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.00318
1
1906
2019-06-02T00:29:05
Question Answering as an Automatic Evaluation Metric for News Article Summarization
[ "cs.CL", "cs.IR" ]
Recent work in the field of automatic summarization and headline generation focuses on maximizing ROUGE scores for various news datasets. We present an alternative, extrinsic, evaluation metric for this task, Answering Performance for Evaluation of Summaries. APES utilizes recent progress in the field of reading-comprehension to quantify the ability of a summary to answer a set of manually created questions regarding central entities in the source article. We first analyze the strength of this metric by comparing it to known manual evaluation metrics. We then present an end-to-end neural abstractive model that maximizes APES, while increasing ROUGE scores to competitive results.
cs.CL
cs
Question Answering as an Automatic Evaluation Metric for News Article Summarization Matan Eyal1, 2, Tal Baumel1, 3, Michael Elhadad1 1Dept. Computer Science, Ben Gurion University {mataney, elhadad}@cs.bgu.ac.il, [email protected] 2IBM Research, Israel, 3Microsoft 9 1 0 2 n u J 2 ] L C . s c [ 1 v 8 1 3 0 0 . 6 0 9 1 : v i X r a Abstract Recent work in the field of automatic sum- marization and headline generation focuses on maximizing ROUGE scores for various news datasets. We present an alternative, extrin- sic, evaluation metric for this task, Answering Performance for Evaluation of Summaries. APES utilizes recent progress in the field of reading-comprehension to quantify the ability of a summary to answer a set of manually cre- ated questions regarding central entities in the source article. We first analyze the strength of this metric by comparing it to known man- ual evaluation metrics. We then present an end-to-end neural abstractive model that maxi- mizes APES, while increasing ROUGE scores to competitive results. Introduction 1 The task of automatic text summarization aims to produce a concise version of a source document while preserving its central information. Current summarization models are divided into two ap- proaches, extractive and abstractive. In extractive summarization, summaries are created by select- ing a collection of key sentences from the source document (e.g., Nallapati et al. (2017); Narayan et al. (2018)). Abstractive summarization, on the other hand, aims to rephrase and compress the in- put text in order to create the summary. Progress in sequence-to-sequence models (Sutskever et al., 2014) has led to recent success in abstractive sum- marization models. Current models (Nallapati et al., 2016; See et al., 2017; Paulus et al., 2017; Celikyilmaz et al., 2018) made various adjust- ments to sequence-to-sequence models to gain im- provements in ROUGE (Lin, 2004) scores. ROUGE has achieved its status as the most common method for summaries evaluation by showing high correlation to manual evaluation methods, e.g., the Pyramid method (Nenkova See et al. (2017)'s Summary: bolton will offer new contracts to emile heskey, 37, eidur gudjohnsen, 36, and adam bogdan, 27. heskey and gudjohnsen joined on short-term deals in december. eidur gudjohnsen has scored five times in the championship . APES score: 0.33 Baseline Model Summary (Encoder / Decoder / Attention / Copy / Coverage): bolton will offer new contracts to emile hes- key, 37, eidur gudjohnsen, 36, and goalkeeper adam bogdan, 27. heskey and gudjohnsen joined on short-term deals in december, and have helped neil lennon 's side steer clear of relegation. ei- dur gudjohnsen has scored five times in the championship, as well as once in the cup this season . APES score: 0.33 Our Model (APES optimization): bolton will offer new con- tracts to emile heskey, 37, eidur gudjohnsen, 36, and goalkeeper adam bogdan, 27. heskey joined on short-term deals in decem- ber, and have helped neil lennon 's side steer clear of relegation. eidur gudjohnsen has scored five times in the championship, as well as once in the cup this season. lennon has also fined mid- fielders barry bannan and neil danns two weeks wages this week. both players have apologised to lennon . APES score: 1.00 Questions from the CNN/Daily Mail Dataset: Q: goalkeeper bogdan Q: dent; A: barry bannan Q: barry bannan and cident; A: neil danns and neil danns both fined by club after drinking inci- also rewarded with new contract; A: adam both fined by club after drinking in- Figure 1: Example 3083 from the test set. et al., 2007). Tasks like TAC AESOP (Owczarzak and Dang, 2011) used ROUGE as a strong base- line and confirmed the correlation of ROUGE with manual evaluation. While it has been shown that ROUGE is corre- lated to Pyramid, Louis and Nenkova (2013) show that this summary level correlation decreases sig- nificantly when only a single reference is given. In contrast to the smaller manually curated DUC datasets used in the past, more recent large-scale summarization and headline generation datasets (CNN/Daily Mail (Hermann et al., 2015), Giga- word (Graff et al., 2003), New York Times (Sand- haus, 2008)) provide only a single reference sum- mary for each source document. In this work, we introduce a new automatic evaluation metric more suitable for such single reference news arti- cle datasets. We define APES, Answering Performance for Evaluation of Summaries, a new metric for au- tomatically evaluating summarization systems by querying summaries with a set of questions central to the input document (see Fig. 1). Reducing the task of summaries evaluation to an extrinsic task such as question answering is in- tuitively appealing. This reduction, however, is ef- fective only under specific settings: (1) Availabil- ity of questions focusing on central information and (2) availability of a reliable question answer- ing (QA) model. Concerning issue 1, questions focusing on salient entities can be available as part of the dataset: the headline generation dataset most used in recent years, the CNN/Daily Mail dataset (Her- mann et al., 2015), was constructed by creating questions about entities that appear in the refer- ence summary. Since the target summary contains salient information from the source document, we consider all entities appearing in the target sum- mary as salient entities. In other cases, salient questions can be generated in an automated man- ner, as we discuss below. Concerning issue 2, we focus on a relatively easy type of questions: given source documents and associated questions, a QA system can be trained over fill-in-the-blank type questions as was shown in Hermann et al. (2015) and Chen et al. (2016). In their work, Chen et al. (2016) achieve 'ceiling performance' for the QA task on the CNN/Daily Mail dataset. We empirically assess in our work whether this performance level (accu- racy of 72.4 and 75.8 over CNN and Daily Mail re- spectively) makes our evaluation scheme feasible and well correlated with manual summary evalua- tion. Given the availability of salient questions and automatic QA systems, we propose APES as an evaluation metric for news article datasets, the most popular summarization genre in recent years. To measure the APES metric of a candidate summary, we run a trained QA system with the summary as input alongside a set of questions as- sociated with the source document. The APES metric for a summarization model is the percent- age of questions that were answered correctly over the whole dataset, as depicted in Fig. 2. We leave Figure 2: Evaluation flow of APES. the task of extending this method to other genres for future work. Our contributions in this work are: (1) We first present APES, a new extrinsic summarization evaluation metric; (2) We show APES strength through an analysis of its correlation with Pyra- mid and Responsiveness manual metrics; (3) we present a new abstractive model which maximizes APES by increasing attention scores of salient entities, while increasing ROUGE to competitive level. We make two software packages avail- able online: (a) An evaluation library which re- ceives the same input as ROUGE and produces both APES and ROUGE scores.1 (b) Our PyTorch (Paszke et al., 2017) based summarizer that opti- mizes APES scores together with trained models.2 2 Related Work 2.1 Evaluation Methods Automatic evaluation metrics of summarization methods can be categorized into either intrinsic or extrinsic metrics. Intrinsic metrics measure a summary's quality by measuring its similarity to a manually produced target gold summary or by inspecting properties of the summary. Exam- ples of such metrics include ROUGE (Lin, 2004), Basic Elements (Hovy et al., 2006) and Pyramid (Nenkova et al., 2007). Alternatively, extrinsic metrics test the ability of a summary to support performing related tasks and compare the perfor- mance of humans or systems when completing a task that requires understanding the source docu- ment (Steinberger and Jezek, 2012). Such extrin- sic tasks may include text categorization, infor- 1www.github.com/mataney/APES 2www.github.com/mataney/APES-optimizer mation retrieval, question answering (Jing et al., 1998) or assessing the relevance of a document to a query (Hobson et al., 2007). ROUGE, or "Recall-Oriented Understudy for Gisting Evaluation" (Lin, 2004), refers to a set of automatic intrinsic metrics for evaluating au- tomatic summaries. ROUGE-N scores a candi- date summary by counting the number of N-gram overlaps between the automatic summary and the reference summaries. Other notable metrics from this family are ROUGE-L, where scores are given by the Longest Common Subsequence (LCS) be- tween the suggested and reference documents, and ROUGE-SU4, which uses skip-bigram, a more flexible method for computing the overlap of bi- grams. The Pyramid method (Nenkova et al., 2007) is a manual evaluation metric that analyzes multiple human-made summaries into "Summary Content Units" (SCUs) and assigns importance weights to each SCU. Different summaries are scored by as- sessing the extent to which they convey SCUs ac- cording to their respective weights. Pyramid is most effective when multiple human-made sum- maries alongside manual intervention to detect SCUs in source and target documents. The Ba- sic Elements method (Hovy et al., 2006), an au- tomated procedure for finding short fragments of content, has been suggested to automate a method related to Pyramid. Like Pyramid, this method requires multiple human-made gold summaries, making this method expensive in time and cost. Responsiveness (Dang, 2005), another manual metric is a measure of overall quality combining both content selection, like Pyramid, and linguis- tic quality. Both Pyramid and Responsiveness are the standard manual approaches for content evalu- ation of summaries. Automated Pyramid evaluation has been at- tempted in the past (Owczarzak, 2009; Yang et al., 2016; Hirao et al., 2018). This task is complex because it requires (1) identifying SCUs in a text, which requires syntactic parsing and the extraction of key subtrees from the identified units, and (2) the clustering of these extracted textual elements into semantically similar SCUs. These two opera- tions are noisy, and the compounded performance summary evaluation is relying on noisy intermedi- ary representation accordingly suffers. Other relevant quantities for summaries qual- ity assessment include: readability (or fluency), grammaticality, coherence and structure, focus, referential clarity, and non-redundancy. Although some automatic methods were suggested as sum- marization evaluation metrics (Vadlapudi and Ka- tragadda, 2010; Tay et al., 2017), these metrics are commonly assessed manually, and, therefore, rarely reported as part of experiments. Our proposed evaluation method, APES, at- tempts to capture the capability of a summary to enable readers to answer questions -- similar to the manual task initially discussed in Jing et al. (1998) and recently reported in Narayan et al. (2018). Our contribution consists of automating this method and assessing the feasibility of the resulting ap- proximation. 2.2 Neural Methods for Abstractive and Extractive Summarization The first paper to use an end-to-end neural network for the summarization task was Rush et al. (2015): this work is based on a sequence-to-sequence model (Sutskever et al., 2014) augmented with an attention mechanism (Bahdanau et al., 2014). Nallapati et al. (2016) was the first to tackle the headline generation problem using the CNN/Daily Mail dataset (Hermann et al., 2015) adopted for the summarization task. See et al. (2017) followed the work of Nallapati et al. (2016) and added an additional loss term to reduce repetitions at decoding time. Paulus et al. (2017) introduces intra-attention in order to attend over both the input and previously generated out- puts. The authors also present a hybrid learning objective designed to maximize ROUGE scores using Reinforcement Learning. All the papers mentioned above have been eval- uated using ROUGE, and all, except for Rush et al. (2015), used CNN/Daily Mail as their main head- line generation dataset. Of all the mentioned mod- els we compare our suggested model only to (See et al., 2017), as it is the only paper to publish out- put summaries. 3 APES Evaluating a summarization system with APES applies the following method: APES receives a set of news articles summaries, question-and-answer pairs referring to central information from the text and an automatic QA system. Then, APES uses this QA system to determine the total number of questions answered correctly according to the re- Original Reference Summary: Arsenal beat Burnley 1-0 in the EPL. a goal from Aaron Ramsey secured all three points. win cuts Chelsea 's EPL lead to four points . Produces questions: Q: Q: @entity0 beat Q: @entity0 beat @entity7 1-0 in the Q: a goal from Q: win cuts Q: win cuts @entity19 's beat @entity7 1-0 in the @entity4; A: Arsenal 1-0 in the @entity4; A: Burnley ; A: EPL secured all three points; A: Aaron Ramsey 's @entity4 lead to four points; A: Chelsea lead to four points; A: EPL Figure 3: Example 202 from the CNN/Daily Mail test set. ceived summaries. The evaluation process is de- picted in Fig. 2. We use Chen et al. (2016)'s model trained on the CNN dataset as our QA system for all our experiments. For a given summarizer and a given dataset, APES reports the average number of questions correctly answered from the summaries produced by the system. This method is especially relevant for the main headline generation dataset used in recent years, the CNN/Daily Mail dataset, as it was initially created for the question answering task by Her- mann et al. (2015). It contains 312,085 articles with relevant questions scraped from the two news agencies' websites. The questions were created by removing different entities from the manually produced highlights to create 1,384,887 fill-in- the-blank questions. The dataset was later repur- posed by Cheng and Lapata (2016) and Nallap- ati et al. (2016) to the summarization task by re- constructing the original highlights from the ques- tions. Fig. 3 shows an example for creating ques- tions out of a given summary. 3.1 Using APES as an Evaluation Metric for any News Datasets When questions are not intrinsically available, one requires to (1) automatically generate relevant questions; (2) use an appropriate automatic QA system. Similarly to the method used in Hermann et al. (2015), we produce fill-in-the-blank questions in the following way: given a reference summary, we find all possible entities, (i.e., Name, Nation- ality, Organization, Geopolitical Entity or Facil- ity) using an NER system (Honnibal and Johnson, 2015) and we create fill-in-the-blank type ques- tions where the answers are these entities. We pro- vide code for this procedure and apply it on the AESOP datasets in our experiments3. For the automatic QA system, we reused in our experiment the same QA system trained on CNN/Daily Mail for different News datasets (in- cluding AESOP). To enable reproducibility, the trained models used are available online. 4 APES on the TAC2011 AESOP Task To evaluate if an automatic metric can accu- rately measure a summarization system perfor- mance, we measure its correlation to manual met- rics. The TAC 2011 Automatically Evaluating Summaries of Peers (AESOP) task (Owczarzak and Dang, 2011) has provided a dataset that in- cludes, alongside the source documents and refer- ence summaries, three manual metrics: Pyramid (Nenkova et al., 2007), Overall Responsiveness (Dang, 2005) and Overall Readability. Two sets of documents are provided, we use only the docu- ments from the first set (Generic summarization), as the second set is relevant to the update summa- rization task. To evaluate APES on the AESOP dataset, we create the required set of questions as presented in Fig. 3. We used the same QA system (Chen et al., 2016) trained on the CNN dataset. This sys- tem is a competent QA system for this dataset, as both AESOP and CNN consist of news articles. Training a QA model on the AESOP dataset would be optimal, but it is not possible due to the small size of this dataset. Nonetheless, even this incom- plete QA system reports valuable results that jus- tify APES value. While the two datasets are similar, they dif- fer dramatically in the type of topics the articles cover. CNN/Daily Mail articles deal with peo- ple, or more generally, Named Entities, averag- ing 6 named entities per summary. In contrast, TAC summaries average 0.87 entities per sum- mary. The TAC dataset is divided into various topics. The first four topics, Accidents and Nat- ural Disasters, Attacks, Health and Safety and En- dangered Resources average 0.65 named entities per summary, making them incomparable to the typical case in the CNN/Daily Mail dataset. The last topic, Investigations and Trials, averages 3.35 named entities per summary, making it more sim- ilar. We report correlation only on this segment of TAC, which contains 204 documents. 3https://github.com/mataney/ APES-on-TAC2011 Pyramid Responsiveness 0.590 0.540 0.599 0.537 ROUGE-1 ROUGE-2 ROUGE-L ROUGE-SU APES 0.608 0.576 0.468* 0.518* 0.563* 0.541 Table 1: Pearson Correlation of ROUGE and APES against Pyramid and Responsiveness on summary level. Sta- tistically significant differences are marked with *. R-1 1.00 R-1 R-2 R-L R-SU APES 0.92 0.82 1.00 R-2 R-L R-SU APES 0.83 0.66 0.61 1.00 0.66 0.67 1.00 0.94 0.90 0.89 1.00 Table 2: Correlation matrix of ROUGE and APES. We follow the work of Louis and Nenkova (2013) and compare input level APES scores with manual Pyramid and Responsiveness scores pro- vided in the AESOP task. Results are in Table 1. In Input level, correlation is computed for each summary against its manual score. In contrast, system level reports the average score for a sum- marization system over the entire dataset. While ROUGE baselines were beaten only by a very small number of suggested metrics in the original AESOP task, we find that APES shows better correlation than the popular R-1, R-2 and R-L, and the strong R-SU. Although showing sta- tistical significance for our hypothesis is difficult because of the small dataset size, we claim APES gives an additional value comparing to ROUGE: ROUGE metrics are highly correlated with each other (around 0.9) as shown in Table 2, indicating that multiple ROUGE metrics provide little addi- tional information. In contrast, APES is not cor- related with ROUGE metrics to the same extent (around 0.6). The above suggests that APES of- fers additional information regarding the text in a manner that ROUGE does not. For this reason, we believe APES complements ROUGE. Louis and Nenkova (2013) further shows that ROUGE correlation to manual scores tends to drop when reducing the number of reference sum- maries. While APES is not immune to this, as the number of questions becomes smaller when the number of reference summaries is reduced, it still performs well when reducing the number of references to a single document. In the AESOP dataset, when comparing with respect to each of the 8 assessors separately on Pyramid and Respon- Model APES #Entities See et al. (2017) Baseline model Gold Summaries 38.2 39.8 85.5 4.90 4.99 6.00 #Salient Entities 2.57 2.61 4.90 Table 3: Average number of entities and salient entities. siveness, the correlation of APES is highest in 7 out of 16 trials, while that of R1 is highest in 6 tri- als and RL in 2 trials. In general, the correlation between any of the metrics and single references is extremely noisy, indicating that reliance on evalu- ations of a single reference, which is standard on large-scale summarization datasets, is far from sat- isfactory. We have established that APES achieves equal or improved correlation with manual metrics when compared to ROUGE, and captures a different type of information than ROUGE, by that, APES can complement ROUGE as an automatic evalua- tion metric. We now turn to develop a model that directly attempts to optimize APES. 5 Model News articles include a high number of named en- tities. When analyzing systems performance on APES (Table 3), a system may fail either when it misses to generate a salient entity in the sum- mary, or when it includes the salient entity, but in a context not relevant to corresponding questions. When this happens, the QA system would not be able to identify the entity as an answer to a ques- tion referring to the context. We compared the average number and type of entities in summaries generated by existing auto- matic summarizers to that in reference summaries. We note that the observed models, while pro- ducing state-of-the-art ROUGE scores and a high number of named entities (5 vs. 6 on average), fail to focus on salient entities when generating a sum- mary (about 2.6 salient entities are mentioned on average vs. 4.9 in the reference summaries). No- tice that solely increasing the number of entities is damaging: mentioning too many entities causes a decrease in the QA accuracy, as the number of possible answers increases, which would distract the QA system. This has motivated us in suggest- ing the following model. 5.1 Baseline Model To experiment with direct optimization of APES, we reconstruct as a starting point a model that encapsulates the key techniques used in recent abstractive summarization models. Our model is based on the OpenNMT project (Klein et al., 2017). All PyTorch (Paszke et al., 2017) code, in- cluding entities attention and beam search refine- ment is available online4. We also include gener- ated summaries and trained models in this reposi- tory. Recent work in the field of abstractive summa- rization (Rush et al., 2015; Nallapati et al., 2016; See et al., 2017; Paulus et al., 2017) share a com- mon architecture as the foundation for their neu- ral models: an encoder-decoder model (Sutskever et al., 2014) with an attention mechanism (Bah- danau et al., 2014). Nallapati et al. (2016) and See et al. (2017) augment this model with a copy mechanism (Vinyals et al., 2015). This architec- ture minimizes the following loss function: losst = − log P (w∗ t ) loss = 1 Ty losst (1) Ty(cid:88) t=0 losst, is the negative log likelihood of generat- ing the gold target word w∗ t at timestep t where P (·) is the probability distribution over the vocab- ulary. We refer the reader to See et al. (2017) for a more detailed description of this architecture. Unlike See et al. (2017), we do not train a spe- cific coverage mechanism to avoid repetitions. In- stead, we incorporate Wu et al. (2016)'s refine- ments of beam search in order to manipulate both the summaries' coverage and their length. In the standard beam search, we search for a sequence Y that maximizes a score function s(Y, X) = log(P (Y X)). Wu et al. (2016) introduce two additional regularization factors, coverage penalty and length penalty. These two penalties, with an additional refinement suggested in Gehrmann et al. (2018), yield the following score function: 4www.github.com/mataney/APES-optimizer s(Y, X) = log(P (Y X))/lp(Y ) − cp(X; Y ) lp(Y ) = (5 + Y )α (5 + 1)α cp(X; Y ) = β(−TX + TX(cid:88) i=1 TY(cid:88) max( ai,j, 1.0)) j=1 (2) where α, β are hyper-parameters that control the length and coverage penalties respectively and ai,j is the attention probability of the j-th target word on the i-th source word. cp(X; Y ), the coverage penalty, is designed to discourage repeated attention to the same source word and favor summaries that cover more of the source document with respect to the attention dis- tribution. lp(Y ), the length normalization, is designed to compare between beam hypotheses of different length accurately. In general, beam search favors shorter outputs as log-probability is added at each step, yielding lower scores for longer sequences. lp compensates for this tendency. In the following section, we describe how we extend this baseline model in order to maximize the APES metric. The new model learns to incor- porate more of the salient entities from the source document in order to optimize its APES metric. 5.2 Entities Attention Layer As we observed, failure to capture salient entities in summaries is one cause for low APES score. To drive our model towards the identification and mention of salient entities from the source docu- ment, we introduce an additional attention layer that learns the important entities of a source docu- ment. We hypothesize that these entities are more likely to appear in the target summary, and thus are better candidate answers to one of the salient questions for this document. We learn for each word in the source document its probability of belonging to a salient entity men- tion. We adopt the classical soft attention mech- anism of Bahdanau et al. (2014): after encoding the source document, we run an additional single alignment model with an empty query and a sig- moid layer instead of the standard softmax layer. j = σ(ee ae j) j = vT tanh(U hj + b) ee (3) Model Source Gold-Summaries Shuffled Gold-Summaries Pointer-generator + coverage (See et al., 2017)∗ Lead 3 Baseline model Our model Our model with gold entities positions APES 61.1 85.5 30.9 45.1 38.2 39.8 46.1 46.3 1 - 100 100 40.1 39.3 39.3 40.2 40.4 ROUGE 2 - 100 7.0 17.3 16.9 17.3 17.7 17.8 L - 100 58.3 36.3 35.7 36.3 37.0 37.3 Table 4: APES: Percent of questions answered correctly using by document. *Obtained from the model uploaded to github.com/abisee/pointer-generator. where U, b, v are learnable weight matrices, hj is the encoder hidden state for the j-th word and σ(·) is a logistic sigmoid function. ae j reflects the prob- ability of the j-th token of being a salient entity. The second modification comparing to Bah- danau et al. (2014) is that we replace the softmax function with a sigmoid: while in the standard alignment model, we intend to obtain a normal- ized probability distribution over all the tokens of the source document, here we would like to get a probability of each token being a salient entity in- dependently of other tokens. In order to drive this attention layer towards salient entities, we define an additional term in the loss function. losse = BCE(ae, s∗) (4) where s∗ is a binary vector of source length size, where s∗ j = 1 if xj is a salient entity, and 0 otherwise, and BCE is the binary cross entropy function. This term is added to the standard log- likelihood loss, changing equation (1) to the fol- lowing composite loss function: loss = δ losse + (1 − δ) 1 Ty losst (5) where δ is a hyper-parameter. We join these two terms in the loss function in order to learn the enti- ties attention layer while keeping the summariza- tion ability learned by Eq. (1). 5.3 Entities Attention and Beam Search After the attention layer has learned the probabil- ity of each source token to belong to a salient en- tity, we pass the predicted alignment to the beam search component at test-time. Using this align- ment data, we wish to encourage beam search to favor hypotheses attending salient entities. Ty(cid:88) t=0 Accordingly, we introduce a new term ep to the beam search score function of equation (2): s(Y, X) = log(P (Y X))/lp(Y ) − cp(X; Y ) − ep(X; Y ) TX(cid:88) i=1 i − TY(cid:88) j=1 ep(X; Y ) = γ max(ae ai,j, 0.0) (6) ep(X; Y ) penalizes summaries that do not at- tend parts of the source document we believe are central. Fig. 4 compares summaries produced by this model and the baseline model by showing their respective attention distribution and the impact on the decision of which words to include in the sum- mary based on the attention level derived from salient entities. 6 Results We report our results in Table 4. For each sys- tem, we present its APES score alongside its F1 scores for ROUGE-1, ROUGE-2 and ROUGE-L, computed using pyrouge 5. We first report APES results on full source doc- uments and gold summaries, in order to assess the capabilities of the QA system used for APES. A simple answer extractor could answer 100% of the questions given the gold-summaries. But the QA system is trained over the source documents and learns to generalize and not "just" extract the an- swer. Answering questions from the full docu- ments is indeed more difficult than from the gold- summaries because the QA system must locate the answer among multiple distractors. While gold- summaries present a very high APES score, the 5https://pypi.org/project/pyrouge/ Source document: jack wilshere may rub shoulders with the likes of alexis sanchez and mesut ozil on a daily basis but he was left starstruck on thursday evening when he met brazil legend pele . even better for wilshere , the arsenal midfielder was given the opportunity to interview the three-time world cup winner during the launch party of 10ten talent . both wilshere and pele , along with glenn hoddle , are clients and the england international made sure his fans on twitter knew about their meeting by posting several tweets . brazil legend pele -lrb- left -rrb- and arsenal midfielder jack wilshere pose for a photo during launch of 10ten talent . wilshere was given the ' honour to interview the legendary pele and asked twitter questions from fans . earlier on thursday , wilshere tweeted : ' looking forward to meeting @pele tonight . i ll be asking the best questions you sent . #jackmeetspele included photos . of the 23-year-old then followed this up with several tweets about the event , many of which pele . meanwhile , pele has acknowledged that last year s world cup was a in ' disaster the barclays for brazil but is not surprised how quickly the likes of oscar and ramires have bounced back premier league this season . brazil were humiliated by germany in a 7-1 semi-final defeat and the hosts were then thrashed 3-0 by holland in the third-place play-off . pele scored 77 goals in 92 games for brazil and won the world cup three times but the former santos striker still finds last year s capitulation difficult to . understand Target Summary: jack wilshere was joined by former england manager glenn hoddle. the arsenal midfielder interviewed pele at launch of 10ten talent. pele scored 77 goals in 92 games for brazil and won three world cups. the brazil legend says the 2014 world cup performance was not expected. the hosts were humiliated 7-1 by germany in the semi-finals last summer. pele is, however, not surprised by reaction of oscar and ramires this year. Baseline Model Prediction: jack wilshere was given the opportunity to interview the three-time world cup winner. both wilshere and pele are clients and the england international. pele has acknowledged that last year's world cup was a 'disaster' Our Model Prediction: jack wilshere was given the 'honour to interview the legendary pele' and asked twitter questions from fans. pele has acknowledged that last year's world cup was a 'disaster' for brazil but is not surprised how quickly the likes of oscar and ramires have bounced back in the premier league this season. the brazil legend scored 77 goals in 92 games for brazil and won the world cup three times. Figure 4: Example 4134 from the CNN/Daily Mail test set. Colors and underlines in the source reflect differences between baseline and our model attention weights: Red and a single underline reflects words attended by baseline model and not our model, Green and double underline reflects the opposite. Entities in bold in the target summary are answers to the example questions. score reported for the source documents (61.1%) is a realistic upper bound for APES. The scores on the validation set are 46.6, 41.2, 18.4, 38.1 for APES, R1, R2, RL respectively. We then present shuffled gold-summaries, where we randomly shuffled the location of each unigram in the gold summary. This score shows that even when all salient entities are in the shuf- fled text, APES is sensitive to the loss of coher- ence, readability and meaning. This confirms that APES does not only match the presence of enti- ties. In contrast, ROUGE-1 fails to punish such incoherent sequences. Finally, we report ROUGE and APES for the strong Lead 3 sentences of the source document - a baseline known to beat most existing abstractive methods. We then present APES and ROUGE scores for abstractive models, See et al. (2017)'s model, our baseline model and our APES-optimized model. Our model achieves significantly higher APES scores (46.1 vs. 39.8) and improves all ROUGE metrics (by about 1 F-point over the baselines). While our objective is maximizing APES score, our model also increases its corresponding ROUGE scores. Unlike Paulus et al. (2017) where the authors suggested a Reinforcement Learning based model to optimize ROUGE specifically, we optimize for APES and gain better ROUGE score. We finally report the results obtained by our model when gold salient entities positions are given as oracle inputs instead of the predicted ae scores. The corresponding score (46.3 vs. 46.1) is only slightly above the score obtained by our model. This indicates that the component of our model predicting entity saliency is good enough to drive summarization. We carried out an informal error analysis to ex- amine why some summaries perform worse than others with our architecture. We compared sum- maries that produce perfect APES score (1,630 out of 11,490 total) to the summaries with zero APES score (1,691). We measure the density of salient named entities in the source document: #(salient entity mentions)/#(distinct salient entities). This density in the case of perfect APES summaries is much higher than that for low APES summaries (4.9 vs. 3.6). This observation suggests that we fail to produce higher APES scores when the salient entities aren't marked through sheer repeti- tion. 7 Conclusion We introduced APES, a new automatic sum- marization evaluation metric for news articles datasets based on the ability of a summary to an- swer questions regarding salient information from the text. This approach is useful in domains with source documents of about 1k words that focus on named entities - such as news articles, where named entities are effectively aligned with Pyra- mid SCUs. In other non-news domains, and longer documents, other methods for generating ques- tions should be designed. We compare APES to manual evaluation metrics on the TAC 2011 AE- SOP task and confirm its value as a complement to ROUGE. We introduce a new abstractive model that opti- mizes APES scores on the CNN/Daily Mail dataset by attending salient entities from the input doc- ument, which also provides competitive ROUGE scores. Acknowledgements This research was supported by the Lynn and William Frankel Centre for Computer Science at Ben-Gurion University. References Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Ben- gio. 2014. Neural machine translation by jointly arXiv preprint learning to align and translate. arXiv:1409.0473. Asli Celikyilmaz, Antoine Bosselut, Xiaodong He, and Yejin Choi. 2018. Deep communicating agents arXiv preprint for abstractive summarization. arXiv:1803.10357. Jianpeng Cheng and Mirella Lapata. 2016. Neural summarization by extracting sentences and words. arXiv preprint arXiv:1603.07252. Hoa Trang Dang. 2005. Overview of duc 2005. In Pro- ceedings of the document understanding conference, volume 2005, pages 1 -- 12. 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. Sebastian Gehrmann, Yuntian Deng, and Alexander M Rush. 2018. Bottom-up abstractive summarization. arXiv preprint arXiv:1808.10792. David Graff, Junbo Kong, Ke Chen, and Kazuaki Maeda. 2003. English gigaword. Linguistic Data Consortium, Philadelphia, 4:1. 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 1693 -- 1701. Tsutomu Hirao, Hidetaka Kamigaito, and Masaaki Na- gata. 2018. Automatic pyramid evaluation exploit- ing edu-based extractive reference summaries. In EMNLP. Stacy President Hobson, Bonnie J Dorr, Christof Monz, and Richard Schwartz. 2007. Task-based evalu- ation of text summarization using relevance pre- Information Processing & Management, diction. 43(6):1482 -- 1499. Matthew Honnibal and Mark Johnson. 2015. An im- proved non-monotonic transition system for depen- In Proceedings of the 2015 Con- dency parsing. ference on Empirical Methods in Natural Language Processing, pages 1373 -- 1378, Lisbon, Portugal. As- sociation for Computational Linguistics. Eduard Hovy, Chin-Yew Lin, Liang Zhou, and Junichi Fukumoto. 2006. Automated summarization eval- In Proceedings of the uation with basic elements. Fifth Conference on Language Resources and Eval- uation (LREC 2006), pages 604 -- 611. Citeseer. Hongyan Jing, Regina Barzilay, Kathleen McKeown, and Michael Elhadad. 1998. Summarization evalu- ation methods: Experiments and analysis. In AAAI symposium on intelligent summarization, pages 51 -- 59. Guillaume Klein, Yoon Kim, Yuntian Deng, Jean Senellart, and Alexander M. Rush. 2017. Open- NMT: Open-source toolkit for neural machine trans- lation. In Proc. ACL. Danqi Chen, Jason Bolton, and Christopher D Man- ning. 2016. the cnn/daily mail reading comprehension task. arXiv preprint arXiv:1606.02858. A thorough examination of Chin-Yew Lin. 2004. Rouge: A package for auto- matic evaluation of summaries. In Text summariza- tion branches out: Proceedings of the ACL-04 work- shop, volume 8. Barcelona, Spain. Annie Louis and Ani Nenkova. 2013. Automatically assessing machine summary content without a gold standard. Computational Linguistics, 39(2):267 -- 300. 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. Ramesh Nallapati, Feifei Zhai, and Bowen Zhou. 2017. Summarunner: A recurrent neural network based se- quence model for extractive summarization of docu- ments. hiP (yi= 1 -- hi, si, d), 1:1. Ramesh Nallapati, Bowen Zhou, Caglar Gulcehre, Bing Xiang, et al. 2016. Abstractive text summa- rization using sequence-to-sequence rnns and be- yond. arXiv preprint arXiv:1602.06023. Shashi Narayan, Shay B Cohen, and Mirella Lapata. 2018. Ranking sentences for extractive summariza- arXiv preprint tion with reinforcement learning. arXiv:1802.08636. Ani Nenkova, Rebecca Passonneau, and Kathleen McKeown. 2007. The pyramid method: Incorpo- rating human content selection variation in summa- rization evaluation. ACM Transactions on Speech and Language Processing (TSLP), 4(2):4. Karolina Owczarzak. 2009. Dependency-based summaries. In ACL/IJCNLP. evaluation Depeval(summ): for automatic Karolina Owczarzak and Hoa Trang Dang. 2011. Overview of the tac 2011 summarization track: Guided task and aesop task. In Proceedings of the Text Analysis Conference (TAC 2011), Gaithersburg, Maryland, USA, November. 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. In NIPS-W. Romain Paulus, Caiming Xiong, and Richard Socher. 2017. A deep reinforced model for abstractive sum- marization. arXiv preprint arXiv:1705.04304. Alexander M Rush, Sumit Chopra, and Jason We- A neural attention model for ab- arXiv preprint ston. 2015. stractive sentence summarization. arXiv:1509.00685. Evan Sandhaus. 2008. The new york times annotated corpus. Linguistic Data Consortium, Philadelphia, 6(12):e26752. Abigail See, Peter J Liu, and Christopher D Man- to the point: Summarization arXiv preprint ning. 2017. Get with pointer-generator networks. arXiv:1704.04368. Josef Steinberger and Karel Jezek. 2012. Evaluation measures for text summarization. Computing and Informatics, 28(2):251 -- 275. Yi Tay, Minh C Phan, Luu Anh Tuan, and Siu Cheung Hui. 2017. Skipflow: Incorporating neural coher- ence features for end-to-end automatic text scoring. arXiv preprint arXiv:1711.04981. Ravikiran Vadlapudi and Rahul Katragadda. 2010. On automated evaluation of readability of summaries: Capturing grammaticality, focus, structure and co- In Proceedings of the NAACL HLT 2010 herence. student research workshop, pages 7 -- 12. Association for Computational Linguistics. Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. 2015. Pointer networks. In Advances in Neural In- formation Processing Systems, pages 2692 -- 2700. 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. Qian Yang, Rebecca J. Passonneau, and Gerard de Melo. 2016. Peak: Pyramid evaluation via au- tomated knowledge extraction. In AAAI. A Experiment Settings For our experiments, we used a bidirectional LSTM encoder with 256-dimensional hidden states for each direction, an LSTM decoder with 512-dimensional hidden states and 128- dimensional embeddings for a 50k shared- vocabulary words. We do not use pretrained word embeddings. We use the Adagrad (Duchi et al., 2011) opti- mizer with a starting learning rate of 0.15 and gra- dient clipping with a maximum gradient norm of 2. At train-time source and target documents are truncated to 400 and 100 tokens respectively. Af- ter training our baseline model for 20 epochs, we fine-tune the network with Eq. (5) loss for an ad- ditional 5 epochs starting again with 0.15 as initial learning rate. Results reported in this paper corre- spond to λ = 0.01. At test-time, we do not truncate the source doc- uments enabling the network to attend overall in- put text. We use Eq. (6) as the beam search score function, penalizing using cp(X; Y ) every single decoding step and lp(Y ) and ep(X; Y ) only when all hypotheses are done. We choose α, β, γ val- ues of 0.9, 0.5, 0.5 respectively for our model. We also used Paulus et al. (2017) suggestion of rep- etition avoidance by blocking trigrams appearing more than once at inference time. Running APES evaluation on a generated test set (of size 11,490 summaries) takes about 40 min- utes using a single process.
1912.00862
1
1912
2019-11-25T11:23:04
ICD Coding from Clinical Text Using Multi-Filter Residual Convolutional Neural Network
[ "cs.CL", "cs.LG" ]
Automated ICD coding, which assigns the International Classification of Disease codes to patient visits, has attracted much research attention since it can save time and labor for billing. The previous state-of-the-art model utilized one convolutional layer to build document representations for predicting ICD codes. However, the lengths and grammar of text fragments, which are closely related to ICD coding, vary a lot in different documents. Therefore, a flat and fixed-length convolutional architecture may not be capable of learning good document representations. In this paper, we proposed a Multi-Filter Residual Convolutional Neural Network (MultiResCNN) for ICD coding. The innovations of our model are two-folds: it utilizes a multi-filter convolutional layer to capture various text patterns with different lengths and a residual convolutional layer to enlarge the receptive field. We evaluated the effectiveness of our model on the widely-used MIMIC dataset. On the full code set of MIMIC-III, our model outperformed the state-of-the-art model in 4 out of 6 evaluation metrics. On the top-50 code set of MIMIC-III and the full code set of MIMIC-II, our model outperformed all the existing and state-of-the-art models in all evaluation metrics. The code is available at https://github.com/foxlf823/Multi-Filter-Residual-Convolutional-Neural-Network.
cs.CL
cs
ICD Coding from Clinical Text Using Multi-Filter Residual Convolutional Neural Network Fei Li,1 Hong Yu1,2,3,4 2Center for Healthcare Organization and Implementation Research, Bedford Veterans Affairs Medical Center, Bedford, MA, United States 1Department of Computer Science, University of Massachusetts Lowell, Lowell, MA, United States 3Department of Medicine, University of Massachusetts Medical School, Worcester, MA, United States 4School of Computer Science, University of Massachusetts, Amherst, MA, United States fei li, hong [email protected] 9 1 0 2 v o N 5 2 ] L C . s c [ 1 v 2 6 8 0 0 . 2 1 9 1 : v i X r a Abstract Automated ICD coding, which assigns the International Clas- sification of Disease codes to patient visits, has attracted much research attention since it can save time and labor for billing. The previous state-of-the-art model utilized one con- volutional layer to build document representations for pre- dicting ICD codes. However, the lengths and grammar of text fragments, which are closely related to ICD coding, vary a lot in different documents. Therefore, a flat and fixed-length convolutional architecture may not be capable of learning good document representations. In this paper, we proposed a Multi-Filter Residual Convolutional Neural Network (Mul- tiResCNN) for ICD coding. The innovations of our model are two-folds: it utilizes a multi-filter convolutional layer to capture various text patterns with different lengths and a residual convolutional layer to enlarge the receptive field. We evaluated the effectiveness of our model on the widely-used MIMIC dataset. On the full code set of MIMIC-III, our model outperformed the state-of-the-art model in 4 out of 6 evalua- tion metrics. On the top-50 code set of MIMIC-III and the full code set of MIMIC-II, our model outperformed all the exist- ing and state-of-the-art models in all evaluation metrics. The code is available at https://github.com/foxlf823/Multi-Filter- Residual-Convolutional-Neural-Network. Introduction The International Classification of Diseases (ICD), which is organized by the World Health Organization, is a com- mon coding method used in various healthcare systems such as hospitals. It includes many pre-defined ICD codes which can be assigned to patients' files such as electronic health records (EHRs). These codes represent diagnostic and procedural information during patient visits. Healthcare providers and insurance companies need these information to diagnose patients and bill for services (Bottle and Aylin 2008). However, manual ICD coding has been demonstrated to be labor-consuming and costly (O'malley et al. 2005). The research community has investigated a number of ap- proaches for automated ICD coding, including the models based on both traditional machine learning (Perotte et al. 2013; Kavuluru, Rios, and Lu 2015) and deep learning (Shi Copyright c(cid:13) 2020, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. Table 1: Examples of clinical text fragments and their corre- sponding ICD codes. 998.32: Disruption of external operation wound ... wound infection, and wound breakdown ... 428.0: Congestive heart failure ... DIAGNOSES: 1. Acute congestive heart failure 2. Diabetes mellitus 3. Pulmonary edema ... 202.8: Other malignant lymphomas ... a 55 year-old female with non Hodgkin's lymphoma and acquired C1 esterase inhibitor deficiency ... 770.6: Transitory tachypnea of newborn ... Chest x-ray was consistent with transient tachypnea of the newborn ... 424.1: Aortic valve disorders ... mild aortic stenosis with an aortic valve area of 1.9 cm squared and 2+ aortic insufficiency ... et al. 2017; Xie and Xing 2018). In terms of data, prior work utilized different domains of data such as radiology reports (Pestian et al. 2007) and death certificates (Koopman et al. 2015), and different modal data such as structured (Perotte et al. 2013) and unstructured text (Scheurwegs et al. 2017). Moreover, some previous work adopted full ICD codes to perform this task (Baumel et al. 2018) while other work adopted partial codes (Xu et al. 2018). Due to such situa- tion, it is difficult to directly compare different work. In this paper, we followed the line of predicting ICD codes from un- structured text of the MIMIC dataset (Johnson et al. 2016), because it is widely studied and publicly available. The state-of-the-art model for this line of work is the com- bination of the convolutional neural network (CNN) and the attention mechanism (Mullenbach et al. 2018). However, this model only contains one convolutional layer to build document representations for subsequent layers to predict ICD codes. As shown in Table 1, ICD-related text spans and patterns vary in different examples. Therefore, it may not be sufficient to learn decent document representations from a flat and fixed-length convolutional architecture. In this paper, we proposed a Multi-Filter Residual Convolutional Neural Network (MultiResCNN) for ICD coding using clinical discharge summaries. Our Mul- tiResCNN model is composed of five layers: the input layer leverages word embeddings pre-trained by word2vec (Mikolov et al. 2013); the multi-filter convolutional layer consists of multiple convolutional filters (Kim 2014); the residual convolutional layer contains multiple residual blocks (He et al. 2016); the attention layer keeps the inter- pretability for the model following (Mullenbach et al. 2018); the output layer utilizes the sigmoid function to predict the probability of each ICD code. Our main contribution is that we proposed a novel CNN architecture that combines the multi-filter CNN (Kim 2014) and residual CNN (He et al. 2016). The advantages are two-folds: MultiResCNN not only captures various text pat- terns with different lengths via the multi-filter CNN, but also enlarges the receptive field1 (Garcia and Delakis 2004) via the residual CNN. Thus, our model can benefit from rich patterns, the large receptive field and deep architec- ture. Such method has achieved great success in natural lan- guage processing (Vaswani et al. 2017) and computer vision (Krizhevsky, Sutskever, and Hinton 2012). To evaluate our model, we employed the MIMIC dataset (Johnson et al. 2016) which has been widely used for au- tomated ICD coding. Compared with 5 existing and state- of-the-art models (Perotte et al. 2013; Prakash et al. 2017; Shi et al. 2017; Baumel et al. 2018; Mullenbach et al. 2018), our model outperformed them in nearly all the evaluation metrics (i.e., macro- and micro-AUC, macro- and micro- F1, precision at K). Concretely, in the MIMIC-III experi- ment using full codes, our model outperformed these mod- els in macro-AUC, micro-F1 and precision at 8 and 15. In the MIMIC-III experiment using top-50 codes and the MIMIC-II experiment using full codes, our model outper- formed these models in all evaluation metrics. Moreover, hyper-parameter tuning experiments show that the multi- filter and residual convolutional layers help our model to improve its performance significantly. Related Work To the best of our knowledge, the earliest work of automated ICD coding was proposed by Larkey and Croft (1996). They combined three classifiers, K-nearest-neighbor, relevance feedback and Bayesian independence, to assign ICD9 codes to inpatient discharge summaries. However, their method only assigns one code to each discharge summary. Pestian et al. (2007) organized a shared task of assigning ICD-9 codes to radiology reports and their task requires models to assign a large set of codes to each report. Early work usually used supervised machine learning approaches for ICD coding. Perotte et al. (2013) lever- aged "flat" and "hierarchical" Support Vector Machines (SVMs) for automatically assigning ICD9 codes to the dis- charge summaries of the MIMIC-II repository (Johnson et al. 2016). Their results show that the hierarchical SVM performs better than the flat one. Kavuluru et al. (2015) used the unstructured text in 71,463 EMRs, which come from the University of Kentucky Medical Center, to evalu- ate supervised learning approaches such as multi-label clas- 1http://cs231n.github.io/convolutional-networks/ sification and learning to rank for the ICD9 code assign- ment. Koopman et al. (2015) employed the SVM to identify cancer-related causes of death from 447,336 death certifi- cates. Their model is cascaded: the first one identified the presence of cancer and the second identified the type of can- cer according to the ICD-10 classification system. Scheur- wegs et al. (2017) evaluated coverage-based feature selec- tion methods and Random Forests on seven medical special- ties for ICD9 code prediction and two for ICD10, incorpo- rating structured and unstructured text. With the development of deep learning, researchers also explored neural networks for this task. Shi et al. (2017) uti- lized the long short-term memory (LSTM) and attention mechanism for automated ICD coding from diagnosis de- scriptions. Xie and Xing (2018) also adopted the LSTM but they introduced the tree structure and adversarial learning to utilize code descriptions. Prakash et al. (2017) exploited condensed memory neural networks and evaluated it on the free-text medical notes of the MIMIC-III dataset. Baumel et al. (2018) proposed a hierarchical gated recurrent unit (GRU) network, which encodes sentences and documents with two stacked layers, to assign multiple ICD codes to discharge summaries of the MIMIC II and III datasets. Mul- lenbach et al. (2018) incorporated the convolutional neural network (CNN) with per-label attention mechanism. Their model achieved the state-of-the-art performance among the work using only unstructured text of the MIMIC dataset. Xu et al. (2018) built a hybrid system that includes the CNN, LSTM and decision tree to predict ICD codes from unstruc- tured, semi-structured and structured tabular data. In addi- tion, Lipton et al. (2015) utilized LSTMs to predict diagnos- tic codes from time series of clinical measurements, while our work focuses on text data. Method In this section, we will introduce our Multi-filter Residual Convolutional Neural Network (MultiResCNN), whose ar- chitecture is shown in Figure 1. Throughout this paper, we employed the following notation rules: matrices are written as italic uppercase letters (e.g., X); vectors and scalars are written as italic lowercase letters (e.g., x). Input Layer Our model leverages a word sequence w = {w1, w2, ..., wn} as input, where n denotes the sequence length. Assuming that E denotes the word embedding matrix, which is pre- trained via word2vec (Mikolov et al. 2013) from the raw text of the dataset. A word wn will correspond to a vector en by looking up E. Therefore, the input will be a matrix E = {e1, e2, ..., en} ∈ Rn×de. Multi-Filter Convolutional Layer To capture the patterns with different lengths, we leveraged the multi-filter convolutional neural network (Kim 2014), where each filter has a different kernel size (i.e., word win- dow size). Assuming we have m filters f1, f2, ..., fm and their kernel sizes denote as k1, k2, ..., km. Therefore, m 1- Figure 2: The architecture of a 1-dimensional convolution filter fm. "⊕" represents the concatenation operation and "⊗" represents the matrix multiplication. Figure 1: The architecture of our MultiResCNN model. "Conv1d" represents the 1-dimensional convolution, "Res- Block" represents the residual block, "⊕" represents the concatenation operation and "⊗" represents the matrix mul- tiplication. Here we use orange and green for U and W to denote they are learnable parameters, and to distinguish with other matrices (e.g., H) which are not parameters. dimensional convolutions can be applied to the input matrix E. The convolutional procedure can be formalized as: H1 = f1(E) = tanh(W T 1 Ej:j+k1−1), Figure 3: The architecture of a residual block rmi. "+" rep- resents the element-wise addition. n(cid:94) n(cid:94) j=1 Hm = fm(E) = n(cid:86) where ... mEj:j+km−1), tanh(W T (1) Residual Convolutional Layer j=1 indicates the convolutional operations from left j=1 to right. Here we forced the row number n of the output H1 or Hm ∈ Rn×df to be the same as that of the input E, because we aimed to keep the sequence length unchanged after convolution. It is simple to implement such goal, e.g., setting the kernel size, padding and stride as k, f loor(k/2) and 1. df indicates the out-channel size of a filter and every filter has the same output size. Moreover, Ej:j+k1−1 ∈ Rk1×de and Ej:j+km−1 ∈ Rkm×de indicate the sub-matrices of E, starting from the j-th row and ending at the j + k1 − 1 or j + km − 1 row. W1 ∈ R(k1×de)×df and Wm ∈ R(km×de)×df indicate the weight matrices of corresponding filters. Throughout this paper, the biases of all layers are ignored for conciseness. The overview of a 1-dimensional convolution filter fm is shown in Figure 2. On top of each filter in the multi-filter convolutional layer, there is a residual convolutional layer which consists of p residual blocks (He et al. 2016). Take the m-th filter as an example, the computational procedure of its corresponding residual blocks rm1, rm2, ..., rmp can be formalized as: 1: X = Hm 2: for i = 1 to p do 3: Hmi = rmi(X) 4: X = Hmi 5: return Hmp For the residual block rmi (Figure 3), it consists of three convolutional filters, namely rmi1, rmi2 and rmi3. The com- putational procedure can be denoted as: ⨁"#"$Conv1d f1ResBlock r11%&'(…………………⊗⊗⊗Conv1d fmResBlock rm1ResBlock rmpResBlock r1pBCELoss Sigmoid Pooling *+#+,+#-+,-+Softmax .!"!#…$%&!'!()!()*"…+&$":()$':()*"⊗⊗⨁……/01ℎ/01ℎ/01ℎ!"#ℎ%Conv1d rmi&'()Conv1d rmi&'(*Conv1d rmi&'(++!"#ℎ-'( X1 = rmi1(X) = n(cid:94) j=1 X2 = rmi2(X1) = W T mi2 n(cid:94) j=1 X3 = rmi3(X) = tanh(W T mi1 X j:j+km−1), n(cid:94) X j:j+km−1 1 , (2) W T mi3 X j:j, j=1 Hmi = tanh(X2 + X3), n(cid:86) j=1 ∈ R(km×di−1)×di, Wmi2 where indicates the convolutional operations. X denotes the input matrix of this residual block and X j:j+km−1 ∈ Rkm×di−1 indicate the sub-matrices of X, starting from the j-th row and ending at the j + km − 1 row. Hmi ∈ Rn×di denotes the output matrix of the residual block. di−1 and di denote the in-channel and out-channel sizes of this resid- ual block. Therefore, the in-channel size of the first residual block rm1 should be df and the out-channel size of the last residual block rmp is defined as dp. Similar with the multi- filter convolutional layer, we let the row numbers of Hmi as well as X1, X2 and X3 ∈ Rn×di be n, which is identical to that of the input X. ∈ Moreover, Wmi1 R(km×di)×di and Wmi3 ∈ R(1×di−1)×di denote the weight matrices of the three convolutional filters, rmi1, rmi2 and rmi3. Thereinto, rmi1 and rmi2 have the same kernel size km with the corresponding filter fm in the multi-filter convolutional layer, but they have different in-channel sizes. rmi3 is a special convolutional filter whose kernel size is 1. Because the m-th filter fm in the multi-filter con- volutional layer blocks layer, rm1, rm2, ..., rmp we employed the output Hmp ∈ Rn×dp of the p-th residual block rmp as the output of these residual blocks. Since there are totally m filters in the multi-filter convolutional layer, the final output of the residual convolutional layer is a concatenation of the output of m residual blocks, namely H = H1p ⊕ H2p...Hmp ∈ Rn×(m×dp). Attention Layer Following Mullenbach et al. (2018), we employed the per- label attention mechanism to make each ICD code attend to different parts of the document representation H. The atten- tion layer is formalized as: corresponds to p residual in the residual convolutional A = sof tmax(HU ), V = AT H, (3) where U ∈ R(m×dp)×l represents the parameter matrix of the attention layer, A ∈ Rn×l represents the attention weights for each pair of an ICD code and a word, V ∈ Rl×(m×dp) represents the output of the attention layer. Here l denotes the number of ICD codes. Output Layer In the output layer, V is first fed into a linear layer followed by the sum-pooling operation to obtain the score vector y for all ICD codes, and then the probability vector y is cal- culated from y by the sigmoid function. This process can be formalized as: Y = V W, where Y ∈ Rl×l, l(cid:88) y = pooling(Y ), where yi = Yij, (4) j=1 y = sigmoid(y), where W ∈ R(m×dp)×l is the weight matrix of the out- put layer. For training, we treated the ICD coding task as a multi-label classification problem following previous work (McCallum 1999; Mullenbach et al. 2018). The training ob- jective is to minimize the binary cross entropy loss between the prediction y and the target y: L(w, y, θ) = − l(cid:88) yjlog(yj) + (1 − yj)log(1 − yj), (5) j=1 where w denotes the input word sequence and θ denotes all the parameters. We utilized the back-propagation algo- rithm and Adam optimizer (Kingma and Ba 2014) to train our model. Experiments Datasets MIMIC-III In this paper, we employed the third version of Medical Information Mart for Intensive Care (MIMIC- III) (Johnson et al. 2016) as the first dataset to evaluate our models. Following Mullenbach et al. (2018), we used discharge summaries, split them by patient IDs, and con- ducted experiments using the full codes as well as the top- 50 most frequent codes. Finally, the MIMIC-III dataset us- ing 8,921 ICD-9 codes consists of 47,719, 1,631 and 3,372 discharge summaries for training, development and testing respectively. The dataset using top-50 codes has 8,067 dis- charge summaries for training, 1,574 for development, and 1,730 for testing. MIMIC-II Besides the MIMIC-III dataset, we also lever- aged the MIMIC-II dataset to compare our models with the ones in previous work (Perotte et al. 2013; Mullenbach et al. 2018; Baumel et al. 2018). Follow their experimental set- ting, there are 20,533 and 2,282 clinical notes for training and testing, and 5,031 unique ICD-9 codes in the dataset. Preprocessing Following previous work (Mullenbach et al. 2018), the text was tokenized, and each token were trans- formed into its lowercase. The tokens that contain no alpha- betic characters were removed such as numbers and punc- tuations. The maximum length of a token sequence is 2,500 and the one that exceeds this length will be truncated. We Table 2: Performance comparisons using different configurations in the multi-filter and residual convolutional layers. k denotes the kernel sizes k1, k2, ..., km and p denotes the residual block number. Model CNN MultiCNN ResCNN MultiResCNN k=3,5,9,15,19,25 p=1 Config k=9 k=5,9,15 k=3,5,9,15,19 k=3,5,9,15,19,25 p=1 p=2 p=3 MIMIC-III, full codes P@8 Micro-F1 Macro-F1 0.706 0.731 0.735 0.736 0.714 0.713 0.710 0.741 0.508 0.534 0.542 0.545 0.532 0.532 0.529 0.561 0.053 0.061 0.067 0.068 0.063 0.059 0.059 0.073 MIMIC-III, top-50 codes P@5 Micro-F1 Macro-F1 0.590 0.616 0.630 0.633 0.618 0.589 0.575 0.638 0.592 0.633 0.646 0.652 0.645 0.601 0.585 0.673 0.519 0.556 0.576 0.584 0.560 0.531 0.500 0.608 utilized the scripts2 provided by Mullenbach et al. (2018) for preprocessing. Evaluation Metrics To compare with previous work, we utilized different evalu- ation metrics in different experiments. In the MIMIC-III ex- periment using full ICD codes, we utilized macro-averaged and micro-averaged AUC (area under the ROC, i.e., re- ceiver operating characteristic curve), macro-averaged and micro-averaged F1, precision at 8 (P@8) and precision at 15 (P@15). When computing macro-averaged AUC or F1, we first computed the performance for each label and then av- eraged them. When computing micro-averaged AUC or F1, we considered every pair of a clinical note and a code as an independent prediction. The precision at K (P@K) indicates the proportion of the correctly-predicted labels in the top-K predicted labels. In the MIMIC-III experiment using the top-50 ICD codes, we employed the P@5 besides macro-averaged and micro- averaged AUC, macro-averaged and micro-averaged F1. In the MIMIC-II experiment using full codes, we employed the same evaluation metrics except that P@5 was changed to P@8. Hyper-parameter Tuning Since our model has a number of hyper-parameters, it is in- feasible to search optimal values for all hyper-parameters. Therefore, some hyper-parameter values were chosen em- pirically or following prior work (Mullenbach et al. 2018). The word embedding size de is 100, the out-channel size df of a filter in the multi-filter convolutional layer is 100, the learning rate is 0.0001, the batch size is 16 and the dropout rate is 0.2. To explore a better configuration for the filter number m and the kernel sizes k1, k2, ..., km in the multi-filter convo- lutional layer, and the residual block number p in the resid- ual convolutional layer, we conducted the following experi- ments. First, we developed three variations: • CNN, which only has one convolutional filter and is equivalent to the CAML model (Mullenbach et al. 2018). 2https://github.com/jamesmullenbach/caml-mimic • MultiCNN, which only has the multi-filter convolutional layer. • ResCNN, which only has the residual convolutional layer. Then we tried several configurations for these models on the development set of MIMIC-III using the full and top-50 code settings. The experimental results are shown in Table 2. For each configuration, we tried three runs by initializing the model parameters randomly. The results shown in the table are the means of three runs. We selected such kernel sizes since they do not only capture various text patterns from different granularities, but also keeps the sequence length unchanged after convolution (e.g., setting the padding and stride sizes as floor(k/2) and 1). In addition, we pre-defined the in-channel and out-channel sizes of residual blocks em- pirically: • p=1: d0=100, d1=50 • p=2: d0=100, d1=100, d2=50 • p=3: d0=100, d1=150, d2=100, d3=50 As shown in Table 2, MultiCNN performs better than CNN. As the kernel number increases, the performance in- creases consistently in both full and top-50 code settings. The performance reaches a peak when the kernel sizes are 3,5,9,15,19,25. Moreover, ResCNN also performs bet- ter than CNN, but the difference is that the performances deteriorate as the residual block number increases. ResCNN achieves the best performance when the residual block num- ber is 1. Therefore, we applied the best configuration of Mul- tiCNN and ResCNN to MultiResCNN. The results show that the performance of MultiResCNN was further improved af- ter combining MultiCNN and ResCNN. Therefore, we kept such configuration in other experiments. Baselines CAML & DR-CAML The Convolutional Attention net- work for Multi-Label classification (CAML) was proposed by Mullenbach et al. (2018). It has achieved the state-of-the- art results on the MIMIC-III and MIMIC-II datasets among the models using unstructured text. It consists of one convo- lutional layer and one attention layer to generate label-aware features for multi-label classification (McCallum 1999). The Table 3: MIMIC-III results (full codes). The results of MultiResCNN are shown in means ± standard deviations. Model CAML (Mullenbach et al. 2018) DR-CAML (Mullenbach et al. 2018) MultiResCNN F1 AUC P@K Macro Micro 15 0.986 0.895 0.561 0.985 0.897 0.548 0.910 0.986 0.584 ±0.002 ±0.001 ±0.007 ±0.005 ±0.002 ±0.001 Macro Micro 0.088 0.539 0.529 0.086 0.552 0.085 8 0.709 0.690 0.734 Table 4: MIMIC-III results (top-50 codes). The results of MultiResCNN are shown in means ± standard deviations. Model C-MemNN (Prakash et al. 2017) C-LSTM-Att (Shi et al. 2017) CAML (Mullenbach et al. 2018) DR-CAML (Mullenbach et al. 2018) MultiResCNN AUC F1 Macro Micro P@5 0.833 0.420 - - 0.875 0.609 0.884 0.618 0.899 0.641 ±0.004 ±0.002 ±0.011 ±0.003 ±0.001 Macro Micro - - 0.532 0.576 0.606 - 0.900 0.909 0.916 0.928 - 0.532 0.614 0.633 0.670 Description Regularized CAML (DR-CAML) is an exten- sion of CAML and incorporates the text description of each code to regularize the model. C-MemNN The Condensed Memory Neural Network was proposed by Prakash et al. (2017), which equips the neural network with iterative condensed memory representa- tions. The model achieved competitive results to predict the top-50 ICD codes for the medical notes in the MIMIC-III dataset. C-LSTM-Att Shi et al. (2017) proposed a Character- aware LSTM-based Attention model to assign ICD codes to clinical notes. They employed LSTM-based language mod- els to generate representations of clinical notes and ICD codes, and proposed an attention method to address the mis- match between notes and codes. They also focused on pre- dicting the top-50 ICD codes for the medical notes in the MIMIC-III dataset. SVM Perotte et al. (2013) experimented two approaches: one treats each ICD9 code independently (flat SVM) and the other uses the hierarchical nature of ICD9 codes (hierarchy SVM). Their results show that the hierarchy SVM performs better than the flat one, yielding 29.3% f1-measure in the MIMIC-II dataset. HA-GRU Baumel et al. (2018) presented a model named Hierarchical Attention Gated Recurrent Unit (HA-GRU) for automatic ICD coding of clinical documents. HA-GRU in- cludes two main layers: the first one encodes sentences and the second one encodes documents. They reported their re- sults in the MIMIC-II dataset, following the data split from Perotte et al. (2013). Results In this section, we compared our model with existing work for automated ICD coding. We ran our model three times for each experiment and each time we used different random seeds for parameter initialization. The final results are the means and standard deviations of three runs. Following prior work (Mullenbach et al. 2018), we compared our model with existing work using the MIMIC-III and MIMIC-II dataset. For the MIMIC-III dataset, we also performed the compar- isons with two experimental settings, namely using the full codes and top-50 codes. For the MIMIC-II dataset, only the full codes were employed. MIMIC-III Results (full codes) As shown in Table 3, we can see that our model obtained better results in the macro- AUC, micro-F1, precision@8 and precision@15, compared with the state-of-the-art models, CAML and DR-CAML. Our model improved the macro-AUC by 0.013, the micro- F1 by 0.013, the precision@8 by 0.025, the precision@15 by 0.023. In addition, our model achieved comparable per- formance on the micro-AUC and a slightly worse macro-F1. More importantly, we observed that our model is able to at- tain stable good results from the standard deviations. MIMIC-III Results (top-50 codes) From Table 4, we observed that our model outperformed all the baselines, namely C-MemNN (Prakash et al. 2017), C-LSTM-Att (Shi et al. 2017), CAML and DR-CAML (Mullenbach et al. 2018), in all evaluation metrics. Our model improves the macro-AUC, micro-AUC, macro-F1, micro-F1 and preci- sion@5 by 0.015, 0.012, 0.030, 0.037 and 0.023, respec- tively. Our model outperformed the C-MemNN by 0.221 and 0.066 in precision@5 and macro-AUC. It also outperformed the C-LSTM-Att by 0.138 and 0.028 in micro-F1 and micro- AUC. Its precision@5 is 0.032 and 0.023 higher than those of CAML and DR-CAML. MIMIC-II Results (full codes) Table 5 shows the results on the full code set of MIMIC-II. Perotte et al. (2013) used the SVM to predict ICD codes from clinical text and their method obtained 0.293 micro-F1. By contrast, our model outperformed their method by 0.171 in micro-F1. Baumel et al. (2018) utilized the attention mechanism and GRU Table 5: MIMIC-II results (full codes). The results of MultiResCNN are shown in means ± standard deviations. Model SVM (Perotte et al. 2013) HA-GRU (Baumel et al. 2018) CAML (Mullenbach et al. 2018) DR-CAML (Mullenbach et al. 2018) MultiResCNN AUC F1 Macro Micro P@8 - - - - 0.820 0.523 0.826 0.515 0.850 0.544 ±0.002 ±0.001 ±0.002 ±0.002 ±0.007 Macro Micro 0.293 - 0.366 - 0.442 0.048 0.049 0.457 0.464 0.052 - - 0.966 0.966 0.968 Table 6: Analysis of the computational cost between CAML and MultiResCNN. "m", "s", "ep" and "d" denote million, second, epoch and document respectively. Parameter Amount Training Time Training Epoch Inference Speed CAML MultiResCNN 6.2m 438s/ep 85 108.7d/s 11.9m 1026s/ep 26 70.9d/s for automated ICD coding. Our model outperformed their model by 0.098 in micro-F1. Our model also outperformed the state-of-the-art model, CAML or DR-CAML, by 0.024, 0.002, 0.003, 0.007 and 0.021 in all evaluation metrics. Discussion Computational Cost Analysis In this section, we analyzed the computational cost between the state-of-the-art model, CAML and our model, Mul- tiResCNN. The analysis was conducted from four aspects, namely the parameter amount, training time, training epoch, inference speed. Our experimental settings are as follows. For CAML, we used the optimal hyper-parameter setting reported in their paper (Mullenbach et al. 2018). For Mul- tiResCNN, we used six filters and 1 residual block, which obtained the best result in our hyper-parameter tuning ex- periments. The batch size, learning rate and dropout rate are identical in every experiment. We used the training set and development set of MIMIC-III (full codes) as experimen- tal data. The experiments were conducted on NVIDIA Tesla P40 GPUs. Training will terminate if the performance on the development set does not increase for 10 times. As shown in Table 6, the parameter of MultiResCNN is approximately 1.9 times as many as that of CAML. The training time of MultiResCNN is about 2.3 times more than that of CAML. It is reasonable since MultiResCNN has more filters and layers. Interestingly, MultiResCNN needs much less epochs to converge. Considering the in- ference speed, CAML is approximately 1.5 times faster than MultiResCNN. Overall, the computational cost of Mul- tiResCNN is larger than that of CAML, but we hold the opinion that the increased cost is still acceptable. Effect of Truncating Data During preprocessing, we truncated the discharge sum- maries that are longer than 2,500 tokens. To investigate the effect of the length limitation, we further conducted the experiments using 3,500, 4,500, 5,500 and 6,500. We se- lected these values because the maximum length of the dis- charge summaries in the development set is approximately 6,300. Results show that the performance differences be- tween different settings are not significant. P@8 ranges be- tween 0.736 and 0.741, and micro-F1 ranges between 0.557 and 0.566. 2,500 seems to be a decent selection considering the tradeoff between performance and cost. Limitations In this study, the performance improvement mostly comes from deep and diversified representations of text. In the fu- ture, we will explore how to incorporate BERT (Devlin et al. 2019) into this task effectively and efficiently. In our prelimi- nary experiments, BERT did not perform well due to the lim- itations of hardware and its fixed-length context. Therefore, potential solutions include recurrent Transformer (Dai et al. 2019) and hierarchical BERT (Zhang, Wei, and Zhou 2019). Moreover, we chose the kernel sizes of the multi-filter layer and channel sizes of the residual layer empirically, which should be further studied and optimized in the future. Conclusions In this paper, we proposed a multi-filter residual convolu- tional neural network for ICD coding. We conducted three experiments on the widely-used MIMIC-III and MIMIC-II datasets. Results show that our model achieved the state- of-the-art performance compared with several competitive baselines. We found that both multi-filter convolution and residual convolution helped the performance improvement with acceptable computational cost. This shows deep and diversified text representations could benefit the ICD coding from clinical text. Our model can be a strong baseline for not only ICD coding, but also other text classification tasks. Acknowledgments This work was supported in part by the Center for Intelli- gent Information Retrieval, R01DA045816, R01HL125089, R01HL137794, R01HL135219, and R01LM012817. Any opinions, findings and conclusions or recommendations ex- pressed in this material are those of the authors and do not necessarily reflect those of the sponsor. References [Baumel et al. 2018] Baumel, T.; Nassour-Kassis, J.; Cohen, R.; Elhadad, M.; and Elhadad, N. 2018. Multi-label classi- fication of patient notes: case study on icd code assignment. In Workshops at the Thirty-Second AAAI Conference on Ar- tificial Intelligence. [Bottle and Aylin 2008] Bottle, A., and Aylin, P. 2008. Intel- ligent information: a national system for monitoring clinical performance. Health services research 43(1p1):10 -- 31. [Dai et al. 2019] Dai, Z.; Yang, Z.; Yang, Y.; Carbonell, J.; Le, Q.; and Salakhutdinov, R. 2019. Transformer-XL: At- tentive language models beyond a fixed-length context. In Proceedings of the 57th Annual Meeting of the ACL, 2978 -- 2988. [Devlin et al. 2019] Devlin, J.; Chang, M.-W.; Lee, K.; and Toutanova, K. 2019. BERT: Pre-training of deep bidirec- tional transformers for language understanding. In Proceed- ings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), 4171 -- 4186. Minneapolis, Minnesota: Association for Com- putational Linguistics. [Garcia and Delakis 2004] Garcia, C., and Delakis, M. 2004. Convolutional face finder: A neural architecture for fast and robust face detection. IEEE Transactions on pattern analysis and machine intelligence 26(11):1408 -- 1423. [He et al. 2016] He, K.; Zhang, X.; Ren, S.; and Sun, J. 2016. Deep residual learning for image recognition. In Proceed- ings of the IEEE conference on computer vision and pattern recognition, 770 -- 778. [Johnson et al. 2016] Johnson, A. E.; Pollard, T. J.; Shen, L.; Li-wei, H. L.; Feng, M.; Ghassemi, M.; Moody, B.; Szolovits, P.; Celi, L. A.; and Mark, R. G. 2016. Mimic- iii, a freely accessible critical care database. Scientific data 3:160035. [Kavuluru, Rios, and Lu 2015] Kavuluru, R.; Rios, A.; and Lu, Y. 2015. An empirical evaluation of supervised learning approaches in assigning diagnosis codes to electronic med- ical records. Artificial intelligence in medicine 65(2):155 -- 166. [Kim 2014] Kim, Y. 2014. Convolutional neural networks for sentence classification. In Proceedings of the 2014 Con- ference on Empirical Methods in Natural Language Pro- cessing (EMNLP), 1746 -- 1751. [Kingma and Ba 2014] Kingma, D. P., and Ba, J. 2014. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980. [Koopman et al. 2015] Koopman, B.; Zuccon, G.; Nguyen, A.; Bergheim, A.; and Grayson, N. 2015. Automatic icd-10 classification of cancers from free-text death certificates. In- ternational journal of medical informatics 84(11):956 -- 965. [Krizhevsky, Sutskever, and Hinton 2012] Krizhevsky, A.; Sutskever, I.; and Hinton, G. E. 2012. Imagenet classifica- tion with deep convolutional neural networks. In Pereira, F.; Burges, C. J. C.; Bottou, L.; and Weinberger, K. Q., eds., Advances in Neural Information Processing Systems 25. Curran Associates, Inc. 1097 -- 1105. [Larkey and Croft 1996] Larkey, L. S., and Croft, W. B. In SI- 1996. Combining classifiers in text categorization. GIR, volume 96, 289 -- 297. Citeseer. [Lipton et al. 2015] Lipton, Z. C.; Kale, D. C.; Elkan, C.; and Wetzel, R. 2015. Learning to diagnose with lstm recurrent neural networks. arXiv preprint arXiv:1511.03677. [McCallum 1999] McCallum, A. 1999. Multi-label text clas- In AAAI sification with a mixture model trained by em. workshop on Text Learning, 1 -- 7. [Mikolov et al. 2013] Mikolov, T.; Sutskever, I.; Chen, K.; Corrado, G. S.; and Dean, J. 2013. Distributed represen- tations of words and phrases and their compositionality. In Advances in neural information processing systems, 3111 -- 3119. [Mullenbach et al. 2018] Mullenbach, J.; Wiegreffe, S.; Duke, J.; Sun, J.; and Eisenstein, J. 2018. Explainable In Pro- prediction of medical codes from clinical text. ceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), 1101 -- 1111. [O'malley et al. 2005] O'malley, K. J.; Cook, K. F.; Price, M. D.; Wildes, K. R.; Hurdle, J. F.; and Ashton, C. M. 2005. Measuring diagnoses: Icd code accuracy. Health services research 40(5p2):1620 -- 1639. [Perotte et al. 2013] Perotte, A.; Pivovarov, R.; Natarajan, K.; Weiskopf, N.; Wood, F.; and Elhadad, N. 2013. Di- agnosis code assignment: models and evaluation metrics. Journal of the American Medical Informatics Association 21(2):231 -- 237. [Pestian et al. 2007] Pestian, J. P.; Brew, C.; Matykiewicz, P.; Hovermale, D. J.; Johnson, N.; Cohen, K. B.; and Duch, W. 2007. A shared task involving multi-label classifica- tion of clinical free text. In Proceedings of the Workshop on BioNLP 2007: Biological, Translational, and Clinical Lan- guage Processing, 97 -- 104. Association for Computational Linguistics. [Prakash et al. 2017] Prakash, A.; Zhao, S.; Hasan, S. A.; Datla, V.; Lee, K.; Qadir, A.; Liu, J.; and Farri, O. 2017. Condensed memory networks for clinical diagnostic infer- encing. In Thirty-First AAAI Conference on Artificial Intel- ligence. [Scheurwegs et al. 2017] Scheurwegs, E.; Cule, B.; Luyckx, K.; Luyten, L.; and Daelemans, W. 2017. Selecting relevant features from the electronic health record for clinical code prediction. Journal of biomedical informatics 74:92 -- 103. [Shi et al. 2017] Shi, H.; Xie, P.; Hu, Z.; Zhang, M.; and Xing, E. P. 2017. Towards automated icd coding using deep learning. arXiv preprint arXiv:1711.04075. [Vaswani et al. 2017] Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A. N.; Kaiser, Ł.; and Polo- sukhin, I. 2017. Attention is all you need. In Advances in neural information processing systems, 5998 -- 6008. [Xie and Xing 2018] Xie, P., and Xing, E. 2018. A neural architecture for automated icd coding. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 1066 -- 1076. [Xu et al. 2018] Xu, K.; Lam, M.; Pang, J.; Gao, X.; Band, C.; Xie, P.; and Xing, E. 2018. Multimodal machine learning for automated icd coding. arXiv preprint arXiv:1810.13348. [Zhang, Wei, and Zhou 2019] Zhang, X.; Wei, F.; and Zhou, M. 2019. HIBERT: Document level pre-training of hierar- chical bidirectional transformers for document summariza- tion. In Proceedings of the 57th Annual Meeting of the ACL, 5059 -- 5069.
1908.09209
1
1908
2019-08-24T21:08:26
Adversarial Domain Adaptation for Machine Reading Comprehension
[ "cs.CL" ]
In this paper, we focus on unsupervised domain adaptation for Machine Reading Comprehension (MRC), where the source domain has a large amount of labeled data, while only unlabeled passages are available in the target domain. To this end, we propose an Adversarial Domain Adaptation framework (AdaMRC), where ($i$) pseudo questions are first generated for unlabeled passages in the target domain, and then ($ii$) a domain classifier is incorporated into an MRC model to predict which domain a given passage-question pair comes from. The classifier and the passage-question encoder are jointly trained using adversarial learning to enforce domain-invariant representation learning. Comprehensive evaluations demonstrate that our approach ($i$) is generalizable to different MRC models and datasets, ($ii$) can be combined with pre-trained large-scale language models (such as ELMo and BERT), and ($iii$) can be extended to semi-supervised learning.
cs.CL
cs
Adversarial Domain Adaptation for Machine Reading Comprehension Huazheng Wang1∗, Zhe Gan2, Xiaodong Liu3, Jingjing Liu2, Jianfeng Gao3, Hongning Wang1 1University of Virginia, 2Microsoft Dynamics 365 AI Research, 3Microsoft Research {hw7ww,hw5x}@virginia.edu, {zhe.gan,xiaodl,jingjl,jfgao}@microsoft.com 9 1 0 2 g u A 4 2 ] L C . s c [ 1 v 9 0 2 9 0 . 8 0 9 1 : v i X r a Abstract In this paper, we focus on unsupervised do- main adaptation for Machine Reading Com- prehension (MRC), where the source domain has a large amount of labeled data, while only unlabeled passages are available in the target domain. To this end, we propose an Adversarial Domain Adaptation framework (AdaMRC), where (i) pseudo questions are first generated for unlabeled passages in the target domain, and then (ii) a domain classifier is incorporated into an MRC model to predict which domain a given passage-question pair comes from. The classifier and the passage- question encoder are jointly trained using ad- versarial learning to enforce domain-invariant representation learning. Comprehensive eval- uations demonstrate that our approach (i) is generalizable to different MRC models and datasets, (ii) can be combined with pre-trained large-scale language models (such as ELMo and BERT), and (iii) can be extended to semi- supervised learning. 1 Introduction Recently, many neural network models have been developed for Machine Reading Comprehension (MRC), with performance comparable to human in specific settings (Gao et al., 2019). However, most state-of-the-art models (Seo et al., 2017; Liu et al., 2018; Yu et al., 2018) rely on large amount of human-annotated in-domain data to achieve the desired performance. Although there exists a number of large-scale MRC datasets (Rajpurkar et al., 2016; Trischler et al., 2016; Bajaj et al., 2016; Zhang et al., 2018), collecting such high- quality datasets is expensive and time-consuming, which hinders real-world applications for domain- specific MRC. ∗ Most of this work was done when the first author was an intern at Microsoft Dynamics 365 AI Research. Therefore, the ability to transfer an MRC model trained in a high-resource domain to other low- resource domains is critical for scalable MRC. While it is difficult to collect annotated question- answer pairs in a new domain, it is generally feasi- ble to obtain a large amount of unlabeled text in a given domain. In this work, we focus on adapting an MRC model trained in a source domain to other new domains, where only unlabeled passages are available. This domain adaptation issue has been a main challenge in MRC research, and the only exist- ing work that investigated this was the two-stage synthesis network (SynNet) proposed in Golub et al. (2017). Specifically, SynNet first generates pseudo question-answer pairs in the target domain, and then uses the generated data as augmenta- tion to fine-tune a pre-trained MRC model. How- ever, the source-domain labeled data and target- domain pseudo data are directly combined without considering domain differences (see Figure 1(a), where the two feature distributions in two domains are independently clustered). Directly transfer- ing a model from one domain to another could be counter-effective, or even hurt the performance of the pre-trained model due to domain variance. To achieve effective domain transfer, we need to learn features that are discriminative for the MRC task in the source domain, while simultaneously indiscriminating with respect to the shift between source and target domains. Motivated by this, we propose Adversarial Domain Adaptation for MRC (AdaMRC), a new approach that utilizes adversar- ial learning to learn domain-invariant transferable representations for better MRC model adaptation across domains (see Figure 1(b), where the two feature distributions learned by AdaMRC are in- distinguishable through adversarial learning). Specifically, our proposed method first gener- ates synthetic question-answer pairs given pas- sages in the target domain. Different from Golub et al. (2017), which only used pseudo question- answer pairs to fine-tune pre-trained MRC mod- els, our AdaMRC model uses the passage and the generated pseudo-questions in the target do- main, in addition to the human-annotated passage- question pairs in the source domain, to train an ad- ditional domain classifier as a discriminator. The passage-question encoder and the domain classi- fier are jointly trained via adversarial learning. In this way, the encoder is enforced to learn domain- invariant representations, which are beneficial for transferring knowledge learned from one domain to another. Based on this, an answer decoder is then used to decode domain-invariant representa- tion into an answer span. The proposed approach is validated on a set of popular benchmarks, including SQuAD (Ra- jpurkar et al., 2016), NewsQA (Trischler et al., 2016), and MS MARCO (Bajaj et al., 2016), using state-of-the-art MRC models including SAN (Liu et al., 2018) and BiDAF (Seo et al., 2017). Since pre-trained large-scale language models, such as ELMo (Peters et al., 2018) and BERT (Devlin et al., 2019), have shown strong performance to learn representations that are generalizable to var- ious tasks, in this work, to further demonstrate the versatility of the proposed model, we perform ad- ditional experiments to demonstrate that AdaMRC can also be combined with ELMo and BERT to further boost the performance. The main contributions of this paper are sum- marized as follows: (i) We propose AdaMRC, an adversarial domain adaptation framework that is specifically designed for MRC. (ii) We per- form comprehensive evaluations on several bench- marks, demonstrating that the proposed method is generalizable to different MRC models and diverse datasets. (iii) We demonstrate that AdaMRC is also compatible with ELMo and BERT. (iv) We further extend the proposed frame- work to semi-supervised learning, showing that AdaMRC can also be applied to boost the perfor- mance of a pre-trained MRC model when a small amount of labeled data is available in the target domain. 2 Related Work Machine Reading Comprehension The MRC task has recently attracted a lot of attention in the community. An MRC system is required (a) SynNet (b) AdaMRC t-SNE plot of encoded feature representa- Figure 1: tions from (a) SynNet (Golub et al., 2017) and (b) the proposed AdaMRC. We sampled 100 data points, each from the development set of the source and the target domains. Blue: SQuAD. Red: NewsQA. to answer a question by extracting a text snip- pet within a given passage as the answer. A large number of deep learning models have been proposed to tackle this task (Seo et al., 2017; Xiong et al., 2017; Shen et al., 2017; Liu et al., 2018; Yu et al., 2018). However, the success of these methods largely relies on large-scale human- annotated datasets (such as SQuAD (Rajpurkar et al., 2016), NewsQA (Trischler et al., 2016) and MS MARCO (Bajaj et al., 2016)). Different from previous work that focused on improving the state of the art on particular MRC datasets, we study the MRC task from a different angle, and aim at addressing a critical yet chal- lenging problem: how to transfer an MRC model learned from a high-resource domain to other low- resource domains in an unsupervised manner. Although important for the MRC task, where annotated data are limited in real-life applications, this problem has not yet been well investigated. There were some relevant studies along this line. For example, Chung et al. (2018) adapted a pre- trained model to TOEFL and MCTest dataset, and Wiese et al. (2017) applied transfer learning to the biomedical domain. However, both studies as- sumed that annotated data in the target domain (ei- ther questions or question-answer pairs) are avail- able. To the best of our knowledge, SynNet (Golub et al., 2017) is the only work that also studied do- main adaptation for MRC. Compared with Syn- Net, the key difference in our model is adversar- ial learning, which enables domain-invariant rep- resentation learning for better model adaptation to low-resource domains. Our approach is also related to multi-task learning (Xu et al., 2019; Caruana, 1997; Liu et al., 2015, 2019) and semi- supervised learning (Yang et al., 2017) for MRC. Figure 2: Illustration of the proposed AdaMRC model for unsupervised domain adaptation of MRC. In this work, we focus on purely unsupervised do- main adaptation. Domain Adaptation Domain adaptation aims to make a machine learning model generalizable to other domains, especially without any annotated data in the target domain (or with only limited data) (Ganin and Lempitsky, 2015). One line of research on domain adaptation focuses on transit- ing the feature distribution from the source domain to the target domain (Gong et al., 2012; Long et al., 2015). Another school of research focuses on learning domain-invariant representations (Glorot et al., 2011) (e.g., via adversarial learning (Ganin et al., 2016; Tzeng et al., 2017)). Domain adaptation has been successfully ap- plied to many tasks, such as image classifi- cation (Tzeng et al., 2017), speech recogni- tion (Doulaty et al., 2015), sentiment classifica- tion (Ganin et al., 2016; Li et al., 2017), ma- chine translation (Johnson et al., 2017; Zoph et al., 2016), relation extraction (Fu et al., 2017), and paraphrase identification (Shah et al., 2018). Com- pared to these areas, the application to MRC presents additional challenges, since besides miss- ing labeled data (i.e., answer spans), the ques- tions in the target domain are also unavailable. To our best knowledge, we are the first to investigate the usage of adversarial domain adaptation for the MRC task. There are many prevailing unsupervised tech- niques for domain adaptation. Our proposed ap- proach is inspired by the seminal work of Ganin et al. (2016) to validate its potential of solving domain adaptation problem on a new task, with- out any supervision for the target domain. There are also other more advanced methods, such as MMD-based adaptation (Long et al., 2017), resid- ual transfer network (Long et al., 2016), and maxi- mum classifier discrepancy (Saito et al., 2018) that can be explored for future work. 3 Problem Definition start, as start, as The problem of unsupervised domain adaptation for MRC is defined as follows. First, let S = {ps, qs, as} denote a labeled MRC dataset from the source domain s, where ps, qs and as repre- sent the passage, the question, and the answer of a sample, respectively. An MRC model M s, tak- ing as input the passage ps = (p1, p2, ..., pT ) of length T and the question qs = (q1, q2, ..., qT (cid:48)) of length T (cid:48), is trained to predict the correct answer end repre- span as = (as sent the starting and ending indexes of the answer in the passage ps. We assume that only unlabeled passages are available in the target domain t, i.e., T = {pt}, where pt represents a passage. This is a reasonable assumption as it is easy to collect a large amount of unlabeled passages in a new domain. Given datasets S and T , the goal of unsupervised domain adaptation is defined as learning an MRC model M t based on S and T to answer questions in the target domain t. end), where as 4 AdaMRC As illustrated in Figure 2, AdaMRC consists of three main components: (i) Question Generator (Sec. 4.1), where pseudo question-answer pairs are generated given unlabeled passages in the tar- get domain; (ii) MRC Module (Sec. 4.2), where Lexicon & ContextualEncodingCross AttentionDocumentLexicon & ContextualEncodingQuestionAnswer ModuleDomain ClassifierDecoder Answerstart, AnswerendDomain labelLexicon & ContextualEncodingCross AttentionDocumentLexicon & ContextualEncodingPseudo QuestionDiscriminator Document & AnswerLexicon & ContextualEncodingAttention-basedDecodingQuestion Generator Encoder SourceDomainTargetDomainPseudo QuestionLoss LDLoss LCEncoder given an input document and a question, an answer span is extracted from the document; (iii) Domain Classifier (Sec. 4.3), where a domain label is pre- dicted to distinguish a feature vector from either the source domain or the target domain. Specifically, the MRC module is composed of an encoder and a decoder. The encoder with pa- rameter θe embeds the input passage and the ques- tion into a feature vector. The decoder with param- eter θd takes the feature vector as input to predict the answer span. The domain classifier with pa- rameter θc takes the same feature vector as input to classify the domain label. All the parameters (θe, θd, θc) are jointly optimized, with the objec- tive of training the encoder to correctly predict the answer span, but also simultaneously fool the do- main classifier. In other words, the encoder learns to map text input into a feature space that is in- variant to the switch of domains. The following sub-sections describe each module, with training details provided in Sec. 4.4. 4.1 Question Generation First, we use an NER system to extract possible answer spans at from the passages pt in the target domain, under the assumption that any named en- tity could be the potential answer of certain ques- tions. Similar answer extraction strategy has been applied in Yang et al. (2017) in a semi-supervised- learning setting, while Golub et al. (2017) pro- posed to train an answer synthesis network to pre- dict possible answers spans. We tried both meth- ods, and empirically observed that a simple NER system provides more robust results, which is used in our experiments. Now, we describe how the question generation (QG) model is trained. Given the passage ps = (p1, p2, ..., pT ) and answer as = (astart, aend) from the source domain, the QG model with pa- rameter θQG learns the conditional probability of generating a question qs = (q1, q2, ..., qT (cid:48)), i.e., P (qsps, as). We implement the QG model as a sequence-to-sequence model with attention mech- anism (Bahdanau et al., 2015), and also apply the copy mechanism proposed in Gu et al. (2016); Gulcehre et al. (2016) to handle rare/unknown words. Specifically, the QG model consists of a lexi- con encoding layer, a BiLSTM contextual encod- ing layer, and an LSTM decoder. For lexicon en- coding, each word token pi of a passage is mapped into a concatenation of GloVe vectors (Penning- ton et al., 2014), part-of-speech (POS) tagging embedding, and named-entity-recognition (NER) embedding. We further insert answer informa- tion by appending an additional zero/one feature (similar to Yang et al. (2017)) to model the ap- pearance of answer tokens in the passage. The output of the lexicon encoding layer is appended with CoVe vectors (McCann et al., 2017), and then passed to the Bidirectional LSTM contextual encoding layer, producing a sequence of hidden states. The decoder is another LSTM with atten- tion and copy mechanism over the encoder hidden states. At each time step, the generation probabil- ity of a question token qt is defined as: P (qt) = gtP v(qt) + (1 − gt)P copy(qt) , (1) where gt is the probability of generating a token from the vocabulary, while (1 − gt) is the proba- bility of copying a token from the passage. P v(qt) and P copy(qt) are defined as softmax functions over the words in the vocabulary and over the words in the passage, respectively. gt, P v(qt) and P copy(qt) are functions of the current decoder hid- den state. 4.2 MRC Module Encoder The encoder in the MRC module con- tains lexicon encoding and contextual encoding, similar to the encoder used in the question gen- eration module. It also includes a cross-attention layer for fusion. Specifically, the output of the lexicon encoder is appended with the CoVe vector and passed to the contextual encoding layer, which is a 2-layer Bidirectional LSTM that produces hid- den states of the passage H p ∈ RT×2m and the question H q ∈ RT (cid:48)×2m, where m is the hidden size of the BiLSTM. We then use cross attention to fuse H p and H q, and construct a working memory of passage M p ∈ RT×2m (see Liu et al. (2018) for more details). The question memory M q ∈ R2m is constructed by applying self-attention on H q. Decoder The decoder, or answer module, pre- dicts an answer span a = (astart, aend) given a passage p and a question q, by modeling the con- ditional probability P (ap, q). The initial state s0 is set as M q. Through T steps, a GRU (Cho et al., 2014) is used to generate a sequence of state vec- tors st = GRU(st−1, xt), where xt is computed via attention between M p and st−1. Two soft- max layers are used to compute the distribution of Algorithm 1 AdaMRC training procedure. 1: Input: source domain labeled data S = target domain unlabeled data {ps, qs, as}, T = {pt} 2: Train the MRC model θs = (θs e, θs d) on source domain S; 3: Train the QG model θQG on source domain S; 4: Generate Tgen = {pt, qt, at} using the QG model; 5: Initialize θ = (θe, θd, θc) with θs; 6: for epoch ← 1 to #epochs do 7: Optimize θ on S ∪ Tgen. Each minibatch is composed with ks samples from S and kt samples from Tgen; 8: end for 9: Output: Model with the best performance on the target development set θ∗. the start and the end of the answer span at each step given st, and the final prediction is the aver- age prediction of all steps. Stochastic prediction dropout (Liu et al., 2018) is applied during train- ing. Note that we use SAN as an example MRC model in the proposed framework. However, our approach is compatible with any existing MRC models. In experiments, in order to demonstrate the versatility of the proposed model, we also con- duct experiments with BiDAF (Seo et al., 2017). 4.3 Domain Classifier The domain classifier takes the output of the en- coder as input, including the aforementioned pas- sage representation M p ∈ RT×2m and the self- attended question representation M q ∈ R2m from different domains, and predicts the domain label d by modeling the conditional probability P (dp, q). A self-attention layer is also applied to M p to re- duce its size to M p(cid:48) ∈ R2m. We then concate- nate it with M q, followed by a two-layer Multi- Layer Perceptron (MLP), f (W [M p(cid:48) ; M q]), and use a sigmoid function to predict the domain la- bel. 4.4 Training Algorithm 1 illustrates the training procedure of our proposed framework. We first train the ques- tion generation model θQG on the source domain dataset S by maximizing the likelihood of gener- ating question qs given passage ps and answer as. Given the unlabeled dataset in the target domain, we extract candidate answers at on pt and use θQG to generate pseudo questions qt, and then compose a pseudo labeled dataset Tgen = {pt, qt, at}. We initialize the MRC model θ for the target do- main with the pre-trained MRC model θs from the source domain, and then fine-tune the model using both the source domain dataset S and the target domain dataset Tgen. The goal of the decoder θd is to predict P (ap, q). The objective function is denoted as: (cid:80)S i=1 log P (a(i)p(i), q(i)) , (2) LD(θe, θd) = 1 S where the superscript (i) indicates the i-th sam- ple. It is worthwhile to emphasize that unlike Golub et al. (2017), we only use source domain data to update the decoder, without using pseudo target domain data. This is because the synthetic question-answer pairs could be noisy, and directly using such data for decoder training may lead to degraded performance of the answer module, as observed both in Sachan and Xing (2018) and in our experiments. 1 N The synthetic target domain data and source do- main data are both used to update the encoder θe and the domain classifier θc. The classifier pre- dicts a domain label d given the feature represen- (cid:80)N tation from the encoder. The objective function is: i=1 log P (d(i)p(i), q(i)) , (3) LC(θe, θc) = where N = S +Tgen. In order to learn domain- invariant representations from the encoder, we up- date θe to maximize the loss while updating θc to minimize the loss in an adversarial fashion. The overall objective function is defined as: L(θe, θd, θc) = LD(θe, θd) − λLC(θe, θc) , where λ is a trade-off parameter that balances the two terms. (4) To optimize our model, instead of alternately updating the adversaries like in GAN (Goodfel- low et al., 2014), we use the gradient-reversal layer (Ganin and Lempitsky, 2015) to jointly op- timize all the components, as suggested in Chen et al. (2018). 5 Experiments 5.1 Experimental Setting Datasets We validate our proposed method on three benchmarks: SQuAD (Rajpurkar et al., Dataset SQuAD (v1.1) Wiki NewsQA News MS MARCO (v1) Web Domain Train Dev Test 87,600 10,570 − 92,549 5,166 5,165 82,430 10,047 9,650 Table 1: Statistics of the datasets. 2016), NewsQA (Trischler et al., 2016), and MS MARCO (Bajaj et al., 2016). The statistics of the datasets are provided in Table 1. Note that these datasets are all from different domains: SQuAD is from Wikipedia; NewsQA is from CNN news; and MS MARCO is from web search log. Evaluation metrics For SQuAD and NewsQA, we report results on two evaluation metrics: Exact Match (EM), which measures the percentage of span predictions that match any of the ground truth answers exactly; and Macro-averaged F1 score, which measures the average overlap between the prediction and the ground-truth answer. For MS MARCO, since the answer is free-formed, we use BLEU and ROUGE-L scores for evaluation. Implementation details1 We use spaCy2 to generate POS and NER taggings, which are used in answer extraction and the lexicon encoding layer of the QG and MRC models. The QG model is fixed after trained on source-domain labeled data. The hidden size of the LSTM in the QG model is set to 125. Parameters of the SAN model follow Liu et al. (2018). The hidden size of the MLP layer in the domain classifier is set to 125. Both the QG and the MRC model are optimized via Adamax (Kingma and Ba, 2015) with mini- batch size set to 32. The learning rate is set to 0.002 and is halved every 10 epochs. To avoid overfitting, we set the dropout rate to 0.3. For each mini-batch, data are sampled from both do- mains, with ks samples from the source domain and kt samples from the target domain. We set ks : kt = 2 : 1 as default in our experiments. For the trade-off parameter λ, we gradually change it from 0 to 1, following the schedule suggested in Ganin and Lempitsky (2015). 5.2 Experimental Results We implement the following baselines and models for comparison. 1. SAN: we directly apply the pre-trained SAN model from the source domain to answer questions in the target domain. 1Code will be released for easy access. 2https://spacy.io/ Method SQuAD → NewsQA EM/F1 SAN SynNet + SAN AdaMRC AdaMRC with GT questions 36.68/52.79 35.19/49.61 38.46/54.20 39.37,54.63 NewsQA → SQuAD 56.83/68.62 50.34/62.42 58.20/69.75 58.82/70.14 SAN SynNet + SAN AdaMRC AdaMRC with GT questions SQuAD → MS MARCO (BLEU-1/ROUGE-L) SAN SynNet + SAN AdaMRC AdaMRC with GT questions MS MARCO → SQuAD SAN SynNet + SAN AdaMRC AdaMRC with GT questions 13.06/25.80 12.52/25.47 14.09/26.09 15.59/26.40 27.06/40.07 23.67/36.79 27.92/40.69 27.79/41.47 Table 2: Performance of AdaMRC compared with baseline models on three datasets, using SAN as the MRC model. 2. SynNet+SAN: we use SynNet3 (Golub et al., 2017) to generate pseudo target-domain data, and then fine-tune the pre-trained SAN model. 3. AdaMRC: as illustrated in Algorithm 1. 4. AdaMRC with GT questions: the same as AdaMRC, except that the ground-truth ques- tions in the target domain are used for train- ing. This serves as an upper-bound of the pro- posed model. For example, Table 2 summarizes the experimental results. We observe that the proposed method consis- tently outperforms SAN and the SynNet+SAN model on all datasets. in the SQuAD→NewsQA setting, where the source- domain dataset is SQuAD and the target-domain dataset is NewsQA, AdaMRC achieves 38.46% and 54.20% in terms of EM and F1 scores, out- performing the pre-trained SAN by 1.78% (EM) and 1.41% (F1), respectively, as well as surpassing SynNet by 3.27% (EM) and 4.59% (F1), respec- tively. Similar improvements are also observed in NewsQA→SQuAD, SQuAD→MS MARCO and MS MARCO→SQuAD settings, which demon- strates the effectiveness of the proposed model. Interestingly, we find that the improvement on adaptation between SQuAD and NewsQA is greater than that between SQuAD and MS MARCO. Our assumption is that it is because 3The officially released code is used in our experiments: https://github.com/davidgolub/QuestionGeneration. SQuAD and NewsQA datasets are more similar than SQuAD and MS MARCO, in terms of ques- tion style. For example, questions in MS MARCO are real web search queries, which are short and may have typos or abbreviations; while questions in SQuAD and NewsQA are more formal and well written. Furthermore, the ground-truth answers in MS MARCO are human-synthesized and usu- ally much longer (16.4 tokens in average) than those in the other datasets, while our answer ex- traction process focuses on named entities (which are much shorter). We argue that extracting named entities as possible answers is still reasonable for most of the reading comprehension tasks such as SQuAD and NewsQA. The problem of synthesiz- ing answers across different domains will be in- vestigated in future work. SynNet vs. pre-trained SAN baseline One observation is that SynNet performs worse than the pre-trained SAN baseline. We hypothesize that this is because the generated question-answer pairs are often noisy and inaccurate, and directly fine-tuning the answer module with synthetic data may hurt the performance, which is also observed in Sachan and Xing (2018), especially when a well-performed MRC model is used as the base- line. Note that we do observe improvements from SynNet+BiDAF over the pre-trained BiDAF model, which will be discussed in Sec. 6.2. Comparing with upper-bound The "AdaMRC with GT questions" model (in Section 5.2) serves as the upper-bound of our proposed approach, where ground-truth questions are used instead of synthesized questions. By using ground- truth questions, performance is further boosted by around 1%. This suggests that our question gener- ation model is effective as the margin is relatively small, yet it could be further improved. We plan to study if recent question generation methods (Du et al., 2017; Duan et al., 2017; Sun et al., 2018; Benmalek et al., 2019) could further help to close the performance gap in future work. 6 Analysis 6.1 Visualization To demonstrate the effectiveness of adversarial do- main adaptation, we visualize the encoded repre- sentation via t-SNE (Maaten and Hinton, 2008) in Figure 1. We observe that with AdaMRC, the two distributions of encoded feature representa- (a) From SQuAD to NewsQA. (b) From NewsQA to SQuAD. Figure 3: Performance of our proposed method com- pared with baselines, using BiDAF as the MRC model. Method SAN AdaMRC + SAN BiDAF AdaMRC + BiDAF EM/F1 32.35/42.62 33.61/44.16 27.85/36.82 29.12/38.84 Table 3: Performance on DuoRC, adapting from Sel- fRC (Wikipedia) to ParaphraseRC (IMDB). tions are indistinguishable. Without AdaMRC, the two distributions are independently clustered by domain. We further use KL divergence for mea- suring distributional differences. The KL diver- gence of data samples between source and target domains, with and without domain adaptation, are 0.278, 0.433, respectively (smaller is better). 6.2 Robustness of AdaMRC Results on BiDAF To verify that our proposed framework is compatible to existing MRC models, we also apply our framework to the BiDAF model, which has different encoder and decoder structures compared to SAN. We follow the model architec- ture and parameter settings in Seo et al. (2017). As shown in Figure 3, the proposed AdaMRC model clearly outperforms both SynNet+BiDAF and pre- trained BiDAF model. We also observe that the improvement of AdaMRC over BiDAF is more significant than SAN. Our hypothesis is that since BiDAF is a weaker baseline than SAN, a higher performance improvement can be observed when the domain adaptation approach is applied to en- hance the model. This experiment confirms that Method SAN AdaMRC + SAN SAN + ELMo AdaMRC + SAN + ELMo BERTBASE AdaMRC + BERTBASE EM/F1 36.68/52.79 38.46/54.20 39.61/55.18 40.96/56.25 42.00/58.71 42.59/59.25 SAN Ratio 36.68/52.79 0% 5% 47.61/62.69 10% 48.66/63.32 20% 50.75/64.80 50% 53.24/67.07 100% 56.48/69.14 AdaMRC + SAN 38.46/54.20 48.50/63.17 49.64/63.94 51.14/65.38 53.34/67.30 56.29/68.97 Table 4: Results of using ELMo and BERT. Setting: adaptation from SQuAD to NewsQA. Table 5: Semi-supervised domain adaptation experi- ment with varied labeling ratio on the target-domain dataset. Setting: adaptation from SQuAD to NewsQA. our proposed approach is robust and can general- ize to different MRC models. Results on DuoRC We further test our model on the newly-released DuoRC dataset (Saha et al., 2018). This dataset contains two subsets: movie descriptions collected from Wikipedia (SelfRC) and from IMDB (ParaphraseRC). Although the two subsets are describing the same movies, the documents from Wikipedia are usually shorter (580 words in average), while the documents from IMDB are longer and more descriptive (926 words in average). We consider them as two differ- ent domains and perform domain adaptation from Wikipedia to IMDB. This experiment broadens our definition of domain. In the DuoRC dataset, the same questions are asked on both Wikipedia and IMDB documents. Thus, question synthesis is not needed, and com- parison with SynNet is not feasible. Note that the answers of the same question could be different in the two subsets (only 40.7% of the questions have the same answers in both domains). We pre- process the dataset and test the answer-span ex- traction task following Saha et al. (2018). Results are reported in Table 3. AdaMRC improves the performance over both SAN (1.26%, 1.54% in EM and F1) and BiDAF (1.27%, 2.02% in EM and F1). This experiment validates that our method can be applied to different styles of domain adap- tation tasks as well. 6.3 AdaMRC with Pre-trained Language Models To verify that our approach is compatible with large-scale pre-trained language models, we eval- uate our model with ELMo (Peters et al., 2018) and BERT (Devlin et al., 2019). To apply ELMo to SAN, we use the model provided by AllenNLP4, and append a 1024-dim ELMo vector to the con- textual encoding layer, with dropout rate set to 0.5. For BERT, we experiment with the pre- 4https://allennlp.org/ trained BERTBASE uncased model5 due to lim- ited computational resources. We use the original design of finetuning BERT for the MRC task in Devlin et al. (2019), instead of combining BERT with SAN. Results are provided in Table 4. We observe that using ELMo and BERT improves both AdaMRC and the baseline model. However, the improvement over ELMo and BERT is rela- tively smaller than SAN. We believe this is be- cause pre-trained language model provides addi- tional domain-invariant information learned from external data, and therefore limits the improve- ment of domain-invariant feature learning in our model. However, it is worth noting that combin- ing AdaMRC with BERT achieves the best perfor- mance, which validates that AdaMRC is compati- ble with data augmentation from external sources. 6.4 Semi-supervised Setting As an additional experiment, we also evalu- ate the proposed AdaMRC framework for semi- supervised domain adaptation. We randomly sam- ple k portion of labeled data from the target do- main, and feed them to the MRC model. The ratio of labeled data ranges k from 0% to 100%. Table 5 shows that AdaMRC outperforms SAN. How- ever, the gap is decreasing when the labeling ra- tio increases. When the ratio is 20% or smaller, there is noticeable improvement. When the ratio is set to 50%, the two methods result in similar per- formance. When the ratio is increased to 100%, i.e., fully supervised learning, the performance of AdaMRC is slightly worse than SAN. This is pos- sibly because in a supervised learning setting, the encoder is trained to preserve domain-specific fea- ture information. The overall results suggest that our proposed AdaMRC is also effective in semi- supervised setting, when a small portion of target- domain data is provided. 5https://github.com/google-research/ bert Refugee camps in eastern Chad house about 300,000 people who fled violence in the Darfur region of Sudan . The U.N. High Commissioner for Refugees said on Monday that more than 12,000 people have fled militia attacks over the last few days from Sudan 's Darfur region to neighboring Chad... Answer: 12,000 GT Question: How many have recently crossed to Chad? Pseudo Question: How many people fled the Refugee region to Sudan? Sources say the classified materials were taken from the East Tennessee Technology Park . Roy Lynn Oakley , 67 , of Roane County , Tennessee , appeared in federal court in Knoxville on Thursday . Oakley was briefly detained for questioning in the case in January ... Answer: Roy Lynn Oakley GT Question: Who is appearing in court ? Pseudo Question: What is the name of the classified employee in Tennessee on East Tennessee ? The Kyrgyz order became effective on Friday when President Kurmanbek Bakiyev reportedly signed legislation that the parliament in Bishkek backed on Thursday , the Pentagon said . Pentagon spokesman Bryan Whitman said the Kyrgyz Foreign Ministry on Friday officially notified the U.S. Embassy in Bishkek that a 180-day withdrawal process is under way... Answer: President Kurmanbek Bakiyev GT Question: Who is the President of Kyrgyzstan ? Pseudo Question: What spokesman signed legislation that the parliament was signed legislation in 2011 ? A high court in northern India on Friday acquitted a wealthy businessman facing the death sentence for the killing of a teen in a case dubbed " the house of horrors . " Moninder Singh Pandher was sentenced to death by a lower court in February . The teen was one of 19 victims -- children and young women -- in one of the most gruesome serial killings in India in recent years ... Answer: one of 19 GT Question:What was the amount of children murdered? Pseudo Question: How many victims were in India? Table 6: Examples of generated questions given input paragraphs and answers, comparing with the ground-truth human-written questions. 6.5 Examples of Generated Questions The percentage of generated questions starting with "what", "who", "when" and "where" are 63.2%, 12.8%, 2.3%, and 2.1%, respectively. We provide several examples of generated questions in Table 6. We observe that the generated ques- tions are longer than human-written questions. This is possibly due to the copy mechanism used in the question generation model, which enables directly copying words into the generated ques- tions. On the one hand, the copy mechanism pro- vides detailed background information for gener- ating a question. However, if not copying cor- rectly, the question could be syntactically incor- rect. For instance, in the third example, "signed legislation that the parliament" is copied from the passage. The copied phrase is indeed describing the answer "President Kurmanbek Bakiyev"; how- ever, the question is syntactically incorrect and the question generator should copy "the parliament backed on Thursday" instead. There is generally good correspondence be- tween the answer type and generated questions. For example, the question generator will produce "What is the name of " if the answer is about a per- son, and ask "How many" if the answer is a num- ber. We also observe that the generated questions may encounter semantic errors though syntacti- cally fluent. For instance, in the first example, the passage suggests that people fled from Sudan to Chad, while the generated question describes the wrong direction. However, overall we think that the current question generator provides reasonable synthesized questions, yet there is still large room to improve. The observation also confirms our analysis that the synthetic question-answer pairs could be noisy and inaccurate, thus could hurt the performance when fine-tuning the answer module with generated data. 7 Conclusion In this paper, we propose a new framework, Adver- sarial Domain Adaptation for MRC (AdaMRC), to transfer a pre-trained MRC model from a source domain to a target domain. We validate our pro- posed framework on several datasets and observe consistent improvement over baseline methods. We also verify the robustness of the proposed framework by applying it to different MRC mod- els. Experiments also show that AdaMRC is com- patible with pre-trained language model and semi- supervised learning setting. We believe our anal- ysis provides insights that can help guide further research in this task. References Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Ben- gio. 2015. Neural machine translation by jointly learning to align and translate. In ICLR. Payal Bajaj, Daniel Campos, Nick Craswell, Li Deng, Jianfeng Gao, Xiaodong Liu, Rangan Majumder, Andrew McNamara, Bhaskar Mitra, Tri Nguyen, et al. 2016. Ms marco: A human generated machine arXiv preprint reading comprehension dataset. arXiv:1611.09268. Ryan Benmalek, Madian Khabsa, Suma Desu, Claire Cardie, and Michele Banko. 2019. Keeping notes: Conditional natural language generation with a scratchpad encoder. In ACL. Rich Caruana. 1997. Multitask learning. Machine learning. Xilun Chen, Yu Sun, Ben Athiwaratkun, Claire Cardie, and Kilian Weinberger. 2018. Adversarial deep av- eraging networks for cross-lingual sentiment classi- fication. TACL. Kyunghyun Cho, Bart Van Merriënboer, Dzmitry Bah- danau, and Yoshua Bengio. 2014. On the properties of neural machine translation: Encoder-decoder ap- proaches. arXiv preprint arXiv:1409.1259. Yu-An Chung, Hung-Yi Lee, and James Glass. 2018. Supervised and unsupervised transfer learning for question answering. In NAACL. Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. Bert: Pre-training of deep bidirectional transformers for language understand- ing. In NAACL. Mortaza Doulaty, Oscar Saz, and Thomas Hain. 2015. Data-selective transfer learning for multi- arXiv preprint domain speech recognition. arXiv:1509.02409. Xinya Du, Junru Shao, and Claire Cardie. 2017. Learn- ing to ask: Neural question generation for reading comprehension. In ACL. Nan Duan, Duyu Tang, Peng Chen, and Ming Zhou. 2017. Question generation for question answering. In EMNLP. Lisheng Fu, Thien Huu Nguyen, Bonan Min, and Ralph Grishman. 2017. Domain adaptation for re- lation extraction with domain adversarial neural net- work. In IJCNLP. Yaroslav Ganin and Victor Lempitsky. 2015. Unsu- pervised domain adaptation by backpropagation. In ICML. Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Lavi- olette, Mario Marchand, and Victor Lempitsky. 2016. Domain-adversarial training of neural net- works. JMLR. Jianfeng Gao, Michel Galley, and Lihong Li. 2019. Neural approaches to conversational ai. Founda- tions and Trends R(cid:13) in Information Retrieval. Xavier Glorot, Antoine Bordes, and Yoshua Bengio. 2011. Domain adaptation for large-scale sentiment classification: A deep learning approach. In ICML. David Golub, Po-Sen Huang, Xiaodong He, and Li Deng. 2017. Two-stage synthesis networks for transfer learning in machine comprehension. In EMNLP. Boqing Gong, Yuan Shi, Fei Sha, and Kristen Grau- man. 2012. Geodesic flow kernel for unsupervised domain adaptation. In CVPR. Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. 2014. Generative ad- versarial nets. In NIPS. Jiatao Gu, Zhengdong Lu, Hang Li, and Victor OK Incorporating copying mechanism in Li. 2016. sequence-to-sequence learning. In ACL. Caglar Gulcehre, Sungjin Ahn, Ramesh Nallapati, Bowen Zhou, and Yoshua Bengio. 2016. Pointing the unknown words. In ACL. Melvin Johnson, Mike Schuster, Quoc V. Le, Maxim Krikun, Yonghui Wu, Zhifeng Chen, Nikhil Tho- rat, Fernanda B. Viégas, Martin Wattenberg, Gre- gory S. Corrado, Macduff Hughes, and Jeffrey Dean. 2017. Google's multilingual neural machine transla- tion system: Enabling zero-shot translation. TACL. Diederik P Kingma and Jimmy Ba. 2015. Adam: A method for stochastic optimization. In ICLR. Zheng Li, Yun Zhang, Ying Wei, Yuxiang Wu, and Qiang Yang. 2017. End-to-end adversarial memory network for cross-domain sentiment classification. In IJCAI. Xiaodong Liu, Jianfeng Gao, Xiaodong He, Li Deng, Kevin Duh, and Ye-Yi Wang. 2015. Representation learning using multi-task deep neural networks for semantic classification and information retrieval. In NAACL. Xiaodong Liu, Pengcheng He, Weizhu Chen, and Jian- feng Gao. 2019. Multi-task deep neural networks for natural language understanding. In ACL. Xiaodong Liu, Yelong Shen, Kevin Duh, and Jianfeng Gao. 2018. Stochastic answer networks for machine reading comprehension. In ACL. Mingsheng Long, Yue Cao, Jianmin Wang, and Michael I. Jordan. 2015. Learning transferable fea- tures with deep adaptation networks. In ICML. Mingsheng Long, Han Zhu, Jianmin Wang, and Michael I Jordan. 2016. Unsupervised domain adaptation with residual transfer networks. In NIPS. Mingsheng Long, Han Zhu, Jianmin Wang, and Michael I Jordan. 2017. Deep transfer learning with joint adaptation networks. In ICML. Caiming Xiong, Victor Zhong, and Richard Socher. 2017. Dynamic coattention networks for question answering. In ICLR. Yichong Xu, Xiaodong Liu, Yelong Shen, Jingjing Liu, and Jianfeng Gao. 2019. Multi-task learning with sample re-weighting for machine reading compre- hension. In NAACL. Zhilin Yang, Junjie Hu, Ruslan Salakhutdinov, and Semi-supervised qa with William Cohen. 2017. generative domain-adaptive nets. In ACL. 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 comprehension. In ICLR. Sheng Zhang, Xiaodong Liu, Jingjing Liu, Jianfeng Gao, Kevin Duh, and Benjamin Van Durme. 2018. Record: Bridging the gap between human and ma- chine commonsense reading comprehension. arXiv preprint arXiv:1810.12885. Barret Zoph, Deniz Yuret, Jonathan May, and Kevin Knight. 2016. Transfer learning for low-resource neural machine translation. In EMNLP. Laurens van der Maaten and Geoffrey Hinton. 2008. Visualizing data using t-sne. JMLR. Bryan McCann, James Bradbury, Caiming Xiong, and Richard Socher. 2017. Learned in translation: Con- textualized word vectors. In NIPS. Jeffrey Pennington, Richard Socher, and Christopher Manning. 2014. Glove: Global vectors for word representation. In EMNLP. Matthew E Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. 2018. Deep contextualized word rep- resentations. In NAACL. Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. Squad: 100,000+ questions for machine comprehension of text. In EMNLP. Mrinmaya Sachan and Eric Xing. 2018. Self-training for jointly learning to ask and answer questions. In NAACL. Amrita Saha, Rahul Aralikatte, Mitesh M Khapra, and Karthik Sankaranarayanan. 2018. Duorc: Towards complex language understanding with paraphrased reading comprehension. In ACL. Kuniaki Saito, Kohei Watanabe, Yoshitaka Ushiku, and Tatsuya Harada. 2018. Maximum classifier discrep- ancy for unsupervised domain adaptation. In CVPR. Minjoon Seo, Aniruddha Kembhavi, Ali Farhadi, and Hannaneh Hajishirzi. 2017. Bidirectional attention flow for machine comprehension. In ICLR. Darsh J Shah, Tao Lei, Alessandro Moschitti, Salva- tore Romeo, and Preslav Nakov. 2018. Adversarial domain adaptation for duplicate question detection. In EMNLP. Yelong Shen, Po-Sen Huang, Jianfeng Gao, and Weizhu Chen. 2017. Reasonet: Learning to stop reading in machine comprehension. In KDD. Xingwu Sun, Jing Liu, Yajuan Lyu, Wei He, Yan- jun Ma, and Shi Wang. 2018. Answer-focused and position-aware neural question generation. In EMNLP. Adam Trischler, Tong Wang, Xingdi Yuan, Justin Har- ris, Alessandro Sordoni, Philip Bachman, and Ka- heer Suleman. 2016. Newsqa: A machine compre- hension dataset. arXiv preprint arXiv:1611.09830. Eric Tzeng, Judy Hoffman, Kate Saenko, and Trevor Darrell. 2017. Adversarial discriminative domain adaptation. In CVPR. Georg Wiese, Dirk Weissenborn, and Mariana Neves. 2017. Neural question answering at bioasq 5b. In BioNLP workshop.
1511.06798
2
1511
2016-07-23T00:18:19
Conducting sparse feature selection on arbitrarily long phrases in text corpora with a focus on interpretability
[ "cs.CL", "cs.IR", "stat.AP" ]
We propose a general framework for topic-specific summarization of large text corpora, and illustrate how it can be used for analysis in two quite different contexts: an OSHA database of fatality and catastrophe reports (to facilitate surveillance for patterns in circumstances leading to injury or death) and legal decisions on workers' compensation claims (to explore relevant case law). Our summarization framework, built on sparse classification methods, is a compromise between simple word frequency based methods currently in wide use, and more heavyweight, model-intensive methods such as Latent Dirichlet Allocation (LDA). For a particular topic of interest (e.g., mental health disability, or chemical reactions), we regress a labeling of documents onto the high-dimensional counts of all the other words and phrases in the documents. The resulting small set of phrases found as predictive are then harvested as the summary. Using a branch-and-bound approach, this method can be extended to allow for phrases of arbitrary length, which allows for potentially rich summarization. We discuss how focus on the purpose of the summaries can inform choices of regularization parameters and model constraints. We evaluate this tool by comparing computational time and summary statistics of the resulting word lists to three other methods in the literature. We also present a new R package, textreg. Overall, we argue that sparse methods have much to offer text analysis, and is a branch of research that should be considered further in this context.
cs.CL
cs
Conducting sparse feature selection on arbitrarily long phrases in text corpora with a focus on interpretability Luke Miratrix, Robin Ackerman July 26, 2016 Disclaimer: The analyses, opinions, and conclusions expressed in this paper do not necessarily reflect the views of the United States Department of Labor. Note: This paper has been accepted to Statistical Analysis and Data Mining. Please see proofed, etc., version there. Abstract We propose a general framework for topic-specific summarization of large text cor- pora, and illustrate how it can be used for analysis in two quite different contexts: an OSHA database of fatality and catastrophe reports (to facilitate surveillance for patterns in circumstances leading to injury or death) and legal decisions on workers' compensation claims (to explore relevant case law). Our summarization framework, built on sparse classification methods, is a compromise between simple word frequency based methods currently in wide use, and more heavyweight, model-intensive meth- ods such as Latent Dirichlet Allocation (LDA). For a particular topic of interest (e.g., mental health disability, or carbon monoxide exposure), we regress a labeling of doc- uments onto the high-dimensional counts of all the other words and phrases in the documents. The resulting small set of phrases found as predictive are then harvested as the summary. Using a branch-and-bound approach, this method can be extended to allow for phrases of arbitrary length, which allows for potentially rich summarization. We discuss how focus on the purpose of the summaries can inform choices of tuning parameters and model constraints. We evaluate this tool by comparing computational time and summary statistics of the resulting word lists to three other methods in the literature. We also present a new R package, textreg. Overall, we argue that sparse methods have much to offer text analysis, and is a branch of research that should be considered further in this context. Keywords: concise comparative summarization, sparse classification, regularized regres- sion, Lasso, text summarization, text mining, key-phrase extraction, text classification, high- dimensional analysis, L2 normalization 1 Introduction Regularized high dimensional regression can extract meaningful information from large text corpora by producing key phrase summaries that capture how a specific set of documents 1 of interest differ from some baseline collection. This text summarization approach has been called Concise Comparative Summarization (CCS) [1], underscoring two fundamental fea- tures of this tool: (1) the comparison of a class of documents to a baseline or complete set in order to remove generic terminology and characteristics of the overall corpus; and (2) the resulting production of a short, easy-to-read summary comprised of key phrases. Such summaries can be useful for understanding what makes a document collection distinct and can be used to inform media analysis, understand incident reports, or investigate trends in legal decisions. Many classic methods of text summarization tend to focus on single words or short phrases only. Approaches such as Latent Dirichlet Allocation [2] also do not extend naturally to phrases. On the other hand, one regression-based method [3, 4] that does allow for longer phrases does not allow for rescaling of the counts of phrases in the text based on the overall frequency of appearance of such phrases, which can negatively impact the quality of resulting summaries. In this paper we merge two CCS approaches to allow for rescaled arbitrary-length key phrases that can include gaps. We briefly discuss how this is done below. Our new CCS tool be easily used via our new R package, textreg, which allows for rapid exploration of text corpora of up to a few gigabytes in size. Even given these tools, when a researcher desires to conduct a specific analysis, he or she is faced with many choices. In particular, the implementation and regularization of the regression itself can be done in several ways-and the impact of choosing among these ways is one of the foci of this paper. In particular, we argue that if the researcher has specific goals for interpretation in mind, these goals can inform choice of tuning parameters. For example, when faced with a corpus where only a few documents are of interest and the rest are to be used as a baseline, a researcher may choose to allow only positive weights on phrases, in order to simplify interpretation. Similarly, choice of tuning parameter can be governed by a researcher's level of interest in pruning rare phrases. We also offer a method for testing for a significant relationship between the text and the labeling that also provides a threshold regularization value. We compare this tool to other related state-of-the-art methods. First, we compare to multinomial inverse regression (MNIR) [5], a text regression method that is primarily de- signed to be distributed across many cores in order to be able to handle massive data. We also compare to a classic linear Lasso approach (see, e.g., [6]), which is similar to this method run on pre-computed document-term matrices without some of the flexibility. We finally compare to the original Ifrim et al. method that is one of the building blocks of this work. In these comparisons we investigate computation time, prediction accuracy, and different features of the resulting word lists. The different approaches give very different types of lists, and we hope this work gives some guidance to the practitioner as to how to sort through the options. As a case study we use this tool to examine a large collection of occupational fatality and catastrophe reports generated by the Occupational Safety and Health Administration (OSHA) in the United States. As a motivating example, we examine hazardous exposure to methylene chloride, a neurotoxin, during bathtub refinishing operations. In 2013, OSHA and the National Institute for Occupational Safety and Health (NIOSH) jointly issued a Hazard Alert calling attention to a recurring pattern of this nature following the deaths of least 2 14 workers since 2000 in related circumstances. However, the sheer volume of information describing occupational fatalities and catastrophes may have initially obscured this pattern in the years preceding its detection. Although OSHA maintains a database of narrative reports describing fatalities and catastrophes ("Fat/Cats"), similar patterns of preventable exposure to occupational hazards may be difficult to identify efficiently through manual review alone, given the large number of narratives in this database. Thus, using methylene chloride as a case study, we consider whether text mining techniques can help identify important patterns in circumstances of hazardous exposures. In our framework, a summary list of key words and phrases ideally represents and reveals the overall content of a collection of narrative reports. For example, one summary for all narratives related to "Methylene Chloride" contained the words "bathtub" and "stripper." To qualitatively evaluate our tool, we manually examine these words and phrases in the context of the original reports and consider whether our text summarization tool effectively characterizes the circumstances of the bathroom refinishing fatalities. In general, we explore whether we can construct text mining algorithms that, when applied to an entire corpus, can uncover "needles in the haystack" patterns such as the connection between bathroom refinishing and overexposure to methylene chloride. At this stage we are not focused on rates or relative risks of particular patterns; we are instead focused on the crude detection of textual patterns that may represent meaningful information about how certain types of injuries and fatalities occur. Such findings, even if they involve only a few recorded deaths or injuries, may facilitate the prevention of many future fatalities, particularly in the context of emerging hazards. We also examine our tool's ability to extract information from a collection of legal de- cisions from the Employees' Compensation Appeals Board (ECAB), which handles appeals of determinations of the Office of Workers' Compensation Programs (OWCP) in the U.S. Department of Labor (DOL). Here we investigate what information we can extract about dif- ferent categories of cases. In particular, we examine cases involving a question as to whether the work environment caused a mental health condition (an "emotional condition," in the parlance of ECAB). We find that while the CCS tool does extract meaningful information relating to the cases of interest, further work needs to be done to obtain more nuanced summaries. Overall, the CCS approach does allow for exploration of text and does extract meaningful information. Extending earlier, fixed-length phrase tools to allow for longer phrases and phrases with gaps does increase the expressive capability of the summaries. The methods for picking a tuning parameter, while possibly a bit aggressive and conservative, do provide an alternative paradigm for data analysis with an eye to extracting human meaning from text. 2 Overview of Summarization This paper extends the concept of Concise Comparative Summarization (CCS) discussed in [1], incorporating a prior approach proposed by [3] to result in an overall improved method- ology. Concise Comparative Summarization involves comparing a pre-specified set of doc- uments to a baseline set. One can think of it as a regularized regression of some labeling 3 of the m documents (normally +1 and -1) onto the collection of all possible summary key phrases. For example, in one analysis we label documents relating to incidents involving car- bon monoxide (CO) as +1 and the remaining documents as −1. Each potential key phrase, or "feature," is considered to be a covariate in the regression, and is in principle represented as an m-vector of measures of the feature's presence (e.g., appearance count) in each of the m documents. By using sparse regularization, only a small subset of these possible summary key phrases is selected. These phrases are taken as the final summary. So, for example, the resulting phrases of our CO-related regression would ideally indicate what is different about CO-related events when compared to other workplace injuries and fatalities. At root we are taking those phrases most useful for classifying a set of documents by the given labeling as the summary of the positive set of documents as compared to the negative, baseline, set. It is worth emphasizing that the focus is not predictive quality; the selected features themselves are the object of interest and the quality can only be measured by their usefulness in the original human interpretation-based question that motivated the exploration. Thus, these methods in principle require human analog experiments to validate their findings. This can be done; see [7, 8], or [1] for examples. We are using text classification tools, but the classification is a byproduct. There are many possible choices for how to implement this regression including whether to use logistic or linear regression, and whether to rescale the frequency appearance of the phrases before regression. Prior work has shown that rescaling phrase frequency is quite important; failing to appropriately do so can result in summaries that have little informative content even while predictive accuracy is maintained. This is not surprising; term frequency in text is a known and serious concern when data mining large text corpora (e.g., [1, 9]), as was first illustrated in the information retrieval literature (e.g., [10, 11]). In text classification, and, by extension, key-phrase extraction via text classifiers, there is some desire to allow for phrases as well as unigram (single word) features. One approach is to calculate and use all phrases up to n words long as the overall feature set. For long phrases this can quickly become intractable as there is a blowup in the number of possible phrases a corpus may contain. To solve this problem, Ifrim et al. [4, 3] allow for arbitrary length phrases by generating the features "on-the-fly" as part of the optimization. As an added benefit, this approach easily allows for "gaps," i.e. phrases with wildcard words, which greatly enhances the potential expressiveness of the resultant summaries. Ifrim et al.'s algorithm, based on work of [12] and, even earlier, [13], fits an elastic-net- penalized logistic regression with the features consisting of the entire space of all phrases. (Also see [14] or [15] for other examples of regression on text and [16] or [17] for an overview of elastic nets and other regularized regression methods in general.) Ifrim et al. initially propose an algorithm to solve a penalized logistic regression of: m(cid:88) i=1 β = arg min β=(β1,...,βp) yic(cid:48) iβ + log (1 + exp(yic(cid:48) iβ)) + CR(β) with ci being the feature vector for document i with the cij as binary indicators of the presence of feature j in document i, yi being the −1/1 class label, p being the number of features including all phrases, C being a regularization tuning parameter, and R(β) being some regularization function. They later extend this to allow for alternate loss functions such as a 4 hinge loss. However, they do not allow for rescaling features. By modifying their methods, we show how rescaling can be incorporated into their overall approach. They also do not allow for an intercept term, which can introduce difficulty with the summarization process if the number of positive features is not close to 50%. We extend their algorithm to allow for a (non-penalized) intercept term as discussed in [1]. We implement these modifications by extending their code, and then wrap the resulting algorithm in a new R package, textreg, to make it easier to use in a rapid and exploratory manner. We also provide some useful tools and visualizations to help researchers understand the resulting summaries. The core idea behind the algorithm is a greedy coordinate descent coupled with a branch- and-bound algorithm. With each step, the algorithm searches the entire feature space for the feature that has the highest gradient at the current β. This is obviously a very large search space, but it can be pruned using a relationship that bounds the size of a gradient of a sub-phrase by a known calculation on any parent phrase. In the search we track the current optimal feature, and then for each new feature considered, if the bound on all the children of that feature is smaller than the current optimum, prune all those children from the search. 2.1 Related work CCS is distinct from classification. Classification is focused on sorting documents, such as for attributing authorship [18, 19] or counting types of news events [20, 21]. Text classification has been attempted using a wide array of machine learning methods such as naive bayes, linear discriminant analysis, or support vector machines [22], which easily allow for large numbers of features (the words and phrases) to be incorporated. For comparisons of these different methods on text see [23], [19] or [24]. For SVMs as an approach in particular for text, see the book of [25]. For such methods and these evaluations, however, the features themselves are not of primary interest, classification is. We instead attempt to extract meaning from documents by contrasting sets to each other. This is most similar to key phrase extraction, a literature in its own right. See, for example, [26], [27], or [28]. Interpreting text is a difficult task, and can be done in a variety of ways. For example, [29] use text to predict roll call votes with an LDA (Latent Dirichlet Allocation) algorithm [2] in order to understand how language of law is correlated with political support. [7] model political text to explore who dominates policy debates. Truly validating a finding is generally quite difficult and requires a great deal of effort to do properly, as these papers illustrate quite well. Our tools are primarily intended for exploration; validation is not within CCS's scope without additional human validation efforts or alternative techniques. Of the many approaches to text analysis, variations of LDA [2] in particular have re- cently been widely investigated and used. These consist of a Bayesian hierarchical model that describe documents in a corpus as a mixture of some number of different distributions on the words. They can reveal structure in a corpus and have been shown to capture human meaning. However, generating novel models for specific circumstances is difficult. Even mild changes to the model can be technically quite challenging and consist of an entire research topic in its own right. They are either computationally expensive or only solved approxi- mately (via, e.g., variational methods). In the spirit of diversity in research approaches, we 5 take a different path. This is not to say that using sparse regression methods on text is new; see for example [23], [30] and [31]. [32] use sparsity to model topics by representing them as small collections of phrases that stand out against a background. [33] showcase several methods, such as sparse PCA, to investigate large corpora. There are many others. One aspect of our approach that we believe is novel is allowing for complex features in the form of overlapping phrases, especially phrases with wildcard words, while maintaining the ability to rescale features. This allows great flexibility in the expressiveness of the possible summaries generated, and it is not obvious how to naturally extend methods such as LDA, which rely on a generative model where words are picked i.i.d. from some distribution, to do this. 3 Rescaled n-gram regression Initial methods regress the yi on the ci, where ci is either the vector of counts with cij being how often phrase j appears in document i or of binary indicators of appearance, with the elements cij ∈ {0, 1} indicating the presence of phrase j in document i. This can be problematic in that common phrases (e.g., "the," or, less obviously, "usually,") end up having much higher variance than less common ones and thus it is easier to pick them up due to random fluctuations. See Section 4 for further discussion. rescaling (for q ≥ 1) transforms the vectors ci into new covariate vectors xi as Rescaling the features can correct this as pointed out in, e.g., [34]. In particular, Lq- xij = cij zj , where zj ≡ (cid:32) n(cid:88) i=1 (cid:33)1/q cq ij . This is similar to standardizing columns in a Lasso regression; if you do not, then phrases with high variability need smaller coefficients to have similar impacts on prediction. This makes them "cheaper" under the regularization and therefore appear more frequently due to random chance. Once our feature space has been standardized with each phrase having an Lq-length of 1 we regress our y onto these rescaled x and an intercept. This is a high-dimensional problem with p (cid:29) m. As we want a small number of phrases, we use a sparse regularization L1 penalty. We also use a squared hinge loss to obtain: L(β) = [(1 − yi(β0 + x(cid:48) iβ)) ∨ 0]2 + C βj, i=1 j=1 with a ∨ b denoting the maximum of a and b. For this loss function an over -prediction is not penalized. From a prediction standpoint, we wish β0 + x(cid:48) iβ = yi; if we fall short, we have quadratic loss, if it does, the loss is zero, and if we overshoot we still have zero loss. There is no penalty for "over-predicting" a document's label. We use squared hinge loss as this is similar to the Lasso, shown to be effective in [1], but also monotonic, which is needed for the optimization algorithm. Also note the penalty term does not include the intercept, β0. 6 n(cid:88) p(cid:88) (cid:32) n(cid:88) n(cid:88) i=1 (cid:32) p(cid:88) p(cid:88) j=1 βj. ξ(mi) + C i=1 j=1 L(β) = = We then obtain β as To generalize this framework, taking notation from Ifrim et al., let our loss for an indi- vidual document be ξ(mi) with mi = yi(µ + x(cid:48) iβ). We can use any monotonic loss functions with ξ(cid:48) ≤ 0 everywhere. The squared hinge loss from above is ξ(m) = ((1 − m) ∨ 0)2; this is very similar to an OLS-type penalty of (1 − m)2. Logistic would be ξ(m) = log(1 + e−m). Regardless of the choice of ξ, the loss term can be expressed in the original counts as 1 − yi ξ β0 + cij zj βj + C βj (cid:33)(cid:33) p(cid:88) j=1 β = arg min L(β) β (1) Alternatively, by letting βj ≡ βj/zj, we can move the zj to the penalty term and regress on the counts ci; this gives the identical loss as seen by considering mi = yi(µ + c(cid:48) β) on the rescaled columns: scaling a column by zj is the same as penalizing the associated βj by zj. This has ties to weighted Lasso approaches such as the adaptive Lasso [35], in that we now have feature-specific penalties. The gradients change, however, which can affect the optimization. See Appendix B. i Solving Equation 1 is done with greedy coordinate descent. See Algorithm 1. For greedy coordinate descent, we repeatedly find the feature with the highest gradient, and then opti- mize its corresponding βj with a line search over the loss function. Because this is a convex problem, this will converge on the global maximum as each iteration will decrease L(β) and since the gradient along all the coordinates can only be 0 if we are at a maximum. For a proof see, e.g., [36] or [37]. We keep a cache of all the non-zero features in our model; we do not need to ever calculate or store all possible features. The main computational cost of the algorithm is in finding the feature with the largest gradient. To do this, we dynamically generate the features by exploiting the nested structure of any multiword phrase having a smaller phrase as a prefix. This inner algorithm is shown on Algorithm 2. Here we first examine all unigrams, then bigrams, and so forth until there are no more eligible phrases. We first calculate the gradient for all unigrams and enter them into the queue. Phrases in the queue are placeholders for their family of superphrases. When we pull a phrase out of the queue, we check to see if we can prune all of its children and if we cannot, we determine the phrases' children, calculate gradients for these children, and finally enter them into the queue. This algorithm would work without pruning, but if we were able to prune all the at-zero children of a feature before examining them, we could achieve large speed-ups. And indeed some pruning is possible due to a trick of bounding a child's gradient based on the structure of its parent, although the rescaling makes keeping this bound tight more difficult than in the original Ifrim et al. presentation. The main idea is if a bound on the gradients of a family of features is less in magnitude than our current best gradient, we can prune them all. We discuss finding such bounds next. 7 Algorithm 1 Greedy Coordinate Descent β = ∅ f eatures = ∅ while Not Converged do β[intercept] = updateFeature(intercept) f = findHighestGradient f eatures.add(f ) β[f ] = updateFeature(f) end while Algorithm 2 findHighestGradient f eatures = all non-zero features so far. bestf = arg maxf∈f eatures gradient(f ) u1, . . . , up1 = all unigrams in dictionary Q = queue( ), a queue of all features to check for u ∈ u1, . . . , up1 do if gradient(u) > gradient(bestf ) then bestf = u end if Q.add( u ) end for while Q is not empty do f = Q.next() if not canPrune(f, bestf ) then for c ∈ children(f ) do if gradient(c) > gradient(bestf ) then bestf = c end if Q.add( c ) end for end if end while 8 3.1 Bounding gradients Take any feature j with corresponding appearance pattern across the documents cj. For any feature k with feature j as a prefix, we know that cki ≤ cji for i = 1, . . . , n, which we write as ck (cid:22) cj. We also know that cki ≥ 0 for i = 1, . . . , n because they are counts, so 0 (cid:22) ck. I.e., given a phrase j, any phrase with phrase j as a prefix can only have a count vector bounded between 0 and phrase j's count vector. During our search we consider phrases from shorter to longer. For each phrase j we, based on that phrase's appearance pattern in the text, calculate a bound bj on the magnitude of the highest gradient a "best case" hypothetical superphrase with that prefix could have. If this bj is smaller than the current best achieved gradient Λ, then we can prune from consideration all phrases with phrase j as a prefix because if bj ≤ Λ we have for any superphrase k of j L(β) dβk (cid:12)(cid:12)(cid:12)(cid:12) d  (cid:88) (cid:12)(cid:12)(cid:12)(cid:12) ≤ bj ≤ Λ. 1/r ξ(cid:48)(mi)r   (cid:88) , 1/r − C, ξ(cid:48)(mi)r Therefore we want bj to be as small as possible, i.e., tight, to make phrases easier to prune. As derived in Appendix B, one such overall bound is, for any q ≥ 1, (cid:12)(cid:12)(cid:12)(cid:12) max (cid:95) (cid:12)(cid:12)(cid:12)(cid:12) ≤ 0 max d dβk L(β) yi=1,cij >0 yi=−1,cij >0 k:0(cid:22)xk(cid:22)xj where 1/r = 1−1/q. For any phrase j, these bounds can be computed by summing over only those documents that have phrase j, rendering them computationally tractable. Because the rescaling allows for theoretically very predictive yet relatively rare phrases, these bounds are unfortunately quite loose, making it hard to substantially trim the search tree. One possible avenue for improvement would be to integrate the preprocessing step suggested by [38]. As special cases, q = 1 gives r = ∞ and a bound of the maximum ξ(cid:48)(mi) for any document i that has phrase j, and q = ∞ gives r = 1 and a bound of the maximum of the two sums of the ξ(cid:48)(mi) across the negative and positive documents containing phrase j-which is Ifrim's bound, corresponding to no rescaling, up to the scaling of the maximum occurrence of the phrase in any single document. All of the above is easily extended to an elastic net [17]. See note in Appendix B. 4 Choices of rescaling and additional constraints Choices of rescaling (e.g., the q in the Lq-rescaling) and further restrictions on the optimiza- tion problem can focus the CCS tool on different aspects of the summary. We can seek to generate summaries with more general or more specific words, for example, or enforce a contrast of a target set to a larger background set which eases interpretability. We discuss how in the following subsections. 4.1 Rescaling Phrases vary greatly in their overall appearance in text, with a very long tail of words and phrases that appear in nearly every document, and the bulk of phrases appearing only one 9 or two times. A phrase's rate of appearance is connected to its underlying variance if we represent the phrase with its count vector. This can cause problems when selecting the most meaningful phrases. In particular, common phrases can easily dominate because they have greater variance. Typically this is handled with stop-word lists, which are lists of words that are a priori deemed low-information and dropped before analysis. For a thorough discussion of this, see [34]. And, as [34] discusses, stop-word removal is finicky, not general, and imperfect. They can not easily be adapted to differing contexts or languages. Furthermore, how to implement stop word removal when phrases are the object of interest is unclear. Rescaling, however, can not only serve the function of a stop-word list but do a superior job [1]. Rescaling is critical, as is widely known in information retrieval. Without rescaling, stop words are easily selected by virtually all text mining procedures. Even with stop words being dropped, typically the "runner up" most common phrases are then selected, primarily due to random variation in their appearance pattern. To see this, test nearly any off-the-shelf text mining tool without removing stop words first; more often than not, these methods will fail, and their results will be dominated by these low-information words. Stop word lists are a hard-threshold solution when a soft-threshold tapering is more appropriate. Rescaling offers such a tapering approach. The question then becomes which rescaling to use, or alternatively, how much tapering do we want. We use Lq-rescaling because it offers a class of choices (and integrates well into the gradient descent algorithm). With Lq-rescaling, different choices of q weight phrases relatively differently, allowing for focus on more common or uncommon phrases at the desire of the researcher. Overall, lower q means generally higher normalization factors Z, which will change the appropriate C for regularization. The main point of concern, however, is the relative sizes of the weights for rare phrases compared to common phrases. In general, a L1.25-rescaling heavily penalizes common phrases while a L3-rescaling does not. On the other hand, L3- rescaling penalizes rare phrases slightly more than lower choices of q. To illustrate, see Figure 1; here we consider a sequence of phrases that appear once in each of m out of 1000 documents. The different series of weights have been rescaled so a phrase which appears 5% of the time (50 times) has the same weight for all choices. tf-idf rescaling. A related strategy for rescaling is tf-idf rescaling, from information re- trieval [10]. It is typically something like (variations exist): rj ≡ log xij = · rj n dj , cij ni with with dj being the total number of documents containing the phrase j. It differs in that it corrects for each document length with the ni; we do not do so. If documents are roughly the same length, this becomes less relevant. Tf-idf also puts more of an extreme difference between weights for rare and common phrases, scaled by the total number of documents. For rare and mid-range phrases, the tf-idf rescaling is similar to a Lq-rescaling with large q. 10 Figure 1. Impact of Different Choices of Rescaling. Here we see different rescaling factors z for phrases with a single appearance for each of m documents out of 1000 total documents. More common phrases are penalized more greatly relative to rare phrases. 4.2 Interpretation and negative coefficients CCS returns a list of phrases with non-zero coefficients β. Interpreting these coefficients can be quite difficult. Just as in OLS, a model-based interpretation for βk would be that changing feature k by 1 would change the prediction by βk holding other features fixed (which, given normalization, means changing feature k by a count of 1 would change the outcome by βk/zk). However, given the lack of a well-motivated model in our context, interpreting the magnitude of these coefficients is somewhat dubious. Nonetheless, we still wish to interpret the sign of the coefficients: positive indicates a feature is associated with our positive class of documents, and negative indicates the negative class. When the negative group is a baseline, however, it is not an object of direct interest. This is especially the case if it is much larger and more diverse than the positive class. In this case the regression is ideally subtracting out baseline characteristics, leaving the researcher with what makes the positive class distinct and noteworthy. Here, interpreting negative coefficients can be difficult. One interpretation would be that such features are "conspicuous in their absence." Unfortunately, even when there is a mix of positive and negative features, we can still end up with unclear interpretations of the sign due to the "holding other features constant" aspect of the above. For example, a negative weight for a feature might be offsetting the positive weight for a highly correlated alternate feature, and in fact both features may have a positive correlation with the labeling. In this case, interpreting the negative sign as, e.g., conspicuous in its absence, is erroneous. It is more accurate to say the feature is conspicuous in its absence given its normal association with the second feature. This can be hard to communicate. One solution is to extend the optimization to consider only the set of positive β, forcing negative coefficients to not exist. This is an easy extension of the above algorithm: simply 11 12510205010020050001234Different Rescaling Results in Different Zmzp=1.25p=2p=3tf−idf drop the lower bound on the gradient search and truncate any line-search update of a βk at 0. This is not to say that negative features are useless. For example, if we allow negative features and find all the coefficients are positive, it would suggest that the positive group has a clearer signal than the negative group. Only phrases found in the positive group are differentiating the groups. This might suggest distinct language use, larger vocabulary, or specific turns of phrase on the part of the positive group, which could be of interest in its own right. 5 Picking the regularization parameter For most regularized regression settings, picking the regularization parameter C is a noto- riously difficult problem. In general, higher Cs lead to fewer features, i.e., more concise summaries. Low C summaries will be more verbose. However, an overly low C allows for over-fitting, which in our context means obtaining features that are detected soley due to random fluctuations in the appearance patterns of phrases. We need to ensure that C is sufficiently large to mostly prune out such noise. Classically, selection of C is done using methods such as cross-validation to optimize prediction accuracy on out-of-sample predictions. As prediction is not our primary focus, we look for other methods to select C that enhance the quality or interpretability of the sum- maries generated. The lack of appropriateness of prediction accuracy is somewhat motivated by the literature; prediction accuracy is, for example, not the same as model selection, as is illustrated by the choice between AIC and BIC selection methods in regression. We present two methods, rooted in the goals of CCS, to select C. The first is to conduct a permutation test to select a C that gives a statistically significant summary in that the summary being non-empty indicates the presence of systematic differences in the text between the positively and negatively marked documents. The second is to select a minimum C to guarantee the pruning of very rare phrases. We discuss how one might select which approach to use in the discussion after the case studies, below. 5.1 A permutation test on the summary One might wonder if the phrases returned by CCS are simply due to random chance. There are so many different phrases, it is reasonable to believe some will randomly be associated with any document labeling. We can control this with a permutation test. This is an exact test, and the resulting p-value is easy to interpret. To test whether it is meaningful to generate a summary at all, repeatedly randomize the labeling across the documents, regress, and find the corresponding C∗ that zeros out all the features, given our random permutation of the labels. This gives a "null distribution" of what C is appropriate if there were no signal. Finally, compare our originally observed C obs to this distribution of fake C∗s. We calculate a p-value of p = Pr(cid:8)C obs ≥ C∗(cid:9) . 12 If p is small, we conclude that the needed regularization to zero out our originally observed signal is greater than that for a random signal; i.e., there is a relationship between the labeling and the text. Similarly, if we pick a C that is at the 95th percentile of our permutation distribution, we are 95% confident that the resulting summary being non-empty is due to the relationship of the labeling and the text, and not due to random chance. The individual phrases, however, are not specifically tested as being significant; it is possible that they would change, for example, given mild perturbations to the data. Never- theless, this test provides a useful minimum bound for the final C. Any C lower than this bound could result in a non-empty summary purely due to random chance. In a similar manner, one can check the coherence of final summaries by generating sum- maries under different permutations of the labeling (potentially adjusting C with each iter- ation to get similar length summaries for all permutations) and creating a list of lists with the actual summary randomly inserted. If humans can then reliably pick out the actual summary from the fake ones, this is indication that the structure of the summary is not due to random chance. This idea is based on assessing the quality of EDA visualizations; see [39]. 5.2 Pruning rare phrases Most potential phrases are rare, showing up only a handful of times in even very large corpora. Selecting from such phrases introduces a severe multiple testing problem, and we seek to appropriately regularize the regression with C to solve it. In particular, rare phrases that show up only a few times can be selected if they happen to fall only in the positive set. More generally, with improper rescaling of features, a term that shows up once in the positive examples with a high count and several times in the negative examples with a low count can also be selected. This often is contrary to the interpretive goal behind selecting predictors. We want phrases that are general summaries, informing the researcher of aspects across multiple documents. These problems can be partially remedied by proper selection of the tuning parameter C. Here we investigate minimal C to guarantee that quite rare phrases are dropped. We find such C by investigating so-called "perfect predictors." Consider a feature j such that cij = 0 if yi = −1 and cij = 1 for some of the documents where yi = +1. For the moment, assume we do not have multiple counts in any document. This is a perfect i cij ≤ s of the s positive documents. These perfect predictors could be used to identify a subset of the positive examples while incurring no loss for the negative examples. The only cost of including such a predictor is due to the regularization term C. If we set C high enough, the cost will be prohibitive and we will not select. In fact, the cut-off of predictor, predicting r ≡(cid:80) C∗ = 2(1 − µ)r1−1/q, Yi, with Yi being the prediction for document i without any such hypothetical with µ = 1 m phrase, suffices. See Appendix B for a derivation. For this C∗, any perfect predictor of r documents will be pruned. For comparison, see Table 1, which shows (for both µ ≈ −1, the case of few positive and many negative examples, and µ ≈ 0, the case of roughly equal numbers of positive and negative documents) the needed 13 cut-offs for r = 1, 2, 4. This cutoff will generally be overly aggressive; if other predictors also predict these documents, then the gain of including the perfect predictor is potentially less. C∗ q ∞ 2(1 − µ)r 2(1 − µ)r3/4 √ 4 2(1 − µ) 2 r 2(1 − µ)r1/4 4/3 2(1 − µ) 1 µ ≈ −1 r = 2 8 r = 1 r = 4 4 16 4 ≈ 6.7 ≈ 11.3 8 4 4 ≈ 4.75 ≈ 5.7 4 4 √ 2 4 4 µ ≈ 0 r = 2 4 √ 2 r = 1 r = 4 2 8 2 ≈ 3.4 ≈ 5.6 4 2 2 ≈ 2.4 ≈ 2.8 2 2 2 Table 1. Needed C to Prune Rare Perfect Predictors. No rescaling. As discussed at the end of Section 3.1, no rescaling is bad for appropriately handling common phrases. No rescaling is also bad for appropriately handling rare ones, as we can see by its connection to the infinity-norm and the top row of the table. No rescaling of features makes it very difficult to prune perfect predictors. Singleton predictors. As a special case, "singleton predictors" are those that appear only once in the entire corpus, and appear for a positive example. Normally if such a rare phrase appears once in a positive example, it can be pruned as described above. Regardless of q, in order to remove singletons that predict for a document with no other predictors, we must have C ≥ 2(1 − µ). This can be generalized somewhat. Consider, for q = 2, if the count of a phrase for a single positive document is s and the count for t negative documents for that same phrase are 1 each. The L2 normalizing constant is then n(cid:88) Z = cki = s2 + t √ s2 + t ≈ 1 for the single positive document and xki = 1/ √ s2 + t ≈ 1/s and xki = s/ for the few negative documents. This is approximately the same as the singleton phrase circumstance, and will therefore be pruned as above. i=1 Proper selection of the tuning parameter is a better approach for pruning than cutting by dropping phrases with low counts (ignoring computational issues), as it can also prune near-singleton phrases with high counts. This circumstance indeed arises. In a study of the Fat/Cats corpus, below, the word "lion," used 8 times for a report involving a plague-ridden mountain lion corpse (positive example) and 9 times in various negative examples, was kept as a predictor in the final summary of "Disease" when C was too low (C = 0.5). 5.3 Regularization with Cross-Validation The traditional form of selecting a tuning parameter is via cross-validation where some metric of predictive performance is optimized. For example, in our context we could calculate the 14 predicted labeling of set-aside documents and select C such that the average squared distance between predictions and actual is minimized. As we will see, this tends to give longer lists which can be less interpretable as more important signal can be buried amongst less-relevant terms. Generally, predictive performance is not directly a measure of our primary focus: the interpretability and significance of the selected phrases. 5.4 Regularization with early stopping and the elastic net The original Ifrim, et al method includes both a penalty term in the loss function but also regularizes by stopping before full convergence. Different choices of C do affect the resulting model, but early stopping is an easy way to obtain a list of specified length quite quickly (although if the list is non-sensical then this is obviously not a good move). Ifrim's initial paper in fact has no penalty term in the loss function at all-their entire regularization is due to early stopping. The relationship of these forms of regularization is unclear; early stopping clearly has great computational advantages and there is no need for convergence checks; we simply stop when we have found enough features of interest. However, it is unclear, for example, whether this approach alone will successfully prune out rare phrases. 6 Computational Comparisons We compare our CCS tool to three other methods in two studies. The first compares running time and general characteristics of the final word lists, generally using default values and recommended approaches for setting tuning parameters. The second compares prediction accuracy for the four methods. In a third study, we also examine the CCS tool under different choices of q. For our data, we use our Fat/Cats corpus and our ECAB corpus, both of which we describe more fully in the case studies section below. 6.1 The Four Methods The main comparison method is multinomial inverse regression (MNIR) [5], a text regres- sion method that is primarily designed to be distributed across many cores in order to be able to handle massive data. It parallelizes the regression by conducting individual inverse regressions of the counts of phrases onto the feature space (which is in our case the binary labeling). It is regularized, giving a sparse feature vector. The recommendation of MNIR, regarding tuning, is to use AIC or BIC penalization. We selected BIC because we are more interested in interpreting the covariates than in the quality of prediction, and BIC is known to be superior for model recovery as compared to AIC (see, e.g., [40] or, more generally, [16]). We used the textir [5] package. MNIR resulted in very long lists (of often more than a thousand words) so we truncated the list by taking the words with the top 1000 weights. For practical use we would advocate greater regularization via, e.g., cross validation, to restrict the list further. 15 We also compare to a classic linear Lasso approach (see, e.g., [6]). Earlier work [1] shows that the gains from logistic over linear are minimal, and the computational expense is large. We use the glmnet package [41], selecting the regularization parameter with cross validation on the RMSE test error. The standard package automatically standardizes the columns, so this method uses L2-rescaling. Generally the Lasso lists were short, but if they were above 1000 words we truncated as above. We finally compare to the original n-gram method of Ifrim et al. Other than our own, there does not seem to be an R package implementing this approach, so we replicated their method by using our binary features option and not rescaling the columns. For a more direct comparison, we select the tuning parameter with our permutation approach. They initially advocated early stopping to regularize, but in later work (and in their C++ package which we extended and modified for our package) they introduced direct regularization. In the first two studies we used L2 normalization for our method. We select C two ways: the permutation approach discussed above and to a fixed C = 8 to prune perfect predictors for 3 or fewer documents. We did not allow gaps in phrases, and did not upper bound phrase length. For the permutation, we permuted 10 times and took the maximum as the C as the C from the permutations do not vary much. We ran our trials primarily on the cleaned Fat/Cat dataset stemmed with Porter stem- ming [42] via the tm [43] package. See Section 7.1 for further details. For the latter two methods the data was stored in a flat file of cleaned and stemmed text, with each line cor- responding to a single document. For the first two methods we generated a document-term matrix from this text, dropping all terms that appeared fewer than 5 times to keep the matrix manageable. This resulted in 8698 unigrams, 81,863 bigrams and 122,528 trigrams. There are 49,558 documents in total. We ran the lasso twice, first with unigrams and second with all unigrams through trigrams. For MNIR we only use unigrams; the number of fea- tures generated when we expanded to trigrams was computationally prohibitive on a single computer. To obtain labeling, we selected a random sample of 100 of the 1400 keywords associated with the Fat/Cat reports, weighted by the frequency of the keywords's appearance, to form the labeling schemes to evaluate. For each keyword we dropped any phrases from consid- eration as a feature (e.g., phrases with "carbon" or "monoxide" for the carbon monoxide keyword were dropped) by either passing these words as banned words to our algorithm or dropping the relevant columns from the document-term matrix. To further understand computational timing, we also replicated our first comparison study on the ECAB legal decisions discussed below. Here we had 7 judges that were part of overlapping subsets of decisions, and we compared each judge to baseline (this is not our labeling of primary interest in the case study below). For the first computational comparison, we ran the four methods on the full data and compared runtimes and characteristics of the final word lists. For the second computation comparison, we set aside a random 15% of the data, and then predicted the labeling of the set-aside data using each method. The Lasso, the Ifrim et al., and our method all produce nominal predictive scores, often overly low due to the massive imbalance of the positive and negative classes. To find a cut-point for classification, we fit a logistic regression model on whatever predictive value came out of the method on the training set, and then classified by 16 determining whether the predicted log-odds were above or below 0. For the MNIR method we first projected the results of the inverse regression as described in [5] and used the resulting score as the covariate in the logistic regression modeling step. We also calculated AUC scores using the raw predictive scores for all methods. Our third investigation was on the impact of different choices of q for Lq-rescaling when using our method. We again generated word lists for each of our 100 keywords, and calculated average length and average frequency of words for the resulting lists for q = 1.2, 2, and 4. We put no upper bound on phrase length. Simulations were run on a MacBook pro with a 2.9 GHz Intel Core i5 processor, 16 GB of memory, and a solid state drive. Reproducible R code for all simulations is available on request. 6.2 Comparison Results For each labeling and each method, we calculated different statistics on the word lists. We also timed the total time to generate a list. Table 2 has the average of these measures across the 100 labelings. A few general trends are evident. List characteristics. Overall the resulting lists are very different in character. We cal- culated average list length, and then, for lists truncated at the top 1000 terms, calculated the mean and median frequency of the words to gauge how common or rare selected phrases were. We finally averaged these means and medians across the different labeling runs. We see the different methods are quite different in terms of these scores. MNIR gives very long lists of very specific words; this is probably due to the inverse regression, which selects all phrases that are relevant without much regard to correlation structure between them. The Lasso also tends to have longer lists, but the average appear- ance of the selected words is on par with the n-gram feature-rescaled regressions. However, when the Lasso had access to trigrams, which can be highly targeted and specific, the median frequency plummeted to 13. For pentagrams, it went to 12. As expected, the Ifrim method, due to no column rescaling, selects very general terms, with a median frequency of around 10,000. For the OSHA dataset, the permutation C values tended to be close to the fixed C, giving overall word lists that were similar as well. For the ECAB dataset, with longer documents, the permutation-selected C was much higher, and thus the word lists were much shorter due to the greater regularization. The resulting words were also typically more general. Overall, it is clear that the practitioner can use different methods to get different types of lists. We believe, generally, that one wants short lists of phrases, and that those phrases should not be overly general. Runtime. Runtimes were generally comparable for our OSHA data but widely different for the ECAB data. We discuss the OSHA data first. The Lasso method, even including its cross-validation step, was quite comparable to the textreg method with respect to time due to its very fast implementation. It is also robust to very wide feature matrices; note the average time for using all trigrams is the same as for just unigrams. The Ifrim method is 17 faster than the textreg methods, likely due to improved pruning. MNIR is also quite fast, event though it is designed for parallel systems and we ran on a single core. Generally, the computational times to generate summaries are comparable. However, MNIR on the trigrams was not workable. As MNIR is linear in the number of features, the blow-up of features was too much of a time increase. Of course, multiple machines and its parallel structure could avoid this. We were quite surprised by the time statistics being insensitive to number of terms for the glmnet package. To investigate further we calculated a document-term matrix for all phrases up to 5 words, giving 363,132 unique terms, giving the extra row in Table 2. Here average runtimes for the Lasso increased modestly by about 16% to a mean of 101 seconds. The computational times were more spread out for the ECAB data; see the bottom half of Table 2. We now see a substantially increased time from moving to unigrams to trigrams for the Lasso and the timing of the textreg methods exploded. In investigating this time differential further, we found many selected phrases had 5 or more words. Furthermore, most runs reached the maximum number of iterations before convergence, indicating flat surfaces. This is a weakness of greedy coordinate descent, which we discuss further below. Overall we potentially have, due to the use of boilerplate language in legal writing, long yet informative phrases that we wish to see in our summaries. This could make pre-generation of candidate phrases prohibitively expensive. The MNIR method selected all unigrams; each unigram apparently has enough difference in use across judges to be selected under the BIC penalization. The times for the Lasso and MNIR do not include the time to generate the document-term matrix, which was 7.4 minutes for 5-grams and 3.7 minutes for trigrams. method Ifrim lasso lasso (trigrams) lasso (pentagrams) MNIR textreg textreg (fixed C) Ifrim lasso lasso (trigrams) MNIR textreg textreg (fixed C) time (avg sec) 21.5 87.6 86.6 101.1 42.1 71.2 46.4 63.8 38.5 138.8 163.9 540.3 555.6 list length (avg) 25 194 440 502 8,696 25 24 8 261 800 25,990 14 64 word freq (avg) 15,285 5,441 657 503 3,818 1441 1711 17,861 3643 898 31 12,595 2481 (median) 10,178 217 13 12 392 371 472 16,872 109 21 16 10,639 653 Table 2. Results of comparison study on OSHA reports (top) and ECAB legal decisions (bottom). Runtime does not include time to generate the document-term matrix for the Lasso and MNIR. 18 6.3 Predictive Accuracy Results To assess predictive accuracy we used the macro-averaged F 1 statistic [44] (F 1 calculated for each of the 100 trials and then averaged). See Table 3. All methods would sometimes score none of the test set documents as positive, giving undefined F 1 scores. These are also indicated on the table. Figure 2 shows these scores along with the component precision and recall, as well as AUC scores, for those keywords where all methods had defined F 1. The predictive accuracy is comparable across the methods, although our text regularization does suffer some due to over-regularization from the permutation method. Overall, predictive accuracy is low; recall, in particular, tends to run around 20% for all methods, although the Lasso with trigrams was noticeably superior. We also examined AUC scores. Here we again see the cost of textreg's over-regularization: conservative classification reduces sensitivity greatly, lowering the ROC and AUC scores. The AUC scores are deceptively high due to the imbalance between positive and negative examples. Generally, the superior performance of the Lasso on trigrams indicates that rescaling fea- tures coupled with the richer feature set of multiple words is useful for prediction tasks. Our methods results indicate over-regularization is detrimental to prediction due to, primarily, diminished ability to predict positive documents as positive (shown by the recall scores). method MNIR lasso lasso (trigrams) Ifrim textreg f1 0.22 0.28 0.36 0.25 0.23 sd # missing 19 6 6 16 7 0.22 0.24 0.25 0.24 0.23 Table 3. F 1 scores for different methods averaged across keywords examined (with standard deviations). Number of keywords with no defined F 1 (out of 100) also indicated. 6.4 Selection of q Results As anticipated, different values of q produce lists of different quality. Results are on Table 4. Higher q corresponds to lists with relatively more common words and phrases. Low q pro- duces lists that tend to have phrases with more words. For the q = 1.2 list, more than half the phrases were 3 words or longer. We also found that the length of the list increased with q. For q = 4 we had longer lists with more common words. For low q the algorithm selected very targeted phrases, and not too many of them. The regularization parameter C is not comparable across q. Therefore we recalculated it via the permutation approach for each run and value of q. Mean values for C are shown on the table for reference. Generally we find a rule of thumb worth remembering: longer lists tend to have more general terms. This can happen by adjusting either C or q (see first simulation and compare different C, for example). 19 Figure 2. Out-of-sample classification rates for different methods. Lasso on trigrams (Lasso-3) is generally the best, although there is substantial variability. Keywords where any of the methods failed to return F 1 scores were dropped. Charts substantively the same when these keywords included. method textreg.1.2 textreg.2 textreg.4 time (avg sec) 78.7 72.8 135.3 (avg) 8 24 35 list length phrase length word freq word freq (median) 110 435 1761 (avg) 310 1492 8035 (avg) 2.9 2.2 1.8 C (avg) 4.6 7.1 19.0 Table 4. Word list characteristics of different rescaling norms. Length is length of list, mean size is average number of words in the selected phrases, frequency refers to phrase occurrence in the corpus. Mean C is the average regularization value. 6.5 Discussion Overall, our method succeeds in accommodating multiple word phrases while also allowing for an intercept and the rescaling of features. As shown, these extensions are critical for generating manageable lists with phrases that are not overly common. Further, picking C and q does control both list length and commonality of words on the lists as predicted by our initial discussion. In terms of computational time our method did not perform particularly well when compared to the Lasso of the glmnet package, especially considering that the Lasso's overall time includes that of cross validation. As our method is similar to Lasso regression on a pre-constructed phrase matrix (differing only in that it uses a hinge-loss instead of a squared loss), one might naturally ask whether an alternative approach would be to simply generate the full document-term matrix and use glmnet. We are not entirely convinced, as we discuss next. 20 llllllllllllllllifrimtextregMNIRlassolasso.tri0.00.40.8f1lllllllllllllllllllllllllllifrimtextregMNIRlassolasso.tri0.40.60.81.0aucifrimtextregMNIRlassolasso.tri0.00.40.8precisionlllllllllllllllllllllllllllllllllllllifrimtextregMNIRlassolasso.tri0.00.40.8recall First, generating full document-term matrices including phrases with wildcards could be computationally tedious, especially if we imagine extensions such as optionally included words. At the very least, it is expensive in both time and memory, and grows increasingly so with the number of possible phrases; the 7 minutes to generate all 5-grams is well over the model-fitting times. The stored matrix was twice the size of the initial raw text. Second, the hinge loss is different from the classic L2 loss, and there could be core differences in overall behavior here; this is an area for future investigation. Third, the speed of the glmnet package is partially due to the LARS approach where the entire regularization path is computed at once. It is arguably also due to the package being particularly well-developed and optimized for efficiency. There may be similar ways to substantially speed up our package and method to make it more competitive. For example, one potential slow-down, determined from examining the convergence paths of many runs, is that we often see an initial selection of a small list of phrases and then a slow hill climb where with each step a different already-selected phrase is selected for adjustment. This comes from the coordinate descent; the optimal gradient path is at an angle, and so following it requires small steps in the associated coordinate directions to trace that path. Unfortunately, with each such step the algorithm conducts a full search for the highest gradient across all phrases, which is expensive. We might instead, after each phrase is selected, find the maximum point given the set of all phrases selected at that point. Then only if a new phrase were introduced would the algorithm have further steps. This is effectively the LARS [6] approach, and is an important area for enhancement. Furthermore, the greedy ascent iteration often involves the intercept ratcheting down as features ratchet up. This suggests another possible direction of forcing the intercept to be −1 (for corpora with rare positive labeling rates) rather than estimating it; a −1 intercept corresponds to predicting all documents as negative by default, distinct from no intercept which predicts 50-50 uncertainty as default or allowing the intercept to move which tends to predict the overall base rate as default. Specifying the intercept value would save an intercept update with each step; the optimization problem is then finding a collection of phrases to give positive documents positive weight without affecting the negative documents too heavily. Regardless, for truly massive data, especially when the number of documents grows large, neither our approach or the Lasso will work. Instead, methods that allow for easy parallelization, such as MNIR, will be key. Another area for future exploration, therefore, is to determine how to over-regularize MNIR to get shorter lists, which also might induce lists with more common phrases. 7 Case Studies We illustrate the CCS tool with two case studies. For the first case study, we also compare the resulting summaries from CCS to the three other methods discussed above. An overview of the code to generate these results using our textreg R package (available on CRAN) is in the appendix. Full scripts and data are available on our website.1 For other studies using 1Website address is http://scholar.harvard.edu/lmiratrix/software/textreg-r-package 21 similar tools see, for example, [1] or [33]. Before presenting our results, we discuss data representation. 7.1 Data representation and cleaning There are many choices one might make in preparing a corpus for statistical analysis. It is common to, for example, convert text to lowercase and to drop all punctuation. We take that approach here, although we convert all digits to 'X' (to preserve the presence of numbers, in case that is informative) and convert hyphens to blank spaces (so the sequence of hyphenated words would coincide with a non-hyphenated similar phrase-something not possible with single word analyses). Most text analysis packages would then convert the raw text into an m × p matrix of counts, dropping any stop words, but because of the greedy coordinate descent algorithm, unknown phrase length, and the related generation of features on-the-fly, we store the text as raw strings, with one string per document. There is some controversy as to whether to "stem" documents, which is where the tails of many words are cropped so as to collapse the number of possible words. For example "clean," "cleaning" and "cleaner" might all be cropped to "clean+" This has the disadvantage of making resulting text output somewhat difficult to read, especially when considering phrases. Stemming can also lose textual meaning if the different suffixes are in fact important in the context. It has the advantage, particularly for phrases, of collapsing several different versions of phrases into one. We provide stemming as an option but, to enhance readability of output, append a '+' to the end of all stemmed words (and their roots) to indicate they have been potentially cropped. We also provide tools to wildcard search for stemmed phrases in the original text so as to recover examples of the complete phrases. Sometimes a given context involves words that are known a priori, or nearly a priori, to have no meaning. We therefore provide a option for custom-made, short stop-word lists (i.e., a list of banned words) that are prohibited from being in any summary phrase. Generally these lists are built on the fly as an iterative process. The first summary generated will often contain words that are immediately recognizable as inconsequential to a researcher with pre-existing contextual knowledge, even though they are correlated with the labeling. The researcher would then drop these words, rerun the algorithm, and repeat as necessary. We do not see any way to avoid this; the case studies below illustrate why. 7.2 Fat/Cats Our main investigation relies on OSHA's publicly available summaries of occupational fa- talities and catastrophes ("Fat/Cats"),2 in the United States, from 2000 to 2010. These summaries describe workplace incidents that have resulted in death or the inpatient hospi- talization of three or more workers. When such an event occurs, an employer must report it to OSHA.34 In the course of conducting the resulting investigation, OSHA generates a 2Website address is http://ogesdw.dol.gov/views/data_catalogs.php. 329 C.F.R. 1904.39(a) 4OSHA recently expanded the list of reportable events to include the loss of an eye, amputation, or inpatient hospitalization. Occupational Injury and Illness Reporting Requirements-NAICS Update and 22 narrative report, part of which becomes publicly available and is annotated with any of a set of about 1400 keywords to categorize the narrative reports in terms of specific chemicals involved, machinery involved, body parts affected, and other salient features. The publicly available records primarily consist of a title, a short paragraph summary of the incident, along with the date, whether the incident involved a fatality, and several other covariates. We concatenated the title and paragraph description to form the documents. These documents tend to be 56 to 136 words long (these are the 1st and 3rd quantiles), with a minimum length of 4 words and a longest report of 791 words. After stemming there were 49,840 unique unigrams (word stems), of which 12,700 appeared 10 or more times and 4,704 appeared 100 or more times. To investigate this corpus, we can, for any keyword, generate a labeling of the narrative reports by setting those reports tagged with the keyword as +1 and the remainder as −1. Using CCS on this would then summarize the collection of reports marked with a keyword by comparing them to all other reports. Ideally this would take out words common to these reports (e.g., "employee" or other general work-place terms), leaving us with phrases that make the identified set stand out. We would interpret this summary as a distillation of what is distinct about this category of Fat/Cats as compared to Fat/Cats in general. By periodically summarizing reports for each keyword of interest, researchers may gain information about emerging hazards and trends in circumstances. Hopefully the resulting summaries would be faster to read than the individual narratives, but still contain hints as to general themes within these narratives. As chemical exposure is an area of particular interest for enhanced surveillance and under- standing, we generated a background comparison set of documents by identifying keywords that we deemed to be at least loosely associated with chemical exposure. We then defined the "chemical family" of narratives as all narratives that were labeled with at least one of these keywords. This allowed us to compare various categories of narratives within the lim- ited context of this chemical family, as well as within the larger context of all other types of narratives. Changing the background set highlights different aspects of what sets apart a marked collection of reports. As an overview of the overall number of narratives of different topics of interest, Table 5 shows the appearance pattern of the categories examined. We discuss Methylene Chloride and Carbon Monoxide here, and defer Chemical Reaction to a supplementary document. The table also shows how many narratives involved a fatality. 7.2.1 Methylene Chloride As it is our motivating example, we first examined Methylene Chloride. We initially selected a value of C = 4 to ensure that we prune all singleton perfect predictors (see Section 5.2). There are 17 reports marked with the "Methylene Chloride" keyword. Running CCS on these reports returns two words, "methylene" and "chloride." As these words are not of interest, we immediately added these words to the ban list and reran. Table 6 displays the resulting summary comparing these 17 narratives to all the other narratives. Reporting Revisions, 79 Fed. Reg. 56129-56188 (September 18, 2014)(amending 29 C.F.R. 1904.39). 23 Methylene Chloride Carbon Monoxide Chemical Reaction General # 17 243 115 Fatality 20,691 49,558 % 0.03% 0.5 0.2 41.8 100.0 Total Chemical # 17 243 115 2,575 7,014 % 0.2% 3.5 1.6 36.7 100.0 Table 5. Number of Narratives with Different Keyword Labelings. Second pair of columns restrict database to only reports related to chemical exposure. The summarizer picks up on the coherent theme across these reports of bathroom re- finishing. This example is quite encouraging, given our prior knowledge of the dangers of Methylene Chloride, but the utility of CCS in detecting yet unknown patterns remains to be seen. If we select C based on the 95th percentile of 100 permutations, we obtain C = 5.65. The needed C to result in a null summary is, by comparison, C obs = 6.92. We conclude that there is a statistically significant relationship between the text and the keyword (beyond the presence of the banned words), and that the summary is thus informative. The corre- sponding summary for C = 5.65 is quite succinct, containing only "a bathtub" and "stripper contained." Picking C to give statistical significance appears, here, to drop informative phrases. phrase a bathtub paint stripper stripper contained and reglazing from a bathtub remover contained stripping agent tub head # phrase # reports # tag % tag % phrase 29 18 18 12 12 12 12 12 56 60 100 100 100 100 100 100 9 5 3 2 2 2 2 2 9 5 3 2 2 2 2 2 5 3 3 2 2 2 2 2 Table 6. Methylene Chloride (L2-rescaling, against all reports). # Phrase is total occurrence of phrase; # reports is number of reports containing phrase; # tag is number of Methylene Chloride reports containing phrase; % tag is percent of phrase appearances in Methylene Chloride reports; and % phrase is percent of Methylene Chloride reports containing phrase. The summaries do not necessarily capture information in all tagged documents. In this case, for example, six of the Methylene Chloride reports do not have any of the phrases on Table 6, and so are not represented. A manual review of these reports revealed that four involved "stripper"s for tile, floors, and furniture. One involved an explosion and one, quite terse, only referred to Methylene Chloride gas. 7.2.2 Carbon Monoxide We also examined reports relating to Carbon Monoxide, an asphyxiant odorless gas. We ran CCS with different values of q for Lq-rescaling to examine the impact of different levels of 24 rescaling. We compared the CO cases to all other cases involving any of a set of keywords predetermined to be related to some sort of chemical exposure (i.e., those narratives marked as members of the "chemical family"). To reduce computational time, we limited attention to phrases that appear at least five times in the corpus. Results are in Table 7. To obtain these results we summarized in an iterative process; words such as "car- bon," "monoxide," "gas," "poisoning," "exposed," "exposure," "overexposed," "carboxy- hemoglobin," "ppm," "levels," "partspermillion," "overcome," and "co" were eventually dropped. We also removed the more specialized "hyperbaric," having to do with a med- ical intervention for CO poisoning and "cohb," an abbreviation for carboxyhemoglobin, a molecular complex that hemoglobin and carbon monoxide form in the body. All of these words appeared in initial summaries and are due to the technical and/or obvious aspects of CO poisoning; they do not reveal trends or characteristics of interest and thus obscure the desired results. None of these words would have appeared on any conventional stop word list. As they are in fact correlated with the category, we see no way of automatically removing them. The final results reflect several known patterns in CO poisoning. For example, the exhaust from gasoline and propane powered engines are major culprits of these exposures, particularly in combination with poorly ventilated enclosed spaces. The appearance of the phrase "cold room" appears to reflect incidents in which propane-fueled forklifts and floor cleaning devices were the source of carbon monoxide exposure within cold storage areas, where ventilation can be poor. In investigating hospitalization, we found 17% of the CO poisoning cases contained "were hospitalized" versus only 5% of the other chemical-related narratives and 1% of the non- chemical narratives. The fire department was mentioned in nearly 9% of these narratives versus a baseline of 0.5%. This all may be due to lower rates of fatality, with only 36% of the CO poisoning cases involving fatalities as compared to 37% for other chemical family reports and 43% for non-chemical-family reports. Interestingly, "dead" appears in 16% of the CO narratives as compared to 5% in the remainder of the chemical family. Different rescalings give different styles of summaries. The smaller q = 1.2 and q = 1.5 have very specific phrases (e.g., "were using a gasoline" and "their blood") that appear only in the positively marked documents. Larger q give more phrases overall, and give phrases that appear at higher rates in both the positive and negative class. For example, "employees," with more than 10,000 appearances, appears for q = 4. Overall, infrequent and specific phrases are relatively easy to interpret, and the more common phrases less so. But their patterns of appearance are striking. "Employees," for example, appears in 52% of the CO narratives versus a baseline of a mere 11%! Less sur- prisingly, "enclosed" appears 7% of the time versus less than 0.5% at baseline. Table 7 contrasts "Carbon Monoxide" to all incidents labeled with other chemical-related keywords. We also compared CO cases to the full set of cases in the database. That is, we summarized the same collection of reports, but used a different baseline point of comparison. Results are in Table 11, in the Appendix. They are broadly similar. We also analyzed the data using stemming. See Table 12 in the Appendix. Results are again broadly similar (but possibly harder to read). Stemming collapses phrases, which can be helpful, but hampers human readability. 25 phrase a propane powered their blood gasoline powered concrete saw an X hour the fire department measured in a cold operating a propane propane operated were using a gasoline propane powered powered forklifts for fresh the generator was X hour overexposure exhaust generator was blood a gasoline average found were treated the fire department hour source of the ventilation enclosed were taken employees employees were were fire department a propane were hospitalized dead warehouse q=1.2 0.25 0.16 0.15 0.11 0.10 0.09 0.09 0.09 0.07 0.07 q=1.5 0.02 0.13 0.29 0.24 q=2 0.28 0.18 q=3 0.05 0.25 0.17 0.13 0.25 0.20 0.13 0.13 0.06 0.02 0.23 0.35 0.21 0.03 0.15 0.04 0.04 0.03 0.22 0.41 0.26 0.26 0.10 0.08 0.06 0.08 0.07 0.06 0.05 0.05 0.03 0.01 0.01 0.01 0.01 0.01 0.01 0.00 0.13 0.44 0.22 q=4 # reports # tagged 15 0.07 5 30 9 6 4 4 6 4 5 28 85 16 4 7 11 18 35 10 30 26 10 68 22 21 23 12 32 18 23 126 66 168 36 26 42 38 19 17 5 41 10 6 4 4 6 4 5 34 169 23 4 9 16 37 112 14 98 48 16 554 111 90 85 32 130 66 97 1400 590 2777 211 96 384 372 92 0.21 0.08 0.28 0.10 0.04 0.10 0.05 0.06 0.05 0.01 0.03 0.02 0.02 0.01 0.02 0.01 0.01 0.01 0.02 0.02 0.01 0.01 0.01 % tagged 88.00 100.00 73.00 90.00 100.00 100.00 100.00 100.00 100.00 100.00 82.00 50.00 70.00 100.00 78.00 69.00 49.00 31.00 71.00 31.00 54.00 62.00 12.00 20.00 23.00 27.00 38.00 25.00 27.00 24.00 9.00 11.00 6.00 17.00 27.00 11.00 10.00 21.00 % phrase 6.00 2.00 12.00 4.00 2.00 2.00 2.00 2.00 2.00 2.00 12.00 35.00 7.00 2.00 3.00 5.00 7.00 14.00 4.00 12.00 11.00 4.00 28.00 9.00 9.00 9.00 5.00 13.00 7.00 9.00 52.00 27.00 69.00 15.00 11.00 17.00 16.00 8.00 Table 7. Different Summaries of Carbon Monoxide (compared to Chemical Family narratives) Finally, we compare CCS to the other methods of MNIR, the Lasso, and the Ifrim et al. approach. The methods returned summaries of very different lengths: MNIR was 293, Lasso 65, Ifrim 20, and textreg 12. We had to truncate MNIR and Lasso to display the lists, but we did this by taking the union of the top 20 words of each list and then displaying weights before truncation to see maximal overlap. See Table 8, with words sorted by frequency of appearance in the corpus. We see the lists are quite different with mild overlap. MNIR generally targets rare phrases, most of which are not displayed, Ifrim very general ones. MNIR, restricted to unigrams in this instance due to computational concerns, has less overlap than it might otherwise. Textreg has mid-range phrases with a few very rare phrases which are perfect predictors. These phrases were not included in the document-term matrix due to their rarity, so could not be on the Lasso or MNIR lists. Many of the phrases have similar meanings. For example, Ifrim has the general versions (e.g., "gasolin+") for the more specific ("gasolin+ power+") of the Lasso and textreg. 7.3 Legal decisions In the context of legal decisions, our motivating question is whether we can efficiently learn about characteristics of certain types of cases by extracting associated phrases and topics from a corpus of those cases. As an exploratory case study, we chose to examine publicly available decisions from the Employees' Compensation Appeals Board (ECAB), which con- siders appeals to determinations by the Office of Workers' Compensation Programs (OWCP) in the U.S. Department of Labor (DOL). OWCP handles compensation claims from federal 26 phrase power+ generat+ to+ level+ of approxim+ food+ poison+ for fresh+ propan+ power+ floor+ tailpip+ their blood unventil+ vanguard over+ expos+ to+ decatur receiv+ oxygen+ mek twa carbonyl exhaust+ fume+ intern+ combust+ engin+ newton power+ concret+ qa transient stratton three employe+ are expos+ weight+ averag+ brigg+ emiss+ fd poison+ at+ employe+ overcom+ by overexpos+ overexposur+ propan+ power+ gasolin+ power+ overcom+ by poison+ overcom+ ventil+ gasolin+ expos+ to+ exposur+ exhaust+ propan+ expos+ level+ found+ power+ forklift+ fell+ were+ when his was MNIR lasso ifrim textreg 0.4 0.4 0.1 0.3 0.2 0.2 0.2 0.1 0.1 0.2 0.1 0.1 0.2 0.1 0.2 0.1 0.2 0.2 0.1 0.2 0.0 0.1 6.6 5.6 5.6 6.2 5.2 7.2 7.3 5.5 5.4 5.4 5.6 5.4 5.4 6.2 5.9 5.1 5.8 4.3 3.5 3.2 4.1 3.1 2.9 2.8 2.1 1.7 1.4 0.6 1.2 0.3 0.2 0.5 0.1 0.3 0.3 0.1 0.5 0.0 0.1 0.9 0.1 0.0 0.1 0.2 0.0 0.1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 num.phrase 3 4 5 5 5 5 5 5 5 6 7 7 8 8 9 9 9 9 11 11 11 12 12 12 13 13 14 17 27 51 55 56 74 207 210 249 321 412 490 519 565 620 1053 3282 3502 5779 9118 19483 27668 36629 53632 176175 Table 8. Different Summaries of Carbon Monoxide (comparing different methods) workers injured during the course of employment. EBAC handles as many as 2000 appeals per year. Within this case law, one particular area of interest is how ECAB handles compensation claims for so-called "emotional conditions." These cases can be challenging for a number of interesting reasons. For example, establishing whether an employee's condition was legiti- mately caused by workplace conditions requires an analysis of causation that is unique in many ways from that which is appropriate in the context of a physical condition. To further probe the potential utility of CSS in extracting useful information from large bodies of technical text, we performed an exploratory analysis on the collection of ECAB decisions that relate to both mental health conditions and causality. We sought to deter- mine whether automated summaries would reveal meaningful patterns. These decisions are publicly available through DOL5. We examined years 2005 to 2010 by scraping them from the website. 5Website address is http://www.dol.gov/ecab/decisions/main.html 27 We ended up with 11,214 legal decisions, documents generally ranging in length from 1602 to 2691 words (these being the 1st and 3rd quartiles) and a median length of 2074 words. The shortest was 281 words and the longest 12,664. There are 107,302 unique words, of which 37,474 appear 10 or more times and 11,264 appear 100 or more times. These counts include case identifiers and other character strings as words. We do not attempt to remove them directly. We automatically labeled all of the decisions with two sets of dummy variables, one for emotional condition and one for discussion of causality or work-relatedness of the injury. For each, we labeled documents if they contained any of a set of handpicked key phrases. Once we tuned our collection of key phrases we took a random sample of the positively and negatively marked documents and conducted a manual review. The labeling is clearly not perfect, as is illustrated in Table 9. Ideally, the CCS method will still be able to produce relevant summaries despite the noise of the missed labels. Although it is possible that specific types of positive decisions are systematically missed due to the ad hoc labeling, discovery of meaningful summary phrases would nevertheless be suggestive. Labeling "Emotional Condition" No "Emotional Condition" Total Cases "Causality/Work-Relatedness" No "Causality/ Work-Relatedness" Total Cases Total 1479 9735 11214 4236 6978 11214 % Correct (sample) 94/100 97/100 Estimated Positive Negative Sense. Spec. 1390 292 89 9443 0.83 0.99 99/100 80/100 4194 1396 42 5582 0.75 0.99 Table 9. Manual Review of Labeling Quality for Legal Decisions Column 1 of Table 10 shows a first pass summary of those cases that both involve an emotional condition and revolve around issues of causality. We see fairly general terms and some boilerplate language. Here it is necessary to explore the raw text to discover the contexts for these phrases. This is easily done using our package. For example, one positively marked decision has: Not every injury or illness that is related to a claimant's employment is compensable. In the case of Lillian Cutler, the Board explained some distinctions as to the type of employment situations giving rise to a compensable emotional condition under FECA. C.E., Docket No. 10-461 (issued November 23, 2010) (emphasis added). Another is: To establish that an emotional condition arose in the performance of duty, a claimant must submit the following: (1) medical evidence establishing that she has an emotional or psychiatric disorder; (2) factual evidence identifying employment factors or incidents alleged to have caused or contributed to the condition; and (3) rationalized medical opinion evidence establishing that the emotional condition is causally related to the identified compensable employment factors. T.G., 58 ECAB 189 (2006) (emphasis added). 28 illness that is cutler xx ecab requirement imposed by the psychiatrist incidents alleged to have caused lillian cutler compensable disorder factor of employment and a factor of employment not covered reaction to anxiety cutler xx ecab xxx xxxx depression lillian cutler xx compensable factor of employment and results from an environment or an administrative or personnel requirement imposed allegations 0.32 0.06 0.32 0.06 0.48 0.60 0.31 0.05 0.05 0.03 0.03 0.01 0.31 0.05 0.05 0.03 0.03 0.01 main +"ecab" +"depression" +"xx" +many 0.46 0.60 0.32 0.31 0.05 0.05 0.04 0.03 0.01 0.01 0.01 0.01 0.01 0.00 0.00 0.00 0.00 0.03 0.01 0.01 0.02 0.03 0.03 0.01 0.01 0.02 0.03 0.01 0.01 0.48 0.01 0.01 0.00 0.00 0.00 0.30 0.01 0.01 0.01 0.00 0.01 0.30 0.01 0.06 0.01 0.01 0.01 0.00 0.06 0.01 0.01 0.01 0.00 Table 10. Summary of cases involving an "emotional condition" and a discussion of causality. Different columns correspond to the number of dropped phrases. First column is only "emotion" and "condition." Rest are adding more and more phrases. Column B adds "ecab," Column C "depression," and Column D "xx" (for illustration purposes). Column D includes many other terms. As an illustration of stability of CCS, consider the other columns of Table 10. Each column corresponds to dropping more and more terms from consideration. Note that the transition from the third to fourth column drops one of the case-references, "Lillian Cutler," even though we did not explicitly drop those words and phrases. CCS selected phrases are picked in the context of other phrases. Because we removed "xx" (indicating a case number), "Lillian Cutler" is no longer selected, along with other phrases including parts of this phrase and "xx." Instead we obtain a cluster of phrases showcasing different aspects of these cases. Dropping phrases can only affect a summary if those phrases are in the summary. The final two columns are the same because none of the additional phrases were in the summary from column 4. Care must be taken to understand the complex dependencies between phrases. Thus, in the context of ECAB decisions, the CCS tool provides phrases that flag boiler- plate language and case citations. To some degree, these phrases appear to reflect precedent and common statements of law that characterize a given category of cases. While our results are exploratory, inexact, and not particularly revealing in and of themselves, they do suggest that a refined CCS tool might one day facilitate the development of automated case content analysis or aid the development of refined legal taxonomies. 29 7.4 Discussion As the above studies illustrate, using these tools to understand text is a very different, and far less precise, activity than working to correctly classify text. The common problems with machine-learning approaches (selecting methods, selecting tuning parameters, etc.) are only exacerbated by this uncertain area. The researcher is left with many decisions to make, and only vague guidance on how to make them. With our method, two such decisions are prominent: what method to use for selection of the regularization parameter C, and what method to use for selection of the feature- normalization parameter q. We also need to determine how to remove domain-specific stop words. Picking C. For selecting C, we have several options, especially if we include picking a regularization parameter by optimizing predictive performance. Which option to select is a difficult, especially since there is no easy metric of final quality if one's focus is not prediction. The computational investigations shed some light on this problem. Ideally one would use the maximum of the permutation approach and the rare-phrase pruning approach. This will guarantee only finding a summary if one should be found, and also will discard rare phrases that do not speak of general trends across the positive documents. The free test from the permutation-selected C of whether the phrases as a whole are in fact significantly associated with the text is a real boon, in our view. It moves towards presentation of results that are known to not be entirely noise. That being said, future work on stability (where documents are perturbed to see how the selected phrases change, for example) is a must. Furthermore, we acknowledge that the above examples suggest that the permutation-selected C is severe, more severe than from cross validation or similar. This means we can lose human meaning as illustrated by the Methylene Chloride example: the richness of the summary was much greater with a slightly reduced C. Relaxing regularization towards what would be achieved with prediction- oriented approaches to achieve longer lists may be informative, but (other than improved prediction) this could undermine the guarantees provided by the above. Perhaps work on testing individual phrases via false discovery rates could find a better balance. Regardless, one should always compare the finally chosen C to Table 1 to see to what degree it is discarding perfect predictors, and to what degree it would leave the remainder to be potentially picked up. This provides a human interpretation of the impact of the regularization. Picking q. Selecting q is also admittedly difficult. By design, it gives different views of the data, from the quite general to the very specific. We advocate for exploring a range of values as the best practice. In the above case studies, for example, the full range of terms on the tables provided the most complex and rich story; perhaps pooling the lists and exploring these pooled lists would be one way forward. We underscore that we view these tools as exploratory; the researcher can extract small snippits of text to see if they offer some clue towards a more thorough investigation. This is similar in spirit to, for example, XGobi [45]. 30 Stop words. Even though we avoid using stop-word lists as a first-pass approach, we still needed to generate specialized stop-word lists. We see no way to have removed these words without human intervention as, from a prediction standpoint, the removed words are key indicators of a given labeling. Unfortunately, selecting them occludes terms that could enhance human understanding. We can see this with the calculated C thresholds: as we add words to the ban list, the C plummets because we are removing the words that are most correlated with the labeling. Eventually we could reach a point where we have "conditioned out" all the connection of the labeling to text. This is another potential avenue for exploring such data. Overall, we advocate generating modest-length stop-word (ban) lists using substance-matter knowledge, coupled with rescaling, over using generic stop lists that allow milquetoast words through due to their being not obviously wrong. 8 Conclusions We present a method for comparing sets of documents that is simple, sparse, and fast. We argue that these qualities are important for text analysis, especially if it is to be used for surveillance or other exploratory tasks. Here "simple" means the summaries cannot be too technical in nature. For example, the presence/absence of features is easier to interpret than regression weights. We need sparsity as humans are lazy; the number of phrases in a summary must be few. The faster summaries can be computed, the better. Otherwise exploratory analysis and discovery are bogged down. We do not, however, argue that the results of these tools, or in fact any other text analysis tools that we know of, can be taken as ultimate proof of any particular substantive theme or meaning. Summaries can be quite suggestive, but researchers would need to investigate further to substantiate those suggestions. Alternatively, secondary analyses such as blind scoring of the key phrases for sentiment could lead to traditional statistical conclusions. In these cases CCS should be viewed as a dimension reduction tool, providing a targeted, small number of informative features for a very complicated form of data. On the technical side, we have effectively provided an implementation of Lasso-style re- gression where the full set of features are dynamically created and the loss is a squared hinge loss rather than a normal quadratic loss. This work shows that implementing sparse regres- sion with greedy coordinate offers a viable direction for summarization using phrases rather than words. Furthermore, the approach of dynamically building features shows promise for other customizations such as skipping or dropping words to automatically detect related phrases, collapsing them into single features. Admittedly more work needs to be done to optimize this particular implementation to see exactly how fast it could be; currently the algorithm is sub-optimal because it does not fully fit currently selected features at each iteration. That being said, compared to methods with a pre-computed design matrix, it is comparably fast, is more flexible in the n-grams considered, and allows for some trickiness such as having gaps in the key-phrases (i.e., wild- card words) and the enforcement of non-negative weights. Additionally, the textreg package is quite natural to use, allowing users to avoid calculating the phrase matrix, and instead works with raw text. It also easily allows for customization of different rescaling schemes other than L2. 31 Going beyond text analysis, these methods also hint at ways of incorporating many interaction terms among features in high-dimensional regression. Phrase features are simply interactions of nearby word features, and thus similar bounding methods may exist. This is another area for future exploration. Acknowledgements We would like to thank three anonymous reviewers and an AE for their detailed comments; the paper has been much improved by this feedback. Also enormous thanks to Matt Taddy for his invaluable and speedy support with his textir package used in our comparison studies. This work builds on conversations and ideas discussed in the StatNews research group in UC Berkeley led by Bin Yu and Laurent El Ghaoui. In particular thanks to Garvesh Raskutti for his ideas on the impact of different rescaling choices. The authors are very grateful for these opportunities and inspirations. Also thanks to Kevin Wu for a portion of the code in the R package, and to Janet Ackerman for collaboration on an earlier incarnation of this project and initial data collection. Appendix A Appendix A consists of supplemental tables showing alternate summaries of the case studies discussed above. Table 11 compares Carbon Monoxide narratives to all the other narratives. Table 12 demonstrates a series of summaries on a stemmed corpus. q=1.2 0.28 0.28 0.28 0.15 0.15 phrase were using a gasoline propane powered floor their blood hemoglobin in the cold room they were found powered forklifts gasoline powered propane powered overexposure exhaust fumes exhaust calculated generator was employees were treated evacuated the fire department ventilation were treated a propane powered blood were hospitalized found employees stratton headaches source of the a gasoline passed out enclosed fire department cold hours room q=1.5 0.31 q=2 q=3 q=4 0.52 0.45 0.64 0.65 0.16 0.34 0.31 0.30 0.28 0.18 0.15 0.18 0.47 0.40 0.34 0.13 0.03 0.56 0.53 0.53 0.10 0.18 0.13 0.10 0.07 0.06 0.05 0.05 0.05 0.03 0.03 0.02 0.01 0.00 0.53 0.53 0.58 0.11 0.17 0.13 0.10 0.07 0.04 0.05 0.03 0.04 0.03 0.02 0.01 0.27 0.16 0.09 0.07 0.06 0.05 0.03 0.03 0.01 0.01 # reports 5 5 5 5 5 4 9 66 52 37 6 196 12 24 40 104 241 203 217 128 740 355 778 2885 5575 12 36 60 70 108 180 778 219 1277 1580 # tagged 5 5 5 5 5 4 8 30 28 18 5 35 7 10 12 18 21 32 22 26 85 30 42 68 126 7 10 12 26 11 18 36 16 33 42 % tagged 100.00 100.00 100.00 100.00 100.00 100.00 89.00 45.00 54.00 49.00 83.00 18.00 58.00 42.00 30.00 17.00 9.00 16.00 10.00 20.00 11.00 8.00 5.00 2.00 2.00 58.00 28.00 20.00 37.00 10.00 10.00 5.00 7.00 3.00 3.00 % phrase 2.00 2.00 2.00 2.00 2.00 2.00 3.00 12.00 12.00 7.00 2.00 14.00 3.00 4.00 5.00 7.00 9.00 13.00 9.00 11.00 35.00 12.00 17.00 28.00 52.00 3.00 4.00 5.00 11.00 5.00 7.00 15.00 7.00 14.00 17.00 Table 11. Different Summaries of Carbon Monoxide (when comparing against all other cases) 32 phrase poison+ at+ propan+ power+ gasolin+ power+ for fresh+ poison+ an+ X hour+ were+ use+ a+ gasolin+ was oper+ a+ propan+ the cold room+ concret+ saw+ XXX cubic+ the generat+ was forklift+ were+ averag+ headach+ dizzi+ intern+ combust+ the cold exhaust+ generat+ sourc+ of the X hour+ hour+ found+ a+ gasolin+ cold fire+ depart+ ventil+ power+ were+ treat+ were+ employe+ were+ room+ employe+ are q=1.2 0.33 0.12 0.11 0.10 0.09 0.04 0.04 0.03 0.03 q=1.5 0.12 0.38 0.38 0.19 0.36 q=2 0.10 0.55 0.54 0.10 0.49 q=3 0.08 0.56 0.56 0.53 0.02 0.08 0.06 0.06 0.01 0.21 0.10 0.09 0.05 0.13 0.06 0.05 0.04 0.03 0.03 0.02 0.01 0.16 0.07 0.05 0.10 0.03 0.03 0.02 0.02 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.00 0.10 0.53 q=4 # reports 17 0.03 34 0.49 43 0.54 4 141 6 5 6 7 10 4 10 8 17 6 8 17 142 110 33 57 362 561 48 66 217 173 459 112 2778 612 475 305 0.01 0.01 0.02 0.01 0.01 0.00 0.00 0.01 0.08 0.03 0.08 0.04 0.03 0.02 # tagged 17 28 32 4 96 6 5 6 7 9 4 8 7 11 5 6 10 38 31 13 18 47 69 26 16 37 42 95 22 168 67 43 37 % tagged 100 82 74 100 68 100 100 100 100 90 100 80 88 65 83 75 59 27 28 39 32 13 12 54 24 17 24 21 20 6 11 9 12 % phrase 7 12 13 2 40 2 2 2 3 4 2 3 3 5 2 2 4 16 13 5 7 19 28 11 7 15 17 39 9 69 28 18 15 Table 12. Different Summaries of Carbon Monoxide (using stemming, compared to chemical family) Appendix B: Derivations We here show three derivations used in the above work. We first show how to obtain the bound on the gradient. Second, we give an alternate formulation of the loss function which gives a different approach for finding the feature with the maximal gradient. We then show how to obtain the minimal λ∗ to ensure perfect predictors are pruned. Bound on the gradient The gradient for phrase j is L(β) = d dβj = yi=1,cij >0 n(cid:88) (cid:88) i=1 ξ(cid:48)(mi)yi cij zj ξ(cid:48)(mi) βj (cid:88) + C d dβj cij zj + yi=−1,cij >0 −ξ(cid:48)(mi) cij zj + C βj d dβj Now consider all phrases k with phrase j as a prefix that are currently not in the model (i.e., which currently have βk = 0), and maximize over the possible gradients (a similar argument gives a bound below for negative gradients). For vectors a, b, let a (cid:22) b denote a component-wise relationship of ai ≤ bi for i = 1, . . . , m. Then the set {a : 0 (cid:22) a (cid:22) cj} contains all potential appearance patterns for a phrase with phrase j as a prefix. We do not wish to calculate what the actual phrases are, hence we optimize over this set of potential 33 phrases. This results in the optimization problem: (cid:88) (cid:88) yi=1,cij >0 yi=−1,cij >0 ξ(cid:48)(mi) ai za −ξ(cid:48)(mi) + ai za U = max 0(cid:22)a(cid:22)cj ≤ max 0(cid:22)a(cid:22)cj (cid:88) −ξ(cid:48)(mi) yi=−1,cij >0 − C = max 0(cid:22)a(cid:22)cj 1 za βj + C ai d za dβj (cid:104)w, a(cid:105) − C with za = aq being the Lq norm of a, w being a m-vector of weights with wi = −ξ(cid:48)(mi), and (cid:104)·,·(cid:105) being the inner product. Because ξ(cid:48)(mi) is everywhere nonpositive, the first term in the first line above is negative. The second line follows because setting ai = 0 for any document with yi = 1 only increases the gradient as doing so will simultaneously drop negative terms and shrink zj. The penalty term is negative because we are examining gradients at 0; if we step  in the negative direction (as indicated by the first term), the gradient will immediately be shrunk towards 0. The mi, which include the intercept µ, are fixed constants, determined by the current location of our optimization path. We are effectively maximizing over an inner product of a and a vector of weights w with wi = ξ(cid:48)(mi) for i = 1, . . . , n. Overall, this bound is assessing the maximum possible utility of a hypothetical super phrase, which boils down to maximizing weights put on positive examples. The normalization za renders this problem difficult. We can bound the optimization using the following relationship: for q, r such that 1/q + 1/r = 1. This inequality gives x2w2 ≤ xqwr a2w2 cos θ − C aqwr cos θ − C 1 aq 1 aq wr cos θ − C U = max 0(cid:22)a(cid:22)cj ≤ max 0(cid:22)a(cid:22)cj = max 0(cid:22)a(cid:22)cj ≤ wr − C with θ being the angle between a and w. Coupling this with a similar argument for minimization gives the overall bound. A note on the Elastic Net. The Elastic Net [17] is where we penalize our loss function with (using Ifrim et al.'s notation) p(cid:88) (cid:32) p(cid:88) (cid:33)1/2 CRa(β) = Ca βj + C(1 − a) βj2 . j=1 j=1 This regularization tends to keep groups of correlated features rather than picking one; it can borrow from the stability of ridge regression. It can be potentially useful when many small features have weak signals. Setting a = 1 corresponds to L1 regularization. 34 For our problem, the gradient search is just changed to a subtraction of Ca rather than C for the at-zero potential new features. The gradients calculated for features already in the model have an extra term of C(1 − a)2βj due to the derivative of the second term above. Alternate gradient formulation. By redefining β, we can change the optimization problem to have a Lq-rescaling term in the penalty. This gives different bounds on the gradients for super-phrases based on a sub- phrase. However, it also changes the gradients themselves, which would change the path of the optimization problem. That is, different features will initially have the largest gradient. Assuming true convergence, the final solution will be identical, however. In particular, define βj = βj/zj. The loss term can then be reexpressed as n(cid:88) L(β) = p(cid:88) zj βj. ξ(mi) + C i=1 j=1 The gradient for phrase j is then L(β) = d dβj = ξ(cid:48)(mi)yicij + Czj ξ(cid:48)(mi)cij + −ξ(cid:48)(mi)cij + Czj βj. d dβj Again consider all phrases with phrase j as a prefix and maximize over the gradient, yielding the optimization problem: n(cid:88) (cid:88) i=1 yi=1,cij >0 (cid:88) (cid:88) yi=1,cij >0 yi=−1,cij >0 U = max 0(cid:22)a(cid:22)cj = max 0(cid:22)a(cid:22)cj d dβj βj (cid:88) yi=−1,cij >0 (cid:88) (cid:32) n(cid:88) i=1 yi=−1,cij >0 ξ(cid:48)(mi)ai + −ξ(cid:48)(mi)ai + Czj βj d dβj (cid:33)1/p ap i . ξ(cid:48)(mi) ai − C As before, the second line comes from noticing that setting ai = 0 for any document with yi = 1 will only increase the gradient due to dropping the negative terms and shrinking zj. The penalty term is still negative because if we step  in the negative direction from 0 (which is indicated by the first term), the gradient will immediately shrink towards 0. If we consider only phrases that have at least r occurrences in our corpus, then we can roughly bound with max k:xk(cid:22)xj d dβk L(β) ≤ (cid:88) yi=−1,cij >0 ξ(cid:48)(mi) cj − Cm1/p. This is from maximizing both terms separately. For the first, we simply add maximum weight, without regard to the normalizing constant. For the normalizing constant, given 35 a total count of r occurrences, the maximum zj would be putting singletons on each of r documents, giving the r1/p total. Similarly, bounding from below gives an overall bound of (cid:12)(cid:12)(cid:12)(cid:12) max k:xk(cid:22)xj d dβk L(β) (cid:95) (cid:12)(cid:12)(cid:12)(cid:12) ≤ 0 max  (cid:88) yi=−1,cij >0 (cid:88) yi=1,cij >0 ξ(cid:48)(mi) cij, ξ(cid:48)(mi) cij  − Cr1/p This bound appears to be less useful than the one presented in the main paper. Further- more, not rescaling by zj tend to make more common phrases be selected first, as we are not rescaling the first term, allowing it to grow quite large. Perfect predictors Take the count vector for a perfect predictor cj. It has r 1s and m− r 0s. For the regression, the count vector cj is q-rescaled, giving xj = 1 zj cj = 1 r1/q as zj = cijq = r1/q. (cid:33)1/q (cid:32) m(cid:88) i=1 Assume feature cj has been set aside and we have optimized without it. We have Y = X β (with βj ≡ βj/zj except for the intercept) for our current set of predictions, and an overall predicted mean µ = 1 m considering feature cj, is then (cid:80) Yi. Now reintroduce feature cj. Our loss function, when only (cid:16) m(cid:88) (cid:16) m(cid:88) (cid:88) i=1 i=1 i:xij>0 (cid:18) (cid:96)(βj) = = = (cid:17)2 Yi − Yi + Cβj Yi − Xi β − xijβj + Cβj 1 − Xi β − βj r1/q + Cβj (cid:17)2 (cid:19)2 (cid:19) i:xij>0 36 where we have dropped those terms not dependent on βj. This is convex. Take the derivative and set equal to 0 to find the minimum: (cid:88) (cid:88) (cid:88) i:xij>0 i:xij>0 (cid:18) (cid:16) (cid:16) (cid:96)(cid:48)(β) = − 2 r1/q = − 2 r1/q = − 2 r1/q + Csgn(β) 1 − Xi β − βj r1/q 1 − Xi β + 2 r1/q (cid:88) i:xij>0 (cid:17) (cid:17) 1 − Xi β + 2βjr1−2/q + Csgn(β). βj r1/q + Csgn(β) The βs will not be negative, and hence we examine the positive case, allowing us to drop the sgn() term. Set (cid:96)(cid:48)(β) equal to 0 and solve, giving 1 r (cid:88) (cid:16) i:xij>0 (cid:17) − 1 2 βj = r1/q 1 − Xi β r2/q−1C. The term in the outer parenthesis is the average prediction for the documents having the perfect predictor cj. If, for a document i with cik = 1, there are not really any other predictive features, then β ≈ µ. If this is true for all of the documents predicted by ck, then the above is then Yi = Xi approximately βj ≈ r1/q−1r(1 − µ) − 1 2 r2/q−1C = r1/q(1 − µ) − 1 2 r2/q−1C. If some documents are predicted by other features included in the model, then the sum will be less and the necessary C for pruning will be reduced. Rearrange to obtain an approximate cut-off for C to drop all perfect predictors that perfectly predict r documents. The q = 2 case. For q = 2 we have (cid:88) (cid:16) √ r (cid:17) − 1 C 2 1 − Xi β βj = ≈ √ 1 r r(1 − µ) − 1 2 √ r, giving prediction of For the positive examples, xij = 1/ 1√ r(1 − µ) − 1 2 r Yi ≈ µ + (cid:18)√ (cid:19) i:xij>0 C. C √ = 1 − 1 2 .C r The first term of βj takes our prediction perfectly to +1 and the second term shrinks the coefficient away from 1 by half of C. Predictions from predictors that predict for more documents will be shrunk less than those for fewer. The raw coefficients will also be larger. Appendix C: Using the textreg package Our text regression package, textreg on CRAN, is a wrapper for an extensively modified version of the C++ code written by Georgiana Ifrim. It is also designed to integrate with the tm package, a commonly used R package for dealing with text. Our package is fully documented, but it is research code, meaning gaps and errors are possible; the author would appreciate notification of anything that is out of order. The primary method in this package is the regression call textreg(). This method takes a corpus and a labeling vector and returns a textreg.result object that contains the final regression result along with diagnostic information that can be of use. The (somewhat edited) function heading along with default values is: 37 textreg <- function(corpus, labeling, banned=NULL, C = 1.0, Lq = 2, maxIter = 40, verbosity = 1, positive.only = FALSE, binary.features = FALSE, no.regularization = FALSE, min.support = 1, min.pattern = 1, max.pattern = 100, gap = 0, convergence.threshold=0.0001 ) The main arguments to this method are listed below: corpus A vector of strings or a Corpus object built out of strings. labeling A vector of +1/0/-1 values where 0 means drop from consideration. banned A vector of unigrams (words) that should not be allowed in any summary phrase. C The C tuning parameter for regularization. Lq The q for the Lq-rescaling of terms. 10 or above is treated as infinity. maxIter The maximum number of iterations allowed before terminating even under no convergence. verbosity 0 means silent. Larger numbers mean more diagnostic printout. positive.only Only allow positive features (other than the intercept). Useful if there are few positive documents and many negative, baseline, documents. binary.features The feature vectors are 0-1 vectors indicating whether a phrase is in or not in any given document. This is compared to vectors of counts of how many times a phrases in a document. These feature vectors are Lq-rescaled regardless. no.regularization If TRUE then features will not be rescaled (which recovers the Ifrim et al. algorithm). min.support Phrases that do not appear this many times are not considered viable features. Increasing this number can greatly decrease the running time of the algorithm, but it will force the dropping of very rare phrases regardless of rescaling or regularization choice. min.pattern,max.pattern Minimum and maximum lengths for phrases that are consid- ered. gap Number of words that can appear in a gap. A phrase can have multiple gaps of this length. 38 The resulting textreg.result object can be printed, plotted, and explored. Try, in an R Console, typing rs by itself or plot( rs ). The method reformat.textreg.model(rs) gives a nice table (see, e.g., Table 6) of summary statistics for the final phrases. The side- by-side summary table such as Table 7 is made by passing a list of textreg.result objects to make.list.table(). The method calc.loss( rs ) gives the final loss of a result rs and predict( rs ) will return individual document-level predictions of the labeling. The method rule.to.matrix( rs ) gives back the n × r design matrix for the final selected r phrases including intercept. To pick a tuning parameter one can use Cs <- find.threshold.C( corpus, labeling, ban.words, R=100 ) This method returns a R + 1 length list of numbers. The first number is the choice of C that will return a null model for the labeling given, and the subsequent R numbers constitute our found C values that return a null model under a random permutation of the labeling (holding the zeros fixed). It takes the same parameters as textreg except for maxIter and C. Be sure to use the same remaining values for both calls so that find.threshold.C culminates with a C corresponding to the correct model family. For exploring text, sample.fragments( phrase, labeling, corpus ) is useful. See also grab.fragments(). To profile specific phrases, possibly even phrases not in the results, use make.phrase.count.table(). One can make cluster plot of how phrases relate with cluster.phrases( rs ), or make matrices of co-occurrence of phrases using make.phrase.correlation.chart( rs ). All of the above, and a bit more, is demonstrated and more fully explained in the vignette "Bathtub Demo," that comes with the package. Please read through it for further discussion and ideas. References [1] Jinzhu Jia, Luke Miratrix, Bin Yu, Brian Gawalt, Laurent El Ghaoui, Luke Barnes- moore, and Sophie Clavier. Concise comparative summaries (CCS) of large text corpora with a human experiment. The Annals of Applied Statistics, 8(1):499–529, 2014. [2] David M Blei, Andrew Y Ng, and Michael I Jordan. Latent Dirichlet Allocation. The Journal of Machine Learning Research, 3:993–1022, 2003. [3] Georgiana Ifrim, Gokhan Bakir, and Gerhard Weikum. Fast logistic regression for text categorization with variable-length n-grams. In 14th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 354–362, 2008. [4] Georgiana Ifrim and Carsten Wiuf. Bounded coordinate-descent for biological sequence classification in high dimensional predictor space. In 17th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 708–716, 2011. [5] Matt Taddy. Multinomial inverse regression for text analysis. Journal of the American Statistical Association, 108(503):755–770, 2013. 39 [6] Robert Tibshirani, Iain Johnstone, B Efron, and T Hastie. Least angle regression. The Annals of Statistics, 32(2):407–451, 2004. [7] J Grimmer. A Bayesian Hierarchical Topic Model for Political Texts: Measuring Ex- pressed Agendas in Senate Press Releases. Political Analysis, 18(1):1–35, January 2010. [8] Jonathan Chang, Jordan Boyd-Graber, Sean Gerrish, Chong Wang, and David M Blei. In Neural Information Reading Tea Leaves: How Humans Interpret Topic Models. Processing Systems (NIPS), 2009. [9] Jonathan M Bischof and Edoardo M Airoldi. Capturing semantic content with word frequency and exclusivity. In 29th International Conference on Machine Learning, Ed- inburgh, Scotland, February 2012. [10] Gerard Salton and Christopher Buckley. Term Weighting Approaches in Automatic Text Retrieval. Information processing & management, 24(5):513–523, 1988. [11] G Salton. Developments in automatic text retrieval. Science, 253(5023):974–980, 1991. [12] Taku Kudo and Yuji Matsumoto. A Boosting Algorithm for Classification of Semi- Structured Text. In Conference on Empirical Methods in Natural Language Processing, pages 301–308, Barcelona, Spain, 2004. Association for Computational Lingusitics. [13] Robert Schapire and Yoram Singer. BoosTexter: A Boosting-based System for Text Categorization. Machine Learning, 39(2/3):135–168, 2000. [14] Alexander Genkin, David D Lewis, and David Madigan. Large-Scale Bayesian Logistic Regression for Text Categorization. Technometrics, 49(3):291–304, 2007. [15] Tong Zhang and Frank J Oles. Text Categorization Based on Regularized Linear Class- fiication Methods. Information Retrieval, 4:5–31, 2001. [16] T Hastie, Robert Tibshirani, and J H Friedman. The Elements of Statistical Learning. Springer, 2003. [17] Hui Zou and Trevor Hastie. Regularization and variable selection via the elastic net. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 67(2):301– 320, 2005. [18] F Mosteller and D L Wallace. Applied Bayesian and Classical Inference: The Case of "The Federalist" Papers. Springer-Verlag, 1984. [19] E M Airoldi, A G Anderson, and S E Fienberg. Who wrote Ronald Reagan's radio addresses? Bayesian analysis, 1(2):289–320, 2006. [20] Gary King and Will Lowe. An automated information extraction tool for international conflict data with performance as good as human coders: A rare events evaluation design. International Organization, 57(3):617–642, September 2009. 40 [21] Daniel J Hopkins and Gary King. A Method of Automated Nonparametric Content Analysis for Social Science. American Journal of Political Science, 54(1):229–247, 2009. [22] C Cortes and V Vapnik. Support-vector networks. Machine Learning, 20:273–297, 1995. [23] George Forman. An extensive empirical study of feature selection metrics for text classification. The Journal of Machine Learning Research, 3:1289–1305, 2003. [24] S Dumais, J Platt, and D Heckerman. Inductive learning algorithms and representa- tions for text categorization. In Proceedings of the seventh international conference on Information and knowledge management, ACM, pages 148–155, 1998. [25] Thorsten Joachims. Learning to Classify Text Using Support Vector Machines. The Springer International Series in Engineering and Computer Science. Springer, 2002. [26] Stuart Rose, Dave Engel, Nick Cramer, and Wendy Cowley. Automatic keyword ex- traction from individual documents. In Michael W Berry and Jacob Kogan, editors, Text Mining: Applications and Theory, pages 1–20. John Wiley & Sons, Ltd, unknown, 2010. [27] Eibe Frank, Gordon W Paynter, Ian H Witten, Carl Gutwin, and Craig G Nevill- Manning. Domain-specific keyphrase extraction. In The Sixteenth International Joint Conference on Artificial Intelligence (IJCAI-99), pages 668–673, California, 1999. Mor- gan Kaufmann. [28] Jilin Chen, Benyu Zhang, Dou Shen, Qiang Yang, Zheng Chen, and Qiansheng Cheng. Diverse topic phrase extraction from text collection. In World Wide Web Conference, pages 1–9, Edinburgh, UK, May 2006. Citeseer. [29] Sean Gerrish and David M Blei. Predicting legislative roll calls from text. In The 28th International Conference on Machine Learning (ICML-11), pages 489–496, 2011. [30] Li-Wei Lee and Shyi-Ming Chen. New Methods for Text Categorization Based on a New Feature Selection Method and a New Similarity Measure Between Documents. In Advances in Applied Artificial Intelligence, pages 1280–1289. Advances in Applied Artificial Intelligence, 2006. [31] Y Yang and I O Pendersen. A comparative study on feature selection in text categoriza- tion. In ICML-97, 14th International Conference on Machine Learning, pages 412–420, Nashville, US, 1997. [32] Jacob Eisenstein, Amr Ahmed, and Eric P Xing. Sparse Additive Generative Models of Text. In 28th International Conference on Machine Learning, pages 1–8, Bellevue, WA, USA, February 2013. [33] Laurent El Ghaoui, Guan-Cheng Li, Viet-An Duong, Vu Pham, Ashok N Srivastava, and Kanishka Bhaduri. Sparse Machine Learning Methods for Understanding Large Text Corpora: Application to Flight Reports. In Conference on Intelligent Data Un- derstanding, pages 159–173, June 2011. 41 [34] Burt L Monroe, Michael P Colaresi, and Kevin M Quinn. Fightin' Words: Lexical Fea- ture Selection and Evaluation for Identifying the Content of Political Conflict. Political Analysis, 16(4):372–403, 2008. [35] Hui Zou. The adaptive lasso and its oracle properties. Journal of the American statistical association, 101(476):1418–1429, 2006. [36] Tong Tong Wu and Kenneth Lange. Coordinate Descent Algorithms for Lasso Penalized Regression. The Annals of Applied Statistics, 2(1):224–244, 2008. [37] Z Q Luo and P Tseng. On the Convergence of the Coordinate Descent Method for Convex Differentiable Minimization. Journal of Optimization Theory and Applications, 72(1):7–35, 1992. [38] Laurent El Ghaoui, Vivian Viallon, and Tarek Rabbani. Safe Feature Elimination in Sparse Supervised Learning. UC Berkeley, 2010. [39] Hadley Wickham, Dianne Cook, Heike Hofmann, and Andreas Buja. Graphical inference for Infovis. IEEE Transactions on Visualization and Computer Graphics, 16(6):973–979, 2010. [40] T P Speed and Bin Yu. Model selection and prediction: normal regression. Annals of the institute of statistical mathematics, 45(1):35–54, 1993. [41] Jerome Friedman, Trevor Hastie, and Rob Tibshirani. Regularization paths for gen- eralized linear models via coordinate descent. Journal of statistical software, 33(1):1, 2010. [42] Martin F Porter. An algorithm for suffix stripping. Program, 14(3):130–137, 1980. [43] David Meyer, Kurt Hornik, and Ingo Feinerer. Text mining infrastructure in R. Journal of Statistical Software, 25(5):1–54, 2008. [44] Yiming Yang and Xin Liu. A re-examination of text categorization methods. In Pro- ceedings of the 22nd annual international ACM SIGIR conference on Research and development in information retrieval, pages 42–49. ACM, 1999. [45] Andreas Buja, Dianne Cook, and Deborah F Swayne. Interactive high-dimensional data visualization. Journal of Computational and Graphical Statistics, 5(1):78–99, 1996. 42
1904.04498
1
1904
2019-04-09T07:26:25
A Hierarchical Decoding Model For Spoken Language Understanding From Unaligned Data
[ "cs.CL" ]
Spoken language understanding (SLU) systems can be trained on two types of labelled data: aligned or unaligned. Unaligned data do not require word by word annotation and is easier to be obtained. In the paper, we focus on spoken language understanding from unaligned data whose annotation is a set of act-slot-value triples. Previous works usually focus on improve slot-value pair prediction and estimate dialogue act types separately, which ignores the hierarchical structure of the act-slot-value triples. Here, we propose a novel hierarchical decoding model which dynamically parses act, slot and value in a structured way and employs pointer network to handle out-of-vocabulary (OOV) values. Experiments on DSTC2 dataset, a benchmark unaligned dataset, show that the proposed model not only outperforms previous state-of-the-art model, but also can be generalized effectively and efficiently to unseen act-slot type pairs and OOV values.
cs.CL
cs
A HIERARCHICAL DECODING MODEL FOR SPOKEN LANGUAGE UNDERSTANDING FROM UNALIGNED DATA Zijian Zhao, Su Zhu and Kai Yu MoE Key Lab of Artificial Intelligence SpeechLab, Department of Computer Science and Engineering Shanghai Jiao Tong University, Shanghai, China {1248uu, paul2204, kai.yu}@sjtu.edu.cn ABSTRACT Spoken language understanding (SLU) systems can be trained on two types of labelled data: aligned or unaligned. Un- aligned data do not require word by word annotation and is easier to be obtained. In the paper, we focus on spoken lan- guage understanding from unaligned data whose annotation is a set of act-slot-value triples. Previous works usually focus on improve slot-value pair prediction and estimate dialogue act types separately, which ignores the hierarchical structure of the act-slot-value triples. Here, we propose a novel hierar- chical decoding model which dynamically parses act, slot and value in a structured way and employs pointer network to han- dle out-of-vocabulary (OOV) values. Experiments on DSTC2 dataset, a benchmark unaligned dataset, show that the pro- posed model not only outperforms previous state-of-the-art model, but also can be generalized effectively and efficiently to unseen act-slot type pairs and OOV values. Index Terms -- Spoken language understanding, un- aligned data, hierarchical decoding, pointer network 1. INTRODUCTION The spoken language understanding (SLU) module is a key component of spoken dialogue system (SDS), parsing user's utterances into corresponding semantic forms. Typically, the SLU problem is regarded as a sequence tagging task which needs word-level annotations[1, 2, 3], e.g., the ut- terance "Show me flights from Boston to New York" can be parsed as "Show me flights from [Boston:from city] to [New York:to city]" [4]. Beyond this word aligned an- notation, there is also sentence-level semantic annotation which is unaligned, e.g., the utterance "I want a high priced restaurant" has an act-slot-value triple annotation of "in- form(pricerange=expensive)" and the utterance "what type of food does it serves" has an annotation of "request(food)". The corresponding author is Kai Yu. This work has been supported by the China NSFC projects (No. 61573241). Experiments have been carried out on the PI supercomputer at Shanghai Jiao Tong University. The unaligned SLU has some advantages against the aligned one. First, as a downstream module of Automatic Speech Recognition (ASR), SLU module based on statistical method often requires that training data should be labelled on the outputs from ASR, which can improve robustness to ASR errors. Therefore, it is hard and sometimes impossible to align the semantic annotations onto ASR outputs due to ASR errors (especially word insertion and deletion errors). Second, value aliases are also difficult to be handled in a word-aligned way which is very time-consuming. In this pa- per, we focus on SLU with the unaligned semantic annotation that a sentence is labelled as a set of act-slot-value triples [5]. There are numerous previous works for the unaligned SLU. Support vector machines (SVM) have been used for learning semantic tuple classifiers [6, 7]. Yazdani et al. pro- pose a model to calculate the similarity between the input sentence and all possible semantic tuples [8]. It assumes all possible values have been known, which may be impracti- cal in real applications and inefficient, e.g. there are a large number of songs in a music domain. Sentence and context representations are exploited in [9] and the OOV problem in slot values is addressed by utilizing a pointer network in [10]. However, they predict act type and slot-value pair separately ignoring relation between the act and slot-value pair. In this paper, we propose a novel hierarchical decoding model for SLU from unaligned data. The model predicts act-slot-value triples hierarchically by following the triple structure. The hierarchical decoding can predict multiple act- slot-value triples completely and generalize to unseen act-slot type pairs. Pointer network [11] is employed to generate out- of-vocabulary (OOV) values with a context-aware attention mechanism. In the experiments, our method achieves state- of-the-art performance in the DSTC2 dataset, and shows great generalization capacity. The rest of the paper is organized as follows. The next section introduces relations to prior works. In section 3, we describe the hierarchical decoding model in detail. Experi- ments and analyses are presented in section 4, followed by conclusions. the modules decode recursively to generate the triples. The details of hierarchical decoding are given in Algorithm 1. Algorithm 1: Hierarchical Decoding Algorithm Input: utterance, ontology, model Output: a set of act-slot-value triples Initialize a empty list; pred acts = act classifier(utterance); for act in pred acts do if the act doesn't need a slot then add the single act into the list; else pred slots = slot classifier(utterance, act); for slot in pred slots do if the slot doesn't need a value then add the act-slot pair into the list; value = value decoder(utterance, act, slot); add the act-slot-value triple to the list; else end end end end Return the list containing triples. 3.1. Shared Utterance Encoder A bidirectional LSTM (BLSTM) [12, 13] model is exploited to encode the utterance. Let ew denote the word embedding of each word w, and ⊕ denote the vector concatenation opera- tion. The encoder reads the utterance w = (w1, w2,··· , wT ) and generates T hidden states of BLSTM: −→ hi = fr( ←− hi ⊕ −→ ←− hi is the hidden vector of the backward pass in BLSTM where −→ and hi is the hidden vector of the forward pass in BLSTM at time i, fl and fr are LSTM units [14] of the backward and forward pass respectively. The final representation of the utterance (utterance vector) is defined as: ←−− hi+1, ewi ); −−→ hi−1, ewi) ←− hi = fl( hi = hi; ←− h1 ⊕ −→ hT h = The utterance vector h will be used for the follow- ing act and slot type classifications, and hidden vectors {h1,··· , hT} will be used for the value sequence gener- ation with pointer network [11, 15, 16]. 3.2. Act and Slot Type Classifiers Fig. 1. A Hierarchical Decoding Model for Spoken Language Understanding from Unaligned Data. ATC denotes act type classifier and STC denotes slot type classifier. 2. RELATION TO PRIOR WORK The work most relevant to us is [10], which also uses a pointer network [11] to handle the OOV problem of values. They focus on filling value for a slot which is a sub-task of SLU, while we aim to hierarchically generate a set of act-slot- value triples which is a complete target of the unaligned SLU. Moreover, the relation between act and slot-value pair is ig- nored in [10]. We apply a context-aware attention mechanism within the pointer network by incorporating the predicted act and slot. A comparison of results on the DSTC2 dataset also shows that we can get better performance. 3. HIERARCHICAL DECODING MODEL In this section, the details of our model are given. The task of SLU from unaligned data is to predict a set of act-slot-value triples given an input utterance. To represent rich semantics, the triples are of three types: single act like "thankyou()" and "bye()", act-slot pair like "request(food)", and act-slot-value triple like "inform(pricerange=expensive)", which are given in domain ontology. Not all act types are followed by a slot and value. Thus, we predict the act-slot-value triples by fol- lowing the triple structure. The overall model consists of four modules, as shown in Figure 1: • a shared utterance encoder; • an act type classifier with the utterance as input to pre- dict act types; • a slot type classifier with the utterance and an act type as inputs to predict slot types; • a value decoder with the utterance and an act-slot type pair as inputs to generate the value sequence. In training state, the modules can be trained together at the same time as multi-task learning. However, in testing stage, Act type prediction is defined as a multi-label classification problem here. A normal solution is to train a binary classifier for each label. We apply a feed forward network with two layers to calculate an existence score for each possible label: r = ReLU(Wuu + bu) p = σ(Wrr + br) where u is the input vector, Wu, Wr are weight matrices and bu, br are biases. σ is the sigmoid function to normalize out- put scores. In the training stage, Binary Cross Entropy (BCE) loss function1 is used. In the testing stage, classes with score higher than 0.5 are predicted. For act type prediction, the in- put vector u is just the utterance vector h. Slot type prediction is formatted in a similar way, while not only the utterance vector but also the corresponding act type are fed to the slot classifier. An embedding layer is also defined to encode each act type into a continuous vector. Let a denote an act type and ea denotes its embedding, then the input vector for the slot type classifier is: u = h ⊕ ea A notable point is that we define embedding modules for act and slot types as word embedding to encode each type into a continuous representation. This allows us to utilize the predicted results from former modules in the latter, e.g., usage of act types in slot types prediction. 3.3. Value Decoder with Pointer Network To predict value of the corresponding act-slot type pair, we utilize a sequence-to-sequence model with attention [17] and pointer network [11] to generate word sequence of the value. Since the encoder has been introduced above, we describe the details of the decoder below. A LSTM model is used to decode the value sequence v = (v1, v2,··· , vN ). We define vN as "</s>" which means the end of a sequence. The LSTM proceed as si = f (si−1, evi), where si is the hidden vector at time i and f is the LSTM units. In order to incorporate the context information of cor- responding act and slot, we define that: si = Ws(si ⊕ ea ⊕ es) + bs where ea and es are embeddings of corresponding act type a and slot type s respectively, Ws is a weight matrix and bs is a bias vector. si is used in the attention mechanism to calculate context vector ci as follows: T(cid:88) j=1 ci = αijhj; αij = (cid:80)T exp (hT j si) k=1 exp (hT k si) The encoded information of predicted act and slot in si could help the attention mechanism to focus semantically. 1Binary cross entropy loss suits multi-labels classification very well: L = i[yi ∗ log(pi) + (1 − yi) ∗ log(1 − pi)], where yi is the target value (0 or 1) of i-th label and pi is the predicted probability of i-th label. −(cid:80) i Finally si and ci are concatenated to be an input of the output layer which calculates the probability distribution P gen over the basic vocabulary as in [17]. To handle the OOV problem in value generation, we en- hance the basic Seq2Seq model with pointer network [11] which can generate a probability distribution P ptr over the words of the input utterance according to the attention weights αij. Therefore, the final distribution over the ex- tended vocabulary (the basic vocabulary and words in the input utterance) is calculated as: i i + (1 − pi) ∗ P ptr Pi = pi ∗ P gen pi = σ(wp(evi ⊕ si ⊕ ci) + bp) i where pi is a balance score, wp is a weight vector and bp is a scalar bias. 4. EXPERIMENTS In our experiments, we use the dataset provided for the sec- ond Dialog State Tracking Challenge (DSTC2) [18]. It en- compasses 11677, 3934, 9890 pairs of utterance and the cor- responding set of act-slot-value triples for training, develop- ment and testing respectively. Each utterance is annotated with semantics including multiple act-slot-value triples. Both the manual transcription and 10-best hypotheses are provided for each utterance. We use the manual transcription and top hypothesis (1-best) as inputs throughout our experiments. The dimension of embeddings is 100 and the number of hidden units is 128. Dropout rate is 0.5 and batch size is 20. Maximum norm for gradient clipping is set to 5 and Adam op- timizer is used with an initial learning rate of 0.001. All train- ing consists of 50 epochs with early stopping on the develop- ment set. We report F1-score of act-slot-value triples by the offical scoring script from http://camdial.org/∼mh521/dstc/. Glove2 word vectors are used to initialize all the embed- ding modules. For act and slot type embedding modules, we compose the embedding of these abstract concept words, for example, the embedding of "pricerange" is the average of the embeddings of "price" and "range". We also tie the act embedding and the topmost weight matrix of the act type clas- sifier [19], same for the slot embedding. 4.1. Overall Performance First of all, we conduct experiments on the top hypothesis and compare the results with prior arts to evaluate the overall SLU performance of our model. [9, 10] are neural network based methods which have been mentioned before, and [20] is a statistical method which uses decision trees based binary classifiers to predict the presence of each slot-value pair and dialog act. The results are shown in Table 1. From the ta- ble, we can see that our model achieves the best F1 score and outperforms the prior works significantly. 2http://nlp.stanford.edu/data/glove.6B.zip Model F1-score(%) Data Type Label Type SLU2 [20] CNN+LSTM w4 [9] S2S-Attn-Ptr-Net [10] Our model 82.1 83.6 85.8 86.9 manual 1best seen unseen seen unseen ST 71.1 0.0 51.1 0.0 ZS 81.2 10.7 74.2 5.2 HD 92.2 72.6 80.8 45.3 Table 1. Comparison with published results on DSTC2. Table 3. SLU performance (F1) with 5% training data on two categories of labels (act-slot-value triples). 4.2. Generalization Capacity In this section, we would like to evaluate the generalization capacity of our hierarchical decoding (HD) model. We adopt two baselines for comparison. One baseline [7] treats act-slot- value triple as a single label and train binary SVM classifiers to predict the existence of each label. The method is named as semantic tuple (ST) classifications. We replace the SVM with our BLSTM encoder for consistency. The other base- line [8] proposes a model to calculate the similarity between the embeddings of input utterance and all possible semantic items (act-slot-value triples) by zero-shot (ZS) learning. We also apply a BLSTM encoder to get the utterance vector. We randomly select 5%, 10%, 20% of the training data to create specific datasets with less act-slot-value triples. The testing set is the same as before. Both manual transcriptions and top hypotheses (1best) are used in the experiments. The results are shown in Table 2. Data Type Data Size manual 1best 5% 10% 20% 100% 5% 10% 20% 100% ST 70.0 92.4 95.1 98.3 50.6 80.0 83.2 87.2 ZS 80.4 91.0 94.2 98.1 73.1 79.6 81.9 86.1 HD 91.7 93.6 96.1 98.3 80.1 80.5 83.3 86.9 4.3. Analysis The decomposition of act-slot structure allows us to predict unseen act-slot type pairs. For example, our model can pre- dict "confirm(area)" even if the pair does not exist in training set. Since it can learn to compose the semantics of "con- firm(area)" from "confirm(food)" and "inform(area)". For non-enumerable slot types like "food" and "name" which may have a huge set of possible values, we can not define all the possible values in advance. The utilization of pointer network allows us to generate OOV values. In our ex- periments, most OOV values can be generated by recognizing the similar context around the values with pointer network. Given the predicted act and slot, the attention mechanism of the value decoder would focus on corresponding words. This enables the decoder to generate values accurately. Figure 2 shows an example that how attention weights are distributed on the input utterance given different act-slot pairs. We can see that, "inform-slot" focuses on "thai" and "deny-slot" con- centrates on "chinese" extremely. Table 2. SLU performance (F1) with varying training size. Fig. 2. Attention weights on input utterance of the value de- coder with different act-slot pairs. As we can see, the performance of our model will not degrade heavily as the data becomes less and less. Especially, it achieves a much better F1 score than the baselines when only 5% data remains. The results show that our model has a good capacity of generalization. To better explore the reason why our model achieves much better performance than the baselines with only 5% data, we split the labels in the testing set into two categories according to whether the act-slot-value triple is seen in train- ing set. Subsequently we report the F1 scores of our model and the baselines on these two categories in Table 3. We find that the decomposition of act-slot-value triples and hierarchi- cal decoding of our method can generalize to unseen labels and improve the performance on seen labels simultaneously. 5. CONCLUSION In this paper, we propose a novel hierarchical decoding model for SLU from unaligned data. The model exploits the struc- ture of act-slot-value triples and can completely predict mul- tiple triples. The decomposition of act-slot structure makes it possible to predict unseen act-slot type pairs. The utilization of pointer network in value decoder allows us to generate out- of-vocabulary (OOV) slot values. Finally, the experiment re- sults show that our model possesses impressive performance and generalization capacity. In future, we would like to im- prove embeddings of act and slot types, and apply our method in domain adaptation problem of SLU. 6. REFERENCES [1] Gr´egoire Mesnil, Xiaodong He, Li Deng, and Yoshua Bengio, "Investigation of recurrent-neural-network ar- chitectures and learning methods for spoken language understanding.," in Interspeech, 2013, pp. 3771 -- 3775. [2] Kaisheng Yao, Geoffrey Zweig, Mei-Yuh Hwang, Yangyang Shi, and Dong Yu, "Recurrent neural net- works for language understanding.," in INTERSPEECH, 2013, pp. 2524 -- 2528. [3] Su Zhu and Kai Yu, "Encoder-decoder with focus- mechanism for sequence labelling based spoken lan- in IEEE International Con- guage understanding," ference on Acoustics, Speech and Signal Process- ing(ICASSP), 2017, pp. 5675 -- 5679. [4] Roberto Pieraccini, Evelyne Tzoukermann, Zakhar Gorelov, J-L Gauvain, Esther Levin, C-H Lee, and Jay G Wilpon, "A speech understanding system based on sta- tistical representation of semantics," in icassp. IEEE, 1992, pp. 193 -- 196. [5] Steve Young, "Cued standard dialogue acts," Report, Cambridge University Engineering Department, 14th October, 2007. [6] Franc¸ois Mairesse, Milica Gasic, Filip Jurcicek, Simon Keizer, Blaise Thomson, Kai Yu, and Steve Young, "Spoken language understanding from unaligned data using discriminative classification models," in Acous- tics, Speech and Signal Processing, 2009. ICASSP 2009. IEEE International Conference on. IEEE, 2009, pp. 4749 -- 4752. [7] Matthew Henderson, Milica Gasi´c, Blaise Thomson, Pirros Tsiakoulis, Kai Yu, and Steve Young, "Dis- criminative spoken language understanding using word confusion networks," in Spoken Language Technology Workshop (SLT), 2012 IEEE. IEEE, 2012, pp. 176 -- 181. [8] Majid Yazdani and James Henderson, "A model of zero- shot learning of spoken language understanding," in Proceedings of the 2015 Conference on Empirical Meth- ods in Natural Language Processing, 2015, pp. 244 -- 249. [9] Lina M Rojas Barahona, Milica Gasic, Nikola Mrksi´c, Pei-Hao Su, Stefan Ultes, Tsung-Hsien Wen, and Steve Young, "Exploiting sentence and context representa- tions in deep neural models for spoken language under- standing," in Proceedings of COLING 2016, the 26th In- ternational Conference on Computational Linguistics: Technical Papers, 2016, pp. 258 -- 267. [10] Lin Zhao and Zhe Feng, "Improving slot filling in spo- ken language understanding with joint pointer and at- tention," in Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), 2018, vol. 2, pp. 426 -- 431. [11] Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly, "Pointer networks," in Advances in Neural Information Processing Systems, 2015, pp. 2692 -- 2700. [12] Mike Schuster and Kuldip K Paliwal, "Bidirectional re- current neural networks," IEEE Transactions on Signal Processing, vol. 45, no. 11, pp. 2673 -- 2681, 1997. [13] Kazuya Kawakami, Supervised Sequence Labelling with Recurrent Neural Networks, Ph.D. thesis, PhD the- sis. Ph. D. thesis, Technical University of Munich, 2008. [14] Sepp Hochreiter and Jurgen Schmidhuber, "Long short- term memory," Neural computation, vol. 9, no. 8, pp. 1735 -- 1780, 1997. [15] Caglar Gulcehre, Sungjin Ahn, Ramesh Nallapati, Bowen Zhou, and Yoshua Bengio, "Pointing the un- known words," in Proceedings of the 54th Annual Meet- ing of the Association for Computational Linguistics (Volume 1: Long Papers), August 2016, pp. 140 -- 149. [16] Abigail See, Peter J Liu, and Christopher D Manning, "Get to the point: Summarization with pointer-generator networks," in Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Vol- ume 1: Long Papers), 2017, vol. 1, pp. 1073 -- 1083. [17] Minh-Thang Luong, Hieu Pham, and Christopher D to attention- arXiv preprint Manning, based neural machine translation," arXiv:1508.04025, 2015. "Effective approaches [18] Matthew Henderson, Blaise Thomson, and Jason D Williams, "The second dialog state tracking challenge," in Proceedings of the 15th Annual Meeting of the Spe- cial Interest Group on Discourse and Dialogue (SIG- DIAL), 2014, pp. 263 -- 272. [19] Ofir Press and Lior Wolf, "Using the output embed- arXiv preprint ding to improve language models," arXiv:1608.05859, 2016. [20] Jason D Williams, "Web-style ranking and slu combina- tion for dialog state tracking," in Proceedings of the 15th Annual Meeting of the Special Interest Group on Dis- course and Dialogue (SIGDIAL), 2014, pp. 282 -- 291.
1606.03254
2
1606
2016-08-15T10:11:49
Natural Language Generation enhances human decision-making with uncertain information
[ "cs.CL", "cs.AI" ]
Decision-making is often dependent on uncertain data, e.g. data associated with confidence scores or probabilities. We present a comparison of different information presentations for uncertain data and, for the first time, measure their effects on human decision-making. We show that the use of Natural Language Generation (NLG) improves decision-making under uncertainty, compared to state-of-the-art graphical-based representation methods. In a task-based study with 442 adults, we found that presentations using NLG lead to 24% better decision-making on average than the graphical presentations, and to 44% better decision-making when NLG is combined with graphics. We also show that women achieve significantly better results when presented with NLG output (an 87% increase on average compared to graphical presentations).
cs.CL
cs
Natural Language Generation enhances human decision-making with uncertain information Dimitra Gkatzia School of Computing Edinburgh Napier University Edinburgh, EH10 5DT, UK Oliver Lemon Interaction Lab Heriot-Watt University Edinburgh, EH14 4AS, UK [email protected] [email protected] Verena Rieser Interaction Lab Heriot-Watt University Edinburgh, EH14 4AS, UK [email protected] 6 1 0 2 g u A 5 1 ] L C . s c [ 2 v 4 5 2 3 0 . 6 0 6 1 : v i X r a Abstract Decision-making is often dependent on uncertain data, e.g. data associated with confidence scores or probabilities. We present a comparison of different informa- tion presentations for uncertain data and, for the first time, measure their effects on human decision-making. We show that the use of Natural Language Genera- tion (NLG) improves decision-making un- der uncertainty, compared to state-of-the- art graphical-based representation meth- ods. In a task-based study with 442 adults, we found that presentations using NLG lead to 24% better decision-making on av- erage than the graphical presentations, and to 44% better decision-making when NLG is combined with graphics. We also show that women achieve significantly better re- sults when presented with NLG output (an 87% increase on average compared to graphical presentations). Introduction 1 Natural Language Generation (NLG) technology can achieve comparable results to commonly used data visualisation techniques for supporting accu- rate human decision-making (Gatt et al., 2009). In this paper, we investigate whether NLG technol- ogy can also be used to support decision-making when the underlying data is uncertain. Current data-to-text systems assume that the underlying data is precise and correct – an assumption which is heavily criticised by other disciplines concerned with decision support, such as medicine (Gigeren- zer and Muir Gray, 2011), environmental mod- elling (Beven, 2009), climate change (Manning et al., 2004), or weather forecasting (Kootval, 2008). However, simply presenting numerical ex- pressions of risk and uncertainty is not enough. Psychological studies on decision making have found that a high percentage of people do not understand and can't act upon numerical uncer- tainty (Cokely et al., 2012; Galesic and Garcia- Retamero, 2010). For example, about 30% of par- ticipants in a German-American study are unable to answer the question: "Which of the following numbers represents the biggest risk of getting a disease: 1 in 100, 1 in 1000, 1 in 10?" (Galesic and Garcia-Retamero, 2010). So far, the NLG community has investigated the conversion of numbers into language (Power and Williams, 2012) and the use of vague ex- pressions (van Deemter, 2009). In this work, we explore how to convert numerical representa- tions of uncertainty into Natural Language so as to maximise confidence and correct outcomes of hu- man decision-making. We consider the exemplar task of weather forecast generation. We initially present two NLG strategies which present the un- certainty in the input data. The two strategies are based on (1) the World Meteorological Organisa- tion (WMO) (Kootval, 2008) guidelines and (2) commercial forecast presentations (e.g. from BBC presenters). We then evaluate the strategies against a state-of-the-art graphical system (Stephens et al., 2011), which presents the uncertain data in a graphical way. Figure 1 shows an example of this baseline graphical presentation. We use a game- based setup (Gkatzia et al., 2015) to perform task- based evaluation, to investigate the effect that the different information presentation strategies have on human decision-making. Weather forecast generation is a common topic within the NLG community, e.g. (Konstas and La- pata, 2012; Angeli et al., 2010; Belz and Kow, 2010; Sripada et al., 2005). Previous approaches have not focused on how to communicate uncer- tain information or the best ways of referring to Likelihood of oc- currence p >0.99 0.90 ≤ p ≤ 0.99 0.70 ≤ p ≤ 0.89 0.55 ≤ p ≤ 0.69 0.45 ≤ p ≤ 0.54 0.30 ≤ p ≤ 0.44 0.10 ≤ p ≤ 0.29 0.01 ≤ p ≤ 0.09 p<0.01 Lexicalisation "extremely likely" "very likely" "likely" "probable - more likely than not" "equally likely as not" "possible - less likely than not" "unlikely" "very unlikely" "extremely unlikely" Table 1: WMO-based mapping of likelihoods. with their likelihoods in three ways: (a) through graphical representations (which is the version of the original game), (b) through textual forecasts, and (c) through combined graphical and textual forecasts. We generated the textual format us- ing two rule-based NLG approaches as described in the next section. Users are asked to initially choose the best destination for the ice-cream ven- dor and then they are asked to state how confident they are with their choice. Based on their deci- sions and their confidence levels, the participants are finally presented with their "monetary gain". For example, the higher the likelihood of sunshine, the higher the monetary gain if the player has de- clared that s/he is confident that it is not going to rain and it doesn't actually rain. In the opposite scenario, the player would lose money. The de- cision on whether rain occurred is estimated by sampling the probability distribution. At the end of the game, users were scored according to their "risk literacy" following the Berlin Numeracy Test (Cokely et al., 2012). Further details are presented in (Gkatzia et al., 2015). 3 Natural Language Generation from Uncertain Information We developed two NLG systems, WMO-based and NATURAL, using SimpleNLG (Gatt and Re- iter, 2009), which both generate textual descrip- tions of rainfall and temperature data addressing the uncertain nature of forecasts. WMO-based: This is a rule-based system which uses the guidelines recommended by the WMO (Kootval, 2008) reporting uncertainty, as shown in Table 1. Consider for instance a fore- cast of sunny intervals with 30% probability of rain. This WMO-based system will generate the following forecast: "Sunny intervals with rain be- ing possible - less likely than not". NATURAL: This system imitates forecasters and for Figure 1: Graphics for temperature data. probabilities of meteorological phenomena to oc- cur. In addition, their evaluation is based on user ratings of grammatically, semantic correctness, fluency, coherence or via post-edit evaluation. Al- though these metrics are indicative of the quality of the text produced, they do not measure the im- pact the texts might have in people's comprehen- sion of uncertainty or on their ability to make de- cisions based on the information conveyed. Our contributions to the field are as follows: (1) We study a principled mapping of uncertainty to Natural Language and provide recommendations and data for future NLG systems; (2) We intro- duce a game-based data collection environment which extends task-based evaluation by measuring the impact of NLG on decision-making (measur- ing user confidence and game/task success); and (3) We show that effects of the different represen- tations vary for different user groups, so that user adaptation is necessary when generating multi- modal presentations of uncertain information. 2 The Extended Weather Game In this section, we present our extended version of the MetOffice's Weather Game (Stephens et al., 2011). The player has to choose where to send an ice-cream vendor in order to maximise sales, given weather forecasts for four weeks and two loca- tions. These forecasts describe (1) predicted rain- fall (Figure 2) and (2) temperature levels together Figure 2: Screenshot of the Extended Weather Game (Rainfall: Graphics and WMO condition). their natural way of reporting weather. The rules used in this system have been derived by observ- ing the way that experts (e.g. BBC weather re- porters) produce forecasts. For the previous exam- ple (sunny intervals with 30% probability of rain), this system will generate the following forecast: "Mainly dry with sunny spells". 4 Evaluation In order to investigate what helps people to better understand and act upon uncertainty in informa- tion presentations, we use five conditions within the context of the Extended Weather Game: 2. Multi-modal Representations: 1. Graphics only: This representation shows the users only the graphical representation of the weather forecasts. For this condition we used the graphs that scored best in terms of human comprehension from (Stephens et al., 2011). − Graphics and NATURAL: This is a multi-modal representation consisting of graphics (as described in the previous con- dition) and text produced by the NATURAL system. − Graphics and WMO-based: This is also a multi-modal representation consisting of graphics and text produced by the WMO- based system. 3. NLG only: − NATURAL only: This is a text-only rep- resentation as described above. − WMO-based system only: This is also a text-only representation. 5 Data We recruited 442 unique players (197 females1, 241 males, 4 non-disclosed) using social me- dia. We collected 450 unique game instances (just a few people played the game twice). The anonymised data will be released as part of this submission. 6 Results In order to investigate which representations as- sist people in decision-making under uncertainty, we analysed both the players' scores (in terms of monetary gain) and their predictions for rainfall with regard to their confidence scores. As we de- scribed in Section 2, the game calculates a mone- tary gain based on both the decisions and the con- fidence of the player, i.e. the decision-making abil- ity of the player. Regarding confidence, we asked users to declare how confident they are on a 10- point scale. In our analysis we therefore focus on both confidence and score at the game. 1Women made up 44.5% of the subjects. Graphs only Multi-modal NLG only Monetary gains Confidence 81.15 117.51 101.33 78.5% 83.7% 66% Graphs only Multi-modal NLG only Monetary gains Confidence 60.83 118.41 113.86 74.6% 81.3% 65.8% Table 2: Average Monetary gains and Confidence scores (All Adults). Table 3: Average Monetary gains and Confidence scores (Females). 6.1 Results for all adults Multi-modal vs. Graphics-only: We found that use of multi-modal representations leads to gain- ing significantly higher game scores (i.e. better decision-making) than the Graphics-only repre- sentation (p = 0.03, effect = +36.36). This is a 44% average increase in game score. Multi-modal vs. NLG-only: However, there is no significant difference between the NLG only and the multi-modal representation, for game score. NLG vs. Graphics-only: We found that the NLG representations resulted in a 24.8% increase in av- erage task score (i.e. better decision-making) com- pared to the Graphics-only condition, see Table 2: an average score increase of over 20 points. There was no significant difference found between the WMO and NATURAL NLG conditions. Confidence: For confidence, the multi-modal rep- resentation is significantly more effective than NLG only (p < 0.01, effect = 17.7%). However, as Table 2 shows, although adults did not feel very confident when presented with NLG only, they were able to make better decisions compared to being presented with graphics only. Demographic factors: We further found that prior experience on making decisions based on risk, familiarity with weather models, and cor- rect literacy test results are predictors of the play- ers' understanding of uncertainty, which is trans- lated in both confidence and game scores. In con- trast, we found that the education level, the gender, or being native speaker of English does not con- tribute to players' confidence and game scores. 6.2 Results for Females We found that females score significantly higher at the decision task when exposed to either of the NLG output presentations, when compared to the graphics-only presentation (p < 0.05, effect = +53.03). This is an increase of 87%, also see Table 3. In addition, the same group of users scores significantly higher when presented with the multi-modal output as compared to graphics only (p = 0.05, effect =60.74%). Interestingly, for this group, the multi-modal presentation adds lit- tle more in effectiveness of decision-making than the NLG-only condition, but the multi-modal pre- sentations do enhance their confidence (+15%). We furthermore found that educated (i.e. holding a BSc or higher degree) females, who also cor- rectly answered the risk literacy test, feel signif- icantly more confident when presented with the multi-modal representations than with NLG only (p = 0.01, effect = 16.7%). 6.3 Results for Males We found that males obtained similar game scores with all the types of representation. This suggests that the overall improved scores (for All Adults) presented above, are largely due to the beneficial effects of NLG for women. In terms of confidence, males are more likely to be more confident if they are presented with graphics only (81% of the time) or a multi-modal representation (85% of the time) (p = 0.01). 7 Conclusions and Future Work We present results from a game-based study on how to generate descriptions of uncertain data – an issue which so far has been unexplored by data-to-text systems. We find that there are sig- nificant gender differences between multi-modal, NLG, and graphical versions of the task, where for women, use of NLG results in a 87% increase in task success over graphics. Multimodal presenta- tions lead to a 44% increase for all adults, com- pared to graphics. People are also more confident of their judgements when using the multimodal representations. These are significant findings, as previous work has not distinguished between gen- ders when comparing different representations of data, e.g. (Gatt et al., 2009). It also confirms re- search on gender effects in multi-modal systems, as for example reported in (Foster and Oberlan- der, 2006; Rieser and Lemon, 2008; Weiss et al., 2012). The results are also related to educational research, which shows that women perform bet- ter in verbal-logical tasks than visual-spatial tasks (Zhu, 2007). An interesting investigation for fu- ture research is the interplay between uncertainty, risk-taking behaviour and gender, as for example reported in (Sarin and Wieland, 2016). Acknowledgments This research received funding from the EPSRC projects GUI (EP/L026775/1), DILiGENt (EP/M005429/1) and MaDrI- gAL (EP/N017536/1). References [Angeli et al.2010] Gabor Angeli, Percy Liang, and Dan Klein. 2010. A simple domain-independent probabilistic approach to generation. In Conference on Empirical Methods in Natural Language Pro- cessing (EMNLP). [Belz and Kow2010] Anja Belz and Eric Kow. 2010. Extracting parallel fragments from comparable cor- pora for data-to-text generation. In 6th International Natural Language Generation Conference (INLG). [Beven2009] Keith Beven. 2009. Environmental Mod- elling: An Uncertain Future? Routledge. [Cokely et al.2012] Edward T. Cokely, Mirta Galesic, Eric Schulz, Saima Ghazal, and Rocio Garcia- Retamero. 2012. Measuring risk literacy: The berlin numeracy test. Judgment and Decision Mak- ing, 7(1):25–47. [Foster and Oberlander2006] Mary Ellen Foster and Jon Oberlander. 2006. Data-driven generation of emphatic facial displays. In Proc. of the 11th Con- ference of the European Chapter of the Association for Computational Linguistics (EACL). [Galesic and Garcia-Retamero2010] Mirta Galesic and Rocio Garcia-Retamero. 2010. Statistical numer- acy for health: A cross-cultural comparison with probabilistic national samples. Archives of Internal Medicine, 170(462–468). [Gatt and Reiter2009] Albert Gatt and Ehud Reiter. 2009. SimpleNLG: A realisation engine for prac- tical applications. In ENLG. [Gatt et al.2009] Albert Gatt, Francois Portet, Ehud Re- iter, James Hunter, Saad Mahamood, Wendy Mon- cur, and Somayajulu Sripada. 2009. From Data to Text in the Neonatal Intensive Care Unit: Using NLG Technology for Decision Support and Infor- mation Management. AI Communications, 22: 153- 186. [Gigerenzer and Muir Gray2011] G. Gigerenzer and J. A. Muir Gray, editors. 2011. Better doctors, better patients, better decisions: Envisioning health care 2020. Cambridge MIT Press. [Gkatzia et al.2015] Dimitra Gkatzia, Amanda Cer- cas Curry, Verena Rieser, and Oliver Lemon. 2015. A game-based setup for data collection and task- based evaluation of uncertain information presenta- tion. In Proceedings of the 15th European Workshop on Natural Language Generation (ENLG), pages 112–113, Brighton, UK, September. Association for Computational Linguistics. [Konstas and Lapata2012] Ioannis Konstas and Mirella Lapata. 2012. Unsupervised concept-to-text gener- ation with hypergraphs. In Conference of the North American Chapter of the Association for Computa- tional Linguistics (NAACL). [Kootval2008] Haleh Kootval, editor. 2008. Guidelines on Communicating Forecast Uncertainty. World Meteorological Organisation. [Manning et al.2004] Martin Manning, Michel Petit, David Easterling, James Murphy, Anand Patward- han, Hans-Holger Rogner, Rob Swart, and Gary Yohe. 2004. IPCC Workshop on Describing Sci- entific Uncertainties in Climate Change to Support Analysis of Risk and of Options. [Power and Williams2012] Richard Power and Sandra Williams. 2012. Generating numerical approxima- tions. Computational Linguistics, 38(1):113–134, March. [Rieser and Lemon2008] V. Rieser and O. Lemon. Learning effective multimodal dialogue 2008. strategies from wizard-of-oz data: Bootstrapping and evaluation. Proceedings of ACL, pages 638– 646. [Sarin and Wieland2016] Rakesh Sarin and Alice Wieland. 2016. Risk aversion for decisions under uncertainty: Are there gender differences? Journal of Behavioral and Experimental Economics, 60:1 – 8. [Sripada et al.2005] Somayajulu G. Sripada, Ehud Re- iter, and Lezan Hawizy. 2005. Evaluation of an NLG system using post-edit data. In International Joint Conference on Artificial Intelligence (IJCAI). [Stephens et al.2011] Liz Stephens, Ken Mylne, and David Spiegelhalter. 2011. Using an online game to evaluate effective methods of communicating en- semble model output to different audiences. In American Geophysical Union, Fall Meeting. [van Deemter2009] Kees van Deemter. 2009. Utility and language generation: The case of vagueness. Journal of Philosophical Logic, 38(6):607–632. [Weiss et al.2012] Benjamin Weiss, Sebastian Moller, and Matthias Schulz. 2012. Modality preferences of different user groups. In The Fifth International Conference on Advances in Computer-Human Inter- actions (ACHI). [Zhu2007] Zheng Zhu. 2007. Gender differences in mathematical problem solving patterns: A re- view of literature. International Education Journal, 8(2):187 – 203.
1805.11611
1
1805
2018-05-29T17:54:52
Semantically-informed distance and similarity measures for paraphrase plagiarism identification
[ "cs.CL" ]
Paraphrase plagiarism identification represents a very complex task given that plagiarized texts are intentionally modified through several rewording techniques. Accordingly, this paper introduces two new measures for evaluating the relatedness of two given texts: a semantically-informed similarity measure and a semantically-informed edit distance. Both measures are able to extract semantic information from either an external resource or a distributed representation of words, resulting in informative features for training a supervised classifier for detecting paraphrase plagiarism. Obtained results indicate that the proposed metrics are consistently good in detecting different types of paraphrase plagiarism. In addition, results are very competitive against state-of-the art methods having the advantage of representing a much more simple but equally effective solution.
cs.CL
cs
Semantically-informed distance and similarity measures for paraphrase plagiarism identification∗ Miguel A. Álvarez-Carmona1, Marc Franco-Salvador2, Esaú Villatoro-Tello3 , Manuel Montes-y-Gómez1, Paolo Rosso4, Luis Villaseñor-Pineda1 1Computer Science Department Instituto Nacional de Astrofísica, Óptica y Electrónica Puebla, México 2 Symanto Research, Nuremberg, Germany 3 Information Technologies Department, Universidad Autónoma Metropolitana Unidad Cuajimalpa, Ciudad de México, México 4PRHLT Research Center Universitat Politècnica de València, Spain May 30, 2018 Abstract Paraphrase plagiarism identification represents a very complex task given that plagiarized texts are intentionally modified through several rewording techniques. Accordingly, this paper introduces two new measures for evaluating the relatedness of two given texts: a semantically-informed similarity measure and a semantically- informed edit distance. Both measures are able to extract semantic information from either an external resource or a distributed representation of words, resulting in informative features for training a supervised classifier for detecting paraphrase plagiarism. Obtained results indicate that the proposed metrics are consistently good in detecting different types of paraphrase plagiarism. In addition, results are very competitive against state-of-the art methods having the advantage of repre- senting a much more simple but equally effective solution. Keywords: Plagiarism identification, Paraphrase Plagiarism, Semantic similarity, Edit distance, Word2vec representation. 1 Introduction Text plagiarism means including other person's text as your own without proper citation [18]. Nowadays, because of the Web and text editing tools, it is very easy to find ∗Preprint of [2]. through https:// content.iospress.com/articles/journal-of-intelligent-and-fuzzy-systems/ ifs169483 The final publication is available at IOS Press 1 and re-use any kind of information [1], causing the plagiarism practice to dramatically increase. Traditional methods for plagiarism detection consider measuring the word overlap between two texts [14]. Using measures such as the Jaccard and cosine coefficients [10] resulted in a simple but effective approach for determining the similarity between the suspicious and the source texts [11, 22]. Likewise, measuring the similarity of texts by means of an edit-distance [13, 19, 6] or the Longest Common Subsequence (LCS) [10] resulted in effective approaches. In general, these approaches are very accurate on detecting verbatim cases of plagiarism (i.e., copy-paste), but they are useless to detect complex cases of plagiarism, such as paraphrase plagiarism, where texts show significant differences in wording and phras- ing. Detecting paraphrase plagiarism represents a challenging task for current methods since they are not able to measure the semantic overlap. Accordingly, some research works have tried to overcome this limitation by proposing the use of knowledge re- sources such as WordNet [16] for evaluating the semantic proximity of texts [4, 8, 17]. Although these methods have been widely applied for measuring the degree of para- phrases between two given texts, just [17] evaluates its relevance for plagiarism detec- tion. More recently, [5, 12] discussed the use of semantic information without depend- ing on any external knowledge resource. Particularly, they proposed using distributive representations, such as word2vec [15], in the task of plagiarism detection. The main drawback of these approaches is that they often need large training sets in order to learn accurate models. This paper focuses on the detection of paraphrase plagiarism. It proposes two new measures for evaluating the relatedness of two given texts: a semantically informed similarity measure and a semantically informed edit distance. Both measures can ex- tract the semantic information from WordNet and word2vec. On the top of these mea- sures we trained a classifier for detecting paraphrase plagiarism. In short, the goal of this paper is threefold: i) to evaluate the effectiveness of the proposed measures, when using WordNet and word2vec, in the paraphrase plagiarism identification task; ii) to in- vestigate the complementarity of both kind of measures for solving the posed task; and iii) to determine the effectiveness of the semantically informed measures on detecting specific types of (plagiarism) paraphrases. The remainder of this paper is organized as follows. Section 2 describes the pro- posed semantically informed measures; Section 3 describes the used datasets and the experimental setup; Section 4 presents and discusses the obtained results. Finally, Sec- tion 5 depicts our conclusions and some future work directions. 2 Proposed semantically-informed measures This section describes the two proposed measures for paraphrase plagiarism identifica- tion. Section 2.1 presents a modification of the Jaccard coefficient considering semantic information, whereas Section 2.2 describes our semantically informed version of the Levenshtein edit distance. In order to illustrate the limitations of traditional measures and to motivated our 2 Figure 1: Example of two (A and B) semantically related sentences. Dotted lines connect exact matching words whilst solid lines connect semantically related words. proposed modifications, please consider the two sentences from Figure 1. Applying the traditional Jaccard measure it will result in a low similarity, JpA, Bq " 0.31, since only 7 terms out of a total of 22 match exactly. Similarly, the classic Levenshtein edit distance will indicate that the sentences are very distant, EDpA, Bq " 0.70. Never- theless, it is evident that these two texts are more similar than these results indicate; they contain several additional pair of terms (solid line connections) that are semanti- cally related but not considered. Therefore, our proposal is to semantically enrich these measures by means of including the similarity degree of non-overlapped words. 2.1 Semantically-informed similarity measure Let's assume A and B are two documents with vocabularies VA and VB, and that V 1 and V 1 B indicate their non-overlapping words respectively. Their semantic similarity, based on the Jaccard coefficient, is computed as shown in Formula 1. A SJpA, Bq " VA X VB ` softmatchpV 1 VA Y VB ´ softmatchpV 1 (1) The function softmatchpX, Y q accounts for the maximum similarity values be- tween words contained in the sets X and Y . For its computation we first measure the similarity simpx, yq among all words x P X and y P Y ; this similarity could be measured using WordNet or word2vec. Then, we eliminate irrelevant relations, that is, we set simpx, yq " 0 if it is not the greatest similarity score for both x and y with any other term. Finally, we accumulate the resulting similarities as indicate by Formula 2. Bq A, V 1 Bq A, V 1 ÿ simpx, yq softmatchpX, Y q " @xPX,@yPY Continuing with the example from Figure 1, V 1 (2) A " {question, linked, closely, to, B " {query, intimately, connected, with, disputed, debated, issue, beginnings} and V 1 point, origin}. Using WordNet as semantic resource for computing word similarities as described in Section 3.2, softmatchpA1, B1q " 6.75, resulting in SJpA, Bq " 0.90, which in turn reflects a more realistic similarity than the initial estimated value. 2.2 Semantically-informed edit distance This new measure is based on the Levenshtein edit distance. It also computes the minimum number of operations permitted (generally substitution [S], deletion [D] and 3 insertion [I]) for transforming text A to text B. However, different to the traditional version where each operation has unitary cost, our proposal accounts for the seman- tic similarity between substituted words and determines the impact of inserted/deleted words in the text. The proposed semantically-informed edit distance between two texts A and B, of lengths A and B respectively, is given by SEDA,BpA,Bq where: $&% SEDpi ´ 1, jq ` distpτ, Aiq SEDpi, j ´ 1q ` distpτ, Bjq SEDA,Bpi, jq " min SEDpi ´ 1, j ´ 1q ` distpAi, Bjq D I S (3) In this approach the substitution of a word x by a word y has a cost proportional to their semantic distance distpx, yq. This distance could be measured using WordNet or word2vec as described in Section 3.2. Similarly, the insertion or deletion of a word x has a variable cost, which is defined in function of its semantic distance to a predefined general word τ. The idea is that the greater distpτ, xq, the more rare is the word x, and the more important its contribution of the meaning of the text. Following with the example above, the new edit distance between texts A and B is small, SEDpA, Bq " 0.20, because all words in bold face are substituted by semanti- cally related words, for instance, "question" by "query" and "beginnings" by "origin". In addition, all removed words, such as "of", "the" and "itself" are very general and, therefore, their deletion do not have a considerable impact. 3 Experimental Setup The proposed distance and similarity measures are especially suited to the task of para- phrase plagiarism identification. Accordingly, this section presents the datasets used for their evaluation as well as a description of their configuration for the task. 3.1 Datasets. We used the P4PIN corpus1 [20], a corpus specially built for evaluating the identifica- tion of paraphrase plagiarism. This corpus is an extension of the P4P corpus [3], which contains pairs of text fragments where one fragment represents the original source text and the other represents a paraphrased version of the original. In addition, the P4PIN corpus includes not paraphrase plagiarism cases, i.e., negative examples formed by pairs of unrelated texts samples with likely thematic or stylistic similarity. Table 1 shows two examples from this corpus, one case of paraphrase plagiarism and one of not-paraphrase plagiarism. An important characteristic of this corpus is that each plagiarism case is labeled with a particular subtype of paraphrase. Authors of the P4P corpus [3] employed a paraphrases typology, which includes four general classes, two of them with four sub- classes, for a total of nineteen types of paraphrases. For our purposes, we took two classes from the most general categorization level, and the four subclasses from the second categorization level as described below: 1Available at: http://ccc.inaoep.mx/~mmontesg/resources/corpusP4PIN.zip 4 Table 1: Examples of paraphrase-plagiarism and not-paraphrase-plagiarism in the P4PIN corpus. Underlined words represent common words between the original and the suspicious document; below each column appears the percentage of common words between text fragments. Original Paraphrase plagiarism example I pored through these pages, and as I perused the lyrics of The Unknown Eros that I had never read before, I appeared to have found out something wonderful: there before me was an entire shining and calming extract of verses that were like a new universe to me. Not-paraphrase plagiarism example The fact that an omnipresent God exists is the one universal factor that governs the laws of nature. God has set in place the laws of the universe for His own purposes. Suspicious I dipped into these pages, and as I read for the first time some of the odes of The Unknown Eros, I seemed to have made a great discovery: here was a whole glittering and peaceful tract of poetry which was like a new world to me. The laws of nature are the art of God. Without the presence of such an agent, one who is conscious of all upon which the laws of nature depend, producing all that the laws prescribe. The laws themselves could have no existence. Common words 57.4% 54.8% • Morphology-based changes include inflectional changes (e.g., affixes modifica- tion), modal verb modification (e.g., might Ñ could) and derivation changes. • Lexicon-based changes comprise modifications such as synthetic and analytic reconstruction, spelling and format change, polarity substitutions and converse substitutions; in general these types of changes alter only one lexical unit within a sentence preserving the original meaning. • Syntax-based modifications cause structural alterations in a sentence, allowing to have the same meaning but redirecting the main focus to different elements within the sentence; paraphrase types included in this category are: diathesis alterations, negation switching, ellipsis, coordination changes and subordination with nesting changes. • Discourse-based modifications alter the sentences' form and order; they include changes in punctuation marks, modifications in the syntactic structure, modality changes as well as some direct or indirect style alternations. • Semantic-based changes consider modifications involving substitution of some elements within a sentence that results in lexical and syntactical modifications without interfering with the original meaning of the sentence. Semantic-based changes represent the highest level of modifications. • Miscellaneous-based changes recollect all types of modifications that do not cor- respond to specific linguistic paraphrase phenomena, such as addition, deletion or changing the order of lexical units. In summary, the P4PIN corpus has 2236 instances, where 75% are not-plagiarism cases and 25% are plagiarism cases. 5 In order to get more insight on the relevance and robustness of the proposed mea- sures we also evaluated them in the paraphrase identification task.2 For this purpose we used the well-known MSRP corpus [9], which contains pairs of sentences labeled as "mean the same thing" (paraphrase) or not (not-paraphrase) [9]. This corpus is divided in two partitions, a training set having 4,076 sentences pairs and a test set containing 1,725 examples; in both partitions, 67% of the instances are plagiarism examples and the remaining 33% are not-plagiarism cases. Contrary to the P4PIN, the MSRP corpus is not labeled by paraphrase sub-types. 3.2 Semantic word similarity Both proposed measures rely on the calculus of the semantic similarity or distance between pairs of words (simpx, yq or distpx, yq). For the sake of simplicity we defined distpx, yq " 1 ´ simpx, yq. We used two different approaches for computing the word similarity. On the one hand, we used WordNet as knowledge source and applied the WUP similarity measure [21]. This measure calculates the semantic relatedness of two given words x and y by considering the depths of their synsets in the WordNet taxonomy (sx and sy), along with the depth of their most specific common synset (mcs) as described by Formula 4. simpx, yq " 2 depthpmscq depthpsxq ` depthpsxq (4) On the other hand, we used the word2vec representation, and measured the sim- ilarity of words by means of the cosine function. In particular, we used the contin- uous Skip-gram model [15] of the word2vec toolkit3 to generate the distributed rep- resentations of the words from the complete English Wikipedia. We considered 200- dimensional vectors, a context window of size 10, and 20 negative words for each sample. 3.3 Classification process Once computed the similarity (or edit distance) between the suspicious and source texts, the next step is to determine whether or not the pair of texts are a case of pla- giarism. When using the semantically-informed similarity measure, if the similarity score is greater than some threshold βs, then the instance is classified as "plagiarism" otherwise the result is "not-plagiarism". On the other hand, when using the semantic- informed edit distance, if the distance score is greater that some threshold βd, then the instance is labeled as "not-plagiarism" otherwise the result is "plagiarism". For the experiments done with the P4PIN corpus we carried out a ten-fold cross- validation strategy. We considered as classification threshold (βs or βd) the one that maximizes the classification performance at training. For the MSRP corpus we used the given training and test partitions. The classification threshold is defined from the 2Although similar, paraphrase plagiarism identification differs from paraphrase identification in that the former is done with the intention of hiding the text-reuse (i.e., the plagiarism act) 3https://code.google.com/archive/p/word2vec/ 6 Table 2: F1 results in the identification of paraphrase and paraphrase plagiarism, using the traditional and the proposed similarity and distance measures. Suffix W2V means word2vec and WN indicates WordNet. Corpus J SJ-W2V SJ-WN ED SED-W2V SED-WN P4PIN 0.90 MSRP 0.80 0.80 0.87 0.73 0.75 0.91 0.81 0.90 0.81 0.82 0.76 training partition. In all the experiments we used the macro F1-measure as main eval- uation measure. 4 Experimental Results This section presents the results of several experiments aimed to assess the effective- ness of the proposed measures in the task of paraphrase plagiarism identification, as well as to analyze their complementarity and their appropriateness for identifying pla- giarism cases using different categories of paraphrases. 4.1 Relevance of considering semantic information To assess the relevance of considering semantic information in the calculation of the similarity/distance between two texts, we carried out the following set of experiments: i) using the original Jaccard coefficient (J), ; ii) using the original edit distance (ED); iii) using the proposed semantically-informed measures with WordNet (SJ-WN and SED-WN) and with word2vec (SJ-W2V and SED-W2V). Results from Table 2 show that the proposed semantically informed approaches, based on both the Jaccard and the Levenshtein edit distance measures, obtained better or equal F1 results than the approaches using the original measures. This particularly happens when word2vec is used as word similarity function (SJ-W2V and SED-W2V). We attribute these results to the coverage of the semantic resources. Table 3 shows a comparative analysis of the vocabulary coverage for both WordNet and word2vec resources within each evaluated corpus. These results indicate that WordNet has lower coverage value than word2vec. Thus, results from Table 3 highlight the limitations of using an external resource such as WordNet. Table 3: Comparative analysis of the vocabulary coverage. Corpus WordNet word2vec P4PIN MSRP 79.52% 79.1% 91% 98% 7 Figure 2: Decision tree of the combined approach on the P4PIN corpus. 4.2 Complementary of the proposed measures The proposed measures are similar in that both consider semantic information and, therefore, both can identify related texts even when they do not contain exactly match- ing words. However, they differ from each other in the way they compute the related- ness of texts. On the one hand, the similarity measure focuses on the content overlap, whereas, on the other hand, the distance measure emphasizes the word order. Accord- ingly, this section presents an experiment aimed to analyze the complementarity of the two measures. The experiment reported in this section combines the best results from the previ- ous section (i.e., SJ-W2V and SED-W2V). For the combination we used a supervised classification approach, where the scores obtained from both measures were used as features. We considered several learning algorithms, such as SVM, Naïve Bayes and J48, but we only report the results obtained by J48 because they outperformed the others as well as allow us to understand the classification criteria (refer to Figure 2). Table 4 shows the results from this experiment. It can be noticed that the results obtained by the combined approach clearly outperform the results from the approaches using the proposed measures individually. Hence, our preliminary conclusion is that these two measures are in fact complementary to each other. Additionally, this table shows the state-of-the-art results for the two used datasets. As noticed, the results from our combined approach are close to the reference results, nonetheless, ours is a much more simple approach (for example, [7] reports a recursive neural network using syntax-aware and multi-sense word embeddings). 8 Table 4: F1 results from the combination of the semantically-informed similarity and distance measures. The SOA column indicates the state-of-the-art performance re- ported for each dataset. Corpus SJ-W2V SED-W2V Combined P4PIN MSRP 0.93 0.83 0.90 0.81 0.91 0.81 SOA 0.92 [20] 0.85 [7] Table 5: F1 results in several paraphrase categories using different similarity and dis- tance measures. The SOA column shows state-of-the-art results reported in [20]. In [20] character n-grams are used for representing the documents and measuring their similarity. Paraphrases categories Morphological Lexical Syntactical Discourse Semantic Miscellaneous J 0.85 0.90 0.88 0.86 0.77 0.89 Jaccard Levenshtein SJ-W2V ED SED-W2V 0.88 0.91 0.89 0.87 0.78 0.89 0.85 0.88 0.85 0.86 0.73 0.85 0.86 0.89 0.87 0.89 0.80 0.87 Combined SOA [20] 0.90 0.92 0.91 0.89 0.77 0.90 0.92 0.93 0.93 0.92 0.83 0.92 4.3 Robustness on different paraphrase categories The plagiarism examples from the P4PIN corpus are categorized according to their paraphrases types, namely: morphology, lexicon, syntax, discourse, semantic and mis- cellaneous changes [3] (refer to Section 3.1). The experiments reported in this sec- tion aim at measuring the robustness of the proposed semantically-informed measures against different paraphrase practices. Table 5 shows the obtained results. These results indicate that the proposed measures (using word2vec as semantic re- source) consistently improve the performance results of the traditional variants. They also indicate that paraphrases from the semantic category are the harder to identify. This performance was expected, since semantic changes involve lexical and syntac- tical modifications. Additionally, these results outperform the state-of-the-art in all categories, evidencing that the supervised combined approach is the best option for identifying plagiarism regardless of the type of paraphrase. 4.4 On the complexity of corpora In order to provide a deeper analysis on the obtained results, we decided to investigate the level of complexity of the employed corpora. Through this analysis we aim to figure out under which circumstances our proposed semantically informed metrics perform the better. 9 For determining the level of complexity of a given corpus C we propose the fol- lowing straightforward measure (refer to Formula 5), which assesses the lexical con- cordance (LC) across both plagiarism and not-plagiarism examples. LCpCq " Cneg ´ OpCnegq ` OpCposq C (5) where Cneg and Cpos represent the negative and positive partitions of corpus C respectively. Accordingly, OpCxq represents the accumulated similarity between all pairs of documents contained in the x partition of the corpus C and it is obtained using the Formula 6, where JpA, Bq represents the Jaccard coefficient between the pair of documents A and B. OpCxq " JpA, Bq (6) ÿ @pA,BqPCx The closer the value of lexical concordance to zero means the corpus is more com- plex, whilst the closer to one indicated an easier corpus. For example, in a low com- plexity corpus (LCpCq Ñ 1) the positive instances are merely verbatim cases and the negative examples are completely unrelated text chunks. Table 6 shows the LC values for the MSRP and P4PIN collections. It can be noticed that MSPR is more complex than P4PIN (see first two rows from Table 6). Addition- ally, in the P4PIN corpus we observe that the more complex paraphrase category is the semantic category, whereas the easier is the lexical one. As a final experiment we analyze the influence of the complexity of the collections over the performance of the proposed semantic enriched measures. In particular we analyzed the correlation between the LC value of each category of the P4PIN corpus and the F1 improvement of the proposed approach over the baselines. For this analysis we applied the Spearman Correlation Coefficient. Table 6: Lexical concordance values of the employed corpora 0.76 0.56 LC value Corpus P4PIN MSRP Paraphrase types LC value Lexical Discourse Miscellaneous Syntactical Morphological Semantic 0.41 0.41 0.39 0.39 0.38 0.29 Table 7 shows the obtained correlation results, indicating some very interesting insights from the proposed measures. On the one hand, there is a strong correlation between the complexity of the corpus and the performance of our combined method. 10 Given the correlation is negative, it indicates that the more complex is the corpus (the smallest the LC value), the greater is the advantage of our method over SOA results; in other words, our proposed method performs consistently better when the corpus has a high complexity level. A similar situation occurs when employing our semantically informed edit distance (SED) approach; it especially outperforms the ED results for the complex paraphrase categories. On the other hand, the correlation results indicate that the improvement of SJ-W2V over J is not related to the corpus complexity. Table 7: Correlation analysis Compared methods SJ-W2V vs. J SED-W2V vs. ED Combined vs. SOA r -0.0377 -0.8771 -0.8985 5 Conclusions and future work We have introduced an approach for paraphrase plagiarism detection which proposes the inclusion of semantic information to traditional similarity and edit distance mea- sures. The aim of the proposed semantically-informed measures is to allow assessing the relatedness between suspicious and source texts even when they do not contain exactly matching words. We hypothesized that using the proposed semantically-informed measures, a method for paraphrase plagiarism identification would be more accurate in solving the task. Performed experiments indicate that our proposed method obtained state-of-the-art re- sults, especially when distributed word representations are considered as a semantic resource. Additionally, experiments demonstrated that the information provided by the two semantically-informed measures is complementary to each other, resulting in use- ful features for a supervised classifier to learn whether or not the pair of texts are a case of plagiarism. Further, we investigated the degree of robustness of the proposed measures against different subtypes of paraphrase plagiarism. Obtained results showed that the proposed approaches, either individually or combined, are able to improve the performance of traditional techniques for the distinct paraphrase plagiarism categories, particularly for those with higher complexities. Finally, it is important to highlight that obtained results are competitive to those reported in recent research works, but, in contrast, the proposed approach represents a much more simple method. As future work we plan to study the sensitivity of our method to the coverage of the semantic resource, in particular we plan to evaluate our method using a word2vec representation trained over a larger corpus. Acknowledgements: This work was partially supported by CONACYT under scholar- ship 401887, project grants 257383, 258588 and 2016-01-2410 and under the Thematic Networks program (Language Technologies Thematic Network project 281795). The 11 work of the fourth author was partially supported by the SomEMBED TIN2015-71147- C2-1-P MINECO research project and by the Generalitat Valenciana under the grant ALMAMATER (Prometeo II/2014/030). References [1] Asad Abdi, Norisma Idris, Rasim M Alguliyev, and Ramiz M Aliguliyev. Pdlk: Plagiarism detection using linguistic knowledge. Expert Systems with Applica- tions, 42(22):8936–8946, 2015. [2] Miguel A Álvarez-Carmona, Marc Franco-Salvador, Esaú Villatoro-Tello, Manuel Montes-y Gómez, Paolo Rosso, and Luis Villaseñor-Pineda. Semantically-informed distance and similarity measures for paraphrase pla- giarism identification. Journal of Intelligent & Fuzzy Systems, (Preprint):1–8, 2018. [3] Alberto Barrón-Cedeño, Marta Vila, M. Antònia Martí, and Paolo Rosso. Plagia- rism meets paraphrasing: insights for the next generation in automatic plagiarism detection. Computational Linguistics, 39(4):917–947, 2013. [4] Sam Biggins, Shaabi Mohammed, and Sam Oakley. University of shefield: Two In First Joint Conference on Lexical approaches to semantic text similarity. and Computational Semantics (SEM at NAACL 2012), pages 655–661, Montreal, Canada., 2012. [5] Arijana Brlek, Petra Franjic, and Nino Uzelac. Plagiarism detection using word2vec model. Text Analysis and Retrieval 2016 Course Project Reports, page 4, 2016. [6] Krishnendu Chatterjee, Thomas A Henzinger, Rasmus Ibsen-Jensen, and Jan Otop. Edit distance for pushdown automata. arXiv preprint arXiv:1504.08259, 2015. [7] Jianpeng Cheng and Dimitri Kartsaklis. Syntax-aware multi-sense word embed- In Proceedings of the 2015 dings for deep compositional models of meaning. Conference on Empirical Methods in Natural Language Processing, pages 1531– 1542. ACL, 2015. [8] Corley Courtney and Rada Mihalcea. Measuring the semantic similarity of texts. In Proceedings of the ACL Workshop on Empirical Modeling of Semantic Equiv- alence and Entailment (EMSEE at NAALC 2005), pages 13–18, 2005. [9] William B Dolan and Chris Brockett. Automatically constructing a corpus of sentential paraphrases. In Proc. of IWP, 2005. [10] Wael H Gomaa and Aly A Fahmy. A survey of text similarity approaches. Inter- national Journal of Computer Applications, 68(13):13–18, 2013. 12 [11] Timothy C Hoad and Justin Zobel. Methods for identifying versioned and pla- giarized documents. Journal of the American society for information science and technology, 54(3):203–215, 2003. [12] Sun Kim, W John Wilbur, and Zhiyong Lu. Bridging the gap: a semantic similar- ity measure between queries and documents. arXiv preprint arXiv:1608.01972, 2016. [13] Vladimir I Levenshtein. Binary codes capable of correcting deletions, insertions, and reversals. In Soviet physics doklady, volume 10, pages 707–710, 1966. [14] Romans Lukashenko, Vita Graudina, and Janis Grundspenkis. Computer-based plagiarism detection methods and tools: an overview. In Proceedings of the 2007 international conference on Computer systems and technologies, page 40. ACM, 2007. [15] Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Dis- tributed representations of words and phrases and their compositionality. In Ad- vances in neural information processing systems, pages 3111–3119, 2013. [16] George A Miller. Wordnet: a lexical database for english. Communications of the ACM, 38(11):39–41, 1995. [17] Yurii Palkovskii, Alexei Belov, and Iryna Muzyka. Using wordnet-based semantic similarity measurement in external plagiarism detection. In Notebook for PAN at CLEF'11, 2011. [18] Ashutosh Pandey, Manpreet Kaur, and Puneet Goyal. The menace of plagiarism: In Emerging Trends and Technologies in Libraries How to detect and curb it. and Information Services (ETTLIS), 2015 4th International Symposium on, pages 285–289. IEEE, 2015. [19] Efstathios Stamatatos. Plagiarism detection using stopword n-grams. Journal of the American Society for Information Science and Technology, 62(12):2512– 2527, 2011. [20] J. Fernando Sánchez-Vega. Identificación de plagio parafraseado incorporando estructura, sentido y estilo de los textos. PhD thesis, Instituto Nacional de As- trofísica, Optica y Electrónica, 2016. [21] Zhibiao Wu and Martha Palmer. Verbs semantics and lexical selection. In Pro- ceedings of the 32nd Annual Meeting on Association for Computational Linguis- tics, ACL '94, pages 133–138, Stroudsburg, PA, USA, 1994. Association for Computational Linguistics. [22] Mario Zechner, Markus Muhr, Roman Kern, and Michael Granitzer. External and intrinsic plagiarism detection using vector space models. In CEUR Workshop Proceedings, volume 502, pages 47–55, 2009. 13
1909.04702
1
1909
2019-09-10T18:39:26
Neural Embedding Allocation: Distributed Representations of Topic Models
[ "cs.CL", "cs.IR", "cs.LG" ]
Word embedding models such as the skip-gram learn vector representations of words' semantic relationships, and document embedding models learn similar representations for documents. On the other hand, topic models provide latent representations of the documents' topical themes. To get the benefits of these representations simultaneously, we propose a unifying algorithm, called neural embedding allocation (NEA), which deconstructs topic models into interpretable vector-space embeddings of words, topics, documents, authors, and so on, by learning neural embeddings to mimic the topic models. We showcase NEA's effectiveness and generality on LDA, author-topic models and the recently proposed mixed membership skip gram topic model and achieve better performance with the embeddings compared to several state-of-the-art models. Furthermore, we demonstrate that using NEA to smooth out the topics improves coherence scores over the original topic models when the number of topics is large.
cs.CL
cs
Neural Embedding Allocation: Distributed Representations of Topic Models Kamrun Naher Keya Department of Information Systems University of Maryland Baltimore County [email protected] Yannis Papanikolaou Atypon Systems [email protected] James R. Foulds Department of Information Systems University of Maryland Baltimore County [email protected] Abstract Word embedding models such as the skip-gram learn vector representations of words' semantic relationships, and document embedding models learn similar represen- tations for documents. On the other hand, topic mod- els provide latent representations of the documents' top- ical themes. To get the benefits of these representa- tions simultaneously, we propose a unifying algorithm, called neural embedding allocation (NEA), which decon- structs topic models into interpretable vector-space em- beddings of words, topics, documents, authors, and so on, by learning neural embeddings to mimic the topic models. We showcase NEA's effectiveness and generality on LDA, author-topic models and the recently proposed mixed membership skip gram topic model and achieve better performance with the embeddings compared to sev- eral state-of-the-art models. Furthermore, we demonstrate that using NEA to smooth out the topics improves coher- ence scores over the original topic models when the num- ber of topics is large. 1 Introduction In recent years, methods for automatically learning rep- resentations of text data have become an essential part of the natural language processing pipeline. Word em- bedding models such as the skip-gram improve the per- formance of Natural Language Processing (NLP) meth- ods by revealing the latent structural relationship between words [Mikolov et al., 2013a,b]. These embeddings have proven valuable for a variety of NLP tasks such as statis- tical machine translation Vaswani et al. [2013], part-of- speech tagging, chunking, and named entity recognition Collobert et al. [2011]. Since word vectors encode distri- butional information, the similarity relationships between the semantic meanings of the words are reflected in the similarity of the vectors Sahlgren [2008]. Extensions to document embeddings have subsequently been proposed Le and Mikolov [2014]. On the other hand, topic models such as latent Dirich- let allocation (LDA) Blei et al. [2003] construct latent representations of topical themes and of documents, and these can be used to subsequently derive representations for words [Griffiths et al., 2007]. Like word embed- dings, topic models exploit conditional discrete distribu- tion over words to represent high-dimensional data into a low-dimensional subspace. However, topic models do not directly capture nuanced relationships between words us- ing vector-space embeddings, which are often important for performance on downstream NLP tasks Maas et al. [2011]. We therefore desire a unified method which gains the 1 benefits of both word embeddings (encoding nuanced se- mantic relationships) and topic models (recovering inter- pretable topical themes). Some recent research has aimed to combine aspects of topic models and word embeddings. The Gaussian LDA model Das et al. [2015] tries to im- prove the performance of topic modeling by prioritizing the semantic information encoded in word embeddings, however, it does not aim to jointly perform word embed- ding. Unlike Gaussian LDA, the topical word embed- ding model Liu et al. [2015] uses LDA topic assignments of words as input to improve the resultant word embed- ding. In another approach, mixed membership word em- beddings Foulds [2018] aim to recover domain-specific interpretable word embeddings without big data, based on topic embeddings. In contrast, in this paper we develop a method which recovers vector-space embeddings of words, documents, topics, authors, and so on, based on a given topic model. Our approach, which we call neural embedding alloca- tion (NEA), is to deconstruct topic models by reparam- eterizing them using vector-space embeddings. We can view our method as learning to mimic a topic model with a skip-gram style embedding model to reveal underlying semantic representations. Our approach is thus reminis- cent of model distillation for supervised models Bucilu et al. [2006]; Hinton et al. [2015]. We train NEA by minimizing the KL-divergence to the data distribution of the corresponding topic model, using a stream of simulated data from the model. The resulting embeddings allow us to (1) improve the co- herence of topic models by "smoothing out" noisy top- ics, (2) improve classification performance by producing topic-informed document vectors, and (3) construct em- beddings and smoothed distributions over general topic modeling variables such as authors. We show the bene- fits and generality of our method by applying it to LDA, author-topic models (ATM) Rosen-Zvi et al. [2004], and the recently proposed mixed membership skip gram topic model (MMSGTM) Foulds [2018]. 2 2 Connections Between Word Em- beddings and Topic Models In this section, we first develop a bridge to connect word embeddings methods such as the skip-gram with topic models. The skip-gram [Mikolov et al., 2013b] and LDA Blei et al. [2003] models are summarized in Ta- ble 1 (top-left, bottom-right), where we have interpreted the skip-gram, which is discriminative, as a "condition- ally generative" model. According to the distributional hypothesis, the skip-gram's conditional distributions over context words should be informative of the semantics of the words Sahlgren [2008]. Similarly, Griffiths et al. [2007] proposed to model semantic relationships between words under the LDA topic model, based on the predic- tive probability of one word given another, which they successfully used to solve a word association task. This suggests that topic models implicitly encode semantic re- lationships between words, even though they are not pa- rameterized as such, motivating methods to recover this information, as we shall propose here. The relationship between the skip-gram and topic mod- els goes beyond their common ability to recover semantic representations of words. In particular, the skip-gram and LDA both model conditional discrete distributions over words; conditioned on an input word in the former, and conditioned on a topic in the latter. To relate the two models, we hence reinterpret the skip-gram's conditional distributions over words as "topics" φ(wi), and the input words wi as observed cluster assignments, analogous to topic assignments z. Table 1 (top) shows how the skip- gram can thus be re-interpreted as a certain parameter- ization of a fully supervised naive Bayes topic model, which Foulds [2018] refer to as the (naive Bayes) skip- gram topic model (SGTM). A naive Bayes assumption is used in these models, as the context words are condition- ally independent given their input words and the model parameters. To understand how learning algorithms for the skip- gram are related to the SGTM, we introduce a variational interpretation of skip-gram training. It is well known that maximizing the log likelihood for a model is equivalent to minimizing the KL-divergence to the model's empir- ical data distribution, cf. Hinton [2002]. When trained via maximum likelihood estimation (MLE), the skip-gram WordsInput Word WordsTopics Embedding Models Skip-gram • For each word in the corpus wi -- Draw input word wi ∼ pdata(wi) -- For each word wc ∈ context(i) (cid:124) ∗ Draw wcwi ∝ exp(v(cid:48) vwi) wc Topic Models Naive Bayes skip-gram topic model (SGTM) • For each word in the corpus wi -- Draw input word wi ∼ pdata(wi) -- For each word wc ∈ context(i) ∗ Draw wcwi ∼ Discrete(φ(wi)) Neural embedding allocation • For each document d Latent Dirichlet allocation • For each document d -- For each word in the document wdi ∗ Draw zdid ∼ Discrete(θ(d)) (cid:124) ∗ Draw wdizdi ∝ exp(v(cid:48) wdi ¯vzdi ) -- For each word in the document wdi ∗ Draw zdid ∼ Discrete(θ(d)) ∗ Draw wdizdi ∼ Discrete(φ(zdi)) Table 1: "Generative" models of the skip-gram (top-left) and its analogous supervised naive Bayes topic model (top- right), and the 'neural embedding allocation reparameterization of the LDA topic model (bottom). (SG) and its corresponding topic model both aim to ap- proximate this same empirical data distribution. The skip- gram topic model (SGTM) can encode any set of condi- tional discrete distributions, and so its MLE recovers this distribution exactly. Thus, we can see that the skip-gram, trained via MLE, also aims to approximate the MLE skip- gram topic model in a variational sense. pdata(wcwi)pdata(wi) = pSGT M (wc, wi; Φ), where Φ is the MLE of the skip-gram topic model. Therefore, the skip-gram is attempting to mimic the "optimal" skip-gram topic model, by solving a variational infer- ence problem which aims to make its distribution over input/output word pairs as similar as possible to that of the SGTM's MLE. With sufficiently high-dimensional vectors, e.g. V ≥ W , it will be able to solve this problem exactly, assuming that a global optimum can be found. While the above holds for maximum likelihood training, noise contrastive estimation (NCE) Gutmann and Hyvarinen [2010, 2012] approximates maximum likelihood estimation, and negative sampling Mikolov et al. [2013b] approximates NCE. We can therefore view both of these training procedures as approximately solving the same variational problem, with some bias in their solutions due to the approximations that they make to maximum likelihood estimation. We can also see from Equation 1 that the SGTM and SG's MLEs can be completely computed using the in- put/output word co-occurrence count matrix as sufficient statistics. The skip-gram then has a global objective function that can be defined in terms of the word co- occurrence matrix, and the development of the GloVe model Pennington et al. [2014] as an alternative with a global objective function seems unnecessary in hindsight. Levy and Goldberg [2014]'s results further illustrate this point, as they find global matrix factorization objectives that are implicitly optimized by negative sampling and NCE as well. 3 wc,wi = − (cid:88) = − (cid:88) −(cid:80) a wc,wi the More consider formally, joint distributions p(wc, wi) obtained by augmenting the skip-gram SG and its topic model SGTM with the empiri- cal input word distribution p(wi) = pdata(wi): pSG(wc, wi; v, v(cid:48)) = p(wcwi; v, v(cid:48))pdata(wi) and pSGT M (wc, wi; Φ) = p(wcwi; Φ)pdata(wi). It can readily be seen that DKL(pdata(wcwi)pdata(wi)pSG(wc, wi; v, v(cid:48))) log p(wcwi; v, v(cid:48)) + const Nwc,wi Nwi N log p(wcwi; v, v(cid:48)) + const . Nwi Nwc,wi N Nwc ,wi similar By we DKL(pdata(wcwi)pSGT M (wc, wi; Φ)) argument, also log p(wcwi; Φ) + const. obtain = Since the topic model's discrete distributions are unconstrained, this is minimized to zero at Nwc,wi wc,wi N = pdata(wcwi) . (1) φ(wi) wc = Nwi So maximizing the the skip-gram minimizes conditional log-likelihood for to the KL-divergence 3 Neural Embedding Allocation We have seen that the skip-gram minimizes the KL- divergence to the distribution over data at the maximum likelihood estimate of its corresponding topic model. We can view this as learning to mimic a topic model with an embedding model. The skip-gram has essentially decon- structed its topic model into nuanced vector representa- tions which aim to encode the same information as the topic model. We therefore propose to apply this same ap- proach, deconstructing topic models into neural embed- ding models, to other topic models. The resulting method, which we refer to as neural em- bedding allocation (NEA), corresponds to reparameteriz- ing the discrete distributions in topic models with embed- dings. The neural embedding model generally loses some model capacity relative to the topic model, but it provides vector representations which encode valuable similarity information between words. Following the skip-gram, by sharing the vectors between distributions, the vectors are encouraged to encode similarity relationships, as medi- ated by the discrete distributions and their relationships to each other. NEA's reconstruction of the discrete distri- butions also smooths out noisy estimates, leveraging the vectors' similarity patterns. For example, we show the "generative" model for NEA in Table 1 (bottom-left), which reparameterizes the LDA model by topic vectors ¯vk and "output" word vectors v(cid:48) w which mimic LDA's topic distributions over words, φ(k), by re-encoding them using log-bilinear models. In the generative model, θ(d) draws a topic for a document and the topic vectors ¯vk are used as the input vectors to draw a word v(cid:48) w. We can also consider a model variant where θ(d) is reparameterized using a log-bilinear model, how- ever we obtained better performance by constructing doc- ument vectors based on topic vectors, as discussed below. 3.1 Training NEA for LDA To train the NEA reconstruction of LDA, we start with pre-trained LDA parameters: document-topic distribu- tions ΘLDA, topic-word distributions ΦLDA, and topic assignments Z. Given the input LDA (or other) topic model, our ideal objective function to train NEA is DKL(pLDApN EA). It can be seen that minimiz- ing DKL(pLDApN EA) is equivalent to maximizing Algorithm 1 Training NEA for LDA Input: W = #Words, K = # Topics, D = # Documents, M= Mini-batch size, trained LDA model ΘLDA, ΦLDA, Z Output: ΦN EA = encoded ΦLDA, V (W )(cid:48) = word-embeddings, ¯V (K) = topic-embeddings, V (D) = document-embeddings Embeddings steps: • For each iteration t: //in practice, use mini-batches -- Draw a document, d ∼ unif (D) -- Draw a topic, z ∼ Θ(d) -- Draw a word, w ∼ Φ(zd) -- Update [¯vz, v(cid:48) LDA LDA w]:= NEG(in = z, out = w) • For each document d in D: -- For each token i in d: ∗ Update vd := vd + -- Normalize vd := vdvd ¯vzdi ¯vzdi Smoothing steps: Calculate ΦN EA ∝ exp(V(W )(cid:48)(cid:124) ¯V (K)) EpLDA(w,z)[p(w, z; V)]. This suggests a procedure where minibatches are drawn from the topic model, and are used to update the parameters V = {V(W )(cid:48), ¯V(K)} via stochastic gradient descent. We construct minibatches of input topics z and target words w by repeatedly draw- ing a document index d uniformly at random, draw- ing a topic z from that document's Θ(d) LDA and sam- pling a word w from drawn topic Φ(zd) LDA. Then, we would take a gradient step on log p(w, zV, b, ΘLDA) = log p(wz, V, b) + const to update V. However, as for other embedding models, normalization over the dictio- nary becomes a bottleneck in the stochastic gradient up- dates. Since noise-contrastive estimation (NCE) Mnih and Kavukcuoglu [2013]; Gutmann and Hyvarinen [2010, 2012] has been shown to be an asymptotically consistent estimator of the MLE in the number of noise samples Gut- mann and Hyvarinen [2012], it is a principled approxima- tion of our EpLDA(data)[p(data; V)] objective. In prac- tice, however, we obtained better performance using neg- ative sampling (NEG) Mikolov et al. [2013b], which fur- ther approximates the NCE objective as log σ(v(cid:48) w (cid:124) ¯vz) + Ewi∼pn(w)log σ(−v(cid:48) wi (cid:124) ¯vz)) , k(cid:88) i=1 4 LDA NEA LDA corresponds change cut exact coincides duplicates volatility trapping reading ters parameters important neural change results report cut multiple experiments minimizing symbolics addressing choice perturbing radii centered damping merits vax unexplored NEA values case increase systems rate point feedback input reduces stage LDA ryan learning bit inhibited nice automatica tucson infinitely stacked exceeded NEA learning methods text space combined averaging area apply bit recognition LDA paths close path make numbering channels rep scalars anism viously NEA total paths global path time fixed function yields close computation Figure 1: The worst four topics produced by LDA, in terms of per-topic coherence score, and their corresponding NEA topics, with LDA trained on the NIPS corpus for K=7, 000. NEA International LDA tonnes LDA share pittsburgh aa aaa ab abandon abandoned abc abdul common share pittsburgh general agreement tender market june yr aa aaa ab abandon abandoned abc abdul NEA announced tonnes addition asked accounts shares surplus secretary heavy held LDA blah aa aaa ab abandon abandoned abc abdul abide aberrational NEA blah company account advantage acquisitions loss proposed considered announced base LDA dlrs aa aaa ab abandon abandoned abc abdul abide aberrational NEA debt canadian today canada decline competitive conditions dlrs price week aberrational dividend aberrational Figure 2: The four topics that were most improved by NEA over the original LDA topic, in terms of the difference between per-topic coherence score, with LDA trained on the Reuters-150 corpus for K=7, 000. where pn(w) is a "noise" distribution, and k is the number of "negative" samples drawn from it per word. Having learned the embeddings, we recover NEA's "smoothed" encodings of the topics: ΦN EA ∝ exp(V(W )(cid:48)(cid:124) ¯V (K)) . (2) Finally, we construct document vectors by summing the corresponding (normalized) topic vectors according to the pre-trained LDA model's topic assignments Z, for each token of that document. We normalize all document vec- tors to unit length to avoid any impact of the length of the document on the scale of the features, to produce the final document embeddings V(D). The pseudocode for training NEA to mimic LDA is shown in Algorithm 1. 3.2 General NEA Algorithm More generally, the NEA method can be extended to en- code any topic model's parameters, which are typically conditional distributions given a single parent assignment, P (aiparent(ai)), into vector representations V(i), V(i)(cid:48) while also providing smoothed versions of the parameters PN EA(aiparent(ai)). The general learning algorithm of our proposed NEA model for general topic models is shown in Algorithm 2. In the embedding steps, for each iteration, we draw samples ai from the conditional dis- crete distributions for documents, authors, topics, words, etc., followed by updating the input and output vectors by optimizing log-bilinear classification problems using neg- ative sampling (discussed in Section 3.1). In the smooth- ing steps, we can recover the smoothed version of the parameters PN EA(aiparents(ai)) by the dot product of the corresponding input and output vectors learned in em- 5 topic Trained P (a0)(cid:81)n Algorithm 2 NEA for General Topic Models Input: form i=1 P (aiparent(ai)), where the ai are discrete variables such as documents, authors, topics, words. Output: Embeddings for each variable V(i), V(i)(cid:48), smoothed distributions PN EA(aiparent(ai)) Embeddings steps: model of the • For each iteration t: //in practice, use mini-batches -- sample a0 ∼ P (a0) -- For each random variable ai ∈ {a1 . . . an}: ∗ sample ai ∼ P (aiparent(ai)) ∗ update [v(i) , v(i)(cid:48) ai ] parent(ai) := NEG(in=parent(ai), out=ai) Smoothing steps: • For each random variable ai ∈ {a1 . . . an}: -- PN EA(aiparent(ai)) ∝ exp(v(i)(cid:48)(cid:124) ai v(i) parent(ai) ) beddings steps followed by a softmax projection onto the simplex. 4 Experiments The goals of our experiments were to evaluate the NEA model both as a topic model and as a feature engineering method for classification tasks. We will release the source code of our implementation once the paper is accepted. For several experiments, we considered five datasets. First, we use the NIPS corpus with 1, 740 scientific ar- ticles from years 1987-1999 with 2.3M tokens, which contains a dictionary size of 13, 649 words. The sec- ond dataset contains 4, 676 articles published by the New York Times with a dictionary size of 12, 042 words. We also used another dataset, Bibtex,1 which contains 7, 395 references as documents with a dictionary size of 1, 643 words. Finally, the Reuters−150 news wire articles cor- pus (15, 500 articles with dictionary size of 8, 349 words) and Ohsumed medical abstracts (20, 000 articles where classes are 23 cardiovascular diseases) were used. 1http://mulan.sourceforge.net/datasets-mlc. html. 6 4.1 Performance for LDA We start our analysis by evaluating how NEA performs at mimicking LDA in terms of topic and embeddings quality. 4.1.1 Quality of Topics To perform this experiment, we compare the quality of generated topics from LDA and NEA by investigating both qualitative and quantitative results on several data sets. We fix LDA's hyperparameters at α=0.1 and β=0.01 when K<500, otherwise we use α=0.01 and β=0.001. LDA was trained using the Metropolis-Hastings-Walker algorithm Li et al. [2014], due to its scalability in the number of topics K. In NEA, negative sampling (NEG) was performed for 1 million minibatches of size 16 with 300-dimensional embeddings. In the experiments, we found that NEA generally recovers the same top words for LDA's "good topics" (example topics are shown in the Appendix). To get a quantitative comparison, we compared the top- ics' UMass coherence metric, which measures the seman- tic quality of a topic based on its T most probable words (we choose T = 10 words), thereby quantifying the user's viewing experience Mimno et al. [2011]. Larger coher- ence values indicate greater co-occurrence of the words, hence higher quality topics. In Figure 3, the average topic coherence of LDA and NEA is shown with respect to the number of topics K. LDA works well with small K val- ues, but when K becomes large, NEA outperforms LDA in average topic coherence scores on all datasets (see the Appendix for similar results on two other datasets). In Figure 1, we show the four worst topics from LDA, based on per-topic coherence score, and their correspond- ing NEA topics, when the model was trained on NIPS for K = 7, 000. In this case, NEA generated slightly more meaningful topics than LDA. We also identified the most improved topics based on the difference between per-topic coherence scores. In Figure 2, we show the 4 topics with the largest improvement in coherence scores by NEA, for Reuters−150 with 7, 000 topics. We observe that these LDA topics were uninterpretable, and likely had very few words assigned to them. NEA tends to improve the quality of these "bad" topics, e.g. by replacing stop words (or words at the top of the dictionary) with more se- Figure 3: Comparison of average topic coherence vs. number of topics K on four different corpora: (a) NIPS, and (b) New York Times. NEA generated topics outperform LDA topics in terms of higher average topic coherence when K is large. mantically related ones. In particular, we found that NEA gave the most improvement for topics with few words as- signed to them (see Figure 4 (left)) and when K becomes large, the majority of topics have few assigned words (see Figure 4 (right)). As a result, NEA improves the quality of most of the topics. In Figure 5, we showcase the im- provement for "bad topics," those which have less than 200 words assigned to them, by our proposed NEA model on the NIPS corpus. 4.1.2 Document Categorization In this set of experiments, we tested the performance of the learned vectors using NEA's document em- beddings V(D) as features for document categoriza- tion/classification. The results are given in Table 2. We used two standard benchmark datasets: Reuters−150, and Ohsumed.2 We used the standard train/test splits from the literature (e.g. for Ohsumed, 50% of documents were as- signed to training and to test sets). We also considered tf-idf as a baseline. Logistic regression classifiers were trained on the features extracted on the training set for each method while classification accuracy was computed 2All document categorization datasets were obtained from http: //disi.unitn.it/moschitti/corpora.htm . on the held-out test data. Finally, we compared NEA with LDA as well as several state-of-the-art models such as the skip-gram (SG) Mikolov et al. [2013a,b], and paragraph vector (doc2Vec) Le and Mikolov [2014]. From the results in Table 2, we found that NEA has better accuracy in classification performance than LDA and doc2Vec. In NEA, the document vectors are encoded at the topic level rather than the word level, so it loses word level information in the embeddings, which turned out to be beneficial for these specific classification tasks, at which SG features outperformed NEA's features. In- terestingly, however, when both SG and NEA features were concatenated (SG + NEA), this improved the classi- fication performance over each model's individual perfor- mance. This suggests that the combination of topic-level NEA and word-level SG vectors complement the qualities of each other and both are valuable for performance. Note that the tf-idf baseline, which is notoriously effective for document categorization, outperformed the other features. In Table 3, we show the results when concatenating tf-idf with the other feature vectors from LDA, SG, and NEA, which in many cases improved performance over tf-idf alone. We observed the highest improvement over tf-idf for both document categorization tasks when we concate- nated NEA vectors with tf-idf (tf-idf + NEA). This ap- 7 (a) NIPS(b) New York Times Figure 4: Improvement in coherence of NEA over LDA vs. number of words in the topic, K = 7, 000, NIPS dataset. Boxplot (left) shows coherence improvement for number of words per topic while histogram (right) shows number of topics in each bin. Datasets Reuters-150 Ohsumed #Classes #Topics Doc2Vec 116 23 500 500 55.89 34.02 LDA NEA 67.15 64.26 32.05 34.38 SG 70.80 37.26 SG+NEA Tf-idf 73.00 43.07 72.29 38.88 Table 2: Comparing NEA in document categorization tasks with other baseline methods. Classification accuracy is shown for two different corpora: Reuters−150, and Ohsumed. proach outperformed all other feature combinations. This may be because the topical information in NEA features is complementary to tf-idf, while SG's word-based features are redundant. them as a ranking problem. Following Rosen-Zvi et al. [2004], we rank based on the symmetric KL-divergence between authors i and j: K(cid:88) [θit log t=1 θit θjt + θjt log θjt θit ], (3) where θi is the ith author's distribution over topics. Using this distance metric, we searched for similar authors in the NIPS corpus for the 125 out of 2037 authors who wrote at least 5 papers. We reported the mean reciprocal rank (MRR) based on the rank of the most similar co-author. Table 4 shows the improvement in MRR using author vec- tors generated from NEA over the author-topic parameters of the ATM. Further improvement was achieved by the NEA-smoothed version of the ATM's parameters which also outperformed author vectors generated from a tf-idf baseline at this task. 8 4.2 Performance for ATM sKL(i, j) = In the second phase of our experiments, we trained NEA for the author-topic model (ATM)'s generated parameters, with the same hyperparameters we used in the previous section. Similar to the experiment for LDA, NEA im- proves topic coherence of the ATM generated topics when K is large. Figure 6 shows NEA outperforms ATM in terms of per-topic coherence for NIPS when K = 1000. We also studied the performance of NEA for smoothing the author-topic distributions. The ATM could be used for a variety of applications such as automated reviewer recommendations Rosen-Zvi et al. [2004], which could benefit from NEA smoothing. Since these applications are based on searching for similar authors, we can treat Datasets Reuters-150 Ohsumed #Classes #Topics Tf-idf Tf-idf+LDA Tf-idf+SG Tf-idf+NEA Tf-idf+SG+NEA 116 23 500 500 73.00 43.07 73.01 43.05 72.99 43.04 73.14 43.11 73.09 43.08 Table 3: Comparing NEA in document categorization tasks along with tf-idf. Classification accuracy is shown for two different corpus: Reuters−150, and Ohsumed. Tf-idf+NEA had the best classification accuracy. Figure 5: Improvement of bad topics (less than 200 assigned words) by NEA vs. number of words in the topic, K = 7, 000, for NIPS. ATM NEA embeddings Tf-idf NEA smoothing 0.016 0.021 0.018 0.019 NIPS Table 4: Mean reciprocal rank for co-author retrieval. 4.3 Performance for MMSGTM Finally, we train NEA to reparameterize the mixed mem- bership skip-gram topic model (MMSGTM) [Foulds, 2018]. We used the same hyperparameter values as in pre- vious experiments, while setting MMSGTM-specific hy- perparameters to the values suggested in Foulds [2018]. The original MMSG algorithm learns topic embeddings based on the MMSGTM's cluster assignments Z, while NEA uses simulated data from the topic model. The NEA method is arguably a more principled method to accomplish the embedding as it has an explicit objective 9 Figure 6: NEA-smoothed ATM outperforms ATM in terms of per topic coherence for K = 1, 000 topics on NIPS corpus. function. We found that NEA smooths and slightly im- proves the speed of the training process (shown in Fig- ure 7), while greatly reducing memory requirements as the topic assignments Z need not be stored. NEA train- ing for MMSG improves over MMSGTM at classification and performs similarly to Foulds [2018]'s algorithm (see results in the Appendix). 5 Conclusion We have proposed neural embedding allocation (NEA) for learning interpretable vector-space embeddings of words, documents, topics, and authors by deconstructing topic models to reveal underlying semantic representations. Our experimental results show that our proposed NEA method successfully mimics topic models with nuanced vector representations, while performing better than them at many tasks. The proposed NEA algorithm can smooth out topic models' parameters to improve topic coher- J. R. Foulds. Mixed membership word embeddings for computational social science. Proceedings of the 21st International Conference on Artificial Intelligence and Statistics (AISTATS), 2018. Thomas L Griffiths, Mark Steyvers, and Joshua B Tenen- baum. Topics in semantic representation. Psychologi- cal Review, 114(2):211, 2007. Michael Gutmann and Aapo Hyvarinen. Noise- contrastive estimation: A new estimation principle for unnormalized statistical models. In Proceedings of the Thirteenth International Conference on Artificial Intel- ligence and Statistics, pages 297 -- 304, 2010. Michael U Gutmann and Aapo Hyvarinen. Noise- contrastive estimation of unnormalized statistical mod- els, with applications to natural image statistics. Jour- nal of Machine Learning Research, 13(Feb):307 -- 361, 2012. Geoffrey E Hinton et al. Learning distributed representa- tions of concepts. In Proceedings of the Eighth Annual Conference of the Cognitive Science Society, volume 1, page 12. Amherst, MA, 1986. Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distill- ing the knowledge in a neural network. ArXiv preprint arXiv:1503.02531, 2015. Geoffrey E Hinton. Training products of experts by min- imizing contrastive divergence. Neural Computation, 14(8):1771 -- 1800, 2002. Quoc Le and Tomas Mikolov. Distributed representations of sentences and documents. In International Confer- ence on Machine Learning, pages 1188 -- 1196, 2014. Omer Levy and Yoav Goldberg. Neural word embedding as implicit matrix factorization. In Advances in Neu- ral Information Processing Systems, pages 2177 -- 2185, 2014. Aaron Q Li, Amr Ahmed, Sujith Ravi, and Alexander J Smola. Reducing the sampling complexity of topic models. In Proceedings of the 20th ACM SIGKDD In- ternational Conference on Knowledge Discovery and Data Mining, pages 891 -- 900. ACM, 2014. Figure 7: Loss curve of NEA and MMSG training for MMS- GTM when K = 1, 000 topics on (a) NIPS and (b) Reuters-150 corpus. ence and author modeling, and produces vector represen- tations which improve document categorization perfor- mance. We plan to use NEA to study and address gender bias issues in natural language processing. References Yoshua Bengio, R´ejean Ducharme, Pascal Vincent, and Christian Jauvin. A neural probabilistic language Journal of Machine Learning Research, model. 3(Feb):1137 -- 1155, 2003. David M Blei, Andrew Y Ng, and Michael I Jordan. La- tent Dirichlet allocation. Journal of Machine Learning Research, 3(Jan):993 -- 1022, 2003. Cristian Bucilu, Rich Caruana, and Alexandru Niculescu- Mizil. Model compression. In Proceedings of the 12th ACM SIGKDD International Conference on Knowl- edge Discovery and Data Mining, pages 535 -- 541. ACM, 2006. Ronan Collobert, Jason Weston, L´eon Bottou, Michael Karlen, Koray Kavukcuoglu, and Pavel Kuksa. Natu- ral language processing (almost) from scratch. Journal of Machine Learning Research, 12(Aug):2493 -- 2537, 2011. Rajarshi Das, Manzil Zaheer, and Chris Dyer. Gaussian LDA for topic models with word embeddings. In Pro- ceedings of the 53rd Annual Meeting of the Associa- tion for Computational Linguistics and the 7th Interna- tional Joint Conference on Natural Language Process- ing (Volume 1: Long Papers), volume 1, pages 795 -- 804, 2015. 10 (a)(b) Ashish Vaswani, Yinggong Zhao, Victoria Fossum, and David Chiang. Decoding with large-scale neural lan- guage models improves translation. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 1387 -- 1392, 2013. Yang Liu, Zhiyuan Liu, Tat-Seng Chua, and Maosong Sun. Topical word embeddings. In AAAI, pages 2418 -- 2424, 2015. Andrew L Maas, Raymond E Daly, Peter T Pham, Dan Huang, Andrew Y Ng, and Christopher Potts. Learning word vectors for sentiment analysis. In Proceedings of the 49th Annual Meeting of the Association for Compu- tational Linguistics: Human Language Technologies- volume 1, pages 142 -- 150. Association for Computa- tional Linguistics, 2011. Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. ArXiv preprint arXiv:1301.3781, 2013. Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Cor- rado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Advances in Neural Information Processing Systems, pages 3111 -- 3119, 2013. David Mimno, Hanna M Wallach, Edmund Talley, Miriam Leenders, and Andrew McCallum. Optimiz- ing semantic coherence in topic models. In Proceed- ings of the Conference on Empirical Methods in Natu- ral Language Processing, pages 262 -- 272. Association for Computational Linguistics, 2011. Andriy Mnih and Koray Kavukcuoglu. Learning word embeddings efficiently with noise-contrastive estima- In Advances in Neural Information Processing tion. Systems, pages 2265 -- 2273, 2013. Jeffrey Pennington, Richard Socher, and Christopher Manning. GloVe: Global vectors for word represen- In Proceedings of the 2014 Conference on tation. Empirical Methods in Natural Language Processing (EMNLP), pages 1532 -- 1543, 2014. Michal Rosen-Zvi, Thomas Griffiths, Mark Steyvers, and Padhraic Smyth. The author-topic model for authors and documents. In Proceedings of the 20th conference on Uncertainty in artificial intelligence, pages 487 -- 494. AUAI Press, 2004. Magnus Sahlgren. The distributional hypothesis. Italian Journal of Disability Studies, 20:33 -- 53, 2008. 11 A Background and Related Work For completeness, and to establish notation, we provide background on topic models and word embeddings. A.1 Latent Dirichlet Allocation Probabilistic topic models, for example, LDA Blei et al. [2003] use latent variables to encode co-occurrences be- tween words in text corpora and other bag-of-words repre- sented data. A simple way to model text corpora is using multinomial naive Bayes with a latent cluster assignment for each document, which is a multinomial distribution over words, called a topic k ∈ {1, ...K}. LDA topic mod- els improve over naive Bayes using mixed membership, by relaxing the condition that all words in a document d belong to the same topic. In LDA's generative process, for each word wdi of a document d, a topic assignment zdi is sampled from document-topic distribution θ(d) followed by drawing the word from topic-word distribution φ(zdi) (see Table 1 in the main paper, bottom-right). Dirichlet priors encoded by αk and βw are used for these parame- ters, respectively. A.2 Author Topic Model Author-topic model (ATM) is a probabilistic model for both author and topics by extending LDA to include au- thorship information Rosen-Zvi et al. [2004]. In the gen- erative process of ATM, for each word wdi of a document d, an author assignment adi is uniformly chosen from number of authors Ad and then a topic assignment zdi is sampled from author-topic distribution θ(adi) followed by drawing the word from topic-word distribution φ(zdi) as follows: • For each document d -- For each word in the document wdi ∗ Draw adi ∼ Uniform( 1Ad ) ∗ Draw zdi ∼ Discrete(θ(adi)) ∗ Draw wdi ∼ Discrete(φ(zdi)) Like LDA, similar Dirichlet priors αa and βw are used for θ(a) and φ(z) parameters, respectively. A.3 MMSG Topic Model To show the generality of our approach to topic models we also consider our method to a recent model called the mixed membership skip-gram topic model (MMSGTM) Foulds [2018], which combines ideas from topic models and word embeddings to recover domain specific embed- dings for small data. The generative model for MMSGTM is: • For each word wi in the corpus -- Sample a topic zi ∼ Discrete(θwi) -- For each word wc ∈ context(i) ∗ Sample a context word wc ∼ Discrete(φzi) . Finally, the mixed membership skip-gram model (MMSG) is trained for word and topic embeddings with the topic assignments z as input and surrounding wc as output. Since MMSG training depends on the topic assignments as well as the whole corpus, it is not scalable for big data. A.4 Word Embeddings Traditional probabilistic language models predict words given their context words using a joint probability for se- quences of words in a language Bengio et al. [2003] based on distributed representations Hinton and others [1986] from neural network weights. Later, word embeddings were found to be useful for semantic representations of words, even without learning a full joint probabilistic lan- guage model. In particular, the skip-gram model is an effective method for learning better quality vector repre- sentations of words from big unstructured text data. The skip-gram Mikolov et al. [2013b] is a log-bilinear classifier for predicting words that occur in the context of other words in a document, where the context is typically defined to be a small window around the word. For a se- quence of input training words, the objective of the skip- gram model is to maximizing the average log probability of the output context words given the input word. We can think of it as a certain parameterization of a set of discrete distributions, p(wcwi), where wc is a context word and wi is an "input" word, and both wc and wi range over the W words in the dictionary (see Table 1 in the main paper, 12 LDA NEA bayesian prior bayes posterior framework priors bayesian bayes posterior priors likelihood prior likelihood framework bars note compute probability note bars recognition LDA images image vision pixel pixels visual techniques computed applied NEA images image visual pixels pixel recognition illumination intensity pairs matching LDA phrase sentences clause structure sentence phrases syntactic connectionist tolerance previous NEA LDA NEA sentences phrase structure sentence clause activation phrases roles agent connectionist regression linear ridge quadratic squared nonparametric dimensionality variables smoothing friedman regression linear ridge quadratic variables nonparametric squared multivariate kernel basis Figure 8: Randomly selected topic pairs from LDA and NEA, with LDA trained on the NIPS corpus for K=2, 000. LDA NEA learning steps computer testing observation predetermined cheng utilizes efficient updating learning steps computer testing people bin observation efficient utilizes birth condensation LDA blake isard models entire oxford rabiner gelb north observations condensation NEA models exp blake similar modified generally cortical isard consisting LDA insertion hole gullapalli reinforcement smoothed reactive extreme ram gordon consecutive NEA space reinforcement learning fig insertion hole fit gullapalli maximum regions LDA strain mars yield rolling mill cart tuning material friedman plot NEA structure length variance equal mars strain weight intelligence cycle friedman Figure 9: The worst four topics produced by NEA, in terms of per-topic coherence score, and their corresponding LDA topics, with LDA trained on the NIPS corpus for K=7, 000.. top-left). In the simplest case, these discrete distributions have the form: p(wcwi) ∝ exp(v(cid:48) (4) where, v(cid:48) wc and vwi are vector embeddings of context words and input words, respectively, with dimensionality V . vwi) . wc (cid:124) B Additional Experiments In this section, we demonstrate our results on other datasets by repeating the similar experiments on them. First, we found that most of the topics produced by both models are interpretable, and NEA was able to approx- imately recover the original LDA's topics. In Figure 8, we show a few randomly selected example topics, where LDA was trained on the NIPS corpus for K = 2, 000. In the main paper, we show four worst topics from LDA with their corresponding NEA topics. Here in Fig- ure 9, we show the four worst topics generated from NEA, based on per-topic coherence score, and their correspond- ing LDA generated topics for the same model. In this case, LDA generates slightly more meaningful topics than NEA. We showed previously that NEA improves LDA top- ics in terms of average coherence for NIPS, and NYTime when K is large. We repeated the same experiment for Bibtex, and Reuters-150 which also gave the same trend in average coherence result (see Figure 10). We showcase again the improvement of "bad topics" those which have less than 200 words assigned to them, by the NEA model for NYTime corpus in Figure 11. To evaluate the performance of NEA for MMSGTM, we perform document categorization tasks for NEA and 13 Figure 10: Comparison of average topic coherence vs. number of topics K on four different corpora: (a) Bibtex, and (b) Reuters- 150. NEA generated topics outperform LDA topics in terms of higher average topic coherence when K is large Reuters-150 Ohsumed MMSGTM NEA MMSG 68.26 34.78 68.14 34.42 66.97 32.41 Table 5: Comparing NEA in document categorization tasks with MMSG, when both models trained for MMS- GTM. Classification accuracy is shown for two different corpus: Reuters−150, and Ohsumed. MMSG as shown in Table 5 when both models trained for MMSGTM. Both NEA and MMSG improves accu- racy of this downstream task comparing to MMSGTM for Reuters−150, and Ohsumed dataset while MMSG main- tains slightly higher accuracy than NEA. Figure 11: Improvement of bad topics (less than 200 assigned words) by NEA vs. number of words in the topic, K = 7, 000, for NYTime corpus. 14 (b) Reuters-150(a) Bibtex
1809.05233
2
1809
2018-09-21T02:29:30
Unsupervised Abstractive Sentence Summarization using Length Controlled Variational Autoencoder
[ "cs.CL" ]
In this work we present an unsupervised approach to summarize sentences in abstractive way using Variational Autoencoder (VAE). VAE are known to learn a semantically rich latent variable, representing high dimensional input. VAEs are trained by learning to reconstruct the input from the probabilistic latent variable. Explicitly providing the information about output length during training influences the VAE to not encode this information and thus can be manipulated during inference. Instructing the decoder to produce a shorter output sequence leads to expressing the input sentence with fewer words. We show on different summarization data sets, that these shorter sentences can not beat a simple baseline but yield higher ROUGE scores than trying to reconstruct the whole sentence.
cs.CL
cs
Unsupervised Abstractive Sentence Summarization using Length Controlled Variational Autoencoder Raphael Schumann Institute for Computational Linguistics Heidelberg University 8 1 0 2 p e S 1 2 ] L C . s c [ 2 v 3 3 2 5 0 . 9 0 8 1 : v i X r a [email protected] Abstract In this work we present an unsupervised approach to summarize sentences in ab- stractive way using Variational Autoen- coder. VAE are known to learn a seman- tically rich latent variable, representing high dimensional input. VAEs are trained by learning to reconstruct the input from the probabilistic latent variable. Explic- itly providing the information about output length during training influences the VAE to not encode this information and thus can be manipulated during inference. Instruct- ing the decoder to produce a shorter output sequence leads to expressing the input sen- tence with fewer words. We show on dif- ferent summarization data sets, that these shorter sentences can not beat a simple baseline but yield higher ROUGE scores than trying to reconstruct the whole sen- tence. Introduction 1 The increasing amount of text data in the digi- tal age calls for methods to reduce reading time while maintaining information content. The pro- cess of summarization achieves this by deleting, generalizing or paraphrasing fragments of the in- put text. Summarization methods can be catego- rized into single or multi document and extrac- tive or abstractive approaches. In contrast to sin- gle document (Rush et al., 2015), the multi docu- ment setup can leverage the fact that in some do- mains like news articles there are different sources describing the same event (Banerjee et al., 2016; Haghighi and Vanderwende, 2009). Extractive methods solely rely on the words of the input and e.g. extract whole sentences (Erkan and Radev, 2004; Parveen and Strube, 2015) or recombine phrases on the sentences level (Banerjee et al., 2016). Abstractive approaches on the other hand are rarely bound to any constraints and gained a lot of traction due to recent advances in ma- chine translation like the encoder-decoder frame- work (Sutskever et al., 2014; Paulus et al., 2017) or attention mechanism (Bahdanau et al., 2014; Rush et al., 2015; Paulus et al., 2017). Another more general distinction is the need of supervi- sion. Supervised methods require training pairs of input text and output summarization (Paulus et al., 2017; Rush et al., 2015), whereas unsupervised methods abuse inherent properties of the input like frequency of phrases (Banerjee et al., 2016) or centrality (Erkan and Radev, 2004). In this work we use a Variational Autoencoder (VAE) (Kingma and Welling, 2013; Bowman et al., 2016) and con- trol the decoding length (Kikuchi et al., 2016) to obtain a shortened version of an input sentence. VAEs work unsupervised and decoding makes use of the whole available vocabulary. This work is organized into following sections. At first we give background about used technologies and concepts. In 3 we describe the architecture of our model. The data we use for the experiments in section 5 is outlined in section 4. At last we report the results in section 1. 2 Background 2.1 Variational Autoencoder Variational Autoencoder (VAE) is a generative model firstly introduces by (Kingma and Welling, 2013). Like regular autoencoders VAEs learn a mapping q(zx) from high dimensional input x to a low dimensional latent variable z. Instead of doing this in a deterministic way VAE imposes a prior distribution on z, e.g. standard Gaussian: p(z) = N (z; 0, 1). (1) The desired effect is that each area in the z space gets a semantic meaning and thus samples from p(z) can be decoded in a meaningful way. The decoder pθ(xz) is trained to reconstruct the input x based on the latent variable z. In order to ap- proximate θ via gradient descent the reparame- terization trick (Kingma and Welling, 2013) was introduced. This trick allows the gradient to flow through the sampling decision of z (Formula 1) by outsourcing the discrete operation. Let µ and σ be deterministic outputs of the encoder qθ(µ, σx): z = µ + σ (cid:12)  where  ∼ N (0, 1) (2) and (cid:12) is the element-wise product. To prevent the model pushing σ close to 0 and basically fall back to a regular autoencoder the objective is extended by the Kullback-Leibler (KL) divergence between prior p(z) and q(zx): L(θ; x) = −KL(qθ(zx)p(z)) +Eqθ(zx)[logpθ(xz)]. (3) The goal is to have a non-zero, but not out of control KL term while maintaining a reasonable reconstruction loss. This guarantees a semanti- cally rich latent variable and good generation abil- ity. 2.2 Controlling Output Length There are different methods for controlling the output length in an encoder-decoder model. One of them is LenEmb (Kikuchi et al., 2016) where the decoder is fed information about the remaining length at every decoding step t. This information is encoded as an embedding matrix WL accessed by Llt = eL(lt) and learned during training. In- stead of calculating the remaining length as bytes we use a more straight forward approach by count- ing whole words. At each decoding step the length embedding is concatenated to the input and chosen as follows: l1 = length lt+1 = max{lt − 1, 0}, (4) where length is the desired length. This en- courages the decoder to fit the information left into the remaining words. The authors show in a super- vised summarization setup that setting length to the desired number of output bytes, conveniently the 75 bytes of the references, yield better perfor- mance during evaluation. Figure 1: VAE Encoder with bidirectional RNN and mean representation of the input 3 Model In order to apply the VAE principle to text data, (Bowman et al., 2016) employ RNNs as en- coder and decoder. The vectors µ and σ are con- structed from the last hidden state of the encoder and the first cell state of the decoder is initialized as z. Since then many improvements of this basic architecture have been published and are adopted in this work. First of all we use a bidirectional en- coder which reads forward and backward through the input sequence x. At each encoding step the forward and backward hidden states f hi and bhi are concatenated to hi = [f hi, bhi]. (Vani and Birodkar, 2016) then calculate µ and σ from the mean of all hidden states hi, arguing that this pro- duces a better sequence representation and the gra- dient reaches every input vector more easily. This is depicted in Figure 1. Besides the reconstruc- tion loss of the input sequence (Zhao et al., 2017) introduce a so called bag-of-words loss. A V di- mensional vector is predicted by a feed-forward layer which takes z as input, where V is the vo- cabulary size. This vector is compared against the label xbow which is the one-hot representation of the input sentence. This forces the model to put more general information into the latent variable instead of encoding the start of a sentence and de- rive the rest by memorizing word order in the de- coder. As seen in Figure 2 the multi-layer RNN gets fed the latent variable at every decoding step, again allowing to have an easier way for the gra- dient to flow back. Additionally the last emitted word x(cid:48) t−1 and the length embedding, see 2.2, are concatenated to the input. To speed up the training sampled softmax (Jean et al., 2015) estimates the softmax function at each decoding output. Figure 2: VAE Decoder with bag-of-word loss and LenEmb 4 Data The data setup is similar to (Rush et al., 2015). For training they use 4 million pairs of title and first sentence of the article from Gigaword (Graff et al., 2003) data set. As we do not need super- vision we remove the titles and due to resource limitations remove all sentences with more than 30 words. The remaining 1.8 million training sen- tences are preprocessed by lower-casing and tok- enizing all words. Additionally numbers are re- placed by # and words not in the top 40000 are replaced by UNK token. For evaluation we also use the around 2000 held-out article-title pairs from Gigaword and the DUC-2004 set (Over et al., 2007). This consist of 500 news articles from New York Times and Associated Press Wire ser- vice and comes with 4 different reference sum- maries (capped at 75 bytes) written by humans. 5 Experiment We train the proposed model on the above pre- sented data by maximizing the objective in For- mula 3. To obtain a shortened version of the in- put sentence during testing we set l1 to the desired length. Our assumption is that the decoder tries to fit all the information present in the latent vari- able into the limited output words. Doing so by skipping meaningless words or rephrasing seman- tic bits to fewer tokens. All under observation of the implicit language model ensuring a grammati- cally correct sentence. 5.1 Baseline We use PREFIX as baseline which cuts the first 75 characters from the input sentence as summariza- Figure 3: The annealing of the KL term weight during training steps and the reaction of KL term value tion. This simple baseline shows to what extent out model is able to pass the information of the input sentence trough the low dimensional latent variable. 5.2 Training Details Similar to (Bowman et al., 2016) a weight for the KL term in the objective function is annealed from 0 to 1 during training. This hinders the model to go the easy way and set the KL term to 0 by letting qθ(zx) be equal to p(z). This would mean there is no information encoded in z and degenerate the VAE to a regular language model. Another tech- nique to overcome this is dropping the previous emitted word during decoding, relying the decoder further on the latent variable. The LSTM cell (Hochreiter and Schmidhuber, 1997) is used as basic RNN unit. Optimization is done by Adam (Kingma and Ba, 2014) and sam- pled softmax draws 1000 words. Beam search size is set to 100 and batch size to 512. The num- ber of desired output words is set to 20 to reli- able reach the 75 bytes of the reference summa- rizations. All other hyperparameter are searched by Bayesian optimization1. Encoder and decoder RNN cell size is 243. Word embedding size is 254 and the latent variable has 124 dimensions. A 236 wide hidden layer predicts Xbow. The best size for length embeddings is found to be 50. Words are not dropped during decoding by a probability of 0.20 and the output layer of RNN cells is regular- ized by a dropout keep rate of 0.87. DUC-2004 Gigaword Model PREFIX no len limit LenEmb 20 ROUGE-1 ROUGE-2 ROUGE-L ROUGE-1 ROUGE-2 ROUGE-L Ext. % 22.43 14.49 16.38 23.14 19.91 22.19 19.65 12.28 14.19 6.49 2.06 2.56 8.25 4.14 4.56 21.73 18.02 19.88 100 51 60 Table 1: ROUGE-1, ROUGE-2, ROUGE-L on DUC-2004 and Gigaword evaluation set. no len Limit decodes the input sentence with modifying the length. LenEmb 20 sets the desired length to 20 output words. Ext. % reports the amount of extracted words from input. 6 Results 6.1 Evaluation Metric ROUGE (Lin, 2004) is an n-gram based evalu- ation metric to quantify the quality of a sum- mary relative to given references. We report re- sults on ROUGE-1 and ROUGE-2 which basically count the uni- and bi-gram overlap. Furthermore ROUGE-L score is based on the longest com- mon subsequence (LCS) between the given texts. ROUGE is just an indicator if a automatically gen- erated summary is as good as a human-written ref- erence and should be handled with caution. 6.2 Quantitative Evaluation Before discussing the summarization results we take a look at how the LenEmb effects the model. In Figure 4 and 5 we see the output length of the model without length restrictions and the one with a desired length of 20 words. Figure 4 is about the same distribution as the input sentences. Figure 5 proofs that we are able to reduce the output length near the desired 75 characters. In fact 20 words are chosen to have the majority slightly above 75 characters to not waste word space during ROUGE evaluation. We perform another analysis to study the effect of LenEmb. We train a model with ex- plicitly providing the information about the sen- tence length via LenEmb and one without this ex- tension. This means the model has to somehow encode the length information into the latent vari- able to reproduce the input sentence with mini- mal loss. In Table 2 we see the R2 results of a Linear Regression (LR) trained on the latent vari- ables of both models with the objective to pre- dict the length of the encoded sentence. For the model without explicit length information LR can better predict the length of the encoded sentence with only looking at the latent variable. With less length information stored in the latent variable it 1https://scikit-optimize.github.io/ should be easier to influence the model to produce a certain output length. The ROUGE scores are found in Table 1. Our model is not able to beat the PREFIX baseline. This however could be the effect of the VAE not being able to restore the correct input sentence. We ver- ify this by testing a vanilla VAE model on solely reconstructing the input sentence and see that a lot of mistakes are made. One reason is the lack of attention, which can't be used in a VAE set- ting, to 'copy' rare words from the input. Our LenEmb model however is consistently better than the vanilla VAE, which shows that the reducing of output length can fit more information into the first 75 characters. If we could improve the vanilla VAE to reproduce the input sentence without mak- ing a lot mistakes and the LenEmb model main- tains the performance gain over the vanilla VAE, we could beat the PREFIX baseline. The gram- matical quality of the generated sentences was not evaluated. Figure 4: Frequency of output characters without limiting the length 7 Conclusion We extended a VAE with LenEmb to control the length of the produced sentences. The hypothe- ing, pages 10 -- 21, Berlin, Germany. Association for Computational Linguistics. Gunes Erkan and Dragomir R. Radev. 2004. Lexrank: Graph-based lexical centrality as salience in text summarization. J. Artif. Int. Res., 22(1):457 -- 479. David Graff, Junbo Kong, Ke Chen, and Kazuaki Maeda. 2003. English gigaword. Linguistic Data Consortium, Philadelphia, 4:1. Aria Haghighi and Lucy Vanderwende. 2009. Explor- ing content models for multi-document summariza- In Proceedings of Human Language Tech- tion. nologies: The 2009 Annual Conference of the North American Chapter of the Association for Compu- tational Linguistics, NAACL '09, pages 362 -- 370, Stroudsburg, PA, USA. Association for Computa- tional Linguistics. Sepp Hochreiter and Jurgen Schmidhuber. 1997. Long short-term memory. Neural Comput., 9(8):1735 -- 1780. S´ebastien Jean, Kyunghyun Cho, Roland Memisevic, and Yoshua Bengio. 2015. On using very large target vocabulary for neural machine translation. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Lan- guage Processing (Volume 1: Long Papers), pages 1 -- 10, Beijing, China. Association for Computa- tional Linguistics. Yuta Kikuchi, Graham Neubig, Ryohei Sasano, Hi- roya Takamura, and Manabu Okumura. 2016. Con- trolling output length in neural encoder-decoders. In Proceedings of the 2016 Conference on Empiri- cal Methods in Natural Language Processing, pages 1328 -- 1338, Austin, Texas. Association for Compu- tational Linguistics. Diederik P. Kingma and Jimmy Ba. 2014. Adam: CoRR, A method for stochastic optimization. abs/1412.6980. Diederik P. Kingma and Max Welling. 2013. Auto- encoding variational bayes. CoRR, abs/1312.6114. Chin-Yew Lin. 2004. Rouge: A package for automatic In Text Summarization evaluation of summaries. Branches Out: Proceedings of the ACL-04 Work- shop, pages 74 -- 81, Barcelona, Spain. Association for Computational Linguistics. Paul Over, Hoa Dang, and Donna Harman. 2007. Duc in context. Inf. Process. Manage., 43(6):1506 -- 1520. Daraksha Parveen and Michael Strube. 2015. Integrat- ing importance, non-redundancy and coherence in graph-based extractive summarization. Romain Paulus, Caiming Xiong, and Richard Socher. 2017. A deep reinforced model for abstractive sum- marization. CoRR, abs/1705.04304. Figure 5: Frequency of output characters with set- ting desired length to 20 R2 with LenEmb w/o LenEmb DUC2004 Gigaword 0.41 0.59 0.54 0.72 Table 2: Linear Regression prediction on sen- tences length with and w/o LenEmb ses that stimulating the decoder to produce shorter outputs will result in more information expressed in fewer words could be verified in a summariza- tion experiment. However a simple baseline could not be beaten with this approach. A reason and subject to further research is how the vanilla VAE can be improved to better reconstruct the input sentence and how this influences the LenEmb ex- tended model. A Linear Regression experiment demonstrated that the length of the input sentence is encoded in the latent variable. All in all this is a reasonable approach to construct a unsuper- vised abstractive sentence summarization model and worth further investigation. References Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Neural machine translation by CoRR, Bengio. 2014. jointly learning to align and translate. abs/1409.0473. Siddhartha Banerjee, Prasenjit Mitra, and Kazunari Sugiyama. 2016. Multi-document abstractive sum- marization using ILP based multi-sentence compres- sion. CoRR, abs/1609.07034. Samuel R. Bowman, Luke Vilnis, Oriol Vinyals, An- drew Dai, Rafal Jozefowicz, and Samy Bengio. 2016. Generating sentences from a continuous In Proceedings of The 20th SIGNLL Con- space. ference on Computational Natural Language Learn- Alexander M. Rush, Sumit Chopra, and Jason Weston. 2015. A neural attention model for abstractive sen- In Proceedings of the 2015 tence summarization. Conference on Empirical Methods in Natural Lan- guage Processing, pages 379 -- 389, Lisbon, Portugal. Association for Computational Linguistics. Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. 2014. Sequence to sequence learning with neural net- In Proceedings of the 27th International works. Conference on Neural Information Processing Sys- tems - Volume 2, NIPS'14, pages 3104 -- 3112, Cam- bridge, MA, USA. MIT Press. Ankit Vani and Vighnesh Birodkar. 2016. Challenges with variational autoencoders for text. Tiancheng Zhao, Ran Zhao, and Maxine Eskenazi. 2017. Learning discourse-level diversity for neural dialog models using conditional variational autoen- In Proceedings of the 55th Annual Meet- coders. ing of the Association for Computational Linguistics (Volume 1: Long Papers), pages 654 -- 664. Associa- tion for Computational Linguistics.
1910.04210
1
1910
2019-10-09T19:25:21
Perturbation Sensitivity Analysis to Detect Unintended Model Biases
[ "cs.CL" ]
Data-driven statistical Natural Language Processing (NLP) techniques leverage large amounts of language data to build models that can understand language. However, most language data reflect the public discourse at the time the data was produced, and hence NLP models are susceptible to learning incidental associations around named referents at a particular point in time, in addition to general linguistic meaning. An NLP system designed to model notions such as sentiment and toxicity should ideally produce scores that are independent of the identity of such entities mentioned in text and their social associations. For example, in a general purpose sentiment analysis system, a phrase such as I hate Katy Perry should be interpreted as having the same sentiment as I hate Taylor Swift. Based on this idea, we propose a generic evaluation framework, Perturbation Sensitivity Analysis, which detects unintended model biases related to named entities, and requires no new annotations or corpora. We demonstrate the utility of this analysis by employing it on two different NLP models --- a sentiment model and a toxicity model --- applied on online comments in English language from four different genres.
cs.CL
cs
Perturbation Sensitivity Analysis to Detect Unintended Model Biases Vinodkumar Prabhakaran Google Brain San Francisco, CA, USA Ben Hutchinson Google Brain San Francisco, CA, USA Margaret Mitchell Google Brain Seattle, WA, USA 9 1 0 2 t c O 9 ] L C . s c [ 1 v 0 1 2 4 0 . 0 1 9 1 : v i X r a [email protected] [email protected] [email protected] Abstract techniques Data-driven statistical Natural Language Pro- cessing (NLP) leverage large amounts of language data to build models that can understand language. However, most lan- guage data reflect the public discourse at the time the data was produced, and hence NLP models are susceptible to learning inciden- tal associations around named referents at a particular point in time, in addition to gen- eral linguistic meaning. An NLP system de- signed to model notions such as sentiment and toxicity should ideally produce scores that are independent of the identity of such enti- ties mentioned in text and their social associa- tions. For example, in a general purpose senti- ment analysis system, a phrase such as I hate Katy Perry should be interpreted as having the same sentiment as I hate Taylor Swift. Based on this idea, we propose a generic evaluation framework, Perturbation Sensitivity Analysis, which detects unintended model biases related to named entities, and requires no new annota- tions or corpora. We demonstrate the utility of this analysis by employing it on two different NLP models -- a sentiment model and a tox- icity model -- applied on online comments in English language from four different genres. Introduction 1 Recent research has shown ample evidence that data-driven NLP models may inadvertently cap- ture, reflect and sometimes amplify various so- cial biases present in the language data they are trained on (Bolukbasi et al., 2016; Blodgett and O'Connor, 2017). Such biases can often result in unintended and disparate harms to the users who engage with NLP-aided systems. For instance, when NLP algorithms are used to moderate online communication, e.g. by detecting harassment, al- though the net social benefits may be positive, the harms caused by incorrect classifications may be unevenly distributed, leading to disparate impact (Feldman et al., 2015). Some writers may find Sentence I hate Justin Timberlake. I hate Katy Perry. I hate Taylor Swift. I hate Rihanna. Toxicity Sentiment 0.90 0.80 0.74 0.69 -0.30 -0.10 -0.40 -0.60 Table 1: Sensitivity of NLP models to named entities in text. Toxicity score range: 0 to 1; Sentiment score range: -1 to +1. their contributions being disproportionately cen- sored, while some readers may not be adequately protected from harassment (Dixon et al., 2018). Research into fairness in machine learning dis- tinguishes two broad categories of unfair discrim- ination. First, unfairness for individuals exists when similar individuals are treated dissimilarly (Dwork et al., 2012). Second, a range of criteria define unfairness for groups, each in terms of sta- tistical dependence between group membership, model score, and class label (see, e.g., (Choulde- chova and Roth, 2018; Mitchell et al., 2018)). In both cases, what is "fair" or "unfair" is highly context-dependent, and judgments about fairness require consideration of the broader sociotechni- cal frame (Selbst et al., 2019). This framework also poses some practical chal- lenges: individual fairness requires knowing in- tricate details about an individual, while group fairness requires knowing how an individual can be categorized into legally and socially sensitive roles. The first runs into the ethical concerns of surveillance; the second runs into the ethical con- cerns of discrimination. Furthermore, texts are of- ten not annotated with the social groups of their readers/writers (and for privacy reasons we may not wish to infer them), or whether two individu- als are "similar" or not. Hence, fairness research in NLP has mostly focused on mentions of social identities (Dixon et al., 2018; Borkan et al., 2019; Garg et al., 2019), or on how social stereotypes im- pact semantic interpretation (Webster et al., 2018), and often rely heavily on annotated corpora. In this paper, we propose a general-purpose evaluation framework that detects unintended bi- ases in NLP models around named entities men- tioned in text. Our method does not rely on any annotated corpora, and we focus solely on application-independent sensitivity of models, which does not clearly fall under individual- or group- based fairness criteria. Our core idea is based on the assumption that an NLP system de- signed to be widely applicable should ideally pro- duce scores that are independent of the identities of named entities mentioned in the text. For in- stance, the sentences I hate Justin Timberlake and I hate Rihanna both express the same semantics using identical constructions; however, the toxic- ity model used in our experiments gives a signif- icantly higher score to the former (0.90) than the latter (0.69) (see Table 1 for more examples). Mentions of such real-world entities are perva- sive in data. Just as word co-occurrence metrics capture 'meaning representations' of words in the language,1 co-occurrence patterns between entity mentions and other parts of the phrases they occur in influence their learned meaning. For example, if a person's name is often mentioned in negative linguistic contexts, a trained model might inadver- tently associate negativity to that name, resulting in biased predictions on sentences with that name. If unchecked, this leads to undesirable biases in the model, violating tenets of both individual and group fairness as they are applied in context. The primary contributions of this paper are: (i) a simple and effective general-purpose model evalu- ation metric, which we call perturbation sensitiv- ity analysis, for measuring unintended bias; (ii) a large-scale systematic analysis of model sensitiv- ity to name perturbations, on two tasks -- sentiment and toxicity -- across four different genres of En- glish text; (iii) a demonstration of how name per- turbation can reveal undesired biases in the learned model towards names of popular personalities; (iv) showing the downstream impact of name sensitiv- ity, controlling for prediction thresholds. 2 Perturbation Sensitivity Analysis We introduce Perturbation Sensitivity Analysis (PSA), a general evaluation technique to detect un- intended biases in NLP models towards real-world entities. Central to our approach is the notion of 1Often through word embeddings fed to or learned by the first layer of neural network based models perturbation, where a reference to a real-world en- tity is replaced by a reference to another real-world entity of the same type (e.g., a person name re- placed with another person name). PSA measures the extend to which a model prediction is sensitive to such perturbations, and is calculated w.r.t. a set of (unannotated) sentences X from the target do- main and a set of names N (of the same entity type t) that the perturbations are performed over. For simplicity, in this paper, we discuss text classification models that take in a piece of text and return a score for a target class. Similarly, we focus on perturbing over person names. However, our method is readily extendable to other kinds of models as well as to other entity types. Our approach begins by first retrieving the set of sentences X such that each sentence contains at least one referring expression that refers to an en- tity of the type we are doing perturbation on (per- son, in our case). This referring expression could be a pronoun or a proper name. We select one such referring expression as the anchor for each sen- tence in X. We then "perturb" each sentence by replacing the anchor with named entities n ∈ N. We then measure the sensitivity of the model with respect to such perturbation by running it on the resulting set of X ∗ N perturbed sentences. Formally, let xn denote the perturbed sentence obtained by replacing the anchor word in x ∈ X with n, and f (xn) denote the score assigned to a target class by model f on the perturbed sentence xn. Formally, we define three metrics for the per- turbation sensitivity of model scores: Perturbation Score Sensitivity (ScoreSens) of a model f with respect to a corpus X and a name n is the average difference between f (xn) and f (x) calculated over X, i.e. E x∈X [f (xn) − f (x)]. [StdDev n∈N Perturbation Score Deviation (ScoreDev) of a model f with respect to a corpus X and a set of names N is the standard deviation of scores due to perturbation, averaged across sentences, i.e., E x∈X Perturbation Score Range (ScoreRange) of a model f with respect to a corpus X and a set of names N is the Range (max−min) of scores, av- eraged across sentences, i.e., E (f (xn)]. x∈X (f (xn)]. [Range n∈N Whether a score difference caused by name per- turbation results in a different label depends also on the threshold. Given a threshold, 0 ≤ c ≤ 1, binary labels y(x) can be obtained from the clas- sifier f as I[f (x) ≥ c] ∈ {0, 1}, where I[·] is the indicator function. Using this, we define a metric for the perturbation sensitivity of model labels: Perturbation Label Distance (LabelDist) of a binary classifier y with respect to a corpus X and a set of names N is the Jaccard Distance between a) the set of sentences {x} for which y(x) = 1, and b) the sentences {x} for which y(xn) = 1, averaged across names n ∈ N; i.e., [Jaccard({xy(x) = 1},{xy(xn) = 1})], E n∈N where Jaccard(A, B) = 1 − A ∩ B/A ∪ B. 2.1 Assumptions The underlying assumption of PSA is that the model should ideally be not sensitive to name per- turbation. However, this assumption may not al- ways hold true. Proper names do convey meaning akin to the linguistic meanings expressed in more general phrases, and thus perturbing names may sometimes remove critical semantic content that an NLP system should be modelling. For exam- ple, he is like Hitler vs. he is like Gandhi should have very different sentiment scores, since the sen- tences evoke the pragmatics associated with those referents. Whether the PSA assumption holds in individual sentences will depend on the sentential context; however, the corpus-level trends that we measure in the model scores/labels are still indica- tive of systemic biases in the model. This points to the importance of paying care to how the corpus X is constructed, and making sure that it captures a diverse set of sentential contexts. 2.2 Analysis Framework The PSA framework described above is applica- ble to any text classification models, on any tar- get corpus, to detect bias with respect to any type of named entities (i.e., perturbable among each other). In this paper, we focus on two text clas- sification models, applied to 4 different corpora, to detect biases associated with person names. Models: We use two text classification models: a) a toxicity model that returns a score between [0,1], and b) a sentiment model that returns a score between [-1,+1]. Both models were trained us- ing state-of-the-art neural network algorithms, and perform competitively on benchmark tests.2 2To obtain information about the models, for instance to perform replication experiments, please contact the authors. Corpora: We use four socially and topically di- verse corpora of online comments released by Voigt et al. (2018): Facebook comments on politi- cians' posts (FB-Pol.) and on public figures' posts (FB-Pub.), Reddit comments, and comments in Fi- tocracy forums. For each corpus, we select 1000 comments at random that satisfy two criteria: at most 50 words in length, and contain at least one English 3rd person singular pronouns (i.e., an- chors). We use these extracted comments to build templates, where the pronouns can be replaced with a person name to form a grammatically co- herent perturbed sentence. We use pronouns as the anchors for multiple reasons. Pronouns are often closed-class words across languages,3 making it a useful reference cross-linguistically. Using a list of names to query for anchors is an option; but it has the risk of resulting in a set of sentences biased towards the cultural/demographic associations of those names, a confound that the use of pronouns as anchors will avoid. We balance the representa- tion of female and male pronouns in our extracted sentences so as to minimize the effect of skew to- wards one gender in particular within the test set. However future work should examine how to best account for non-binary genders in this step. Names: We choose a list of controversial per- sonalities, compiled based on Wikipedia page edit frequency.4 Because of their controversial nature, these names are more likely to have social biases associated with them, which is helpful to demon- strate the utility of our analysis. 3 Results Table 2 shows the results of perturbation sensi- tivity analysis on different corpora. Both models exhibit significant sensitivity towards name per- turbation across all 4 corpora. On average, sen- tences subjected to name perturbation resulted in a wide range of scores; i.e., ScoreRange over 0.10 for toxicity, and 0.36-0.42 for sentiment. Simi- larly, ScoreDev values for the sentiment model is also higher (over 0.07 across board) compared to that of the toxicity model (around 0.02), suggest- ing that the sentiment model is much more sensi- tive to the named entities present in text than the toxicity model. We also observe that perturbation 3While the assumption that pronouns are a closed-class is useful for many languages, Japanese and Malay are example languages where this assumption does not hold. 4https://anon.to/x9PMYo Figure 1: Name Perturbation Sensitivity (ScoreSens) for the toxicity model on the Reddit subcorpus, across names of contro- versial personalities. Female names are at the top; male names at the bottom; colors distinguish their career type. Names have been obfuscated due to their sensitive nature. Corpus FB-Pol. FB-Pub. Reddit Fitocracy Toxicity Sentiment ScoreDev ScoreRange ScoreDev ScoreRange 0.022 0.025 0.022 0.022 0.107 0.118 0.107 0.103 0.070 0.083 0.072 0.071 0.360 0.420 0.376 0.364 Table 2: ScoreDev is the per-sentence standard deviation of scores upon name perturbation, averaged across all sentences. ScoreRange is the per-sentence range of scores (i.e., max - min) upon name perturbation, averaged across all sentences. sensitivity is a function of the target corpus; com- ments on public figures had a much larger Score- Dev and ScoreRange for both tasks. 3.1 Bias Towards Specific Names We now analyze the ScoreSens for specific names. Figure 1 shows the ScoreSens for each name in our list, for the Toxicity-Reddit combination. Names are obfuscated in the figure due to their sensi- tive nature, but their career type is distinguished. Replacing a pronoun with some names increases the toxicity scores by over 0.03 on average, while other names decrease the scores by almost 0.02 on average. It is also notable that leaders (politicians) and actors in our list have higher toxicity associa- tions than musicians and athletes. Similar effects also occur in the sentiment analysis model. 3.2 Threshold Analysis Whether a score difference caused by perturbation results in a different label or not depends also on the threshold. It is possible that a model would be more stable on sentences with highly toxic lan- guage, but the effect of perturbation is more preva- lent in sentences that have fewer signals of toxic- ity. We verified this to be the case in our analysis: the average (over all names) value of the pertur- f (xn) − f (x), has bation score sensitivity, i.e. a significant moderate negative correlation (-0.48) with the original score of that sentence, f (x). This finding is of importance to counter-factual token fairness approaches such as (Garg et al., 2019). To further understand the impact of perturbation sensitivity, we calculate LabelDist, which takes into account the number of sentences that switch either from toxic to non-toxic or vice versa, when a pronoun is changed to a name. Figure 2 shows LabelDist values across different thresholds. As can be seen from the Figure, the name perturbation results in a LabelDist of 0.10 -- 0.40 across thresh- olds. This roughly suggests that around 10-40% of sentences (with third person singular pronouns) labeled as toxic at any given threshold could flip the label as a result of name perturbation. It is also interesting to note that despite the negative corre- lation between f (xn) − f (x) and f (x), the La- belDist has high values at high thresholds. 4 Related Work Fairness research in NLP has seen tremendous growth in the past few years (e.g., (Bolukbasi et al., 2016; Caliskan et al., 2017; Webster et al., 2018; D´ıaz et al., 2018; Dixon et al., 2018; De- Arteaga et al., 2019; Gonen and Goldberg, 2019; Manzini et al., 2019)) over a range of NLP tasks such as co-reference resolution and machine trans- lation, as well as the tasks we studied -- senti- ment analysis and toxicity prediction. Some of this work study bias by swapping names in sen- tence templates (Caliskan et al., 2017; Kiritchenko and Mohammad, 2018; May et al., 2019; Gonen and Goldberg, 2019); however they use synthetic sentence templates, while we extract naturally oc- curring sentences from the target corpus. Our work is closely related to counter-factual token fairness (Garg et al., 2019), which measures the magnitude of model prediction change when identity terms (such as gay, lesbian, transgender etc.) referenced in naturally occurring sentences are perturbed. Additionally, De-Arteaga et al. (2019) study gender bias in occupation classifica- tion using names in online biographies. In con- trast, we propose a general framework to study bi- ases with named entities. Our work is also related to the work on interpreting neural network models by manipulating input text (Li et al., 2016); while their aim is to interpret model weights, we study the model outputs for biases. 5 Discussion and Conclusion Social biases towards real-world entities are often reflected in the language that mentions them, and such biases can be unintentionally perpetuated to trained models. The focus of this paper is to in- troduce a simple method, Perturbation Sensitivity Analysis, to test for unwanted biases in an NLP model. Our method can be employed to study bi- ases towards individuals (as demonstrated here), or towards groups (e.g., races, genders), and is flexible enough to be applied across domains. Figure 2: Even for high model thresholds, we see significant name perturbation sensitivity in classifications/labels. La- belDist measures the # of flips between toxic and non-toxic. We are motivated to provide solutions for end users of NLP systems, who are likely to use mod- els outside of their original training/testing envi- ronments, e.g., on data from populations or plat- forms that the system was not explicitly trained on. The relative simplicity of the proposed approach suggests that the same method may be applied in different genres and across different languages, provided that a set of anchors are provided, such as pronouns in the target language. Pronouns' sta- tus cross-linguistically as closed-class -- high fre- quency and easily listed as a small set of words -- make them particularly amenable for serving as a starting point for open domain bias analyses. After identifying unwanted biases in a model, a next logical step is to reduce these biases. Adapting the proposed approach to model train- ing is straightforward, either by perturbing names in the training data directly, or by estimating the likelihood of given annotations as a func- tion of sentence perturbation. Without access to model retraining, a simple solution could use post- processing to return system scores as a function of perturbed sentences, such as by averaging scores across perturbed sentences. Future work could employ our method to study various group biases such as nationality, caste, and religion, since person names may function as sig- nificant markers for many such demographic as- sociations. Our method could also be easily ex- tended to other kinds of NLP models (beyond clas- sification) as well as other types of entities (loca- tions, organizations etc.). Acknowledgements We would like to thank the anonymous reviewers for their helpful and con- structive feedback. We also thank Dylan Baker, Emily Denton, Yoni Halpern, Ben Packer, Lucy Vasserman, Kellie Webster, and Simone Wu for their valuable discussions on this paper. References Su Lin Blodgett and Brendan O'Connor. 2017. Racial disparity in natural language processing: A case study of social media African-American English. arXiv preprint arXiv:1707.00061. Tolga Bolukbasi, Kai-Wei Chang, James Y Zou, Venkatesh Saligrama, and Adam T Kalai. 2016. Man is to computer programmer as woman is to In Ad- homemaker? debiasing word embeddings. vances in neural information processing systems, pages 4349 -- 4357. Daniel Borkan, Lucas Dixon, Jeffrey Sorensen, Nithum Thain, and Lucy Vasserman. 2019. Nuanced met- rics for measuring unintended bias with real data for text classification. In Proceedings of the FATES 2019 Workshop on Fairness, Accountability, Trans- parency, Ethics, and Society on the Web. Aylin Caliskan, Joanna J Bryson, and Arvind Narayanan. 2017. Semantics derived automatically from language corpora contain human-like biases. Science, 356(6334):183 -- 186. Alexandra Chouldechova and Aaron Roth. 2018. The arXiv frontiers of fairness in machine learning. preprint arXiv:1810.08810. Maria De-Arteaga, Alexey Romanov, Hanna Wal- lach, Jennifer Chayes, Christian Borgs, Alexandra Chouldechova, Sahin Geyik, Krishnaram Kentha- padi, and Adam Tauman Kalai. 2019. Bias in bios: A case study of semantic representation bias in a In Proceedings of the Confer- high-stakes setting. ence on Fairness, Accountability, and Transparency, pages 120 -- 128. ACM. Mark D´ıaz, Isaac Johnson, Amanda Lazar, Anne Marie Piper, and Darren Gergle. 2018. Addressing age- In Proceedings related bias in sentiment analysis. of the 2018 CHI Conference on Human Factors in Computing Systems, page 412. ACM. Lucas Dixon, John Li, Jeffrey Sorensen, Nithum Thain, and Lucy Vasserman. 2018. Measuring and mitigat- In Pro- ing unintended bias in text classification. ceedings of the 2018 AAAI/ACM Conference on AI, Ethics, and Society, pages 67 -- 73. ACM. Cynthia Dwork, Moritz Hardt, Toniann Pitassi, Omer Reingold, and Richard Zemel. 2012. Fairness through awareness. In Proceedings of the 3rd inno- vations in theoretical computer science conference, pages 214 -- 226. ACM. Michael Feldman, Sorelle A Friedler, John Moeller, Carlos Scheidegger, and Suresh Venkatasubrama- nian. 2015. Certifying and removing disparate im- In Proceedings of the 21th ACM SIGKDD pact. International Conference on Knowledge Discovery and Data Mining, pages 259 -- 268. ACM. Sahaj Garg, Vincent Perot, Nicole Limtiaco, Ankur Taly, Ed H Chi, and Alex Beutel. 2019. Counterfac- tual fairness in text classification through robustness. In Proceedings of the 2019 AAAI/ACM Conference on AI, Ethics, and Society, pages 219 -- 226. ACM. Hila Gonen and Yoav Goldberg. 2019. Lipstick on a pig: Debiasing methods cover up systematic gen- der biases in word embeddings but do not remove In Proceedings of NAACL, pages 609 -- 614, them. Minneapolis, Minnesota. Association for Computa- tional Linguistics. Svetlana Kiritchenko and Saif Mohammad. 2018. Ex- amining gender and race bias in two hundred sen- In Proceedings of the timent analysis systems. Seventh Joint Conference on Lexical and Com- putational Semantics, pages 43 -- 53, New Orleans, Louisiana. Association for Computational Linguis- tics. Jiwei Li, Will Monroe, and Dan Jurafsky. 2016. Un- derstanding neural networks through representation erasure. arXiv preprint arXiv:1612.08220. Thomas Manzini, Lim Yao Chong, Alan W Black, and Yulia Tsvetkov. 2019. Black is to criminal as cau- casian is to police: Detecting and removing multi- In Proceedings of class bias in word embeddings. NAACL, pages 615 -- 621, Minneapolis, Minnesota. Association for Computational Linguistics. Chandler May, Alex Wang, Shikha Bordia, Samuel R. Bowman, and Rachel Rudinger. 2019. On measur- ing social biases in sentence encoders. In Proceed- ings of NAACL, pages 622 -- 628, Minneapolis, Min- nesota. Association for Computational Linguistics. Shira Mitchell, Eric Potash, and Solon Barocas. 2018. Prediction-based decisions and fairness: A cat- alogue of choices, assumptions, and definitions. arXiv:1811.07867. Andrew D Selbst, Danah Boyd, Sorelle A Friedler, Suresh Venkatasubramanian, and Janet Vertesi. 2019. Fairness and abstraction in sociotechnical systems. In Proceedings of the Conference on Fair- ness, Accountability, and Transparency. ACM. Rob Voigt, David Jurgens, Vinodkumar Prabhakaran, Dan Jurafsky, and Yulia Tsvetkov. 2018. Rtgender: A corpus for studying differential responses to gen- In Proceedings of the Eleventh International der. Conference on Language Resources and Evaluation (LREC 2018), Paris, France. European Language Resources Association (ELRA). Kellie Webster, Marta Recasens, Vera Axelrod, and Ja- son Baldridge. 2018. Mind the gap: A balanced corpus of gendered ambiguous pronouns. Transac- tions of the Association for Computational Linguis- tics, 6:605 -- 617.
1804.05990
1
1804
2018-04-17T00:14:32
Learning Joint Semantic Parsers from Disjoint Data
[ "cs.CL" ]
We present a new approach to learning semantic parsers from multiple datasets, even when the target semantic formalisms are drastically different, and the underlying corpora do not overlap. We handle such "disjoint" data by treating annotations for unobserved formalisms as latent structured variables. Building on state-of-the-art baselines, we show improvements both in frame-semantic parsing and semantic dependency parsing by modeling them jointly.
cs.CL
cs
Learning Joint Semantic Parsers from Disjoint Data Sam Thomson♣ ♦ Paul G. Allen School of Computer Science & Engineering, University of Washington, Seattle, WA, USA Swabha Swayamdipta♣ Noah A. Smith♦ Hao Peng♦ ♣ School of Computer Science, Carnegie Mellon University, Pittsburgh, PA, USA {hapeng,nasmith}@cs.washington.edu, {sthomson,swabha}@cs.cmu.edu 8 1 0 2 r p A 7 1 ] L C . s c [ 1 v 0 9 9 5 0 . 4 0 8 1 : v i X r a Abstract We present a new approach to learning se- mantic parsers from multiple datasets, even when the target semantic formalisms are dras- tically different, and the underlying corpora do not overlap. We handle such "disjoint" data by treating annotations for unobserved for- malisms as latent structured variables. Build- ing on state-of-the-art baselines, we show im- provements both in frame-semantic parsing and semantic dependency parsing by model- ing them jointly. Our code is open-source and available at https://github.com/ Noahs-ARK/NeurboParser. Introduction 1 Semantic parsing aims to automatically predict formal representations of meaning underlying nat- ural language, and has been useful in question an- swering (Shen and Lapata, 2007), text-to-scene generation (Coyne et al., 2012), dialog systems (Chen et al., 2013) and social-network extraction (Agarwal et al., 2014), among others. Various for- mal meaning representations have been developed corresponding to different semantic theories (Fill- more, 1982; Palmer et al., 2005; Flickinger et al., 2012; Banarescu et al., 2013). The distributed nature of these efforts results in a set of anno- tated resources that are similar in spirit, but not strictly compatible. A major axis of structural di- vergence in semantic formalisms is whether based on spans (Baker et al., 1998; Palmer et al., 2005) or dependencies (Surdeanu et al., 2008; Oepen et al., 2014; Banarescu et al., 2013; Copestake et al., 2005, inter alia). Depending on applica- tion requirements, either might be most useful in a given situation. Learning from a union of these resources seems promising, since more data almost always trans- lates into better performance. This is indeed the case for two prior techniques-parameter sharing Figure 1: An example sentence from the FrameNet 1.5 corpus, shown with an author-annotated DM semantic dependency graph (above) and frame- semantic annotation (below). Two more gold frames (and their arguments) have been omitted for space. (FitzGerald et al., 2015; Kshirsagar et al., 2015), and joint decoding across multiple formalisms us- ing cross-task factors that score combinations of substructures from each (Peng et al., 2017). Pa- rameter sharing can be used in a wide range of multitask scenarios, when there is no data overlap or even any similarity between the tasks (Collobert and Weston, 2008; Søgaard and Goldberg, 2016). But techniques involving joint decoding have so far only been shown to work for parallel annota- tions of dependency-based formalisms, which are structurally very similar to each other (Llu´ıs et al., 2013; Peng et al., 2017). Of particular interest is the approach of Peng et al., where three kinds of semantic graphs are jointly learned on the same in- put, using parallel annotations. However, as new annotation efforts cannot be expected to use the same original texts as earlier efforts, the utility of this approach is limited. We propose an extension to Peng et al.'s formu- lation which addresses this limitation by consid- ering disjoint resources, each containing only a single kind of annotation. Moreover, we consider structurally divergent formalisms, one dealing with semantic spans and the other with semantic Onlyafewbooksfellinthereadingarg1room.arg1mwearg1arg1arg2BVcompoundtopin.prepLocative RelationFigureGroundfall.vMotionDirectionalThemePlacea few.art QuantityIndividuals dependencies. We experiment on frame-semantic parsing (Gildea and Jurafsky, 2002; Das et al., 2010), a span-based semantic role labeling (SRL) task (§2.1), and on a dependency-based minimum recursion semantic parsing (DELPH-IN MRS, or DM; Flickinger et al., 2012) task (§2.2). See Fig- ure 1 for an example sentence with gold FrameNet annotations, and author-annotated DM representa- tions. Our joint inference formulation handles missing annotations by treating the structures that are not present in a given training example as latent vari- ables (§3).1 Specifically, semantic dependencies are treated as a collection of latent variables when training on FrameNet examples. Using this latent variable formulation, we present an approach for relating spans and depen- dencies, by explicitly scoring affinities between pairs of potential spans and dependencies. Be- cause there are a huge number of such pairs, we limit our consideration to only certain pairs-our design is inspired by the head rules of Surdeanu et al. (2008). Further possible span-dependency pairs are pruned using an (cid:96)1-penalty technique adapted from sparse structure learning (§5). Neu- ral network architectures are used to score frame- semantic structures, semantic dependencies, as well as cross-task structures (§4). To summarize, our contributions include: • using a latent variable formulation to ex- tend cross-task scoring techniques to scenar- ios where datasets do not overlap; • learning cross-task parts across structurally • using an (cid:96)1-penalty technique to prune the divergent formalisms; and space of cross task parts. Our approach results in a new state-of-the-art in frame-semantic parsing, improving prior work by 0.8% absolute F1 points (§6), and achieves competitive performance on semantic dependency parsing. Our code is available at https://github.com/Noahs-ARK/ NeurboParser. 2 Tasks and Related Work We describe the two tasks addressed in this work-frame-semantic parsing (§2.1) and seman- tic dependency parsing (§2.2)-and discuss how 1Following past work on support vector machines with latent variables (Yu and Joachims, 2009), we use the term "latent variable," even though the model is not probabilistic. their structures relate to each other (§2.3). 2.1 Frame-Semantic Parsing Frame-semantic parsing is a span-based task, un- der which certain words or phrases in a sentence evoke semantic frames. A frame is a group of events, situations, or relationships that all share the same set of participant and attribute types, called frame elements or roles. Gold supervision for frame-semantic parses comes from the FrameNet lexicon and corpus (Baker et al., 1998). Concretely, for a given sentence, x, a frame- semantic parse y consists of: and ally a single token2) that evokes a frame; • a set of targets, each being a short span (usu- • for each target t, the frame f that it evokes; • for each frame f, a set of non-overlapping ar- gument spans in the sentence, each argument a = (i, j, r) having a start token index i, end token index j and role label r. The lemma and part-of-speech tag of a target comprise a lexical unit (or LU). The FrameNet ontology provides a mapping from an LU (cid:96) to the set of possible frames it could evoke, F(cid:96). Every frame f ∈ F(cid:96) is also associated with a set of roles, Rf under this ontology. For the LU "fall.v" evokes example, the frame MOTION DIRECTIONAL. The roles THEME and PLACE (which are specific to MO- TION DIRECTIONAL), are filled by the spans "Only a few books" and "in the reading room" re- spectively. LOCATIVE RELATION has other roles (PROFILED REGION, ACCESSIBILITY, DEIXIS, etc.) which are not realized in this sentence. in Figure 1, In this work, we assume gold targets and LUs are given, and parse each target independently, following the literature (Johansson and Nugues, 2007; FitzGerald et al., 2015; Yang and Mitchell, 2017; Swayamdipta et al., 2017, inter alia). More- over, following Yang and Mitchell (2017), we per- form frame and argument identification jointly. Most prior work has enforced the constraint that a role may be filled by at most one argument span, but following Swayamdipta et al. (2017) we do not impose this constraint, requiring only that argu- ments for the same target do not overlap. 296.5% of targets in the training data are single tokens. 2.2 Semantic Dependency Parsing Broad-coverage semantic dependency parsing (SDP; Oepen et al., 2014, 2015, 2016) represents sentential semantics with labeled bilexical depen- dencies. The SDP task mainly focuses on three semantic formalisms, which have been converted to dependency graphs from their original annota- tions. In this work we focus on only the DELPH- IN MRS (DM) formalism. Each semantic dependency corresponds to a la- beled, directed edge between two words. A sin- gle token is also designated as the top of the parse, usually indicating the main predicate in the sentence. For example in Figure 1, the left-most arc has head "Only", dependent "few", and label arg1. In semantic dependencies, the head of an arc is analogous to the target in frame semantics, the destination corresponds to the argument, and the label corresponds to the role. The same set of labels are available for all arcs, in contrast to the frame-specific roles in FrameNet. 2.3 Spans vs. Dependencies Early semantic role labeling was span-based (Gildea and Jurafsky, 2002; Toutanova et al., 2008, inter alia), with spans corresponding to syn- tactic constituents. But, as in syntactic parsing, there are sometimes theoretical or practical rea- sons to prefer dependency graphs. To this end, Surdeanu et al. (2008) devised heuristics based on syntactic head rules (Collins, 2003) to transform PropBank (Palmer et al., 2005) annotations into dependencies. Hence, for PropBank at least, there is a very direct connection (through syntax) be- tween spans and dependencies. For many other semantic representations, such a direct relationship might not be present. Some semantic representations are designed as graphs from the start (Hajic et al., 2012; Banarescu et al., 2013), and have no gold alignment to spans. Con- versely, some span-based formalisms are not an- notated with syntax (Baker et al., 1998; He et al., 2015),3 and so head rules would require using (noisy and potentially expensive) predicted syn- tax. Inspired by the head rules of Surdeanu et al. (2008), we design cross-task parts, without relying on gold or predicted syntax (which may be either unavailable or error-prone) or on heuristics. 3 Model Given an input sentence x, and target t with its LU (cid:96), denote the set of valid frame-semantic parses (§2.1) as Y(x, t, (cid:96)), and valid semantic de- pendency parses as Z(x).4 We learn a parameter- ized function S that scores candidate parses. Our goal is to jointly predict a frame-semantic parse and a semantic dependency graph by selecting the highest scoring candidates: (y, z) = arg max (y,z)∈Y(x,t,(cid:96))×Z(x) S(y, z, x, t, (cid:96)). (1) The overall score S can be decomposed into the sum of frame SRL score Sf, semantic dependency score Sd, and a cross-task score Sc: S(y, z, x, t, (cid:96)) = Sf(y, x, t, (cid:96)) + Sd(z, x) +Sc(y, z, x, t,(cid:96)). (2) Sf and Sc require access to the target and LU, in addition to x, but Sd does not. For clarity, we omit the dependence on the input sentence, target, and lexical unit, whenever the context is clear. Below we describe how each of the scores is computed based on the individual parts that make up the candidate parses. Frame SRL score. The score of a frame- semantic parse consists of • the score for a predicate part, sf (p) where each predicate is defined as a combination of a target t, the associated LU, (cid:96), and the frame evoked by the LU, f ∈ F(cid:96); • the score for argument parts, sf (a), each as- sociated with a token span and semantic role from Rf . Together, this results in a set of frame-semantic parts of size O(n2 F(cid:96)Rf).5 The score for a frame semantic structure y is the sum of local scores of parts in y: (cid:88) yi∈y Sf(y) = sf(yi). (3) The computation of sf is described in §4.2. 3 In FrameNet, phrase types of arguments and their gram- matical function in relation to their target have been anno- tated. But in order to apply head rules, the internal structure of arguments (or at least their semantic heads) would also re- quire syntactic annotations. 4For simplicity, we consider only a single target here; han- dling of multiple targets is discussed in §6. 5With pruning (described in §6) we reduce this to a num- ber of parts linear in n. Also, F(cid:96) is usually small (averaging 1.9), as is Rf (averaging 9.5). decoding frame-semantic structures.7 Because the DM dataset we use does not have target anno- tations, we do not use latent variables for frame semantic structures when predicting semantic de- pendency graphs. The parsing problem here re- duces to z = arg max z∈Z Sd(z), (6) in contrast with Equation 1 . 4 Parameterizations of Scores This section describes the parametrization of the scoring functions from §3. At a very high level: we learn contextualized token and span vectors using a bidirectional LSTM (biLSTM; Graves, 2012) and multilayer perceptrons (MLPs) (§4.1); we learn lookup embeddings for LUs, frames, roles, and arc labels; and to score a part, we combine the relevant representations into a single scalar score using a (learned) low-rank multilin- ear mapping. Scoring frames and arguments is detailed in §4.2, that of dependency structures in §4.3, and §4.4 shows how to capture interactions between arguments and dependencies. All param- eters are learned jointly, through the optimization of a multitask objective (§5). Tensor notation. The order of a tensor is the number of its dimensions-an order-2 tensor is a matrix and an order-1 tensor is a vector. Let ⊗ denote tensor product; the tensor product of two order-2 tensors A and B yields an order-4 tensor where (A ⊗ B)i,j,k,l = Ai,jBk,l. We use (cid:104)·,·(cid:105) to denote inner products. tokens and spans are 4.1 Token and Span Representations The representations of formed using biLSTMs followed by MLPs. Contextualized token representations. Each token in the input sentence x is mapped to an embedding vector. Two LSTMs (Hochreiter and Schmidhuber, 1997) are run in opposite directions over the input vector sequence. We use the con- catenation of the two hidden representations at each position i as a contextualized word embed- ding for each token: hi =(cid:2)−→ h i; (cid:3). ←− h i (7) 7Semantic dependency parses over a sentence are not con- strained to be identical for different frame-semantic targets. Figure 2: An example of cross-task parts from the FrameNet 1.5 development set. We enumer- ate all unlabeled semantic dependencies from the first word of the target (includes) to any token in- side the span. The red bolded arc indicates the prediction of our model. Semantic dependency score. Following Mar- tins and Almeida (2014), we consider three types of parts in a semantic dependency graph: seman- tic heads, unlabeled semantic arcs, and labeled se- mantic arcs. Analogous to Equation 3, the score for a dependency graph z is the sum of local scores: Sd(z) = sd(zj), (4) (cid:88) zj∈z The computation of sd is described in §4.3. Cross task score. In addition to task-specific parts, we introduce a set C of cross-task parts. Each cross-task part relates an argument part from y to an unlabeled dependency arc from z. Based on the head-rules described in §2.3, we consider unlabeled arcs from the target to any token inside the span.6 Intuitively, an argument in FrameNet would be converted into a dependency from its tar- get to the semantic head of its span. Since we do not know the semantic head of the span, we con- sider all tokens in the span as potential modifiers of the target. Figure 2 shows examples of cross- task parts. The cross-task score is given by Sc(y, z) = sc(yi, zj). (5) (yi,zj )∈(y×z)∩C The computation of sc is described in §4.4. In contrast to previous work (Llu´ıs et al., 2013; Peng et al., 2017), where there are parallel annota- tions for all formalisms, our input sentences con- tain only one of the two-either the span-based frame SRL annotations, or semantic dependency graphs from DM. To handle missing annotations, we treat semantic dependencies z as latent when 6Most targets are single-words (§2.1). For multi-token targets, we consider only the first token, which is usually content-bearing. (cid:88) includesinclude.vInclusionEvidencetosupportthisargumentTotal… Span representations. Following Lee et al. (2017), span representations are computed based on boundary word representations and discrete length and distance features. Concretely, given a target t and its associated argument a = (i, j, r) with boundary indices i and j, we compute three features φt(a) based on the length of a, and the distances from i and j to the start of t. We con- catenate the token representations at a's boundary with the discrete features φt(a). We then use a two-layer tanh-MLP to compute the span repre- sentation: gspan(i, j) = MLPspan(cid:0)[hi; hj; φt(a)](cid:1). (8) The target representation gtgt(t) is similarly com- puted using a separate MLPtgt, with a length fea- ture but no distance features. 4.2 Frame and Argument Scoring As defined in §3, the representation for a predi- cate part incorporates representations of a target span, the associated LU and the frame evoked by the LU. The score for a predicate part is given by a multilinear mapping: gpred(f ) = gfr(f ) ⊗ gtgt(t) ⊗ glu((cid:96)) sf(p) =(cid:10)W, gpred(f )(cid:11), (9a) (9b) where W is a low-rank order-3 tensor of learned parameters, and gfr(f ) and glu((cid:96)) are learned lookup embeddings for the frame and LU. A candidate argument consists of a span and its role label, which in turn depends on the frame, tar- get and LU. Hence the score for argument part, a = (i, j, r) is given by extending definitions from Equation 9: garg(a) = gspan(i, j) ⊗ grole(r), sf(a) =(cid:10)W ⊗ U, gpred(f ) ⊗ garg(a)(cid:11), (10a) (10b) where U is a low-rank order-2 tensor of learned parameters and grole(r) is a learned lookup em- bedding of the role label. 4.3 Dependency Scoring Local scores for dependencies are implemented with two-layer tanh-MLPs, followed by a final linear layer reducing the represenation to a single For example, let u = i→j denote scalar score. an unlabeled arc (ua). Its score is: gua(u) = MLPua(cid:0)[hi; hj](cid:1) sd(u) = wua · gua(u), (11a) (11b) where wua is a vector of learned weights. The scores for other types of parts are computed simi- larly, but with separate MLPs and weights. 4.4 Cross-Task Part Scoring As shown in Figure 2, each cross-task part c con- sists of two first-order parts: a frame argument part a, and an unlabeled dependency part, u. The score for a cross-task part incorporates both: sc (c) =(cid:10)W ⊗ U ⊗ V, gpred(f ) ⊗ garg(a) ⊗ wua ⊗ gua(u)(cid:11), (12) where V is a low-rank order-2 tensor of parame- ters. Following previous work (Lei et al., 2014; Peng et al., 2017), we construct the parameter ten- sors W, U, and V so as to upper-bound their ranks. 5 Training and Inference All parameters from the previous sections are trained using a max-margin training objective (§5.1). For inference, we use a linear program- ming procedure, and a sparsity-promoting penalty term for speeding it up (§5.2). 5.1 Max-Margin Training Let y∗ denote the gold frame-semantic parse, and let δ (y, y∗) denote the cost of predicting y with respect to y∗. We optimize the latent structured hinge loss (Yu and Joachims, 2009), which gives a subdifferentiable upper-bound on δ: L (y∗) = max (y,z)∈Y×Z {S (y, z) + δ (y, y∗)} z∈Z {S (y∗, z)} . − max (13) Following Martins and Almeida (2014), we use a weighted Hamming distance as the cost function, where, to encourage recall, we use costs 0.6 for false negative predictions and 0.4 for false posi- tives. Equation 13 can be evaluated by applying the same max-decoding algorithm twice-once with cost-augmented inference (Crammer et al., 2006), and once more keeping y∗ fixed. Train- ing then aims to minimize the average loss over all training instances.8 Another potential approach to training a model on disjoint data would be to marginalize out the 8We do not use latent frame structures when decoding se- mantic dependency graphs (§3). Hence, the loss reduces to structured hinge (Tsochantaridis et al., 2004) when training on semantic dependencies. latent structures and optimize the conditional log- likelihood (Naradowsky et al., 2012). Although max-decoding and computing marginals are both NP-hard in general graphical models, there are more efficient off-the-shelf implementations for approximate max-decoding, hence, we adopt a max-margin formulation. Inference 5.2 We formulate the maximizations in Equation 13 as 0–1 integer linear programs and use AD3 to solve them (Martins et al., 2011). We only enforce a non-overlapping constraint when de- coding FrameNet structures, so that the argu- ment identification subproblem can be efficiently solved by a dynamic program (Kong et al., 2016; Swayamdipta et al., 2017). When decoding se- mantic dependency graphs, we enforce the deter- minism constraint (Flanigan et al., 2014), where certain labels may appear on at most one arc out- going from the same token. Inference speedup by promoting sparsity. As discussed in §3, even after pruning, the number of within-task parts is linear in the length of the in- put sentence, so the number of cross-task parts is quadratic. This leads to potentially very slow in- ference. We address this problem by imposing an (cid:96)1 penalty on the cross-task part scores: (14) L(cid:0)y∗(cid:1) + λ (cid:88) (cid:12)(cid:12)sc(yi, zj)(cid:12)(cid:12), (yi,zj )∈C where λ is a hyperparameter, set to 0.01 as a prac- tical tradeoff between efficiency and development set performance. Whenever the score for a cross- task part is driven to zero, that part's score no longer needs to be considered during inference. It is important to note that by promoting sparsity this way, we do not prune out any candidate solu- tions. We are instead encouraging fewer terms in the scoring function, which leads to smaller, faster inference problems even though the space of fea- sible parses is unchanged. The above technique is closely related to a line of work in estimating the structure of sparse graph- ical models (Yuan and Lin, 2007; Friedman et al., 2008), where an (cid:96)1 penalty is applied to the inverse covariance matrix in order to induce a smaller number of conditional dependencies between vari- ables. To the best of our knowledge, we are the first to apply this technique to the output of neural scoring functions. Here, we are interested in learn- Train 17,143 19,875 33,961 - FN 1.5 FN 1.7 DM id DM ood Exemplars Dev. 2,333 153,952 2,308 192,460 1,692 - - - Test 4,457 6,722 1,410 1,849 Table 1: Number of instances in datasets. ing sparse graphical models only because they re- sult in faster inference, not because we have any a priori belief about sparsity. This results in roughly a 14× speedup in our experiments, without any significant drop in performance. 6 Experiments Datasets. Our model is evaluated on two differ- ent releases of FrameNet: FN 1.5 and FN 1.7,9 using splits from Swayamdipta et al. (2017). Fol- lowing Swayamdipta et al. (2017) and Yang and Mitchell (2017), each target annotation is treated as a separate training instance. We also include as training data the exemplar sentences, each an- notated for a single target, as they have been re- ported to improve performance (Kshirsagar et al., 2015; Yang and Mitchell, 2017). For semantic de- pendencies, we use the English DM dataset from the SemEval 2015 Task 18 closed track (Oepen et al., 2015).10 DM contains instances from the WSJ corpus for training and both in-domain (id) and out-of-domain (ood) test sets, the latter from the Brown corpus.11 Table 1 summarizes the sizes of the datasets. Baselines. We compare FN performance of our joint learning model (FULL) to two baselines: BASIC: A single-task frame SRL model, trained using a structured hinge objective. NOCTP: A joint model without cross-task parts. It demonstrates the effect of sharing parame- ters in word embeddings and LSTMs (like in FULL). It does not use latent semantic depen- dency structures, and aims to minimize the sum of training losses from both tasks. We also compare semantic dependency parsing performance against the single task model by Peng 9https://FN.icsi.berkeley.edu/ fndrupal/ 10http://sdp.delph-in.net/. The closed track does not have access to any syntactic analyses. The impact of syntactic features on SDP performance is extensively studied in Ribeyre et al. (2015). 11Our FN training data does not overlap with the DM test set. We remove the 3 training sentences from DM which ap- pear in FN test data. Prec. Rec. 68.0 72.2 65.8 75.4 65.5 74.8 75.0 67.3 67.8 71.0 70.5 71.2 77.1 68.7 74.5 78.8 73.5 80.4 80.4 74.7 71.7 79.2 76.9 74.8 Model F 1 Roth 70.0 Tackstrom 70.3 FitzGerald 69.9 FitzGerald (10×) 70.9 69.4 open-SESAME open-SESAME (5×) 70.9 Yang and Mitchell (REL) 72.7 †∗Yang and Mitchell (ALL) 76.6 †This work (FULL) 76.8 †This work (FULL, 2×) 77.4 †This work (BASIC) 75.3 †This work (NOCTP) 75.8 Table 2: FN 1.5 full structure extraction test per- formance. † denotes the models jointly predicting frames and arguments, and other systems imple- ment two-stage pipelines and use the algorithm by Hermann et al. (2014) to predict frames. K× de- notes a product-of-experts ensemble of K mod- els. ∗Ensembles a sequential tagging CRF and a relational model. Bold font indicates best perfor- mance among all systems. strategies. For et al. (2017), denoted as NeurboParser (BASIC). To ensure fair comparison with our FULL model, we made several modifications to their implemen- tation (§6.3). We observed performance improve- ments from our reimplementation, which can be seen in Table 5. Pruning frame SRL, we discard argument than 20 to- kens (Swayamdipta et al., 2017). We further pretrain an unlabeled model and prune spans with posteriors lower than 1/n2, with n being the input sentence length. For semantic dependencies, we generally follow Martins and Almeida (2014), replacing their feature-rich pruner with neural net- works. We observe that O(n) spans/arcs remain after pruning, with around 96% FN development recall, and more than 99% for DM.12 longer spans 6.1 Empirical Results FN parsing results. Table 2 compares our full frame-semantic parsing results to previous sys- tems. Among them, Tackstrom et al. (2015) and Roth (2016) implement a two-stage pipeline and use the method from Hermann et al. (2014) to predict frames. FitzGerald et al. (2015) uses the 12On average, around 0.8n argument spans, and 5.7n un- labeled dependency arcs remain after pruning. - - All Ambiguous 87.6 88.2 88.4 89.2 89.2 89.9 90.0 Model Hartmann Yang and Mitchell Hermann †This work (BASIC) †This work (NOCTP) †This work (FULL) †This work (FULL, 2×) Table 3: Frame identification accuracy on the FN 1.5 test set. Ambiguous evaluates only on lexical units having more than one possible frames. † de- notes joint frame and argument identification, and bold font indicates best performance.13 73.1 76.3 76.4 77.7 78.0 same pipeline formulation, but improves the frame identification of Hermann et al. (2014) with better syntactic features. open-SESAME (Swayamdipta et al., 2017) uses predicted frames from FitzGer- ald et al. (2015), and improves argument identi- fication using a softmax-margin segmental RNN. They observe further improvements from product of experts ensembles (Hinton, 2002). The best published FN 1.5 results are due to Yang and Mitchell (2017). Their relational model (REL) formulates argument identification as a sequence of local classifications. They ad- ditionally introduce an ensemble method (denoted as ALL) to integrate the predictions of a sequen- tial CRF. They use a linear program to jointly pre- dict frames and arguments at test time. As shown in Table 2, our single-model performance outper- forms their REL model, and is on par with their ALL model. For a fair comparison, we build an ensemble (FULL, 2×) by separately training two models, differing only in random seeds, and aver- aging their part scores. Our ensembled model out- performs previous best results by 0.8% absolute. Table 3 compares our frame identification re- sults with previous approaches. Hermann et al. (2014) and Hartmann et al. (2017) use distributed word representations and syntax features. We fol- low the FULL LEXICON setting (Hermann et al., 2014) and extract candidate frames from the offi- 13Our comparison to Hermann et al. (2014) is based on their updated version: http://www.aclweb.org/ anthology/P/P14/P14-1136v2.pdf. Ambiguous frame identification results by Yang and Mitchell (2017) and Hartmann et al. (2017) are 75.7 and 73.8. Their ambiguous lexical unit sets are different from the one extracted from the official frame directory, and thus the results are not compara- ble to those in Table 3. F 1 75.0 75.9 76.4 Full Structure Prec. Rec. 72.1 78.0 79.8 72.4 72.9 80.2 Frame Id. Model All Amb. BASIC 76.6 88.6 NOCTP 88.5 76.3 77.5 89.1 FULL Table 4: FN 1.7 full structure extraction and frame identification test results. Bold font indicates best performance. FN 1.7 test set is an extension of FN 1.5 test, hence the results here are not comparable to those reported in Table 2. id F 1 89.4 90.4 90.0 89.9 90.5 91.2 ood F 1 Model 84.5 NeurboParser (BASIC) 85.3 NeurboParser (FREDA3) 84.6 NeurboParser (BASIC, reimpl.) 85.2 This work (NOCTP) 85.9 This work (FULL) This work (FULL, 2×) 86.6 Table 5: Labeled parsing performance in F1 score id denotes in- for DM semantic dependencies. domain WSJ test data, and ood denotes out-of- domain brown corpus test data. Bold font indi- cates best performance. cial directories. The Ambiguous setting compares lexical units with more than one possible frames. Our approach improves over all previous models under both settings, demonstrating a clear benefit from joint learning. We observe similar trends on FN 1.7 for both full structure extraction and for frame identifica- tion only (Table 4). FN 1.7 extends FN 1.5 with more consistent annotations. Its test set is different from that of FN 1.5, so the results are not directly comparable to Table 2. We are the first to report frame-semantic parsing results on FN 1.7, and we encourage future efforts to do so as well. Semantic dependency parsing results. Table 5 compares our semantic dependency parsing per- formance on DM with the baselines. Our reim- plementation of the BASIC model slightly im- proves performance on in-domain test data. The NOCTP model ties parameters from word embed- dings and LSTMs when training on FrameNet and DM, but does not use cross-task parts or joint pre- diction. NOCTP achieves similar in-domain test performance, and improves over BASIC on out- of-domain data. By jointly predicting FrameNet Operation Description Frame error Frame misprediction. Role error Matching span with incorrect role. Span error Matching role with incorrect Arg. error span. Predicted argument does not overlap with any gold span. Rel. Err. (%) BASIC FULL 11.3 12.6 (5.2) 11.1 13.4 (5.9) 11.4 12.3 18.6 22.4 Missing arg. Gold argument does not overlap with any predicted span. 43.5 38.0 Table 6: Percentage of errors made by BASIC and FULL models on the FN 1.5 development set. Parenthesized numbers show the percentage of role errors when frame predictions are correct. structures and semantic dependency graphs, the FULL model outperforms the baselines by more than 0.6% absolute F1 scores under both settings. Previous state-of-the-art results on DM are due to the joint learning model of Peng et al. (2017), denoted as NeurboParser (FREDA3). They adopted a multitask learning approach, jointly pre- dicting three different parallel semantic depen- dency annotations. Our FULL model's in-domain test performance is on par with FREDA3, and im- proves over it by 0.6% absolute F1 on out-of- domain test data. Our ensemble of two FULL models achieves a new state-of-the-art in both in- domain and out-of-domain test performance. 6.2 Analysis Error type breakdown. Similarly to He et al. (2017), we categorize prediction errors made by the BASIC and FULL models in Table 6. Entirely missing an argument accounts for most of the er- rors for both models, but we observe fewer er- rors by FULL compared to BASIC in this category. FULL tends to predict more arguments in general, including more incorrect arguments. Since candidate roles are determined by frames, frame and role errors are highly correlated. There- fore, we also show the role errors when frames are correctly predicted (parenthesized numbers in the second row). When a predicted argument span matches a gold span, predicting the semantic role is less challenging. Role errors account for only around 13% of all errors, and half of them are due to mispredictions of frames. Performance by argument length. Figure 3 plots dev. precision and recall of both BASIC and FULL against binned argument lengths. We ob- Hyperparameter Word embedding dimension Lemma embedding dimension POS tag embedding dimension MLP dimension Tensor rank r BiLSTM layers BiLSTM dimensions α for word dropout Value 100 (32) 50 (16) 50 (16) 100 (32) 100 (32) 2 (1) 200 (64) 1.0 (1.0) Table 7: Hyperparameters used in the experiments. Parenthesized numbers indicate those used by the pretrained pruners. penalty of 10−6 is applied to all weights. See Ta- ble 7 for other hyperparameters. Modifications to Peng et al. (2017). To ensure fair comparisons, we note two implementation modifications to Peng et al.'s basic model. We use a more recent version (2.0) of the DyNet toolkit, and we use 50-dimensional lemma embeddings in- stead of their 25-dimensional randomly-initialized learned word embeddings. 7 Conclusion We presented a novel multitask approach to learn- ing semantic parsers from disjoint corpora with structurally divergent formalisms. We showed how joint learning and prediction can be done with scoring functions that explicitly relate spans and dependencies, even when they are never ob- served together in the data. We handled the re- sulting inference challenges with a novel adapta- tion of graphical model structure learning to the deep learning setting. We raised the state-of- the-art on DM and FrameNet parsing by learn- ing from both, despite their structural differ- ences and non-overlapping data. While our selection of factors is specific to spans and dependencies, our general techniques could be adapted to work with more combinations of struc- tured prediction tasks. We have released our implementation at https://github.com/ Noahs-ARK/NeurboParser. Acknowledgments We thank Kenton Lee, Luheng He, and Rowan Zellers for their helpful comments, and the anony- mous reviewers for their valuable feedback. This work was supported in part by NSF grant IIS- 1562364. Figure 3: FN 1.5 development precision and re- call of BASIC and FULL by different argument lengths. Length (cid:96) is binned to (cid:98)log1.6 (cid:96)(cid:99), and precision/recall values are smoothed with loess, with a smoothing parameter of 0.1. serve two trends: (a) FULL tends to predict longer arguments (averaging 3.2) compared to BASIC (averaging 2.9), while keeping similar precision;14 (b) recall improvement in FULL mainly comes from arguments longer than 4. Implementation Details 6.3 Our implementation is based on DyNet (Neubig et al., 2017).15 We use predicted part-of-speech tags and lemmas using NLTK (Bird et al., 2009).16 Parameters are optimized with stochastic sub- gradient descent for up to 30 epochs, with (cid:96)2 norms of gradients clipped to 1. We use 0.33 as initial learning rate, and anneal it at a rate of 0.5 every 10 epochs. Early stopping is applied based on FN development F1. We apply logarithm with base 2 to all discrete features, e.g., log2(d + 1) for distance feature valuing d. To speed up training, we randomly sample a 35% subset from the FN exemplar instances each epoch. Hyperparameters. Each input token is repre- sented as the concatenation a word embedding vector, a learned lemma vector, and a learned vec- tor for part-of speech, all updated during train- ing. We use 100-dimensional GloVe (Pennington et al., 2014) to initialize word embeddings. We ap- ply word dropout (Iyyer et al., 2015) and randomly replace a word w with a special UNK symbol with probability 1+#(w), with #(w) being the count of w in the training set. We follow the default param- eters initialization procedure by DyNet, and an (cid:96)2 α 14Average gold span length is 3.4 after discarding those longer than 20. 15https://github.com/clab/dynet 16http://www.nltk.org/ 01234560.20.40.60.81.0Binned Argument LengthPrecision/RecallBasic PrecisionBasic RecallFull PrecisionFull Recall References Apoorv Agarwal, Sriramkumar Balasubramanian, Anup Kotalwar, Jiehan Zheng, and Owen Rambow. 2014. Frame semantic tree kernels for social net- work extraction from text. In Proc. of EACL. Collin F. Baker, Charles J. Fillmore, and John B. Lowe. In Proc. 1998. The Berkeley FrameNet project. ACL. Laura Banarescu, Claire Bonial, Shu Cai, Madalina Georgescu, Kira Griffitt, Ulf Hermjakob, Kevin Knight, Philipp Koehn, Martha Palmer, and Nathan Schneider. 2013. Abstract meaning representation for sembanking. In Proc. LAW-ID. Steven Bird, Ewan Klein, and Edward Loper. 2009. Natural Language Processing with Python: Ana- lyzing Text with the Natural Language Toolkit. " O'Reilly Media, Inc.". Yun-Nung Chen, William Yang Wang, and Alexander I Rudnicky. 2013. Unsupervised induction and filling of semantic slots for spoken dialogue systems using frame-semantic parsing. In Proc. of ASRU-IEEE. Michael Collins. 2003. Head-driven statistical models for natural language parsing. Computational Lin- guistics 29(4):589–637. Ronan Collobert and Jason Weston. 2008. A unified architecture for natural language processing: Deep In Proc. neural networks with multitask learning. ICML. Ann Copestake, Dan Flickinger, Ivan A. Sag, and Carl Pollard. 2005. Minimal recursion semantics: An in- troduction. Research on Language & Computation 3(4):281–332. Bob Coyne, Alex Klapheke, Masoud Rouhizadeh, Richard Sproat, and Daniel Bauer. 2012. Annota- tion tools and knowledge representation for a text- to-scene system. In Proc. of COLING. Koby Crammer, Ofer Dekel, Joseph Keshet, Shai Shalev-Shwartz, and Yoram Singer. 2006. Online passive-aggressive algorithms. JMLR 7:551–585. Dipanjan Das, Nathan Schneider, Desai Chen, and Noah A. Smith. 2010. Probabilistic frame-semantic parsing. In Proc. of NAACL. Charles Fillmore. 1982. Frame semantics. Linguistics in the morning calm pages 111–137. Nicholas FitzGerald, Oscar Tackstrom, Kuzman Ganchev, and Dipanjan Das. 2015. Semantic role In Proc. of labeling with neural network factors. EMNLP. Daniel Flickinger, Yi Zhang, and Valia Kordoni. 2012. DeepBank: A dynamically annotated treebank of the Wall Street Journal. In Proc. of TLT. pages 85–96. Jerome Friedman, Trevor Hastie, and Robert Tibshi- rani. 2008. Sparse inverse covariance estimation with the graphical lasso. Biostatistics 9(3):432–441. Daniel Gildea and Daniel Jurafsky. 2002. Automatic labeling of semantic roles. Computational Linguis- tics 28(3):245–288. Alex Graves. 2012. Supervised Sequence Labelling with Recurrent Neural Networks, volume 385 of Studies in Computational Intelligence. Springer. Jan Hajic, Eva Hajicov´a, Jarmila Panevov´a, Petr Sgall, Ondrej Bojar, Silvie Cinkov´a, Eva Fuc´ıkov´a, Marie Mikulov´a, Petr Pajas, Jan Popelka, Jir´ı Semeck´y, Jana Sindlerov´a, Jan Step´anek, Josef Toman, Zdenka Uresov´a, and Zdenek Zabokrtsk´y. 2012. Announcing Prague Czech-English depen- dency treebank 2.0. In Proc. of LREC. Silvana Hartmann, Ilia Kuznetsov, Teresa Martin, and Iryna Gurevych. 2017. Out-of-domain FrameNet semantic role labeling. In Proc. of EACL. Luheng He, Kenton Lee, Mike Lewis, and Luke Zettle- moyer. 2017. Deep semantic role labeling: What works and whats next. In Proc. of ACL. Luheng He, Mike Lewis, and Luke S. Zettlemoyer. 2015. Question-answer driven semantic role label- ing: Using natural language to annotate natural lan- guage. In Proc. of EMNLP. Karl Moritz Hermann, Dipanjan Das, Jason Weston, and Kuzman Ganchev. 2014. Semantic frame iden- tification with distributed word representations. In Proc. of ACL. Geoffrey E. Hinton. 2002. Training products of experts by minimizing contrastive divergence. Neural Com- putation 14(8):1771–1800. Sepp Hochreiter and Jurgen Schmidhuber. 1997. Long Short-Term Memory. Neural Computation 9(8):1735–1780. Mohit Iyyer, Varun Manjunatha, Jordan Boyd-Graber, and Hal Daum´e III. 2015. Deep unordered compo- sition rivals syntactic methods for text classification. In Proc. of ACL. Richard Johansson and Pierre Nugues. 2007. LTH: Se- mantic structure extraction using nonprojective de- pendency trees. In Proc. of SemEval. Lingpeng Kong, Chris Dyer, and Noah A. Smith. 2016. In Proc. of Segmental recurrent neural networks. ICLR. Jeffrey Flanigan, Sam Thomson, Jaime Carbonell, Chris Dyer, and Noah A. Smith. 2014. A discrim- inative graph-based parser for the abstract meaning representation. In Proc. ACL. Meghana Kshirsagar, Sam Thomson, Nathan Schnei- der, Jaime Carbonell, Noah A. Smith, and Chris Dyer. 2015. Frame-semantic role labeling with het- erogeneous annotations. In Proc. ACL. Corentin Ribeyre, ´Eric Villemonte De La Clergerie, and Djam´e Seddah. 2015. Because Syntax does Matter: Improving Predicate-Argument Structures In Proc. of Parsing Using Syntactic Features. NAACL. Michael Roth. 2016. Improving frame semantic pars- In Book of ing via dependency path embeddings. Abstracts of the 9th International Conference on Construction Grammar. Dan Shen and Mirella Lapata. 2007. Using semantic In Proc. of roles to improve question answering. EMNLP-CoNLL. Anders Søgaard and Yoav Goldberg. 2016. Deep multi-task learning with low level tasks supervised at lower layers. In Proc. of ACL. Mihai Surdeanu, Richard Johansson, Adam Meyers, Llu´ıs M`arquez, and Joakim Nivre. 2008. The CoNLL-2008 shared task on joint parsing of syntac- tic and semantic dependencies. In Proc. of CoNLL. Swabha Swayamdipta, Sam Thomson, Chris Dyer, and Noah A. Smith. 2017. Frame-semantic parsing with softmax-margin segmental RNNs and a syntactic scaffold. arXiv:1706.09528. Oscar Tackstrom, Kuzman Ganchev, and Dipanjan Das. 2015. Efficient inference and structured learn- ing for semantic role labeling. TACL 3:29–41. Kristina Toutanova, Aria Haghighi, and Christopher D. Manning. 2008. A global joint model for semantic role labeling. Computational Linguistics 34(2):161– 191. Ioannis Tsochantaridis, Thomas Hofmann, Thorsten Joachims, and Yasemin Altun. 2004. Support vector machine learning for interdependent and structured output spaces. In Proc. of ICML. Bishan Yang and Tom Mitchell. 2017. A joint sequen- tial and relational model for frame-semantic parsing. In Proc. of EMNLP. Chun-Nam John Yu and Thorsten Joachims. 2009. Learning structural SVMs with latent variables. In Proc. of ICML. Ming Yuan and Yi Lin. 2007. Model selection and esti- mation in the gaussian graphical model. Biometrika 94(1):19–35. Kenton Lee, Luheng He, Mike Lewis, and Luke Zettle- moyer. 2017. End-to-end neural coreference resolu- tion. In Proc. of EMNLP. Tao Lei, Yu Xin, Yuan Zhang, Regina Barzilay, and Tommi Jaakkola. 2014. Low-rank tensors for scor- ing dependency structures. In Proc. ACL. Xavier Llu´ıs, Xavier Carreras, and Llu´ıs M`arquez. 2013. Joint arc-factored parsing of syntactic and se- mantic dependencies. TACL 1:219–230. Andr´e F. T. Martins and Mariana S. C. Almeida. 2014. Priberam: A turbo semantic parser with second or- der features. In Proc. of SemEval. Andr´e F. T. Martins, Noah A. Smith, Pedro M. Q. Aguiar, and M´ario A. T. Figueiredo. 2011. Dual de- composition with many overlapping components. In Proc. of EMNLP. Jason Naradowsky, Sebastian Riedel, and David A. Smith. 2012. Improving NLP through marginaliza- tion of hidden syntactic structure. In Proc. EMNLP. Graham Neubig, Chris Dyer, Yoav Goldberg, Austin Matthews, Waleed Ammar, Antonios Anastasopou- los, Miguel Ballesteros, David Chiang, Daniel Clothiaux, Trevor Cohn, Kevin Duh, Manaal Faruqui, Cynthia Gan, Dan Garrette, Yangfeng Ji, Lingpeng Kong, Adhiguna Kuncoro, Gau- rav Kumar, Chaitanya Malaviya, Paul Michel, Yusuke Oda, Matthew Richardson, Naomi Saphra, Swabha Swayamdipta, and Pengcheng Yin. 2017. DyNet: The dynamic neural network toolkit. arXiv:1701.03980. Stephan Oepen, Marco Kuhlmann, Yusuke Miyao, Daniel Zeman, Silvie Cinkova, Dan Flickinger, Jan Hajic, and Zdenka Uresova. 2015. SemEval 2015 task 18: Broad-coverage semantic dependency pars- ing. In Proc. of SemEval. Stephan Oepen, Marco Kuhlmann, Yusuke Miyao, Daniel Zeman, Silvie Cinkov´a, Dan Flickinger, Jan Hajic, Angelina Ivanova, and Zdenka Uresov´a. 2016. Towards comparability of linguistic graph banks for semantic parsing. In Proc. of LREC. Stephan Oepen, Marco Kuhlmann, Yusuke Miyao, Daniel Zeman, Dan Flickinger, Jan Hajic, Angelina Ivanova, and Yi Zhang. 2014. SemEval 2014 task 8: Broad-coverage semantic dependency parsing. In Proc. of SemEval. Martha Palmer, Daniel Gildea, and Paul Kingsbury. 2005. The proposition bank: An annotated corpus of semantic roles. Computional Linguistics 31(1):71– 106. Hao Peng, Sam Thomson, and Noah A. Smith. 2017. Deep multitask learning for semantic dependency parsing. In Proc. of ACL. Jeffrey Pennington, Richard Socher, and Christo- pher D. Manning. 2014. GloVe: Global vectors for word representation. In Proc. of EMNLP.
1511.06066
1
1511
2015-11-19T05:54:45
Transfer Learning for Speech and Language Processing
[ "cs.CL", "cs.LG" ]
Transfer learning is a vital technique that generalizes models trained for one setting or task to other settings or tasks. For example in speech recognition, an acoustic model trained for one language can be used to recognize speech in another language, with little or no re-training data. Transfer learning is closely related to multi-task learning (cross-lingual vs. multilingual), and is traditionally studied in the name of `model adaptation'. Recent advance in deep learning shows that transfer learning becomes much easier and more effective with high-level abstract features learned by deep models, and the `transfer' can be conducted not only between data distributions and data types, but also between model structures (e.g., shallow nets and deep nets) or even model types (e.g., Bayesian models and neural models). This review paper summarizes some recent prominent research towards this direction, particularly for speech and language processing. We also report some results from our group and highlight the potential of this very interesting research field.
cs.CL
cs
Transfer Learning for Speech and Language Processing Dong Wang and Thomas Fang Zheng 1. Center for Speech and Language Technologies (CSLT) Research Institute of Information Technology, Tsinghua University 2. Tsinghua National Lab for Information Science and Technology Beijing, 100084, P.R.China 5 1 0 2 v o N 9 1 ] L C . s c [ 1 v 6 6 0 6 0 . 1 1 5 1 : v i X r a Abstract—Transfer learning is a vital technique that gener- alizes models trained for one setting or task to other settings or tasks. For example in speech recognition, an acoustic model trained for one language can be used to recognize speech in another language, with little or no re-training data. Transfer learning is closely related to multi-task learning (cross-lingual vs. multilingual), and is traditionally studied in the name of ‘model adaptation’. Recent advance in deep learning shows that transfer learning becomes much easier and more effective with high-level abstract features learned by deep models, and the ‘transfer’ can be conducted not only between data distributions and data types, but also between model structures (e.g., shallow nets and deep nets) or even model types (e.g., Bayesian models and neural models). This review paper summarizes some recent prominent research towards this direction, particularly for speech and language processing. We also report some results from our group and highlight the potential of this very interesting research field1. I. INTRODUCTION Machine learning (ML) techniques have been extensively exploited in modern speech and language processing re- search [1], [2], [3]. Among the rich family of ML models and algorithms, transfer learning is among the most interesting. Generally speaking, transfer learning involves all methods that utilize any auxiliary resources (data, model, labels, etc.) to enhance model learning for the target task [4], [5], [6], [7]. This is very important for speech and language research, since human speech and languages are so diverse and imbalanced. There are more than 5, 000 languages around the world, and the number is even bigger if dialects are counted. Among this big family, 389 languages (nearly 6%) account for 94% of the word’s population, and the rest thousands languages are spoken by very few people.2 Even for the 389 ‘big’ languages, only very few possess adequate resources (speech signal, lexicon, phonetic/syntactic regulations, etc.) for speech and language research. If we talk about ‘rich- resource’ languages, perhaps only English is in that category. Additionally, resources in different domains are also highly imbalanced, even for English. This means that almost all research in speech and language confront the challenge of data sparsity. More seriously, human language is such dynamic that new words and domains emerge every day, and so no models learned at a particular time will remain valid forever. text corpus, With such diversity, variation, imbalance and dynamics, it is almost impossible for speech and language researchers to 1This survey will be continuously updated online () to reflect the recent progress on transfer learning. 2https://www.ethnologue.com/statistics learn a model from one single data resource and then put it on the shelf. We have to resort to some more smart algorithms that can learn from multiple languages, multiple data, multiple domains and keep the model adapted. On the other hand, it would not be very controversial to argue that human speech and languages hold some common statistical patterns at both the signal and symbolic levels, so that learning from multiple resources is possible. In fact, transfer learning has been studied for a long time in a multitude of research fields in speech and language processing, e.g., speaker adaptation and multilingual modeling in speech recognition, cross-language document classification and sentiment analysis. Most of the studies, however, are task-driven in their own research fields and seldom hold deep understanding about the position of their research in the whole picture of transfer learning. This prevents researchers from answering some important questions: how and in which conditions their methods work, what are possible alternatives of their methods, and what advantages can be achieved with different alternatives? In this paper, we will give a brief summary of the most promising transfer learning methods, particularly within the modern deep learning paradigm. Special focus will be put on the application of transfer learning in speech and language processing, and some recent results from our research team will be presented. We highlight that it is not our goal to present an entire list of the transfer learning methods in this paper. Instead, the focus is put on the most promising approaches for speech and language processing. Even with such a constraint, the work on transfer learning is still too much to be enumerated, and we can only touch a small part of the plenty techniques. We decide to focus on two specific domains: speech recognition and document classification, particularly the most recent advances based on deep learning which is most relevant to our research. For more detailed surveys on transfer learning in broad research fields, readers are referred to the nice review articles from Pan, Taylor, Bengio and Lu [4], [5], [6], [7] and the references therein. The paper is organized as follows: Section II gives a quick review of the transfer learning approach, and Section III and Section IV discuss application of transfer learning in speech processing and language processing respectively. The paper is concluded in Section V, with some discussions for the future research directions in this very promising field. II. TRANSFER LEARNING: A QUICK REVIEW The motivation of transfer learning can be found in the idea of ”Learning to Learn”, which stats that learning from scratch (tabula rasa learning) is often limited, and so past experience should be used as much as possible [8]. For instance, once we learned that a hard apple is often sour, this experience can be used when we select pears: we conjecture that hard pears are also sour. This idea and associated research trace back to 20 years ago and were summarized in the NIPS 95 work- shop on ‘Learning to Learn: Knowledge Consolidation and Transfer in Inductive Systems’ [9]. Many ideas and research goals raised in that workshop last two decades and influence our research till today, though the data, models, algorithms, computing power have dramatically changed. Some of the recent developments were discussed in several workshops, e.g., the ICML 2011 workshop on unsupervised and transfer learning3; the NIPS 2013 workshop on new directions in transfer and multitask4; the ICDM 2015 workshop on practical transfer learning5. In this section, we review some of the most prominent approaches to transfer learning, particularly those have been applied to or are potential for speech and language processing. A. Categories of transfer learning The initial idea of transfer learning is to reuse the experi- ence/knowledge obtained already to enhance learning for new things. Depending on the relation of the ‘old things’ (source) that we have learned and the ‘new things’ (target) that we want to learn, a large amount of methods have been devised, in different names by different authors. A short list of these names include multitask learning, lifelong learning, knowledge transfer, knowledge consolidation, model adaptation, concept drift, covariance shift, etc. Different researchers hold different views for the categorization of these methods. For example, Pan and Yang [4] believed transfer learning should really ‘transfer’ something so multitask learning should be regarded as a different approach, while Bengio [6] treated transfer learning and multitask learning as synonyms. In our opinion, the different learning methods mentioned above can be regarded as particular implementations of trans- fer learning applied in different conditions or by different ways. For example, model adaptation is applied to conditions where the data distributions of the source and target domains are clearly different, while covariance drift is applied to con- ditions where the distribution changes gradually. As another example, knowledge transfer is applied to the condition where the source model and target model are trained sequentially, while multi-task learning is applied to the condition where the source and target models are trained simultaneously. No matter what forms and properties the learning methods hold, what they all have in common is ‘the attempt to transfer knowledge from other sources to benefit the current inductive task’, and the benefit of the transfer involves faster convergence, more robust models and less data sensitivity. We can thus categorize transfer learning into several classes according to the conditions that they apply to. Following the 3http://clopinet.com/isabelle/Projects/ICML2011/ 4https://sites.google.com/site/learningacross/ 5https://sites.google.com/site/icdmwptl2015/home taxonomy in [4], we use data and task as two conditional factors of transfer learning. For the data condition, it involves the feature space X (e.g., audio or text) and the distribution P (X) of the feature (e.g., financial news and scientific papers); for the task condition, it involves the label space Y (e.g., speech phones or speaker identity) and the model M (x) (e.g., probabilistic models or neural models). Any of the two components of the two conditional factors can be the same or different for the learning in the source and target domains, and their relation is shown in Fig. 1. Note that if the feature space is different for the source and target domains, then their distributions are certainly different. Similarly, if the labels are different, then the models are regarded as different, although models from the same family might be used in the source and target domains. 1 M1(x) M2(x) 1 P1(x) 2 2 P2(x) Fig. 1. Relation of the conditional factors in the transfer learning paradigm. X1 and Y1 are the feature and label spaces respectively for the learning task in the source domain, and X2 and Y2 are for the learning task in the target domain. M1(x) and M2(x) represent the models in the source and target domains, respectively. According to whether the conditional factors (data and task) of the learning in the source and target domains are different or not, transfer learning methods can be categorized into several classes. Table I shows some of the most popular transfer learning approaches that are applicable in different conditions. In the table, ‘+’ means the corresponding conditional factor is the same for the source and target domains, while ‘-’ means different. Note that transfer learning is such a large research field and it is impossible to classify all the methods in such a simple way. For example, an important factor that discriminates different learning methods is whether or not the data in the source and target domains are labelled, which is not clearly reflected in the table (though we will discuss the related issue in the next section). Anyway, Table I gives a rough picture how big the family of transfer learning methods and how they can be categorized according to the conditional factors. B. Transfer learning methods We give a short description of the learning methods ap- pearing in Table I. For each method, only the general idea is presented, and application of these methods to speech and language processing is left to the next sections. 1) Model adaptation and incremental training: The sim- plest transfer learning is to adapt an existing model to meet the change of data distribution. Both the feature and label spaces are the same for the source and target domains, and the models are the same. There are various approaches for TABLE I CATEGORIES OF TRANSFER LEARNING M(x)+ Y+ M(x) - Y − X + P(X)+ X − P(X)- Model Adaptation[12], [13], incremental learning[14] Conventional ML Model transfer[10] Multitask learning[11] Co-training[15] Heterogeneous transfer learning[16], [17] Analogy learning [18] model adaptation. For example, the maximum a posterior (MAP) [12] estimation and the maximum likelihood linear regression (MLLR) algorithm [13]. If the distribution changes gradually, then incremental or online learning is often used, e.g. [14], [19], [20]. Note that the adaptation can be either supervised or unsuper- vised. In the supervised learning, the data in the target domain are labelled, while in the unsupervised learning, no labels are available and they have to be generated by the model in the source domain before the adaptation can be performed. The latter case is often referred to as semi-supervised learning [21]. Note that semi-supervised learning is a general framework to deal with unlabelled data, and can be applied to any conditions where the label spaces are the same in the source and target domains. We will come back to this method in heterogeneous transfer learning that will be discussed shortly. Another approach to dealing with unlabelled data is to use them to derive new features (e.g., by linear projection) where the distributions of the data in the source domain and the target domain are close to each other. An interesting work towards this direction is the approach based on transfer component analysis (TCA) [22]. In another configuration, some unlabelled data are available but the distribution is different from that of the target domain. These data cannot be used for adaptation (either by semi- supervised learning or TCA) otherwise the model will be adapted to a biased condition. However, it can be used to assist deriving more robust features. The idea is similar to TCA, but the unlabelled data are not used as supervision about the target domain, instead as an auxiliary information to derive more domain-independent features. This approach is often referred to as self-taught learning [23], and it essentially holds the same idea as the more recent deep representation learning that will be discussed in Section II-C. 2) Heterogeneous transfer learning: A more complex transfer learning scenario is to keep the labels and model unchanged, however the features are different in the source and target domains. The transfer learning in this scenario is often called heterogeneous transfer learning. The basic assumption for heterogeneous transfer learning is that some correspondence between the source and target domains exist, and this correspondence can be used to transfer knowledge in one domain to another. For example, speech and text are two domains, and there is clear correspondence between the two domains based on human concepts: no matter we speak or write ‘chicken’, it is clear that we refer to the same bird that has wings but can not fly much. The early research tried to define and utilize the correspon- dence between the instances of the source and target domains. For example, [24] employed an oracle word translator to define some pivot words that were used to establish the cross- domain correspondence by learning multiple linear classifiers that predict the ‘joint existence’ of these words in the multi- domain data. In [25] some instance-level co-occurrence data were used to estimate the correspondence in the form of joint or conditional probabilities; this correspondence was then used to improve the model in the target domain by risk- minimization inference. Asymmetric regularized cross-domain transformation was proposed in [26], which tries to learn a non-linear transform between the source and target domains by class-labeled instances from both source and target domains. Although an instance does not necessarily possess features of both domains, the class labels offer the correspondence information. More recent approaches prefer to finding common represen- tations of the source and target domains, for example by matrix factorization [17], RBM-based latent factor learning [27], or joint transfer optimization [28], [16], [29]. More recently, deep learning and heterogeneous transfer learning are combined where high-level features are derived by deep learning and inter-domain transforms are learned by transfer learning [30]. We emphasize that most of the approaches discussed above assume that the label space does not change when transferring from the source domain to the target domain. A more ambi- tious task is to learn from very different tasks for which the label space is different from the target domain. For example, the task in the source domain is to classify document senti- ment, while in the target domain the task is to classify image aesthetic value. This two tasks are fundamentally different, however some analogy does exist between them. Learning cor- respondence between two independent but analogous domains is easy for humans [31], [32], [33], however it is very difficult for machines. There has been long-term interest in analogy learning among artificial intelligence researchers, e.g., [34], [18], though not too much achievement yet. Interestingly, the recent improvement in deep learning methods seems provide more hope in this direction, by a unified framework for representation learning and multitask learning. This will be discussed in Section II-C. 3) Multiview co-training: A special case of heterogeneous transfer learning is the multi-view co-training, which assumes that each training instance involves features of both the source and target domains, but only the feature in the target domain is available at runtime. In this condition, heterogeneous transfer learning is not very effective since the training instances in the source domain are the same as the instances in the target domain and so does not provide much additional information, at least with supervised learning. However, the multi-view property of the training data indeed can be used to improve unsupervised learning with unlabelled data, by the approach called co-training [15]. Specifically, co-training trains two separate models with features of the source and target domains respectively, and then generates labels for the unlabelled data using one model, which are in turn used to update the other model. This process iterates until convergence is obtained. It is well-known that co-training leads to better models than training with the feature of the target domain only. 4) Model transfer: If the feature and label spaces are the same however the models are different for the source and target domains, the knowledge learned by the source model can be transferred to the target model by model transfer. For example, in the source domain the model is a Gaussian mixture model (GMM), while in the target domain the model is a deep neural network (DNN). The transfer learning then exploits the GMM to initialize and boost the DNN. This is the general recipe in the modern DNN-based speech recognition system. Recently, this model transfer has gained much attention in the deep learning community. For example, it is possible to learn simple neural nets from a complex DNN model, or vice versa [10], [35], [36]. Some interesting work in this direction will be presented in the next sections. 5) Multitask learning: In the case where the feature spaces of the source and target domains are the same but the task labels are significantly different, multitask learning is more applicable [11], [37], [38]. The basic assumption of this learning approach is that tasks are closely related, either positively or negatively, so that learning for one task helps learning the other in the form of mutual regularization. Multitask learning is a general approach that can be applied to boost various types of models including kernel regression, k-nearest neighbour, and it can be even employed to learn ‘opposite’ tasks simultaneously, e.g., text content classification and emotion detection [39]. the source and target A particular issue of multitask learning is how to evaluate the relevance of two tasks so that whether they can be learned together can be determined. Although there is not a simple solution yet, [38] indeed provided an interesting approach that estimates the relevance between tasks by evaluating the overlap of different tasks in the same semantic space. C. Transfer learning in deep learning era Deep learning almost changed everything, including transfer learning. Because deep learning gains so much success in speech and language processing [40], [41], [42], [43], we put more emphasis on transfer learning methods based on deep models in this paper. Roughly speaking, deep learning consists of various models that involve multi-level represen- tations and the associated training/inference algorithms. Typ- ical deep models include deep belief networks (DBNs) [44], deep Boltzmann machines (DBMs) [45], deep auto encoders (DAEs) [46], [47], deep neural networks (DNNs) [48], [41] and deep recurrent neural networks (RNNs) [49]. The success of deep models is largely attributed to their capability of learning multi-level representations (features), which simulates the processing pipeline of human brains where information is processed in a hierarchical way. The multi-level feature learning possesses several advantages. First, it can learn high-level features which are more robust against data variation than features at low-levels; second, it offers a hierarchal parameter sharing that holds great expressive power [50]; third, the feature learning can be easily conducted without any labelled data and so is cheap; fourth, with a little supervised training (fine-tuning), the learned models can be well adapted to specific tasks [11], [51], [52]. For these reasons, deep learning provides a graceful frame- work for transfer learning, which unifies almost all the ap- proaches listed in Table I as representation learning. The basic idea is to learn some high-level robust features that are shared by multiple features and multiple tasks, so that all the knowl- edge/model transfers are implemented as feature transfer. This approach was advocated in the NIPS95 workshop as a major research direction, but it was not such successful until deep learning became a main stream in machine learning and related fields [53], [6], [54], [55]. The transfer learning architecture based on deep representa- tion learning is illustrated in Fig.2. The left part of this figure is the joint training phase where heterogeneous input features are projected onto a common semantic space by different pre-processing networks, and the shared features involve rich explanatory factors that can be used to perform multiple tasks. The right part of the picture illustrates the adaptation phase, where some data X2 for the target task Y2 have been provided, either with or without labels, and the model is updated with the new data which follows a distribution P ′ 2(x) that is different from the original distribution P2(x) in the joint training phase. 1 2 1 P1(x) 2 P2(x) 1 1 2 2 P'2(x) Fig. 2. Transfer learning architecture with deep representation learning. X1 and Y1 are the feature and label spaces respectively for the learning task in the source domain, and X2 and Y2 are for the learning task in the target domain. At the runtime, only the target domain is concerned. The framework in Fig. 2 is very flexible and covers almost all the methods in Table I. For example, without the adap- tation phase, it is basically a multitask learning, while using multi-domain data also implements structural correspondence learning and latent representation learning. If the joint training phase involves only a single task, then the adaptation phase implements the conventional model adaptation. It should be highlighted that a particular advantage of the representation learning framework is that the feature extractor can be trained in an unsupervised way, e.g., by restricted Boltzmann ma- chines (RBMs) [56] or auto-associators [46], therefore little or no labelled data are required. According to [6], as long as the distribution P (X) is relevant to the class-conditional distribution P (Y X), the unsupervised learning can improve the target supervised learning, in terms of convergence speed, amount of labelled data required and model quality. An early work based on deep representation learning is [57], where the authors used unsupervised learning (denoising auto- encoders) to extract high-level features, and trained a sentiment analysis system in one domain (e.g., book review). They found that the system could be directly migrated to a new domain (e.g., DVD review) and achieved much better performance than competitive approaches including structural correspon- dence learning (SCL) and spectral feature alignment (SFA). This work demonstrated that high-level abstract features are highly domain-independent and could be easily transferred across domains, even without any adaptation. As another example, [58] showed that CNN-based representations learned from a large image database imageNet were successfully applied to represent images in another database PASCAL VOC. A similar study was proposed recently in [59] where CNN features trained on multiple tasks were successfully applied to analyze biological images in multiple domains. In another example called ‘one-short learning’ [60], high- level features trained on a large image database were found to be highly generalizable, and a very few labeled data could adapt models to recognize unseen objects by identifying the most relevant features. In a more striking configuration, the learning task can be specified as an input vector (task vector, e.g., a vector that represents a subregion of the data where the classification takes place) and fed into the deep nets together with the input data. The network then can learn the complex relationship between the data vector, the task vector, and the task labels. As long as the new task can be related to the tasks seen in the training phase (which can be obtained by a distributed task vector with which the relation between tasks can be estimated from the distance between task vectors), the new task can be well performed without any adaptation. This leads to the zero-data learning [61] and zero-shot learning [62]. III. TRANSFER LEARNING IN SPEECH PROCESSING Speech signals are pseduo-stationary and change vastly according to a large number of factors (language, gender, speaker, channel, environment, emotion, ...). Dealing with these varieties is the core challenge of the speech processing research, and transfer learning is an important tool to solve the problem. It is not possible to cover all the researches in a short paper, so we select three most prominent fields where transfer learning has gained much success: transfer across languages, transfer across speakers, and transfer across models. A. Cross-lingual and multilingual transfer It is natural to believe that some common patterns are shared across languages. For example, many consonants and vowels are shared across languages, defined by some universal phone sets, e.g., IPA. This sharing among human languages have been utilized explicitly or implicitly to improve statistical strength in multilingual conditions, and has delivered better models than training with monolingual data, especially for low-resource languages. This advantage has been demonstrated in a multi- tude of research fields, though our review simply focuses on speech recognition and speech enhancement. Early approaches to employing cross-lingual or multilingual resources is via some linguistic correspondence, e.g., by a universal phone set or a pair-wised phone mapping [63], [64]. With the popularity of deep learning, the DNN-based multilingual approach in the form of representation learning gained much interest. The basic idea is that the features learned by DNN models tend to be language-independent at low layers and more language-dependent at high layers. Therefore multilingual data can be used to train a multilingual DNN where the low-level layers are shared by all languages, while the high-level layers are language specific. This is fully consistent with the representation learning framework shown in Fig. 2, where Y1 and Y2 represent two languages. By this sharing diagram, the features can be better learned with multilingual data, and for each language, training only the language-specific part is much easier than training the entire network. The initial investigation was proposed in [65], where mul- tilingual data were used to initialize the DNN model for the target language. Interesting improvement was reported and this approach was quickly followed by researchers, with both the DNN-HMM hybrid setting and the tandem setting. With the hybrid setting, DNNs are used to replace the conventional GMMs to estimate the likelihood of HMM states. In the multilingual scenario, the hidden layers of the DNN structure are shared across languages and each language holds its own output layer [66], [67], [68]. The training process then learns a shared feature extractor as well as language- dependent classifiers. This approach was proposed indepen- dently by three research groups in 2013, and tested on three different databases: English and Mandarin data [66], eleven Romance languages [67] and the global phone dataset with 19 languages [68]. A simple extension of the above setting is to involve multiple layers in the language-specific part, or simply use different classifiers (the default is software regression), although the latter is much similar to the tandem approach discussed below. With the tandem setting, DNNs are used as feature exactors, based on which posterior features or bottleneck features are obtained and are used to train conventional GMM-HMM systems. In [69], [70], the same DNN structure as in the hybrid setting was used to train a multilingual DNN, however the model was used to produce features (from the last hidden layer) instead of state likelihood. It was showed that the features generated by multilingual DNNs are rather language- independent and can be used directly for new languages. With limited adaptation data in the target language, additional per- formance could be obtained. The same approach was proposed in [71], though the features were read from a hidden layer in the middle layer (the bottle net layer with less neurons than other layers) instead of the last hidden layer. The features produced in this way are often referred to as bottleneck (BN) features. Combing with a universal phone set, the language- independent BN features can be used to train models for languages even without any labelled data [72]. The hybrid setting and tandem setting can be combined. For example, in [73], the BN feature was first derived from a multilingual DNN, and then it was combined with the original feature to train a hybrid system. A similar approach was proposed in [74], where the BN feature extractor for each language was regarded as a module, and another DNN combined the BN features from the modules of multiple languages to construct the hybrid system. The multilingual DNN approach described above belongs to multitask learning which can be extended to more general settings. For example, in [75] phone recognition and grapheme recognition were treated as two different tasks to supervise the DNN acoustic model training. They tested on three low- resource south African languages and showed that the mutitask training indeed improved performance. They also compared the multitask training with the conditional training where the grapheme recognition provided additional input for the phone recognition, instead of co-supervision. In a slightly different configuration, we reported a multitask learning which learns speech content and speaker accent together [76]. In this approach, a pronunciation vector that represents the accent of a speaker is generated by either an i- vector system [77] or a DNN system [78]. This pronunciation vector can be integrated in the input or hidden layers as additional features (the conditional learning), or used as an auxiliary output of a hidden layer (the multitask learning). In the latter setting, the pronunciation vector plays the role of a regularization to help learn better representations that can disentangle the underlying factors of the speech signal. We tested the method in an English ASR task where the speech data are in multiple accents (British and Chinese). We found that both the two approach could improve performance for utterances in both British and Chinese accents. An advantage with the second setting, however, is that the pronunciation vector is required only at the training phase. This is actually a heterogeneous multitask learning that has been proposed for a long time [11] but has not been studied much in speech processing. Besides speech recognition, cross-lingual and multilingual transfer were also proposed for speech enhancement. The assumption is that the noise and reverberation that need to be removed are largely language-independent, and therefore an enhancement model trained with the data in one language can be applied directly to other languages. For example, in [79], an DNN architecture trained in English data was demonstrated to be highly effective for enhancing speech signals in Chinese, by re-using the first several layers which were assumed to be language-independent. Another study published recently from our group demonstrated that a DNN structure can be used to remove music from speech in multilingual conditions [80]. B. Speaker adaptation Speaker adaptation is another domain in which transfer learning has gained brilliant success. In the paradigm of parametric statistic models (e.g., Gaussian models or Gaussian mixture models), maximum a posterior (MAP) estimation [12] and maximum likelihood linear regression (MLLR) [13] are two most successful methods to adapt a general model to a specific speaker. These methods are still the research focus of some authors, e.g. [81], [82], [83]. A short survey for these early-stage techniques can be found in [84]. In the deep learning era, DNN models are widely used nearly everywhere. However, adapting neural network, par- ticular a deep one, is not simple, because DNN is a highly compact distributed model. It is not easy to learn a simple form (with limited amount of parameters) such as MLLR to update all parameters of the network. However, recent research shows that with some particular constrains on the adaptation structure, speaker adaptation is possible for DNN models. An early study reported in [85] introduced a user vec- tor (user code) to represent a speaker, and the vector was augmented to the input and hidden layers. The learning then trained the network and the speaker code simultane- ously. To adapt to a new speaker, the network was fixed while the speaker vector was inferred by the conventional back-propagation algorithm [86]. This approach was extended in [87] by involving a transform matrix before the speaker vector was augmented to the input and hidden layers, possibly in the form of low-rank matrices. In a similar setting, the speaker code can be replaced by a more general speaker vector produced by exotic models, e.g., the famous i-vector [77]. Different from the speaker code approach, these speaker vectors do not need to be adapted (although it is possible) [88], [89], [90], [91]. An advantage of using exotic speaker vectors is that the speaker vector model can be trained with a large unlabelled database in an unsupervised fashion. A disadvantage is that no phone information is considered when deriving the vectors, at least it is case with the i-vector model. A careful analysis for the i-vector augmentation was conducted in [92], which showed that i-vectors not only compensate for speaker variance but also acoustic variance. In contrast to involving an speaker vector, the second approach to speaker adaptation for DNN models is to update the DNN model directly, with some constraints on which components of the DNN should be adapted. For example, the adaptation can be conducted on the input layer [93], [94], the activations of hidden layers [95], [96], [97], or the output layer [94]. Some comparison for adaptation on different components can be found in [98], [99]. In order to constrain the adaptation more aggressively, [100], [101] studied a singular value decomposition (SVD) approach which decomposes a weight matrix as production of low rank matri- ces, and only the singular values are updated for each speaker. Another constraint for speaker adaptation is based on a prior distribution over the output of the adapted network, which is imposed by the output of the speaker-independent DNN, in the form of KL-divergence [102]. Another interesting approach to speaker adaptation for DNN models is to apply transfer learning to project features to a canonical speaker-independent space where a model can be well trained. For example, the famous constrained MLLR (CMLLR) in the HMM-GMM architecture [13]. Recently, an auto-encoder trained with speaker vectors (obtained from a regression-based speaker transform) was used to produce speaker-independent BN features [103]. A similar approach was studied in [104], though an i-vector was used as the speaker representation. Most of the above researches are based on the DNN structure. Recent research shows that RNNs can be adapted in a similar way. For example, [105] reported an extensive study on speaker adaptation for LSTMs. It was found that LSTMs can be effectively adapted by using speaker-adaptive (SA) front-end (e.g., a speaker-aware DNN projection [104]), or by inserting speaker-dependent layers. It should be noted that DNN itself possesses great advan- tage of learning multiple conditions. Therefore, DNN models trained with a large amount of data of multiple speakers can deal with speaker variation pretty well. This conjecture was demonstrated by [99], which showed that the adaptation methods provide some improvement if the network is small and the amount of training data is medium, however for a large network trained with a large mount of data, the improvement is insignificant. The techniques discussed above are mostly applied to speech recognition, however they can be easily migrated to other applications. For example in HMM-based speech synthesis, model adaptation based on MAP and MLLR has been widely used to produce specific voice, e.g., [106], [107], [108], [109]. Particularly, speaker adaptation is often coupled with language adaptation to obtain multilingual synthesis, e.g., by state mapping [107], [110], [111]. For DNN-based speech synthesis [112], [113], [114], it is relatively new and the adaptation methods have not been extensively studied, except a few exceptions [115], [116]. C. Model transfer A recent progress in transfer learning is to learn a new model (child model) from an existing model (teacher model), which is known as model transfer. This was mentioned in the seminal paper of multitask learning [11] and was recently rediscovered by several researchers in the context of deep learning [117], [10], [118]. The initial idea was that the teacher model learns rich knowledge from the training data and this knowledge can be used to guide the training of child models which are simple and hence unable to learn many details without the teacher’s guide. To distill the knowledge from the teacher model, the logit matching approach proposed by Ba [117] teaches the child model by encouraging its logits (activations before softmax) close to those generated by the teacher model in terms of square error, and the dark knowledge distiller model proposed by Hinton [10] encourages the output of the child model close to those of the teacher model in terms of cross entropy. This approach has been applied to learn simple models from complex models so that the simple model can approach the performance of the complex model. For example, [118] utilized the output of a complex DNN as regularization to learn a small DNN that is suitable for speech recognition on mobile devices. [119] used a complex RNN to train a DNN. Recently, a new architecture called FitNet was proposed [120]. Instead of regularizing the output, FitNet regularizes hidden units so that knowledge learned by the intermediate representations can be transferred to the target model, which is suitable for training a model whose label space is different from that of the teacher model. This work was further extended in [121], where multiple hidden layers were regularized by the teacher model. Another example is to transfer heterogeneous models. For instance, in [122], unsupervised learning models (PCA and ICA) were used to model the outputs of a DNN model. This in fact treats the DNN output as an intermediate feature, and uses the feature for general tasks, e.g., classifying instances from novel classes. Our recent work [35] showed that this model transfer can not only learn simple models from complex models, but also the reverse: a weak model can be used to teach a stronger model. In our work [35], a DNN model was used to train a powerful complex RNN. We found that by the model transfer learning, RNNs can be learned pretty well with the regularization of a DNN model, though the teacher model is weaker than the target one. In a related work [36], we found that the model transfer learning can be used as a new pre-training approach, and it even works in some scenarios where the RBM pre-training and layer-wised discriminative pre-training do not work. Additionally, combining the RMB- based pre-training and the model transfer pre-training can offer additional gains, at least in our experimental setting where the training data is not very abundant. IV. TRANSFER LEARNING IN LANGUAGE PROCESSING As in speech processing, the basic assumption of transfer learning for language processing is also intuitive: all human languages share some common semantic structures (e.g., con- cepts and syntactic rules). Following this idea, the simple way of transfer learning in multilingual or multi-domain scenarios is to construct some cross-lingual/cross-domain correspon- dence so that knowledge learned in one language/domain can be transferred and reused in another language/domain. For example, a bi-lingual lexicon can be used to provide instance- level correspondence so that syntactic knowledge learned in one language can be used to improve the syntactic learning in the second language [125]. Another approach that gained more attention recently is to learn a common latent space that are shared by different languages or domains, so that knowledge can be aggregated, leading to improved statistic strength for probabilistic modeling in each single language or domain. Once again, transfer learning is such a broad research field and the research of language processing is even more broad itself, which makes a detailed review for all the research fields impossible in such a short paper. We will focus on two particular fields: cross-lingual learning and cross-domain learning, particularly for the document classification task. A. Cross-lingual and multilingual transfer learning A straightforward way to transfer knowledge between lan- guages is to translate words from one language to another by a bi-lingual lexicon. For example, this approach was used in [126] to translate a maximum entropy (ME) classifier trained in English data to a classifier used for classifying Chinese documents. In another work from our group, we have applied this approach successfully to train multilingual language models, where some foreign words need to be addressed [127]. Word-by-word translation, however, is ob- viously not ideal since no syntactic constraints in different languages are considered. A more complicated approach is to translate the whole sentence by machine translation [128], so that any labelling or classification tasks in one language can be conducted with models trained in another language. A more recent approach to multilingual learning is to learn some common latent structures/representations based on multilingual data. For example, the multilingual LDA model proposed in [129] assumes a common latent topic space, so that words from multiple languages can share the same topics. This is similar to the RMB-based heterogeneous factor learning [27]: both are based on unsupervised learning with weak supervision, i.e., no word alignment is required. A similar approach proposed in [130] learns multilingual word clusters, where a cluster may involve words from differ- ent languages. This was achieved by means of a probabilistic model over large amounts of monolingual data in two lan- guages, coupled with parallel data through which cross-lingual correspondence was obtained. Applying to the NER task, it was found that up to 26% performance improvement was observed with the multi-lingual model. This work was extend in [131] where cross-lingual clusters were used to ‘directly’ transfer an NER model trained in the source language to the target language. Another approach to constructing common latent space is by linear projection instead of statistical models. For example, in the heterogeneous feature augmentation (HFA) approach proposed in [29], two linear projections are learned to project features in different languages to a common space. In their study, these projections were used to produce additional fea- tures that were augmented to the original features to train the model in the target language. An interesting part of their approach is to train the supervision model (e.g., SVM) in the source and target languages simultaneously. This leads to a joint optimization for the common space projections as well as the classifiers. The approach was tested on a text classification task with the Reuters multilingual database and obtained good performance. In another work [24], a linear projection was learned by optimizing a set of multi-lingual classifier, each of which predicted the existence of the words of a bi-lingual word-pair. The approach was tested on cross-lingual topic discovery and sentiment classification. Recently, word embedding becomes a hot topic [132], [133], [134], [135], [136]. Intuitively, word embedding represents each word as a low-dimensional dense vector (word vector) with the constraint that relevant words are located more closely than irrelevant words. This embedding enables semantic com- puting over words, and provides new ways for mulitilingual learning: if word vectors can be trained in a multilingual fashion, regressors/classifiers trained on these vectors naturally apply to multiple languages. A simple approach is to map word vectors trained in individual languages to a single space. For example, in [137], it was found that a linear transform can project word vectors trained in one languages to word vectors in another language so that relevant words are put closely, in spite of their lan- guages. This projection can be learned simply by some pivot word pairs from the two languages. We extended this work in [138] by modeling the transfer as an orthogonal transform. A more systematic approach was proposed by [139], where different languages were projected to the same space by different projections, and the projections were determined by maximizing the canonical correlation of the corresponding words in the projected space. This approach requires one- to-one word correspondence, which was obtained by aligned parallel data. learn any projection, A potential problem of the above approaches is that the word vectors and projections are learned separately. The approach proposed in [140] does not instead the bi-lingual correspondence was taken into account in the embedding process. This work was based on the neural LM model [132] and changed the objective function by involving an extra term that encourages relevant words in different languages located together. The relevance of words in different languages was derived from aligned parallel data. In another work [141], the relevance constraint was em- ployed at the sentence level. Word vectors were aggregated into a sentence embedding, and relevant sentences were em- bedded closely. This approach does not require word alignment and so can be easily implemented. Additionally, this approach can be simply extended to document level models, for which only document pairs are required, without any sentence- level alignment. This approach was tested on a multilingual classification task. A similar work was proposed by [142]. As in [141], only sentence pairs are required in the learning; the difference is that the embedding leveraged both monolingual data and bi-lingual data, and employd noise-contrastive training to improve efficiency. Good performance was obtained in both cross-lingual document classification and word-level transla- tion. An interesting research that involves much ingredient of deep learning was proposed by [30]. The basic idea is to learn high-level document features individually in each language by unsupervised learning (i.e., mSDA in that paper), and then learn the correspondence (transform) using parallel data. The raw and high-level features can be combined to train the classifier in one language, and documents in another language can be transferred to the rich language and are classified there. The idea of applying unsupervised learning to learn high-level features is prominent, which may help remove noises in the raw data thus leading to more reliable transform estimation. The approach was tested on several multilingual sentiment classification tasks where the raw document feature was TF- IDF and the high-level features were learned by mSDA. Good performance was reported. B. Cross-domain transfer learning Cross-domain transfer learning has two different meaning: when the domain refers to applications, then the difference is in the data distribution; when it refers to features, then the difference is in feature types or modalities, e.g., audio feature or image feature. We focus on the feature domain transfer, which is relatively new and invokes much interest recently. With the simplest approach, multi-modal features can be com- bined either at the feature level or the score level. For example on the semantic relatedness task, [143] concatenated visual and textual features to train multi-stream systems; in [144], the scores predicted by multiple models based on different features are combined. A more complex setting involves transferring knowledge between models built with heterogeneous features. Note that some authors regard different languages as different domains, e.g., [30]. However, we focus on transfer learning between different feature modalities. An example is the work proposed in [25], where the au- thors used co-occurrence data to estimate the correspondence between different features, i.e., image and text. The estimated correspondence was then used to assist the classification task in the target domain, by transferring the target features to the source domain where a good classification model had been constructed. The authors formulated this transfer process using a Markov chain and risk minimization inference. The method was tested on a text-aided image classification task and achieved significant performance improvement. The common latent space approach was studied in [145], with the task of image segmentation and labelling. The model was based on kernelized canonical correlation analysis which finds a mapping between visual and textual representations by projecting them into a latent semantic space. Deep learning provides an elegant way for cross-domain transfer learning, with its great power in learning high-level representations shared by multiple modalities [54]. For exam- ple, in [62], [146], images and words are embedded in the same low-dimensional space via neural networks, by which image classification can be improved by the word embedding, even for classes without any image training data. [147] pro- posed a multi-modal neural language modeling approach with which the history and prediction can be both text and images, so that the prediction between multiple modalities becomes possible. In [148], an RNN structure based on dependency-tree was proposed to embed textual sentences into compositional vectors, which were then projected together with image rep- resentations to a common space. Within this common space, multi-modal retrieval and annotation can be easily conducted. The same idea was proposed by [149], though deep Boltzmann machines were used instead of DNNs to infer the common latent space. C. Model transfer Model transfer, which aims to learn one model from another, has not yet been extensively studied in language processing. A recent work [150] studied a knowledge distilling approach on the sentiment classification task. The original classifier was a large neural net with large word vectors as input, and a small network was learned in two ways: either using the output of the large network as supervision or directly transferring large word vectors to smaller ones. In a recent study [151], we show that it is possible to learn a neural model using supervision from a Bayesian model. Specifically, we tried to learn a document vector from the raw TF input using a neural net, supervised by the vector representation produced by latent Dirichlet allocation (LDA). Our experimental results showed that with a two-layer neural network, it is possible to learn document vectors that are quite similar to the ones produced by LDA, while the inference is hundreds of times faster. V. PERSPECTIVE AND CONCLUSIONS We gave a very brief review of transfer learning, and intro- duced some applications of this approach in speech and lan- guage processing. Due to the broad landscape of this research and the limited knowledge of the authors, only very limited areas were touched. Also, many important contributions in the ‘history’ had to be omitted, for the sake of emphasis on more recent directions in the past few years, especially deep learning. Even with such a limited review, we can still clearly see the important role that transfer learning plays and how fast it has evolved recently. For speech and language processing, transfer learning is essentially important as both speech and language are diverse, imbalance, dynamic and inter-linked, which makes transfer learning inevitable. Transfer learning can be conducted in very different man- ners. It can be conducted as a shared learning that learns various domains and tasks together, or as a tandem learning which learns a model in one domain/task and migrates the model to another domain/task. It can be conducted with a supervised way where labeled data are used to refine the classifier, or an unsupervised way where numerous unlabelled data are used to learn better representations. It can be used to transfer instances, representations, structures and models. It can transfer between different distributions, different features and different tasks. Go back to the NIPS 95 workshop, where some questions were raised by the famous researchers at time. Two decades later, we can answer some of the questions, while other remains mystery: that • What do we mean by related tasks and how can we identify them? It is still difficult to measure relatedness, particularly with the complex configurations of transfer learning. However, we do know some possible metrics, e.g., the relatedness between marginal and conditional distributions [6] in unsupervised feature learning, or rep- resentation overlap in model adaptation [38]. Particularly, we now know that even two tasks are intuitively unrelated (e.g., speech recognition and speaker recognition), trans- fer learning still works by utilizing the fact that the tasks are unrelated [39]. • How do we predict when transfer will help (or hurt)? Again, it is not easy to find a complete solution. However some approaches indeed can alleviate negative transfer, e.g., [152], [38]. With deep learning, the risk of negative transfer seems substantially reduced. For example, any data in related domains can be used to assist learning ab- stract features, even they are sampled from a distribution different from the target domain [23]. This is not the case twenty years ago. • What are the benefits: speed, generalization, intelligibil- ity,...? Seems all of these can be improved by transfer learning. • What should be transferred: internal representations, parameter settings, features,...? We now know all these components can be transferred. • How should it be transferred: weight initialization, bias- ing the error metric,...? All these methods can be used, although it seems that the regularization view is more attractive and it is related to modifying the objective function. • How do we look inside to see what has been transferred? This question is more related to model adaptation and the answer is model-dependent. For example with a DNN model which is highly compact, is not simple to investigate which part of the model has been changed after adaptation. it Transfer learning has been widely studied in speech and language processing, particularly for model adaptation. Recent advance in multilingual learning and heterogeneous feature transform demonstrates the power of transfer learning in a more clear way. Nevertheless, compared to the very diverse methods studied in the machine learning community, appli- cation of transfer learning in speech and language research is still very limited. There are many questions remain unan- swered, for example: can we learn common representations for both speech, language and speaker recognition? Can we learn acoustic models for voiced speech and whistle speech together? How about sign language? How to use large volume of unlabeled video data to regularize speech models? How pronunciation models can be used to regularize NLP tasks? How to involve heterogeneous resources including audio, visual, language to solve the most challenging tasks in the respective research fields? How to utilize the large amount of unlabeled data more efficiently in the big-data era? To solve these problems, we believe collaboration among researchers who have been used to work independently in their own areas is mostly required. ACKNOWLEDGEMENT This research was supported by the National Science Foun- dation of China (NSFC) under the project No. 61271389 and No. 61371136, and the National Basic Research Program (973 Program) of China under Grant No. 2013CB329302. It was also supported by the MESTDC PhD Foundation Project No.20130002120011, as well as Sinovoice and Huilan Ltd. Thanks to Zhiyuan Tang for the careful reference collection. REFERENCES [1] J. H. Martin and D. Jurafsky, “Speech and language processing,” [3] L. Deng and X. Li, “Machine learning paradigms for speech recog- nition: An overview,” Audio, Speech, and Language Processing, IEEE Transactions on, vol. 21, no. 5, pp. 1060–1089, 2013. [4] S. J. Pan and Q. Yang, “A survey on transfer learning,” Knowledge and Data Engineering, IEEE Transactions on, vol. 22, no. 10, pp. 1345– 1359, 2010. [5] M. E. Taylor and P. Stone, “Transfer learning for reinforcement learning domains: A survey,” The Journal of Machine Learning Research, vol. 10, pp. 1633–1685, 2009. [6] Y. Bengio, “Deep learning of representations for unsupervised and transfer learning,” in ICML Unsupervised and Transfer Learning, 2012. [7] J. Lu, V. Behbood, P. Hao, H. Zuo, S. Xue, and G. Zhang, “Transfer learning using computational intelligence: A survey,” Knowledge-Based Systems, vol. 80, pp. 14–23, 2015. [8] S. Thrun and L. Pratt, Learning to learn. Springer Science & Business Media, 2012. [2] J. Benesty, Springer handbook of speech processing. Springer Science International Edition, 2000. & Business Media, 2008. [22] S. J. Pan, I. W. Tsang, J. T. Kwok, and Q. Yang, “Domain adaptation via transfer component analysis,” Neural Networks, IEEE Transactions on, vol. 22, no. 2, pp. 199–210, 2011. [23] R. Raina, A. Battle, H. Lee, B. Packer, and A. Y. Ng, “Self-taught learning: transfer learning from unlabeled data,” in Proceedings of the 24th international conference on Machine learning. ACM, 2007, pp. 759–766. [24] P. Prettenhofer and B. Stein, “Cross-lingual adaptation using structural correspondence learning,” ACM Transactions on Intelligent Systems and Technology (TIST), vol. 3, no. 1, p. 13, 2011. [25] W. Dai, Y. Chen, G.-R. Xue, Q. Yang, and Y. Yu, “Translated learning: Transfer learning across different feature spaces,” in Advances in neural information processing systems, 2008, pp. 353–360. [26] B. Kulis, K. Saenko, and T. Darrell, “What you saw is not what you get: Domain adaptation using asymmetric kernel transforms,” in Computer Vision and Pattern Recognition (CVPR), 2011 IEEE Conference on. IEEE, 2011, pp. 1785–1792. [27] B. Wei and C. J. Pal, “Heterogeneous transfer learning with RBMs.” in AAAI, 2011. [28] X. Shi, Q. Liu, W. Fan, P. S. Yu, and R. Zhu, “Transfer learning on heterogenous feature spaces via spectral transformation,” in Data Mining (ICDM), 2010 IEEE 10th International Conference on. IEEE, 2010, pp. 1049–1054. [29] L. Duan, D. Xu, and I. Tsang, “Learning with augmented features for heterogeneous domain adaptation,” arXiv preprint arXiv:1206.4660, 2012. [30] J. T. Zhou, S. J. Pan, I. W. Tsang, and Y. Yan, “Hybrid heterogeneous transfer learning through deep learning,” in Twenty-Eighth AAAI Con- ference on Artificial Intelligence, 2014. [31] D. Gentner, “Structure-mapping: A theoretical framework for analogy,” Cognitive science, vol. 7, no. 2, pp. 155–170, 1983. [32] D. Gentner and K. J. Holyoak, “Reasoning and learning by analogy: Introduction.” American Psychologist, vol. 52, no. 1, p. 32, 1997. [33] J. Blitzer, R. McDonald, and F. Pereira, “Domain adaptation with struc- tural correspondence learning,” in Proceedings of the 2006 conference on empirical methods in natural language processing. Association for Computational Linguistics, 2006, pp. 120–128. [34] J. G. Carbonell, Learning by analogy: Formulating and generalizing plans from past experience. Springer, 1983. [35] D. Wang, C. Liu, Z. Tang, Z. Zhang, and M. Zhao, “Recurrent neural network training with dark knowledge transfer,” arXiv preprint arXiv:1505.04630, 2015. [36] Z. Tang, D. Wang, Y. Pan, and Z. Zhang, “Knowledge transfer pre- training,” arXiv preprint arXiv:1506.02256, 2015. [37] J. Baxter, “A model of inductive bias learning,” J. Artif. Intell. Res.(JAIR), vol. 12, pp. 149–198, 2000. [38] J. Guinney, Q. Wu, and S. Mukherjee, “Estimating variable structure and dependence in multitask learning via gradients,” Machine Learning, vol. 83, no. 3, pp. 265–287, 2011. [39] B. Romera-Paredes, A. Argyriou, N. Berthouze, and M. Pontil, “Ex- ploiting unrelated tasks in multi-task learning,” in International Con- ference on Artificial Intelligence and Statistics, 2012, pp. 951–959. [40] G. Hinton, L. Deng, D. Yu, G. E. Dahl, A.-r. Mohamed, N. Jaitly, A. Senior, V. Vanhoucke, P. Nguyen, T. N. Sainath et al., “Deep neural networks for acoustic modeling in speech recognition: The shared views of four research groups,” IEEE Signal Processing Magazine, vol. 29, no. 6, pp. 82–97, 2012. [41] L. Deng and D. Yu, “Deep learning: Methods and applications,” Foundations and Trends in Signal Processing, vol. 7, no. 3-4, pp. 197– 387, 2013. [Online]. Available: http://dx.doi.org/10.1561/2000000039 [42] X. He, J. Gao, and L. Deng, “Deep learning for natural language processing and related applications (Tutorial at ICASSP),” in IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP), 2014. [43] J. Hirschberg and C. D. Manning, “Advances in natural processing,” Science, vol. 349, no. 6245, pp. 261–266, 2015. language [44] 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. [45] R. Salakhutdinov and G. E. Hinton, “Deep boltzmann machines,” in International Conference on Artificial Intelligence and Statistics, 2009, pp. 448–455. [46] Y. Bengio, P. Lamblin, D. Popovici, H. Larochelle et al., “Greedy layer-wise training of deep networks,” Advances in neural information processing systems, vol. 19, p. 153, 2007. [47] P. Vincent, 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,” The Journal of Machine Learning Research, vol. 11, pp. 3371–3408, 2010. [9] “NIPS 95 workshop on learning to learn: Knowledge consolidation [Online]. Available: and transfer http://socrates.acadiau.ca/courses/comp/dsilver/NIPS95 LTL/transfer.workshop.1995.html systems,” 1995. in inductive [10] G. E. Hinton, O. Vinyals, and J. Dean, “Distilling the knowledge in a neural network,” in NIPS 2014 Deep Learning Workshop, 2014. [11] R. Caruana, “Multitask learning,” Machine learning, vol. 28, no. 1, pp. 41–75, 1997. [12] J.-L. Gauvain and C.-H. Lee, “Maximum a posteriori estimation for multivariate Gaussian mixture observations of Markov chains,” IEEE Transactions on Speech and audio processing, vol. 2, no. 2, pp. 291– 298, 1994. [13] C. J. Leggetter and P. Woodland, “Maximum likelihood linear re- gression for speaker adaptation of continuous density hidden Markov models,” Computer Speech & Language, vol. 9, no. 2, pp. 171–185, 1995. [14] P. E. Utgoff, “Incremental induction of decision trees,” Machine learning, vol. 4, no. 2, pp. 161–186, 1989. [15] A. Blum and T. Mitchell, “Combining labeled and unlabeled data with co-training,” in Proceedings of the eleventh annual conference on Computational learning theory. ACM, 1998, pp. 92–100. [16] C. Wang and S. Mahadevan, “Heterogeneous domain adaptation using manifold alignment,” in IJCAI Proceedings-International Joint Confer- ence on Artificial Intelligence, vol. 22, no. 1, 2011, p. 1541. [17] Y. Zhu, Y. Chen, Z. Lu, S. J. Pan, G.-R. Xue, Y. Yu, and Q. Yang, “Heterogeneous transfer learning for image classification.” in AAAI, 2011. [18] H.-Y. Wang and Q. Yang, “Transfer learning by structural analogy,” in AAAI. Citeseer, 2011. [19] O. Arandjelovic and R. Cipolla, “Incremental learning of temporally- coherent Gaussian mixture models,” Society of Manufacturing Engi- neers (SME) Technical Papers, pp. 1–1, 2006. [20] A. Declercq and J. H. Piater, “Online learning of Gaussian mixture models-a two-level approach.” in VISAPP (1), 2008, pp. 605–611. [21] X. Zhu, “Semi-supervised learning literature survey,” Computer Sci- ences TRP 1530, University of Wisconsin C Madison, 2005. [48] G. E. Dahl, D. Yu, L. Deng, and A. Acero, “Context-dependent pre- trained deep neural networks for large-vocabulary speech recognition,” Audio, Speech, and Language Processing, IEEE Transactions on, vol. 20, no. 1, pp. 30–42, 2012. [49] A. Graves, A.-R. Mohamed, and G. Hinton, “Speech recognition with deep recurrent neural networks,” in Proceedings of IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). IEEE, 2013, pp. 6645–6649. [50] Y. Bengio and O. Delalleau, “On the expressive power of deep Springer, 2011, pp. architectures,” in Algorithmic Learning Theory. 18–36. [51] R. Collobert and J. Weston, “A unified architecture for natural lan- guage processing: Deep neural networks with multitask learning,” in Proceedings of the 25th international conference on Machine learning. ACM, 2008, pp. 160–167. [52] L. Deng, J. Li, J.-T. Huang, K. Yao, D. Yu, F. Seide, M. Seltzer, G. Zweig, X. He, J. Williams et al., “Recent advances in deep learning for speech research at Microsoft,” in Acoustics, Speech and Signal Processing (ICASSP), 2013 IEEE International Conference on. IEEE, 2013, pp. 8604–8608. [53] S. M. Gutstein, Transfer learning techniques for deep neural nets. The University of Texas at El Paso, 2010. [54] J. Ngiam, A. Khosla, M. Kim, J. Nam, H. Lee, and A. Y. Ng, “Multimodal deep learning,” in Proceedings of the 28th international conference on machine learning (ICML-11), 2011, pp. 689–696. [55] Y. Bengio, I. J. Goodfellow, and A. Courville, Deep Learning, [Online]. Available: 2015, book in preparation for MIT Press. http://www.iro.umontreal.ca/∼bengioy/dlbook [56] G. E. Hinton and R. R. Salakhutdinov, “Reducing the dimensionality of data with neural networks,” Science, vol. 313, no. 5786, pp. 504–507, 2006. [57] X. Glorot, A. Bordes, and Y. Bengio, “Domain adaptation for large- scale sentiment classification: A deep learning approach,” in Proceed- ings of the 28th International Conference on Machine Learning (ICML- 11), 2011, pp. 513–520. [58] M. Oquab, L. Bottou, I. Laptev, and J. Sivic, “Learning and transferring mid-level image representations using convolutional neural networks,” in Computer Vision and Pattern Recognition (CVPR), 2014 IEEE Conference on. IEEE, 2014, pp. 1717–1724. [59] W. Zhang, R. Li, T. Zeng, Q. Sun, S. Kumar, J. Ye, and S. Ji, “Deep model based transfer and multi-task learning for biological image analysis,” in Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. ACM, 2015, pp. 1475–1484. [60] L. Fei-Fei, R. Fergus, and P. Perona, “One-shot learning of object cate- gories,” Pattern Analysis and Machine Intelligence, IEEE Transactions on, vol. 28, no. 4, pp. 594–611, 2006. [61] H. Larochelle, D. Erhan, and Y. Bengio, “Zero-data learning of new tasks.” in AAAI, vol. 1, no. 2, 2008, p. 3. [62] R. Socher, M. Ganjoo, C. D. Manning, and A. Ng, “Zero-shot learning information transfer,” in Advances in neural through cross-modal processing systems, 2013, pp. 935–943. [63] T. Schultz and A. Waibel, “Language-independent and language- adaptive acoustic modeling for speech recognition,” Speech Commu- nication, vol. 35, no. 1, pp. 31–51, 2001. [64] N. T. Vu, F. Kraus, and T. Schultz, “Cross-language bootstrapping based on completely unsupervised training using multilingual A-stabil,” in Acoustics, Speech and Signal Processing (ICASSP), 2011 IEEE International Conference on. IEEE, 2011, pp. 5000–5003. [65] P. Swietojanski, A. Ghoshal, and S. Renals, “Unsupervised cross- lingual knowledge transfer in DNN-based LVCSR,” in Spoken Lan- guage Technology Workshop (SLT), 2012 IEEE. IEEE, 2012, pp. 246–251. [66] J.-T. Huang, J. Li, D. Yu, L. Deng, and Y. Gong, “Cross-language knowledge transfer using multilingual deep neural network with shared hidden layers,” in Acoustics, Speech and Signal Processing (ICASSP), 2013 IEEE International Conference on. IEEE, 2013, pp. 7304–7308. [67] G. Heigold, V. Vanhoucke, A. Senior, P. Nguyen, M. Ranzato, M. Devin, and J. Dean, “Multilingual acoustic models using distributed deep neural networks,” in Acoustics, Speech and Signal Processing (ICASSP), 2013 IEEE International Conference on. IEEE, 2013, pp. 8619–8623. [68] A. Ghoshal, P. Swietojanski, and S. Renals, “Multilingual training of deep neural networks,” in Acoustics, Speech and Signal Processing (ICASSP), 2013 IEEE International Conference on. IEEE, 2013, pp. 7319–7323. [69] K. Vesely, M. Karafi´at, F. Grezl, M. Janda, and E. Egorova, “The language-independent bottleneck features,” in Spoken Language Tech- nology Workshop (SLT), 2012 IEEE. IEEE, 2012, pp. 336–341. [70] S. Thomas, M. L. Seltzer, K. Church, and H. Hermansky, “Deep neural network features and semi-supervised training for low resource speech recognition,” in Acoustics, Speech and Signal Processing (ICASSP), IEEE, 2013, pp. 6704–6708. 2013 IEEE International Conference on. [71] Z. Tuske, J. Pinto, D. Willett, and R. Schluter, “Investigation on cross-and multilingual mlp features under matched and mismatched acoustical conditions,” in Acoustics, Speech and Signal Processing (ICASSP), 2013 IEEE International Conference on. IEEE, 2013, pp. 7349–7353. [72] K. M. Knill, M. J. Gales, A. Ragni, and S. P. Rath, “Language independent and unsupervised acoustic models for speech recognition and keyword spotting,” in Proc. Interspeech14, 2014. [73] P. Bell, P. Swietojanski, and S. Renals, “Multi-level adaptive networks in tandem and hybrid ASR systems,” in Acoustics, Speech and Signal Processing (ICASSP), 2013 IEEE International Conference on. IEEE, 2013, pp. 6975–6979. [74] J. Gehring, Q. B. Nguyen, F. Metze, and A. Waibel, “DNN acoustic modeling with modular multi-lingual feature extraction networks,” in Automatic Speech Recognition and Understanding (ASRU), 2013 IEEE Workshop on. IEEE, 2013, pp. 344–349. [75] D. Chen, B. Mak, C.-C. Leung, and S. Sivadas, “Joint acoustic modeling of triphones and trigraphemes by multi-task learning deep neural networks for low-resource speech recognition,” in Acoustics, Speech and Signal Processing (ICASSP), 2014 IEEE International Conference on. IEEE, 2014, pp. 5592–5596. [76] X. Z. Zhiyuan Tang, “Speech recognition with pronunciation [Online]. Available: vecotrs,” CSLT, Tsinghua University, 2015. http://cslt.riit.tsinghua.edu.cn/publications.php?Publication-trp [77] N. Dehak, P. Kenny, R. Dehak, P. Dumouchel, and P. Ouellet, “Front- end factor analysis for speaker verification,” Audio, Speech, and Lan- guage Processing, IEEE Transactions on, vol. 19, no. 4, pp. 788–798, 2011. [78] V. Ehsan, L. Xin, M. Erik, L. M. Ignacio, and G.-D. Javier, “Deep neural networks for small footprint text-dependent speaker verifica- tion,” IEEE International Conference on Acoustic, Speech and Signal Processing (ICASSP), vol. 28, no. 4, pp. 357–366, 2014. [79] Y. Xu, J. Du, L.-R. Dai, and C.-H. Lee, “Cross-language transfer learning for deep neural network based speech enhancement,” in Chi- nese Spoken Language Processing (ISCSLP), 2014 9th International Symposium on. IEEE, 2014, pp. 336–340. [80] M. Zhao, D. Wang, Z. Zhang, and X. Zhang, “Music removal by con- volutional denoising autoencoder in speech recognition,” in Interspeech 2015, 2015. [81] M. L. Seltzer and A. Acero, “Separating speaker and environmental variability using factored transforms.” in INTERSPEECH, 2011, pp. 1097–1100. [82] D. Povey and K. Yao, “A basis representation of constrained MLLR transforms for robust adaptation,” Computer Speech & Language, vol. 26, no. 1, pp. 35–51, 2012. [83] Y. Miao, F. Metze, and A. Waibel, “Learning discriminative basis coefficients for eigenspace MLLR unsupervised adaptation,” in Acous- tics, Speech and Signal Processing (ICASSP), 2013 IEEE International Conference on. IEEE, 2013, pp. 7927–7931. [84] K. Shinoda, “Speaker adaptation techniques for automatic speech recognition,” Proc. APSIPA ASC 2011, 2011. [85] O. Abdel-Hamid and H. Jiang, “Fast speaker adaptation of hybrid NN/HMM model for speech recognition based on discriminative learn- ing of speaker code,” in Acoustics, Speech and Signal Processing (ICASSP), 2013 IEEE International Conference on. IEEE, 2013, pp. 7942–7946. [86] ——, “Rapid and effective speaker adaptation of convolutional neural network based models for speech recognition.” in INTERSPEECH, 2013, pp. 1248–1252. [87] S. Xue, O. Abdel-Hamid, H. Jiang, and L. Dai, “Direct adaptation of hybrid DNN/HMM model for fast speaker adaptation in LVCSR based on speaker code,” in Acoustics, Speech and Signal Processing (ICASSP), 2014 IEEE International Conference on. IEEE, 2014, pp. 6339–6343. [88] G. Saon, H. Soltau, D. Nahamoo, and M. Picheny, “Speaker adaptation of neural network acoustic models using i-vectors,” in Automatic Speech Recognition and Understanding (ASRU), 2013 IEEE Workshop on. IEEE, 2013, pp. 55–59. [89] P. Karanasou, Y. Wang, M. J. Gales, and P. C. Woodland, “Adaptation of deep neural network acoustic models using factorised i-vectors,” in Proc Interspeech, 2014. [90] A. Senior and I. Lopez-Moreno, “Improving DNN speaker indepen- dence with i-vector inputs,” in Proc. ICASSP, 2014. [91] V. Gupta, P. Kenny, P. Ouellet, and T. Stafylakis, “I-vector-based speaker adaptation of deep neural networks for french broadcast audio transcription,” in Acoustics, Speech and Signal Processing (ICASSP), 2014 IEEE International Conference on. IEEE, 2014, pp. 6334–6338. [92] M. Rouvier and B. Favre, “Speaker adaptation of DNN-based ASR with i-vectors: Does it actually adapt models to speakers?” in Fifteenth Annual Conference of the International Speech Communication Asso- ciation, 2014. [93] J. Neto, L. Almeida, M. Hochberg, C. Martins, L. Nunes, S. Renals, and T. Robinson, “Speaker-adaptation for hybrid HMM-ANN continuous speech recognition system,” in Proc. EUROSPEECH’95. International Speech Communication Association, 1995. [94] K. Yao, D. Yu, F. Seide, H. Su, L. Deng, and Y. Gong, “Adaptation of context-dependent deep neural networks for automatic speech recog- nition,” in Spoken Language Technology Workshop (SLT), 2012 IEEE. IEEE, 2012, pp. 366–369. [95] R. Gemello, F. Mana, S. Scanzio, P. Laface, and R. De Mori, “Linear hidden transformations for adaptation of hybrid ANN/HMM models,” Speech Communication, vol. 49, no. 10, pp. 827–835, 2007. [96] S. M. Siniscalchi, J. Li, and C.-H. Lee, “Hermitian polynomial for speaker adaptation of connectionist speech recognition systems,” Audio, Speech, and Language Processing, IEEE Transactions on, vol. 21, no. 10, pp. 2152–2161, 2013. [97] P. Swietojanski and S. Renals, “Learning hidden unit contributions for unsupervised speaker adaptation of neural network acoustic models,” in Spoken Language Technology Workshop (SLT), 2014 IEEE. IEEE, 2014, pp. 171–176. [98] B. Li and K. C. Sim, “Comparison of discriminative input and output transformations for speaker adaptation in the hybrid NN/HMM systems,” in Interspeech’10, 2010. [99] H. Liao, “Speaker adaptation of context dependent deep neural net- works,” in Acoustics, Speech and Signal Processing (ICASSP), 2013 IEEE International Conference on. IEEE, 2013, pp. 7947–7951. [100] J. Xue, J. Li, D. Yu, M. Seltzer, and Y. Gong, “Singular value de- composition based low-footprint speaker adaptation and personalization for deep neural network,” in Acoustics, Speech and Signal Processing (ICASSP), 2014 IEEE International Conference on. IEEE, 2014, pp. 6359–6363. [101] S. Xue, H. Jiang, and L. Dai, “Speaker adaptation of hybrid NN/HMM model for speech recognition based on singular value decomposition,” in Chinese Spoken Language Processing (ISCSLP), 2014 9th Interna- tional Symposium on. IEEE, 2014, pp. 1–5. [102] D. Yu, K. Yao, H. Su, G. Li, and F. Seide, “Kl-divergence regularized deep neural network adaptation for improved large vocabulary speech recognition,” in Acoustics, Speech and Signal Processing (ICASSP), 2013 IEEE International Conference on. IEEE, 2013, pp. 7893–7897. [103] Y. Tang, A. Mohan, R. C. Rose, and C. Ma, “Deep neural net- work trained with speaker representation for speaker normalization,” in Acoustics, Speech and Signal Processing (ICASSP), 2014 IEEE International Conference on. IEEE, 2014, pp. 6329–6333. [104] Y. Miao, H. Zhang, and F. Metze, “Towards speaker adaptive training of deep neural network acoustic models,” in Interspeech’14, 2014. [105] Y. Miao and F. Metze, “On speaker adaptation of long short-term mem- ory recurrent neural networks,” in Sixteenth Annual Conference of the International Speech Communication Association (INTERSPEECH)(To Appear). ISCA, 2015. [106] M. Tamura, T. Masuko, K. Tokuda, and T. Kobayashi, “Adapta- tion of pitch and spectrum for HMM-based speech synthesis using MLLR,” in Acoustics, Speech, and Signal Processing, 2001. Proceed- ings.(ICASSP’01). 2001 IEEE International Conference on, vol. 2. IEEE, 2001, pp. 805–808. [107] Y.-J. Wu, Y. Nankaku, and K. Tokuda, “State mapping based method for cross-lingual speaker adaptation in HMM-based speech synthesis.” in Interspeech, 2009, pp. 528–531. [108] J. Yamagishi and T. Kobayashi, “Average-voice-based speech synthesis using HSMM-based speaker adaptation and adaptive training,” IEICE TRANSACTIONS on Information and Systems, vol. 90, no. 2, pp. 533– 543, 2007. [109] J. Yamagishi, T. Kobayashi, Y. Nakano, K. Ogata, and J. Isogai, “Analysis of speaker adaptation algorithms for HMM-based speech synthesis and a constrained SMAPLR adaptation algorithm,” Audio, Speech, and Language Processing, IEEE Transactions on, vol. 17, no. 1, pp. 66–83, 2009. [110] H. Liang, J. Dines, and L. Saheer, “A comparison of supervised and unsupervised cross-lingual speaker adaptation approaches for HMM- based speech synthesis,” in Acoustics Speech and Signal Processing (ICASSP), 2010 IEEE International Conference on. IEEE, 2010, pp. 4598–4601. [111] M. Gibson and W. Byrne, “Unsupervised intralingual and cross-lingual speaker adaptation for HMM-based speech synthesis using two-pass decision tree construction,” Audio, Speech, and Language Processing, IEEE Transactions on, vol. 19, no. 4, pp. 895–904, May 2011. [112] Z.-H. Ling, L. Deng, and D. Yu, “Modeling spectral envelopes using restricted boltzmann machines and deep belief networks for statistical parametric speech synthesis,” Audio, Speech, and Language Processing, IEEE Transactions on, vol. 21, no. 10, pp. 2129–2139, 2013. [113] H. Zen and A. Senior, “Deep mixture density networks for acoustic modeling in statistical parametric speech synthesis,” in Acoustics, Speech and Signal Processing (ICASSP), 2014 IEEE International Conference on. IEEE, 2014, pp. 3844–3848. [114] K. Hashimoto, K. Oura, Y. Nankaku, and K. Tokuda, “The effect of neural networks in statistical parametric speech synthesis,” in Acoustics, Speech and Signal Processing (ICASSP), 2015 IEEE International Conference on. IEEE, 2015, pp. 4455–4459. [115] B. Potard, P. Motlicek, and D. Imseng, “Preliminary work on speaker adaptation for DNN-based speech synthesis,” Idiap, Tech. Rep., 2015. [116] Z. Wu, P. Swietojanski, C. Veaux, S. Renals, and S. King, “A study of speaker adaptation for DNN-based speech synthesis,” in Interspeech 2015, 2015. [117] J. Ba and R. Caruana, “Do deep nets really need to be deep?” in Advances in Neural Information Processing Systems, 2014, pp. 2654– 2662. [118] J. Li, R. Zhao, J.-T. Huang, and Y. Gong, “Learning small-size DNN with output-distribution-based criteria,” in Proceedings of the Annual Conference of International Speech Communication Association (INTERSPEECH), September 2014. [Online]. Available: http://research.microsoft.com/apps/pubs/default.aspx?id=230080 [119] W. Chan, N. R. Ke, and I. Lane, “Transferring knowledge from a RNN to a DNN,” arXiv preprint arXiv:1504.01483, 2015. [120] A. Romero, N. Ballas, S. E. Kahou, A. Chassang, C. Gatta, and Y. Ben- gio, “Fitnets: Hints for thin deep nets,” arXiv preprint arXiv:1412.6550, 2014. [121] M. Long and J. Wang, “Learning transferable features with deep adaptation networks,” arXiv preprint arXiv:1502.02791, 2015. [122] Y. Lu, “Unsupervised learning of neural network outputs,” arXiv preprint arXiv:1506.00990, 2015. [123] N. Chen, Y. Qian, and K. Yu, “Multi-task learning for text-dependent speaker verification,” in Sixteenth Annual Conference of the Interna- tional Speech Communication Association, 2015. [124] R. F´er, P. Matejka, F. Gr´ezl, O. Plchot, and J. Cernock`y, “Multilingual bottleneck features for language recognition,” in Sixteenth Annual Conference of the International Speech Communication Association, 2015. [125] G. Durrett, A. Pauls, and D. Klein, “Syntactic transfer using a bilingual lexicon,” in Proceedings of the 2012 Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning. Association for Computational Linguistics, 2012, pp. 1–11. [126] L. Shi, R. Mihalcea, and M. Tian, “Cross language text classification by model translation and semi-supervised learning,” in Proceedings of the 2010 Conference on Empirical Methods in Natural Language Processing. Association for Computational Linguistics, 2010, pp. 1057–1067. [127] X. Ma, X. Wang, and D. Wang, “Recognize foreign low-frequency words with similar pairs,” in Interspeech 2015, 2015. [128] P. Koehn, Statistical machine translation. Cambridge University Press, 2009. [129] W. De Smet, J. Tang, and M.-F. Moens, “Knowledge transfer across topics,” in Advances in Knowledge multilingual corpora via latent Discovery and Data Mining. Springer, 2011, pp. 549–560. [130] O. Tackstrom, R. McDonald, and J. Uszkoreit, “Cross-lingual word clusters for direct transfer of linguistic structure,” in Proceedings of the 2012 Conference of the North American Chapter of the Associ- ation for Computational Linguistics: Human Language Technologies. Association for Computational Linguistics, 2012, pp. 477–487. [131] O. Tackstrom, “Nudging the envelope of direct transfer methods for multilingual named entity recognition,” in Proceedings of the NAACL- HLT Workshop on the Induction of Linguistic Structure. Association for Computational Linguistics, 2012, pp. 55–63. [132] Y. Bengio, H. Schwenk, J.-S. Sen´ecal, F. Morin, and J.-L. Gauvain, “Neural probabilistic language models,” in Innovations in Machine Learning. Springer, 2006, pp. 137–186. [133] A. Mnih and G. E. Hinton, “A scalable hierarchical distributed language model,” in NIPS, 2008, pp. 1081–1088. [134] J. Turian, L. Ratinov, and Y. Bengio, “Word representations: a simple and general method for semi-supervised learning,” in Proceedings of the association for computational linguistics. Association for Computational Linguistics, 2010, pp. 384– 394. the 48th annual meeting of [135] R. Collobert, J. Weston, L. Bottou, M. Karlen, K. Kavukcuoglu, and P. Kuksa, “Natural language processing (almost) from scratch,” The Journal of Machine Learning Research, vol. 12, pp. 2493–2537, 2011. [136] T. Mikolov, K. Chen, G. Corrado, and J. Dean, “Efficient estimation of word representations in vector space,” arXiv preprint arXiv:1301.3781, 2013. [137] T. Mikolov, Q. V. Le, and I. Sutskever, “Exploiting similarities among languages for machine translation,” arXiv preprint arXiv:1309.4168, 2013. [138] C. Xing, D. Wang, C. Liu, and Y. Lin, “Normalized word embedding and orthogonal transform for bilingual word translation,” in NAACL’15, 2015. [139] M. Faruqui and C. Dyer, “Improving vector space word representa- tions using multilingual correlation,” in EACL’14. Association for Computational Linguistics, 2014. [140] A. Klementiev, I. Titov, and B. Bhattarai, “Inducing crosslingual distributed representations of words,” in COLING’12. Citeseer, 2012. [141] K. M. Hermann and P. Blunsom, “Multilingual models for composi- tional distributed semantics,” arXiv preprint arXiv:1404.4641, 2014. [142] S. Gouws, Y. Bengio, and G. Corrado, “Bilbowa: Fast bilingual distributed representations without word alignments,” arXiv preprint arXiv:1410.2455, 2014. [143] E. Bruni, G. Boleda, M. Baroni, and N.-K. Tran, “Distributional semantics in technicolor,” in Proceedings of the 50th Annual Meeting of the Association for Computational Linguistics: Long Papers-Volume 1. Association for Computational Linguistics, 2012, pp. 136–145. [144] C. W. Leong and R. Mihalcea, “Going beyond text: A hybrid image- text approach for measuring word relatedness.” in IJCNLP, 2011, pp. 1403–1407. [145] R. Socher and L. Fei-Fei, “Connecting modalities: Semi-supervised segmentation and annotation of images using unaligned text corpora,” in Computer Vision and Pattern Recognition (CVPR), 2010 IEEE Conference on. IEEE, 2010, pp. 966–973. [146] A. Frome, G. S. Corrado, J. Shlens, S. Bengio, J. Dean, T. Mikolov et al., “Devise: A deep visual-semantic embedding model,” in Advances in Neural Information Processing Systems, 2013, pp. 2121–2129. [147] R. Kiros, R. Salakhutdinov, and R. Zemel, “Multimodal neural lan- guage models,” in Proceedings of the 31st International Conference on Machine Learning (ICML-14), 2014, pp. 595–603. [148] R. Socher, A. Karpathy, Q. V. Le, C. D. Manning, and A. Y. Ng, “Grounded compositional semantics for finding and describing images with sentences,” Transactions of the Association for Computational Linguistics, vol. 2, pp. 207–218, 2014. [149] N. Srivastava and R. R. Salakhutdinov, “Multimodal learning with deep boltzmann machines,” in Advances in neural information processing systems, 2012, pp. 2222–2230. [150] L. Mou, G. Li, Y. Xu, L. Zhang, and Z. Jin, “Distilling word embeddings: An encoding approach,” arXiv preprint arXiv:1506.04488, 2015. [151] D. Zhang, T. Luo, D. Wang, and R. Liu, “Learning from LDA using deep neural networks,” arXiv preprint arXiv:1508.01011, 2015. [152] M. Long, J. Wang, G. Ding, D. Shen, and Q. Yang, “Transfer learning with graph co-regularization,” Knowledge and Data Engineering, IEEE Transactions on, vol. 26, no. 7, pp. 1805–1818, 2014.
1804.02135
3
1804
2019-02-11T09:41:22
Expressive Speech Synthesis via Modeling Expressions with Variational Autoencoder
[ "cs.CL", "cs.SD", "eess.AS" ]
Recent advances in neural autoregressive models have improve the performance of speech synthesis (SS). However, as they lack the ability to model global characteristics of speech (such as speaker individualities or speaking styles), particularly when these characteristics have not been labeled, making neural autoregressive SS systems more expressive is still an open issue. In this paper, we propose to combine VoiceLoop, an autoregressive SS model, with Variational Autoencoder (VAE). This approach, unlike traditional autoregressive SS systems, uses VAE to model the global characteristics explicitly, enabling the expressiveness of the synthesized speech to be controlled in an unsupervised manner. Experiments using the VCTK and Blizzard2012 datasets show the VAE helps VoiceLoop to generate higher quality speech and to control the expressions in its synthesized speech by incorporating global characteristics into the speech generating process.
cs.CL
cs
Expressive Speech Synthesis via Modeling Expressions with Variational Autoencoder Kei Akuzawa1, Yusuke Iwasawa1, Yutaka Matsuo1 1Graduate School of Engineering, The University of Tokyo, Japan {akuzawa-kei,iwasawa,matsuo}@weblab.t.u-tokyo.ac.jp 9 1 0 2 b e F 1 1 ] L C . s c [ 3 v 5 3 1 2 0 . 4 0 8 1 : v i X r a Abstract Recent advances in neural autoregressive models have improve the performance of speech synthesis (SS). However, as they lack the ability to model global characteristics of speech (such as speaker individualities or speaking styles), particularly when these characteristics have not been labeled, making neural au- toregressive SS systems more expressive is still an open issue. In this paper, we propose to combine VoiceLoop, an autoregres- sive SS model, with Variational Autoencoder (VAE). This ap- proach, unlike traditional autoregressive SS systems, uses VAE to model the global characteristics explicitly, enabling the ex- pressiveness of the synthesized speech to be controlled in an unsupervised manner. Experiments using the VCTK and Bliz- zard2012 datasets show the VAE helps VoiceLoop to generate higher quality speech and to control the expressions in its syn- thesized speech by incorporating global characteristics into the speech generating process. Index Terms: autoregressive model, variational autoencoder, expressive speech synthesis 1. Introduction Natural human speech is very expressive, and varies based on the speaker individualities (such as age and gender), emotions and speaking styles (see, e.g., [1, 2]). Many studies have suggested properly incorporating such expressiveness makes speech synthesis (SS) systems more pleasant to listen to and interact with, and have investigated the problem of expressive speech synthesis (see, e.g., [2, 3, 4]). This paper addresses the problem of synthesizing expres- sive speech without relying on speech expression labels, which we refer to as unsupervised expressive speech synthesis (UESS). Many studies have reported that such labels are helpful for mod- eling complex audio data [5, 6, 4, 7]. Unsupervised meth- ods, however, are more desirable because expressive speech is easy to obtain from video hosting websites (e.g., Youtube) or audiobooks but annotating such sources is costly. Moreover, manually-annotated labels are not always reliable: for example, not all emotions in a given category have the same strength [4]. Another important aspect of this paper is that it focuses on the neural autoregressive models, which have been shown to offer significant performance improvements to SS systems. For example, WaveNet [8] generates more natural speech than traditional parametric or unit-selection based SS methods. In addition, autoregressive-based sequence-to-sequence (seq2seq) speech synthesis models have simple structure, and can be trained on <text, audio> pairs with minimal human annotation. Such end-to-end systems have many advantages, for example, they alleviate the need for laborious feature engineering, which may involve heuristics, and are likely to be more robust than multi-stage models where each component's errors can com- pound [9]. However, finding ways to add the expressiveness to autore- gressive SS models is still an open issue. One of the diffi- culties here is such models are typically unable to model the global characteristics of data because they model data densities autoregressively, i.e., point-by-point [10, 11]. Given that cer- tain sources of speech expressiveness (e.g., gender or emotions) characterize speech in a global manner (sentence level), autore- gressive SS models may suffer from the difficulty: it reduces the quality of the synthesized speech, and they have no structured way to control the expressions in the synthesized speech. In this paper, we propose a model called VAE-Loop, which combines VoiceLoop [12], an autoregressive SS model, with Variational Autoencoer (VAE) [13]. Several recent studies (e.g., [14]) have shown VAEs can model global characteristics of speech such as speaker individualities, but to our knowledge no study has yet suggested using VAEs for SS or UESS. We use VAE to deal with the problem incorporatig global charac- teristics into the speech generating process when using an au- toregressive model for UESS. Specifically, VAE encodes such global characteristics as a tractable probability distribution, which is used to give hints about them to VoiceLoop, allowing it to generate higher quality speech and to control the expressions in the synthesized speech. The proposed VAE-based method is both effective and simple, trained in end-to-end as well as seq2seq SS models. Our experiments show, by incorpolating global characteris- tics in this way, the VAE can help VoiceLoop to attain lower test errors and higher mean opinion scores (MOSs) when no labels are available. Also, latent variables yielded by the VAE show it has the ability to control speaker individualities and speaking styles, and interpolate between them. 2. Related Work Seq2seq SS systems have simple structures that directly predict acoustic features from text. In addition, they have demonstrated the ability to generate natural and intelligible speech [9, 15, 16] and to robustly handle different prosodies [12, 17]. [12] has shown even when VoiceLoop is trained on data obtained from YouTube containing various speaking styles, it can generate high quality speech. We have incorporated VoiceLoop into the proposed model, expecting that it will be effective for UESS. Several studies tackled the problem of UESS on both neu- ral autoregressive and non-neural paradigm. On the non-neural paradigm, representation of emotions, acquired by unsuper- vised learning methods such as clustering and principal com- ponent analysis, have been used to generate speech [2, 3, 18]. The most relevant works to ours might be [19, 12], which pro- posed the seq2seq SS models that can learn and control speak- ing styles in an unsupervised manner. However, the proposed VAE-based method is different in that it learns speech expres- sions as a tractable distribution, which can be useful for down- stream tasks such as interpolation and semi-supervised learning. [2, 18] pointed out that UESS can be divided into two parts: predicting expressive information from text; and synthesizing the speech with a particular expression. In this paper only the latter stage is considered for simplicity. Several recent studies have proposed using VAEs for mod- eling speech [20, 21, 14, 22, 23]. The most relevant works might be [21, 23], which conditioned the VAE on speaker labels and perform voice conversion. In contrast, we perform SS by con- ditioning the model on text, and verify that the VAE as a SS model is also able to learn and control speech expressions. Many other studies in areas outside the SS field have also proposed combining VAEs and autoregressive models. For ex- ample, it has been shown a recurrent neural network language model combined with VAE can generate sentences with consis- tent global characteristics (e.g., style, topics) [24] . That study pointed out also the issue that autoregressive models often ig- nore the latent variables obtained from the VAE. Several authors have proposed countermeasures for dealing with this problem [11, 25, 22]. Based on these studies, we employ the KL cost annealing approach used in [24] to alleviate this problem. 3. Models introduce conditional VAE and In this section, we first VoiceLoop, which form the basis of the proposed method, and then present our VAE-Loop method. (cid:90) (cid:90) 3.1. Conditional Variational Autoencoder Here we present the variant of VAE used in VAE-Loop, which is simply conditioned on the auxiliary features c. In this study, x and c correspond to the acoustic features and phonemes, re- spectively. Using the latent variable vector z and the approximate distribution qφ(zx, c) (with parameter φ) of the true poste- rior pθ(zx, c) (with parameter θ), we can obtain the follow- ing lower bound L(θ, φ; x, c) on the marginal likelihood of pθ(xc): L(θ, φ; x, c) = = qφ(zx, c) log qφ(zx) log pθ(x, zc) qφ(zx, c) dz pθ(x,z, c)p(z) qφ(zx) (1) dz (2) = −DKL(qφ(zx)p(z)) + Eqφ(zx)[log pθ(xz, c)] (3) where we have assumed qφ(zx, c) = qφ(zx) and p(zc) = p(z) for simplicity. The prior p(z) and approximate poste- rior qφ(zx) are modeled by Gaussian distributions, namely p(z) = N (z0, I) and qφ(zx) = N (zµφ(x), σ2 During training, we update the parameters θ and φ to maxi- mize L. We call qφ(zx) an encoder and pθ(xz, c) a decoder. φ(x)I). 3.2. VoiceLoop Let x = [x1, ..., xT ] be a variable length sequence of audio features that we want to predict. VoiceLoop can be regarded as a conditional autoregressive model with a parameter ξ as follows: T(cid:89) Next, we t ∈ T . Eq.(5) assumes pξ(xtx1:t−1, c) is modeled by a Gaus- sian distribution with mean µξ and variance I (identity matrix). estimating pξ(xtx1:t−1, c). VoiceLoop has a shifting buffer, which can be seen as a matrix S ∈ Rd×k with columns S[1]...S[k]. At each time step, all the columns shift to the right as follows: procedure describe the for St[i + 1] = St−1[i] f or 1 ≤ i < k St[1] = u (6) (7) Here, u is a function of four parameters, namely the current attention-mediated context ct, buffer St−1 itself, latest "spo- ken" output xt−1 and speaker embedding s, as follows: Ct =[ct + tanh(Fu(s)), xt−1] u =Nu([St−1, Ct]) (8) (9) where [a, b] is the concatenation of the two column vectors a and b to one column vector. VoiceLoop then estimates xt using the buffer St and embedding s, as follows: xt = No(St + Fo(s)) (10) where Fu, Nu, Fo and No are the respective neural networks, and xt is equivalent to µξ in Eq.(5). 3.3. Proposed model: VAE-Loop VoiceLoop has no structured way to model the complex global characteristics in an unsupervised manner since it relies on the point-by-point estimation. In contrast, VAE-Loop explicitly in- corporates them into the speech generating process in the VAE framework. Specifically, VAE-Loop regards VoiceLoop as a de- coder for the conditional VAE, i.e., VoiceLoop is conditioned on the global latent variable z. 3.3.1. Modeling various expressions using VAE We first change VoiceLoop's probability distribution (Eq.(4) and (5)) so that it is conditioned on the latent variable z, as follows: pθ(xz, c) = pθ(xtx1:t−1, z, c) pθ(xtx1:t−1, z, c) = N (xtµθ(x1:t−1, z, c), I) t=1 (11) (12) where we have set ξ = θ because VoiceLoop is regarded as the decoder in Eq.(3). In the VAE framework, information which is useful to esti- mate x but is not contained in the text c is encoded into z. Since certain types of expressions are difficult to predict from the spo- ken text alone, z is expected to acquire latent representations of such expressions (i.e., the global characteristics). 3.3.2. Generating speech using the global latent variable The pθ(xtx1:t−1, z, c) in Eq.(12) is estimated by changing Eq.(9) to incorporate the latent variable z into the speech gen- erating process of VoiceLoop, as follows: T(cid:89) pξ(xc) = pξ(xtx1:t−1, c) (4) u = Nu([St−1, Ct, z]) (13) t=1 pξ(xtx1:t−1, c) = N (xtµξ(x1:t−1, c), I) (5) where x1:t−1 is the audio features between time steps 1 and t− 1 and we estimate pξ(xtx1:t−1, c) in order for each time step As previously mentioned, z is expected to acquire the expres- sion information. In addition, since z does not depend on the time step t unlike St−1 and Ct, it conditions the speech gener- ating process in a global manner. Table 1: Test errors for different numbers of annealing epochs and z dimensions, on the VCTK dataset. Model annealing epochs VoiceLoop (w/o) N/A VoiceLoop (w/) N/A 0 VAE-Loop 15(10%) VAE-Loop 30(20%) VAE-Loop 15 VAE-Loop VAE-Loop 15 KLD z-dim Rec. error term 15.946 N/A 15.759 N/A 0.073 15.832 0.090 15.684 0.086 15.749 0.082 15.839 15.724 0.084 N/A N/A 64 64 64 32 128 Total 15.946 15.759 15.905 15.774 15.835 15.921 15.808 samples from 109 English speakers. We used the version of the dataset from VoiceLoop's source code page1 instead of the complete VCTK, in order to replicate the conditions of [12]. This contained about 5 hours of speech by 21 North American speakers (4 males and 17 females), and each utterance lasted less than 5 seconds. Our second dataset was from the Blizzard Challenge 2012 (Blizzard2012), and consisting of four audio- books [27, 28]. Audiobooks are often used by expressive speech synthesis studies because they include a variety of emotions and speaking styles. Unlike those in the VCTK, all the utterances in this dataset were read by the same male speaker. To match the conditions with VCTK and avoid exploding gradients, we used utterances of less than 5 seconds only, resulting in a total of about 10 hours of speech. Both of the datasets were divided into three parts, with 90% used for training and the remaining 10% used for validation, with 50 samples set aside as test data. 4.2. Experimental setup We used DNN based on time-domain convolution for the en- coder of VAE-Loop. Specifically, the first half of the encoder consisted of five repeated convolutional layers with a stride size 2, with dropout, batch normalization and ReLU, while the rest consisted of time-domain global max-pooling and fully con- nected layers. The model hyperparameters used for the base- line VoiceLoop and VAE-Loop decoder were the same as in the authers' implementation1. During training, we employ a variant of teacher forcing technique as well as the original VoiceLoop [12], which aims to stabilize both training and inference. We refer to this as semi- teacher-forcing. Specifically, xt−1 used as input to the network Nu in Eq.(8) is replaced by xt−1 bellow: xt−1 + xt−1 + η (16) xt−1 = 2 where we assumed η ∼ N (0, I). Unless otherwise noted, we used the Adam [29] optimizer and 150 training epochs. The learning rate was chosen to achieve the minimum possible validation error from the set [1e- 3, 1e-4, 5e-5, 1e-5], resulting in 1e-4 and 5e-5 for the VCTK and Blizzard2012, respectively. Figure 1: Speech generating process of VAE-Loop T(cid:88) 3.3.3. Training and inference By combining Eq.(3) and (11), we can obtain the objective func- tion of VAE-Loop: L(θ, φ; x, c) = − DKL(qφ(zx)p(z))+ Eqφ(zx)[ log pθ(xtx1:t−1, z, c)] (14) t=1 where the first and second terms are the regularizer and recon- struction error, respectively. We can estimate the reconstruction error by taking the mean squared error between the estimators xt and true audio features xt. The second term is thus equiva- lent to the objective function of the original VoiceLoop, except that z is used in the generating process. At training, z is sampled from the encoder. Here, as with a conventional VAE, the encoder qφ(zx) is parameterized as a deep neural network (DNN). At inference, z is sampled from the prior p(z). Figure 1 illustrates the speech generating pro- cess of VAE-Loop, showing its training and inference proce- dures are simple; and do not not require any additional training stage or data preprocessing compared with VoiceLoop alone. In addition, in spite of these simple procedures, it offers higher performance as we will demonstrate in Section 4. 3.3.4. KL cost annealing We exploit the ideas outside the SS field and employ the simple KL cost annealing technique to alleviate the problem that au- toregressive models often ignore the latent variables [24]. They argued that the latent variables were ignored because the reg- ularizer in Eq.(14), which we call Kullback-Leibler divergence (KLD) term, acted too strongly at the start of training; therefore, Eq.(14) is adjusted to include the weight λ, as follows: L(θ, φ; x, c) = − λDKL(qφ(zx)p(z))+ Eqφ(zx)[ log pθ(xtx1:t−1, z, c)] (15) T(cid:88) t=1 We set λ to 0 at the start of training so that the model learns to encode as much information as possible, and then increase it linealy to 1 over the course of the annealing process. 4. Experiments 4.1. Datasets We used two datasets: one featuring multiple speakers and an- other containig a variety of emotions and speaking styles. The first was VCTK Corpus[26] (VCTK), which contains speech 4.3. Effect of latent variables on the test error We compared the test errors for VAE-Loop with those for VoiceLoop alone, to demonstrate how adding latent variables to VoiceLoop enables it to estimate audio features more ac- curately. For this experiment, the models were trained on the VCTK, using the setup described in Section 4.2. However, to stabilize training on various hyperparameters, we set the learn- ing rate to 5e-5. In addition, since the baseline VoiceLoop had not converged sufficiently after 150 epochs at that learning rate, 1https://github.com/facebookresearch/loop/ Table 2: Mean opinion scores (mean CI) for both datasets. Method Ground Truth VoiceLoop(w/o) VoiceLoop(w/) VoiceLoop(orig, w/) VAE-Loop(σ = 1) VAE-Loop(σ = 0.7) VAE-Loop(σ = 0) VCTK Blizzard2012 3.94 ± 0.30 2.23 ± 0.24 N/A N/A 2.47 ± 0.32 2.89 ± 0.32 3.03 ± 0.32 4.07 ± 0.23 2.51 ± 0.34 3.24 ± 0.27 3.57 3.25 ± 0.29 N/A N/A we extended the training period to 200 epochs. We tested with annealing for 10 or 20% of the training period, and without annealing. The test errors were calculated using semi-teacher- forcing in order to use the same objective function as during training. Table 1 presents the test errors, calculated using Eq.(14) and then divided by the sequence length. Here, (w) and (w/o) mean "with speaker labels" and "without speaker labels" re- spectively. These show proper use of KL cost annealing leads to a higher KLD term and a lower test error, suggesting it al- lows the decoder (VoiceLoop) to recieve more useful informa- tion from the latent variables. Moreover, the test errors of VAE- loop is smaller than that of VoiceLoop without speaker labels, suggesting incorporating latent variables into the speech gen- erating process enables VoiceLoop to estimate audio features more accurately. 4.4. Mean opinion score tests To demonstrate that incorporating global characteristics enables VAE-Loop to generate higher quality speech, we conducted an mean opinion score (MOS) study, using the crowdMOS toolkit [30] and Amazon Mechanical Turk. The MOS is a popular sub- jective audio quality measure, obtained by asking people to rate the audio's naturalness on a scale of 1 to 5. More than 15 people living in the US rated each of the two datasets. Table 2 shows MOSs for the two models, together with their 95% confidence intervals(CIs). Here, "Ground Truth" recordings were the audio reconstructed using the WORLD vocoder [31]. For the VCTK, the MOS achieved by VAE-Loop was higher than that by VoiceLoop without speaker labels, match- ing even VoiceLoop with labels, despite not using labels. In addition, in our informal listening tests, we observed VAE- Loop was less likely than the baseline to generate unintelli- gible speech (e.g., several seconds of just breath or a certain phoneme). Therefore, these results could indicate that where the original VoiceLoop struggled to model the various speaker individualities, adding VAE stabilized its speech generating process by giving hints about them. Here, we acknowledge that VoiceLoop's MOS by our inplementation is lower than that reported in [12] ("VoiceLoop(orig, w/)" in Table 2), probably because there might be a different choice of hyperparameters, including the use of pre-training. For the Blizzard2012, we observed that the high variance of the p(z) used for generating test samples meant VAE-Loop often generated unintelligible speech in much the same way as VoiceLoop. To investigate this issue, we instead assumed that p(z) = N (z0, σ2I) at inference time, and sampled z using different parameters σ, where σ = 0 means we always sam- ple z = 0. When the variance of p(z) was suppressed, in this way, VAE-Loop's MOS improved, exceeding that of the baseline. Here, note that using small σ values means always sampling similar z values; therefore, VAE-Loop can make a tradeoff between stable inference and latent variable variety. Figure 2: F0 Trajectories for two utterances generated by VAE- Loop, trained on VCTK. Here, z1 and z2 correspond to high- pitched (female as we heard) and low-pitched (male) voices, re- spectively. Averaged F0 trajectories are also shown, generated by interpolating between z1 and z2. Figure 3: F0 Trajectories for two utterances generated by VAE- Loop, trained on Blizzard2012. Here, z1 and z2 correspond to voices with large (dramatic as we heard) and small (calm) pitch fluctuations, respectively. 4.5. Controlling speech expressions using latent variables To demonstrate that VAE-Loop is able to control the expers- sions in its synthesized speech, we presented the trajectories of the fundamental frequency (F0). Figure 2 shows F0 trajectories generated by VAE-Loop, trained on the VCTK. The left and right figures correspond to different texts; however, both were generated using the same z values. Here, different latent vari- able values, z1 and z2, lead to different F0 characteristics, indi- cating our model can control speaker individualities expressed in the sythesized speech using latent variables. Moreover, when the speech is synthesized using a latent variable value that in- terpolated between previous two, the F0 trajectories were also averaged. Likewise, Figure 3 shows F0 trajectories generated by VAE-Loop, trained on the Blizzard2012. Here, the latent variables characterize the pitch fluctuations of the F0 trajecto- ries. Some audio samples can be found at: https://akuzeee.github.io/VAELoopDemo/. 5. Conclusions In this paper, we have proposed to combine VoiceLoop with VAE, in order to enable this autoregressive SS model to be more expressive by using VAE to help model a range of ex- pressions. Even though autoregressive SS models have shown promising results, they typically lack the ability to model the global characteristics of speech. However, the proposed method can incorporate such expressions explicitly into the speech gen- erating process in an unsupervised manner. Our experiments have shown taking advantage of these global characteristics could enable our method to generate higher quality speech than VoiceLoop without labels and to control speech expressions. In future studies, we plan to extend this approach to semi- supervised learning with a small amount of labeled data, and to infer the latent variables from text. [19] Y. Wang, R. J. Skerry-Ryan, Y. Xiao, D. Stanton, J. Shor, E. Battenberg, R. Clark, and R. A. Saurous, "Uncovering Latent Style Factors for Expressive Speech Synthesis," CoRR, vol. abs/1711.00520, 2017. [Online]. Available: http://arxiv.org/abs/ 1711.00520 [20] M. Blaauw and J. Bonada, "Modeling and Transforming Speech Using Variational Autoencoders," in Proc. Interspeech 2016, 2016, pp. 1770 -- 1774. [21] C. C. Hsu, H. T. Hwang, Y. C. Wu, Y. Tsao, and H. M. Wang, "Voice conversion from non-parallel corpora using variational auto-encoder," in 2016 Asia-Pacific Signal and Information Pro- cessing Association Annual Summit and Conference (APSIPA), Dec 2016, pp. 1 -- 6. [22] A. van den Oord, O. Vinyals, and k. kavukcuoglu, "Neural Dis- crete Representation Learning," in Advances in Neural Informa- tion Processing Systems 30, 2017, pp. 6306 -- 6315. [23] C.-C. Hsu, H.-T. Hwang, Y.-C. Wu, Y. Tsao, and H.-M. Wang, "Voice conversion from unaligned corpora using variational au- toencoding wasserstein generative adversarial networks," in Proc. Interspeech 2017, 2017, pp. 3364 -- 3368. [24] S. R. Bowman, L. Vilnis, O. Vinyals, A. M. Dai, R. J´ozefowicz, and S. Bengio, "Generating Sentences from a Continuous Space," in Proceedings of the 20th SIGNLL Conference on Computational Natural Language Learning, 2016. [25] X. Chen, D. P. Kingma, T. Salimans, Y. Duan, P. Dhariwal, J. Schulman, I. Sutskever, and P. Abbeel, "Variational Lossy Au- toencoder," in Proc. 5th International Conference on Learning Representations, 2017. [26] C. Veaux, J. Yamagishi, and K. MacDonald, "CSTR VCTK Corpus: English Multi-speaker Corpus for CSTR Voice Cloning Toolkit," 2017. [Online]. Available: http://dx.doi.org/10.7488/ds/ 1994 [27] S. King and V. Karaiskos, "The blizzard challenge 2012," in Proc. Blizzard Challenge workshop, 2012. [28] N. Braunschweiler, M. J. F. Gales, and S. Buchholz, "Lightly su- pervised recognition for automatic alignment of large coherent speech recordings," in Proc. interspeech 2010, 2010, pp. 2222 -- 2225. [29] D. P. Kingma and J. Ba, "Adam: A Method for Stochastic Op- timization," in Proc. 3rd International Conference on Learning Representations, 2015. [30] F. Ribeiro, D. Florłncio, C. Zhang, and M. Seltzer, "CROWD- MOS: An approach for crowdsourcing mean opinion score stud- ies," in 2011 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), May 2011, pp. 2416 -- 2419. [31] M. Morise, F. YOKOMORI, and K. Ozawa, "WORLD: A Vocoder-Based High-Quality Speech Synthesis System for Real- Time Applications," in IEICE Transactions on Information and Systems, vol. E99.D, 07 2016, pp. 1877 -- 1884. 6. References [1] D. Erickson, "Expressive speech: Production, perception and ap- plication to speech synthesis," Acoustical Science and Technol- ogy, vol. 26, no. 4, pp. 317 -- 325, 2005. [2] F. Eyben, S. Buchholz, and N. Braunschweiler, "Unsupervised clustering of emotion and voice styles for expressive TTS," in 2012 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), March 2012, pp. 4009 -- 4012. [3] M. Charfuelan and I. Steiner, "Expressive speech synthesis in MARY TTS using audiobook data and emotionML." in Proc. in- terspeech 2013, 2013, pp. 1564 -- 1568. [4] G. E. Henter, J. Lorenzo-Trueba, X. Wang, and J. Yamagishi, "Principles for Learning Controllable TTS from Annotated and Latent Variation," in Proc. Interspeech 2017, 2017, pp. 3956 -- 3960. [5] Y. Fan, Y. Qian, F. K. Soong, and L. He, "Multi-speaker modeling and speaker adaptation for DNN-based TTS synthesis," in 2015 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), April 2015, pp. 4475 -- 4479. [6] H. T. Luong, S. Takaki, G. E. Henter, and J. Yamagishi, "Adapting and controlling DNN-based speech synthesis using input codes," in 2017 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), March 2017, pp. 4905 -- 4909. [7] Y. Lee, A. Rabiee, and S. Lee, "Emotional End-to-End Neural Speech Synthesizer," CoRR, vol. abs/1711.05447, 2017. [Online]. Available: http://arxiv.org/abs/1711.05447 [8] A. van den Oord, S. Dieleman, H. Zen, K. Simonyan, O. Vinyals, A. Graves, N. Kalchbrenner, A. W. Senior, and K. Kavukcuoglu, "WaveNet: A Generative Model for Raw Audio," CoRR, vol. abs/1609.03499, 2016. [Online]. Available: http://arxiv.org/abs/1609.03499 [9] Y. Wang, R. Skerry-Ryan, D. Stanton, Y. Wu, R. J. Weiss, N. Jaitly, Z. Yang, Y. Xiao, Z. Chen, S. Bengio, Q. Le, Y. Agiomyrgiannakis, R. Clark, and R. A. Saurous, "Tacotron: Towards End-to-End Speech Synthesis," in Proc. Interspeech 2017, 2017, pp. 4006 -- 4010. [10] A. Kolesnikov and C. H. Lampert, "PixelCNN models with auxil- iary variables for natural image modeling," in Proc. 34th Interna- tional Conference on Machine Learning, vol. 70, 2017, pp. 1905 -- 1914. [11] I. Gulrajani, K. Kumar, F. Ahmed, A. A. Taiga, F. Visin, D. Vazquez, and A. Courville, "PixelVAE: A Latent Variable Model for Natural Images," in Proc. 5th International Conference on Learning Representations, 2017. [12] Y. Taigman, L. Wolf, A. Polyak, and E. Nachmani, "VoiceLoop: Voice Fitting and Synthesis via a Phonological Loop," in Proc. 6th International Conference on Learning Representations, 2018. [13] D. P. Kingma and M. Welling, "Auto-Encoding Variational Bayes." in Proc. 2nd International Conference on Learning Rep- resentations, 2014. [14] W.-N. Hsu, Y. Zhang, and J. Glass, "Learning latent representa- tions for speech generation and transformation," in Proc. Inter- speech 2017, 2017, pp. 1273 -- 1277. [15] J. Sotelo, S. Mehri, K. Kumar, J. F. Santos, K. Kastner, A. Courville, and Y. Bengio, "Char2Wav: End-to-end speech syn- thesis," in International Conference on Learning Representations (Workshop Track), April 2017. [16] W. Ping, K. Peng, A. Gibiansky, S. O. Arik, A. Kannan, S. Narang, J. Raiman, and J. Miller, "Deep Voice 3: Scaling Text- to-Speech with Convolutional Sequence Learning," in Proc. 6th International Conference on Learning Representations, 2018. [17] S. Ronanki, O. Watts, and S. King, "A Hierarchical Encoder- Decoder Model for Statistical Parametric Speech Synthesis," in Proc. Interspeech 2017, 2017, pp. 1133 -- 1137. [18] L. Chen, M. J. F. Gales, N. Braunschweiler, M. Akamine, and K. Knill, "Integrated Expression Prediction and Speech Synthesis From Text," IEEE Journal of Selected Topics in Signal Process- ing, vol. 8, no. 2, pp. 323 -- 335, April 2014.
1906.00790
2
1906
2019-06-13T20:07:28
Multi-task Pairwise Neural Ranking for Hashtag Segmentation
[ "cs.CL" ]
Hashtags are often employed on social media and beyond to add metadata to a textual utterance with the goal of increasing discoverability, aiding search, or providing additional semantics. However, the semantic content of hashtags is not straightforward to infer as these represent ad-hoc conventions which frequently include multiple words joined together and can include abbreviations and unorthodox spellings. We build a dataset of 12,594 hashtags split into individual segments and propose a set of approaches for hashtag segmentation by framing it as a pairwise ranking problem between candidate segmentations. Our novel neural approaches demonstrate 24.6% error reduction in hashtag segmentation accuracy compared to the current state-of-the-art method. Finally, we demonstrate that a deeper understanding of hashtag semantics obtained through segmentation is useful for downstream applications such as sentiment analysis, for which we achieved a 2.6% increase in average recall on the SemEval 2017 sentiment analysis dataset.
cs.CL
cs
Multi-task Pairwise Neural Ranking for Hashtag Segmentation Mounica Maddela1, Wei Xu1, Daniel Preot¸iuc-Pietro2 1 Department of Computer Science and Engineering, The Ohio State University [email protected] {maddela.4, xu.1265}@osu.edu 2 Bloomberg LP 9 1 0 2 n u J 3 1 ] L C . s c [ 2 v 0 9 7 0 0 . 6 0 9 1 : v i X r a Abstract Hashtags are often employed on social me- dia and beyond to add metadata to a tex- tual utterance with the goal of increasing dis- coverability, aiding search, or providing addi- tional semantics. However, the semantic con- tent of hashtags is not straightforward to infer as these represent ad-hoc conventions which frequently include multiple words joined to- gether and can include abbreviations and un- orthodox spellings. We build a dataset of 12,594 hashtags split into individual segments and propose a set of approaches for hash- tag segmentation by framing it as a pairwise ranking problem between candidate segmen- tations.1 Our novel neural approaches demon- strate 24.6% error reduction in hashtag seg- mentation accuracy compared to the current state-of-the-art method. Finally, we demon- strate that a deeper understanding of hash- tag semantics obtained through segmentation is useful for downstream applications such as sentiment analysis, for which we achieved a 2.6% increase in average recall on the Se- mEval 2017 sentiment analysis dataset. 1 Introduction A hashtag is a keyphrase represented as a sequence of alphanumeric characters plus underscore, pre- ceded by the # symbol. Hashtags play a cen- tral role in online communication by providing a tool to categorize the millions of posts generated daily on Twitter, Instagram, etc. They are useful in search, tracking content about a certain topic (Berardi et al., 2011; Ozdikis et al., 2012), or dis- covering emerging trends (Sampson et al., 2016). Hashtags often carry very important informa- tion, such as emotion (Abdul-Mageed and Ungar, 1Our toolkit along with the code and data are pub- licly available at https://github.com/mounicam/ hashtag_master Type Named-entity (33.0%) Events (14.8%) Standard (43.6%) Non-standard (11.2%) Single-token Multi-token #toyotaprius #lionhead #ipv6summit #oscars #snowfall #epicfall #iloveu4eva #sayin Table 1: Examples of single- (47.1%) and multi-word hashtags (52.9%) and their categorizations based on a sample of our data. 2017), sentiment (Mohammad et al., 2013), sar- casm (Bamman and Smith, 2015), and named en- tities (Finin et al., 2010; Ritter et al., 2011). How- ever, inferring the semantics of hashtags is non- trivial since many hashtags contain multiple to- kens joined together, which frequently leads to multiple potential interpretations (e.g., lion head lionhead). Table 1 shows several exam- vs. ples of single- and multi-token hashtags. While most hashtags represent a mix of standard to- kens, named entities and event names are preva- lent and pose challenges to both human and auto- matic comprehension, as these are more likely to be rare tokens. Hashtags also tend to be shorter to allow fast typing, to attract attention or to sat- isfy length limitations imposed by some social me- dia platforms. Thus, they tend to contain a large number of abbreviations or non-standard spelling variations (e.g., #iloveu4eva) (Han and Baldwin, 2011; Eisenstein, 2013), which hinders their un- derstanding. The goal of our study is to build efficient meth- ods for automatically splitting a hashtag into a meaningful word sequence. Our contributions are: • A larger and better curated dataset for this task; • Framing the problem as pairwise ranking using novel neural approaches, in contrast to previous work which ignored the relative order of candi- date segmentations; • A multi-task learning method that uses differ- ent sets of features to handle different types of hashtags; • Experiments demonstrating that hashtag seg- mentation improves sentiment analysis on a benchmark dataset. Our new dataset includes segmentation for 12,594 unique hashtags and their associated tweets annotated in a multi-step process for higher qual- ity than the previous dataset of 1,108 hash- tags (Bansal et al., 2015). We frame the segmenta- tion task as a pairwise ranking problem, given a set of candidate segmentations. We build several neu- ral architectures using this problem formulation which use corpus-based, linguistic and thesaurus based features. We further propose a multi-task learning approach which jointly learns segment ranking and single- vs. multi-token hashtag clas- sification. The latter leads to an error reduction of 24.6% over the current state-of-the-art. Finally, we demonstrate the utility of our method by us- ing hashtag segmentation in the downstream task of sentiment analysis. Feeding the automatically segmented hashtags to a state-of-the-art sentiment analysis method on the SemEval 2017 benchmark dataset results in a 2.6% increase in the official metric for the task. 2 Background and Preliminaries Current approaches for hashtag segmentation can be broadly divided into three categories: (a) gaze- teer and rule based (Maynard and Greenwood, 2014; Declerck and Lendvai, 2015; Billal et al., 2016), (b) word boundary detection (C¸ elebi and Ozgur, 2017, 2016), and (c) ranking with lan- guage model and other features (Wang et al., 2011; Bansal et al., 2015; Berardi et al., 2011; Reuter et al., 2016; Simeon et al., 2016). Hashtag seg- mentation approaches draw upon work on com- pound splitting for languages such as German or Finnish (Koehn and Knight, 2003) and word seg- mentation (Peng and Schuurmans, 2001) for lan- guages with no spaces between words such as Chi- nese (Sproat and Shih, 1990; Xue and Shen, 2003). Similar to our work, Bansal et al. (2015) extract an initial set of candidate segmentations using a sliding window, then rerank them using a linear regression model trained on lexical, bigram and other corpus-based features. The current state-of- the-art approach (C¸ elebi and Ozgur, 2017, 2016) uses maximum entropy and CRF models with a combination of language model and hand-crafted features to predict if each character in the hashtag is the beginning of a new word. Generating Candidate Segmentations. Mi- crosoft Word Breaker (Wang et al., 2011) is, among the existing methods, a strong baseline for hashtag segmentation, as reported in C¸ elebi and Ozgur (2017) and Bansal et al. (2015). It employs a beam search algorithm to extract k best segmen- tations as ranked by the n-gram language model probability: n(cid:88) ScoreLM (s) = log P (wiwi−N +1 . . . wi−1) i=1 where [w1, w2 . . . wn] is the word sequence of seg- mentation s and N is the window size. More sophisticated ranking strategies, such as Bino- mial and word length distribution based ranking, did not lead to a further improvement in perfor- mance (Wang et al., 2011). The original Word Breaker was designed for segmenting URLs using language models trained on web data. In this pa- per, we reimplemented2 and tailored this approach to segmenting hashtags by using a language model specifically trained on Twitter data (implementa- tion details in §3.6). The performance of this method itself is competitive with state-of-the-art methods (evaluation results in §5.3). Our proposed pairwise ranking method will effectively take the top k segmentations generated by this baseline as candidates for reranking. However, in prior work, the ranking scores of each segmentation were calculated independently, ignoring the relative order among the top k can- didate segmentations. To address this limitation, we utilize a pairwise ranking strategy for the first time for this task and propose neural architectures to model this. 3 Multi-task Pairwise Neural Ranking We propose a multi-task pairwise neural ranking approach to better incorporate and distinguish the relative order between the candidate segmenta- tions of a given hashtag. Our model adapts to ad- dress single- and multi-token hashtags differently via a multi-task learning strategy without requir- ing additional annotations. In this section, we de- scribe the task setup and three variants of pairwise neural ranking models (Figure 1). 2To the best of our knowledge, Microsoft discontinued its Word Breaker and Web Ngram API services in early 2018. #songsonghaddafisitunes hashtag (h) segmentation (s∗) songs on ghaddafi s itunes (i.e. songs on Ghaddafi's iTunes) candidate segmentations (s ∈ S) songs on ghaddafis itunes songs on ghaddafisi tunes songs on ghaddaf is itunes song song haddafis i tunes songsong haddafisitunes (and . . . ) Table 2: Example hashtag along with its gold and pos- sible candidate segmentations. 3.1 Segmentation as Pairwise Ranking The goal of hashtag segmentation is to divide a given hashtag h into a sequence of meaningful words s∗ = [w1, w2, . . . , wn]. For a hashtag of r characters, there are a total of 2r−1 possible seg- mentations but only one, or occasionally two, of them (s∗) are considered correct (Table 2). We transform this task into a pairwise rank- ing problem: given k candidate segmentations {s1, s2, . . . , sk}, we rank them by comparing each with the rest in a pairwise manner. More specifi- cally, we train a model to predict a real number g(sa, sb) for any two candidate segmentations sa and sb of hashtag h, which indicates sa is a better segmentation than sb if positive, and vice versa. To quantify the quality of a segmentation in training, we define a gold scoring function g∗ based on the similarities with the ground-truth segmentation s∗: g∗(sa, sb) = sim(sa, s∗) − sim(sb, s∗). We use the Levenshtein distance (minimum num- ber of single-character edits) in this paper, al- though it is possible to use other similarity mea- surements as alternatives. We use the top k seg- mentations generated by Microsoft Word Breaker (§2) as initial candidates. 3.2 Pairwise Neural Ranking Model For an input candidate segmentation pair (cid:104)sa, sb(cid:105), we concatenate their feature vectors sa and sb, and feed them into a feedforward network which emits a comparison score g(sa, sb). The feature vector sa or sb consists of language model probabilities using Good-Turing (Good, 1953) and modified Kneser-Ney smoothing (Kneser and Ney, 1995; Chen and Goodman, 1999), lexical and linguistic features (more details in §3.5). For training, we use all the possible pairs (cid:104)sa, sb(cid:105) of the k candi- dates as the input and their gold scores g∗(sa, sb) as the target. The training objective is to minimize m(cid:88) i=1 the Mean Squared Error (MSE): LM SE = 1 m (g∗(i)(sa, sb) − g(i)(sa, sb))2 (1) where m is the number of training examples. (cid:80) To aggregate the pairwise comparisons, we fol- low a greedy algorithm proposed by Cohen et al. (1998) and used for preference ranking (Parakhin and Haluptzok, 2009). For each segmentation s in the candidate set S = {s1, s2, . . . , sk}, we calculate a single score ScoreP N R(s) = s(cid:54)=sj∈S g(s, sj), and find the segmentation smax corresponding to the highest score. We repeat the same procedure after removing smax from S, and continue until S reduces to an empty set. Fig- ure 1(a) shows the architecture of this model. 3.3 Margin Ranking (MR) Loss As an alternative to the pairwise ranker (§3.2), we propose a pairwise model which learns from can- didate pairs (cid:104)sa, sb(cid:105) but ranks each individual can- didate directly rather than relatively. We define a new scoring function g(cid:48) which assigns a higher score to the better candidate, i.e., g(cid:48)(sa) > g(cid:48)(sb), if sa is a better candidate than sb and vice-versa. Instead of concatenating the features vectors sa and sb, we feed them separately into two identi- cal feedforward networks with shared parameters. During testing, we use only one of the networks to rank the candidates based on the g(cid:48) scores. For training, we add a ranking layer on top of the net- works to measure the violations in the ranking or- der and minimize the Margin Ranking Loss (MR): i=1 1 m m(cid:88)  1 −1 0 lab = LM R = max(0, 1 − l(i) ab p(i) ab ) ab = (g(cid:48)(i)(sa) − g(cid:48)(i)(sb)) p(i) (2) g∗(sa, sb) > 0 g∗(sa, sb) < 0 otherwise where m is the number of training samples. The architecture of this model is presented in Fig- ure 1(b). 3.4 Adaptive Multi-task Learning Both models in §3.2 and §3.3 treat all the hashtags uniformly. However, different features address different types of hashtags. By design, the lin- guistic features capture named entities and multi- word hashtags that exhibit word shape patterns, (a) Pairwise Ranking Model (MSE §3.2) (b) Margin Ranking Loss w/ shared parameters (MR §3.3) (c) Adaptive Multi-task Learning for Pairwise ranking (MSE+Multitask §3.4) Figure 1: Pairwise neural ranking models for hashtag segmentation. Given two candidate segmentations sa and sb of hashtag h, the goal is to predict the segmentation's goodness relative score (g) or absolute (g(cid:48)) score. such as camel case. The ngram probabilities with Good-Turing smoothing gravitate towards multi- word segmentations with known words, as its es- timate for unseen ngrams depends on the frac- tion of ngrams seen once which can be very low (Heafield, 2013). The modified Kneser-Ney smoothing is more likely to favor segmentations that contain rare words, and single-word segmen- tations in particular. Please refer to §5.3 for a more detailed quantitative and qualitative analysis. To leverage this intuition, we introduce a binary classification task to help the model differentiate single-word from multi-word hashtags. The bi- nary classifier takes hashtag features h as the in- put and outputs wh, which represents the prob- ability of h being a multi-word hashtag. wh is used as an adaptive gating value in our multi- task learning setup. The gold labels for this task are obtained at no extra cost by simply verifying whether the ground-truth segmentation has mul- tiple words. We train the pairwise segmentation ranker and the binary single- vs. multi-token hash- tag classifier jointly, by minimizing LM SE for the pairwise ranker and the Binary Cross Entropy Er- ror (LBCE) for the classifier: Lmultitask = λ1LM SE + λ2LBCE m(cid:88) i=1 (cid:2)l(i) ∗ log(w(i) h )(cid:3) h )+ (3) LBCE = − 1 m (1 − l(i)) ∗ log(1 − w(i) where wh is the adaptive gating value, l ∈ {0, 1} indicates if h is actually a multi-word hashtag and m is the number of training examples. λ1 and λ2 are the weights for each loss. For our experiments, we apply equal weights. More specifically, we divide the segmentation feature vector sa into two subsets: (a) sKN a with modified Kneser-Ney smoothing features, and (b) a with Good-Turing smoothing and linguistic sGL features. For an input candidate segmentation pair (cid:104)sa, sb(cid:105), we construct two pairwise vectors sKN ab = ] by concate- [sKN nation, then combine them based on the adaptive gating value wh before feeding them into the feed- forward network G for pairwise ranking: ab + (1 − wh)sKN g(sa, sb) = G(cid:0)whsGL ] and sGL ; sKN ab = [sGL a ; sGL b (cid:1) (4) a b ab We use summation with padding, as we find this simple ensemble method achieves similar perfor- mance in our experiments as the more complex multi-column networks (Ciresan et al., 2012). Fig- ure 1(c) shows the architecture of this model. An analogue multi-task formulation can also be used for the Margin Ranking loss as: Lmultitask = λ1LM R + λ2LBCE. (5) 3.5 Features We use a combination of corpus-based and lin- guistic features to rank the segmentations. For a candidate segmentation s, its feature vector s in- cludes the number of words in the candidate, the length of each word, the proportion of words in an English dictionary3 or Urban Dictionary4 (Nguyen et al., 2018), ngram counts from Google Web 1TB corpus (Brants and Franz, 2006), and ngram prob- abilities from trigram language models trained on the Gigaword corpus (Graff and Cieri, 2003) and 3https://pypi.org/project/pyenchant 4https://www.urbandictionary.com 1.1 billion English tweets from 2010, respectively. We train two language models on each corpus: one with Good-Turing smoothing using SRILM (Stol- cke, 2002) and the other with modified Kneser- Ney smoothing using KenLM (Heafield, 2011). We also add boolean features, such as if the can- didate is a named-entity present in the list of Wikipedia titles, and if the candidate segmentation s and its corresponding hashtag h satisfy certain word-shapes (more details in appendix A.1). Similarly, for hashtag h, we extract the feature vector h consisting of hashtag length, ngram count of the hashtag in Google 1TB corpus (Brants and Franz, 2006), and boolean features indicating if the hashtag is in an English dictionary or Urban Dictionary, is a named-entity, is in camel case, ends with a number, and has all the letters as con- sonants. We also include features of the best- ranked candidate by the Word Breaker model. Implementation Details 3.6 We use the PyTorch framework to implement our multi-task pairwise ranking model. The pairwise ranker consists of an input layer, three hidden lay- ers with eight nodes in each layer and hyperbolic tangent (tanh) activation, and a single linear out- put node. The auxiliary classifier consists of an input layer, one hidden layer with eight nodes and one output node with sigmoid activation. We use the Adam algorithm (Kingma and Ba, 2014) for optimization and apply a dropout of 0.5 to prevent overfitting. We set the learning rate to 0.01 and 0.05 for the pairwise ranker and auxiliary classi- fier respectively. For each experiment, we report results obtained after 100 epochs. For the baseline model used to extract the k initial candidates, we reimplementated the Word Breaker (Wang et al., 2011) as described in §2 and adapted it to use a language model trained on 1.1 billion tweets with Good-Turing smoothing using SRILM (Stolcke, 2002) to give a better perfor- mance in segmenting hashtags (§5.3). For all our experiments, we set k = 10. 4 Hashtag Segmentation Data We use two datasets for experiments (Table 3): (a) STANsmall, created by Bansal et al. (2015), which consists of 1,108 unique English hashtags from 1,268 randomly selected tweets in the Stanford Sentiment Analysis Dataset (Go and Huang, 2009) along with their crowdsourced segmentations and Data num. of Hashtags avg. 8.5 Train STANlarge Dev 8.4 8.6 Test STANsmall Test 9.0 2518 (51.9%) 629 (52.3%) 9447 (53.0%) 1108 (60.5%) avg. (multi-token%) #char #word 1.8 1.7 1.8 1.9 Table 3: Statistics of the STANsmall and STANlarge datasets -- number of unique hashtags, percentage of multi-token hashtags, average length of hashtags in characters and words. our additional corrections; and (b) STANlarge, our new expert curated dataset, which includes all 12,594 unique English hashtags and their associ- ated tweets from the same Stanford dataset. Dataset Analysis. STANsmall is the most com- monly used dataset in previous work. However, after reexamination, we found annotation errors in 6.8%5 of the hashtags in this dataset, which is sig- nificant given that the error rate of the state-of-the- art models is only around 10%. Most of the er- rors were related to named entities. For example, #lionhead, which refers to the "Lionhead" video game company, was labeled as "lion head". Our Dataset. We therefore constructed the STANlarge dataset of 12,594 hashtags with addi- tional quality control for human annotations. We displayed a tweet with one highlighted hashtag on the Figure-Eight6 (previously known as Crowd- Flower) crowdsourcing platform and asked two workers to list all the possible segmentations. For quality control on the platform, we displayed a test hashtag in every page along with the other hash- tags. If any annotator missed more than 20% of the test hashtags, then they were not allowed to con- tinue work on the task. For 93.1% of the hashtags, out of which 46.6% were single-token, the work- ers agreed on the same segmentation. We further asked three in-house annotators (not authors) to cross-check the crowdsourced annotations using a two-step procedure: first, verify if the hashtag is a named entity based on the context of the tweet; then search on Google to find the correct segmen- tation(s). We also asked the same annotators to fix the errors in STANsmall. The human upperbound of the task is estimated at ∼98% accuracy, where we consider the crowdsourced segmentations (two workers merged) as correct if at least one of them matches with our expert's segmentations. 5More specifically, 4.8% hashtags is missing one of the two acceptable segmentations and another 2.0% is incorrect segmentation. 6https://figure-eight.com All Hashtags Multi-token Single-token A@1 F1@1 A@2 MRR A@1 F1@1 A@2 MRR A@1 A@2 MRR 51.0 Original hashtag 58.1 Rule-based (Billal et al., 2016) 73.2 GATE Hashtag Tokenizer (M&G, 2014) 73.4 Viterbi (Berardi et al., 2011) MaxEnt (C¸ elebi and Ozgur, 2017) 92.4 90.8 Word Breaker w/ Twitter LM 88.1 Pairwise linear ranker 92.3 Pairwise neural ranker (MR) 92.5 Pairwise neural ranker (MSE) 93.0 Pairwise neural ranker (MR+multitask) Pairwise neural ranker (MSE+multitask) 94.5 Human Upperbound 98.0 100.0 58.8 76.0 71.6 93.1 94.3 96.8 94.7 97.0 94.5 96.9 94.5 97.0 95.2 96.6 95.4 96.8 -- 98.4 19.1 66.5 78.0 83.1 93.6 90.0 97.8 86.8 97.3 92.8 99.0 93.1 99.0 93.7 98.7 95.1 99.4 -- 98.2 51.0 63.5 77.2 78.5 93.4 91.7 97.4 89.9 97.2 93.5 98.2 93.7 98.2 94.3 97.8 95.2 98.4 -- 98.3 19.1 57.6 71.4 74.5 91.9 88.5 83.8 90.9 91.2 91.5 93.9 97.8 93.7 91.3 95.2 95.4 95.4 96.8 -- 95.7 95.9 95.8 95.8 96.0 96.2 -- 94.5 93.1 95.4 95.5 95.7 96.6 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Table 4: Evaluation results on the corrected version of STANsmall. For reference, on the original version of STANsmall, the Microsoft Word Breaker API reported an 84.6% F1 score and an 83.6% accuracy for the top one output (C¸ elebi and Ozgur, 2017), while our best model (MSE+multitask) reported 89.8% F1 and 91.0% accuracy. All Hashtags Multi-token Single-token A@1 F1@1 A@2 MRR A@1 F1@1 A@2 MRR A@1 A@2 MRR 55.5 Original hashtag 56.1 Rule-based (Billal et al., 2016) Viterbi (Berardi et al., 2011) 68.4 GATE Hashtag Tokenizer (M&G, 2014) 72.4 MaxEnt (C¸ elebi and Ozgur, 2017) 91.2 90.1 Word Breaker w/ Twitter LM 89.2 Pairwise linear ranker 91.3 Pairwise neural ranker (MR) 91.3 Pairwise neural ranker (MSE) Pairwise neural ranker (MR+multitask) 91.4 Pairwise neural ranker (MSE+multitask) 92.4 Human Upperbound 98.6 16.2 65.8 81.5 76.8 92.4 90.0 97.0 87.8 95.6 92.4 97.5 93.6 97.7 92.6 97.7 94.1 98.0 -- 98.4 100.0 56.3 65.0 75.3 92.3 91.9 94.8 92.8 91.5 92.9 93.0 99.2 55.5 61.5 73.8 76.1 92.3 91.0 91.1 92.6 92.6 92.7 93.6 98.8 16.2 56.0 71.2 70.0 90.2 88.5 84.2 89.9 91.0 90.0 91.9 98.0 93.4 91.0 94.3 94.9 94.4 95.4 -- 93.9 93.3 94.6 94.5 94.6 95.2 -- 96.6 96.3 97.2 97.0 97.2 97.3 -- 96.2 97.0 96.8 96.2 96.6 96.5 94.4 95.9 94.9 94.1 94.9 94.9 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Table 5: Evaluation results on our STANlarge test dataset. For single-token hashtags, the token-level F1@1 is equivalent to segmentation-level A@1. For multi-token cases, A@1 and F1@1 for the original hashtag base- line are non-zero because 11.4% of the hashtags have more than one acceptable segmentations. Our best model (MSE+multitask) shows a statistically significant improvement (p < 0.05) over the state-of-the-art approach (C¸ elebi and Ozgur, 2017) based on the paired bootstrap test (Berg-Kirkpatrick et al., 2012). 5 Experiments In this section, we present experimental results that compare our proposed method with the other state-of-the-art approaches on hashtag segmenta- tion datasets. The next section will show exper- iments of applying hashtag segmentation to the popular task of sentiment analysis. 5.1 Existing Methods We compare our pairwise neural ranker with the following baseline and state-of-the-art ap- proaches: (a) The original hashtag as a single token; (b) A rule-based segmenter, which employs a set of word-shape rules with an English dictionary (Billal et al., 2016); (c) A Viterbi model which uses word frequencies from a book corpus7 (Berardi et al., 2011); (d) The specially developed GATE Hashtag To- kenizer from the open source toolkit,8 which combines dictionaries and gazetteers in a Viterbi-like algorithm (Maynard and Green- wood, 2014); (e) A maximum entropy classifier (MaxEnt) trained on the STANlarge training dataset. It predicts whether a space should be inserted at each position in the hashtag and is the current state-of-the-art (C¸ elebi and Ozgur, 2017); (f) Our reimplementation of the Word Breaker algorithm which uses beam search and a Twit- ter ngram language model (Wang et al., 2011); (g) A pairwise linear ranker which we im- plemented for comparison purposes with the same features as our neural model, but using perceptron as the underlying classifier (Hop- kins and May, 2011) and minimizing the hinge 7Project Gutenberg http://norvig.com/big.txt 8https://gate.ac.uk/ Single A MRR 95.4 95.7 Kneser-Ney Good-Turing (GT) 91.4 93.5 89.4 91.7 Linguistic (Ling) 92.4 93.9 GT + Ling All Features 91.1 93.1 Multi A MRR 56.0 75.3 85.9 91.8 71.6 82.6 86.2 92.3 89.0 93.7 All A MRR 74.9 85.1 88.6 92.6 80.1 87.0 88.9 92.7 90.0 93.4 Table 6: Evaluation of automatic hashtag segmentation (MSE) with different features on the STANlarge dev set. A denotes accuracy@1. While Kneser-Ney features perform well on single-token hashtags, GT+Ling fea- tures perform better on multi-token hashtags. loss between g∗ and a scoring function similar to g(cid:48). It is trained on the STANlarge dataset. 5.2 Evaluation Metrics We evaluate the performance by the top k (k = 1, 2) accuracy (A@1, A@2), average token-level F1 score (F1@1), and mean reciprocal rank (MRR). In particular, the accuracy and MRR are calculated at the segmentation-level, which means that an output segmentation is considered correct if and only if it fully matches the human segmen- tation. Average token-level F1 score accounts for partially correct segmentation in the multi-token hashtag cases. 5.3 Results Tables 4 and 5 show the results on the STANsmall and STANlarge datasets, respectively. All of our pairwise neural rankers are trained on the 2,518 manually segmented hashtags in the train- ing set of STANlarge and perform favorably against other state-of-the-art approaches. Our best model (MSE+multitask) that utilizes different features adaptively via a multi-task learning procedure is shown to perform better than simply combining all the features together (MR and MSE). We high- light the 24.6% error reduction on STANsmall and 16.5% on STANlarge of our approach over the previous SOTA (C¸ elebi and Ozgur, 2017) on the Multi-token hashtags, and the importance of hav- ing a separate evaluation of multi-word cases as it is trivial to obtain 100% accuracy for Single- token hashtags. While our hashtag segmentation model is achieving a very high accuracy@2, to be practically useful, it remains a challenge to get the top one predication exactly correct. Some hash- tags are very difficult to interpret, e.g., #BTVSMB refers to the Social Media Breakfast (SMB) in Burlington, Vermont (BTV). The improved Word Breaker with our addition of a Twitter-specific language model is a very strong Good-Turing Kneser-Ney Linguistic count ◦ • ◦ ◦ • • ◦ • ◦ ◦ • ◦ • ◦ • • ◦ ◦ ◦ • ◦ • • • Example Hashtags #omnomnom #BTVSMB #commbank #mamapedia #wewantmcfly #winebarsf #cfp09 #TechLunchSouth #twittographers #bringback #iccw #ecom09 #LetsGoPens #epicwin #prototype #newyork 31 13 38 24 44 16 53 420 Table 7: Error (◦) and correct (•) segmentation anal- ysis of three pairwise ranking models (MSE) trained with different feature sets Each row corresponds to one area in the Venn diagram; for example, ◦◦◦ is the set of hashtags that all three models failed in the STANlarge dev data and •◦◦ is the set of hashtags that only the model with Kneser-Ney language model features (but not the other two models) segmented correctly. baseline, which echos the findings of the origi- nal Word Breaker paper (Wang et al., 2011) that having a large in-domain language model is ex- tremely helpful for word segmentation tasks. It is worth noting that the other state-of-the-art system (C¸ elebi and Ozgur, 2017) also utilized a 4-gram language model trained on 476 million tweets from 2009. 5.4 Analysis and Discussion Feature Analysis. To empirically illustrate the effectiveness of different features on different types of hashtags, we show the results for mod- els using individual feature sets in pairwise rank- ing models (MSE) in Table 6. Language mod- els with modified Kneser-Ney smoothing perform best on single-token hashtags, while Good-Turing and Linguistic features work best on multi-token hashtags, confirming our intuition about their use- fulness in a multi-task learning approach. Table 7 shows a qualitative analysis with the first column (◦◦◦) indicating which features lead to correct or wrong segmentations, their count in our data and illustrative examples with human segmentation. Length of Hashtags. As longer hashtags with more than three tokens pose greater challenges and the segmentation-level accuracy of our best model (MSE+multitask) For many error cases, drops our model predicts a seg- #youknowyouupttooearly, mentation, #iseelondoniseefrance, which is also reflected by close-to-correct to 82.1%. expected, e.g., Type single 2 tokens 3 tokens 4 tokens 5+ tokens num. of Hashtags 4426 (47.1%) 3436 (36.2%) 1085 (11.2%) 279 (2.9%) 221 (2.6%) Figure 2: Token-level F1 scores (MSE+multitask) on hashtags of different lengths in the STANlarge test set. Figure 3: Token-level F1 scores of our pairwise ranker (MSE+multitask) and Word Breaker on the STANlarge test set, using language models trained with varying amounts of data. the higher token-level F1 scores across hashtags with different lengths (Figure 2). Size of the Language Model. Since our ap- proach heavily relies on building a Twitter lan- guage model, we experimented with its sizes and show the results in Figure 3. Our approach can perform well even with access to a smaller amount of tweets. The drop in F1 score for our pairwise neural ranker is only 1.4% and 3.9% when using the language models trained on 10% and 1% of the total 1.1 billion tweets, respectively. Time Sensitivity. Language use in Twitter changes with time (Eisenstein, 2013). Our pairwise ranker uses language models trained on the tweets from the year 2010. We tested our approach on a set of 500 random English hashtags posted in tweets from the year 2019 and show the results in Table 8. With a segmentation-level accuracy of 94.6% and average token-level F1 score of 95.6%, our approach performs favorably on 2019 hashtags. A@1 F1@1 MRR 94.7 Word Breaker w/ Twitter LM 92.1 Pairwise neural ranker (MSE+multitask) 94.6 96.7 93.9 95.6 Table 8: Evaluation results on 500 random hashtags from the year 2019. 6 Extrinsic Evaluation: Twitter Sentiment Analysis We attempt to demonstrate the effectiveness of our hashtag segmentation system by studying its impact on the task of sentiment analysis in Twitter (Pang et al., 2002; Nakov et al., 2016; Rosenthal et al., 2017). We use our best model (MSE+multitask), under the name HashtagMas- ter, in the following experiments. 6.1 Experimental Setup the BiL- We compare the performance of STM+Lex (Teng et al., 2016) sentiment analysis model under three configurations: (a) tweets with hashtags removed, (b) tweets with hashtags as sin- gle tokens excluding the # symbol, and (c) tweets with hashtags as segmented by our system, Hash- tagMaster. BiLSTM+Lex is a state-of-the-art open source system for predicting tweet-level sentiment (Tay et al., 2018). It learns a context-sensitive sentiment intensity score by leveraging a Twitter- based sentiment lexicon (Tang et al., 2014). We use the same settings as described by Teng et al. (2016) to train the model. We use the dataset from the Sentiment Analy- sis in Twitter shared task (subtask A) at SemEval 2017 (Rosenthal et al., 2017). 9 Given a tweet, the goal is to predict whether it expresses POSITIVE, NEGATIVE or NEUTRAL sentiment. The training and development sets consist of 49,669 tweets and we use 40,000 for training and the rest for devel- opment. There are a total of 12,284 tweets con- taining 12,128 hashtags in the SemEval 2017 test set, and our hashtag segmenter ended up splitting 6,975 of those hashtags present in 3,384 tweets. 6.2 Results and Analysis In Table 9, we report the results based on the 3,384 tweets where HashtagMaster predicted a split, as for the rest of tweets in the test set, the hashtag segmenter would neither improve nor worsen the sentiment prediction. Our hashtag seg- menter successfully improved the sentiment anal- ysis performance by 2% on average recall and FP N comparing to having hashtags unsegmented. 1 This improvement is seemingly small but decid- edly important for tweets where sentiment-related information is embedded in multi-word hashtags 9We did not use the Stanford Sentiment Analysis Dataset (Go and Huang, 2009), which was used to construct the STANsmall and STANlarge hashtag datasets, because of its noisy sentiment labels obtained using distant supervision. AvgR FP N Acc 61.7 60.0 58.7 Original tweets − No Hashtags 60.2 58.8 54.2 62.3 60.3 58.6 + Single-word + HashtagMaster 64.3 62.4 58.6 1 Table 9: Sentiment analysis evaluation on the 3384 tweets from SemEval 2017 test set using the BiL- STM+Lex method (Tang et al., 2014). Average re- call (AvgR) is the official metric of the SemEval task and is more reliable than accuracy (Acc). FP N is the average F1 of positive and negative classes. Having the hashtags segmented by our system HashtagMaster (i.e., MSE+multitask) significantly improves the senti- ment prediction than not (p < 0.05 for AvgR and FP N against the single-word setup). 1 1 and sentiment prediction would be incorrect based only on the text (see Table 10 for examples). In fact, 2,605 out of the 3,384 tweets have multi- word hashtags that contain words in the Twitter- based sentiment lexicon (Tang et al., 2014) and 125 tweets contain sentiment words only in the hashtags but not in the rest of the tweet. On the entire test set of 12,284 tweets, the increase in the average recall is 0.5%. 7 Other Related Work Automatic hashtag segmentation can improve the performance of many applications besides senti- ment analysis, such as text classification (Billal et al., 2016), named entity linking (Bansal et al., 2015) and modeling user interests for recommen- dations (Chen et al., 2016). It can also help in col- lecting data of higher volume and quality by pro- viding a more nuanced interpretation of its con- tent, as shown for emotion analysis (Qadir and Riloff, 2014), sarcasm and irony detection (May- nard and Greenwood, 2014; Huang et al., 2018). Better semantic analysis of hashtags can also po- tentially be applied to hashtag annotation (Wang et al., 2019), to improve distant supervision la- bels in training classifiers for tasks such as sar- casm (Bamman and Smith, 2015), sentiment (Mo- hammad et al., 2013), emotions (Abdul-Mageed and Ungar, 2017); and, more generally, as labels for pre-training representations of words (Weston et al., 2014), sentences (Dhingra et al., 2016), and images (Mahajan et al., 2018). 8 Conclusion We proposed a new pairwise neural ranking model for hashtag segmention and showed significant performance improvements over the state-of-the- Ofcourse #clownshoes #altright #IllinoisNazis #FinallyAtpeaceWith people calling me "Kim Fatty the Third" Leslie Odom Jr. sang that. #ThankYouObama After some 4 months of vegetarianism .. it's all the same industry. #cutoutthecrap Table 10: Sentiment analysis examples where our HashtagMaster segmentation tool helped. Red and blue words are negative and positive entries in the Twitter sentiment lexicon (Tang et al., 2014), respectively. art. We also constructed a larger and more curated dataset for analyzing and benchmarking hashtag segmentation methods. We demonstrated that hashtag segmentation helps with downstream tasks such as sentiment analysis. Although we fo- cused on English hashtags, our pairwise ranking approach is language-independent and we intend to extend our toolkit to languages other than En- glish as future work. Acknowledgments We thank Ohio Supercomputer Center (Center, 2012) for computing resources and the NVIDIA for providing GPU hardware. We thank Alan Rit- ter, Quanze Chen, Wang Ling, Pravar Mahajan, and Dushyanta Dhyani for valuable discussions. We also thank the annotators: Sarah Flanagan, Kaushik Mani, and Aswathnarayan Radhakrish- nan. This material is based in part on research sponsored by the NSF under grants IIS-1822754 and IIS-1755898, DARPA through the ARO under agreement number W911NF-17-C-0095, through a Figure-Eight (CrowdFlower) AI for Everyone Award and a Criteo Faculty Research Award to Wei Xu. The views and conclusions contained in this publication are those of the authors and should not be interpreted as representing official policies or endorsements of the U.S. Government. References Muhammad Abdul-Mageed and Lyle Ungar. 2017. Emonet: Fine-grained emotion detection with gated In Proceedings of the recurrent neural networks. 55th Annual Meeting of the Association for Compu- tational Linguistics, ACL, pages 718 -- 728. David Bamman and Noah A Smith. 2015. Contextu- alized Sarcasm Detection on Twitter. In Ninth Inter- national AAAI Conference on Web and Social Media, ICWSM, pages 574 -- 577. Piyush Bansal, Romil Bansal, and Vasudeva Varma. 2015. Towards Deep Semantic Analysis of Hashtags. In Proceedings of the 37th European Conference on Information Retrieval, ECIR, pages 453 -- 464. Giacomo Berardi, Andrea Esuli, Diego Marcheggiani, and Fabrizio Sebastiani. 2011. ISTI@TREC Mi- croblog Track 2011: Exploring the Use of Hashtag Segmentation and Text Quality Ranking. In Text RE- trieval Conference (TREC). Taylor Berg-Kirkpatrick, David Burkett, and Dan Klein. 2012. An Empirical Investigation of Statisti- cal Significance in NLP. In Proceedings of the 2012 Joint Conference on Empirical Methods in Natu- ral Language Processing and Computational Natural Language Learning, EMNLP-CoNLL, pages 995 -- 1005. Belainine Billal, Alexsandro Fonseca, and Fatiha Sa- dat. 2016. Named Entity Recognition and Hash- tag Decomposition to Improve the Classification of In Proceedings of the 2nd Workshop on Tweets. Noisy User-generated Text (WNUT), COLING, pages 102 -- 111. Thorsten Brants and Alex Franz. 2006. Web 1T 5-gram Version 1. Linguistic Data Consortium (LDC). Arda C¸ elebi and Arzucan Ozgur. 2016. Segment- ing Hashtags using Automatically Created Training In Proceedings of the Tenth International Data. Conference on Language Resources and Evaluation, LREC, pages 2981 -- 2985. Arda C¸ elebi and Arzucan Ozgur. 2017. Segmenting Hashtags and Analyzing Their Grammatical Struc- ture. Journal of Association For Information Science and Technology (JASIST), 69(5):675 -- 686. Ohio Supercomputer Center. 2012. Oakley super- http://osc.edu/ark:/19495/ computer. hpc0cvqn. Stanley F Chen and Joshua Goodman. 1999. An empirical study of smoothing techniques for lan- guage modeling. Computer Speech & Language, 13(4):359 -- 394. Tao Chen, Xiangnan He, and Min-Yen Kan. 2016. Context-aware Image Tweet Modelling and Recom- mendation. In Proceedings of the 24th ACM Interna- tional Conference on Multimedia, MM, pages 1018 -- 1027. Dan Ciresan, Ueli Meier, and Jurgen Schmidhuber. 2012. Multi-column Deep Neural Networks for Im- age Classification. In Proceedings of the 2012 IEEE Conference on Computer Vision and Pattern Recog- nition, CVPR, pages 3642 -- 3649. William W Cohen, Robert E Schapire, and Yoram In Ad- Singer. 1998. Learning to Order Things. vances in Neural Information Processing Systems, NIPS, pages 451 -- 457. Thierry Declerck and Piroska Lendvai. 2015. Process- ing and normalizing hashtags. In Proceedings of the International Conference Recent Advances in Natu- ral Language Processing, RANLP, pages 104 -- 109. Bhuwan Dhingra, Zhong Zhou, Dylan Fitzpatrick, and William Cohen. 2016. Character-Based Distributed Rep- In Proceedings of the Association for Michael Muehl, Tweet2Vec: resentations for Social Media. the 54th Annual Meeting of Computational Linguistics, ACL, pages 269 -- 274. Jacob Eisenstein. 2013. What to do about bad language on the Internet. In Proceedings of the 2013 Confer- ence of the North American Chapter of the Associ- ation for Computational Linguistics, NAACL, pages 359 -- 369. Tim Finin, Will Murnane, Anand Karandikar, Nicholas Keller, Justin Martineau, and Mark Dredze. 2010. Annotating named entities in Twitter data with crowdsourcing. In Proceedings of the Workshop on Creating Speech and Language Data with Amazon's Mechanical Turk, NAACL, pages 80 -- 88. Bhayani R. Go, A. and L. Huang. 2009. Twitter Sentiment Classification using Distant Supervision. CS224N Project Report, Stanford. Irving J Good. 1953. The population frequencies of species and the estimation of population parameters. Biometrika, 40(3-4):237 -- 264. David Graff and Christopher Cieri. 2003. English Gi- gaword LDC2003T05. Linguistic Data Consortium (LDC). Bo Han and Timothy Baldwin. 2011. Lexical Normali- sation of Short Text Messages: Makn Sens a# twitter. In Proceedings of the 49th Annual Meeting of the As- sociation for Computational Linguistics, ACL, pages 368 -- 378. Kenneth Heafield. 2011. KenLM: Faster and Smaller In Proceedings of the Language Model Queries. Sixth Workshop on Statistical Machine Translation, WMT, pages 187 -- 197. Kenneth Heafield. 2013. Efficient Language Modeling Algorithms with Applications to Statistical Machine Translation. Ph.D. thesis, Carnegie Mellon Univer- sity. Mark Hopkins and Jonathan May. 2011. Tuning as In Proceedings of the Conference on Em- ranking. pirical Methods in Natural Language Processing, EMNLP. Hen-Hsen Huang, Chiao-Chen Chen, and Hsin-Hsi Chen. 2018. Disambiguating false-alarm hashtag us- ages in tweets for irony detection. In Proceedings of the 56th Annual Meeting of the Association for Com- putational Linguistics, ACL, pages 771 -- 777. Diederik P. Kingma and Jimmy Ba. 2014. Adam: A In Proceed- Method for Stochastic Optimization. ings of the 3rd International Conference for Learning Representations, ICLR. Reinhard Kneser and Hermann Ney. 1995. Improved backing-off for m-gram language modeling. In Pro- ceedings of the 1995 International Conference on Acoustics, Speech, and Signal Processing, ICASSP, pages 181 -- 184. Philipp Koehn and Kevin Knight. 2003. Empirical In Proceedings methods for compound splitting. of the tenth conference on European chapter of the Association for Computational Linguistics, EACL, pages 187 -- 194. Dhruv Mahajan, Ross Girshick, Vignesh Ramanathan, Kaiming He, Manohar Paluri, Yixuan Li, Ashwin Bharambe, and Laurens van der Maaten. 2018. Ex- ploring the Limits of Weakly Supervised Pretraining. In Tech Report. Diana Maynard and Mark A Greenwood. 2014. Who cares about sarcastic tweets? Investigating the impact of sarcasm on sentiment analysis. In Proceedings of the 9th International Conference on Language Re- sources and Evaluation, LREC, pages 4238 -- 4243. Saif Mohammad, Svetlana Kiritchenko, and Xiaodan Zhu. 2013. NRC-Canada: Building the state-of-the- art in sentiment analysis of tweets. In Proceedings of the Seventh International Workshop on Semantic Evaluation, SemEval, pages 321 -- 327. Preslav Nakov, Sara Rosenthal, Svetlana Kiritchenko, Saif M. Mohammad, Zornitsa Kozareva, Alan Ritter, Veselin Stoyanov, and Xiaodan Zhu. 2016. Develop- ing a successful SemEval task in sentiment analysis of Twitter and other social media texts. Language Resources and Evaluation, 50(1):35 -- 65. Dong Nguyen, Barbara McGillivray, and Taha Yasseri. 2018. Emo, love and god: making sense of urban dictionary, a crowd-sourced online dictionary. Royal Society Open Science, 5(5):172320. Ozer Ozdikis, Pinar Senkul, and Halit Oguztuzun. Semantic Expansion of Hashtags for En- 2012. In Proceedings hanced Event Detection in Twitter. of the 1st international Workshop on Online Social Systems. Bo Pang, Lillian Lee, and Shivakumar Vaithyanathan. 2002. Thumbs up? Sentiment Classification using Machine Learning Techniques. In Proceedings of the Conference on Empirical Methods in Natural Lan- guage Processing, EMNLP, pages 79 -- 86. Fuchun Peng and Dale Schuurmans. 2001. A hierarchi- cal em approach to word segmentation. In NLPRS, pages 475 -- 480. Ashequl Qadir and Ellen Riloff. 2014. Learning emo- tion indicators from tweets: Hashtags, hashtag pat- terns, and phrases. In Proceedings of the 2014 Con- ference on Empirical Methods in Natural Language Processing, EMNLP, pages 1203 -- 1209. Jack Reuter, Jhonata Pereira-Martins, and Jugal Kalita. International 2016. Segmenting twitter hashtags. Journal on Natural Language Computing, 5:23 -- 36. Alan Ritter, Sam Clark, Oren Etzioni, et al. 2011. Named Entity Recognition in Tweets: An Experi- mental Study. In Proceedings of the Conference on Empirical Methods in Natural Language Processing, EMNLP, pages 1524 -- 1534. Sara Rosenthal, Noura Farra, and Preslav Nakov. 2017. SemEval-2017 task 4: Sentiment Analysis in Twitter. In Proceedings of the 11th International Workshop on Semantic Evaluation, SemEval, pages 502 -- 518. Justin Sampson, Fred Morstatter, Liang Wu, and Huan Liu. 2016. Leveraging the implicit structure within social media for emergent rumor detection. In Pro- ceedings of the 25th ACM International on Confer- ence on Information and Knowledge Management, CIKM, pages 2377 -- 2382. C. Simeon, H. J. Hamilton, and R. J. Hilderman. 2016. Word segmentation algorithms with lexical resources for hashtag classification. In Proceedings of the 2016 IEEE International Conference on Data Science and Advanced Analytics (DSAA), pages 743 -- 751. Richard Sproat and Chilin Shih. 1990. A statistical method for finding word boundaries in chinese text. Computer Processing of Chinese and Oriental Lan- guages, 4(4):336 -- 351. Andreas Stolcke. 2002. SRILM -- An Extensible Lan- guage Modeling Toolkit. In Proceedings of the 7th International Conference on Spoken Language Pro- cessing, ICSLP, pages 901 -- 904. Duyu Tang, Furu Wei, Bing Qin, Ming Zhou, and Ting Liu. 2014. Building Large-Scale Twitter-Specific Sentiment Lexicon : A Representation Learning Ap- In Proceedings of the 25th International proach. Conference on Computational Linguistics, COLING, pages 172 -- 182. Yi Tay, Anh Tuan Luu, Siu Cheung Hui, and Jian Su. 2018. Attentive gated lexicon reader with contrastive contextual co-attention for sentiment classification. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, EMNLP, pages 3443 -- 3453. M. Parakhin and P. Haluptzok. 2009. Finding the Most Probable Rranking of Objects with Probabilistic Pair- In Proceedings of the 10th In- wise Preferences. ternational Conference on Document Analysis and Recognition, ICDAR, pages 616 -- 620. Zhiyang Teng, Duy Tin Vo, and Yue Zhang. 2016. Context-Sensitive Lexicon Features for Neural Sen- In Proceedings of the 2016 Con- timent Analysis. ference on Empirical Methods in Natural Language Processing, EMNLP, pages 1629 -- 1638. Kuansan Wang, Christopher Thrasher, and Bo- June Paul Hsu. 2011. Web Scale NLP: A Case Study on URL Word Breaking. In Proceedings of the 20th International Conference on World Wide Web, WWW, pages 357 -- 366. Yue Wang, Jing Li, Irwin King, Michael R. Lyu, and Shuming Shi. 2019. Microblog Hashtag Generation via Encoding Conversation Contexts. In Proceedings of the North American Chapter of the Association for Computational Linguistics (NAACL). Jason Weston, Sumit Chopra, and Keith Adams. 2014. # tagspace: Semantic embeddings from hashtags. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing, EMNLP, pages 1822 -- 1827. Nianwen Xue and Libin Shen. 2003. Chinese word In Proceedings of segmentation as LMR tagging. the second SIGHAN workshop on Chinese Language Processing, SIGHAN, pages 176 -- 179. A Appendix A.1 Word-shape rules Our model uses the following word shape rules as boolean features. If the candidate segmentation s and its corresponding hashtag h satisfies a word shape rule, then the boolean feature is set to True. Rule Hashtag → Segmentation Camel Case XxxXxx → Xxx+Xxx Consonants cccc → cccc Digits as prefix ddwwww → dd+wwww Digits as suffix wwwwdd → wwww+dd Underscore www www → www + + www Table 11: Word-shape rule features used to identify good segmentations. Here, X and x represent capital- ized and non-capitalized alphabetic characters respec- tively, c denotes consonant, d denotes number and w denotes any alphabet or number.
1606.05702
1
1606
2016-06-17T23:05:41
Query-Focused Opinion Summarization for User-Generated Content
[ "cs.CL" ]
We present a submodular function-based framework for query-focused opinion summarization. Within our framework, relevance ordering produced by a statistical ranker, and information coverage with respect to topic distribution and diverse viewpoints are both encoded as submodular functions. Dispersion functions are utilized to minimize the redundancy. We are the first to evaluate different metrics of text similarity for submodularity-based summarization methods. By experimenting on community QA and blog summarization, we show that our system outperforms state-of-the-art approaches in both automatic evaluation and human evaluation. A human evaluation task is conducted on Amazon Mechanical Turk with scale, and shows that our systems are able to generate summaries of high overall quality and information diversity.
cs.CL
cs
Query-Focused Opinion Summarization for User-Generated Content Lu Wang1 Hema Raghavan2 Claire Cardie1 Vittorio Castelli3 1Department of Computer Science, Cornell University, Ithaca, NY 14853, USA {luwang, cardie}@cs.cornell.edu 2LinkedIn, CA, USA [email protected] 3IBM T. J. Watson Research Center, Yorktown Heights, NY 10598, USA [email protected] Abstract We present a submodular function-based framework for query-focused opinion summarization. Within our framework, relevance ordering produced by a statistical ranker, and information coverage with respect to topic distribution and diverse viewpoints are both encoded as submodular functions. Dispersion functions are utilized to minimize the redundancy. We are the first to evaluate different metrics of text similarity for submodularity-based summarization methods. By experimenting on community QA and blog summariza- tion, we show that our system outperforms state-of-the-art approaches in both automatic evaluation and human evaluation. A human evaluation task is conducted on Amazon Mechanical Turk with scale, and shows that our systems are able to generate summaries of high overall quality and information diversity. 1 Introduction Social media forums, such as social networks, blogs, newsgroups, and community question answering (QA), offer avenues for people to express their opinions as well collect other people's thoughts on topics as diverse as health, politics and software (Liu et al., 2008). However, digesting the large amount of information in long threads on newsgroups, or even knowing which threads to pay attention to, can be overwhelming. A text-based summary that highlights the diversity of opinions on a given topic can lighten this information overload. In this work, we design a submodular function-based framework for opinion summarization on community question answering and blog data. Question: What is the long term effect of piracy on the music and film industry? Best Answer: Rising costs for movies and music. ... If they sell less, they need to raise the price to make up for what they lost. The other thing will be music and movies with less quality. ... Other Answers: Ans1: Its bad... really bad. (Just watch this movie and you will find out ... Piracy causes rappers to appear on your computer). Ans2: By removing the profitability of music & film companies, piracy takes away their motivation to produce new music & movies. If they can't protect their copyrights, they can't continue to do business. ... Ans4: It is forcing them to rework their business model, which is a good thing. In short, I don't think the music industry in particular will ever enjoy the huge profits of the 90's. ... Ans6: Please-People in those businesses make millions of dollars as it is!! I don't think piracy hurts them at all!!! Figure 1: Example discussion on Yahoo! Answers. Besides the best answer, other answers also contain relevant information (in italics). For example, the sentence in blue has a contrasting viewpoint compared to the other answers. Opinion summarization has previously been applied to restricted domains, such as product reviews (Hu and Liu, 2004; Lerman et al., 2009) and news (Stoyanov and Cardie, 2006), where the output summary is either presented in a structured way with respect to each aspect of the product or organized along contrastive viewpoints. Unlike those works, we address user generated online data: community QA and blogs. These forums use a substantially less formal language than news articles, and at the same time address a much broader spectrum of topics than product reviews. As a result, they present new challenges for automatic summarization. For example, Figure 1 illustrates a sample question from Yahoo! Answers1 along with the answers from different users. The question receives more than one answer, and one of them is selected as the "best answer" by the asker or other participants. In general, answers from other users also provide relevant information. While community QA successfully pools rich knowledge from the wisdom of the crowd, users might need to seine through numerous posts to extract the information This work is licensed under a Creative Commons Attribution 4.0 International Licence. Page numbers and proceedings footer are added by the organisers. Licence details: http://creativecommons.org/licenses/by/4.0/ 1http://answers.yahoo.com/ they need. Hence, it would be beneficial to summarize answers automatically and present the summaries to users who ask similar questions in the future. In this work, we aim to return a summary that encapsu- lates different perspectives for a given opinion question and a set of relevant answers or documents. In our work we assume that there is a central topic (or query) on which a user is seeking diverse opin- ions. We predict query-relevance through automatically learned statistical rankers. Our ranking function not only aims to find sentences that are on the topic of the query but also ones that are "opinionated" through the use of several features that indicate subjectivity and sentiment. The relevance score is en- coded in a submodular function. Diversity is accounted for by a dispersion function that maximizes the pairwise distance between the pairs of sentences selected. Our chief contributions are: (1) We develop a submodular function-based framework for query-focused opinion summarization. To the best of our knowledge, this is the first time that submodular functions have been used to support opinion summarization. We test our framework on two tasks: summarizing opinionated sentences in community QA (Yahoo! Answers) and blogs (TAC-2008 corpus). Human evaluation using Amazon Me- chanical Turk shows that our system generates the best summary 57.1% of the time. On the other hand, the best answer picked by Yahoo! users is chosen only 31.9% of the time. We also obtain significant higher Pyramid F1 score on the blog task as compared to the system of Lin and Bilmes (2011). (2) Within our summarization framework, the statistically learned sentence relevance is included as part of our objective function, whereas previous work on submodular summarization (Lin and Bilmes, 2011) only uses ngram overlap for query relevance. Additionally, we use Latent Dirichlet Allocation (Blei et al., 2003) to model the topic structure of the sentences, and induce clusterings according to the learned topics. Therefore, our system is capable of generating summaries with broader topic coverage. (3) Furthermore, we are the first to study how different metrics for computing text similarity or dis- similarity affect the quality of submodularity-based summarization methods. We show empirically that lexical representation-based similarity, such as TFIDF scores, uniformly outperforms semantic similar- ity computed with WordNet. Moreover, when measuring the summary diversity, topical representation is marginally better than lexical representation, and both of them beats semantic representation. 2 Related Work Our work falls in the realm of query-focused summarization, where a user asks a question and the sys- tem generates a summary of the answers containing pertinent and diverse information. A wide range of methods have been investigated, where relevance is often estimated through TF-IDF similarity (Car- bonell and Goldstein, 1998), topic signature words (Lin and Hovy, 2000) or by learning a Bayesian model over queries and documents (Daum´e and Marcu, 2006). Most work only implicitly penalizes summary redundancy, e.g. by downweighting the importance of words that are already selected. Encouraging diversity of a summary has recently been addressed through submodular functions, which have been applied for multi-document summarization in newswire (Lin and Bilmes, 2011; Sipos et al., 2012), and comments summarization (Dasgupta et al., 2013). However, these works either ignore the query information (when available) or else use simple ngram matching between the query and sentences. In contrast, we propose to optimize an objective function that addresses both relevance and diversity. Previous work on generating opinion summaries mainly considers product reviews (Hu and Liu, 2004; Lerman et al., 2009), and formal texts such as news articles (Stoyanov and Cardie, 2006) or editori- als (Paul et al., 2010). Mostly, there is no query information, and summaries are formulated in a struc- tured way based on product features or contrastive standpoints. Our work is more related to opinion summarization on user-generated content, such as community QA. Liu et al. (2008) manually construct taxonomies for questions in community QA. Summaries are generated by clustering sentences according to their polarity based on a small dictionary. Tomasoni and Huang (2010) introduce coverage and quality constraints on the sentences, and utilize an integer linear programming framework to select sentences. 3 Submodular Opinion Summarization In this section, we describe how query-focused opinion summarization can be addressed by submodular functions combined with dispersion functions. We first define our problem. Then we introduce the Basic Features - answer position in all answers/sentence position in blog - length of the answer/sentence - length is less than 5 words Query-Sentence Overlap Features - unigram/bigram TF/TFIDF similarity with query - number of key phrases in the query that appear in the sentence. A model similar to that described in (Luo et al., 2013) was applied to detect key phrases. Sentiment Features - number/portion of sentiment words from a lexicon (Section 3.2) - if contains sentiment words with the same polarity as sentiment words in query Query-Independent Features - unigram/bigram TFIDF similarity with cluster centroid - sumBasic score (Nenkova and Vanderwende, 2005) - number of topic signature words (Lin and Hovy, 2000) - JS divergence with cluster Table 1: Features used for candidate ranking. We use them for ranking answers in both community QA and blogs. components of our objective function (Sections 3.1–3.3). The full objective function is presented in Section 3.4. Lastly, we describe a greedy algorithm with constant factor approximation to the optimal solution for generating summaries (Section 3.5). A set of documents or answers to be summarized are first split into a set of individual sentences V = {s1, · · · , sn}. Our problem is to select a subset S ⊆ V that maximizes a given objective function f (S), subject to S ≤ c. S is the length of f : 2V → R within a length constraint: S∗ = arg max the summary S, and c is the length limit. Definition 1 A function f : 2V → R is submodular iff for all s ∈ V and every S ⊆ S′ ⊆ V , it satisfies f (S ∪ {s}) − f (S) ≥ f (S′ ∪ {s}) − f (S′). S⊆V Previous submodularity-based summarization work assumes this diminishing return property makes submodular functions a natural fit for summarization and achieves state-of-the-art results on various datasets. In this paper, we follow the same assumption and work with non-decreasing submodular func- tions. Nevertheless, they have limitations, one of which is that functions well suited to modeling diversity are not submodular. Recently, Dasgupta et al. (2013) proved that diversity can nonetheless be encoded in well-designed dispersion functions which still maintain a constant factor approximation when solved by a greedy algorithm. Based on these considerations, we propose an objective function f (S) mainly considering three as- pects: relevance (Section 3.1), coverage (Section 3.2), and non-redundancy (Section 3.3). Relevance and coverage are encoded in a non-decreasing submodular function, and non-redundancy is enforced by maximizing the dispersion function. 3.1 Relevance Function We first utilize statistical rankers to produce a preference ordering of the candidate answers or sentences. We choose ListNet (Cao et al., 2007), which has been shown to be effective in many information retrieval tasks, as our ranker. We use the implementation from Ranklib (Dang, 2011). Features used in the ranking algorithm are summarized in Table 1. All features are normalized by standardization. Due to the length limit, we cannot provide the full results on feature evaluation. Never- theless, we find that ranking candidates by TFIDF similarity or key phrases overlapping with the query can produce comparable results with using the full feature set (see Section 5). i We take the ranks output by the ranker, and define the relevance of the current summary S as: r(S) = i qrank−1 , where ranki is the rank of sentence si in V . For QA answer ranking, sentences from the PS same answer have the same ranking. The function r(S) is our first submodular function. 3.2 Coverage Functions Topic Coverage. This function is designed to capture the idea that a comprehensive opinion sum- mary should provide thoughts on distinct aspects. Topic models such as Latent Dirichlet Allocation (LDA) (Blei et al., 2003) and its variants are able to discover hidden topics or aspects of document col- lections, and thus afford a natural way to cluster texts according to their topics. Recent work (Xie and Xing, 2013) shows the effectiveness of utilizing topic models for newsgroup document clustering. We first learn an LDA model from the data, and treat each topic as a cluster. We estimate a sentence-topic distribution ~θ for each sentence, and assign the sentence to the cluster k corresponding to the mode of the distribution (i.e., k = arg maxi θi). This naive approach produces comparable clustering performance to the state-of-the-art according to (Xie and Xing, 2013). T is defined as the clustering induced by our algo- rithm on the set V . The topic coverage of the current summary S is defined as t(S) = PT ∈T pS ∩ T . From the concavity of the square root it follows that sets S with uniform coverages of topics are preferred to sets with skewed coverage. Authorship Coverage. This term encourages the summarization algorithm to select sentences from different authors. Let A be the clustering induced by the sentence to author relation. In community QA, sentences from the answers given by the same user belong to the same cluster. Similarly, sentences from blogs with the same author are in the same cluster. The authorship score is defined as a(S) = PA∈A pS ∩ A. Polarity Coverage. The polarity score encourages the selection of summaries that cover both positive and negative opinions. We categorize each sentence simply by counting the number of polarized words given by our lexicon. A sentence belongs to a positive cluster if it has more positive words than negative ones, and vice versa. If any negator co-occurs with a sentiment word (e.g. within a window of size 5), the sentiment is reversed.2 The polarity clustering P thus have two clusters corresponding to positive and negative opinions. The score is defined as p(S) = PP ∈P p S ∩ P . Our lexicon consists of MPQA lexicon (Wilson et al., 2005), General Inquirer (Stone et al., 1966), and SentiWordNet (Esuli and Sebastiani, 2006). Words with conflicting sentiments from different lexicons are removed. Content Coverage. Similarly to Lin and Bilmes (2011) and Dasgupta et al. (2013), we use the following function to measure content coverage of the current summary S: c(S) = Pv∈V min(cov(v, S), θ · cov(v, V )), where cov(v, S) = Pu∈S sim(v, u). We experiment with two types of similarity functions. One is a Cosine TFIDF similarity score. The other is a WordNet-based semantic similarity score between pairwise dependency relations from two sentences (Dasgupta et al., 2013). Specifically, simSem(v, u) = Preli∈v,relj ∈u W N (ai, aj) × W N (bi, bj), where reli = (ai, bi), relj = (aj , bj), W N (wi, wj) is the shortest path length. All scores are scaled onto [0, 1]. 3.3 Dispersion Function Summaries should contain as little redundant information as possible. We achieve this by adding an additional term to the objective function, encoded by a dispersion function. Given a set of sentences S, a complete graph is constructed with each sentence in S as a node. The weight of each edge (u, v) is their dissimilarity d′(u, v). Then the distance between any pair of u and v, d(u, v), is defined as the total weight of the shortest path connecting u and v.3 We experiment with two forms of dispersion function (Dasgupta et al., 2013): (1) hsum = Pu,v∈V,u6=v d(u, v), and (2) hmin = minu,v∈V,u6=v d(u, v). Then we need to define the dissimilarity function d′(·, ·). There are different ways to measure the dissimilarity between sentences (Mihalcea et al., 2006; Agirre et al., 2012). In this work, we experiment with three types of dissimilarity functions. Lexical Dissimilarity. This function is based on the well-known Cosine similarity score using TFIDF weights. Let simtf idf (u, v) be the Cosine similarity between u and v, then we have d′ Lex(u, v) = 1 − simtf idf (u, v). Semantic Dissimilarity. This function is based on the semantic meaning embedded in the dependency relations. d′ Sem(u, v) = 1 − simSem(v, u), where simSem(v, u) is the semantic similarity used in content coverage measurement in Section 3.2. Topical Dissimilarity. We propose a novel dissimilarity measure based on topic models. Celikyilmaz et al. (2010) show that estimating the similarity between query and passages by using topic structures can help improve the retrieval performance. As discussed in the topic coverage in Section 3.2, each sentence is represented by its sentence-topic distributions estimated by LDA. For candidate sentence u and v, let their topic distributions be Pu and Pv. Then the dissimilarity between u and v can be defined 2 (Pu(i) + Pv(i)). as: d′ T opic(u, v) = JSD(PuPv) = 1 Pu(i) Pv (i) Pa(i) ) where Pa(i) = 1 2 (Pi Pu(i) log2 Pa(i) + Pi Pv(i) log2 3.4 Full Objective Function The objective function takes the interpolation of the submodular functions and dispersion function: F(S) = r(S) + αt(S) + βa(S) + γp(S) + ηc(S) + δh(S). (1) 2There exists a large amount of work on determining the polarity of a sentence (Pang and Lee, 2008) which can be employed for polarity clustering in this work. We decide to focus on summarization, and estimate sentence polarity through sentiment word summation (Yu and Hatzivassiloglou, 2003), though we do not distinguish different sentiment words. 3This definition of distance is used to produce theoretical guarantees for the greedy algorithm described in Section 3.5. The coefficients α, β, γ, η, δ are non-negative real numbers and can be tuned on a development set.4 Notice that each summand except h(S) is a non-decreasing, non-negative, and submodular function, and summation preserves monotonicity, non-negativity, and submodularity. Dispersion function h(s) is either hsum or hmin as introduced previously. 3.5 Summary Generation via Greedy Algorithm Generating the summary that maximizes our objective function in Equation 1 is NP-hard (Chandra and Halld´orsson, 1996). We choose to use a greedy algorithm that guarantees to obtain a constant factor ap- proximation to the optimal solution (Nemhauser et al., 1978; Dasgupta et al., 2013). Concretely, starting with an empty set, for each iteration, we add a new sentence so that the current summary achieves the maximum value of the objective function. In addition to the theoretical guarantee, existing work (Mc- Donald, 2007) has empirically shown that classical greedy algorithms usually works near-optimally. 4 Experimental Setup 4.1 Opinion Question Identification We first build a classifier to automatically detect opinion oriented questions in Community QA; questions in the blog dataset are all opinionated. Our opinion question classifier is trained on two opinion question datasets: (1) the first, from Li et al. (2008a), contains 646 opinionated and 332 objective questions; (2) the second dataset, from Amiri et al. (2013), consists of 317 implicit opinion questions, such as "What can you do to help environment?", and 317 objective questions. We train a RBF kernel based SVM classifier to identify opinion questions, which achieves F1 scores of 0.79 and 0.80 on the two datasets when evaluated using 10-fold cross-validation (the best F1 scores reported are 0.75 and 0.79). 4.2 Datasets Community QA Summarization: Yahoo! Answers. We use the Yahoo! Answers dataset from Yahoo! WebscopeT M program,5 which contains 3,895,407 questions. We first run the opinion question classifier to identify the opinion questions. For summarization purpose, we require each question having at least 5 answers, with the average length of answers larger than 20 words. This results in 130,609 questions. To make a compelling task, we reserve questions with an average length of answers larger than 50 words as our test set for both ranking and summarization; all the other questions are used for training. As a result, we have 92,109 questions in the training set for learning the statistical ranker, and 38,500 in the test set. The category distribution of training and test questions (Yahoo! Answers organizes the questions into predefined categories) are similar. 10,000 questions from the training set are further reserved as the development set. Each question in the Yahoo! Answers dataset has a user-voted best answer. These best answers are used to train the statistical ranker that predicts relevance. Separate topic models are learned for each category, where the category tag is provided by Yahoo! Answer. Blog Summarization: TAC 2008. We use the TAC 2008 corpus (Dang, 2008), which consists of 25 topics. 23 of them are provided with human labeled nuggets, which TAC used in human evaluation. TAC also provides snippets (i.e., sentences) that are frequently retrieved by participant systems or identified as relevant by human annotators. We do not assume those snippets are known to any of our systems. 4.3 Comparisons For both opinion summarization tasks, we compare with (1) the approach by Dasgupta et al. (2013), and (2) the systems from Lin and Bilmes (2011) with and without query information. The sentence clustering process in Lin and Bilmes (2011) is done by using CLUTO (Karypis, 2003). For the implementation of systems in Lin and Bilmes (2011) and Dasgupta et al. (2013), we always use the parameters reported to have the best performance in their work. For cQA summarization, we use the best answer voted by the user as a baseline. Note that this is a strong baseline since all the other systems are unaware of which answer is the best. For blog summa- rization, we have three additional baselines – the best systems in TAC 2008 (Kim et al., 2008; Li et al., 2008b), top sentences returned by our ranker, a baseline produced by TFIDF similarity and a lexicon 4The values for the coefficients are 5.0, 1.0, 10.0, 5.0, 10.0 for α, β, γ, η, δ, respectively, as tuned on the development set. 5http://sandbox.yahoo.com/ (henceforth called TFIDF+Lexicon). In TFIDF+Lexicon, sentences are ranked by the TFIDF similar- ity with the query, and then sentences with sentiment words are selected in sequence. This baseline aims to show the performance when we only have access to lexicons without using a learning algorithm. 5 Results 5.1 Evaluating the Ranker We evaluate our ranker (described in Section 3.1) on the task of best answer prediction. Table 2 compares the average precision and mean reciprocal rank (MRR) of our method to those of three baselines, (1) where answers are ranked randomly (Baseline (Random)), (2) by length (Baseline (Length)), and (3) by Jensen Shannon Divergence (JSD) with all answers. We expect that the best answer is the one that covers the most information, which is likely to have a smaller JSD. Therefore, we use JSD to rank answers in the ascending order. Table 2 manifests that our ranker outperforms all the other methods. Avg Precision MRR Baseline (Random) 0.1305 0.3403 Baseline (Length) 0.2834 0.4889 JSD 0.4000 0.5909 Ranker (ListNet) 0.5336 0.6496 Table 2: Performance for best answer prediction. Our ranker outperforms the three baselines. 5.2 Community QA Summarization Automatic Evaluation. Since human written abstracts are not available for the Yahoo! Answers dataset, we adopt the Jensen-Shannon divergence (JSD) to measure the summary quality. Intuitively, a smaller JSD implies that the summary covers more of the content in the answer set. Louis and Nenkova (2013) report that JSD has a strong negative correlation (Spearman correlation = −0.737) with the overall summary quality for multi-document summarization (MDS) on news articles and blogs. Our task is similar to MDS. Meanwhile, the average JSD of the best answers in our test set is smaller than that of the other answers (0.39 vs. 0.49), with an average length of 103 words compared with 67 words for the other answers. Also, on the blog task (Section 5.3), the top two systems by JSD also have the top two ROUGE scores (a common metric for summarization evaluation when human-constructed summaries are available). Thus, we conjecture that JSD is a good metric for community QA summaries. Table 3 (left) shows that our system using a content coverage function based on Cosine using TFIDF weights, and a dispersion function (hsum) based on lexicon dissimilarity and 100 topics, outperforms all of the compared approaches (paired-t test, p < 0.05). The topic number is tuned on the development set, and we find that varying the number of topics does not impact performance too much. Meanwhile, both our system and Dasgupta et al. (2013) produce better JSD scores than the two variants of the Lin and Bilmes (2011) system, which implies the effectiveness of the dispersion function. We further examine the effectiveness of each component that contributes to the objective function (Section 3.4), and the results are shown in Table 3 (right). Length JSD100 0.3424 0.3375 0.3366 0.3309 0.3102 0.3017 JSD200 0.2053 0.2040 0.2033 0.1983 0.1851 0.1758 200 - 0.2008 0.1988 0.1939 0.1758 100 0.3858 0.3398 0.3379 0.3316 0.3017 Rel(evance) Rel + Aut(hor) Rel + Aut + TM (Topic Models) Rel + Aut + TM + Pol(arity) Rel + Aut + TM + Pol + Cont(ent Coverage) Rel + Aut + TM + Pol + Cont + Disp(ersion) Best answer Lin and Bilmes (2011) Lin and Bilmes (2011) + q Dasgupta et al. (2013) Our system Table 3: [Left] Summaries evaluated by Jensen-Shannon divergence (JSD) on Yahoo Answer for sum- maries of 100 words and 200 words. The average length of the best answer is 102.70. [Right] Value addition of each component in the objective function. The JSD on each line is statistically significantly lower than the JSD on the previous (α = 0.05). Human Evaluation. Human evaluation for Yahoo! Answers is carried out on Amazon Mechanical Turk6 with carefully designed tasks (or "HITs"). Turkers are presented summaries from different systems in a random order, and asked to provide two rankings, one for overall quality and the other for information diversity. We indicate that informativeness and non-redundancy are desirable for quality; however, Turk- ers are allowed to consider other desiderata, such as coherence or responsiveness, and write down those when they submit the answers. Here we believe that ranking the summaries is easier than evaluating each summary in isolation (Lerman et al., 2009). 6https://www.mturk.com/mturk/ We randomly select 100 questions from our test set, each of which is evaluated by 4 distinct Turkers located in United States. 40 HITs are thus created, each containing 10 different questions. Four system summaries (best answer, Dasgupta et al. (2013), and our system with 100 and 200 words respectively) are displayed along with one noisy summary (i.e. irrelevant to the question) per question in random order.7 We reject Turkers' HITs if they rank the noisy summary higher than any other. Two duplicate questions are added to test intra-annotator agreement. We reject HITs if Turkers produced inconsistent rankings for both duplicate questions. A total of 137 submissions of which 40 HITs pass the above quality filters. Turkers of all accepted submissions report themselves as native English speakers. An inter-rater agree- ment of Fleiss' κ of 0.28 (fair agreement (Landis and Koch, 1977)) is computed for quality ranking and κ is 0.43 (moderate agreement) for diversity ranking. Table 4 shows the percentage of times a particular method is picked as the best summary, and the macro-/micro-average rank of a method, for both overall quality and information diversity. Macro-average is computed by first averaging the ranks per question and then averaging across all questions. For overall quality, our system with a 200 word limit is selected as the best in 44.6% of the evaluations. It outperforms the best answer (31.9%) significantly, which suggests that our system summary covers rel- evant information that is not contained in the best answer. Our system with a length constraint of 100 words is chosen as the best for quality 12.5% times while that of Dasgupta et al. (2013) is chosen 11.0% of the time. Our system is also voted as the best summary for diversity in 78.7% of the evaluations. More interestingly, both of our systems, with 100 words and 200 words, outperform the best answer and Das- gupta et al. (2013) for average ranking (both overall quality and information diversity) significantly by using Wilcoxon signed-rank test (p < 0.05). When we check the reasons given by Turkers, we found that people usually prefer our summaries due to "helpful suggestions that covered many options" or being "balanced with different opinions". When Turks prefer the best answers, they mostly stress on coherence and responsiveness. Sample summaries from all the systems are displayed in Figure 2. Length of Summary Best answer Dasgupta et al. (2013) Our system Our system 102.70 100 200 Overall Quality Average Rank % Macro Micro Best 2.69 2.68 31.9% 2.84 2.83 11.0% 2.50∗ 2.50∗ 12.5% 44.6% 1.98∗ 1.98∗ Information Diversity Average Rank % Macro Micro Best 3.29 3.27 9.6% 5.0% 2.95 2.94 2.43∗ 2.43∗ 6.7% 78.7% 1.35∗ 1.34∗ Table 4: Human evaluation on Yahoo! Answer Data. Boldface implies statistically significance com- pared to other results in the same columns using paired-t test. Both of our systems are ranked higher (i.e. numbers in bold with ∗) than the best answers voted by Yahoo! users and system summaries from Dasgupta et al. (2013). Question: What is the long term effect of piracy on the music and film industry? Dasgupta et al. (2013) (Qty Rank=2.75 Div. Rank=2.5): •In short, I don't think the music industry in particular will ever enjoy the huge profits of the 90's. •Please-People in those businesses make millions of dollars as it is !! I don't think piracy hurts them at all !!! •The other thing will be music and movies with less quality. •Its a big gray area, I dont see anything wrong with burning a mix cd or a cd for a friend so long as youre not selling them for profit. •By removing the profitability of music & film companies, piracy takes away their motivation to produce new music & movies. Our system (100 words) (Qty Rank=2.25 Div. Rank=2.25): •Rising costs for movies and music. The other thing will be music and movies with less quality. •Now, with piracy, there isn't the willingness to take chances. •But it's also like the person put the effort into it and they aren't getting paid. It's a big gray area, I don't see anything wrong with burning a mix cd or a cd for a friend so long as you're not selling them for profit. •It is forcing them to rework their business model, which is a good thing. Our system (200 words) (Qty. Rank=2.25, Div Rank=1.25): •Rising costs for movies and music. The other thing will be music and movies with less quality. •Now, with piracy, there isn't the willingness to take chances. American Idol is the result of this. .... The real problem here is that the mainstream music will become even tighter. Record labels will not won't to go far from what is currently like by the majority. •I hate when people who have billions of dollars whine about not having more money. But it's also like the person put the effort into it and they aren't getting paid ... I don't see anything wrong with burning a mix cd or a cd for a friend .... •It is forcing them to rework their business model, which is a good thing. •By removing the profitability of music & film companies, piracy takes away their motivation to produce new music & movies. Figure 2: Sample summaries from Dasgupta et al. (2013), and our systems (100 words and 200 words). Sentences from separate bullets (•) are partial answers from different users. 7Note that we aim to compare results with the gold-standard best answers of about 100 words. The evaluation of the 200-word summaries is provided only as an additional data-point. 5.3 Blog Summarization Automatic Evaluation. We use the ROUGE (Lin and Hovy, 2003) software with standard options to automatically evaluate summaries with reference to the human labeled nuggets as those are available for this task. ROUGE-2 measures bigram overlap and ROUGE-SU4 measures the overlap of unigram and skip-bigram separated by up to four words. We use the ranker trained on Yahoo! data to produce relevance ordering, and adopt the system parameters from Section 5.2. Table 5 (left) shows that our system outperforms the best system in TAC'08 with highest ROUGE-2 score (Kim et al., 2008), the two baselines (TFIDF+Lexicon, and our ranker), Lin and Bilmes (2011), and Dasgupta et al. (2013). ROUGE-2 ROUGE-SU4 JSD 0.3286 0.2429 0.2293 0.2330 0.2349 0.2370 0.2258 Our system Pyramid F-score 0.2225 0.2790 0.3620 Best system in TAC'08 Lin and Bilmes (2011) 0.3766 0.3876 0.3960 0.3582 0.3700 0.3500 0.3978 0.2923 0.3069 0.3200 0.2732 0.2852 0.2618 0.3234 Best system in TAC'08 TFIDF + Lexicon Ranker (ListNet) Lin and Bilmes (2011) Lin and Bilmes (2011) + q Dasgupta et al. (2013) Our system Table 5: Results on TAC'08 dataset. [Left] Our system has significant better ROUGE scores than all the other systems except our ranker (paired-t test, p < 0.05). We also achieve the best JS divergence. [Right] Human evaluation with Pyramid F-score. Our system significantly outperforms the others. Human Evaluation. For human evaluation, we use the standard Pyramid F-score used in the TAC'08 opinion summarization track with β = 3 (Dang, 2008). In the TAC task, systems are allowed to return up to 7,000 non-white characters for each question. Since the TAC metric favors recall we do not produce summaries shorter than 7,000 characters. We ask two human judges to evaluate our system along with the one that got the highest Pyramid F-score in the TAC'08 and Lin and Bilmes (2011). Cohen's κ for inter-annotator agreement is 0.68 (substantial). While we did not explicitly evaluate non-redundancy, both of our judges report that our system summaries contain less redundant information. 5.4 Further Discussion Yahoo! Answer DISPERSIONsum DISPERSIONmin TAC 2008 DISPERSIONsum DISPERSIONmin Contsem 0.3232 0.3209 0.3172 Conttf idf 0.3143 0.3101 0.3017 Contsem Conttf idf 0.324 3 0.3129 0.3106 0.3202 0.3147 0.3071 DISSIMI Semantic Topical Lexical Table 6: Effect of different dispersion functions, content coverage, and dissimilarity metrics on our system. [Left] JSD values for different combinations on Yahoo! data, using LDA with 100 topics. All systems are significantly different from each other at significance level α = 0.05. Systems using summation of distances for dispersion function (hsum) uniformly outperform the ones using minimum distance (hmin). [Right] ROUGE scores of different choices for TAC 2008 data. All systems use LDA with 40 topics. The parameters of our systems are adopted from the ones tuned on Yahoo! Answers. Contsem Conttf idf 0.2169 0.2772 0.3234 0.2090 0.2129 0.3117 Conttf idf 0.2216 0.2128 0.2167 DISSIMI Semantic Topical Lexical Contsem 0.2579 0.3056 0.3160 Given that the text similarity metrics and dispersion functions play important roles in the framework, we further study the effectiveness of different content coverage functions (Cosine using TFIDF vs. Se- mantic), dispersion functions (hsum vs. hmin), and dissimilarity metrics used in dispersion functions (Semantic vs. Topical vs. Lexical). Results on Yahoo! Answer (Table 6 (left)) show that systems using summation of distances for dispersion functions (hsum) uniformly outperform the ones using minimum distance (hmin). Meanwhile, Cosine using TFIDF is better at measuring content coverage than WordNet- based semantic measurement, and this may due to the limited coverage of WordNet on verbs. This is also true for dissimilarity metrics. Results on blog data (Table 6 (right)), however, show that using minimum distance for dispersion produces better results. This indicates that optimal dispersion function varies by genre. Topical-based dissimilarity also marginally outperforms the other two metrics in blog data. 6 Conclusion We propose a submodular function-based opinion summarization framework. Tested on community QA and blog summarization, our approach outperforms state-of-the-art methods that are also based on sub- modularity in both automatic evaluation and human evaluation. Our framework is capable of including statistically learned sentence relevance and encouraging the summary to cover diverse topics. We also study different metrics on text similarity estimation and their effect on summarization. References Eneko Agirre, Daniel Cer, Mona Diab, and Aitor Gonzalez-Agirre. 2012. Semeval-2012 task 6: A pilot on seman- tic textual similarity. In Volume 2: Proceedings of the Sixth International Workshop on Semantic Evaluation (SemEval 2012), pages 385–393, Montr´eal, Canada, 7-8 June. Association for Computational Linguistics. Hadi Amiri, Zheng-Jun Zha, and Tat-Seng Chua. 2013. A pattern matching based model for implicit opinion question identification. In AAAI. AAAI Press. David M. Blei, Andrew Y. Ng, and Michael I. Jordan. 2003. Latent dirichlet allocation. J. Mach. Learn. Res., 3:993–1022, March. Zhe Cao, Tao Qin, Tie-Yan Liu, Ming-Feng Tsai, and Hang Li. 2007. Learning to rank: From pairwise approach to listwise approach. In Proceedings of the 24th International Conference on Machine Learning, ICML '07, pages 129–136, New York, NY, USA. ACM. Jaime Carbonell and Jade Goldstein. 1998. The use of mmr, diversity-based reranking for reordering documents and producing summaries. In Proceedings of the 21st Annual International ACM SIGIR Conference on Research and Development in Information Retrieval, SIGIR '98, pages 335–336, New York, NY, USA. ACM. Asli Celikyilmaz, Dilek Hakkani-Tur, and Gokhan Tur. 2010. Lda based similarity modeling for question answer- ing. In Proceedings of the NAACL HLT 2010 Workshop on Semantic Search, SS '10, pages 1–9, Stroudsburg, PA, USA. Association for Computational Linguistics. Barun Chandra and Magn´us M. Halld´orsson. 1996. Facility dispersion and remote subgraphs. In Proceedings of the 5th Scandinavian Workshop on Algorithm Theory, SWAT '96, pages 53–65, London, UK, UK. Springer- Verlag. Hoa Tran Dang. 2008. Overview of the tac 2008 opinion question answering and summarization tasks. In Proc. TAC 2008. Van Dang. 2011. RankLib. http://www.cs.umass.edu/vdang/ranklib.html. Anirban Dasgupta, Ravi Kumar, and Sujith Ravi. 2013. Summarization through submodularity and dispersion. In Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1014–1022, Sofia, Bulgaria, August. Association for Computational Linguistics. Hal Daum´e, III and Daniel Marcu. 2006. Bayesian query-focused summarization. In Proceedings of the 21st International Conference on Computational Linguistics and the 44th Annual Meeting of the Association for Computational Linguistics, ACL-44, pages 305–312, Stroudsburg, PA, USA. Association for Computational Linguistics. Andrea Esuli and Fabrizio Sebastiani. 2006. Sentiwordnet: A publicly available lexical resource for opinion In In Proceedings of the 5th Conference on Language Resources and Evaluation (LREC06, pages mining. 417–422. Minqing Hu and Bing Liu. 2004. Mining and summarizing customer reviews. In Proceedings of the Tenth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD '04, pages 168–177, New York, NY, USA. ACM. George Karypis. 2003. CLUTO - a clustering toolkit. Technical Report #02-017, November. Hyun Duk Kim, Dae Hoon Park, V.G.Vinod Vydiswaran, and ChengXiang Zhai. 2008. Opinion summarization using entity features and probabilistic sentence coherence optimization: Uiuc at tac 2008 opinion summarization pilot. In Proc. TAC 2008. J R Landis and G G Koch. 1977. The measurement of observer agreement for categorical data. Biometrics, 33(1):159–174. Kevin Lerman, Sasha Blair-Goldensohn, and Ryan McDonald. 2009. Sentiment summarization: Evaluating and learning user preferences. In Proceedings of the 12th Conference of the European Chapter of the Association for Computational Linguistics, EACL '09, pages 514–522, Stroudsburg, PA, USA. Association for Computational Linguistics. Baoli Li, Yandong Liu, and Eugene Agichtein. 2008a. Cocqa: Co-training over questions and answers with an application to predicting question subjectivity orientation. In EMNLP, pages 937–946. Wenjie Li, You Ouyang, Yi Hu, and Furu Wei. 2008b. Polyu at tac 2008. In Proc. TAC 2008. Hui Lin and Jeff Bilmes. 2011. A class of submodular functions for document summarization. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies - Volume 1, HLT '11, pages 510–520, Stroudsburg, PA, USA. Association for Computational Linguistics. Chin-Yew Lin and Eduard Hovy. 2000. The automated acquisition of topic signatures for text summarization. COLING '00, pages 495–501, Stroudsburg, PA, USA. Association for Computational Linguistics. Chin-Yew Lin and Eduard Hovy. 2003. Automatic evaluation of summaries using n-gram co-occurrence statistics. In Proceedings of the 2003 Conference of the North American Chapter of the Association for Computational Linguistics on Human Language Technology - Volume 1, pages 71–78. Yuanjie Liu, Shasha Li, Yunbo Cao, Chin-Yew Lin, Dingyi Han, and Yong Yu. 2008. Understanding and sum- marizing answers in community-based question answering services. In Proceedings of the 22Nd International Conference on Computational Linguistics - Volume 1, COLING '08, pages 497–504, Stroudsburg, PA, USA. Association for Computational Linguistics. Annie Louis and Ani Nenkova. 2013. Automatically assessing machine summary content without a gold standard. Comput. Linguist., 39(2):267–300, June. Xiaoqiang Luo, Hema Raghavan, Vittorio Castelli, Sameer Maskey, and Radu Florian. 2013. Finding what matters in questions. In HLT-NAACL, pages 878–887. Ryan McDonald. 2007. A study of global inference algorithms in multi-document summarization. ECIR'07, pages 557–564, Berlin, Heidelberg. Springer-Verlag. Rada Mihalcea, Courtney Corley, and Carlo Strapparava. 2006. Corpus-based and knowledge-based measures of text semantic similarity. In Proceedings of the 21st National Conference on Artificial Intelligence - Volume 1, AAAI'06, pages 775–780. AAAI Press. G. L. Nemhauser, L. A. Wolsey, and M. L. Fisher. 1978. An analysis of approximations for maximizing submod- ular set functionsI. Mathematical Programming, 14(1):265–294, December. Ani Nenkova and Lucy Vanderwende. 2005. The impact of frequency on summarization. Microsoft Research, Redmond, Washington, Tech. Rep. MSR-TR-2005-101. Bo Pang and Lillian Lee. 2008. Opinion mining and sentiment analysis. Found. Trends Inf. Retr., 2(1-2):1–135, January. Michael J. Paul, ChengXiang Zhai, and Roxana Girju. 2010. Summarizing contrastive viewpoints in opinionated text. In Proceedings of the 2010 Conference on Empirical Methods in Natural Language Processing, EMNLP '10, pages 66–76, Stroudsburg, PA, USA. Association for Computational Linguistics. Ruben Sipos, Pannaga Shivaswamy, and Thorsten Joachims. 2012. Large-margin learning of submodular summa- rization models. EACL '12, pages 224–233, Stroudsburg, PA, USA. Association for Computational Linguistics. Philip J. Stone, Dexter C. Dunphy, Marshall S. Smith, and Daniel M. Ogilvie. 1966. The General Inquirer: A Computer Approach to Content Analysis. MIT Press, Cambridge, MA. Veselin Stoyanov and Claire Cardie. 2006. Partially supervised coreference resolution for opinion summarization through structured rule learning. In Proceedings of the 2006 Conference on Empirical Methods in Natural Language Processing, EMNLP '06, pages 336–344, Stroudsburg, PA, USA. Association for Computational Linguistics. Mattia Tomasoni and Minlie Huang. 2010. Metadata-aware measures for answer summarization in community question answering. In Proceedings of the 48th Annual Meeting of the Association for Computational Linguis- tics, ACL '10, pages 760–769, Stroudsburg, PA, USA. Association for Computational Linguistics. Theresa Wilson, Janyce Wiebe, and Paul Hoffmann. 2005. Recognizing contextual polarity in phrase-level senti- ment analysis. In Proceedings of the Conference on Human Language Technology and Empirical Methods in Natural Language Processing, HLT '05, pages 347–354, Stroudsburg, PA, USA. Association for Computational Linguistics. Pengtao Xie and Eric Xing. 2013. Integrating document clustering and topic modeling. In Proceedings of the Twenty-Ninth Conference Annual Conference on Uncertainty in Artificial Intelligence (UAI-13), pages 694– 703, Corvallis, Oregon. AUAI Press. Hong Yu and Vasileios Hatzivassiloglou. 2003. Towards answering opinion questions: Separating facts from In Proceedings of the Conference on Empirical opinions and identifying the polarity of opinion sentences. Methods in Natural Language Processing (EMNLP).
1711.08231
3
1711
2018-06-13T02:16:11
Does Higher Order LSTM Have Better Accuracy for Segmenting and Labeling Sequence Data?
[ "cs.CL" ]
Existing neural models usually predict the tag of the current token independent of the neighboring tags. The popular LSTM-CRF model considers the tag dependencies between every two consecutive tags. However, it is hard for existing neural models to take longer distance dependencies of tags into consideration. The scalability is mainly limited by the complex model structures and the cost of dynamic programming during training. In our work, we first design a new model called "high order LSTM" to predict multiple tags for the current token which contains not only the current tag but also the previous several tags. We call the number of tags in one prediction as "order". Then we propose a new method called Multi-Order BiLSTM (MO-BiLSTM) which combines low order and high order LSTMs together. MO-BiLSTM keeps the scalability to high order models with a pruning technique. We evaluate MO-BiLSTM on all-phrase chunking and NER datasets. Experiment results show that MO-BiLSTM achieves the state-of-the-art result in chunking and highly competitive results in two NER datasets.
cs.CL
cs
Does Higher Order LSTM Have Better Accuracy for Segmenting and Labeling Sequence Data? Yi Zhang, Xu Sun, Shuming Ma, Yang Yang, Xuancheng Ren MOE Key Lab of Computational Linguistics, School of EECS, Peking University {zhangyi16, xusun, shumingma, 1200012760, renxc}@pku.edu.cn 8 1 0 2 n u J 3 1 ] L C . s c [ 3 v 1 3 2 8 0 . 1 1 7 1 : v i X r a Abstract Existing neural models usually predict the tag of the current token independent of the neigh- boring tags. The popular LSTM-CRF model considers the tag dependencies between every two consecutive tags. However, it is hard for existing neural models to take longer distance dependen- cies of tags into consideration. The scalability is mainly limited by the complex model structures and the cost of dynamic programming during training. In our work, we first design a new model called "high order LSTM" to predict multiple tags for the current token which contains not only the current tag but also the previous several tags. We call the number of tags in one prediction as "order". Then we propose a new method called Multi-Order BiLSTM (MO-BiLSTM) which combines low order and high order LSTMs together. MO-BiLSTM keeps the scalability to high order models with a pruning technique. We evaluate MO-BiLSTM on all-phrase chunking and NER datasets. Experiment results show that MO-BiLSTM achieves the state-of-the-art result in chunking and highly competitive results in two NER datasets. 1 1 Introduction Chunking and named entity recognition are sequence labeling tasks whose target is to find the correct segments and give them the correct labels. The tags inside a segment have internal dependencies. The tags in consecutive segments may have dependencies, too. Therefore, it is natural to take the tag depen- dencies into consideration when making a prediction in such sequence labeling tasks. Recently, methods have been proposed to capture tag dependencies for neural networks. Collobert et al. (2011) proposed a method based on convolutional neural networks, which can use dynamic program- ming in training and testing stage (like a CRF layer) to capture tag dependencies. Furthermore, Huang et al. (2015) proposed LSTM-CRF by combining LSTM and CRF for structured learning. They use a transition matrix to model the tag dependencies. A similar structure is adopted by Ma and Hovy (2016). Their model also involves an external layer to extract some character level features. However, it is not explicit how to model the dependencies of more tags or use the dependency infor- mation in these lines of work. We then propose a solution to capture long distance tag dependencies and use them for dependency-aware prediction of tags. For clarity, we first give some detailed explanations of the related terms in our work. "order" means the number of tags that a prediction involves in a model. An order-2 tag is a bigram which contains the previous tag and the current tag at a certain time step, as shown in Figure 1. Higher order tags are defined in a similar way. We first develop a simple method to implement high order models. But these models, which are supposed to capture more tag dependency information, perform worse and worse as the order of models increases. One possible reason is that trying to capture more tag dependencies raises the difficulty of prediction. We name these models as single order models and propose a new method based on them. The proposed Multi-Order LSTM (MO-LSTM) combines multi-order information from these single order models to decode. It keeps the scalability with a proposed pruning technique and performs well in our 1The code is available at https://github.com/lancopku/Multi-Order-LSTM This work is licensed under a Creative Commons Attribution 4.0 International License. License details: http:// creativecommons.org/licenses/by/4.0/ Figure 1: An illustration of tags of different orders. tasks. Experiments show that MO-LSTM achieves the state-of-the-art F1 score in all-phrase chunking and competitive scores in two NER datasets. The contributions of this work are as follows: • We extend the LSTM model to higher order models. However, the performance of the high order models which are supposed to capture longer tag dependencies is getting worse when increasing the order. • We propose a model integrating low order and high order models. It keeps the scalability in both training and testing stage with a pruning technique. • The proposed MO-LSTM achieves an evident error reduction in chunking and NER tasks. It pro- duces the state-of-the-art F1 score in chunking and highly competitive results in two NER datasets. 2 Single Order LSTM We first propose a simple training and decoding method which enables the existing models to extend to higher order models. Take the order-2 model as an example, for each word we combine its previous tag and its current tag to produce a bigram tag as its new tag to predict. Hence, the model can be trained with the "new" bigram (order-2) tag set. Formally, given an input sequence x = {x1, x2,··· , xT}, where xt denotes the t-th word in a sentence and T denotes the sentence length. The sequence y = {y1, y2,··· , yT} represents a possible label se- quence for x. We denote Y (1) as the set of all possible order-1 labels, and yt ∈ Y (1). The order-1 model can be represented as: s1(y1, y2,··· , yTx; θ) = s(ytx; θ) (1) T(cid:89) t=1 T(cid:89) where θ is the parameters of the model. In implementation, we use a Bi-LSTM with a softmax layer to compute the score s(ytx; θ). To extend the order-1 model to an order-2 model, we transform the unigram label sequence into a bigram label sequence y0y1, y1y2,··· , yT−1yT , where y0 is a special START symbol. The bigram label is defined as a combination of two consecutive label yt−1 and yt, and Y (2) is the set of all possible bigram labels that appear in the training set. The order-2 model can then be written as: s2(y1, y2,··· , yTx; θ) = s(yt−1ytx; θ) (2) Similar to the order-1 model, the score s(yt−1ytx; θ) is computed by a Bi-LSTM with a softmax layer. In implementation, the difference with the order-1 model is that the unigram label is replaced with the t=1 order-1 taghighordertags…………order-2 tagorder-3 tagorder-n tag…BOIB II OB I O…B I… B … B… B… B I… B I O… B I O B…I O BBO Binput…𝑥𝑡𝑥𝑡−1𝑥𝑡+1𝑥𝑡+2… (a) Single Order-1 Model (b) Single Order-2 Model (c) Multi-Order-2 Model Figure 2: An illustration of the single order model and the multi-order model. The single order-1 model is a BiLSTM. bigram label. In this way, the model can be further extended to order-n: T(cid:89) sn(y1, y2,··· , yTx; θ) = s(yt−n+1 ··· ytx; θ) (3) t=1 As the order of the models increases, the models are supposed to learn more tag dependencies. How- ever, according to our experiments, the performance of these models is getting worse, and the detailed results are shown in Section 4. An intuitive reason to explain the experimental phenomena is that the increasing size of the label set makes it more difficult to predict a correct label of the input word. An- other potential reason is that the complex structure leads to overfitting problem. Sun (2014) suggests that complex structures are actually harmful to the generalization ability in structured prediction. 3 Multi-Order BiLSTM The performance of single high order models deteriorates as the order increases. But they might cap- ture some kinds of useful dependency information. To make use of these dependency information, we introduce a multi-order model which combines the low-order and high-order information. The proposed multi-order model consists of several single order models (as described in Section 2) of different orders. At the training stage, these models are trained separately as usual. At the decoding stage, we propose a new decoding method to combine the low order model and the high order model. Since both low order information and high order information is used when decoding, the proposed method is named Multi- Order BiLSTM (MO-BiLSTM). In this section, we first give the details of the training and the decoding process, and then introduce a pruning technique to improve the efficiency of MO-BiLSTM. 3.1 Multi-Order Training Our proposed multi-order-n model is a mixture of k single order models with different orders, where n is the maximum order of the single order models. When n = 1, the multi-order model becomes a single order-1 model, i.e. a BiLSTM. The order set of the single order models is the subset of {1, 2,··· , n}. For example, if the maximum order n is 3, the combination of the single order models can be [1, 2], [1, 3], [2, 3], or [1, 2, 3]. Formally, we denote the order set as {o1, o2,··· , ok}, where oi<oj and i<j. In our implementation, n is equal to k in both training and decoding stage. At the training stage, we train k single order models separately following Eq. 3: θi = argmax θ soi(y1, y2,··· , yTx; θ) = argmax θ s(yt−oi+1 ··· ytx; θ) (4) where θi is the parameters of the i-th single order model of the order oi. After training, we obtain a set of k independent models: {s(yt−o1+1 ··· ytx; θ1),··· , s(yt−oi+1 ··· ytx; θi)}, which learns the label dependency of different orders. 3.2 Multi-Order Decoding For the purpose of simplicity and clarity, we first describe the proposed decoding method of MO- BiLSTM in the order-2 case, and then we extend it to the general order-n case. T(cid:89) t=1 BiLSTMBIIOBiLSTMBIIOBIIIIOBiLSTMBIIOBIIIIO Select the top-k uni-labels by the order-1 scores: Algorithm 1 Multi-order decoding with pruning in the order-n case 1: Input: sentence x, trained order-1 LSTM s1(yx) in Eq. 1, multi-order-n LSTM sn(yx) in Eq. 6 2: for t = 1...T do 3: Y1 = topkTag(s1(ytx)), Y2 = topkTag(s1(yt−1x)),··· , Yn = topkTag(s1(yt−n+1x)) 4: 5: Y = Y1 × Y2 × ··· × Yn 6: 7: Previous tag state dt−1 = y1y2 ··· yn−1 8: Current tag state dt = y2y3 ··· yn 9: Compute the transition score s = sn(y1, y2,··· , ynx) by multi-order-n LSTM 10: Compute the maximum score at current state A[t][dt] = max(A[t][dt], A[t − 1][dt−1] ∗ s) 11: 12: Output: The optimal tag sequence y∗ by backtracking the path of the maximum score A[T ][dT ] Combine n top-k uni-label sets into a n-gram label set: for each (y1, y2,··· , yn) ∈ Y do As shown in Figure 2, in the order-2 case the multi-order model is a mixture of 2 single order models, i.e. single order-1 model (Eq. 1) and single order-2 model (Eq. 2). At the decoding stage, the multi- order model takes account of both the order-1 model and the order-2 model. We need a new decoding approach to unify the decisions of both models. Since the order-1 model and order-2 model predict the label sequence independently, we choose to multiply the scores of order-1 model and order-2 model to get a global score, and use a dynamic programming algorithm to search for the label sequence with the maximum score: y∗ 1, y∗ s1(y1, y2,··· , yTx; θ1) × s2(y1, y2,··· , yTx; θ2) 2,··· , y∗ T = argmax s(ytx; θ1) × s(yt−1, ytx; θ2) (5) y T(cid:89) = argmax y t=1 where s(ytx; θ1) and s(yt−1, ytx; θ2) are the score predictions of the single order-1 model and the single order-2 model, respectively. The details of the dynamic programming algorithm are shown in Section 3.3. Further, we extend the order-2 case to a general order-n case. The difference with the order-2 case is that there are k single order models to approximate the scores of the generated label sequence. We approximate the scores by multiplying all the scores of these trained single order models, and then decode the sequence with the maximum score. Formally, it can be written as: y∗ 1, y∗ 2,··· , y∗ T = argmax y = argmax y soi(y1, y2,··· , yTx; θi) T(cid:89) s(yt−oi+1 ··· ytx; θi) (6) k(cid:89) k(cid:89) i=1 i=1 t=1 where s(yt−oi+1 ··· ytx; θi) is the score prediction of the i-th single order model of the order oi. 3.3 Scalable Decoding with Pruning Here, we introduce an efficient dynamic programming algorithm to search for the label sequence with the maximum score. The scores of different n-gram labels are jointly considered in our model. Orig- inally, we should consider all possible n-gram labels at every position of the sentence during dynamic programming. However, it will lead to a huge search space and a lot of time. In order to reduce the time cost, we can prune the unnecessary searching branches. For example, an order-1 model assigns a very low probability to the uni-label "I" of the t-th word, which means the order-1 model is confident that the t-th word can hardly be labeled as "I". Therefore, it is unnecessary to take account of the bi-gram labels "I-B", "I-I", and "I-O" at the next time step. Model All-Chunking English-NER Dutch-NER Single Order-1 BiLSTM 93.89 Single Order-2 BiLSTM 93.71 (-0.18) Single Order-3 BiLSTM 93.34 (-0.55) Multi-Order-1 BiLSTM 93.89 Multi-Order-2 BiLSTM 94.93 (+1.04) Multi-Order-3 BiLSTM 95.01 (+1.12) 88.23 87.61 (-0.62) 87.47 (-0.76) 88.23 90.23 (+2.00) 90.70 (+2.47) 77.20 76.61 (-0.59) 76.47 (-0.73) 77.20 80.95 (+3.75) 81.76 (+4.56) Table 1: Results of single order models and MO-BiLSTM. The number in parentheses means the im- provements or reductions compared to the results of order-1 models. All-Chunking denotes All-Phrase- Chunking. In implementation, we use the order-1 labels with high scores to evaluate whether to prune the high order labels. More precisely, we simply keep the top-k order-1 labels at each position. The order-n labels for a specific position is generated by the top-k labels of n tokens around the position. Suppose a task has totally 50 labels. The order-1 model should compute 50 scores of these labels at each time step. As for the order-3 model, the number of the scores to be computed becomes 503. The original search space before pruning for dynamic programming at each time step is 503. But if we only keep top-5 order-1 labels at each position and prune the order-n labels, the search space will be reduced from 503 to 53. According to our experiments, the pruning technique saves a lot of time in the decoding stage and results in no loss of accuracy, and we find top-5 pruning works the best in order to balance the accuracy and the time cost. Details of the experiments can be found in Section 4. Algorithm 1 shows the detailed process of multi-order decoding with pruning in the order-n case. 4 Experiments 4.1 Datasets Chunking and named entity recognition are sequence labeling tasks that are sensitive to tag dependen- cies. The tags inside a segment have internal dependencies. The tags in consecutive segments may have dependencies, too. Thus, we conduct experiments on the chunking and NER tasks to evaluate the pro- posed method. The test metric is F1-score. The chunking data is from CoNLL-2000 shared task (Sang and Buchholz, 2000), where we need to identify constituent parts of sentences (nouns, verbs, adjectives, etc.). To distinguish it from NP-chunking, it is referred to as the all-phrase chunking. We use the English NER data from the CoNLL-2003 shared task (Sang and Meulder, 2003). There are four types of enti- ties to be recognized: PERSON, LOCATION, ORGANIZATION, and MISC. The other NER dataset is the Dutch-NER dataset from the shared task of CoNLL-2002. The types of entities are the same as the English NER dataset. 4.2 Experimental Details Our model uses a single layer for the forward and backward LSTMs whose dimensions are set to 200. We use the Adam learning method (Kingma and Ba, 2014) with the default hyper parameters. We set the dropout (Srivastava et al., 2014) rate to 0.5. Following previous work (Huang et al., 2015), we extract some spelling features and context features. We did not use extra resources, with the exception of using Senna embeddings2 in Chunking and English- NER tasks. The embeddings in Dutch-NER tasks are randomly initialized with a size of 50. The code is implemented with the python package Tensorflow (Abadi et al., 2016). 4.3 Effect of Multi-Order Setting For simplicity, the single order model of order-n is denoted as single order-n model and the multi-order model in the order-n case is denoted as multi-order-n model. To verify the effectiveness of MO-BiLSTM, 2Downloaded from http://ronan.collobert.com/senna/ Model All-Chunking English-NER Dutch-NER Order-1 Order-2 Order-3 14 154 832 10 39 138 11 44 158 Table 2: The sizes of tag set of different order. we conduct comparison experiments of single order models and multi-order models. The results are shown in Table 1. The performance of single order BiLSTM models is getting worse with the growing of the order. An intuitive reason is that the increasing size of tag set raises the difficulty to make a correct tag prediction of a word. Although the performance of single high order models is far from satisfactory, the multi-order models perform well with consistent growth of F1-score on three datasets. In chunking, the MO-BiLSTM at order-3 obtains a 18.3% error reduction compared to BiLSTM. It also performs well in the NER tasks, resulting in a 21.6% and a 20.0% error reductions in English-NER and Dutch-NER compared to BiLSTM baselines, respectively. The results suggest that high order dependency information is indeed beneficial to the prediction. Furthermore, the adopted multi-order setting makes the learned tag dependency specific to the input words. The reason is that the proposed high order model encodes the tag dependency into a single "output tag", and model the "output tag" relations using a BiLSTM conditioned on the input words. The tag dependency in previous work is represented by a transition matrix, which cannot capture the relations of tag dependencies with respect to the input words. Moreover, MO-BiLSTM can take advantage of the subtle tag dependencies captured by single-order models and naturally integrate multi-order information to make tag prediction. The decoding process of MO-BiLSTM finds a global optimum tag sequence, which significantly reduces the risk of mistakes. MO-BiLSTM also results in a growing size of tag set. The sizes of tag set from order-1 model to order-3 model are given in Table 2 respectively. The tag size of the model is beyond a hundred at order-3 case. Although the size of tag set grows as the order of model increases, it is acceptable in such sequence labeling problems compared to the vocabulary size in machine translation which can be over millions. 4.4 Effect of Pruning The effect of pruning on speeding up the decoding is presented in Table 3. As shown, the pruning technique has shown a great ability to save time with no loss of accuracy. We then give a detailed analysis of the pruning technique. Original search process of dynamic programming considers all possible high order dependencies. However, most low-order tags have been assigned very low probabilities by low- order models and they will form almost impossible high-order tags. Thus, we only keep a small subset of all low-order tags, which makes the possible combinations shrink rapidly so that the cost of dynamic programing is greatly reduced. We also find that the pruned search space has no effect on the performance of the models. We suppose it is almost unlikely that the best tag sequence is out of the pruned search space. Hence, the accuracy is kept to the full extent, as shown in our experiments. Model Multi-Order-2 BiLSTM w/o pruning Multi-Order-2 BiLSTM Multi-Order-3 BiLSTM w/o pruning Multi-Order-3 BiLSTM All-Chunking F1 Time (s) 94.93 31.59 13.64 94.93 95.01 215.21 44.81 95.01 English-NER Time (s) F1 90.23 19.23 13.13 90.23 90.70 51.78 20.43 90.70 Dutch-NER F1 80.95 80.95 81.76 81.76 Time (s) 26.60 18.42 69.79 28.66 Table 3: Effect of pruning on speeding up the decoding. All-Chunking SVM classifier (Kudo and Matsumoto, 2001) Second order CRF (Sha and Pereira, 2003) Second order CRF (McDonald et al., 2005) Specialized HMM + voting scheme (Shen and Sarkar, 2005) Second order CRF (Sun et al., 2008) Conv network tagger (senna) (Collobert et al., 2011) CRF-ADF (Sun et al., 2014) BiLSTM-CRF (Senna) (Huang et al., 2015) Edge-based CRF (Ma and Sun, 2016) Encoder-decoder-pointer framework(Zhai et al., 2017) BiLSTM (our implementation) MO-BiLSTM (this work) F1 93.91 94.30 94.29 94.01 94.34 94.32 94.52 94.46 94.80 94.72 93.89 95.01 Table 4: All-Chunking: Comparison with state-of-the-art models. English-NER Combination of HMM, Maxent etc. (Florian et al., 2003) Semi-supervised model combination (Ando and Zhang, 2005) Conv-CRF (Senna + Gazetteer) (Collobert et al., 2011) CRF with Lexicon Infused Embeddings (Passos et al., 2014) BiLSTM-CRF (Senna) (Huang et al., 2015) BiLSTM-CRF (Lample et al., 2016) BiLSTM-CNNs-CRF (Ma and Hovy, 2016) Iterated Dilated CNNs (Strubell et al., 2017) CNN-CNN-LSTM (Shen et al., 2018) BiLSTM (our implementation) MO-BiLSTM (this work) F1 88.76 89.31 89.59 90.90 90.10 90.94 91.21 90.65 90.89 88.23 90.70 Table 5: English-NER: Comparison with state-of-the-art models. Dutch-NER AdaBoost (decision trees) (Carreras et al., 2002) Semi-structured resources (Nothman et al., 2013) Variant of Seq2Seq (Gillick et al., 2015) Character-Level Stacked BiLSTM (Kuru et al., 2016) BiLSTM-CRF (Lample et al., 2016) Special Decoder + Attention (Martins and Kreutzer, 2017) BiLSTM (our implementation) MO-BiLSTM (this work) F1 77.05 78.60 78.08 79.36 81.74 80.29 77.20 81.76 Table 6: Dutch-NER: Comparison with state-of-the-art models. Gillick et al. (2015) reported a F1-score of 82.84 in their work, but this result is based on multilingual resources. 4.5 Comparison with State-of-the-art Systems Table 4 shows the results on all-phrase chunking task compared with previous work. We achieve the state- of-the-art performance in all-phrase chunking. Our model outperforms the popular method BiLSTM- CRF (Huang et al., 2015) by a large margin. Shen and Sarkar (2005) also reported a 95.23 F1-score in their paper. However, this result is based on noun phrase chunking (NP-chunking). All phrase chunking task contains much more tags to predict than NP-chunking, so it is more difficult. GOLD BiLSTM MO-BiLSTM GOLD BiLSTM MO-BiLSTM The ministry updated port conditions and shipping warnings for the Gulf of Mexico (LOC), Caribbean and Pacific Coast The ministry updated port conditions and shipping warnings for the Gulf (LOC) of Mexico(LOC) , Caribbean and Pacific Coast The ministry updated port conditions and shipping warnings for the Gulf of Mexico (LOC), Caribbean and Pacific Coast. About 200 Burmese students marched briefly from troubled Yangon In- stitute of Technology (ORG) in northern Rangoon on Friday. About 200 Burmese students marched briefly from troubled Yangon (LOC) Institute of Technology (ORG) in northern Rangoon on Friday. About 200 Burmese students marched briefly from troubled Yangon In- stitute of Technology (ORG) in northern Rangoon on Friday. Table 7: Examples of the predictions of BiLSTM and MO-BiLSTM of order-3. Table 5 shows the comparison results on the English-NER dataset. Ma and Hovy (2016) reported the best result of English NER. The main architecture of their network is BiLSTM-CRF equipped with a CNN layer to extract character-level representations of words. Our model performs slightly worse than it but outperforms BiLSTM-CRFs reported in other papers (Huang et al., 2015; Lample et al., 2016). The comparison results on Dutch NER are shown in Table 6. Gillick et al. (2015) keeps the best result of Dutch NER. However, the model is trained on four languages. With the monolingual setting, their model achieves 78.08 on F1 score. Another competitive result is reported in the work of Lample et al. (2016). Their model is a BiLSTM-CRF model with an external LSTM layer to extract character-level representations of words. Our model gets the best score when there is no extra resources. 4.6 Case Study We observe that MO-BiLSTM mainly helps in two aspects: the prediction of boundaries of a segment and the recognition of long segments. Table 7 shows two cases that MO-BiLSTM model predicts correctly but BiLSTM fails to recognize the entities. In the first case, "Gulf of Mexico" should be recognized as the entity "Location". BiLSTM recognizes "Gulf" and "Mexico" as locations, but fails to recognize "of" as a part of the entity, so that an entire entity is split. The reason is that BiLSTM model predicts the tag independently, and it predicts "O" as the tag of "of" regardless of the neighboring tags. On the contrary, MO-BiLSTM takes account of the neighboring tags, and works well in this case. Considering that both the left tag and the right tag are labeled "LOC", the word "of" has a larger probability to be a part of the entity. The second case contains an entity of type "LOC". BiLSTM succeeds in recognizing the boundary of the entity but predicts a wrong entity type for the word "Yongon". Although "Yangon" is a city, it should not be recognized as a location because it is a part of an organization. BiLSTM does not consider the neighboring tag, and makes a wrong prediction, while MO-BiLSTM succeeds in predicting a correct entity by considering the neighboring tag. 4.7 Error Analysis To better analyze the basic model and the MO-BiLSTM, we investigate the cases that can not be handled well in English-NER dataset, and the result is summarized in Figure 3. All the unrecognized entities are classified into five categories, which are "boundary-1", "boundary-2", "boundary-3", "type", and "no common words". "Boundary-1" denotes the cases that the gold entity contains a predicted entity, and "boundary-2" means the gold entity is contained by a prediction. "Boundary-3" represents the case that the gold entity and our prediction overlap. "Type" means a entity's boundaries are recognized correctly but its entity type is misclassified. When there are no common words between the predicted entity and any gold entity, it is denoted as "no common words". We count the number of wrongly predicted entities of these different categories, and the result is shown in Figure 3a. The "boundary" error (the (a) Error types of the predicted entities of MO-BiLSTM. (b) Number of predicted entities be- longing to boundary error. (c) Percentage of error entities regarding the length of entities. Figure 3: Error analysis of BiLSTM and MO-BiLSTM on English-NER. sum of "boundary-1", "boundary-2", and "boundary-3"), which represents the model misidentifies the entity's boundaries, is the major error type of BiLSTM. The reason is that the boundary is made up of two tags, but BiLSTM model predicts each tag independently. Our MO-BiLSTM is able to capture the dependencies between two tags, so it can significantly decrease the number of boundary recognition error. That is also the reason why "boundary" error is not the major error of MO-BiLSTM. We further compare the number of entities belonging to "boundary" error between BiLSTM and MO- BiLSTM. According to Figure 3b, it shows that the "boundary" error of MO-BiLSTM has a reduction rate of nearly 40% compared with BiLSTM. In order to analyze the influence of the length of entities, we divide the entities into 2 groups according to their lengths, and calculate the recognition error rate of different lengths of entities. The result is shown in Figure 3c. We observe that the MO-BiLSTM model has a significant reduction in the recognition error of long entities from 27.42% to 14.52%. The large reduction in error rate proves that the MO-BiLSTM model is able to capture longer distance tag dependencies compared with BiLSTM. 5 Related Work Huang et al. (2015) and Lample et al. (2016) stacked a CRF layer on BiLSTM to capture the global tag dependencies. The difference between their work is the way to capture character-level information. Their proposed BiLSTM-CRF performs well in sequence labeling tasks. However, the dynamic programming must be done in both training and testing stage. The MO-BiLSTM does not need dynamic programming during training. Muller et al. (2013) proposed a model that also prunes the tag set using a lower order model, but dynamic programming is required in both training and testing stage like prior work. Besides the difference that we do not need dynamic programing in training stage, the pruning technique is dif- ferent. We directly model the high order states in the training stage, while Muller et al. (2013) merges lower order states to get higher order states. Soltani and Jiang (2016) propose a model called higher order recurrent neural networks (HORNNs). They proposed to use more memory units to keep track of more preceding RNN states, which are all recurrently fed to the hidden layers as feedback. These structures of Soltani's work are also termed "higher order" models, but the definition is different from ours. There are several other neural networks that use new techniques to improve sequence labeling. Ling et al. (2015) and Yang et al. (2016) used BiSLTM to compose character embeddings to words represen- tation. Martins and Kreutzer (2017) used an attention mechanism to decide what is the "best" word to focus on next in sequence labeling tasks. Zhai et al. (2017) proposed to separate the segmenting and la- beling in chunking. Segmentation is done by a pointer network and a decoder LSTM is used for labeling. Shen et al. (2018) used active learning to strategically choose most useful examples in NER datasets. 6 Conclusions In this paper, we focus on extending LSTM to higher order models in order to capture more tag dependen- cies for segmenting and labeling sequence data. We introduce a single order model, which is supposed Boundary-1Boundary-2Boundary-3TypeNo common wordsError Type303186050100150200250300350BiLSTMMO-BiLSTMBoundary error051015202530BiLSTMMO-BiLSTM[1,3] [4,6]Error (%)Length of entities to capture more tag dependencies. However, the performance of the single order model is getting worse when increasing the order. To address this problem, we propose to integrate dependency information of different orders to decode. The proposed method, which is called MO-BiLSTM, keeps the scalability to high order models with a pruning technique. Experiments show that MO-BiLSTM achieves better performance than many existing popular methods. It produces the state-of-the-art result in chunking and competitive results in two NER datasets. At the end, we analyze the advantage and limitation of the MO-BiLSTM. We find that MO-BiLSTM mainly helps in the prediction of segment boundaries and the recognition of long segments. Acknowledgements This work was supported in part by National Natural Science Foundation of China (No. 61673028), National High Technology Research and Development Program of China (863 Program, No. 2015AA015404), and the National Thousand Young Talents Program. Xu Sun is the corresponding author of this paper. References Mart´ın Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Gregory S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian J. Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal J´ozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Man´e, Rajat Monga, Sherry Moore, Derek Gordon Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul A. Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda B. Vi´egas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. 2016. Tensorflow: Large-scale machine learning on heterogeneous distributed systems. CoRR, abs/1603.04467. Rie Kubota Ando and Tong Zhang. 2005. A framework for learning predictive structures from multiple tasks and unlabeled data. Journal of Machine Learning Research, 6:1817–1853. Xavier Carreras, Lluis Marquez, and Llu´ıs Padr´o. 2002. Named entity extraction using adaboost. In proceedings of the 6th conference on Natural language learning-Volume 20, pages 1–4. Association for Computational Linguistics. Ronan Collobert, Jason Weston, L´eon Bottou, Michael Karlen, Koray Kavukcuoglu, and Pavel P. Kuksa. 2011. Natural language processing (almost) from scratch. Journal of Machine Learning Research, 12:2493–2537. Radu Florian, Abe Ittycheriah, Hongyan Jing, and Tong Zhang. 2003. Named entity recognition through classifier combination. In Proceedings of the seventh conference on Natural language learning at HLT-NAACL 2003- Volume 4, pages 168–171. Association for Computational Linguistics. Dan Gillick, Cliff Brunk, Oriol Vinyals, and Amarnag Subramanya. 2015. Multilingual language processing from bytes. CoRR, abs/1512.00103. Zhiheng Huang, Wei Xu, and Kai Yu. 2015. Bidirectional lstm-crf models for sequence tagging. arXiv preprint arXiv:1508.01991. Diederik Kingma and Jimmy Ba. arXiv:1412.6980. 2014. Adam: A method for stochastic optimization. arXiv preprint Taku Kudo and Yuji Matsumoto. 2001. Chunking with support vector machines. In Proceedings of NAACL'01, pages 1–8. Onur Kuru, Ozan Arkan Can, and Deniz Yuret. 2016. Charner: Character-level named entity recognition. In Proceedings of COLING 2016, the 26th International Conference on Computational Linguistics: Technical Papers, pages 911–921. Guillaume Lample, Miguel Ballesteros, Sandeep Subramanian, Kazuya Kawakami, and Chris Dyer. 2016. Neural architectures for named entity recognition. CoRR, abs/1603.01360. Wang Ling, Tiago Lu´ıs, Lu´ıs Marujo, Ram´on Fern´andez Astudillo, Silvio Amir, Chris Dyer, Alan W. Black, and Isabel Trancoso. 2015. Finding function in form: Compositional character models for open vocabulary word representation. CoRR, abs/1508.02096. Xuezhe Ma and Eduard H. Hovy. 2016. End-to-end sequence labeling via bi-directional lstm-cnns-crf. CoRR, abs/1603.01354. Shuming Ma and Xu Sun. 2016. A new recurrent neural CRF for learning non-linear edge features. CoRR, abs/1611.04233. Andr´e FT Martins and Julia Kreutzer. 2017. Learning what's easy: Fully differentiable neural easy-first taggers. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 349–362. Ryan T. McDonald, Koby Crammer, and Fernando Pereira. 2005. Flexible text segmentation with structured In HLT/EMNLP 2005, Human Language Technology Conference and Conference multilabel classification. on Empirical Methods in Natural Language Processing, Proceedings of the Conference, 6-8 October 2005, Vancouver, British Columbia, Canada. Thomas Muller, Helmut Schmid, and Hinrich Schutze. 2013. Efficient higher-order crfs for morphological tag- ging. In EMNLP 2013. Joel Nothman, Nicky Ringland, Will Radford, Tara Murphy, and James R Curran. 2013. Learning multilingual named entity recognition from wikipedia. Artificial Intelligence, 194:151–175. Alexandre Passos, Vineet Kumar, and Andrew McCallum. 2014. Lexicon infused phrase embeddings for named entity resolution. arXiv preprint arXiv:1404.5367. Erik Tjong Kim Sang and Sabine Buchholz. 2000. Introduction to the CoNLL-2000 shared task: Chunking. In Proceedings of CoNLL'00, pages 127–132. E. F. Sang and F. D. Meulder. 2003. Introduction to the CoNLL-2003 Shared Task: Language-Independent Named Entity Recognition. In Proceedings of CoNLL-2003, pages 142–147. Fei Sha and Fernando C. N. Pereira. 2003. Shallow parsing with conditional random fields. In HLT-NAACL. Hong Shen and Anoop Sarkar. 2005. Voting between multiple data representations for text chunking. In Advances in Artificial Intelligence, 18th Conference of the Canadian Society for Computational Studies of Intelligence, Canadian AI 2005, Victoria, Canada, May 9-11, 2005, Proceedings, pages 389–400. Yanyao Shen, Hyokun Yun, Zachary C. Lipton, Yakov Kronrod, and Animashree Anandkumar. 2018. Deep active learning for named entity recognition. In International Conference on Learning Representations. Rohollah Soltani and Hui Jiang. 2016. Higher order recurrent neural networks. CoRR, abs/1605.00064. Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. 2014. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15:1929–1958. Emma Strubell, Patrick Verga, David Belanger, and Andrew McCallum. 2017. Fast and accurate sequence labeling with iterated dilated convolutions. arXiv preprint arXiv:1702.02098. Xu Sun, Louis-Philippe Morency, Daisuke Okanohara, and Jun'ichi Tsujii. 2008. Modeling latent-dynamic in shallow parsing: A latent conditional model with improved inference. In Proceedings of COLING'08, pages 841–848, Manchester, UK. Xu Sun, Wenjie Li, Houfeng Wang, and Qin Lu. 2014. Feature-frequency-adaptive on-line training for fast and accurate natural language processing. Computational Linguistics, 40(3):563–586. Xu Sun. 2014. Structure regularization for structured prediction. In Advances in Neural Information Process- ing Systems 27: Annual Conference on Neural Information Processing Systems 2014, December 8-13 2014, Montreal, Quebec, Canada, pages 2402–2410. Zhilin Yang, Ruslan Salakhutdinov, and William W. Cohen. 2016. Multi-task cross-lingual sequence tagging from scratch. CoRR, abs/1603.06270. Feifei Zhai, Saloni Potdar, Bing Xiang, and Bowen Zhou. 2017. Neural models for sequence chunking. In Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, February 4-9, 2017, San Francisco, California, USA., pages 3365–3371.
1903.01275
1
1903
2019-03-04T14:36:21
Using Word Embeddings for Visual Data Exploration with Ontodia and Wikidata
[ "cs.CL", "cs.IR" ]
One of the big challenges in Linked Data consumption is to create visual and natural language interfaces to the data usable for non-technical users. Ontodia provides support for diagrammatic data exploration, showcased in this publication in combination with the Wikidata dataset. We present improvements to the natural language interface regarding exploring and querying Linked Data entities. The method uses models of distributional semantics to find and rank entity properties related to user input in Ontodia. Various word embedding types and model settings are evaluated, and the results show that user experience in visual data exploration benefits from the proposed approach.
cs.CL
cs
Using Word Embeddings for Visual Data Exploration with Ontodia and Wikidata Gerhard Wohlgenannt1, Nikolay Klimov1, Dmitry Mouromtsev1, Daniil Razdyakonov2, Dmitry Pavlov2, and Yury Emelyanov2 1 Intern. Lab. of Information Science and Semantic Technologies, ITMO University, St. Petersburg, Russia http://en.ifmo.ru/en 2 Vismart Ltd., St. Petersburg, Russia https://vismart.biz Abstract. One of the big challenges in Linked Data consumption is to create visual and natural language interfaces to the data usable for non- technical users. Ontodia provides support for diagrammatic data explo- ration, showcased in this publication in combination with the Wikidata dataset. We present improvements to the natural language interface re- garding exploring and querying Linked Data entities. The method uses models of distributional semantics to find and rank entity properties re- lated to user input in Ontodia. Various word embedding types and model settings are evaluated, and the results show that user experience in visual data exploration benefits from the proposed approach. Keywords: Linked Data querying, word embeddings, Ontodia, Wiki- data, natural language interface 1 Introduction The gigantic data source of Linked Data (LD) is accessible both by machines and humans. Especially for end users, there are high barriers, such as finding relevant datasets, understanding the schema, or being familiar with query languages such as SPARQL [1]. One of the tools that provide an intuitive way to discover LD for non-technical users is Ontodia3. Ontodia is an open-source library for OWL and RDF diagramming and visual exploration. In its current version, natural language (NL) search in the properties of given entities will only find properties exactly matching in the its labels. Here, we investigate a method to make the search more flexible and abstracting users from the underlying data schemata by leveraging word embeddings to provide properties which are semantically related to a user query. Using Wikidata4 as underlying dataset, we aim to i) investigate if word embeddings are useful for the given problem, ii) evaluate which types of pre-trained embedding models, and which parameters, are best suited for the task, and iii) provide a prototype to demonstrate the benefits of the method. We do not aim at full-fledged question answering over LD with NL to SPARQL transformation, but at improving the search functionality in diagram- matic LD exploration. 3 http://www.ontodia.org 4 https://www.wikidata.org 9 1 0 2 r a M 4 ] L C . s c [ 1 v 5 7 2 1 0 . 3 0 9 1 : v i X r a 2 Authors Suppressed Due to Excessive Length 2 Related Work Query expansion for keyword queries is a classical problem in information re- trieval. A traditional way of keyword expansion is the use of dictionaries such as WordNet to find synonyms or hypo- and hypernyms. This method suffers from sparse data regarding Named Entities and missing coverage of specialized domains. In the Semantic Web field, eg. Augenstein et al. [1] propose a method to map keywords to LD resources by finding the properties that are related to semantic similarity between resources. In contrast to our work, which searches in entity properties, Augenstein et al. [1] focus primarily on finding resources (entities). Freitas et al. [3] propose a complex system for querying heteroge- neous, and distributed datasets, which abstracts users from the underlying data schemata. The system combines entity search, a Wikipedia-based semantic re- latedness measure and spreading activation to answer NL queries. Challenges and future directions in Question Answering on LD are presented in Shekarpour et al. [8]. The application of word embeddings and deep learning is listed prominently among the promising techniques for future investigation. In line with this recommendation, we apply distributional semantics for the natural language query interface of Ontodia. In general, word embeddings transform the vocabulary of a given corpus into a continuous low-dimensional vector space rep- resentation. They have been successfully applied, for example, for word similarity computations, but also more complex natural language tasks [4]. 3 System Description The work presented in this paper extends Ontodia with improved search ca- pabilities. As mentioned, Ontodia is an open-source tool5 for simple OWL and RDF visual data exploration. Ontodia is often integrated with metaphactory6 as a semantic platform backend. In a typical data exploration scenario, the user starts querying the dataset at the system entry point7. At search result, the user can switch to using Ontodia to explore the data space. In the current version, search in the connections of an entity only finds literal matches of the search term in the property labels. This limits the ease-of-use with unfamiliar datasets. E.g, when looking for family relations of entity Van Gogh, the system will not find any matching properties due to missing exact lexical matches, see Figure 1. The prototype presented here makes use of a) aliases for property labels defined in Wikidata, and it applies distributional semantics in the form of word embeddings to find suitable properties related to a user query. Figure 2 shows the results using the new search functionality, which are a combination of: (i) exact matches of the input term in the property labels, (ii) exact matches in property aliases, and (iii) related properties according to the word embedding model used, ordered descendingly by semantic similarity. 5 https://github.com/ontodia-org/ontodia 6 http://www.metaphacts.com/product 7 https://wikidata.metaphacts.com/resource/Start Using Word Embeddings for Visual Data Exploration 3 Fig. 1. Searching for "family" relations of entity Van Gogh in the original system. Fig. 2. Searching for "family" relations of entity Van Gogh in the new prototype. The updated search interface also allows for a new way of data exploration, where the user is interested in a certain topic, for example family or politics, and can then explore all entity properties (connections) related to the topic. The prototype described here is available at: http://ontodia-prop-suggest.apps.vismart.biz/wikidata.html. 3.1 The Method A central ingredient to the method is the word embedding model. The models were trained on a Wikipedia corpus -- and in some cases additional textual sources -- and contain continuous vector space representations of the words from the corpora which capture the distributional semantics of the words. First, the Wikidata properties need to be added to the model vector space. For every property we split the property label (rdf:label) into a list of words, and remove stopwords. The vector representation of a property is created as the vectorial sum of the words. A variant of the system also includes the words from the property descriptions to create the property vectors. At runtime, the same 4 Authors Suppressed Due to Excessive Length process is applied to the natural language user query provided in the search box. The query is split into single words, stopwords are removed, and the vectorial representation is the sum of the query word vectors. Finally, the system ranks the properties by cosine similarity between the query vector and all the property vectors to find the most relevant properties. The method is simple and computationally efficient. In this publication, the focus is on the evaluation of the method, and especially on comparing the per- formance of various types of word embeddings. 3.2 Implementation The presented method and the accompanying code was implemented in Python and can be found on GitHub8. The main modules include a preprocessing phase, where the vectors for the Wikidata properties are constructed and persisted, the module to rank properties according to user input, and the tools for the evaluation of the system. For integration with Ontodia, we created a webservice that takes the user input in JSON format, computes the property rankings, and returns them in JSON format to Ontodia for display to the user. 4 Evaluation First, this section describes aspects of evaluation setup like the Wikidata dataset, the gold standard data used, system settings and the word embedding models. Then, a detailed presentation of the evaluation results, including a discussion of aspects like dataset quality and result interpretation, follow. 4.1 Evaluation Setup Wikidata Dataset Wikidata is an open knowledge base, which can be ex- ported and interlinked with other datasets on the Linked Data web. Wikidata is the central data storage for projects like Wikipedia.The dataset currently in- cludes around 28 million items, and, more relevant for this work, there are 3323 properties defined to describe and connect the entities. The properties have la- bels for various languages, and aliases (called "also known as") for many of the labels. We focus on English language labels, for which currently 4603 aliases are defined. Additionally, properties usually have a short textual description, which we also use in our method to create property representations. Gold Standard Dataset The aliases manually defined in Wikidata are an obvious source to be used as a gold standard dataset to evaluate our method. For this purpose, any of the 4603 English language aliases is used as an query term, and the system suggests a ranking of properties similar to the term. 1736 of 3323 properties actually have aliases defined. 8 https://github.com/gwohlgen/ontodia_search_properties Using Word Embeddings for Visual Data Exploration 5 Despite the varying quality of aliases (details in the Discussion section), we decided to use them as a gold standard dataset. Eventually the proposed method can even be applied to help detect questionable alias definitions in the future. System Settings In the evaluations, we experimented with various system settings and word embedding models. The types of word embedding models are described below, the most important system settings include: -- Use description text (Boolean): For creating the representations of prop- erties in vector space, we compared the results of using only the words from the property labels versus words from property labels and description texts. -- Dimensions of vector model: Some predefined vector models are avail- able with different numbers of vector dimensions (for example 50 vs. 100 vs. 300 dimensions). A lower number of dimensions makes the model more computationally efficient, but it may loose semantic nuances. -- Number of words in the model: In the pre-trained models the word vectors are ordered descendingly by word frequency in the training corpus. Big models with hundreds of thousands of vectors occupy a lot of memory and take a long time load. Therefore, we compared the performance of models with 300.000 words with smaller models with the 10.000 most frequent words. Word Embeddings One of the main goals was to evaluate which of the pre- trained word embedding models is best suited for the task at hand. The pre- trained models available are not trained on exactly the same corpus, but all include English Wikipedia. The following word embedding types were evaluated: -- fastText: FastText [2] is an extension of the original Word2vec [5] model which uses sub-word information. Words are represented as bag of character n-grams. FastText generates better word embeddings for rare words, and takes morphological information into account. Here, we applied a model trained on Wikipedia 20169. Two variants were compared, a model with 300.000 words, and a small model with only the 10.000 most frequent words. -- GloVe: GloVe[6] factors the logarithm of the co-occurrence matrix that reflects the position of the context words in the word window. We used a model pre-trained on a Wikipedia 2014 and Gigaword 5 corpus (6B tokens)10. Variants include combinations of models with 300, 100 or 50 dimensions, and 300.000 versus only 10.000 word vectors. -- LexVec: LexVec [7] is a word embedding method which factorizes PPMI ma- trices and combines characteristics of techniques like Word2vec and GloVe. LexVec performs well on word similarity and semantic analogy tasks, but struggles on syntactic analogies. The model used was trained on a 7B token corpus of English Wikipedia 2015 and NewsCrawl11. Again, we evaluated variants of 300.000 versus 10.000 word vectors. 9 https://github.com/facebookresearch/fastText/blob/master/pretrained- vectors.md 10 https://github.com/stanfordnlp/GloVe 11 https://github.com/alexandres/lexvec 6 Authors Suppressed Due to Excessive Length 4.2 Evaluation Results In the main evaluation which aims to judge the suitability of various word em- bedding types we experiment with different models and settings. As stated, the task is as follows: for any of the aliases defined for Wikidata properties, we create a ranking of related properties. The word vectors of the alias words are compared to the vectors representing the properties. Every alias is compared to all 3323 properties, which is much harder than the real-world task of searching only in the properties of a given entity. The later task is evaluated in the next section. Table 1 presents an overview of the results. Column one states the embedding model type and the settings, namely the model size (either 300.000 or 10.000 words), and the dimensions of the vectors. The metrics Top-N reflect the ratio of system suggestions, where the correct property is in the Top-N of the generated ranking. MRR is the well-known mean reciprocal rank. The lower part of the table includes some results for models which only use the words from the property label to create the property vectors, but not from the description text (WO-D). Top 1 Top 3 Top 10 MRR fastText 300.000 / 300d fastText 10.000 / 300d GloVe 300.000 / 300d GloVe 10.000 / 300d GloVe 300.000 / 100d GloVe 10.000 / 100d GloVe 300.000 / 50d GloVe 10.000 / 50d 38.12% 55.13% 70.22% 0.493 0.432 31.49% 48.59% 0.469 36.33% 52.82% 0.411 30.54% 45.90% 33.24% 47.85% 0.429 0.386 28.39% 43.21% 0.376 27.97% 41.88% 0.344 24.42% 38.51% 37.21% 53.45% 0.479 0.411 30.59% 46.03% 0.464 fastText WO-D 300.000 / 300d 36.10% 51.94% 0.407 fastText WO-D 10.000 / 300d 29.99% 46.83% GloVe WO-D 300.000 / 300d 34.21% 48.88% 0.437 66.29% 66.55% 61.78% 61.94% 58.97% 56.58% 54.24% 67.99% 62.55% 65.25% 60.74% 60.76% LexVec 300.000 / 300d LexVec 10.000 / 300d Table 1. Evaluation of word embedding models and settings on aligning Wikidata aliases to the corresponding property. The fastText model with 300.000 word vectors and 300 vector dimensions performs best over all metrics. We also experimented with a bigger fastText model with around 2.5m word vectors, but those additional rare words just increased memory consumption, the performance stayed almost the same. On the other hand, it is evident that reducing the model size to 10.000 words affects performance negatively. Over all model types reducing model size from 300.000 to 10.000 words led to a sharp drop in accuracy. Regarding model types, fastText is best suited for the task, followed by LexVec, and lastly GloVe. As seen in the last part of the table, using the words from the description text to represent property vectors is helpful. Finally, using fine grained word representations with larger vectors (50 versus 100 versus 300 dimensions) has a strong positive effect. Using Word Embeddings for Visual Data Exploration 7 Property Search for Single Entities In the evaluations above, we measure the accuracy for matching aliases against all the 3323 properties in Wikidata. However, in an interactive scenario of visual data exploration with Ontodia, the user query is typically restricted to the properties defined for a specific entity. This scenario was simulated and evaluated by randomly choosing 1150 entities from the Wikidata dataset, and performing the evaluation with the their properties and aliases.In total, about 85% of the properties had one or more aliases defined, with an average of 5.9 aliases per property. Table 2 presents the evaluation using the fastText and LexVec models on the task of finding the corresponding entity property for all aliases defined for an entity. Top 1 Top 3 Top 10 MRR fastText 68.63% 84.75% LexVec 62.08% 80.93% 94.59% 93.18% 0.78 0.73 Table 2. Evaluation of system accuracy for matching aliases with properties of randomly-picked entities. Again, fastText outperforms the LexVec embeddings. When ranking the en- tity properties for the alias term by similarity, in over 70% of cases the first ranked property is correct with respect to the gold standard. For the Top-3 re- sults, the number is 87.49%, and the MRR is 0.80. The results make us confident that the new search feature has a very positive impact on user experience. The runtime of a query is typically under 10ms -- well-suited for interactive systems. 4.3 Discussion Dataset Quality During the evaluation and the inspection of the results we found various issues with Wikidata dataset quality, which (i) explain part of the misclassification of the method, and (ii) provide hints on improving dataset quality, esp. the quality of aliases. First of all, in 14 cases the alias was exactly the same term as the property label. More interestingly, many aliases are not proper synonyms. For example, property P582 with label "end time", has alias such as "divorced", or simply "to". Or, P150 with label "contains administrative territorial entity", has aliases such as "divides into", "contains", "has villages" -- some of which make it hard for the system to link to the correct property. 4.4 System Performance The experiments summarized in Table 1 indicate that the fastText algorithm is best suited for the task, followed by LexVec. System configuration, especially the model vocabulary size and the number of vector dimensions are crucial for system performance, and should only be compromised if decreasing memory footprint is inevitable. Furthermore, including the property descriptions in the vector pro- vides better property representations. In our real-world use case (Section 4.2) the method demonstrates sufficient performance to improve user experience. 8 Authors Suppressed Due to Excessive Length Regarding computational performance, using Python and the gensim library, the fastText model with 300.000 vectors and 300 dimensions consumes ca. 650M of memory, a 10.000 words model requires 130M. The runtime for a query against all 3323 properties is around 300ms, for the interactive use-case query time is usually below 10ms. 5 Conclusions In this publication we present a method for simple and powerful search in entity properties of Linked Data using natural language. A prototype of the method is integrated into the Ontodia tool using Wikidata as data source. The method applies models of distributed semantics to find properties related to user input. The contributions include (i) the presentation of a method for searching in Linked Data which applies word embeddings to the given task in an efficient way, (ii) an extensive evaluation of various types of word embedding models and parameters such as model size and dimensionality against a gold standard, (iii) the provision of the implementation and an online prototype. In future work we will apply the presented approach to other datasets, and investigate the integration with more powerful question answering for Linked Data techniques. 6 Acknowledgments This work was supported by the Government of the Russian Federation (Grant 074-U01) through the ITMO Fellowship and Professorship Program. References 1. Augenstein, I., Gentile, A.L., Norton, B., Zhang, Z., Ciravegna, F.: Mapping key- words to linked data resources for automatic query expansion. In: Cimiano, P.e.a. (ed.) ESWC 2013. pp. 101 -- 112. Springer LNCS, Berlin, Heidelberg (2013) 2. Bojanowski, P., Grave, E., Joulin, A., Mikolov, T.: Enriching word vectors with subword information. arXiv preprint arXiv:1607.04606 (2016) 3. Freitas, A., Oliveira, J.G., O'Riain, S., da Silva, J.C., Curry, E.: Querying linked data graphs using semantic relatedness: A vocabulary independent approach. Data & Knowledge Engineering 88, 126 -- 141 (2013) 4. Ghannay, S., Favre, B., Estve, Y., Camelin, N.: Word embedding evaluation and combination. In: Calzolari, N., al. (eds.) LREC 2016. ELRA, Paris, France (2016) 5. Mikolov, T., Chen, K., Corrado, G., Dean, J.: Efficient estimation of word represen- tations in vector space. arXiv preprint arXiv:1301.3781 (2013) 6. Pennington, J., Socher, R., Manning, C.D.: Glove: Global vectors for word repre- sentation. In: EMNLP. pp. 1532 -- 1543 (2014) 7. Salle, A., Idiart, M., Villavicencio, A.: Enhancing the lexvec distributed word representation model using positional contexts and external memory. CoRR abs/1606.01283 (2016), http://arxiv.org/abs/1606.01283 8. Shekarpour, S., Lukovnikov, D., Kumar, A.J., Endris, K.M., Singh, K., Thakkar, H., Lange, C.: Question answering on linked data: Challenges and future directions. CoRR abs/1601.03541 (2016), http://arxiv.org/abs/1601.03541
1302.5645
1
1302
2013-02-18T15:28:51
Role of temporal inference in the recognition of textual inference
[ "cs.CL" ]
This project is a part of nature language processing and its aims to develop a system of recognition inference text-appointed TIMINF. This type of system can detect, given two portions of text, if a text is semantically deducted from the other. We focused on making the inference time in this type of system. For that we have built and analyzed a body built from questions collected through the web. This study has enabled us to classify different types of times inferences and for designing the architecture of TIMINF which seeks to integrate a module inference time in a detection system inference text. We also assess the performance of sorties TIMINF system on a test corpus with the same strategy adopted in the challenge RTE.
cs.CL
cs
Université des Sciences et Technologie Houari Boumediene THESE Spécialité : Informatique Option : Recherche Présentée pour obtenir le titre : D’ingénieur en informatique Par Djallel Bouneffouf Rapport du stage effectué au laboratoire de recherche en Informatique de Toulouse (IRIT) Rôle de l’inférence temporelle dans la reconnaissance de l’inférence textuelle Soutenu le 18 juin 2008 devant le jury composé de : Madame A.Aissani Présidente Monsieur H.Azzoune Examinateur Madame F.Khellaf Directrice de thèse Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Résumé du projet Ce projet s‟insère dans le cadre du traitement du langage nature. Il a pour objectif le développement d‟un système de reconnaissance d‟inférence textuelle, nommé TIMINF. Ce type de système permet de détecter, étant donné deux portions de textes, si un des textes est sémantiquement déduit de l‟autre. Nous nous sommes focalisés sur l‟apport de l‟inférence temporelle dans ce type de système. Pour cela, nous avons constitué et analysé un corpus construit à partir de questions collectées à travers le web. Cette étude, nous a permis de classer différents types d‟inférences temporelles et de concevoir l‟architecture informatique de TIMINF qui a pour but l‟intégration d‟un module d‟inférence temporelle dans un système de détection d‟inférence textuelle. Nous proposons, également d‟évaluer les performances des sorties du système TIMINF sur un corpus de test avec la même stratégie adopté dans le challenge RTE. Mot clef : Traitement du langage naturel, reconnaissance d‟inférence textuelle, inférence temporelle, système question réponse, Recherche d‟information. Project summary This project is a part of nature language processing and its aims to develop a system of recognition inference text-appointed TIMINF. This type of system can detect, given two portions of text, if a text is semantically deducted from the other. We focused on making the inference time in this type of system. For that we have built and analyzed the web. through collected questions from built body a This study has enabled us to classify different types of times inferences and for designing the architecture of TIMINF which seeks to integrate a module inference time in a detection system inference text. We also assess the performance of sorties TIMINF system on a test corpus with the same strategy adopted in the challenge RTE. Keyword: Natural language processing, recognizing of textual entailment, temporal inference, question answering system, Information Retrieval. 2 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Table des matières Introduction générale .................................................................................................................. 1 Chapitre 1 : LE TALN et LE RTE 1) Introduction ............................................................................................................................ 6 2) Brève historique du traitement automatique du langage naturel ........................................... 6 3) Les niveaux de traitement ...................................................................................................... 7 3.1) Le niveau lexical ............................................................................................................. 7 3.2) Le niveau syntaxique ...................................................................................................... 8 3.3) Le niveau sémantique...................................................................................................... 9 3.4) Le niveau pragmatique .................................................................................................... 9 4) Les difficultés du TALN : ambiguïté ................................................................................... 10 4.1) Ambiguïté des graphèmes (lettres) ............................................................................... 10 4.2) Ambiguïté dans les propriétés grammaticales et sémantiques ...................................... 10 4.3) Ambiguïté de la fonction grammaticale des groupes de mots ...................................... 10 4.4) Ambiguïté de la portée des quantificateurs, des conjonctions et des prépositions ....... 11 4.5) Ambiguïté sur l’interprétation à donner en contexte à un énoncé ................................ 11 5) La reconnaissance de l’inférence textuelle (RTE) ............................................................... 11 5.1) Introduction .............................................................................................................. 11 5.2) Les applications du RTE .......................................................................................... 12 5.2.1) La recherche d’information .................................................................................... 12 5.2.2) L’extraction d’information ..................................................................................... 13 5.2.3) Le système question- réponse ................................................................................ 14 5.2.4) La traduction automatique ..................................................................................... 14 5.2.4) Le résumé automatique .......................................................................................... 14 5.2.5) L’acquisition des Paraphrases (AP) ........................................................................... 14 5.3) Le challenge “PASCAL Recognizing of Textual Entailment” ................................ 15 5.3.1) La préparation du corpus ....................................................................................... 15 5.3.2) Les directives de jugements ................................................................................... 16 5.3.3) Les mesures d’évaluation ............................................................................................... 5.4) L’analyse des principales méthodes utilisées ................................................................... 17 5.4.1) Les prétraitements ...................................................................................................... 17 5.4.1.1) Le Niveau lexical ............................................................................................. 17 5.4.1.2) Le niveau syntaxique .......................................................................................... 18 5.4.1.3) Le niveau sémantique ......................................................................................... 19 5.4.2) Les différents niveaux d’inférence textuelle .............................................................. 20 5.4.2.1) L’inférence au niveau lexical ........................................................................... 20 5.4.2.2) L’inférence au niveau lexico syntaxique ............................................................ 23 5.4.2.3) L’inférence sémantique (logique) ....................................................................... 24 3 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle 5.4.3) Les ressources utilisées .............................................................................................. 24 5.4.3.1) Le WordNet ........................................................................................................ 24 5.4.3.2) Le FrameNet ................................................................................................... 25 5.4.3.3) Le Cyc ................................................................................................................ 25 5.5.4) Quelques exemples d’inférence utilisés par des groupes de recherches ................. 26 5.5.4.1) La reconnaissance de l’inférence textuelle basée sur l’analyse de dépendance et WordNet (Université nationale de l’éducation a distance de Madrid) ...................... 27 5.5.4.2) COGEX (université du Texas, USA) ...................................................................... 29 5.5.5) Conclusion ................................................................................................................. 31 5.6) Conclusion ........................................................................................................................ 32 Chapitre 2: Le temps dans la langue 1) Introduction .......................................................................................................................... 34 2) la structure de points ........................................................................................................... 34 3) la structure d’intervalles ...................................................................................................... 35 4) la structure d’événements ................................................................................................... 35 5) La théorie d’Allen ................................................................................................................ 36 5) le temps dans la langue ....................................................................................................... 37 5.1) Le modèle de Reichenbach ........................................................................................... 38 5.2) Les adverbiaux temporels ............................................................................................. 39 6) L’inférence temporelle ......................................................................................................... 39 6.1) Le travail du groupe Human Language Technology Research Institut (HLTRI) sur l’inférence temporelle ......................................................................................................... 40 6.2) Synthése ........................................................................................................................ 41 7) Conclusion ........................................................................................................................... 41 Chapitre 3 : L'élaboration du corpus 1) Introduction .......................................................................................................................... 44 2) L’élaboration du corpus ....................................................................................................... 44 3) Classification de l’inférence temporelle .............................................................................. 47 3.1) Les inférences entre expressions temporelles ............................................................... 47 3.1.1) Les inférences entre dates ...................................................................................... 48 3.1.2) les inférences entre adverbiaux temporels ............................................................. 49 3.1.3) Les inférences entre dates et adverbiaux temporels ............................................... 49 3.3.2) Les inférences entre évènements............................................................................ 49 3.3.2.1) Les relations entre évènements temporels ....................................................... 50 4 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle 3.3.2.2) Les inférences lexico sémantiques ................................................................... 51 3.3.4) Les inférences entre évènements et expressions temporelles ............................... 51 3) Le bilan de l’étude du corpus ............................................................................................... 52 4) Conclusion ........................................................................................................................... 53 Chapitre 4 : La présentation du système TIMINF 1) Introduction .......................................................................................................................... 55 2) Architecture informatique de TIMINF ................................................................................ 55 2.1) Le prétraitement ............................................................................................................ 57 2.1.1) Le projet TARSQI .................................................................................................. 57 2.1.1.1) Treetagger ........................................................................................................ 58 2.1.1.2) GUTime ........................................................................................................... 59 2.1.1.3) Evita ................................................................................................................. 60 2.1.1.4) GutenLink ........................................................................................................ 61 2.1.1.5) Slinket .............................................................................................................. 63 2.1.1.6) SputLink ........................................................................................................... 64 2.1.1.7) L’utilisation de TARSQI .................................................................................. 64 2.1.1.8) L’intégration de TARSQI au système TIMINF ............................................... 66 2.1.2) L’analyse syntaxique.............................................................................................. 66 2.1.2.1) La présentation de link grammar parser ........................................................... 66 2.1.2.2) L’intégration du link parser à notre système .................................................... 67 2.2) Les test d’inférence textuelle ........................................................................................ 68 2.2.1) Les testes d’inférences entre événements et entre sujets ....................................... 68 2.2.1.1) L’inférence entre sujets ................................................................................... 69 2.2.1.2) L’inférence entre évènements ......................................................................... 70 2.2.2) Le balisage des expressions temporelles non détectées par TARSQI ................... 71 2.3) Les Ressources linguistiques ........................................................................................ 72 2.3.1) Les ressources externes ......................................................................................... 72 2.3.1) Les ressources internes ......................................................................................... 73 2.4) Les tests d’inférences temporelles ................................................................................ 73 2.4.1) Les règles d’inférences ........................................................................................ 73 2.4.1.1) Les définitions des fonctions utilisés dans l’abstraction des règles d’inférence ....................................................................................................................................... 74 4.1.1.2) Les règles du groupe 1 ..................................................................................... 75 4.1.1.3) La règle du groupe 2 ........................................................................................ 81 4.2.2) Le superviseur ........................................................................................................ 82 4.4) Conclusion .................................................................................................................... 84 5 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Chapitre 5: La mise en oeuvre et L'évaluation du système TIMEINF 1) Introduction .......................................................................................................................... 86 2) environnement et outils utilisés ........................................................................................... 86 2.1) Python ........................................................................................................................... 86 2.2) TARSQI ........................................................................................................................ 87 2.2.1) Installation .............................................................................................................. 87 2.2.2) Utilisation de la boite à outils TARSQI ................................................................. 88 2.2.3) Utilisation de la boite à outils d’interface graphique ............................................. 88 2.3) Link Parseur .................................................................................................................. 89 2.4) PyWordNet ................................................................................................................... 90 2.4.1) Installation .............................................................................................................. 90 2.4.2) Utilisation de PyWordNet dans notre système ...................................................... 90 3) Exemple d’exécution du TIMINF sur un exemple du corpus .............................................. 92 3.1) TARSQI ........................................................................................................................ 92 3.2) Analyse syntaxique ....................................................................................................... 93 3.3) Inférence entre sujets et événements ............................................................................. 94 3.4) Balisages des expressions temporelles non détectées par TARSQI ............................. 94 3.5) Superviseur ................................................................................................................... 94 4) L’évaluation de notre système ............................................................................................. 95 4.1) l’évaluation du système sur le corpus de développement ............................................. 95 4.2) Evaluation du système avec le corpus de test ............................................................... 96 4.4) Analyse des erreurs causées par le système. ................................................................. 96 5) Conclusion ........................................................................................................................... 97 Conclusion générale et perspectives......................................................................................... 98 References .............................................................................................................................. 102 Annexe ................................................................................................................................... 103 6 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Table des illustrations Les figures Figure 2.1 : Exemple de moteur de recherche a base de mot clé ....................................................... 12 Figure 1.2 : Exemple où le moteur de recherche à base de mot clé ne marche pas ........................... 13 Figure 1.3 : Exemple du corpus annoté ............................................................................................. 16 Figure 1.4 : Sortie du TreeTagger ...................................................................................................... 18 Figure 1.5 : Exemple d‟annotation syntaxique .................................................................................. 19 Figure 1.6 : Exemple de structure prédicat argument ........................................................................ 20 Figure 1.7 : L‟architecture du système .............................................................................................. 27 Figure 1.8: Exemple de recouvrement entre arbre de dépendance .................................................... 28 Figure 1.9: Architecture du système UNED ...................................................................................... 29 Figure 1.10 : Architecture du système ............................................................................................... 30 Figure 2.1: Représentation des relations d‟Allen ............................................................................... 37 Figure 2.2: règles d‟inférence temporelle .......................................................................................... 40 Figure 2.3: application des règles d‟inférences sur un exemple du corpus RTE ............................... 40 Figure 3.1 : représente la réponse du système AnswerBus ................................................................ 45 Figure 3.2 : Exemple du corpus annoté ............................................................................................. 46 Figure 3.3 : Pourcentage de paires par types d‟inférences ................................................................. 47 Figure 3.4 : Nombre de paires par types d‟inférences ....................................................................... 50 Figure 3.5 : Nombre de paires par types d‟inférences ....................................................................... 51 Figure 3.6 : Pourcentage de paires par types d‟inférences ................................................................. 53 Figure 4.1 : architecture du système TIMINF ................................................................................... 56 Figure 4.2 : Architecture du module TARSQI ................................................................................... 57 Figure 4.3 : Sortie en format tableau de TreeTagger ......................................................................... 58 Figure 4.4 : Sortie en format XML de TreeTagger ............................................................................ 59 Figure 4.5: Sortie du module GUTime .............................................................................................. 60 Figure 4.6 : Sortie du module Evita ................................................................................................... 61 7 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Figure 4.7 : Sortie du module GutenLink .......................................................................................... 62 Figure 4.8 : Sortie du module SLINKET ........................................................................................... 63 Figure 4.10 : Entrée format simple-xml ………………………………………………………………………………...64 Figure 4.9: Inférence effectué par le module SputLINK ................................................................... 65 Figure 4.11 : Sortie du module GutenLink ........................................................................................ 66 Figure 4.12 : L‟analyse syntaxique .................................................................................................... 66 Figure 4.13 : Sortie du module Link Grammar Parser....................................................................... 67 Figure 4.14 : L‟inférence entre évènements et sujets ........................................................................ 68 Figure 4.15 : Exemple d‟inférence entre sujets ................................................................................. 69 Figure 4.16 : Exemple d‟inférence entre évènements ........................................................................ 70 Figure 4.17 : exemple de balisages d‟expressions temporelles ......................................................... 71 Figure 4.18 : Ressources linguistiques ............................................................................................... 72 Figure 4.19 : Règles d‟inférences ...................................................................................................... 73 Figure 4.20 : Règle R1 d‟inférence temporelle .................................................................................. 76 Figure 4.21 : Règle R2 d‟inférence temporelle .................................................................................. 77 Figure 4.22 : Règle R3 d‟inférence temporelle .................................................................................. 78 Figure 4.23: Règle R4 d‟inférence temporelle ................................................................................... 79 Figure 4.24 : Règle R5 d‟inférence temporelle .................................................................................. 80 Figure 4.25 : Règle R6 d‟inférence temporelle .................................................................................. 82 Figure 4.26 : Architecture du superviseur .......................................................................................... 83 Figure 5.1 : Shell python .................................................................................................................... 86 Figure 5.2 : Comment exécuter un programme ................................................................................. 87 Figure 5.3 : Capture d‟écran de l‟interface TARSQI ......................................................................... 89 Figure 5.4 : Capture d‟écran de l‟interface de link parser ................................................................. 90 Figure 5.5 : La fonction d‟interfaçage avec WordNet ....................................................................... 91 Figure 5.6 : Entré simple-xml ............................................................................................................ 92 Figure 5.7 : Sortie TARSQI ............................................................................................................... 93 8 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Figure 5.8: Sortie de l‟analyseur syntaxique ...................................................................................... 93 Figure 5.9 : Inférence entre sujets et évènements .............................................................................. 94 Figure 5.10: Balisages des expressions temporelles .......................................................................... 94 Figure 5.11 : Test d‟inférences .......................................................................................................... 95 Les tableaux Tableau 1.1:Représentation des différents types d‟inférences entrepris par les groupes de recherches ................................................................................................................................................. .26 Tableau 2.2: Les valeurs de précision des systèmes .......................................................................... 28 Tableau 3.1: les relations d‟Allen ...................................................................................................... 36 Tableau 4.1 : Nombre de paire dans le corpus ................................................................................... 52 Tableau 5.1 : Le tableau représente l‟accuracy du système ............................................................... 96 Tableau 5.2 : les causes d‟erreurs du système ................................................................................... 96 9 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Introduction générale Nous regroupons sous le vocable de traitement automatique du langage naturel (TALN) l‟ensemble des recherches et développements visant à modéliser et à reproduire, à l‟aide de machines, la capacité humaine à produire et à comprendre des énoncés linguistiques dans le but de communication (Yvon, 2007). Les deux sources principales de motivation à l‟étude du TALN sont d‟une part; la volonté de modéliser une compétence fascinante (le langage), afin de tester des hypothèses sur les mécanismes de la communication humaine, ou plus généralement sur la nature de la cognition humaine et d‟autre part le besoin de disposer d‟applications capables de traiter efficacement les morceaux d‟informations « naturelles» (documents écrits ou sonores) aujourd‟hui disponibles sous forme électronique (mails, pages HTML, documents hypermédias, etc). Le TALN est un champ de savoir et de techniques élaborés autour de problématiques diverses. Les concepts et techniques qu‟il utilise se trouvent à la croisée de multip les champs disciplinaires : l‟Intelligence Artificielle «traditionnelle», l‟informatique théorique, la logique, la linguistique, mais aussi les neurosciences, les statistiques, etc. Une des principales problématiques du TALN est que dans une langue en général, nous pouvons toujours exprimer la même idée avec plusieurs phrases différentes, ce qui pose un vrai problème d‟ambiguïté, que les chercheurs, dans tous les domaines du traitement du langage, veulent résoudre. Extraction d‟information (EI), question réponse (QR), recherche d‟information (RI), résumé automatique et traduction automatique sont des exemples d‟applications qui ont besoin d‟évaluer la relation sémantique entre des segments de textes, c‟est-à-dire, si un segment de texte peut être sémantiquement déduit d‟un autre. Au début du traitement du langage naturel, le problème d‟ambiguïté était dispersé dans ses différentes applications et chaque groupe de recherche traite le problème à sa façon, mais cela a produit une grande perte de temps. Pour cela, les chercheurs ont choisi d‟unifier leurs forces pour créer un domaine qui a pour but de centraliser le problème d‟ambiguïté et de proposer des méthodes de traitement du langage au niveau lexical, syntaxique et sémantique indépendamment d'une application donnée. La reconnaissance de l‟inférence textuelle (RTE) est née. Ainsi: on dira qu'un texte, noté T (texte), infère un texte, noté H (hypothése), si et seulement si H peut être inféré à partir de T (Dagan et al, 05). Exemple d'inférence dite TRUE T: Since its formation in 1948, Israel was involved in many wars with neighboring Arab countries. H: Israel was established in 1948. Exemple d'inférence dite FALSE T: Since its formation in 1948, Israel was involved in many wars with neighboring Arab countries. H: Israel was established before 1948. 10 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Le Pascal RTE est un concoure qui à débuter en 2005 et son objectif et de comparer les réalisations des différents groupes de recherches travaillant sur le RTE. Il y a eu trois compétitions Pascal RTE (2005, 2006 et 2007) et dans ces trois compétitions, les principales méthodes utilisées sont basées sur: - le word matching (contage de mot) : l‟inférence entre le texte T et H est vrai si le nombre de mot similaire entre les deux segments de textes est élevé. Exemple: T: Amine eats chocolates in the kitchen. H : Amine eats chocolates. Dans l‟exemple l‟inférence est considéré comme vrai par l‟algorithme puisqu‟il a 100 % des mots du texte H qui existe dans le texte T. nous appelons cette méthode le comptage de mots ou en anglais « le word matching ». - l'inférence lexicale : T infère H si les mots contenus dans la phrase H peuvent être déduits de T après des transformations lexicales. - les relations de dépendances syntaxiques (telles que les relations entre un verbe et ses arguments). Un matching entre les graphes de dépendances de T et H est alors effectué. - l'inférence logique: transformer T et H en une représentation logique (souvent du premier ordre) puis vérifier si H est une déduction logique de T. Pour le moment, les aspects temporels ne sont pas du tout abordés (reconnaissances des dates, expressions temporelles, événements, ordonnancement d'événements dans le temps, etc.) dans le RTE. Pour cela, notre projet, nommé TIMINF, pour « Time-inference », vise à modéliser, à développer et à évaluer l‟apport de l‟inférence temporelle dans le domaine de la reconnaissance de l‟inférence textuelle (RTE). Motivation Notre approche est motivée par les constatations suivantes : La plupart des systèmes de détection d‟inférence textuelle évalués au Pascal RTE, se sont focalisés sur les principales inférences (lexical, syntaxique et logique) et pour le moment, les aspects temporels ne sont pas du tout abordés. Aussi les groupes travaillant sur les inférences temporells ne se basent que sur l‟amélioration des détéctions des relations temporelles existentes entre évenements et expressions temporelles et n‟essayent en aucun cas d‟intégrer leurs travaux a un systéme d‟inférence textuelle. Méthodologie de travail Pour parvenir à la réalisation du système d‟inférence textuelle intégrant l‟inférence temporelle. Nous avons en premier lieu étudié les différents méthodes existantes dans la reconnaissance de l‟inférence textuelle pour cela nous nous sommes basés sur les trois 11 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle challenges qui se sont déroulés pour avoir un état des lieux sur les différentes méthodes existant. Ensuite nous avons étudié la logique temporelle et son application sur le langage naturel, pour pouvoir avoir une idée de l‟intégration du temps dans la langue. Apres avoir étudié les différentes inférences textuelles et temporelles nous avons entamé l‟étude des relations temporelles qui peuvent exister entre deux ségments de textes à travers un corpus que nous avons élaboré. La suite logique à notre projet est de concevoir notre systéme d‟inférnece textuelle intégrant les différentes régles d‟inférences temporelles découvertes au paravant. Nous terminons notre travail avec l‟évaluation de notre système et l‟étude des différentes failles existentes en proposant quelques perspectives de recherche future. Plan du mémoire Le plan que nous adoptons dans ce manuscrit reflète les différentes évolutions de notre projet. Ce document comporte cinq chapitres. Après avoir étudié les différentes approches adoptées pour traiter l‟inférence textuelle dans le premier chapitre, le deuxième chapitre présente le temps dans la langue et aussi une étude sur l‟inférence temporelle. Dans le chapitre trois nous avons entrepris une démarche expérimentale à base de corpus afin de dégager différentes classes d‟inférence temporelle. A partir de cette analyse, la seconde étape a été de concevoir l‟architecture d‟un système de reconnaissance d‟inférence textuelle présenté dans le chapitre 4. Enfin une fois le système conçu, nous nous sommes intéressés dans le dernier chapitre à l‟évaluation des sorties de notre système en le confrontant à un corpus de test adapté. Nous résumons, en conclusion de ce manuscrit, les différentes contributions de ce projet et nous donnons plusieurs pistes de recherches futures. 12 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Partie 1 L'état de l‟art Résumé Avant d‟entamer la conception de notre système d‟inférence, nous avons besoin d‟explorer les deux notions d‟inférences textuelles et temporelles. Pour cela la partie état de l‟art de notre mémoire est constituée de deux chapitres contenants successivement un large tour d‟horizon sur l‟inférence textuelle et ses différents niveaux de traitements. Le deuxième chapitre va contenir l‟étude de la logique temporelle sous ses différentes facettes et les différentes techniques d‟inférences temporelles existantes à nos jours. 13 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle -Chapitre 1- LE TALN ET LE RTE 14 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Chapitre 1 Le TALN et Le RTE 1) Introduction Dans ce chapitre, nous commencerons par clarifier quelques concepts linguistiques, en étudiant les différents niveaux de représentation et de traitement des énoncés linguistiques. La section suivante est consacrée à l‟étude de l‟inférence textuelle où nous présentons les différentes applications du RTE et les principaux niveaux d‟inférences textuelles nous détaillons les étapes de développement du challenge Pascale RTE qui a été mis en oeuvre pour évaluer les avances des groupes de recherches dans ce domaine. Nous terminons ce chapitre par la présentation de quelques méthodes d‟inférences utilisées par des groupes de recherches évaluées dans le challenge Pascal RTE. 2) Brève historique du traitement automatique du langage naturel Historiquement, les premiers travaux importants dans le domaine du TALN ont porté sur la traduction automatique, avec, dès 1954, la mise au point du premier traducteur automatique (très rudimentaire). Quelques phrases russes, sélectionnées à l‟avance, furent traduites automatiquement en anglais. Depuis 1954, de lourds financements ont été investis et de nombreuses recherches ont été lancées. Les principaux travaux présentés concernent alors la fabrication et la manipulation de dictionnaires électroniques, car les techniques de traduction consistent essentiellement à traduire mot à mot, avec ensuite un éventuel réarrangement de l‟ordre des mots. Cette conception simpliste de la traduction a conduit à l‟exemple célèbre suivant : la phrase The spirit is willing but the flesh is weak (l‟esprit est fort mais la chair est faible) fut traduite en russe puis retraduite en anglais. Cela donna quelque chose comme : The vodka is strong but the meat is rotten (la vodka est forte mais la viande est pourrie) ! Ce qui ressort de cet exemple, c‟est que de nombreuses connaissances contextuelles (i.e. portant sur la situation décrite) et encyclopédiques (i.e. portant sur le monde en général) sont nécessaires pour trouver la traduction correcte d‟un mot (par exemple ici spirit, qui, suivant les contextes peut se traduire comme esprit ou comme alcool). Posant comme conjecture que tout aspect de l‟intelligence humaine peut être décrit de façon suffisamment précise pour qu‟une machine le simule, les figures les plus marquantes de l‟époque (John Mc Carthy, Marvin Minsky, Allan Newell, Herbert Simon) y discutent des 15 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle possibilités de créer des programmes d‟ordinateurs qui se comportent intelligemment, et en particulier qui soient capables d‟utiliser le langage. Aujourd‟hui, le champ du traitement du langage naturel est un champ de recherche très actif. De nombreuses applications industrielles (traduction automatique, recherche documentaire, interfaces en langage naturel), qui commencent à atteindre le grand public, sont là pour témoigner de l‟importance des avancées accomplies mais également des progrès qu‟il reste encore à accomplir. 3) Les niveaux de traitement Nous introduisons dans cette section les différents niveaux de traitements nécessaires pour parvenir à une compréhension complète d‟un énoncé en langage naturel. Ces niveaux correspondent à des modules qu‟il faudrait développer et faire coopérer dans le cadre d‟une application complète de traitement de la langue. Nous considérons à titre d‟exemple l‟énoncé suivant : (1) Le président des antialcooliques mangeait une pomme avec un couteau, Nous envisageons les traitements successifs qu‟il convient d‟appliquer à cet énoncé pour parvenir automatiquement à sa compréhension la plus complète. Il nous faudra successivement : – identifier les composants lexicaux, et leurs propriétés : c‟est l‟étape de traitement lexical ; – identifier des constituants (groupe) de plus haut niveau, et les relations (de dominance) qu‟ils entretiennent entre eux : c‟est l‟étape de traitement syntaxique ; – construire une représentation du sens de cet énoncé, en associant à chaque concept évoqué un objet ou une action dans un monde de référence (réel ou imaginaire) : c‟est l‟étape de traitement sémantique. – identifier enfin la fonction de l‟énoncé dans le contexte particulier de la situation dans lequel il a été produit : c‟est l‟étape de traitement pragmatique. 3.1) Le niveau lexical Le but de cette étape de traitement est de passer des formes atomiques (tokens) identifiées par le segmenteur de mots (Nugues, 2006), c‟est-à-dire de reconnaître dans chaque chaîne de caractères une (ou plusieurs) unité(s) linguistique(s), dotée(s) de caractéristiques propres (son sens, sa prononciation, ses propriétés syntaxiques, etc). Selon l‟exemple (1), l‟étape d‟identification lexicale devrait conduire à un résultat voisin de celui donné ci-dessous, dans lequel on peut constater en particulier l‟ambiguïté d‟une forme telle que président: cette chaîne correspond à deux formes du verbe présider (indicatif et subjonctif), ainsi à une forme nominale, et sa prononciation diffère selon qu‟elle représente un nom ou un verbe. 16 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle On conçoit aisément que pour les mots les plus fréquents, comme « le », la solution la plus simple est de rechercher la forme dans (un lexique)1 précompilé. Dans les faits, c‟est effectivement ce qui se passe, y compris pour des formes plus rares, dans la mesure où l‟utilisation des formalismes de représentations compacts permettant un accès optimisé (par exemple sous la forme d‟automates d‟états finis), et l‟augmentation de la taille des mémoires rend possible la manipulation de vastes lexiques (de l‟ordre de centaines de milliers de formes). Pour autant, cette solution ne résout pas tous les problèmes. Le langage est création, et de nouvelles formes surgissent tous les jours, que ce soit par emprunt à d‟autres langues (il n‟y a qu‟a écouté parler les enseignants des autres modules de la dominante informatique !), ou, plus fréquemment, par l‟application de procédés réguliers de créations de mots, qui nous permettent de composer pratiquement à volonté de nouvelles formes immédiatement compréhensibles par tous les locuteurs de notre langue : si j‟aime lire Proust, ne peut-on pas dire que je m‟emproustise, que de proustien je deviens proustiste, voire proustophile, puis que, lassé, je me désemproustise... Ce phénomène n‟a rien de marginal, puisqu‟il est admis que, même si l‟on dispose d‟un lexique complet du français, environ 5 à 10 % des mots d‟un article de journal pris au hasard ne figureront pas dans ce lexique. La solution purement lexicale atteint là ses limites, et il faut donc mettre en oeuvre d‟autres approches, de manière à traiter aussi les formes hors-lexiques. 3.2) Le niveau syntaxique La syntaxe est l‟étude des contraintes portant sur les successions licites de formes qui doivent être prises en compte lorsque l‟on cherche à décrire les séquences constituant des phrases grammaticalement correctes: toutes les suites de mots ne forment pas des phrases acceptables (Ligauzat, 1994). La description des contraintes caractéristiques d‟une langue donnée se fait par le biais d‟une grammaire. Les modèles et les formalismes grammaticaux proposés dans le cadre du traitement automatique du langage sont particulièrement nombreux et variés. Le niveau syntaxique est donc le niveau conceptuel concerné par le calcul de la validité de certaines séquences de mots, les séquences grammaticales ou bien-formées. On conçoit bien l‟importance d‟un tel traitement dans une application de génération, pour laquelle il est essentiel que la machine engendre des énoncés corrects. Dans une application de compréhension, la machine analyse des textes qui lui sont fournis, et dont on peut supposer qu‟ils sont grammaticaux. Pourquoi donc, dans ce cas, mettre en oeuvre des connaissances syntaxiques ? Une première motivation provient du fait que les textes ne sont pas toujours grammaticaux, par exemple à cause des fautes d‟orthographes. Une analyse syntaxique peut donc permettre de choisir entre plusieurs corrections à apporter à une phrase incorrecte, mais également se révéler bien utile pour améliorer les sorties d‟un système de reconnaissance optique de caractère ou d‟encore un système de reconnaissance de la parole. 1 En linguistique, le lexique d'une langue constitue l'ensemble de ses lemmes ou, d'une manière plus courante mais moins précise, « l'ensemble de ses mots ». Toujours dans les usages courants, on utilise, plus facilement le terme vocabulaire. 17 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Une seconde raison est que l‟entrée du module syntaxique est une série de formes étiquetées morpho syntaxiquement, une forme pouvant avoir plusieurs étiquettes différentes. Une première fonction du module syntaxique consiste donc à désambiguïser la suite d‟étiquettes, en éliminant les séquences qui correspondent à des énoncés grammaticalement invalides. 3.3) Le niveau sémantique Intuitivement, la sémantique se préoccupe du sens des énoncés (yvon, 2007). Une phrase comme Le jardin de la porte mange le ciel, bien que grammaticalement parfaitement correcte, n‟a pas de sens dans la plupart des contextes. Mais qu‟est ce que le sens ? Pour une expression comme la bouteille de droite dans la phrase : Sers-toi du vin. Non, pas celui-là, prends la bouteille de droite. Le sens correspond à l‟objet (au concept) désigné. Dans cet exemple, le sens dépend étroitement du contexte : il faut une représentation de la scène pour savoir de quelle bouteille, et donc de quel vin, il s‟agit. Pour une expression prédicative, comme Il commande un Margaux 1982, le sens peut être représenté par un prédicat logique comme <demander(paul,chateau_margaux_82)>. L‟identification d‟un tel prédicat dépend encore une fois du contexte. Le verbe commander aurait en effet renvoyé à un autre prédicat s‟il s‟agissait de commander un navire. 3.4) Le niveau pragmatique Le niveau pragmatique est parfaitement dissociable du niveau sémantique. Alors que la sémantique se préoccupe du sens des énoncés, la pragmatique porte sur les attitudes (vérité, désirabilité, probabilité) que les locuteurs adoptent vis à vis des énoncés et sur les opérations logiques que ces attitudes déclenchent (yvon, 2007). Historiquement, certains linguistes ont appelé pragmatique tout traitement du langage faisant intervenir le contexte d‟énonciation. Ce critère présente fort peu d‟intérêt, dans la mesure où les processus sémantiques sont les mêmes, que le contexte intervienne ou non. En revanche, il existe une distinction très importante, basée sur la notion d‟inférence logique. Considérons l‟exemple suivant : (a) Pierre : viendras-tu au bal ce soir ? (b) Marie : j‟ai entendu que Paul y sera ! La seconde phrase sera interprétée comme une réponse négative si l‟on sait que Marie n‟aime pas Paul. Cette interprétation n‟est pas de nature sémantique. À partir de la compréhension du sens de l‟intervention de Marie, Pierre réalise une inférence logique en utilisant une connaissance contextuelle, l‟inimitié entre Paul et Marie. Pierre conclut que Marie ne veut pas aller au bal, autrement dit il reconstruit l‟attitude de Marie par rapport à son propre énoncé. Cette opération n‟est pas une construction conceptuelle, c‟est une opération logique. Elle appartient donc à la pragmatique. 18 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Les techniques correspondant à ce niveau de traitement sont encore très mal maîtrisées. Le niveau pragmatique, même si les techniques qui lui correspondent ne sont pas encore stabilisées, apparaît moins difficile à aborder que le niveau sémantique. Il semble en effet qu‟il repose sur un ensemble de principes fixes, comme le principe de pertinence, qu‟il s‟agit de modéliser correctement. La détermination de l‟intention argumentative de l‟auteur ou du locuteur est essentielle dans bon nombre d‟applications, notamment la gestion de dialogue, le résumé de texte, la traduction automatique, les systèmes d‟aide contextuelle ou d‟enseignement, etc. On attend donc des progrès significatifs à ce niveau dans les années qui viennent. 4) Les difficultés du TALN : ambiguïté Le langage naturel est ambigu, et cette ambiguïté se manifeste par la multitude d‟interprétations possibles pour chacune des entités linguistiques pertinentes pour un niveau de traitement, comme en témoignent les exemples suivants : 4.1) Ambiguïté des graphèmes (lettres) Cette ambigüité existe dans le processus d‟encodage orthographique en comparant la prononciation du i dans lit, poire et maison. 4.2) Ambiguïté dans les propriétés grammaticales et sémantiques Ainsi mange est ambigu à la fois morpho-syntaxiquement, puisqu‟il correspond aux formes indicatives et subjonctives du verbe manger), mais aussi sémantiquement. En effet, cette forme peut aussi bien référer (dans un style familier) à un ensemble d‟actions conventionnelles (comme de s‟assoir à une table, mettre une serviette, utiliser divers ustensiles, ceci éventuellement en maintenant une interaction avec un autre humain) avec pour vision finale d‟ingérer de la nourriture (auquel il ne requière pas de complément d‟objet direct); et à l‟action consistant à effectivement ingérer un type particulier de nourriture (auquel cas il requiert un complément d‟objet direct), etc. Comparez en effet : (a) Demain, Paul mange avec ma soeur. (b) Paul mange son pain au chocolat. Ainsi que les déductions que l‟on peut faire à partir de ces deux énoncés : de (a), on peut raisonnablement conclure que Paul sera assis à une table, disposera de couverts,... ; tout ceci n‟est pas nécessairement vrai dans le cas de l‟énoncé (b). 4.3) Ambiguïté de la fonction grammaticale des groupes de mots L‟ambigüité est illustrée par la phrase : il poursuit la jeune fille à vélo. Dans cet exemple à vélo est soit un complément de manière de poursuivre (et c‟est il qui pédale), soit un complément de nom de fille (et c‟est elle qui mouline) ; 19 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle 4.4) Ambiguïté de la portée des quantificateurs, des conjonctions et des prépositions Ainsi, dans Tous mes amis ont pris un verre, nous pouvons supposer que chacun avait un verre différent, mais dans Tous les témoins ont entendu un cri, il est probable que c‟était le même cri pour tous les témoins. De même, lorsque l‟on évoque les chiens et les chats de Paul, l‟interprétation la plus naturelle consiste à comprendre de Paul comme le complément de nom du groupe les chats et les chiens ; cette lecture est beaucoup moins naturelle dans les chiens de race et les chats de Paul ; 4.5) Ambiguïté sur l‟interprétation à donner en contexte à un énoncé Nous comparons ainsi la « signification » de non, dans les deux échanges suivants : (a) Si je vais en cours demain ? Non (négation) (b) Tu vas en cours demain ! Non ! (j’y crois pas). En effet, l‟ambiguïté est un problème majeur du TALN. Pour y pallier les chercheurs ont crée un domaine qui a pour but de centraliser ce problème et de proposer des méthodes de traitement du langage au niveau lexical, syntaxique et sémantique indépendamment d'une application donnée. Dans ce qui suit nous allons explorer ce domaine ainsi que ces différentes applications. 5) La reconnaissance de l‟inférence textuelle (RTE) 5.1) Introduction Le RTE est un domaine de recherche assez récent en traitement du langage (2005) qui a pour but de fédérer les recherches en TALN afin de proposer des méthodes de traitement du langage au niveau lexical, syntaxique et sémantique indépendamment d'une application donnée (résumé automatique, système de question réponse ou encore la recherche d'information). Le RTE vise à déterminer automatiquement si un segment de texte (H) est déduit d‟un autre segment de texte (T) (Dagan et al, 05). Exemple : T : « Amine a 40 degrés de fièvre, sa mère l’a pris immédiatement à l’hôpital ». H : « Amine est malade ». Dans l‟exemple ci dessus, comprendre que le segment H est déduit du segment T, est une déduction simple pour l‟être humain, mais pour la machine c‟est tout autre. Pour cela, les chercheurs ont proposé plusieurs approches pour résoudre le problème. Dans l‟exemple, pour dire que H est inféré de T le système doit lier le fait d‟être malade (texte H) avec le mot hôpital et fièvre (texte T) pour déduire qu‟il y a inférence. 20 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Dans cette section, nous présentons les différentes applications du RTE, puis nous détaillons les étapes de développement du challenge Pascale RTE qui a été mis en oeuvre pour évaluer les avances des groupes de recherches dans ce domaine. Nous développons dans la section 2, les principaux niveaux d‟inférences textuelles et nous terminons ce chapitre par la présentation de quelques méthodes d‟inférences utilisées par des groupes de recherches évaluées dans le challenge pascal RTE. 5.2) Les applications du RTE L‟inférence entre des segments de textes est au coeur de plusieurs applications du traitement automatique du langage naturel (TALN). Nous décrivons dans ce qui suit comment le RTE contribue dans ces différents domaines : 5.2.1) La recherche d‟information La recherche d'information est la science qui consiste à rechercher l'information dans des documents, des bases de données, qu'elles soient relationnelles ou mises en réseau par des liens hypertextes (Joachims, 2003). La recherche d'information est un domaine historiquement lié aux sciences de l'information et à la bibliothéconomie qui ont toujours eu le souci d‟établir des représentations des documents dans le but d'en récupérer des informations, à travers la construction d‟index. L‟informatique a permis le développement d‟outils pour traiter l‟information et à établir la représentation des documents au moment de leur indexation, ainsi que pour rechercher l‟information. Les approches qui étaient utilisées auparavant se basaient sur la recherche de mots clés dans les textes. Le problème dans ces systèmes c‟est qu‟ils ne prennent en compte ni les relations entre les mots clés ni leurs sens. Exemple 1 : Figure 1.1 : Exemple de moteur de recherche a base de mot clé 21 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Dans cet exemple (Figure 1.1) nous remarquons qu‟un moteur de recherche fonctionnant à base de mot clé comme Google fait bien ce type de recherche et répond bien à la question simple comme « the first president Algerie » puisque la simple recherche des mots clés dans les différents documents permet de donner une bonne réponse à l‟utilisateur. Exemple 2 : Considérée comme une chaîne de caractères non pas comme une période (date) Mots clés de la requête Pas de responses pertinences Figure 1.2 : Exemple où le moteur de recherche à base de mot clé ne marche pas Dans cet exemple (Figure 1.2) nous remarquons que l‟utilisation des mots clés seuls peut nous mener à un document qui n‟a aucune relation avec notre requête et qui montre que l‟inférence sémantique est indispensable à la recherche d‟information. 5.2.2) L‟extraction d‟information L'extraction d'information consiste à identifier l'information bien précise d'un texte en langue naturelle et à la représenter sous forme structurée. Par exemple, à partir d'un rapport sur un accident d‟automobile, un système d'extraction d'information sera capable d'identifier la date et le lieu de l'accident, le type d'incident, ainsi que les victimes. Ces informations pourront ensuite être stockées dans une base de données pour y effectuer des recherches ultérieures ou être utilisées comme base à la génération automatique de résumés (Kosseim., 2005). L'extraction d'information s'avère très pratique dans l'industrie où des opérations d'extractions y sont quotidiennement effectuées à la main. Nous pensons, par exemple, au traitement de rapports de filature d'une agence de surveillance, à la gestion de dépêches d'une agence de presse, à la manipulation de rapports d'incidents d'une compagnie d'assurances, etc. Un système d'extraction d'information permet de traiter automatiquement et plus rapidement de grandes quantités de documents. 22 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Dans ce cas de figure le RTE donne son apport dans la détection de l‟information. 5.2.3) Le système question- réponse Les systèmes Questions/Réponses sont capables de répondre à des questions écrites en langage naturel en cherchant la réponse dans un corpus de textes. Ils sont classiquement constitués d'un ensemble de modules réalisant respectivement : une analyse de la question, une recherche de portions de documents pertinents et une extraction de la réponse à l'aide de motifs d'extractions, ou patterns en anglais (Nyberg et al, 2002). Le système doit identifier le segment de texte qui contient la réponse. L‟inférence entre le texte T et le segment H peut aider à détecter le segment qui contient la réponse. Exemple : H : « who is Ariel Sharon ? ». T : « Israel‟s Prime Minister, Ariel Sharon, visited Prague ». Le système effectue d‟abord une transformation à l‟affirmatif de la question « Ariel Sharon is Isreal‟s Prime Minister » puis une comparaison entre le segment de texte T et le segment H. Si H est inféré de T comme dans l‟exemple alors T est accepté comme un segment contenant la réponse à la question H. 5.2.4) La traduction automatique La traduction automatique désigne, au sens strict, le fait de traduire entièrement un texte grâce à un ou plusieurs programmes informatiques, sans qu'un traducteur humain n'ait à interveni r (Laurian et Marie, 1996). La traduction automatique est encore très imparfaite, et la génération de traduction d'une qualité comparable à celle de traducteurs humains relève encore de l'utopie. Pour évaluer les performances de la machine, le RTE permet de comparer la traduction faite par la machine avec celle faite par l‟humain. 5.2.5) Le résumé automatique Le résumé automatique se propose de faire une extraction de l‟information jugée importante d‟un texte d‟entré pour construire, à partir de cette information, un nouveau texte de sortie, condensé. Ce nouveau texte permet d‟éviter la lecture en entier du document source. Le RTE est utilisé pour trouver les redondances d‟informations. Si un segment de texte infère un autre, un des deux va être supprimé. En particulier c‟est intéressant dans les applications qui font le résumé de plusieurs documents. S‟il y a plusieurs documents qui relatent le même fait, un seul doit être pris. 5.2.6) L‟acquisition des Paraphrases (AP) Une paraphrase, c‟est le fait de dire avec d‟autres mots, d‟autres termes ce qui est dit dans un texte, un paragraphe. Dans ce cas de figure le RTE est utilisé pour détecter l‟inférence entre le texte paraphrasé et le texte d‟origine. Comme dans l‟exemple suivant où les deux phrases ont le même sens avec juste une autre disposition des mots dans la phrase. Exemple : T : « Ce médicament est commercialisé au Canada seulement ». H : « La commercialisation de ce médicament s‟est effectuée au Canada seulement ». 23 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle 5.3) Le challenge “PASCAL Recognizing of Textual Entailment” Le Pascal recognition of Textual Entailment est un concours qui a débuté en 2005. Il se déroule chaque année et son objectif, est de fournir à la communauté du TAL un nouveau point de repère pour vérifier les progrès dans la reconnaissance l‟inférence textuelle, et de comparer les réalisations des différents groupes de recherches travaillant dans ce domaine ( http://www.pascal-network.org/Challenges/RTE/ ). Suite au succès du premier RTE un nouveau RTE a été organisé, avec 23 groupes venus du monde entier (par rapport à 17 pour le premier défi) qui ont présenté les résultats de leurs systèmes. Les représentants des groupes participants ont présenté leurs travaux au PASCAL Challenges atelier en avril 2006 à Venise, Italie. L'événement a été un succès et le nombre de participants et leurs contributions à la discussion ont démontré que le Textual Entailment est un domaine en expansion rapide. Déjà, les ateliers ont donné naissance à un nombre impressionnant de publications dans les grandes conférences, en plus des travaux en cours. Les démarches entreprises pour réaliser le concours sont :  Préparation du corpus.  Etablissement des mesures d‟évaluations. Dans ce qui suit les démarches citées sont détaillées. 5.3.1) La préparation du corpus La première étape à entreprendre consiste à créer le corpus de texte-hypothèse (T-H) pair de petit segment de texte, qui correspond à des informations collectées à travers le web dans des domaines différents. Les exemples ont été collectés manuellement pour l‟inférence par des annotateurs humains. Les exemples ont été divisés en deux types de corpus (Corpus de développement et Corpus de test). Le corpus de développement est utilisé au début de challenge pour donner aux utilisateurs la possibilité de tester leurs systèmes et de faire des petites mises au point pour se préparer au test. Le corpus de test est utilisé pour l‟évaluation finale. 1. Pour le RTE 1 Le corpus était composé de 567 paires de (H-T) pour le développement et 800 pairs pour le test. Le choix d‟un large corpus est justifié par la nécessité d‟avoir des résultats statistiques significatifs. Le corpus est collecté en respectant les différentes applications du traitement de langage naturel (QR, RI, IE., PP…) et la collecte des exemples est faite par niveau d‟inférence : L‟analyse lexique, syntaxique, logique et connaissance du monde, et les différents niveaux de difficultés. 24 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle <pair id="754" value="TRUE" task="CD"> <t> Mexico City has a very bad pollution problem because the mountains around the city act as walls and block in dust and smog. </t> <h> Poor air circulation out of the mountain-walled Mexico City aggravates pollution.</h> </pair> Id : représente le numéro de la pair. Value : représente la décision de l’annotateur (vrai ou faux). Task : représente le type de l’application ou l’inférence existe. Figure 1.3 : Exemple du corpus annoté Le corpus doit inclure 50% d‟un exemple de T-H correspondant à de vraies inférences et 50% de fausses inférences. Pour cela, chaque exemple (T-H) est jugé vrai ou faux par l‟annotateur qui crée l‟exemple. Puis l‟exemple est évalué par un second juge qui évalue les paires de textes et d‟hypothèses, sans avoir pris conscience de leurs contextes. Les annotateurs étaient d‟accord avec le jugement dans 80% des exemples, ce qui correspond à 0.6 Kappa2, les 20% du corpus où il n‟y a pas eu d‟accord ont été supprimés). Le reste du corpus est considéré comme un «gold standard» ou « BASELINE » pour l‟évaluation. Le but de cette manoeuvre est de créer un corpus où il n‟y aura pas de jugements controverses. Pour effectuer leurs jugements et annoter le corpus les annotateurs suivent des directives. Dans ce qui suit, nous allons citer les différentes directives qui étaient prises en considération. 5.3.2) Les directives de jugements  L‟inférence est une relation à un seul sens.  L‟hypothèse doit être inférée d‟un texte, mais le texte ne doit pas forcement être inféré de l‟hypothèse.  L‟hypothèse doit être inférée entièrement du texte. L‟inférence est fausse s‟il reste une partie de l‟hypothèse qui ne peut être inférée par le texte. 2 Kappa (J.Cohen, 1960) :c‟est une mesure statistique pour calculer a quel point deux personnes (ou groupes de personnes) A et B sont d‟accord pour classer N éléments dans K catégories mutuellement exclusives. 25 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle   les cas où l‟inférence est probable doit être jugé comme vrai. il est autorisé d‟utiliser les connaissances du monde comme dans l‟exemple le chiffre d’affaire de Google est de 50 millions de dollars. On doit savoir que Google est une entreprise donc on peut lui attribuer la possibilité d‟avoir un chiffre d‟affaire. 5.3.3) Les mesures d‟évaluation Le système d‟annotation du corpus adopté dans les deux challenges précédant est binaire, c‟est-à-dire que le système donne deux résultats possibles soit l‟inférence entre les deux textes est vrai ou fausse}. Le résultat est comparé au „GOLD standard‟, et le pourcentage donnant le nombre de fois où il y a similitude entre le système et le „gold standard‟ donne „l‟accuracy‟ du système. L‟accuracy est une mesure standard dans les systèmes de traitement du langage naturel. Elle est fréquemment utilisée pour évaluer les performances des applications, (Beyer et al. 2005). Elle est calculée comme ceci. Accuracy = X / Y. Où : X : représente le nombre de fois où les résultats du système sont similaires au gold standard. Y : représente le nombre de paires contenu dans le corpus de test. Par exemple Le nombre de résultats similaires est de 500 paires et le corpus est de 800 paires, l‟accuracy est de 500/800 qui est égale à 62,5%. 5.4) L‟analyse des principales méthodes utilisées Dans ce qui suit, nous allons présenter les différentes étapes de traitements effectuées pour détecter l‟inférence textuelle. 5.4.1) Les prétraitements Quelque soit la technique adoptée pour effectuer l‟inférence textuelle, il est nécessaire de pré traiter les données brutes avant d‟appliquer les techniques d‟inférences. Dans le RTE trois niveaux de prétraitements ont été utilisés:  Niveau lexical pour éviter les problèmes liés à la morphologie de mots.  Niveau syntaxique pour pouvoir donner une structure préalable au texte.  Niveau sémantique pour analyser les sens des mots. Ci-dessous nous allons présenter les différents niveaux de prétraitements existants et utiliser pour l‟inférence textuelle. 5.4.1.1) Le Niveau lexical L‟objectif du prétraitement au niveau du "mot" est de réduire les variations dues à la morphologie et d‟éviter que des petites erreurs initiales se propagent dans toutes les étapes du traitement. Pour cela, différentes transformations ont été introduites : A) La tokenisation L‟objectif de la tokenisation est de trouver les unités de base du "sens " dans les textes. Pour cela, les systèmes doivent résoudre différents problèmes comme la gestion des blancs, de la ponctuation, des retours lignes et des fins de paragraphes. 26 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle B) La lemmatisation La lemmatisation d'une forme d'un mot consiste à en prendre sa forme canonique. Celle-ci est définie comme ceci : Quand c‟est un verbe on doit le mètre à l'infinitif : Exemple : Parti (verbe) -> partir Pour les autres mots, ils doivent être mis au masculin singulier. Exemple : Parti (nom) -> parti Pour effectuer l‟analyse lexicale, différents outil qui ont été mis en point. Le TreeTagger est un des outils le plus utilisés pour la langue anglaise. Le TreeTagger effectue une tokinisation, une lemmatisation et un étiquetage comme le montre l‟exemple suivant : Exemple d‟entrée dans le TreeTagger : « Le TreeTagger est facile à utiliser ». La figure suivante reprend la sortie du logiciel. Tokenisation Étiquetage Lemmatisation Le TreeTagger Est Facile À Utiliser DT NP VBZ JJ D' VB La TreeTagger Être Facile À Utiliser . . . Figure 1.4 : Sortie du TreeTagger 5.4.1.2) Le niveau syntaxique L‟objectif de cette étape est de décrire les structures de phrases possibles et d‟analyser les phrases en structures. La structure révélée par l'analyse donne alors précisément la façon dont les règles syntaxiques sont combinées dans le texte. Cette structure est souvent une hiérarchie de syntagmes, représentée par un arbre syntaxique dont les noeuds peuvent être décorés (dotés d'informations complémentaires). 27 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Nous illustrons cette analyse avec la sortie d‟un des outils utilisés dans l‟annotation syntaxique (SYNTEX)3. Le chat de Marie mange une petite souris. LeDet chatNom dePrep MarieNomPr mangeVb uneDet petiteAdj sourisNom. Étiquetage morphosyntaxique SUJ Analyse syntaxique OBJ LeDet chatNom dePrep MarieNomPr mangeVb uneDet petiteAdj sourisNom. Figure 1.5 : Exemple d‟annotation syntaxique Nous remarquons dans l‟exemple ci-dessus que l‟analyse morphosyntaxique permet d‟étiqueter les mots et l‟analyse syntaxique permet de les relier entre eux. 5.4.1.3) Le niveau sémantique Pour simplifier, nous pouvons dire que l'analyse sémantique s'appuie, entre autres, sur la compréhension du sens des mots des textes, contrairement aux analyses lexicales ou grammaticales, qui analysent les mots à partir du lexique ou de la grammaire. Dans le cadre de l'analyse sémantique, il est donc fondamental d'analyser le sens des mots pour comprendre ce qu'on dit. Pour cela plusieurs approches ont été adoptées pour annoter les relations entre les mots pour mieux cerner leur sens. Une de ces approches est la structure prédicat argument qui est expliquée ci-dessous. La structure que nous appelons prédicative est un graphe de relation prédicat-argument, où les prédicats représentent l‟action. Une relation prédicative correspond à une relation de dépendance syntaxique. Le prédicat peut avoir plusieurs types d‟arguments (sujet, complément d‟objet direct et complément d‟objet indirect). 3 La fonction de cet analyseur est d'identifier des relations de dépendances entre mots et d'extrai re d'un corpus (Bourigault, 2000). des syntagmes (verbaux, nominaux, adjectivaux) 28 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Exemple : Figure 1.6 : Exemple de structure prédicat argument 5.4.2) Les différents niveaux d‟inférence textuelle Dans cette section nous allons présenter les différents niveaux d‟inférences (Lexical, lexico syntaxique, sémantique (logique) et connaissance du monde) utilisées pour la détection de l‟inférence textuelle. 5.4.2.1) L‟inférence au niveau lexical A ce niveau, l‟inférence entre deux segments de textes est accepté s‟il existe des mots semblables entre T et H, où les mots contenus dans la phrase H peuvent être inférés de T après des transformations lexicales (vanderwede et al., 2005). Les trois techniques d‟inférence sont ci-dessous : A) Les dérivations morphologiques Ce mécanisme d‟inférence considère que deux des termes sont équivalents si l‟un peut être obtenu de l‟autre après une dérivation morphologique. Il existe trois type de dérivations morphologiques : - La normalisation Exemple : T : « l‟acquisition d‟un AIRBUS A380 par le roi FAHD ». H : « le roi FAHD a acquis un AIRBUS A380 ». 29 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle La transformation <d’acquisition> en <a acquis > a permis de faire la déduction de l‟inférence entre les deux textes. - La dérivation nominale Exemple T : Le GIA a donne de la terreur au peuple algérien. H : Le GIA est un groupe terroriste. La transformation de terreur en terroriste a permis de faire la déduction de l‟inférence entre les deux textes. - Les relations entre noms et verbes Exemple T : Mark gagne à tous les coups. H : Mark est un gagnant. La transformation de Mark est un gagnant en Mark gagne a permis de faire la déduction de l‟inférence entre les deux textes. B) Les relations ontologiques Une ontologie est un ensemble structuré de concepts permettant de donner un sens aux informations. Elle est aussi un modèle de données qui représente un ensemble de concepts dans un domaine et les rapports entre ces concepts (Bourigault, 2004). Elle est employée pour raisonner au sujet des objets dans ce domaine. Les concepts sont organisés dans un graphe dont les relations peuvent être : des relations sémantiques et des relations de subsomption. L'objectif premier d'une ontologie est de modéliser un ensemble de connaissances dans un domaine donné. Ce mécanisme d‟inférence se réfère à la relation ontologique qui existe entre deux termes. Ces différentes relations sont citées ci dessous. - La synonymie Représente un ensemble de mots interchangeables dans un contexte donné. Elle est souvent utilisée pour reconnaître l‟inférence. 30 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Exemple T : « Jane a abattue Mark ». H : « Jane a tué Mark ». Autre exemple comme („‟commencer‟‟/‟‟démarrer‟‟), („‟enlever „‟/‟‟ retirer‟‟). - La généralisation (hypernymie) La relation d‟Hypernymie est le terme générique utilisé pour désigner une classe englobant des instances de classes plus spécifiques. Y est un hypernyme de X si X est un type de Y. Exemple T : « On a coupé le sapin ». H : « On a coupé l‟arbre ». La relation entre l‟arbre et le sapin (l‟arbre est une généralisation sapin) a permis l‟inférence entre les deux textes. - L‟hyponymie La relation Hyponymie est le terme spécifique utilisé pour désigner un membre d'une classe (relation inverse de Hypernymie). X est un hyponyme de Y si X est un type de Y. Exemple T : John a pris un moyen de transport pour terrestre pour faire le trajet Toulouse paris. H : John a fait Toulouse Paris en TGV. La relation entre moyen de transport pour terrestre et TGV qui a permis l‟inférence entre les deux textes. - La relation de Méronymie X est un méronyme de Y si X est une partie de Y. Exemple : {Avion} a comme méronyme {{porte}, {moteur}} ; C) La connaissance du monde dans l‟analyse lexique Ce mécanisme d‟inférence se réfère à la connaissance du monde pour détecter l‟inférence au niveau lexical (Len Schubert, 2002). 31 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Exemple : „‟Taliban  organisation „‟et „‟yahoo  moteur de recherche „‟ 5.4.2.2) L‟inférence au niveau lexico syntaxique Au niveau lexico syntaxique l‟hypothèse est représentée par des relations de dépendances syntaxiques. La relation d‟inférence entre T et H est définit comme un recouvrement des relations de H par les relations de T, ou le recouvrement est obtenu après une séquence de transformation appliquée à la relation de T. Les différents s types de transformations sont spécifies par : A) Les transformations syntaxiques Dans ce mécanisme d‟inférence, la transformation se fait entre les structures syntaxiques qui ont les mêmes éléments lexicaux et préservent le sens de la relation entre elles (Vanderwende et al..,2005). Ce genre de mécanisme inclut la transformation passive active et l‟apposition4. Exemple : « Mon chat, ce gentil petit siamois, est assis sur cette table ». « Il peut devenir : Mon chat est assis sur cette table, ce gentil petit siamois ! ». B) L‟inférence basée sur les paraphrases Dans ce mécanisme d‟inférence, la transformation modifie la structure syntaxique du segment du texte et quelques éléments lexicaux, mais elle garde la relation d‟inférence entre le segment de texte original et celui qui est transformé. Ce type de relation entre les deux segments est appelé dans la littérature « Paraphrase ». Des méthodes pour effectuer la transformation sont proposées dans (Lin et Pantel, 2001). Exemple : T : « Ce médicament est commercialisé au Canada seulement ». H : « La commercialisation de ce médicament s‟est effectuée au Canada seulement ». C) La coréférence La relation de coréférence met en relation un pronom et un antécédent éloigné l‟un de l‟autre dans la phrase. Par exemple : « L‟Italie et l‟Allemagne ont tous deux joué deux matchs, ils n‟ont perdu aucun match encore ». Infère à « Ni l‟Italie ni l‟Allemagne n‟a encore perdu un match », cela inclut la transformation de coréférence « ils  l‟Italie et l‟Allemagne ». 4 L‟apposition est une construction grammaticale dans laquelle deux éléments, normalement substantif expressions, sont placés à côté de l'autre, avec un élément servant à déf inir ou modifier les autres.. Lorsque ce dispositif est utilisé, les deux éléments sont censés être à l'apposition. Par exemple, dans l'expression "mon ami Alice" le nom "Alice" est à l'apposition de "mon ami". 32 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle 5.4.2.3) L‟inférence sémantique (logique) A ce niveau, l‟inférence entre deux segments de textes est acceptée si le sens des deux phrases se concorde. En d‟autre termes, l‟inférence textuelle est considérée comme un problème d‟implication logique entre les sens des deux phrases (Tatu et al., 2006). Pour cela, la structure prédicat argument est souvent utilisée, c'est-à-dire que, les segments de textes T et H sont transformés en prédicat et à travers des déductions logiques comme par exemple l‟utilisation de la (preuve par réfutation5) on arrive à déduire l‟inférence. Un exemple des systèmes utilisant cette méthode d‟inférence est décrit dans la section (5.5.4.2). 5.4.3) Les ressources utilisées Dans les différents techniques d‟inférence textuelle plusieurs ressources sont utilisées (WordNet, framnet, Cyc…). L‟ensemble constitue un « écosystème » complet couvrant des aspects lexicaux, syntaxiques et sémantiques. Combinées, ces ressources fournissent un point de départ intéressant pour des développements sémantiques en TAL ou dans le cadre du Web sémantique, telle que la recherche d‟information, l‟inférence pour la compréhension automatique de textes, la désambiguïsation lexicale, la résolution d‟anaphore et aussi l‟inférence textuelle. Dans ce qui suit, nous allons définir les différentes ressources existantes et utilisées pour détecter l‟inférence textuelle. 5.4.3.1) Le WordNet WordNet (Miller, 1995) est une base de données lexicale développée depuis 1985 par des linguistes du laboratoire des sciences cognitives de l'université de Princeton. C‟est un réseau sémantique de la langue anglaise, qui est fondé sur une théorie psychologique du langage. La première version diffusée remonte à juin 1991. Son but est de répertorier de classifier et de mettre en relation de diverses manières le contenu sémantique et lexical de la langue anglaise. Le système se présente sous la forme d'une base de données électronique (Chaumartin, 2007). Le synset (ensemble de synonymes) est la composante atomique sur laquelle repose WordNet. Un synset correspond à un groupe de mots, dénotant un sens ou un usage particulier. Un synset est défini par les relations qu'il entretient avec les sens voisins. Les noms et verbes sont organisés en hiérarchies. Des relations d‟hyperonymie et d‟hyponymie relient les « ancêtres » des noms et des verbes avec leurs «spécialisations». Au niveau racine, ces hiérarchies sont organisées en types de base. À l'instar d'un dictionnaire traditionnel, WordNet offre ainsi, pour chaque mot, une liste de synsets correspondant à toutes ses acceptions répertoriées. Mais les synsets ont également d'autres usages : ils peuvent représenter des concepts plus abstraits, de plus haut niveau que les mots et leurs sens, qu'on peut organiser sous forme d'ontologie. Nous pouvons ainsi interroger le système quant aux hyperonymes d'un mot particulier. À partir par exemple du 5 La réfutation est un procédé logique consistant à prouver la fausseté ou l'insuffisance d'une proposition ou d'un argument. 33 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle sens le plus commun du nom "car" (correspondant au synset "1. car, auto..."), la relation d'hyperonymie définit un arbre de concepts de plus en plus généraux: 1. car, auto, automobile, machine, motorcar => motor vehicle, automotive vehicle => vehicle => conveyance, transport => instrumentality, instrumentation => artifact, artefact => object, physical object => entity, something Dans cet exemple, il est clair que le dernier concept, "entity, something", est le plus général, le plus abstrait (il pourrait ainsi être le super-concept d'une multitude de concepts plus spécialisés). Nous pouvons également interroger le système quant à la relation inverse de l'hypernymie, l'hyponymie. WordNet offre en fait une multitude d'autres ontologies, faisant usage de relations sémantiques plus spécialisées et restrictives. Nous pouvons ainsi interroger le système quant aux méronymes d'un mot ou d'un concept, les parties constitutives d'un objet ("HAS-PART"). Les méronymes associés au sens "car, auto..." du mot "car" sont : 1. car, auto, automobile, machine, motorcar HAS PART: accelerator, accelerator pedal, gas pedal, gas, throttle, gun HAS PART: air bag HAS PART: auto accessory HAS PART: automobile engine HAS PART: automobile horn, car horn, motor horn, horn (...) 5.4.3.2) Le FrameNet FrameNet (Baker, Fillmore et Lowe, 1998), projet mené à Berkeley à l‟initiative de Charles Fillmore, est fondé sur la sémantique des cadres (frame semantics). FrameNet a pour objectif de documenter la combinatoire syntaxique et sémantique pour chacun des sens d‟une entrée lexicale à travers une annotation manuelle d‟exemples choisis dans des corpus sur des critères de représentativité lexicographique. Les annotations sont ensuite synthétisées dans des tables, qui résument pour chaque mot les cadres avec leurs arguments syntaxiques. 5.4.3.3) Le Cyc Cyc est un projet d‟Intelligence Artificielle lancé en 1984 par Doug Lenat. Cyc vise à regrouper une ontologie et une base de données complètes sur le sens commun, pour permettre à des applications d'intélligence artificielle. D‟effectuer des raisonnements similaires à ceux des humains. Des fragments de connaissances typiques sont par exemple : « les chats ont quatre pattes » ; « Paris est la capitale de la France ». Elles contiennent des 34 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle termes (PARIS, FRANCE, CHAT?) et des assertions (« Paris est la capitale de la France ») qui relient ces termes entre eux. Grâce au moteur d‟inférence fourni avec la base Cyc, il est possible d‟obtenir une réponse à une question comme « Quelle est la capitale de la France ? » La base Cyc contient des millions d‟assertions (faits et règles) rentrées à la main. 5.5) L‟analyse des systèmes participant au RTE 2 Nous avons marqués pour chaque groupe de recherche participant au RTE2 les types d‟inférences utilisés. Les résultats sont affiches dans le tableau 1.6. lexicale syntaxique lexico- sémantique Logique numérique Temporelle + + + + Type d‟analyse Groupes de recherches UNED UMESS MITRE + + IRST + + GOGEX LCC‟S + + C&C + + + + + + Tableau 1.1 Représentation des différents types d‟inférences entrepris par les groupes de recherches 5.5.4) Quelques exemples d‟inférence utilisés par des groupes de recherches Dans le RTE 2 nous avons remarqué que tous les groupes de recherches n‟ont pas utilisé d‟inférence temporelle dans leurs systèmes et à l‟heure actuelle, les résultats du RTE 3 ne sont pas encore publiés officiellement mais d‟après notre lecture des différentes publications des groupes de recherches participant au RTE3, il y a deux groupes qui ont fait allusion à l‟inférence temporelle. Pour cela, nous avons choisi de décrire leurs systèmes. 35 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle 5.5.4.1) La reconnaissance de l‟inférence textuelle basée sur l‟analyse de dépendance et WordNet (Université nationale de l‟éducation a distance de Madrid) Le système présenté montre comment des informations sémantiques peuvent être extraites du texte en utilisant les structurations syntaxiques données par l‟analyse de dépendance, et des ressources lexico- sémantiques comme Word Net peuvent développer le RTE. Les techniques utilisées par ce système sont les suivantes : l‟analyse dépendance du texte et de l‟hypothèse. l‟inférence lexicale entre les noeuds des arbres en utilisant Word Net. la concordance entre les arbres de dépendance basée sur la notion de l‟inclusion.    A) L‟architecture du système L‟architecture du système est montrée dans la figure suivante (Figure 1.7) : Figure 1.7 : L‟architecture du système Cette architecture est composée de Trois modules :  L‟analyse de dépendance : Elle consiste à normaliser les informations du dataset, de générer les dépendances existantes entre les mots et de donner à la sortie un arbre de dépendance constitué de noeuds qui représentent les mots de la phrase et d‟arcs qui représentent les dépendances entre les noeuds. Ce travail est réalisé par un logiciel nommé « Lin‟s Minipar ».  L‟analyse lexicale : prend les informations données par l‟analyse de dépendance et retourne les mots de l‟hypothèse H qui sont infères du texte T. Ce module utilise WordNet pour détecter les relations de (synonymie, hyponymie, meronymie ) entre les unîtes lexicales.  Les relations entre les arbres de dépendance : le but est de déduire si l‟arbre de l‟hypothèse est recouvert par l‟arbre de dépendance du texte, Pour cela, la règle établie est qu‟un arc est dit recouvert s‟il est dans le même emplacement que dans l‟arbre représentant le texte et il y a une inférence entre ces noeuds et celle du texte . La figure ci-dessous (figure 1.8) reprend ce genre de recouvrement. 36 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Figure 1.8: Exemple de recouvrement entre arbre de dépendance B) L‟expérimentation du système Le groupe a soumi deux systèmes au challenge. - Système 1 Le systeme1 n‟utilise que les deux premiers modules, et la décision de l‟existence d‟inférence est prise par rapport au nombre de noeuds de l‟hypothèse infère de l‟arbre de dépendance du texte. - Système 2 Le système 2 utilise les 3 modules et la décision est prise par rapport au nombre d‟arc recouverts. Les résultats sont affiches dans le tableau 1.2. L‟utilisation de WordNet seule a donné de bons résultats, mais en ajoutant le module de recouvrement il décroît les performances du système. Les systèmes Précision Système 1 : 56,37 % Système 2 : 54,75 % Tableau 1.2: Les valeurs de précision des systèmes 37 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle La notion de recouvrement n‟est pas appropriée pour le RTE, car un large recouvrement n‟implique pas une inférence sémantique, et un faible recouvrement n‟implique pas une différence sémantique. L‟utilisation de Word Net a contribué à l‟inférence au niveau lexical et a augmenté les performances du système. Dans cette direction, les prochaines étapes seront de reconnaître et d‟évaluer les inférences entre les expressions numériques, les entités nommées 6et les expressions temporelles. C) L‟évolution du système Ce qui a été développé pour le RTE2 est un module pour la détection des expressions numériques, ce qui a permis d‟augmenter fortement la précision (harrera et al.,2006). La figure suivante montre comment le module est introduit dans leur système. Figure 1.9: Architecture du système UNED Dans le RTE 3, le groupe s‟est focalisé sur l‟inférence entre les entités nommées. Il a défini les relations d‟inférences entre les entités nommées (Rodrigo et al., 2007). Exemple : - Nom propre E1 infère nom propre E2 si une chaîne E1 contient la chaîne E2. - une expression du temps t1 infère une expression du temps T2 si l‟intervalle de temps exprimée dans t1 est inclus dans l‟intervalle T2. Ce module de d‟inférence a lui aussi contribué à augmenter la précision (Rodrigo et al, 2007). 5.5.4.2) COGEX (université du Texas, USA) Le système utilise une approche logique pour résoudre l‟inférence textuelle. En d‟autres termes, l‟inférence textuelle est considérée comme un problème d‟implication logique entre les sens des deux phrases (Tatu et al., 2006). La description du système et l‟évolution qui s‟est produite dans chaque challenge est décrite dans ce qui suit. 6 Les entités nommées désignent l'ensemble des noms de personnes, de lieux, d'entreprise contenues dans un texte. 38 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle A) La description du système La première étape consiste à transformer le texte et l‟hypothèse en forme logique (Moldovan and Rus, 2001). Pour cela il faut d‟abord transformer du langage nature a un format prédicat argument, pour cella le groupe utilise WordNet pour lier le prédicat avec ses argument. Concrètement WordNet produit des relations entre les synsets, et chaque synset lui correspond un prédicat. Le prédicat peut avoir un ou plusieurs arguments et le prédicat qui correspond au nom a un seul argument en général, et le prédicat qui correspond à un verbe a trois arguments : l‟événement, le sujet et le complément d‟objet. Pour chaque relation dans la chaîne lexicale7, le système génère un axiome utilisant les prédicats qui correspondent au synset de la relation. Par exemple : il y a une relation d‟inférence entre le verbe vendre et le verbe payer. Le système génère l‟axiome suivant pour cette relation : Vendre_VB_1(e1,x1,x2)  payer_VB_1(e1,x1,x3) Ce type d‟axiome contribue à l‟inférence quand une chaîne lexicale est trouvée. Apres la transformation des deux paires de texte en format logique le groupe utilise la preuve par « l‟absurde » ou „‟preuve par contradiction‟‟ (Wos, 1998). La négation de l‟hypothèse H est réalisée s‟il y a une contradiction ou une déduction de contradiction par rapport au texte T, nous concluons que l‟hyponyme est dérivable du texte. B) L‟évolution du système Il a été développé pour le RTE 2 un module qui traite la négation dans la transformation du texte en prédicat et un autre module qui fait une analyse sémantique en tant que pré traitement pour donner les relations existantes entre le verbe et ses arguments et aussi entre les arguments eux- mêmes (Tatu et al.,2006). Pour le RTE3 le groupe a développé et intégrer a leur système plusieurs outils. Dans ce qui suit nous allons présenter l‟architecture du système et les nouveaux outils conçus et utilises pour améliorer l‟inférence. Le schéma du dernier système conçu pour le RTE 3 par le groupe est donné par la figure ci- dessous. 7 Une chaîne lexicale est une chaîne où il y a une relation entre deux synsets. 39 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Figure 1.10 : Architecture du système - EXtended WordNet XWN (eXtended WordNet) est un projet qui a pour but d‟enrichir les relations du dictionnaire WordNet avec des relations sémantique entre les synsets et les transforment en format logique (Tatu et Moldovan, 2007). - TARSQI C‟est un système modulaire pour l'annotation automatique temporelle qui ajoute les expressions du temps, des événements et des relations temporelles de l'actualité des textes (Venhaguane et al. ,2005). - Outil pour la gestion des coréférences Pour relier les phrases dans les textes longs et, résoudre le problème qui est apporté par les coréférences dans l‟inférence textuelle, l‟outil développé combine l‟algorithme Hobbs (Hobbs, 1978) et l‟algorithme de résolution d‟anaphore (Lappin and Leass, 1994). Pour le RTE, il est important d‟avoir les relations entre les prédicats d‟un long texte. Exemple 1 : George Bush grandit à Greenwich au Connecticut, Il est à l'époque membre d'une confrérie étudiante secrète devenue célèbre. Lier George Bush et il, est une des taches que l‟outil doit résoudre. Le développement du XWN-KB a eu un impact considérable sur le RTE, mais l‟utilisation du TARSQI n‟a donné aucun impact sur le résultat car l‟utilisation des expressions temporelles dans ce corpus est inexistante. 5.5.5) Conclusion Dans les travaux entamés par UNED sur les entités nommées, le groupe a établi plusieurs règles d‟inférence entre les entités nommées, parmi lesquelles se trouve une règle d‟inférence entre les expressions temporelles. Celle-ci peut être considérer comme une contribution implicite à l‟inférence temporelle. Mais concrètement l‟inférence temporelle est considérée comme une perspective pour leurs prochaines recherches. 40 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle 5.6) Conclusion Dans ce chapitre nous avons explorés l‟apport du RTE dans les différentes applications du TALN (RI, QR, EI et RA) et nous avons exploré les différentes approches utilisées pour détecter l‟inférence (lexical, lexico syntaxique, sémantique et logique). Aussi nous avons analysé les approches des différents groupes de recherches qui ont participe au challenge Pascal RTE. Cette étape nous a permis de découvrir les chemins qui n‟ont pas encore été pris pour détecter l‟inférence textuelle. Enfin nous nous sommes focalisés à décrire les systèmes qui ont mentionné l‟aspect temporel dans leurs recherches. Nous avons remarqué que dans les trois RTE qui se sont déroulés, l‟inférence temporelle est une perspective qui n‟est pas encore entamée. Nous allons justement décrire dans le prochain chapitre l‟aspect temporel dans le RTE. 41 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle - Chapitre 2 - Le temps et la langue 42 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Chapitre 2 1) Introduction Le temps et la langue Avant d‟entamer notre travail sur l‟inférence textuelle, nous avons besoin d‟explorer la notion du temps dans ses différentes bannières, d‟abord par rapport à la logique modale et aussi par rapport à la langue. Le mot « temps » recouvre plusieurs significations en français, et il est nécessaire pour la compréhension de distinguer le temps grammatical du temps notionnel. Le second est représenté en logique par une ligne droite et infinie, avec un point marquant le présent et séparant le passé du futur. Le temps grammatical désigne les marques linguistiques utilisées pour exprimer le temps notionnel dans le langage (l‟imparfait, le présent de l‟indicatif, etc.…). Dans ce qui suit nous allons explorer ces deux notions du temps, du point de vu logique avec ces différentes représentations (structure de points, structure d‟intervalles, événement et Allen) ensuite au point de vu langage. Nous terminons avec une étude sur l‟inférence temporelle élaborée par l‟un des groupes les plus abouti dans le domaine. 2) La structure de points La conception du temps est couramment reliée à la notion de point ou d‟instant sur un axe temporel. Les points permettent en effet d‟utiliser les structures de nombres (entiers, rationnels ou réels). Cette conception est largement utilisée dans la modélisation de phénomènes évoluant dans le temps. Cette structure temporelle doit être manipulée avec un langage logique ; la logique du temps, historiquement très liée au développement des logiques modales. Elle est basée sur les connecteurs logiques habituels () et les opérateurs temporels P (passé) et F (futur). Ainsi, si l‟action de chanter effectuée par John est notée p, on aura les représentations suivantes : - John chante : p - John chanta : Pp - John chantera : Fp - John avait chanté : PPp (on se place dans le passé d‟un point situé au passé lui-même) - John aura chanté : FPp Ces formules seront enrichies avec de nouveaux opérateurs similaires à ceux utilisés en logique modale (Bras, 1990). Toutes les logiques dérivées de la logique du temps sont basées sur une ontologie de points. Nous allons maintenant nous intéresser à des ontologies d‟intervalles. 43 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle 3) La structure d‟intervalles Du point de vue philosophique, il semble que le concept de point dépourvu de durée ne correspond pas à la réalité : Du point de vue linguistique, il est encore plus évident qu‟une entité ponctuelle est mal adaptée pour l‟expression de la référence temporelle. Même les expressions dites ponctuelles se référent à des périodes étendus, comme dans les exemples suivants : A six heures précises, Harry quitta son bureau. Une structure d‟intervalle est définie par < I, <, >, avec I un ensemble non vide d‟entités temporelles, des relations de précédence (<) et d‟inclusion (). Voici quelques propriétés de cette structure :  est un ordre partiel, elle est en effet : Réflexive : (xxx. Antisymétrique : (x(y(xy  yx  xy). Transitive : (x(x xyyzxz). Nous pouvons également remplacer la relation (par la relation O (overlap) qui exprime que deux événements ont une partie commune, et définie par rapport à l‟inclusion: xOy (z) (zx  zy) La mise en place des logiques temporelles basées sur les sémantiques d‟intervalles amènent à des résultats relativement complexes, qu‟il n‟est pas nécessaire d‟exposer ici. Des critiques ont été adressées aux sémantiques d‟intervalles, notamment en ce qui concerne la difficulté de définir la vérité d‟une proposition (vraie sur toutes intervalles ? sur au moins l‟un deux ?). Ces problèmes ont provoqué la nécessité de concevoir une entité plus globale et plus complète. 4) La structure d‟événements L‟événement est une nouvelle entité primitive, de durée non nulle et fini, correspondant intuitivement à des fragments de notre perception du monde. Pour les linguistes comme pour les philosophes, les logiciens et les spécialistes de l‟intelligence artificielle, la tendance est de préférer les événements aux intervalles car les événements ont une structure à portée non seulement temporelle, mais aussi spatiale. Davidson a proposé de traiter les événements comme des objets, ajoutant à l‟ensemble des individus d‟un modèle, un ensemble d‟événements, par exemple, la phrase Marie aime Paul n‟est plus représentée par aimer (Paul, Marie), mais par : Aimer(e, Paul, Marie) Une structure d‟événement est définie par Kamp par le triplet<E, , >, où E est un ensemble d‟entités de base non nulle,  est la relation de précédence, et O la relation de recouvrement si e1Oe2 alors une partie de e1 au moins a eu lieu en même temps que e2. est asymétrique : (e1 e2) (e2  e1)  est transitive : (e1 e2)  (e2 e3)  (e1 e3) O est symétrique : (e1 e2)  (e2 e1) O est réflexive : (e1 e2) Principe de séparation : (e1 e2)   (e1 e2) 44 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Transitive mixte : (e1 e2) (e2 e3)  (e3 e4)  (e1 e4) Principe de linéarité : (e1 e2) (e1 e2) (e2 e1) Ces conditions minimales sont dictées par l‟intuition lorsque nous avons des événements et des relations qui les lient. Nous avons présenté trois ontologies (structures de points, structures d‟intervalles et structures d‟événements). Il est fondamental de séparer le niveau temporel (points et intervalles) du niveau relatif à l‟expérience du monde (événements). En effet, si les relations définies dans les structures d‟événements sont des relations temporelles, les événements sont également des expériences, des « faits » qui ont lieu et qui déterminent la structure du temps. C‟est pourquoi nous pouvons dire que la logique d‟Allen, que nous allons présenter, permet de rattacher les deux notions. 5) La théorie d‟Allen Selon Allen, deux intervalles peuvent être liés entre eux par les 13 relations primitives suivantes (Bras, 1990). Où X et Y sont des termes de types intervalles de temps (on appelle « relation inverse » la relation correspondante entre Y et X) : Relation Symbole Symbole relation inverse X beforeY X equalsY X meetsY X overlapsY X duringY X startsY X finishes Y <  M O D S F >  Mi Oi Di Si Fi Tableau 2.1: Les relations d‟Allen Les relations sont mutuellement exclusives : une seule relation est possible entre deux intervalles. Il est possible de composer les relations. Ainsi, la transitivité des relations entre intervalles est définie par:  I  j k (( I < j) (j < k) I < k) 45 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle  I  j k ((I mj) (j d k) (I o k)  (I d k)  (I s k)) Il existe 169 relations de transitivité de ce type. Figure 2.1: Représentation des relations d‟Allen Deux intervalles peuvent être reliés par une relation primitive, mais aussi par une relation complexe ; il est ainsi possible de représenter une connaissance incomplète des relations. La connaissance temporelle sur un ensemble d‟intervalles peut être représentée par un réseau de contraintes. Il s‟agit d‟un graphe orienté dont les noeuds représentent les intervalles et dont les arcs sont étiquetés par la relation entre les intervalles. L‟exemple suivant, très simple, permet d‟illustrer rapidement le raisonnement sur les intervalles : Paul entra dans la pièce (1). Marie regardait la télévision (2) .Elle l’éteint (3). (1) Et (2) introduisent l‟assertion temporelle suivante : I entre during I regarde_television Puis, en examinant (2) et (3), nous obtenons : I regarde_television meet I enteindre- television 5) Le temps dans la langue Qu'est-ce qui distingue le temps linguistique des autres notions de temps? "Ce que le temps linguistique a de particulier c'est qu'il est organiquement lié à l'exercice de la parole, qu'il se définit et s'ordonne comme fonction du discours. Ce temps a son centre – un centre, à la fois, générateur et axial - dans le présent de l'instance de la parole" (Benveniste, 1974). Le discours instaure un maintenant, moment de l'énonciation. En opposition au maintenant, nous créons un alors. Ce maintenant est donc le fondement des oppositions de la langue. 46 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle 5.1) Le modèle de Reichenbach Reichenbach a proposé, pour modéliser la sémantique des temps grammaticaux, les trois repères suivants : E le moment de l‟événement S le moment de l‟énonciation ou de la parole (Speech Time) R le moment de référence Les relations possibles entre repères sont la relation de simultanéité) notée « , » et la relation de précédence notée « _ ». La nouveauté réside surtout dans l‟ajout d‟un moment de référence, qui permet de prendre en considération certains temps composés. Ainsi, la représentation de quelques temps grammaticaux à l‟aide du modèle de Reichenbach est la suivante : Passé simple je vis Paul E, R_S Plus-que-parfait j‟avais vu Paul E_R_S Futur je verrai Paul S_E,R Futur antérieur j‟aurai vu Paul S_E_R 5.2) Les adverbiaux temporels Un adverbial est un élément (mot ou groupe de mots) ayant une fonction similaire à celle d‟un adverbe ou d‟un complément circonstanciel, c‟est-à-dire qu‟il modifie le verbe auquel il est rattaché (Charolles, 1997). Nous pouvons le supprimer sans rendre la syntaxe ni la sémantique de la phrase incorrecte. Ainsi, les passages soulignés des exemples suivants ont une fonction adverbiale temporelle : Paul arrive demain. Marie est revenue à cinq heures. Nous pouvons distinguer : Les adverbiaux de référence temporelle dont le rôle est d‟exprimer la localisation d‟un événement dans le temps : demain. Les adverbiaux de durée : pendant une heure, en trois jours Les adverbiaux de durée : pendent une heure. Les adverbiaux de fréquence : souvent, tous les mois. Les adverbiaux itératifs : trois fois, plusieurs fois. Les adverbiaux de quantification : toujours, quelquefois. Les adverbiaux présuppositionnels : encore, déjà. 6) L‟inférence temporelle Si l‟annotation des marqueurs du temps dans le discours sont l‟objet de plusieurs sujets de recherches, l‟étude de l‟inférence temporelle et ses applications ne sont qu‟à ses débuts. Ce problème commence à générer des travaux en informatique linguistique liés aux enjeux que représentent les informations temporelles entre autre pour la recherche d‟information et les systèmes questions-réponses. Avec l‟exploration de ce nouveau champ d‟action dans le traitement du langage naturel, l‟inférence temporelle nous permet d‟établir des relations temporelles existantes entre évènements dans un texte, de détecter les relations existantes entre expressions temporelles et aussi les relations entre expressions temporelles et événements. 47 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Dans ce qui suit nous présentons l‟une des recherches les plus abouti dans le domaine. 6.1) Le travail du groupe Human Language Technology Research Institut (HLTRI) sur l‟inférence temporelle : HLTRI est un groupe de recherche travaillant sur l‟inférence temporelle. Il est aussi membre de l‟organisation fondatrice du langage (TimeML8) qui est un langage de spécification d‟événements et d‟expressions temporelles dans le langage naturel. Afin d‟étudier l‟inférence temporelle dans le langage naturel, le groupe (HLTRI) a établi un grand corpus de questions-réponses qui sont fondées sur la recherche d‟information temporelle. Les questions sont annotées comme ceci: • Expressions temporelles, annotées par la balise TIMEX3. • La balise EVENT correspond à un événement. • LIEN est une balise qui code les relations entre éléments temporels. Pour découvrir les relations temporelles entre les événements dans un texte, le groupe a utilisé la représentation graphique. Les noeuds du graphe sont représentés par les événements et les arcs entre les noeuds sont soit des relations TLink, SLink ou ALink. Pour classer les événements dans un même texte, il utilise les trois relations ALINK, TLINK, SLINK et entre les évènements de deux textes différents il n‟utilise que le module TLINK. - TLink, représentant les relations temporelles entre les événements ou entre un événement et une expression temporelle. - SLink ou relation de subordination, est utilisée pour introduire des contextes et des relations entre deux événements. - ALink ou relation aspectuelle, représentant la relation aspectuelle entre un événement et son argument (en général c‟est un autre événement). Afin d‟avoir toutes les relations temporelles possibles entre les évènements des deux textes, le groupe a conçu un module d‟inférence temporelle. À partir des différents liens TLINK, ALINK et SLINK existant entre les expressions temporelles et les événements, le module infère de nouveaux liens non détectés auparavant. Pour cela le groupe a définit plusieurs règles d‟inférences qui sont citées ci-dessous : 8 TimeML a été développé dans le cadre de trois ateliers AQUAINT et des projets. En 2002, TERQAS atelier vise à renforcer la langue naturelle de répondre à la question des systèmes de réponse temps -fondé des questions sur les événements et les entités dans des articles de journaux. La première version de TimeML a été définie et la TimeBank corpus a été créé comme une illustration. Tango a un atelier de suivi dans lequel un outil graphique d'annotation a été développé. Actuellement, le TARSQI projet développe des algorithmes qui balise les événements et le temps des expressions NL textes dans le temps et l'ancrage et l'ordre des événements. En outre, TimeML a été examinée et encouragée dans: ARTE atelier ACL : Annoter et Raisonnement sur le temps et les événements (Juillet 2006), Séminaire Dagstuhl Annoter, l'extraction et le raisonnement sur le temps et les événements (avril, 2005). 48 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Figure 2.2: Règles de l‟inférences temporelles Concrètement le module suit les étapes suivantes : Etape1:trouver T1 et T2, deux expressions temporelles dans la phrase ou des phrases adjacentes. respectivement. lié à T1 et T2 Etape2:Rechercher des événements E1 et E2 événements. d'autres et entre E1 lien relation CE1 une Etape3:Trouver Etape4:Trouver relation CE2 lien entre E2 et d'autres événements. Etape5:Utiliser une inférence temporelle reliant CE2 et CE1. Figure 2.3: Application des règles de l‟inférences sur un exemple du corpus RTE Lors de l'application de la procédure à l'exemple illustré dans la figure 2.3 le module suit les étapes suivantes : Etape 1: trouver les expressions temporelles t1 et t2. Etape 2: événements e1 et e4 reliées à t1 et t2 avec TLink : is_includes. Etape 3: détecter la chaîne des événements (e1, e2, e3). Etape 5: T1 et T2 sont liés (par un ANCHORTIME (t2)=t1), ce qui signifie que e1, e2, e4 et e3 sont simultanés. 49 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle 6.2) Synthése Ce groupe s‟est focalisé sur la déduction de nouvelles relations entre évenements. Cette étude sur l‟inférence temporelle a permis d‟établir plusieurs régles d‟inférences reliant les évenements et les expressions temporelles. 7) Conclusion Dans ce chapitre nous avons exploré la logique temporelle et ses applications dans le traitement du langage Naturel. Nous avons aussi illustré avec les travaux du groupe (HLTRI) les différents types d‟inférences temporelles existants, Nous avons remarqué que ce groupe ne se base que sur l‟amélioration des détections des relations temporelles existantes entre évenements et expressions temporelles. Nous nous sommes inspirés de ces travaux dans notre façon de procéder pour élaborer le corpus et concevoir nos inférences. Nous allons montrer dans les prochains chapitres comment nous avons concrétisé cet objectif. 50 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Partie 2 Conception, réalisation et mise en oeuvre du système TIMINF Résumé : Cette partie de notre mémoire est composée de trois chapitres qui regroupent la conception et la réalisation de notre projet. Dans le chapitre trois, nous avons entrepris une démarche expérimentale à base de corpus afin de dégager les différentes classes d‟inférence temporelle et à partir de cette analyse, nous avons conçu l‟architecture du système de reconnaissance d‟inférence textuelle TIMINF présenté dans le chapitre quatre. Nous nous sommes intéressés dans le dernier chapitre à l‟évaluation des sorties de notre système en le confrontant à un corpus de test adapté. 51 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle - Chapitre 3 - L‟élaboration et étude du corpus 52 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Chapitre 3 L‟élaboration et l‟étude du corpus 1) Introduction L‟importance du RTE dans le TALN a poussé les chercheurs à s‟investir dans ce domaine et à explorer différents chemins pour parvenir à détecter et à classifier différents types d‟inférences. Dans les chapitres précedents, nous avons d‟abord étudié les groupes travaillant sur la reconaissance de l‟inférence textuelle et nous avons remarqué qu‟aucun groupe n‟utilisait l‟inférence temporelle dans son système. Dans le chapitre précedent nous avons étudié le temps dans la langue et nous avons remarqué que les groupes travaillant sur l‟inférence temporelle se base sur l‟amélioration des détéctions des relations temporelles existantes entre évènements et expressions temporelles mais ils n‟essayaient en aucun cas d‟intégrer leurs travaux a un systéme d‟inférence textuelle. Afin de répondre au manque de l‟inférence temporelle dans le RTE, notre objectif est d‟intégrer le système de détéction d‟inférence temporelle dans un systéme d‟inférence textuelle. Pour cela, nous avons l‟obligation d‟étudier les relations temporelles qui peuvent exister entre deux ségments de textes à travers un corpus que nous avons élaboré. Ceci nous a permis de distinguer différents types d‟inférences. Nous allons montrer tout au long de ce chapitre comment nous avons concrétisé ces différents objectifs. 2) L‟élaboration du corpus La première étape à entreprendre consiste à créer le corpus constitué de paires de textes et hypothèses (T-H) qui correspond à des informations collectées à travers le web dans des domaines différents. Nous avons choisi d‟établir notre corpus en langue anglaise car jusqu'à nos jours les recherches les plus abouties sur l‟inférence temporelle et aussi sur le RTE sont en langue anglaise. Pour cela, nous avons choisi d‟utiliser le corpus de questions élaborées pour le test par la compagne d‟évaluation des systèmes de recherches d‟informations (clef9) pour l‟année 2006. 9Le lien du challenge clef : http://www.elda.org/article225.html 53 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Le challenge CLEF est crée en 2000 pour fournir une infrastructure visant à soutenir le développement, d'essai et d'évaluation des systèmes de cross-langue de recherche d'information dans plusieurs langues européennes (Français, Italien, Allemand). Pour pouvoir développer et évaluer notre système, nous avons sélectionné des questions portant sur des événements temporels et nous avons soumis ces questions au système de question-réponse answerbus 10 disponible sur le web. Nous avons récupéré les réponses correspondantes et nous les avons modifiées pour obtenir l‟inférence souhaitée. Nous avons aussi transformé les questions à l‟affirmatif. Nous illustrons ces démarches par l‟exemple montré ci-dessous : La question numéro 13 du corpus de test de challenge clef 2006: In what year did the catastrophe in Chernobyl happen? La requête va être mise dans le système de question réponse Answerbus. Le résultat est montré ci-dessous : Figure 3.1 : Représente la réponse du système AnswerBus Nous choisissons la première réponse donnée par le système qui est : 10 http://www.answerbus.com 54 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle H: It is not by accident that one of the versions explaining the catastrophe at the Chernobyl AES on 26 April 1986 (because smaller-scale accidents happened there before) ties up the cause of the tragedy with experiments at "Chernobyl-Two" . Aussi, nous transformons la question en affirmatif en répondant à la question. Comme résultat nous avons la réponse suivante : T: the catastrophe of Chernobyl happens in 1987. Finalement nous avons une paire de texte de la forme : T: the catastrophe of Chernobyl happens in 1987. H: It is not by accident that one of the versions explaining the catastrophe at the Chernobyl AES on 26 April 1986 (because smaller-scale accidents happened there before) ties up the cause of the tragedy with experiments at "Chernobyl-Two" . Comme dans le challenge RTE, les exemples sont divisés en deux types de corpus (corpus de développement et corpus de test). Les deux corpus sont constitués de 30 paires de textes et chaque portion du corpus doit inclure 50% d‟exemples avec une inférence vrai 50% d‟exemples avec une inférence fausse. Pour cela, chaque exemple (T-H) paire est jugé par un annotateur pour voir s‟il y a une inférence textuelle dans la paire de texte entre (T-H) ou pas. La figure suivante montre un exemple du corpus après annotation : <pair id="754" value="TRUE" > <t> the catastrophe of Chernobyl happens in 1987</t> <h> It is not by accident that one of the versions explaining the catastrophe at the Chernobyl AES on 26 April 1986 (because smaller-scale accidents happened there before) ties up the cause of the tragedy with experiments at "Chernobyl-Two" . </h> </pair> Id : représente le numéro de la pair. Value : représente la décision de l’annotateur (vrai ou faux). Figure 3.2 : Exemple du corpus annoté L‟exemple est évalué par un second juge qui évalue les paires de textes et d‟hypothèses, sans avoir pris conscience de leurs contextes. 55 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Les annotateurs étaient d‟accord avec le jugement dans 86,66 % des exemples, ce qui correspond à 0.6 Kappa qui est une mesure statistique pour calculer a quel point deux personnes A et B sont d‟accord pour classer N éléments dans K catégories mutuellement exclusives, les 13,33% du corpus où il n‟y a pas eu d‟accord ont été supprimés. Le reste du corpus est considéré comme un «gold standard» ou « BASELINE » pour l‟évaluation. 3) Classification de l‟inférence temporelle Apres avoir conçu notre corpus, nous avons annoté manuellement les événements, les dates et les différents types d‟inférences (lexicales, syntaxiques et temporelles) existant entre les segments de textes. Cela nous a permis de détecter les différents types d‟inférences temporelles entre les segments de textes. Nous détaillons dans ce qui suit les différentes classes que nous avons distingué: 3.1) Les inférences entre expressions temporelles L‟inférence permet d‟établir des relations temporelles liant date, heure et durée entre elles. Dans le même contexte, nous avons distingué trois types d‟inférences temporelles liant des expressions temporelles. Cette figure représente le nombre de paires de textes pour chaque sous classe d‟inférence dans notre corpus de développement. Figure 3.3 : Pourcentage de paires par types d‟inférences Dans ce qui suit, nous présentons les trois types d‟inférences : 56 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle 3.1.1) Les inférences entre dates C‟est la relation temporelle entre qui peut y avoir entre les dates du texte T et les dates du texte H. L‟exemple suivant permet de montrer la relation qui peut exister entre les dates. Exemple 1: <pair id="8" value="TRUE" > T: the football world cup finished on t1: july 12 th 2006. H: the football world cup finished in t2: july 2006. Dans cet exemple, nous remarquons que l‟inclusion entre les deux dates t1 et t2 a permis d‟avoir l‟inférence temporelle. Exemple 2: 1) <pair id="1" value="TRUE" > T: the second world war finished in t1: 1945. H: the end of the second world war took part t2: between 1940 and 1950. Dans cet exemple nous remarquons aussi que l‟inclusion entre les deux dates t1 et t2 a permis d‟avoir l‟inférence temporelle. 3.1.2) Les inférences entre adverbiaux temporels L‟inférence permet d‟établir une relation temporelle entre adverbiaux de référence temporelle qui exprime la localisation d‟un événement dans le temps. L‟exemple suivant permet de montrer la relation qui peut exister entre deux adverbiaux temporels. Exemple 1: <pair id="15" value="TRUE" > T: he has worked during 10 days. H: He has worked for many days. Dans cet exemple, nous pouvons remarquer que l‟adverbial temporel « During 10 days » l‟infère l‟adverbial « many days ». Exemple 2: 14) <pair id="14" value="TRUE" > T: the day before yesterday, Paul disappeared. H: two days ago, Paul disappeared. Dans cet exemple nous remarquons que l‟adverbial temporel « the day before yesterday» infère l‟adverbial « two days ago». 57 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle 3.1.3) Les inférences entre dates et adverbiaux temporels L‟inférence permet d‟établir des relations temporelles entre dates et adverbes. L‟exemple suivant permet de montrer la relation qui peut exister entre un adverbial temporel et une date. Exemple 1: 18) <pair id="18" value="TRUE" > T: the building collapsed at 2 o‟clock p.m. H: in the afternoon the building collapsed. Dans l‟exemple précédant nous pouvons remarquer que « 2 o‟clock p.m » infère l‟adverbial «the afternoon ». Exemple 2: 19) <pair id="19" value="TRUE" > T: Mark has arrived on Monday, the day after Celine has arrived. H: Celine has arrived on Tuesday. Dans l‟exemple précédant nous pouvons remarquer que si nous ajoutons « the day after » à « Monday» nous arrivons à «Tuesday». Ceci implique une inférence entre ces adverbiaux temporels. 3.3.2) Les inférences entre évènements L‟inférence permet d‟établir des relations temporelles entre événements. Dans ce contexte, nous avons détecté deux types d‟inférences, une qui demande la relation entre événements pour détecter l‟inférence, et l‟autre ne demande que l‟inférence lexico sémantique. Cette figure présente le nombre de paires de textes dans chaque sous classe dans le corpus. 58 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Figure 3.4 : Nombre de paires par types d‟inférences 3.3.2.1) Les relations entre évènements temporels La relation temporelle entre événements est établie par rapport aux relations qu‟elle peut avoir avec d‟autres événements dans le texte. L‟exemple suivant permet de montrer la relation qui peut exister entre un adverbial temporel et une date. Exemple 1: 22) <pair id="22" value="TRUE" > T: since the death of Turing, the scientific community gives the Turing prize to researchers who found out discoveries in computer science. H: The Turing prize was not given before the death of Turing. Dans l‟exemple précédent, nous pouvons apercevoir que les deux événements « given » apparaissant dans les deux segments dépendent d‟autres événements « the death of turing » pour se situer dans le temps. Exemple 2: 23) <pair id="23" value="TRUE" > T: Algeria has become independent. H: before its independence Algeria was colonized. Dans l‟exemple précédent, nous pouvons apercevoir que l‟événement « independent » apparaissant dans le segment H, dépendent de l‟événement « was colonized » pour se situer dans le temps. 59 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle 3.3.2.2) Les inférences lexico sémantiques La relation temporelle entre événements est établie par rapport aux relations sémantiques qui peuvent exister entre eux. L‟exemple suivant permet de montrer la relation lexico-sémantique existante entre deux évènements. Exemple 1: 26) <pair id="26" value="TRUE" > T: France has won the match against Brasil. H: France has played the match against Brasil. Dans l‟exemple précédent, nous pouvons constater que l‟évènement « won » se produit après l‟évènement « played ». Exemple 2: 27) <pair id="27" value="TRUE" > T : Amine was dreaming . H : Amine was sleeping deeply. Dans l‟exemple précédant nous pouvons constater que l‟évènement « was dreaming» se produit durant l‟évènement « was sleeping deeply». 3.3.4) Les inférences entre évènements et expressions temporelles L‟inférence permet d‟établir des relations temporelles entre événements et expressions temporelles. Cette figure représente le nombre de paires de textes où existe ce type d‟inférence. Figure 3.5 : Nombre de paires par types d‟inférences 60 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle L‟exemple suivant permet de montrer la relation temporelle existante entre évènements et expressions temporelles. Exemple 1: 29) <pair id="29" value="TRUE" > T: Japan gave weapons back after the explosion of the first atomic bomb. H: Japan gave weapons back in 1945. Dans l‟exemple précédent, nous pouvons remarquer que l‟évènement « the explosion of the first atomic bomb » est ancré temporellement avec l‟expression temporelle «1945 ». Exemple 2: 30) <pair id="30" value="TRUE" > T: Germany has become unified since the fall down of the Berlin wall. H: Germany unified 19 years ago. Dans l‟exemple précédent, nous pouvons remarquer que l‟évènement «the fall down of the Berlin wall» est ancré temporellement avec l‟expression temporelle «19 years ago». 4) Le bilan de l‟étude du corpus Dans notre élaboration du corpus, nous nous sommes limités à des segments de textes relativement brefs et concrets. Nous retrouvons dans ce corpus des inférences temporelles sous des formes variées. Le tableau suivant représente le pourcentage de paires du corpus de développement par type d‟inférence temporelle existante, sachant qu‟il existe 30 paires dans notre corpus. Types d‟inférences temporelles Inférences entre expressions temporelles Inférences entre évènements Inférences entre évènements et expressions temporelles Nombres de paires 21/30 6/30 3/30 Tableau 3.1 : Nombre de paire dans le corpus Cette figure représente le pourcentage de paires de chaque type d‟inférence dans le corpus de développement : 61 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Figure 3.6 : Pourcentage de paires par types d‟inférences Nous constatons que notre corpus de développement a un pourcentage élevé de paires contenant une inférence temporelle entre expression temporelle et cela est dû à une forte présence de questions d‟ordres temporelles extraites du corpus de test du challenge clé. Les détails des corpus de test et de développement sont disponibles en annexe. 5) Conclusion Dans ce chapitre nous avons expliqué, comment nous avons élaboré un corpus contenant des paires de segments de textes integrant des relations temporelles, ensuite nous avons fait une classification des différents types d‟inférences temporelles existantes dans le corpus. La suite logique de ce travail consiste à déduire des régles d‟inférences temporelles et à les intégrer à un systéme d‟inférence texuelle. Ces démarches sont l‟objet du chapitre suivant que nous allons exposer. 62 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle - Chapitre 4 - La présentation du système TIMINF 63 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Chapitre 4 La présentation du système TIMINF 1) Introduction Nous présentons, dans ce chapitre notre projet d‟inférence temporelle, nommé TIMINF. Ce projet a pour but de développer et d‟évaluer l‟apport de l‟inférence temporelle dans la reconnaissance de l‟inférence textuelle. L‟un des principaux défis de ce type de système est de permettre aux systèmes d‟inférences textuelles, d‟ouvrir un voile sur l‟inférence temporelle et d‟explorer cette nouvelle approche. Dans ce cadre, l‟objectif de TIMINF est de définir ce que devrait être un système d‟inférence textuelle intégrant l‟aspect temporel dans son fonctionnement, qui tient en compte la relation entre expression temporelle et relation entre les évènements dans la déduction de l‟inférence textuelle. Nous allons montrer tout au long de ce document comment nous avons concrétisé cet objectif. Nous décrivons alors les principaux modules constituant le système. 2) Architecture informatique de TIMINF L‟architecture générale de TIMINF, telle que déduite de l‟analyse du corpus présenté au chapitre précédant, est illustrée dans la figure 4.1 suivante. Cette dernière s‟articule autour de trois étapes essentielles qui sont :  Le prétraitement qui permet de repérer les données temporelles et les composants syntaxiques de la paire de texte (T, H).  L‟inférence textuelle qui contient les modules de test d‟inférence textuelle et du balisage des expressions temporelles.  L‟inférence d‟inférences. temporelle qui contient les moteurs d‟inférence et les règles 64 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Ree Paire de texte D pré traitement D Test d‟inférence textuelle Ree Ressources l‟inguistiques T TARSQI Analyse syntaxique Balisages expressions temporelles détectées TARSQI des Inférence entre sujets non par Inférence entre événements T Test d‟inférence T temporelle Ree Règles d‟inférences Superviseur YES NO YE YES Figure 4.1 : Architecture du système TIMINF Dans ce qui suit nous présentons les différents modules constituants le système TIMINF. 65 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle 2.1) Le prétraitement Le prétraitement est effectué par les deux modules TARSQI et LINK parseur. Ces deux modules s‟exécutent en parallèle et nous permettent respectivement de repérer les données temporelles et les composants syntaxiques de la paire de texte (T, H). Nous détaillerons dans ce qui suit les deux modules et leurs utilisations dans notre système. 2.1.1) Le projet TARSQI TARSQI est un outil permettant d‟organiser des textes en langages naturels en fonction de leurs caractéristiques temporelles (Pustejovsky et al., 2003). Son objectif est d‟annoter les données temporelles dans un texte en langage naturel, d'extraire des données temporelles à partir de temporelles les données raisonnements sur textes et d‟effectuer des (http://www.timeml.org). Afin de répondre à ces différents objectifs, le module TARSQI utilise les balises TimeML pour marquer les expressions temporelles, les événements, les relations temporelles et les Subordinations syntaxiques des événements. Le système TARSQI est mis en place comme une cascade de modules successivement ajoutés. L'architecture du système est définie dans le schéma ci-dessous. document entrant : étiqueté par TreeTagger GUTime : détection des expressions temporelles E Evita : système de reconnaissance d‟événements inf(e1,e2 )=vrai GUTenLINK : représente la relation entre deux objets temporels Slinket : relations les identifie subordonnées entre deux événements SputLINK : détection des relations implicites entre événements Document TimeML Figure 4.2 : Architecture du module TARSQI 66 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Le module TARSQI doit avoir comme entrée des documents prétraités syntaxiquement. Pour cela, les concepteurs de TARSQI ont choisi d‟utiliser une analyse morphosyntaxique avec le module TreeTagger. Dans ce qui suit nous allons décrire le module TreeTagger. 2.1.1.1) TreeTagger C‟est un système d'étiquetage automatique des catégories grammaticales des mots avec tokenisation lemmatisation (www.ims.uni- 1994) Schmid, (Helmut et stuttgart.de/projekte/corplex/TreeTagger/). Le module Treetagger a comme entrée un texte brut et il admet deux types de sorties : A) Une sortie en forme de tableau Comme il est montré dans l‟exemple suivant (figure 4.3), le mode de sortie est un tableau représentant l‟étiquetage des mots dans la phrase. Entrée : Le TreeTagger est facile à utiliser. Sortie: Mot POS Le DT TreeTagger Est Facile À Utiliser NP VBZ JJ D' VB Lemme La TreeTagger Être Facile À Utiliser . . . Figure 4.3 : Sortie en format tableau de TreeTagger Sachant que : Mot : représente le mot étiqueté. POS : représente la catégorie grammaticale du mot par exemple (VB pour verbe, DT pour un déterminant…..). Lemme : représente la lemmatisation du mot. 67 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle B) Sortie format XML Avec La sortie format XML, chaque mot est tagué avec les balises de TreeTagger. Exemple d‟entrée, sortie TreeTagger : Entrée: He also slept on Friday night. Sortie: <BODY> <TEXT> <s> <NG><lex pos="PP">He</lex></NG> <lex pos="RB">also</lex> <VG <lex pos="VBD">slept</lex></VG> <lex pos="IN">on</lex> <NG> <lex pos="NNP" >Friday</lex> <lex pos="NN">night</lex> </NG> <lex pos=".">.</lex> </s> </TEXT> </BODY> Figure 4.4 : Sortie en format XML de TreeTagger Les balises utilisées par TreeTagger sont :  <BODY> contient le corps du document.  <TEXT> contient le texte.  Les phrases doivent être marquées d'un <s>.  Le groupe nominal est balisé avec <NG> et le groupe verbal avec <VG>.  chaque mot dans la phrase est balisé par <LEX>. Les attributs utilisés par TreeTagger sont :  Stem : représente la lemmatisation du mot qui est balisé.  Pos : donne la catégorie grammaticale du mot balisé. (DT pour déterminant-nom, PP pour une préposition…). pour en savoir plus sur les différents symboles utilisés par Treetagger pour étiquetter les différentes catégories grammaticales, toutes les définitions des symboles sont disponibles sur le site (www.ims.uni- stuttgart.de/projekte/corplex/TreeTagger/). 2.1.1.2) GUTime L'étiqueteur GUTime, développé à l'Université de Georgetown, utilise TIMEX3 tag pour représenter les expressions temporelles, telles que : les dates, les heures, les durées, etc (Mani et Wilson, 2000). Il existe 3 types d‟informations temporelles détectées par TIMEX3. 68 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle DATE : c'est-à-dire les années, les mois et les jours. Exemple: USA were touched by terrorism in September 11, 2001. TIME : c'est-à-dire les heures de la journée. Exemple: The building collapsed at 2 o'clock p.m. DURATION : représente un intervalle de temps entre deux dates. Exemple: The end of the second world war happened between 1940 and 1950. Un exemple de sortie du module GUTime est montré ci-dessous : In Washington <TIMEX3 tid="t1" TYPE="DATE" temporalFunction="true" valueFromFunction="tf1" anchorTimeID="t0">today</TIMEX3>, the Federal Aviation Administration released air traffic control tapes from the night the TWA Flight eight hundred went down. Figure 4.5: Sortie du module GUTime Les attributs de TIMEX3 dans l‟exemple sont : Tid : donne l‟identifiant de l‟expression temporelle, pour chaque expression tagger par TIMEX a son propre identifiant. Type : chaque TIMEX est assigné à ces différents types {DATE, TIME, DURATION}. TemporalFunction : c‟est un attribut qui retourne si la date est précise dans le temps ou pas. Exemple: Next Tuesday  TemporalFunction= true. September 11,2001 TemporalFunction= false. AnchorTimeID : s‟il y a un ancrage temporel de l‟expression temporelle identifiée par Tid avec une autre expression temporelle, AnchorTimeID donne son identifiant. 2.1.1.3) Evita Evita est un système de reconnaissance d‟événements, pour cela le module utilise deux balises de TIMEML (EVENT et MAKEINTANCE) qui sont décrites ci-dessous : A) EVENT EVENT est utilisé pour annoter les événements dans un texte, syntaxiquement, les évènements sont généralement des verbes, mais un nom peut aussi être utilisé pour dénoter un événement. Les différentes classes d‟événements qui sont détectées sont représentées ci-dessous. 69 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle  occurence : la plupart des événements font partie de cette classe. Ils décrivent ce qui se produit dans le monde.  state : les états décrivant les circonstances dans lesquelles un événement a lieu et dont l‟état peut être modifié ; et les états introduits par les i-action, i-state et reporting.  Reporting : description de l‟action d‟une personne par un acte narratif.  i-action : une action intentionnelle introduisant un autre événement, comme un essai, une enquête, un rapport, un ordre, une demande, une promesse, une nomination. i-state : similaire à i-action mais pour identifier un état tel que penser, ressentir. suspecter, douter, vouloir, désirer, détester, être prêt, être capable.  aspectual : un événement débutant, terminant ou continuant une action.  Perception : constatation physique d‟un événement telle qu‟entendre ou voir l‟action.  B) MAKEINSTANCE MAKEINSTANCE est une réalisation de lien, il indique les différentes instances d'un événement donné. Dans l‟annotation, les <EVENT> ne participe jamais à une relation, c‟est la réalisation (<MAKEINSTANCE>) de l‟événement qui y participe et chaque EVENT introduit au moins un correspondant MAKEINSTANCE. Un exemple de sortie du module Evita est montré ci-dessous: In Washington today, the Federal Aviation Administration <EVENT eid="e1" class="OCCURRENCE">released</EVENT> air traffic control tapes from the <EVENT eid="e2" night the TWA Flight eight hundred class="OCCURRENCE">went</EVENT> down. <MAKEINSTANCE aspect="NONE"/> <MAKEINSTANCE aspect="NONE"/> eventID="e1" eiid="ei1" pos="VERB" tense="PAST" eventID="e2" eiid="ei2" pos="VERB" tense="PAST" Figure 4.6 : Sortie du module Evita Les attributs de EVENT dans l‟exemple sont : Eid : donne l‟identifiant de l‟évènement, pour chaque évènement tagger par EVENT a son propre identifiant. Class : détermine la classe auquel appartient l‟évènement. Les attributs de MAKEINSTANCE dans l‟exemple sont : eventID : donne l‟identifiant de l‟évènement, pour chaque évènement tagger par EVENT a son propre identifiant. Eiid : instance de l‟événement trouvé dans le texte. Pos : donne la catégorie grammaticale du mot balisé. Tense : donne le temps de l‟évènement si l‟évènement est un verbe. 2.1.1.4) GutenLink GutenLink est un module de TARSQI qui utilise les balises TLINK de TIMEML pour représenter la relation entre deux objets temporels, que ce soit deux événements, deux marqueurs temporels ou un marqueur temporel et un événement. Il y a quatorze types de relations identifiées par le module, bien que certaines soient simplement l‟inverse d‟autre : 70 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle    before et after spécifient qu‟un objet temporel précède ou suit l‟autre objet temporel de la relation ; ibefore et iafter spécifient qu‟un objet temporel est immédiatement avant ou après un autre. includes et is-included spécifient qu‟un objet temporel inclut ou est inclus dans un autre, p. ex. John arrived in Montreal yesterday.  during spécifie que l‟état ou l‟événement se poursuit durant une période de temps, p. ex. John taught for 90 minutes.  during-inv est l‟inverse de la relation précédente.  simultaneous spécifie que deux instances d‟événements semblent coïncider dans le Temps.  identity indique que deux objets temporels représentent le même événement.  begins spécifie qu‟un événement débute par l‟objet temporel avec lequel il est lié.  begun-by est l‟inverse de begin, elle relie un objet temporel à un événement débutant par l‟objet temporel.  ends et ended-by sont similaires aux deux relations précédentes sauf qu‟elles Spécifient la fin de l‟événement. Un exemple de sortie du module GutenLink est montré ci-dessous : tid="t1" TYPE="DATE" VAL="PRESENT_REF" In <TIMEX3 Washington temporalFunction="true" valueFromFunction="tf1" anchorTimeID="t0">today</TIMEX3>, the Federal Aviation Administration <EVENT eid="e1" class="OCCURRENCE">released</EVENT> air traffic control tapes from the night the TWA Flight eight hundred <EVENT eid="e2" class="OCCURRENCE">went</EVENT> down. There's nothing new on why the plane <EVENT eid="e3" class="OCCURRENCE">exploded</EVENT>, but you <EVENT eid="e4" class="OCCURRENCE">cannot</EVENT> <EVENT eid="e5" class="OCCURRENCE">miss</EVENT> the moment. ABC's Lisa Stark <EVENT eid="e6" class="OCCURRENCE">has</EVENT> more. pos="VERB" eiid="ei1" tense="PAST" pos="VERB" eventID="e4" eiid="ei3" tense="PAST" pos="VERB" eiid="ei2" tense="PAST" eventID="e3" eventID="e1" pos="VERB" eiid="ei4" tense="PRESENT" eventID="e2" eventID="e5" pos="VERB" eiid="ei5" tense="INFINITIVE" <MAKEINSTANCE aspect="NONE"/> <MAKEINSTANCE aspect="NONE"/> <MAKEINSTANCE aspect="NONE"/> <MAKEINSTANCE aspect="NONE"/> <MAKEINSTANCE aspect="NONE"/> <MAKEINSTANCE aspect="NONE"/> <TLINK eventInstanceID="ei1" rule="2-1"/> <TLINK eventInstanceID="ei2" rule="2-1"/> <TLINK eventInstanceID="ei1" relatedToEventInstance="ei3" relType="BEFORE" rule="3-19"/> <TLINK eventInstanceID="ei3" relatedToEventInstance="ei4" relType="BEFORE" rule="6-1"/> <TLINK eventInstanceID="ei3" relatedToEventInstance="ei6" relType="BEFORE" rule="3-23"/> relType="IS_INCLUDED" relType="IS_INCLUDED" relatedToTime="t1" relatedToTime="t1" tense="PRESENT" eventID="e6" pos="NONE" eiid="ei6" Figure 4.7 : Sortie du module GutenLink 71 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Les attributs de TLINK dans l‟exemple sont : eventInstanceID : donne l‟identifiant de l‟évènement. relatedToTime : donne l‟identifiant de l‟expression temporelle. relType : donne la relation temporelle existant entre les l‟expressions temporelles, ils utilisent pour cela les relations d‟Allen. 2.1.1.5) Slinket Les liens subordonnants <SLINK> identifient les relations entre deux événements. Ils sont habituellement introduits par des verbes modaux qui impliquent une confirmation. Les liens subordonnants sont définis selon six types de relations qui interagissent avec les classes d‟événements reporting, i-state et i-action (modal introduit la possibilité d‟un événement, p. ex. John promised Mary to buy some beer). Les différentes classes d‟événements qui sont détectées sont représentées ci-dessous.  evidential introduit la perception ou le compte-rendu de l‟événement, p. ex. Johnsaid he bought a pack of beer.  neg-evidential introduit la perception ou rapporte que l‟événement ne s‟est pas réalisé, p. ex. John denied he bought beers factive est une action qui implique ou présuppose qu‟un événement a déjà eu lieu, p. ex. John managed to leave the party.  counter-factive est la négation de la relation précédente p. ex. John forgot to buy beers.  conditional indique que la réalisation de l‟action entraînera l‟événement en relation.  Un exemple de sortie du module SLINKET est montré ci-dessous: The Soviet Union <EVENT eid="e12" class="REPORTING">said</EVENT> today it had <EVENT eid="e13" class="OCCURRENCE">sent</EVENT> an envoy to the Middle East. eventID="e12" <MAKEINSTANCE pos="VERB"/> <MAKEINSTANCE eventID="e13" eiid="ei13" tense="PAST" aspect="PERFECTIVE" pos="VERB"/> aspect="NONE" eiid="ei12" tense="PAST" <SLINK relType="EVIDENTIAL" subordinatedEventInstance="ei13" "/> eventInstanceID="ei12" Figure 4.8 : Sortie du module SLINKET Les attributs de SLINK dans l‟exemple sont : l‟identifiant de eventInstanceID : c‟est subordination. subordinatedEventInstance : c‟est l‟identifiant de l‟évènement subordonné. relType : donne la relation temporelle existante entre entités. l‟évènement concerné par la relation de 72 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle 2.1.1.6) SputLink Le module SputLink effectue des inférences temporelles en tenant compte des relations temporelles déjà générées par les modules qui le précèdent, c‟est-à-dire (GUTenLINK et Slinket) et génère de nouvelles relations temporelles. SputLink est fondé sur l‟algèbre d‟intervalle fondé par James Allen's en 1983. Allen réduit tous les évènements et expressions de temps à 13 intervalles de bases et identifie les relations entre les intervalles. Les informations temporelles dans un document sont représentées comme un graphe où les événements et les expressions temporelles forment les noeuds, les relations temporelles forment les arcs. Exemple Evenement Before(A,B) Before(B,C) Before(A,C) Before(a,b)= a précéde b A B C A C Figure 4.9: Inférence effectué par le module SputLINK Ainsi, si A précède B et B précède C. des deux relations, on déduit que A précède C. 2.1.1.7) L’utilisation de TARSQI Afin de permettre la portabilité du module TARSQI, les concepteurs ont proposé deux formats d‟entrée possible à TARSQI qui sont décrits ci-dessous: A) Format simple–xml Avec ce format, l‟analyse morphosyntaxique est incluse dans le module TARSQI. L‟entrée est représentée par le format suivant: Exemple d‟entrée simple-xml. <DOC> <DOCID> Simple Test </DOCID> <TEXT> In the afternoon, the building collapsed. </TEXT> </DOC> Figure 4.10 : Entrée format simple-xml 73 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Les balises de simpe_xml :  <DOC> pour annoter le début et la fin du document.  <DOCID> contient le type du document.  <TEXT> contient le texte. B) Format RTE3 Avec ce format, l‟analyse morphosyntaxique n‟est pas incluse dans le module TARSQI et nous avons comme entrée le format RTE3, qui est le résultat d‟un prétraitement effectué par le groupe COGEX qui travaille sur le RTE. Le groupe a choisi de développer son propre prétraitement. Nous présentons dans ce qui suit un exemple de sortie du format RTE3 : Exemple : <XML version="1.0" ?> <pair length="short" task="IE" id="1"> <t><s>text1</s></t> <br/><h><s><NG> <HEAD><lex start="0" end="12" pos="NNP" stem="Le Beau Serge">Le Beau Serge</lex> </HEAD></NG><VG><lex start="14" end="16" pos="VBD" stem="be">was</lex> <HEAD><lex start="18" end="25" pos="VBN" stem="direct">directed</lex> </HEAD></VG> <HEAD><lex start="27" end="28" pos="IN" stem="by">by</lex> </HEAD><NG> <HEAD><lex start="30" end="36" pos="NNP" stem="Chabrol">Chabrol</lex> </HEAD></NG><lex start="37" end="37" pos="." stem=".">.</lex> </s></h> </pair> Figure 4.11 : Sortie du module GutenLink Les balises du format RTE3 sont :  Les phrases doivent être marquées d'<s>.  Les groupes nominaux sont balisés avec <NG> et les groupes verbaux avec <VG>.  Les débuts de phrases sont marqués par des balises <HEAD>.  <t> représente la premier phrase et <s> représente la deuxième phrase.  <pair> représente la paire de phrases. Les attributs :  Start : représente la position du caractère de début de la chaine dans le texte.  End : représente la position du caractère de fin de la chaine dans le texte.  Stem : représente la lemmatisation du mot qui est balisé. 74 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle  Pos : donne la catégorie grammaticale du mot balisé. 2.1.1.8) L’intégration de TARSQI au système TIMINF Dans notre système d‟inférence, nous avons utilisé le format simple-xml au lieu de RTE3 car nous avons choisi d‟utiliser le module TreeTagger pour l‟analyse morphosyntaxique qui est intégré dans le module TARSQI dans le format simple-xml. En plus de la détection des expressions temporelles, la phase de prétraitement intègre l‟analyse syntaxique pour détecter la relation grammaticale entre les mots dans une phrase. Dans ce qui suit, nous allons présenter l‟outil que nous avons choisi pour effectuer l‟analyse syntaxique. 2.1.2) L‟analyse syntaxique Figure 4.12 : L‟analyse syntaxique 2.1.2.1) Présentation de link grammar parser Nous avons utilisé le Link Grammar Parser (Sleator et Temperley, 1991) qui est un analyseur syntaxique de la langue anglaise, basé sur la dépendance syntaxique. Partant d’une phrase fournie en entrée, cet analyseur produit un ou plusieurs graphes de dépendances, qui consistent en un ensemble de liens reliant des paires de mots. Les noeuds du graphe sont les mots de la phrase. Certains d’entre eux ont un suffixe qui indique la partie du discours (nom, verbe, adjectif,adverbe, préposition, etc.). 75 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Les arcs étiquetés relient les noeuds du graphe. Chaque étiquette précise un rôle grammatical (D pour déterminant-nom, S pour sujet-verbe…). Dans ce qui suit, nous montrons un exemple de sortie du parseur Link Grammar Parser. Exemple : Entrée: Jone works very hard. Sortie: +----------------------Xp-----------------------+ +-------MVa-------+ +--- wd---+---Ss---+ + --EE--+ LEFT-WALL Jone works.v very hard.e . Figure 4.13 : Sortie du module Link Grammar Parser Les définitions des différents liens représentés dans le graphe sont les suivantes : EE adverbe se connecte à un autre adverbe. Ssconnecte le sujet au verbe. Xpconnecte le début et la fin de la phrase. MVaconnecte le verbe à l‟adverbe. Wd le premier mot est un sujet. .v verbe. .e adverbe. LEFT-WALL  détermine le début de la phrase. Pour en savoir plus sur les différents symboles utilisés par Link Grammar Parser pour étiqueter les différents liens grammaticaux, toutes les définitions des symboles sont disponibles sur le lien suivant (www.link.cs.cmu.edu/link/). 2.1.2.2) L’intégration du link parser à notre système Concrètement l‟analyseur syntaxique nous a permis de détecter les sujets dans les deux segments de textes (T, H) et de les baliser avec nos propres balises comme il figure dans l‟exemple suivant. Exemple: <pair id="28" value="TRUE" > <s> <syntax type: sujet>Poland</syntax> became a communistic state in 1945.</s><s> <syntax type: sujet>Poland</syntax> has become a communistic state since the invasion of Russians.</s> 76 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle La balise <syntaxe type: sujet>sujet</syntaxe> est choisi pour baliser les sujets dans la paire(T, H). Apres l‟analyse syntaxique et le traitement par TARSQI, la paire de texte est prête à être soumise au test d‟inférence textuelle qui a besoin des prétraitements effectués précédemment pour tester l‟inférence textuelle. Dans ce qui suit nous décrivons les différents constituants de la phase de test d‟inférence textuelle. 2.2) Les tests d‟inférences textuelles La deuxième phase s‟articule autour de deux modules. Le premier permet de tester l‟inférence textuelle pour savoir s‟il y a une inférence textuelle ou pas et le deuxième module permet de détecter les expressions temporelles non détectées par TARSQI. Les deux modules exploitent des ressources linguistiques. Dans ce qui suit nous allons présenter les deux modules et les ressources linguistiques utilisées : 2.2.1) Les tests d‟inférences entre événements et entre sujets Figure 4.14 : L‟inférence entre évènements et sujets Le but de ce module est de détecter s‟il y a une inférence textuelle entre les deux paires de textes (T, H). Le module est mis en place comme une cascade de sous modules successives. Le premier module détecte les inférences textuelles entre les sujets des deux segments de textes (T, H) et 77 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle le deuxième détecte les inférences textuelles entre évènements des deux segments de textes (T, H). Nous décrivons ci-dessous les deux modules d‟inférences : 2.2.1.1) L‟inférence entre sujets Le module d‟inférence entre sujets détecte s‟il y a une inférence textuelle entre les sujets du texte H avec les sujets du texte T. Pour cela, le module utilise les sorties du module LINK parser c'est-à-dire que pour chaque sujet détecté, dans le texte H nous recherchons s‟il y a une relation de synonymie avec un des sujets du texte T. Pour cela, le module emploie WordNet pour retrouver toutes les relations ontologiques qui lient les deux entités (l‟utilisation de wordNet dans notre système est détaillée dans le chapitre cinq). Aussi nous utilisons le comptage de mots pour comparer des groupes de mots (l‟algorithme de comptage de mots est expliqué dans l‟exemple (1)). Ce module accepte comme entrée au module le résultat de l‟analyse syntaxique des paires de texte T et H et en sortie il existe deux possibilités :  Si le module trouve une équivalence entre deux sujets, il déclenche le module d‟inférence entre événements en lui envoyant les événements correspondants aux deux sujets.  Si le module ne trouve pas d‟équivalence entre sujets, le module envoie le message « pas d‟inférence » au module du test d‟inférence. Exemple (1) : paire numéro 3 du corpus de développement. T: The Algerian revolution war started on 1st November 1954 and S1 caused the death of 1, 5 million of martyrs and lasted 7 years. H: The Algerian war ended in July 5 th, 1962. S2 Figure 3.12 : exemple d‟inférence entre sujets Relation d‟équivalence entre S1 et S2 Figure 3.15 : Exemple d‟inférence entre sujets Dans l‟exemple suivant le module détecte tous les sujets contenus dans le segment T et le segment H et les met dans deux listes différentes, ensuit il effectue la comparaison entre les évènements des deux listes. Dans notre exemple la première liste ne contient qu‟un seul sujet {S1} et la deuxième liste contient le sujet {S2}. Une relation d‟équivalence est détectée entre les évènements S1 et S2. 78 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Pour détecter l‟équivalence le module utilise l‟algorithme de comptage de mots pour déduire l‟inférence entre «the Algerian war » et « the Algerian revolution war». Le comptage de mots : L‟algorithme récupère les deux groupes deux mots dans deux listes différents et compare chaque mot d‟une liste avec les mots contenu dans la deuxième liste et s‟il y a un seul mot qui est semblable ou sous mot d‟un mot de la deuxième liste, il considère qu‟il y a une inférence entre sujets. 2.2.1.2) L‟inférence entre évènements Le module d‟inférence entre évènements détecte s‟il y a une relation ontologique entre les deux évènements reçus du module d‟inférence entre sujets. Pour cela, le module emploie WORDNET pour retrouver toutes les relations qui lient les deux entités. Le module a comme entrée les évènements reçus du module d‟inférence entre sujets et le balisage de TARSQI et comme sortie les résultats suivants :  S‟il trouve une équivalence entre deux évènements, il envoie le message « oui» au module de test d‟inférence.  S‟il trouve deux évènements contraires, il envoie le message « non » au module de test d‟inférence.  S‟il ne trouve pas de relation entre événements, il envoie le message « pas d‟inférence » au module de test d‟inférence. Exemple : T: the Algerian revolution war started in 1 November 1954 and E1 caused the death of 1,5 million of martyrs and finished 7 years. E3 E3 H : the algerian war ended in july 5, 1962. E4 Relation de synonymie entre E4 et E3 Figure 4.16 : Exemple d‟inférence entre évènements Dans l‟exemple ci-dessus le module détecte une liste d‟évènements dans le texte T {E1, E2, E3} et une autre liste d‟évènements dans le texte H {E1} et effectue la comparaison entre les évènements des deux listes. Une relation ontologique (synonymie) est détectée entre les évènements E4 et E3. 79 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle 2.2.2) Le balisage des expressions temporelles non détectées par TARSQI Nous avons remarqué qu‟au niveau de la détection des expressions temporelles, les modules de balisages existant ont un manque au niveau de la détection des entités nommées et des adverbiaux temporels. Dans ce qui suit nous montrons les différentes balises utilisées : Entités nommées : elles sont balisées par <NE TYPE=" " Val=‟‟ „‟>entité nommée</NE>.  TYPE contient le type d‟expression temporelle {date, durée}.  Val contient la date ou la durée correspondante. Exemple : T: Germany has become unified since t2: the fall down of the Berlin Wall. H: Germany unified t1: 19 years ago. T2 est balisé ainsi: <NE TYPE=" date " Val=‟‟ 1989 „‟> the fall down of the Berlin Wall</NE>. Figure 4.17 : Exemple de balisages d‟expressions temporelles Notre objectif avec le balisage de « the fall down of the Berlin Wall» est de repérer l‟évènement dans le temps. Dans l‟exemple précédent le balisage avec le module TARSQI ne détecte que « fall » comme événement et ne le relie pas à une date. Adverbiaux temporels : ils sont balisés par <TIMEX3 tid="t" TYPE=" " VAL="" >  TYPE contient le type d‟expression temporelle {date, durée}.  Val contient les entités que nous avons mises pour représenter les expressions temporelles. Dans ce qui suit nous relions à chaque expression les symboles correspondants.  Les jours de la semaine c‟est à dire {Monday, Tuesday, Wednesday, Thursday, Friday Saturday, Sunday} sont représentés respectivement par des nombres de 1 à 7, 80 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle  {Day before yesterday, two days ago, Yesterday}, sont respectivement par {-2, -2, -1} représentés  {everyday often} sont représentés avec {often}.  {Someday, Many days, morning, evening, Afternoon} sont représentés respectivement par PSD, PMD, aMORNING, aNIGHT et AFTERNOON. 2.3) Les Ressources linguistiques Figure 4.18 : Ressources linguistiques Deux types de ressources sont utilisés : 2.3.1) Les ressources externes Dans la conception de notre module d‟inférence, l‟utilisation d‟une ressource lexicale est indispensable au bon fonctionnement des deux modules (inférence entre sujets et inférence entre événements). Pour cela, nous avons choisi d‟utiliser Wordnet qui est la base de données lexicale qui correspond le plus à notre besoin en termes de relations ontologiques entre mots. 81 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle 2.3.1) Les ressources internes Ce module est en fait une base de données lexicale contenant les différentes entités nommées qui sont utilisées par le module de balisage pour annoter les expressions temporelles non détectées par le module TARSQI. Puisque notre objectif est de se focaliser sur l‟inférence entre expressions temporelles, non pas sur leur détection, nous avons effectué une annotation manuelle de ces expressions temporelles sachant qu‟il existe des logiciels payant qui peuvent effectuer la détection. 2.4) Les tests d‟inférences temporelles Cette phase permet de détecter s‟il y a une inférence temporelle et aussi textuelle entre les deux segments de textes T et H. Pour cela, nous utilisons un superviseur qui communique avec une base de règles d‟inférences et d‟après les résultats de la phase précédente (phase de test d‟inférence textuelle), il décide de la règle à utiliser. Dans ce qui suit nous décrivons les modules constituants cette phase. 2.4.1) Les règles d‟inférences Figure 4.19 : Règles d‟inférences Les règles d‟inférences sont divisées en deux groupes. Groupe 1 : contient les fonctions qui testent si les événements ont un ancrage temporel identique. 82 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Groupe 2 : contient les fonctions qui testent si les événements ont un ancrage temporel différent. 2.4.1.1) Définition des fonctions utilisées dans l‟abstraction des règles d‟inférences Dans ce qui suit, nous allons définir toutes les fonctions que nous avons utilisées dans l‟abstraction de nos règles d‟inférences. Sachant que S représente un des textes T ou H de la paire, E représente un événement dans le texte et t représente une expression temporelle.  <S, E>: indique que l‟événement E est dans le segment de texte S.  Subj (<S, E>): la fonction retourne le sujet de l‟évènement E dans le segment S.  Equivalent (<S,E1>,<S,E2>): la fonction retourne s‟il y a une équivalence entre E1 et E2 ou pas.  Contraire (<S,E1>,<S,E2>): la fonction retourne s‟il y a une antonymie entre E1 et E2 ou pas.  Inclut (<S,t>,<S,t>): la fonction retourne si t est inclut dans l‟intervalle de t‟ ou pas.  Egale (<S, t1>,<S, t2>): la fonction retourne s‟il y a une équivalence entre t1 et t2 ou pas.  Début (<S,t>,<S,E>,type): la fonction et booléen et renvoi vrai ou faux, si t est la date de debut de l‟événement E ou pas.  After(<S,E1>,<S,E2>,type): la fonction retourne s‟il y a une équivalence entre t1 et t2 ou pas.  before(<S,E1>,<S,E2>,type): la fonction retourne si E1 est avant E2 ou pas .  Fin (<S,E>,<S, t>,type): la fonction retourne si t est la date de fin de l‟événement E ou pas.  Relation (<S, E>,<S,t>,type): indique s‟il y a une relation TLINK entre l‟événement E et la date t. Tel que l‟argument type indique le type d‟expression temporelle {date, durée}.  Inf (T, H): indique, en sortie s‟il y à une inférence entre les segments de textes T et H ou pas.  Somme(<S, t1>,<S,t2>): renvoi en sortie la somme des deux dates.  Différence(<S, t1>,<S,t2>): renvoi en sortie la différence entre les deux dates. 83 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Les symboles utilisés dans les schémas de représentation de nos règles d‟inférences sont présentés ci-dessous : : représente le lien entre les deux évènements. : représente le lien entre les deux expressions temporelles. : représente les éléments du texte T. : représente les éléments du texte H. : représente le lien entre les événements et expressions temporelles. : représente l‟événement. : représente l‟expression temporelle. .t : représente une date. .e : représente un évènement. .d : représente une durée. Ainsi, les différentes règles d‟inférences conçues sont reparties comme suit : 4.1.1.2) Les règles du groupe 1 Ces règles permettent de savoir s‟il y a un ancrage temporel entre évènements. Si équivalent (<T, e1>, <H, e2>) ^ équivalent (<T, Subj (<T, e1>)>, <H, Subj (<H,e2>)>) alors : A) Règle R1 Si les différentes conditions se réunissent c‟est-à-dire :  détecter une équivalence entre les deux évènements (e1, e2)  chaque événement est relie avec la même relation TLINK avec une date e1t1 et e2t2  les dates sont égales. Nous aurons une inférence temporelle et textuelle entre les segments T et H. L‟abstraction de la règle R1 est représentée dans ce qui suit : o Si relation (<T,e1>,< T,t> ,date) ^ relation (<H,e2>, <H,t‟>,date) alors Inf(T,H)= Vraie SSi inclus(<T,t> ,<H, t‟>) v égale(<T,t> ,<H, t‟>) sinon inf(T,H)=Faux 84 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Les numéros des exemples dans le corpus de développement où les règles peuvent s‟appliquer : 8, 7, 15, 14, 18, 28, 29, 30. Cette figure représente la règle d‟inférence R1: Figure 4.20 : Règle R1 de l‟inférence temporelle Dans l‟exemple qui suit, nous allons appliquer la règle R1 sur la paire numéro 8 du corpus. 8) <pair id="9" value="TRUE" > T: since its e1: creation in 1948, Israel had faced a lot of conflict with the Arabic countries. H: Israel e2: was conceived in 1948. Puisque l‟événement e1 se déroule en 1948 et l‟événement e2 se déroule entre 1948 et puisque e2 est le synonyme de e1 alors il y a une inférence temporelle entre e1 et e2. B) Règle R2 Si les différentes conditions se réunissent c‟est-à-dire :  détecter une équivalence entre les deux évènements (e1, e2)  t1 est la date de début de l‟évènement e1, t2 est la date de fin de l‟évènement e1 et l‟événement e2 est relié a une durée e2d.  la différence entre les dates t1 et t2 est égale à la durée d. Nous aurons une inférence temporelle et textuelle entre les segments T et H. L‟abstraction de la règle R2 est représentée dans ce qui suit : o debut(<T,e1>,<T,t>,date) Si relation(<H,e2>, <H,t‟‟>,durée) ^ fin(<T,e1>,<T,t‟>,date) ^ Alors Inf(T,H)= égale(Différence (<T,t>,<T,t‟>) , <H,t‟‟>) sinon Inf(T,H)=Faux 85 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Les numéros des exemples dans le corpus de développement où les règles peuvent s‟appliquer: 4, 12. Cette figure représente la règle d‟inférence R2 : Figure 4.21 : Règle R2 de l‟inférence temporelle Dans l‟exemple qui suit, nous allons appliquer la règle R2 sur la paire numéro 4 du corpus. 4) <pair id="4" value="TRUE" > T: Pasteur began looking for the germ that causes rabies in 1880, and in july 1885 he found the efficient vaccine against the illness. H: to find the vaccine, Pasteur‟s researches took five years. Puisque l‟événement e1 se déroule au même moment que l‟évènement e2 car si nous ajoutons « 7 years» à « november the first 1954» nous serions en 1962 qui est la date où s‟est déroulé l‟évènement e2 et puisque e2 est le synonyme de e1 alors il y a une inférence temporelle entre e1 et e2. C) Règle R3 Si les différentes conditions se réunissent c‟est-à-dire :  détecter une équivalence entre les deux évènements (e1, e2)  t1 est la date de début de l‟évènement e1, événement e1 est relié a une durée e1d et t2 est la date de fin de l‟évènement e1.  la somme entre la date t1et la durée d est égale à t2. 86 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Nous aurons une inférence temporelle et textuelle entre les segments T et H. L‟abstraction de la règle R3 est représentée dans ce qui suit : o Si debut(<T,e1>,<T,t>,date) fin(<H,e2>, <H,t‟‟>,date) ^ relation(<T,e1>,<T,t‟>,durée) ^ Alors Inf(T,H)= egal(Somme(<T,t>, <T,t‟>) , <H,t‟‟>) sinon Inf(T,H)= Faux Les numéros des exemples dans le corpus de développement où les règles peuvent s‟appliquer : 3, 11. Cette figure représente la règle d‟inférence R3: Figure 4.22 : Règle R3 de l‟inférence temporelle Dans l‟exemple qui suit, nous allons appliquer la règle R3 sur la paire numéro 3 du corpus de développement. 3) <pair id="3" value="TRUE" > T: the Algerian revolution war started on november the first 1954, it caused the death of 1,5 million of martyrs and it e1: lasted 7 years. H: the Algerian revolution war e2: ended on july the fifth 1962. 87 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle L‟événement e1 se déroule au même moment que l‟événement e2 car si on ajoute « 7 years» à « november the first 1954» nous serions en 1962 qui est la date où se déroule l‟évènement e2 et puisque e2 est le synonyme de e1 alors il y a une inférence temporelle entre e1 et e2. D) Règle R4 Si les différentes conditions se réunissent c‟est-à-dire :  détecter une équivalence entre les deux évènements (e1, e2)  t1 est la date de fin de l‟évènement e1, événement e1 est relié à une durée e1d et t2 est la date de début de l‟évènement e1.  la somme entre la date t1 et la durée d est égale a t2. Nous aurons une inférence temporelle et textuelle entre les segments T et H. L‟abstraction de la règle R4 est représentée dans ce qui suit : o Si relation(<T,e1>,<T,t>,durée) ^ fin(<T,e1>,<T, t‟>,date) ^ debut(<H,e2>, <H, t‟‟>,date) Alors Inf(T, H)= égale(Différence (<T, t‟>,<T, t>),<H, t‟‟>) sinon Inf(T, H)=Faux Les numéros des exemples dans le corpus de développement où les règles peuvent s‟appliquer : 10, 20. Cette figure représente la règle d‟inférence R4: Figure 4.23: Règle R4 de l‟inférence temporelle 88 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Dans l‟exemple qui suit, nous allons appliquer la règle R4 sur la paire numéro 10 du corpus. 10) <pair id="11" value="TRUE" > T: on t1: december 2nd 1804, Napoleon Bonaparte became the emperor of the French, before d1: one year exactly, he e1: won the battle of Austerlitz. H: in t2: 1803, Napoleon e2: won the battle of Austerlitz. L‟événement e1 se déroule au même moment que l‟événement e2 car si on réduit « one year exactly » à « december 2nd 1804 » nous serions en 1803 qui est la date où se déroule l‟évènement e2 et puisque e2 est le synonyme de e1 alors il y a une inférence temporelle entre e1 et e2. E) Règle R5 Si les différentes conditions se réunissent c‟est-à-dire :  détecter une équivalence entre les deux évènements (e1, e2)  l‟événement e1 est relié avec une relation TLINK e1t2 et l‟événement e1 est relié avec la même relation TLINK à une durée e2d.  inclusion entre la date t1 et la durée d. Nous aurons une inférence temporelle et textuelle entre les segments T et H. L‟abstraction de la règle R5 est représentée dans ce qui suit : o Relation (<T, e1>, < T,t> ,date) ^ relation(<H,e2>, <H,t‟>,durée) alors Inf(T, H)= Vraie SSi inclus(<T,t> ,<H, t‟>) sinon inf(T, H)=Faux Le numéro de l‟exemple dans le corpus de développement où cette règle peut être appliquée: 1. Cette figure représente la règle d‟inférence R5: Figure 4.24 : Règle R5 de l‟inférence temporelle 89 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Application de la règle 5 sur la paire numéro 1 du corpus. 1) <pair id="1" value="TRUE" > T: the second world war e1: finished in 1945. H: the end of the second world war e2: took part between 1940 and 1950. Puisque l‟événement e1 ce déroule en 1945 et l‟événement e2 se déroule entre 1940 et 1950 et puisque e2 est le synonyme de e1 alors il y a une inférence temporelle entre e1 et e2. 4.1.1.3) Groupe 2 Cette règle permet de savoir s‟il n‟y a pas d‟ancrage temporel entre évènements. Si contraire(<T,e1> ,<H,e2>) ^ équivalent(<T ,Subj(e1)> , <T,subj(e2)>) =<H,Subj(e2)>) A) Règle R6 Si les différentes conditions se réunissent c‟est-à-dire :  détecter que l‟évènement e1 est le contraire de l‟évènement e2.  l‟événement e1 se produit soit avant ou après e2. Nous aurons une inférence temporelle et textuelle entre les segments T et H. L‟abstraction de la règle R6 est représentée dans ce qui suit : Si relation (<T, e1>, <T, t>, date) ^ relation(<H, e2>, <H, t‟>, date) Alors Inf(T, H) = Vraie SSi before(relation (<T,e1>,<T,t>, date), relation(<H, e2>, <H, t‟>, date) v after(relation (<T, e1>,<T, t>, date) , relation(<H, e2>, <H, t‟>, date) sinon inf(T, H)=Faux Les numéros des exemples dans le corpus de développement où les règles peuvent s‟appliquer : 2, 5. Cette figure représente la règle d‟inférence R6: 90 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Figure 4.25 : Règle R6 de l‟inférence temporelle Application de la règle 6 sur la paire 2 du corpus. 2) <pair id="2" value="TRUE" > T: Algeria got its e1: independence in 1962. H: Before 1962 Algeria was e2: colonized. Dans cet exemple ci-dessus, puisque l‟événement e1 se déroule en 1962 et l‟événement e2 se déroule avant l‟évènement e1 et puisque e2 est l‟antonyme de e1 alors il y a une inférence temporelle entre e1 et e2. 4.2.2) Le superviseur Ce module, accepte en entrée, les résultats du module « inférence entre événements », le résultat de « TARSQI », « les ressources » à ajouter et « les règles d‟inférences » et en sortie, il indique s‟il y une inférence textuelle ou pas. Le superviseur permet de choisir les règles d‟inférences temporelles à appliquer et de décider de l‟existence ou pas de l‟inférence textuelle. Ainsi, le superviseur applique la procédure suivante:  Si le module a comme message « pas d‟inférence » de la phase précédente c'est-à- dire du module de test d‟inférence le superviseur va afficher, « pas d‟inférence textuelle ».  Si le module a comme message « non » qui veut dire qu‟il y a une relation d‟antonymie entre les évènements le module va exécuter les règles d‟inférences temporelles qui détectent si les deux évènements ne sont pas ancrés temporellement. 91 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle  Si le module a comme message « oui » qui veut dire qu‟il y a une relation de synonymie entre les évènements, le module va exécuter les règles d‟inférences temporelles qui détectent si les événements sont ancrés temporellement. Nous représentons dans la figure suivante l‟architecture du superviseur : Fichier texte Oui Non Test d‟inférence sujets Oui entre oui Pas d‟inférence Oui Non Test d‟inférence évènements entre Oui oui Pas d‟inférence Oui Non Test d‟antonymie Oui Non Test synonymie Oui de oui Oui oui Oui Non Test règles des d‟inférences du groupe 1 Oui oui Pas d‟inférence Oui Non Oui oui règles Test des Pas d‟inférence Inférence vrai d‟inférences du groupe 2 Pas d‟inférence Inférence vrai Figure 4.26 : Architecture du superviseur 92 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Il existe des cas où plusieurs règles peuvent s‟appliquer. Pour cela, le superviseur prend les mesures suivantes :  S‟il existe une fonction qui retourne une fausse inférence temporelle, cela implique qu‟il n‟y a pas d‟inférence textuelle entre les segments T et H.  Si toutes les fonctions retournent une inférence temporelle, cela implique qu‟il y a une inférence textuelle entre les segments T et H. Oui inférence vrai Règle n°1 Inférence fausse Inférence vrai Règle n°2 Inférence fausse Inférence vrai Règle n°3 Inférence fausse Règle n°N Inférence vrai Inférence fausse Figure 4.27: Test des règles d‟inférences Comme il est montré dans la Figure 4.27 le superviseur exécute les règles du même groupe une par une. 4.4) Conclusion Nous avons présenté dans ce chapitre, notre projet TIMINF. Son architecture informatique se base sur cinq modules principaux. Les deux modules TARSQI et Link Grammar Parser constituent la phase de prétraitement indispensable à la phase de test d‟inférence, qui nous permet de détecter l‟inférence entre évènements et sujets. Le module de balisage qui est inclue dans la deuxième phase est utilisé pour baliser les expressions temporelles non détectées par TARSQI. Le superviseur est le dernier module de notre système. Celui ci communique avec une base de règle et décide des choix des règles d’inférences temporelles a appliqué. Il a aussi le rôle de tester l’inférence textuelle entre les phrases T et H d’après les données reçues de tous les composants du système. Nous allons présenter dans le chapitre qui suit les différentes étapes de la mise en oeuvre du système TIMINF ainsi qu‟une étude expérimentale. 93 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle - Chapitre 5 - La mise en oeuvre et l‟évaluation du système TIMINF 94 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Chapitre 5 La mise en oeuvre et l‟évaluation du système TIMINF 1) Introduction Dans ce chapitre nous allons expliquer l‟installation des différents outils utilisés pour aboutir à notre objectif. Nous donnons aussi un exemple de déroulement de notre système qui résume les principales spécifications de notre projet et montre comment les différents modules peuvent être mis en oeuvre dans un système de test d‟inférence textuelle intégrant l‟aspect temporel dans ses décisions. Nous finissons ce chapitre avec l‟évaluation de notre système. 2) Environnement et outils utilisés 2.1) Python Pour concevoir notre système nous avons choisi d‟utiliser le langage de programmation Python qui a fait ses preuves dans la programmation de nombres applications du TALN. Python est un langage portable, dynamique, extensible, gratuit, qui permet une approche modulaire et orientée objet de la programmation. Python est développé depuis 1989 par Guido van Rossum et de nombreux contributeurs bénévoles (Swinnen, 2005). L'interpréteur peut être lancé directement depuis la ligne de commande (dans un « shell » Linux, ou bien dans une fenêtre DOS sous Windows) : il suffit d'y taper la commande "python" (en supposant que le logiciel lui-même ait été correctement installé). Nous utilisons une interface graphique telle que Windows. Pour cela nous avons préféré travailler dans un environnement de travail spécialisé tel que IDLE. Avec IDLE sous Windows, notre environnement de travail ressemblera à celui-ci : Les trois caractères « supérieur à » constituent le signal d'invité, ou prompt principal, lequel indique que Python est prêt à exécuter une commande. Figure 5.1 : Shell python 95 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Pour rédiger nos séquences d'instructions nous avons utilisé l'éditeur incorporé dans une interface de développement telle que IDLE). Il serait parfaitement possible d'utiliser un système de traitement de textes, à la condition d'effectuer la sauvegarde sous un format "texte pur" (sans balises de mise en page). Il est cependant préférable d'utiliser un véritable éditeur ANSI "intelligent" tel que nedit ou IDLE, muni d'une fonction de coloration syntaxique pour Python, qui aide à éviter les fautes de syntaxe. La figure ci-dessous illustre l'utilisation de l'éditeur IDLE). Sous (windows) : Figure 5.2 : Comment exécuter un programme Par la suite, pour tester l'exécution de notre programme, il nous suffit de lancer l'interpréteur Python en lui fournissant (comme argument) le nom du fichier qui contient le script. Par exemple, si nous avons placé un script dans un fichier nommé « MonScript », il suffira d'entrer la commande suivante dans une fenêtre de terminal pour que ce script s'exécute : python MonScript Dans l'explorateur Windows, nous pouvons lancer l'exécution de notre script en effectuant un simple clic de souris sur l'icône correspondante ou dans IDLE, en lançant l'exécution du script en cours d'édition, directement à l'aide de la combinaison de touches <Ctrl-F5>. 2.2) TARSQI Nous décrivons dans ce qui suit le processus d‟installation de TARSQI dans un environnement Linux puisqu‟il n'existe pas actuellement une version Windows de TARSQI. Toutefois, le code est écrit pour être multiplateforme. Le groupe TIMEML travaille actuellement sur une version de TARSQI adapté pour Windows qui sera publiée dès que possible. 2.2.1) L‟installation La boîte à outils requiert au moins la version 2,3 de Python et la version 5,8 de Perl. La boîte à outils a été testée sur les plates-formes suivantes: Red Hat Linux 5, avec Python 2.4.3 et Perl 5.8.8 Mac OS X, avec Python 2.3.5 et Perl 5.8.8 96 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Pour installer TARSQI, nous avons d‟abord téléchargé et décompresser l'archive dans un répertoire et, taper dans l‟invité de commande ce qui suit : % Gunzip-c TTK-1.0.tar.gz tar xp Cette commande permet de décompresser le contenu dans un répertoire nommé TTK-1,0, qui est un répertoire choisi par nous. La boîte à outils TARSQI est conçue pour fonctionner de façon transparente avec le SGI TreeTagger. Le TreeTagger doit être installé dans ttk-1.0/code/components/preprocessing/treetagger/ Ce répertoire doit avoir des sous-répertoires bin et lib. 2.2.2) L‟utilisation de la boite à outils TARSQI Pour exécuter l'outil TARSQI, nous devons ouvrir un terminal, aller au répertoire où se trouve le fichier tarsqi.py et taper : python tarsqi.py <input_type> [drapeaux] <infile> <outfile> <input_type>: Il existe deux formats d‟entrée de TARSQI : simple-xml et rte3. [drapeaux]: Avec les drapeaux nous pouvons exécuter un seul ou plusieurs module de TARSQI où l‟ordre des modules est important. En voici un exemple: [drapeaux]= L‟exemple montre une demande d‟exécution des 3 premiers modules de TARSQI. préprocesseur, GUTIME, EVITA 2.2.3) L‟utilisation de la boite à outils d‟interface graphique La Boîte à outils d'interface graphique peut être utilisée en tapant : % Pythonw gui.py L'interface graphique a trois avantages sur l'utilisation de la version en ligne de commande:  Il est plus rapide lors de l'utilisation sur un fichier par fichier, parce que toutes les bibliothèques sont chargées soit au démarrage ou lorsque le premier fichier est traité.  Il est plus facile à utiliser.  Il permet à l'utilisateur de taper certains points d'entrée et voir ce qui se passe. Le principal inconvénient est qu'il n'est pas possible de traiter tous les fichiers dans un répertoire. Voici une capture d'écran: 97 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Figure 5.3 : Capture d‟écran de l‟interface TARSQI Les fonctionnalités peuvent être résumées comme suit:    Utilisez "Chargez le fichier" pour sélectionner un fichier à traiter. Utilisez "Texte de charge" à saisir du texte. Cette opération va créer un fichier dans le dossier data / en / répertoire utilisateur, qui est ensuite sélectionné comme fichier d'entrée. Utilisez « Processus de dossier » pour traiter le fichier d'entrée conformes aux paramètres sélectionnés. 2.3) Link Parseur L’installation de ce module n’est pas difficile, puisque après avoir téléchargé le système de puis le lien suivant (http://www.abisource.org/projects/link-grammar/), nous avons décompressé le contenu dans un répertoire de notre choix. Il suffit d’un click sur l’exécutable contenu dans le répertoire. 98 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Figure 5.4 : Capture d‟écran de l‟interface de link parser Il suffit d’écrire le texte que nous voulons analyser et nous aurons l’analyse syntaxique. 2.4) PyWordNet Dans notre module nous avons choisi d‟utiliser une version de WordNet qui correspond au choix de notre langage de programmation. En effet, PyWordNet est une interface Python pour la base de données WordNet qui permet avec des fonctions du langage python de consulter la base de données WordNet. Exemple : Si nous tapons l‟expression suivante dans l‟invité de commande python : >>> N['dog'] dog(n.) >>> N['dog'].getSenses() Nous interrogeons la base de données sur les différents sens du mot « dog ». {'dog' in {noun: dog, domestic dog, Canis familiaris} 2.4.1) L‟installation Pour installer Pywordnet, il nous a fallu d‟abord Télécharger et installer WordNet de 2.0 qui est disponible sur le site http://www.cogsci.princeton.edu/ wn ~ /. Aussi nous avons téléchargé PyWordNet de http://sourceforge.net/projects/pywordnet et décompresser dans le répertoire. Ensuite avec l‟invité de commande nous accédons au répertoire contenant les fichiers décompressés et nous tapons python setup.py. Cette commande va permettre concrètement d‟installer les deux bibliothèques nécessaires au bon fonctionnement du système. Les deux bibliothèques sont respectivement wordnet.py contient la base de données et wntools.py contient les fonctions qui permettent de consulter la base de données. 99 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle 2.4.2) L‟utilisation de PyWordNet dans notre système Pour savoir si les mots sont antonyme ou synonymie, qui est l‟objet du module inférence entre sujet et événement, nous avons utilisé la fonction meet (mot1, mot2, Synonymie) de la bibliothèque PyWordNet qui permet de donner vrai s‟il y a une synonymie entre les deux. La même chose pour l‟antonyme mot et meet (mot1, mot2, antonymie) qui permet de donner vrai si „il y a une antonymie entre les deux mots. Cette figure représente la fonction qui détecte s‟il y a une antonymie entre deux mots programmés en Python : Figure 5.5 : La fonction d‟interfaçage avec WordNet Dans ce qui suit nous allons illustrer nos travaux avec le déroulement d‟un exemple du corpus sur notre système. Nous allons citer les différentes phases de traitement de la paire de textes. 100 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle 3) Exemple d‟exécution du TIMINF sur un exemple du corpus Nous avons choisi pour l‟exemple, la paire numéro 8 du corpus de développement. Comme il est montré dans l‟exemple ci-dessous la première étape est de transformer le texte brut en format simple-xml, pour cela nous avons balisé manuellement les paires du corpus. Figure 4.6 : Entré simple-xml 3.1) TARSQI Le module TARSQI va permettre de détecter les deux événements de la paire de deux textes (T,H) qui correspondent dans l‟exemple au verbe collapsed qui est l‟évènement des deux segments de textes. La commande qui permet d‟enclencher le module TARSQI avec le format simpel-xml dans un environnement UNIX c‟est : python tarsqi.py simple-xml (le nom du fichier contenant les deux segments de textes) (le nom du fichier de sortie). Ci-dessous nous montrons la sortie TARSQI correspondant à l‟exemple : 101 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Figure 5.7 : Sortie TARSQI 3.2) L‟analyse syntaxique L‟analyse syntaxique se fait en parallèle avec TARSQI et elle va permettre de détecter les sujets des deux segments de textes, qui correspond dans l‟exemple à the building. Ci-dessous nous montrons la sortie de LINK Parseur correspondante à l‟exemple : Figure 5.8: Sortie de l‟analyseur syntaxique 102 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle 3.3) L‟inférence entre sujets et événements Comme il est montré dans l‟exemple ci-dessous le module de test d‟inférence entre sujets et évènements va permettre de détecter l‟équivalence entre les deux sujets et les deux évènements des segments T et H. Figure 5.9 : Inférence entre sujets et évènements 3.4) Le balisages des expressions temporelles non détectées par TARSQI Comme il est montré dans l‟exemple ci-dessous, le balisage des expressions temporelles va permettre de positionner l‟expression temporelle dans le temps. Dans l‟exemple il détermine que the afternoon c‟est l‟intervalle temporel entre midi et 18 heures. Figure 5.10: Balisages des expressions temporelles 3.5) Le superviseur L‟équivalence entre les sujets et les évènements est détectée par la phase d‟inférence textuelle et d‟ancrage entre les expressions temporelles (2 o‟clock et the afternoon) est détecté par l‟application de la régle R5 de la base de règles d‟inférences qui stipu le que si les différentes conditions se réunissent c‟est-à-dire :  détecter une équivalence entre les deux évènements (e1, e2) 103 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle  l‟événement e1 est relié avec une relation TLINK e1t2 et l‟événement e1 est relié avec la même relation TLINK à une durée e2d.  inclusion entre la date t1 et la durée d. Nous aurons une inférence temporelle et textuelle entre les segments T et H. Des deux résultats précédents le superviseur décide qu‟il y a une inférence textuelle entre les segments T et H. Figure 5.11 : Test d‟inférences Cette figure représente les différentes conditions nécessaires à une inférence textuelle. 4) L‟évaluation de notre système Notre objectif consiste à améliorer les systèmes d‟inférences textuelles. Dans ce cadre, nous avons choisi d‟évaluer notre système d‟inférence avec le système d‟évaluation adopté par le challenge RTE. Pour cela, nous devons évaluer le système par rapport au corpus de développement et aussi par rapport au corpus de test. Chaque paire du corpus est lancée dans notre système qui donne en sortie s‟il y a une inférence textuelle ou pas. Les résultats sont comparés au « GOLD standard » que nous avons établi dans notre étape de conception du corpus. Le pourcentage donnant le nombre de fois où il y a similitude entre notre système et le « gold standard » donne « l‟accuracy » du système. l‟accuracy est une mesure standard fréquemment utilisée dans les systèmes de traitements du langage naturel. Dans ce qui suit, nous allons présenter les résultats préliminaires des évaluations des deux corpus. 4.1) L‟évaluation du système sur le corpus de développement Nous avons élaboré notre système d‟après l‟étude des inférences existantes dans le corpus de développement. Ce corpus nous a permis de tester notre système plusieurs fois en effectuant à chaque fois des modifications jusqu'à ce qu‟on arrive à concevoir un système qui a donné 100% d‟accuracy par rapport à ce corpus. 104 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle 4.2) L‟évaluation du système avec le corpus de test Le corpus de test est constitué de 30 paires de textes, 15 d‟entres elles sont évaluées comme contenant une inférence textuelle fausse et les autres sont évalués comme vrai. Nous avons soumis ce corpus a notre système qui nous a permis de calculer l‟accuracy. Les résultats d‟accuracy sont montrés dans le tableau suivant : Les systémes L‟accuracy Système 58 % Tableau 2.1 : Le tableau représente l‟accuracy du système Les résultats de l‟évaluation sont encouragent puisque nos résultats sont plus élevés que la moyenne de l‟accuracy des systèmes participants au RTE 2 qui sont de 56.6 %. Dans ce qui suit nous allons étudier les causes de défaillance de notre système. 4.4) L‟analyse des erreurs causées par le système D‟après notre étude des résultats donnés par notre système nous avons pu élaborer un t ableau contenant des statistiques concernant les causes d‟échecs de notre système. Problème Pourcentage d‟erreur dans corpus le Analyse syntaxique 38 % TARSQI 62 % Tableau 3.2 : les causes d‟erreurs du système Nous remarquons dans ce tableau que les majeures parties des erreurs commises par notre système sont en générale causé par la déficience de l‟outil TARSQI. En effet, TARSQI ne détecte pas plusieurs choses. Par exemple, au niveau de la détection des évènements où nous avons remarqué que TARSQI ne détecte pas les verbes composés comme un événement mais plutôt comme deux évènements indépendants. Exemple: paire numéro 1 du corpus de test. T: the First World War spent 7 years. 105 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle H: World War I, also known as the First World War, the Great War and the War To End All Wars, was a global military conflict which took place primarily in Europe from 1914 to 1918. Dans l‟exemple la détection de l‟événement took place par TARSQI n‟a pas pu se faire car took place est un verbe composé. Aussi les erreurs de notre système viennent de l‟analyse syntaxique effectuer en pré traitement par link parser où les sujets des verbes ne sont pas détectés. Exemple: paire numéro 10 du corpus de test. T: Protracted military S1: conflict between Iran and Iraq. It officially began on t1: Sept. 22, 1980, finally, in July, 1988, Iran was forced to accept a United Nations–mandated cease-fire. H: With more than 100000 Iranian victims of Iraq's chemical weapons during the ten-year war, Iran is one of the countries most severely afflicted by weapons. Dans l‟exemple précédant, la relation entre la date t1 et le sujet S1 n‟est pas détecté par TARSQI puisque l‟analyse syntaxique n‟a pas pu auparavant relier entre conflict et it. 5) Conclusion Nous avons présenté dans ce chapitre le processus d‟installation de nos différents outils nécessaires au bon fonctionnement de notre système. Nous avons également présenté le déroulement de notre système sur un exemple du corpus qui a permis de montrer comment les différents modules étaient mis en oeuvre dans notre système. Enfin, nous avons donné les performances de notre système qui étaient encourageantes et nous avons étudié les différentes failles de notre système. Cela a permis de monter que l‟inférence temporelle à un besoin inéluctable aux d‟autres modules d‟inférences. 106 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Conclusion générale et perspective Nous avons présenté, tout au long de ce manuscrit, notre démarche pour la conception d‟un système d‟inférence textuelle considérant l‟inférence temporelle dans sa décision. Pour cela nous avons d‟abord exploré l‟apport du RTE dans les différentes applications du TAL (RI, QR, EI et RA) et étudié les différentes approches utilisées pour détecter l‟inférence (lexical, lexico syntaxique, sémantique et logique). Puis nous avons analysé les approches des différents groupes de recherches qui ont participé aux trois challenges Pascal RTE. Cette étape nous a permis de découvrir les chemins qui n‟ont pas encore été étudiés pour détecter l‟inférence textuelle. Ensuite, nous avons exploré la logique temporelle, ses applications dans le traitement du langage nature et les différents types d‟inférences temporelles existantes . Cette étude nous a permis de constater qu‟il n‟y a pas de travail à nos jours liant l‟inférence temporelle et la reconnaissance de l‟inférence temporelle. Nous avons élaboré un corpus contenant des paires de segments de textes integrant des relations temporelles et nous avons fait une classification des différents types d‟inférences temporelles existants dans le corpus. La suite logique de ce travail est de déduire des régles d‟inférences temporelles et les intégrer à un systéme de reconnaissance d‟inférence texuelle. Une fois le systéme concu, nous avons évalué ses performances avec la méme stategie d‟evaluation adoptée dans le challenge pascal RTE. Cette evaluation nous a donné des résultats encourageants. Enfin, nous avons étudié les différentes failles de notre système. Cela a permis de prévoir plusieurs perspectives de recherches. Contribution Etant donné les objectifs que nous nous sommes fixés pour ce projet, les principales contributions de TIMINF peuvent être résumées comme suit : L‟élaboration d‟un corpus à base d‟inférence temporelle permettra d‟évaluer les recherches futures dans ce Domaine. L‟étude du corpus nous a permis de classifier différents types d‟inférence temporelle et de développer différentes règles d‟inférences temporelles. Aussi l‟évaluation de notre système a permis de voir concrètement quel est l‟apport de l‟aspect temporel dans le RTE. 107 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Perspectives et travaux futurs Nous envisageons de poursuivre nos recherches futures dans trois directions principales. Notre système ne permet pas de détecter les entités nommées et de gérer les anaphores. Pour cela, nous envisageons d‟introduire un module permettant de détecter et de dater les entités nommées automatiquement. Aussi nous pensons à intégrer un module pour gérer les anaphores et étudier l‟impacte de celui-ci sur la performance de notre système. La seconde direction scientifique est d‟évaluer le système prédicat argument comme prétraitement au lieu d‟une simple analyse syntaxique. Enfin, nous envisageons également de développer un système pouvant tester l‟inférence textuelle dans des segments de textes plus grandes et utiliser un système qui utilise comme réponse trois sorties possibles (inférence vrai, inférence Fausse ou on ne c‟est pas s‟il y a une inférence) et nous associons chaque inférence vraie à une application du TALN (QR, RI, IE, PP…). 108 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle Références (Baker, Fillmore et Lowe, 1998) Baker, Charles J. Fillmore, and John B. Lowe. 1998. The berkeley framenet project. In Proceedings of the COLING-ACL, Montreal. (Bras, 1990) Myriam Bras. Calcul des Structures Temporelles du Discours. PhD thesis, IRIT, 1990. (Benveniste, 1974) Benveniste Emile Problèmes de linguistique générale. Paris, Gallimard, vol. II. (Bourigault, 2000) BOURIGAULT D. Recent Advances in Computational Terminology, 2000. (Bourigault et al., 2004) BOURIGAULT D. AUSSENAC-GILLES N. et CHARLET J. (2004). Construction de ressources terminologiques ou ontologiques à partir de textes : un cadre unificateur pour trois études de cas, Revue d'Intelligence Artificielle, 18(4), 24 pp. (Charolles, 1997) Charolles M. « L‟encadrement du discours – univers, champs, domaines et espaces », Cahier derecherche linguistique, 6, p. 1-73. 1997. (Chaumartin, 2007) Francois-Regis chaumartin, wordnet et son ecosysteme, BDL-CA,2007, montreal. (Cohen, 1960) Cohen J. : “A coefficient of agreement for nominal scales”, Educ. Psychol. Meas.: 20, 27-46. 1960 (Dagan et al, 2005) Textual inference problems from the PASCAL RTE. Challenge, 2005. (Len Schubert, 2002) Len Schubert. Can we derive general Word Knowledge from Texts ?. 2002. (Helmut Schmid, 1994) Part-of-Speech Tagging with Neural Networks. Proceedings of the 15th International Conference on Computational Linguistics (COLING-94). August 1994. (Joachims, 2003) T. Joachims, Information Retrieval and Language Technology (pdf), 2003, Cornell University. (Kosseim., 2005). Leila Kosseim, Extraction d'information bilingue, 2005. (Ligauzat , 1994) Gérard Ligauzat. Représentation des connaissances et linguistique. Armand Colin, Paris, 1994. (Lin et Pantel, 2001) DeKang Lin and Patrick Pantel. 2001. Discovery of inference rules for Question Answering. Natural Language Engineering. (Laurain et Marie, 2006) La traduction automatique. France. Septentrion Presses Universitaire, 1996. p. 15-16. 109 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle (Macleod et al., 1998) C.Macleod, R.Grishman, A.Meyers, L.Barrett and R. Reeves. 1998. Nomex : A lexicom of normalisations.in Proceedings of 8 the International Congress of the European association for lexicography.1998. liege, begium : EURALEX. (Mani et Wilson, 2000) Mani and George Wilson. 2000. Processingof News. In Proceedings of the 38th Annual Meetingof the Association for Computational Linguistics(ACL2000), pages 69–76. (Moldovan et Rus, 2001) Dan I. Moldovan and Vasile Rus. 2001. Logic form transformation of wordnet and its applicability to question answering. In Meeting of the Association for Computational Linguistics, pages 394-401. (Moldovan and Rus, 2001). Moldovan and Rus Logic Forms can be utilized by a wide variety.2001. (Miller, 1995) P. Miller. 1995. "Notes on phonology and orthography in several Katuic Mon- Khmer groups in Northeast Thailand."‭ Mon-Khmer Studies 24: 27-51. (Nugues, 2006) Pierre Nugues. An Introduction to Language Processing with Perl and Prolog. Springer Verlag, 2006. (Nyberg et al, 2002) E. Nyberg, T.Mitamura, J. Carbonnell, J. Callan, K. Cllins-Thompson, K Czuba, M. Duggan, L. Hiyakumoto, N. Hu, Y. huang, J. Ko, L.V. Lita, S.Muratagh et V. Pedro. The JAVELIN Question-Ansewering System at TREC 2002. In Proceding of the 11th Text Retrieval conference (TREC-11), 2002. (Pustejovsky et al., 2003) Paul Kiparsky and Carol Kiparsky. InManfred Bierwisch and Karl Erich Heidolph, editors, Progress in Linguistics. A collection of Papers, pages143–173. Mouton, Paris. (Rodrigo et al., 2007) A. Rodrigo, A. Penas, J. Herrera and F. Verdejo..The Effect of Entity Recognition on Answer Validation.In Lecture Notes in Computer Science. In press 2007. (Sleator et Temperley, 1991) Daniel Sleator and Davy Temperley. 1991. Parsing English with a Link Grammar. Carnegie Mellon University Computer Science technical report CMU-CS- 91-196, October 1991. (Swinnen, 2005) Gérard Swinnen Apprendre à programmer avec Python, Copyright 2005. (Tatu et Moldovan,2007) Marta Tatu and Dan Moldovan. 2007 COGEX at the third recognising of textual entailement challenge. In proceeding of the wokshop on textual entailment, prague, June 2007. (Tatu et al., 2006) Marta Tatu, B Iles, J. Slavick, A. Novischi, and D. Moldovan. 2006, COGEX at the third recognising of textual entailement challenge. In proceeding of the wokshop on textual entailment,Venice, Italy. (vanderwende et al., 2005) Lucy vanderwende, deborah coughlin and bill dolan. 2005.what syntax contribute in entailment task. In proccedings of pascalchallange wo rkshop on recogning texual entailment,2005 . 110 Rôle de l’inférence temporel dans la reconnaissance de l’inférence textuelle (Venhagen et al., 2005) M. Venhagen, I. Mani , R. Sauri, R. Knippen, J .Littman and J. Pustejovsky. 2005. Automating Tenporal Annotation With TARSQI. In Proceedings of ACL 2005. demo session. (WOS, 1998) L. WOS. Automated Reasoning -33 Basic Research Problems. Prentice-Hall. (Yvon, 2007) François Yvon . Une petite introduction au Traitement Automatique des Langues Naturelles, 2007. 111
1604.06635
1
1604
2016-04-22T12:51:11
Bridging LSTM Architecture and the Neural Dynamics during Reading
[ "cs.CL", "cs.AI", "cs.LG", "cs.NE" ]
Recently, the long short-term memory neural network (LSTM) has attracted wide interest due to its success in many tasks. LSTM architecture consists of a memory cell and three gates, which looks similar to the neuronal networks in the brain. However, there still lacks the evidence of the cognitive plausibility of LSTM architecture as well as its working mechanism. In this paper, we study the cognitive plausibility of LSTM by aligning its internal architecture with the brain activity observed via fMRI when the subjects read a story. Experiment results show that the artificial memory vector in LSTM can accurately predict the observed sequential brain activities, indicating the correlation between LSTM architecture and the cognitive process of story reading.
cs.CL
cs
Bridging LSTM Architecture and the Neural Dynamics during Reading Peng Qian Xipeng Qiu∗ Xuanjing Huang Shanghai Key Laboratory of Intelligent Information Processing, Fudan University School of Computer Science, Fudan University 825 Zhangheng Road, Shanghai, China {pqian11, xpqiu, xjhuang}@fudan.edu.cn 6 1 0 2 r p A 2 2 ] L C . s c [ 1 v 5 3 6 6 0 . 4 0 6 1 : v i X r a Abstract Recently, the long short-term memory neural net- work (LSTM) has attracted wide interest due to its success in many tasks. LSTM architecture consists of a memory cell and three gates, which looks sim- ilar to the neuronal networks in the brain. However, there still lacks the evidence of the cognitive plausi- bility of LSTM architecture as well as its working mechanism. In this paper, we study the cognitive plausibility of LSTM by aligning its internal archi- tecture with the brain activity observed via fMRI when the subjects read a story. Experiment results show that the artificial memory vector in LSTM can accurately predict the observed sequential brain ac- tivities, indicating the correlation between LSTM architecture and the cognitive process of story read- ing. 1 Introduction In recent years, biologically-inspired artificial neural net- works have become a focused topic in the field of computer science [Hinton and Salakhutdinov, 2006; Bengio, 2009; Schmidhuber, 2015]. Among the various network archi- tectures, long short-term memory neural network (LSTM) [Hochreiter and Schmidhuber, 1997] has attracted recent in- terest and gives state-of-the-art results in many tasks, such as time series prediction, adaptive robotics and control, con- nected handwriting recognition, image classification, speech recognition, machine translation, and other sequence learning problems [Schmidhuber, 2015]. LSTM is an extension of the simple recurrent neural network (RNN). It employs three gate vectors to filter information and a memory vector to store the history information. This mechanism can help encode long- term information better than simple RNN. Despite the biolog- ical inspiration of the architecture desgin of LSTM [O'Reilly and Frank, 2006] and some efforts in understanding LSTM memory cell [Karpathy et al., 2015], there still lacks the ev- idence of the cognitive plausibility of LSTM architecture as well as its working mechanism. In this paper, we relate LSTM struture with the brain ac- tivities during the process of reading a story. In parallel with ∗Corresponding author. the fMRI experiment [Wehbe et al., 2014a], we train a LSTM neural network and use it to generate the sequential represen- tation of the same story. By looking for the potential align- ment between the representations produced by LSTM and the neural activities recorded by fMRI at the same time, we are able to explore the cognitive plausibility of LSTM architec- ture per se. Although some previous works [Mitchell et al., 2008; Pereira et al., 2011; Pereira et al., 2013; Schwartz et al., 2013; Devereux et al., 2010; Murphy et al., 2012] have tried to use computational models to decode the human brain activity as- sociated with the meaning of words, most of them focused on the isolate words. Recently, [Wehbe et al., 2014b] studied the alignment between the latent vectors used by neural net- works and brain activity observed via Magnetoencephalog- raphy (MEG) when subjects read a story. Their work just focused on the alignment between the word-by-word vectors produced by the neural networks and the word-by-word neu- ral activity recorded by MEG. Our main contributions can be summarized as follows. First, we show that it might be possible to use brain data to un- derstand, interpret, and illustrate what is being encoded in the LSTM architecture, by drawing parallels between the model components and the brain processes; Second, we perform an empirical study on the gating mechanisms and demonstrate the superior power of the gates except the forget gates. 2 Long Short-Term Memory Neural Network A recurrent neural network (RNN) [Elman, 1990] is able to process a sequence of arbitrary length by recursively applying a transition function to its internal hidden state vector ht of the input sequence. The activation of the hidden state ht at time-step t is computed as a function f of the current input symbol xt and the previous hidden state ht−1 (cid:26)0 ht = f (ht−1, xt) otherwise t = 0 (1) In a classic recurrent neural network, the gradient may blow up or decay exponentially over the time. Therefore, LSTM was proposed in [Hochreiter and Schmidhuber, 1997] as a solution to the vanishing gradient problem. The basic unit of LSTM consists of three gates and a memory cell, which is designed in analogy to the psychological foundation of the Figure 1: The paradigm of brain-LSTM mapping experiment. human memory. A number of minor modifications to the standard LSTM unit have been made. While there are nu- merous LSTM variants, here we describe the implementation used by [Graves, 2013]. LSTM unit has a memory cell and three gates: input gate, output gate and forget gate. Intuitively, at time step t, the input gate it controls how much each unit is updated, the out- put gate ot controls the exposure of the internal memory state, and the forget gate ft controls the amount of which each unit of the memory cell is erased. The memory cell ct keeps the useful history information which will be used for the next process. Mathematically, the states of LSTM are updated as fol- lows: (2) it = σ(Wxixt + Whiht−1 + Wcict−1 + bi), (3) ft = σ(Wxf xt + Whf ht−1 + Wcf ct−1 + bf ), ct = ft (cid:12) ct−1 + it (cid:12) tanh(Wxcxt + Whcht−1 + bc), (4) (5) ot = σ(Wxoxt + Whoht−1 + Wcoct−1 + bo), ht = ot (cid:12) tanh(ct), (6) where xt is the input vector at the current time step, σ de- notes the logistic sigmoid function and (cid:12) denotes element- wise multiplication. Note that Wci, Wcf and Wco are diago- nal matrices. When we use LSTM to model the linguistic input, such as sentences and documents, the first step is to represent the symbolic data into distributed vectors, also called embed- dings [Bengio et al., 2003; Collobert and Weston, 2008]. For- mally, we use a lookup table to map each word as a real- valued vector. All the unseen words are regarded by a special symbol and further mapped to the same vector. 3 Methodology Due to the complexity of LSTM, it is not always clear how to assess and compare its performances as they might be useful for one task and not the other. It is also not easy to interpret its dense distributed representations. In order to explore the correlation between the LSTM architecture and human cognitive process, we employ the paradigm of mapping the artificial representation of the lin- guistic stimuli with the real observed neural activity, as is explained in Figure 1. One one hand, stimulated by a se- ries of linguistic input, the neural response can be measured by the brain imaging techniques (e.g. EEG, fMRI, etc.). On the other hand, given the same series of the linguistic stimuli as the input information, an artificial model (e.g. recurrent neural network) also generates an abstract, continuous vec- tor representation in correspondence with the real-time brain state. What would be attractive to us is whether there ex- ists any linear mapping relationship between the model-based representation and the brain activity. This would guide us to a Figure 2: An explanation of the analogy and alignment be- tween LSTM mechanism and the process of reading a story chapter. new direction of depicting the mechanism of model, specifi- cally LSTM architecture in this paper. Figure 2 illustrates our experimental design. In this section, we first briefly introduce the brain imaging data, and then we describe our experiment design. 3.1 Brain Imaging Data The brain imaging data is originally acquired in [Wehbe et al., 2014a], which recorded the brain activities of 8 subjects when they read the ninth chapter from the famous novel, Harry Porter and the Philosopher's Stone [Rowling, 1997]. The chapter had been segmented to words so that they can be pre- sented to the subject at the center of the screen one by one, staying for 0.5 seconds each. Since the chapter is quite long and complicated, the whole chapter was divided into four sec- tions. Subjects had short breaks between the presentation of the different sections. Each section started with a fixation pe- riod of about 20 seconds, during which the subjects stared at a cross in the middle of the screen. The total length of the four sections was about 45 minutes. About 5180 words were presented to each subject in the story reading task. The brain activity data is collected by the functional Mag- netic Resonance Imaging (fMRI), a popular brain imaging technique used in the cognitive neuroscience research. As fMRI displays poor temporal resolution, the brain activity is acquired every 2 seconds, namely every 4 words. Details of the data acquisition can be referred to [Wehbe et al., 2014a]. Of course, there are two potential limitations with fMRI. One is the low temporal resolution, compared with EEG. The other is that fMRI BOLD (Blood Oxygenation Level Depen- Sequential linguistic stimuliDynamic neural activityDense vector representationDecodable ?InstrumentModelThe time line of reading the ninth chapter of Harry Potter for about 45 minutes in totalendwithhimnarrowly···0.5s0.5s0.5s0.5sw(t-3)w(t-2)w(t-1)w(t)LSTMLSTMLSTMLSTM······tanhtanhCh(t)w(t)σf(t)c(t-1)c(t-1)i(t)o(t)c(t-1)c(t-1)σσInputOutputForgetLSTM Unit······Predict ?Predict ?···BOLD ValueRegion of brainfMRI image of the brain at time (t)···Linguistic stimuli input for generating the representation of the reading state at time (t) narrowly148end with him narrowlythat always seemed to end with him narrowlyDoc-wise10020040080016Linguistic stimuliWindowSize······h(t-1)w(t)h(t-1)w(t)h(t-1)c(t)w(t)h(t-1)h(t-3)h(t-2)h(t-1)h(t-4)harry had never believed ··· stories that always seemed to end with him narrowly dent) signal is an indirect measurement of the neural activ- ities. However, its high spatial resolution and non-invasive characteristic have made it a successful tool in cognitive neu- roscience, especially for human subjects. Thus, we think that it is appropriate to measure the neural dynamics with fMRI, since it has been widely accepted by the academic commu- nity. In Figure 2, we summarize the basic information about the experiment setting of the story reading task. Taking one time step t of the whole story time line as an example, the previ- ous 4 words 'end' (w(t−3)), 'with' (w(t−2)), 'him' (w(t−1)), 'narrowly' (w(t)) appeared on the screen one by one. The BOLD signal was recorded by the brain imaging machine af- ter the presentation of these 4 words. Similar arrangements are carried over the other part of the reading process. We preprocess the fMRI data before training the model to remove noise from the raw data as much as possible. We compute the default brain activity ¯y by selecting the fMRI recording of the default state and averaging these fMRI data. Then we subtract other observed brain activity with the de- fault brain activity ¯y. The new fMRI data of each time step are used in the experiments. 3.2 Alignment LSTM has two key hidden vector representations to keep the history information and be used in the next time step: (1) a memory vector ct that summarizes the history of the previous words; and (2) the hidden state vector ht that is used to predict the probability of the incoming word. Under the paradigm of the brain-LSTM mapping experi- ment, the brain activity at the t-th time step of the story read- ing process can be viewed as a vector y(t) in the continu- ous high-dimensional space. Each dimension of y(t) reflects the measured value of the BOLD signal of a certain tiny area (about 3× 3× 3mm3) in the brain, which is also called voxel (VOlumeric piXEL). Mathematically, at the t-th time step, we use vector a(t) to represent the activations of internal neurons in LSTM. In this paper, a(t) may be memory vector ct and hidden state vector ht. To align the activation a(t) of LSTM and brain activity y(t) at the same time step t, we define a function to predict the brain activity y(t) from a(t). In this paper, we use linear function (7) where M is the mapping matrix between a(t) and y(t), which is learnt by the least square error. y(t) = M a(t), T(cid:88) t=1 where A = [a(1),··· , a(T )] and Y = [y(1),··· , y(T )]. predict the brain activities. The reasons lie in two points. Here, we do not train a LSTM neural network to directly First, the dimension of the fMRI signal varies among dif- ferent subjects. Therefore, it is not convenient to design a M∗ = arg min M (cid:107)y(t) − y(t)(cid:107)2. The matrix M∗ is analytically solved as: M∗ = (AT A)−1AT Y, (8) (9) 1 0.8 0.6 0.4 y t i r a l i m i S S1 S2 S3 S4 S5 S6 S7 S8 Random (horizontal) 4 400 Test window size doc-wise Figure 3: The performance of mapping LSTM memory cell vector to the brain imaging data over different subjects. LSTM model is trained on 8-word window size training data. universal neural network architecture for generating outputs of different dimensions. Second, the goal of this research is not to improve the per- formance of predicting fMRI signal with LSTM neural net- work. We just wish to explore the characteristic of the artifi- cial memory vector and the hidden state in the LSTM archi- tecture, as the work on correlating the performance-optimized deep neural network models with the neural activities in the visual cortex [Yamins et al., 2014]. Therefore, we try to avoid any possible supervision from the fMRI data when training LSTM language model. 3.3 Evaluation Metric Regarding the evaluation metric, we evaluate the model by computing the average cosine distance between the predicted functional brain image and the true observed brain activity at a certain time step of the story reading process. For each activations a(t) of LSTM at the time step t in the test cases, we compute the predicted brain activity y(t). Then we cal- culate the cosine distance between y(t) and y(t). Since the cosine distance lies between -1 and 1, we normalise the co- sine distance into [0,1] and use it as the accuracy of each test case. We train the linear map model over about 95% of the brain imaging data and test the model over the remaining 5%. We apply 20-folds cross-validation in order to get the average performance of the model. 4 Experiment In our experiments, the dimensionality of word embeddings is set to 50, the hidden state size is also set to 50, and the initial learning rate is set to 0.1. The other parameters are initialized by randomly sampling from uniform distribution in [-0.1, 0.1], based on the experience with recurrent neural network. LSTM is trained according to the procedure of the neural language model [Mikolov et al., 2010], which predicts the in- coming word given the history context. Since only one chap- ter of Harry Porter and the Philosopher's Stone is involved in the original story reading experiment, the remaining chapters of the book is used as the training data. Our results report the averaged accuracies over 8 subject under the same experimental conditions. To show the feasi- bility of this averaging, we show the mean accuracy of LSTM 0.8 0.6 y t i r a l i m i S 0.4 1 4 8 TrainWindowSize 16 sent-wise148 (a) The result of c(t) 800 doc-wise Size 400 100 200 Test W indo w 16 0.6 0.5 y t r i a l i m i S 1 4 8 TrainWindowSize 16 sent-wise148 800 doc-wise Size 400 100 200 Test W indo w 16 (b) The result of h(t) Figure 4: The similarity between the real brain activities and the ones predicted by (a) the memory vector c(t) and (b) the hidden state vector h(t) of LSTM under different model configurations. The x-axis of each sub-figure represents the window size of the training data. The y-axis of each sub-figure represents the window size of the test data. memory vector with three different experimental settings over eight subjects in Figure 1. We can see that there is not much between-subject variance. Therefore, each data point in Fig- ure 4 is computed by averaging the accuracy of 160 test cases (8 subjects with 20 test folds each). 4.1 Effect of the Long-Term Memory LSTM does not explicitly differentiate short-term memory with long-term memory, from a general view of its unit ar- chitecture. Therefore, in order to clearly explore how LSTM unit learns to encode the long-term and short-term informa- tion and the interaction between the two types of working memory, we deliberately cut the text data with different win- dow size, both for the training corpus and the test stimuli. We set window size as 1, 4, 8, 16 and sentence-length for training data and 1, 4, 8, 16, 100, 200, 400, 800, document-length for test data, as is visualized in Figure 3. When training LSTM neural network and generating the vector representation a(t) for every time step t, we choose the data of the different win- dow size for LSTM neural network. The experiment results are presented in Figure 4, which suggests that the memory vector of LSTM neural language model generally performs significantly better than the hid- den state vector of the neural network in the brain mapping task, given the same hyper-parameter configuration. Besides, the accuracy of the predicted brain image by LSTM mem- ory vector reach about 86% at the best performance, while the highest accuracy of the predicted brain image by LSTM hidden state vector only reach about 61%. This supports the cognitive plausibility of the LSTM memory cell architecture. Regarding the influence of the window size of the training data and the window size of the test data on the model perfor- mance, the accuracy increases with large test window size in general. As far as the hidden state vector is concerned, the ac- curacy also increases with small window size of the training data and the large window size of the test data. However, we are surprised to find that the memory vector of LSTM architecture achieves the best performance when LSTM model is trained with the text data of exactly the 8- word window size and generate brain activity representation with the word sequence input of the document-wise test win- dow size, as is shown in Figure 4. The accuracy sharply de- creases when the model generates the representation and pre- dicts fMRI signals only from the previous 4 or 8 words with a limited, small test window size. The accuracy of the memory vector is very low when test window size is small, no matter we decrease or increase the window size of the training data. This indicates that the long-term memory plays an important role in constructing the artificial memory. 4.2 Effect of the Internal Factor: the Gating Mechanisms In order to take a further look at the role of each gate in the general LSTM architecture, we "remove" the input gates, the forget gates and the output gates respectively by setting their vector as a permanent all-one vector respectively. Then we train the new models with the data of the different window size. The results are presented in Figure 5. It is obvious that dropping gates brings a fatal influence to the performance on the brain image prediction task. While it may have negative impact to drop input and output gates, the performances seem to been even improved when dropping the forget gates. Looking at the brief history of LSTM architecture, we find that the original model in [Hochreiter and Schmidhuber, 1997] only has the input gate and the output gate. [Gers et al., 2000] added a forget gate to each LSTM unit, suggesting that it will help improve the model in dealing with continual input stream. It might be the case that story reading, in our experiment, is not a tough prediction task since the size of the input stream is limited to only a part of one novel chapter. In addition, reading should involve the processing of document- wise information, which means setting forget gates to all-one y t i r a l i m i S y t i r a l i m i S y t i r a l i m S i 0.8 0.6 0.4 vanilla LSTM w/o input gate w/o forget gate w/o output gate 1 4 8 16 100 200 400 800 doc (a) LSTM trained on 8-word window size vanilla LSTM w/o input gate w/o forget gate w/o output gate 0.8 0.6 0.4 1 4 8 16 100 200 400 800 doc (b) LSTM trained on 16-word window size 0.8 0.6 0.4 vanilla LSTM w/o input gate w/o forget gate w/o output gate 1 4 8 16 100 200 400 800 doc (c) LSTM trained on sentence-wise window size Figure 5: Comparative analysis of LSTM model with/without a certain gate. The x-axis of each sub-figure represents the window size of the test data. vector should not pose much negative influence to the ability of the model. It is worth noticing that the performance falls down sharply when the output gates is removed. From a technical perspec- tive, this is probably because that the output gate is close to the hidden state, which means that the output gate receives the back-propagating gradient earlier than the other two gates. The error can not be correctly updated. Therefore, removing the output gate will certainly interfere with the normal back propagation process, leading the model training process to- wards a wrong direction. 4.3 Comparison to Other Models We compare LSTM model with the vanilla RNN and other heuristic models. Vanilla RNN hidden We train a vanilla RNN language model and generate a series of representation of the story with the hidden state vector. The experiment configura- tion of the training and testing data are the same with that of the best LSTM model. BoW (tf-idf) For time step t , we transform the text that the subject has read into a tf-idf (term frequency-inverse document frequency) representation. AveEmbedding We average the word embedding of all the words that have been read at a certain time step t to gen- erate a representation for the brain state. We use the pub- lic Turian word embedding dataset [Turian et al., 2010]. Applying the same evaluation metric, we found that the AveEmbed heuristic model performs well, achieving a simi- larity of 0.81. LSTM memory vector is significantly better than the heuristic method. RNN hidden vectors, however, give out poor performance. A key reason is that RNN only captures short-term information and therefore fails in mod- elling reading process, which involves strong integration of the long-term information. Model Random BoW(tf-idf) AveEmbedding RNN hidden LSTM hidden LSTM memory Cosine Dist. -0.128 0.184 0.634 0.016 0.224 0.724 Similarity 0.436 0.592 0.817 0.508 0.612 0.862 Table 1: Comparison of different models. 5 Discussion We can summary the observations from the experiment re- sults as follows. • LSTM has the ability to encode the semantics of a story by the memory vector, in which the stored information can be used to predict the brain activity with 86% sim- ilairty. Compared to the simple RNN, the overall archi- tecture of LSTM should be more cognitively plausible. • The gating mechanisms are effective for LSTM to filter the valuable information except the forget gates, which is also consistent with the adaptive gating mechanism of working memory system [O'Reilly and Frank, 2006]. • The long-term memory can be well kept by LSTM. When we deliberately cut the source of long-term mem- ory (by using small context window size), the prediction accuracy decreases greatly. 5.1 Visualization Analysis In addition to the quantitative analysis above, we visualize part of the brain state dynamics of subject 1 in Figure 6, in- cluding the true signal sequence at 80 randomly-selected vox- els and two signal sequences reconstructed by LSTM mem- ory vector and LSTM hidden state vector. The x-axis of each sub-figure represents the time steps of the reading process (the fixation periods between every two runs are removed). The colour indicates the activation level of a certain brain re- gion at a certain time step. We found that the brain dynamics reconstructed by the memory vector of LSTM is more like a smoothed version of the real brain activity. The brain dynamics reconstructed by (a) Real brain activity (b) Predication by LSTM memory cell (c) Predication by LSTM hidden state Figure 6: The real brain activity and the reconstructed brain activities over the subject 1. Four sections of the experiment are concatenated to show the complete time line of the story reading process. The pictures are constructed from (a) true brain data, (b) LSTM memory, and (c) LSTM hidden state. brain activities by measuring the Pearson correlation coeffi- cient for each voxel within each subject. Then we compute the averaged correlation for a specific anatomical region de- fined by AAL (Automated Anatomical Labeling) atlas and visualize the correlation strength for subject 1 in Figure 7. L Temproal Pole Mid Temporal Inf R Fusiform Lingual Frontal Sup Orb Frontal Mid Orb Frontal Inf Orb Postcentral Parietal Sup We notice some interesting phenomena that might reflect the association of the LSTM memory vector with the pre- dictability of brain regions involved in language processing and semantic working memory. [Gabrieli et al., 1998] indicates that prefrontal cortex is as- sociated with semantic working memory. [Price, 2000] sum- marizes that frontal superior gyrus is associated with the pro- cessing of word meaning and that temporal pole area is as- sociated with sentence reading. Our analysis also reflects a strong correlation between the reconstructed brain activity from LSTM memory vector and the observed brain activity of the prefrontal cortex and temporal cortex, especially the inferior and anterior part of the gyrus. We also found that the reconstructed brain activity of Lin- gual gyrus and Fusiform (Visual Word Form Area ) are highly correlated with the real observed activities. Previous neuro- science research [Mechelli et al., 2000; McCandliss et al., 2003] has reported that these brain regions play an impor- tant role in word recognition. Similar patterns have also been found for other subjects. Figure 7: The correlation between the predicted and the real neural activity in a certain anatomical region for Subject 1. The brain is displayed in the transverse view. the hidden state vector of LSTM are largely deviated from the real brain activity, although LSTM hidden state reconstructs a few features of the real brain signals. 5.2 Connection with Cognitive Neuroscience To explore whether the predictability of the neural activity varies among different brain regions for LSTM memory vec- tor, we compute the correlation of the predicted and the real 6 Conclusion In this paper, we explore LSTM architecture with the sequen- tial brain signal of story reading. Experiment results suggest a correlation between the LSTM memory cell and the cog- nitive process of story reading. In the future work, we will continue to investigate the effectiveness of different LSTM variants by relating the representation generated by the mod- els with neural dynamics. We would also try to design a more reasonable artificial memory architecture for a better approx- imation to the working memory system and language cogni- tion. Besides, we will investigate some non-linear mapping function between the artificial and brain memories. Acknowledgments We would like to thank the anonymous reviewers for their valuable comments. This work was partially funded by Na- tional Natural Science Foundation of China (No. 61532011, 0200400600800100012001007550250255075100020040060080010001200100755025025507510002004006008001000120010075502502550751000.450.500.550.600.650.700.750.800.85 61473092, and 61472088), the National High Technol- ogy Research and Development Program of China (No. 2015AA015408). References [Bengio et al., 2003] Yoshua Bengio, R´ejean Ducharme, Pascal Vincent, and Christian Janvin. A neural probabilis- tic language model. The Journal of Machine Learning Re- search, 3:1137–1155, 2003. [Bengio, 2009] Yoshua Bengio. Learning deep architectures for ai. Foundations and trends R(cid:13) in Machine Learning, 2(1):1–127, 2009. [Collobert and Weston, 2008] Ronan Collobert and Jason Weston. A unified architecture for natural language pro- cessing: Deep neural networks with multitask learning. In Proceedings of ICML, 2008. [Devereux et al., 2010] Barry Devereux, Colin Kelly, and Anna Korhonen. Using fmri activation to conceptual stim- uli to evaluate methods for extracting conceptual represen- tations from corpora. In Proceedings of the NAACL HLT Workshop on Computational Neurolinguistics, 2010. [Elman, 1990] Jeffrey L Elman. Finding structure in time. Cognitive science, 14(2):179–211, 1990. [Gabrieli et al., 1998] John DE Gabrieli, Russell A Poldrack, and John E Desmond. The role of left prefrontal cor- tex in language and memory. Proceedings of the national Academy of Sciences, 95(3):906–913, 1998. [Gers et al., 2000] Felix A Gers, Jurgen Schmidhuber, and Fred Cummins. Learning to forget: Continual prediction with lstm. Neural computation, 12(10):2451–2471, 2000. [Graves, 2013] Alex Graves. Generating sequences with re- current neural networks. arXiv preprint arXiv:1308.0850, 2013. [Hinton and Salakhutdinov, 2006] Geoffrey E Hinton and Ruslan R Salakhutdinov. Reducing the dimensionality of data with neural networks. Science, 313(5786):504–507, 2006. [Hochreiter and Schmidhuber, 1997] Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997. [Karpathy et al., 2015] Andrej Karpathy, Justin Johnson, and Fei-Fei Li. Visualizing and understanding recurrent networks. arXiv preprint arXiv:1506.02078, 2015. [McCandliss et al., 2003] Bruce D McCandliss, Laurent Co- hen, and Stanislas Dehaene. The visual word form area: expertise for reading in the fusiform gyrus. Trends in cog- nitive sciences, 7(7):293–299, 2003. [Mechelli et al., 2000] Andrea Mechelli, Glyn W Humphreys, Kate Mayall, Andrew Olson, and Cathy J Price. Differential effects of word length and visual con- trast in the fusiform and lingual gyri during. Proceedings of the Royal Society of London B: Biological Sciences, 267(1455):1909–1913, 2000. [Mikolov et al., 2010] Tomas Mikolov, Martin Karafi´at, Lukas Burget, Jan Cernock`y, and Sanjeev Khudanpur. Re- current neural network based language model. In INTER- SPEECH, pages 1045–1048, 2010. [Mitchell et al., 2008] Tom M Mitchell, Svetlana V Shinkareva, Andrew Carlson, Kai-Min Chang, Vicente L Malave, Robert A Mason, and Marcel Adam Just. Pre- dicting human brain activity associated with the meanings of nouns. Science, 320(5880):1191–1195, 2008. [Murphy et al., 2012] Brian Murphy, Partha Talukdar, and Tom Mitchell. Selecting corpus-semantic models for neu- rolinguistic decoding. Introduction to SEM, 2012. [O'Reilly and Frank, 2006] Randall O'Reilly and Michael Frank. Making working memory work: a computational model of learning in the prefrontal cortex and basal gan- glia. Neural computation, 18(2):283–328, 2006. [Pereira et al., 2011] Francisco Pereira, Greg Detre, and Matthew Botvinick. Generating text from functional brain images. Frontiers in human neuroscience, 5, 2011. [Pereira et al., 2013] Francisco Pereira, Matthew Botvinick, and Greg Detre. Using wikipedia to learn semantic fea- ture representations of concrete concepts in neuroimaging experiments. Artificial intelligence, 194:240–252, 2013. [Price, 2000] Cathy J Price. The anatomy of language: contributions from functional neuroimaging. Journal of anatomy, 197(03):335–359, 2000. [Rowling, 1997] Joanne K Rowling. Harry Potter and the Philosopher Stone. 1997. [Schmidhuber, 2015] Jurgen Schmidhuber. Deep learning in neural networks: An overview. Neural Networks, 61:85– 117, 2015. [Schwartz et al., 2013] Yannick Schwartz, Bertrand Thirion, and Gael Varoquaux. Mapping cognitive ontologies to and from the brain. In NIPS (Neural Information Processing Systems), 2013. [Turian et al., 2010] Joseph Turian, Lev Ratinov, and Yoshua Bengio. Word representations: a simple and general In Proceedings of method for semi-supervised learning. ACL, 2010. [Wehbe et al., 2014a] Leila Wehbe, Brian Murphy, Partha Talukdar, Alona Fyshe, Aaditya Ramdas, and Tom Mitchell. Simultaneously uncovering the patterns of brain regions involved in different story reading subprocesses. PloS one, 9(11):e112575, 2014. [Wehbe et al., 2014b] Leila Wehbe, Ashish Vaswani, Kevin Knight, and Tom Mitchell. Aligning context-based statisti- cal models of language with brain activity during reading. In Proceedings of EMNLP, 2014. [Yamins et al., 2014] Daniel LK Yamins, Ha Hong, Charles F Cadieu, Ethan A Solomon, Darren Seibert, and James J DiCarlo. Performance-optimized hierarchical models predict neural responses in higher visual cor- tex. Proceedings of the National Academy of Sciences, 111(23):8619–8624, 2014.
1902.06734
1
1902
2019-02-14T20:00:30
Author Profiling for Hate Speech Detection
[ "cs.CL" ]
The rapid growth of social media in recent years has fed into some highly undesirable phenomena such as proliferation of abusive and offensive language on the Internet. Previous research suggests that such hateful content tends to come from users who share a set of common stereotypes and form communities around them. The current state-of-the-art approaches to hate speech detection are oblivious to user and community information and rely entirely on textual (i.e., lexical and semantic) cues. In this paper, we propose a novel approach to this problem that incorporates community-based profiling features of Twitter users. Experimenting with a dataset of 16k tweets, we show that our methods significantly outperform the current state of the art in hate speech detection. Further, we conduct a qualitative analysis of model characteristics. We release our code, pre-trained models and all the resources used in the public domain.
cs.CL
cs
Author Profiling for Hate Speech Detection Pushkar Mishra Marco Del Tredici Dept. of CS and Technology University of Cambridge United Kingdom ILLC University of Amsterdam The Netherlands [email protected] [email protected] Helen Yannakoudakis Dept. of CS and Technology The ALTA Institute University of Cambridge United Kingdom Ekaterina Shutova ILLC University of Amsterdam The Netherlands [email protected] 9 1 0 2 b e F 4 1 ] L C . s c [ 1 v 4 3 7 6 0 . 2 0 9 1 : v i X r a [email protected] Abstract The rapid growth of social media in recent years has fed into some highly undesirable phenomena such as proliferation of abusive and offensive language on the Internet. Previous research sug- gests that such hateful content tends to come from users who share a set of common stereotypes and form communities around them. The current state-of-the-art approaches to hate speech de- tection are oblivious to user and community information and rely entirely on textual (i.e., lexical and semantic) cues. In this paper, we propose a novel approach to this problem that incorpo- rates community-based profiling features of Twitter users. Experimenting with a dataset of 16k tweets, we show that our methods significantly outperform the current state of the art in hate speech detection. Further, we conduct a qualitative analysis of model characteristics. We release our code, pre-trained models and all the resources used in the public domain. 1 Introduction Hate speech, a term used to collectively refer to offensive language, racist comments, sexist remarks, etc., is omnipresent in social media. Users on social media platforms are at risk of being exposed to content that may not only be degrading but also harmful to their mental health in the long term. Pew Research Center highlighted the gravity of the situation via a recently released report (Duggan, 2014). As per the report, 40% of adult Internet users have personally experienced harassment online, and 60% have witnessed the use of offensive names and expletives. Expectedly, the majority (66%) of those who have personally faced harassment have had their most recent incident occur on a social networking website or app. While most of these websites and apps provide ways of flagging offensive and hateful content, only 8.8% of the victims have actually considered using such provisions. These statistics suggest that passive or manual techniques for curbing propagation of hateful content (such as flagging) are neither effective nor easily scalable (Pavlopoulos et al., 2017). Consequently, the efforts to automate the detection and moderation of such content have been gaining popularity in natural language processing (NLP) (Waseem and Hovy, 2016; Wulczyn et al., 2017). Several approaches to hate speech detection demonstrate the effectiveness of character-level bag-of- words features in a supervised classification setting (Djuric et al., 2015; Nobata et al., 2016; Davidson et al., 2017). More recent approaches, and currently the best performing ones, utilize recurrent neural networks (RNNs) to transform content into dense low-dimensional semantic representations that are then used for classification (Pavlopoulos et al., 2017; Badjatiya et al., 2017). All of these approaches rely solely on lexical and semantic features of the text they are applied to. Waseem and Hovy (2016) adopted This work is licensed under a Creative Commons Attribution 4.0 International License. License details: http://creativecommons.org/licenses/by/4.0/. a more user-centric approach based on the idea that perpetrators of hate speech are usually segregated into small demographic groups; they went on to show that gender information of authors (i.e., users who have posted content) is a helpful indicator. However, Waseem and Hovy focused only on coarse demographic features of the users, disregarding information about their communication with others. But previous research suggests that users who subscribe to particular stereotypes that promote hate speech tend to form communities online. For example, Zook (2012) mapped the locations of racist tweets in response to President Obama's re-election to show that such tweets were not uniformly distributed across the United States but formed clusters instead. In this paper, we present the first approach to hate speech detection that leverages author profiling information based on properties of the authors' social network and investigate its effectiveness. Author profiling has emerged as a powerful tool for NLP applications, leading to substantial perfor- mance improvements in several downstream tasks, such as text classification, sentiment analysis and author attribute identification (Hovy, 2015; Eisenstein, 2015; Yang and Eisenstein, 2017). The relevance of information gained from it is best explained by the idea of homophily, i.e., the phenomenon that peo- ple, both in real life as well as on the Internet, tend to associate more with those who appear similar. Here, similarity can be defined along various axes, e.g., location, age, language, etc. The strength of author profiling lies in that if we have information about members of a community c defined by some similarity criterion, and we know that the person p belongs to c, we can infer information about p. This concept has a straightforward application to our task: knowing that members of a particular community are prone to creating hateful content, and knowing that the author p is connected to this community, we can leverage information beyond linguistic cues and more accurately predict the use of hateful/non-hateful language from p. The questions that we seek to address here are: are some authors, and the respective communities that they belong to, more hateful than the others? And can such information be effectively utilized to improve the performance of automated hate speech detection methods? In this paper, we answer these questions and develop novel methods that take into account community- based profiling features of authors when examining their tweets for hate speech. Experimenting with a dataset of 16k tweets, we show that the addition of such profiling features to the current state-of-the-art methods for hate speech detection significantly enhances their performance. We also release our code (including code that replicates previous work), pre-trained models and the resources we used in the public domain. 2 Related Work 2.1 Hate speech detection Amongst the first ones to apply supervised learning to the task of hate speech detection were Yin et al. (2009) who used a linear SVM classifier to identify posts containing harassment based on local (e.g., n- grams), contextual (e.g., similarity of a post to its neighboring posts) and sentiment-based (e.g., presence of expletives) features. Their best results were with all of these features combined. Djuric et al. (2015) experimented with comments extracted from the Yahoo Finance portal and showed that distributional representations of comments learned using paragraph2vec (Le and Mikolov, 2014) outperform simpler bag-of-words (BOW) representations in a supervised classification setting for hate speech detection. Nobata et al. (2016) improved upon the results of Djuric et al. by training their clas- sifier on a combination of features drawn from four different categories: linguistic (e.g., count of insult words), syntactic (e.g., POS tags), distributional semantic (e.g., word and comment embeddings) and BOW-based (word and characters n-grams). They reported that while the best results were obtained with all features combined, character n-grams contributed more to performance than all the other features. Waseem and Hovy (2016) created and experimented with a dataset of racist, sexist and clean tweets. Utilizing a logistic regression (LR) classifier to distinguish amongst them, they found that character n-grams coupled with gender information of users formed the optimal feature set; on the other hand, geographic and word-length distribution features provided little to no improvement. Working with the same dataset, Badjatiya et al. (2017) improved on their results by training a gradient-boosted decision tree (GBDT) classifier on averaged word embeddings learnt using a long short-term memory (LSTM) network that they initialized with random embeddings. Waseem (2016) sampled 7k more tweets in the same manner as Waseem and Hovy (2016). They recruited expert and amateur annotators to annotate the tweets as racism, sexism, both or neither in order to study the influence of annotator knowledge on the task of hate speech detection. Combining this dataset with that of Waseem and Hovy (2016), Park et al. (2017) explored the merits of a two-step classification process. They first used a LR classifier to separate hateful and non-hateful tweets, followed by another LR classifier to distinguish between racist and sexist ones. They showed that this setup had comparable performance to a one-step classification setup built with convolutional neural networks. Davidson et al. (2017) created a dataset of about 25k tweets wherein each tweet was annotated as being racist, offensive or neither of the two. They tested several multi-class classifiers with the aim of distinguishing clean tweets from racist and offensive tweets while simultaneously being able to separate the racist and offensive ones. Their best model was a LR classifier trained using TF-IDF and POS n-gram features, as well as the count of hash tags and number of words. Wulczyn et al. (2017) prepared three different datasets of comments collected from the English Wikipedia Talk page; one was annotated for personal attacks, another for toxicity and the third one for aggression. Their best performing model was a multi-layered perceptron (MLP) classifier trained on character n-gram features. Experimenting with the personal attack and toxicity datasets, Pavlopoulos et al. (2017) improved the results of Wulczyn et al. by using a gated recurrent unit (GRU) model to encode the comments into dense low-dimensional representations, followed by a LR layer to classify the comments based on those representations. 2.2 Author profiling Author profiling has been leveraged in several ways for a variety of purposes in NLP. For instance, many studies have relied on demographic information of the authors. Amongst these are Hovy et al. (2015) and Ebrahimi et al. (2016) who extracted age and gender-related information to achieve superior performance in a text classification task. Pavalanathan and Eisenstein (2015), in their work, further showed the relevance of the same information to automatic text-based geo-location. Researching along the same lines, Johannsen et al. (2015) and Mirkin et al. (2015) utilized demographic factors to improve syntactic parsing and machine translation respectively. While demographic information has proved to be relevant for a number of tasks, it presents a signif- icant drawback: since this information is not always available for all authors in a social network, it is not particularly reliable. Consequently, of late, a new line of research has focused on creating repre- sentations of users in a social network by leveraging the information derived from the connections that they have with other users. In this case, node representations (where nodes represent the authors in the social network) are typically induced using neural architectures. Given the graph representing the social network, such methods create low-dimensional representations for each node, which are optimized to predict the nodes close to it in the network. This approach has the advantage of overcoming the absence of information that the previous approaches face. Among those that implement this idea are Yang et al. (2016), who used representations derived from a social graph to achieve better performance in entity linking tasks, and Chen and Ku (2016), who used them for stance classification. A considerable amount of literature has also been devoted to sentiment analysis with representations built from demographic factors (Yang and Eisenstein, 2017; Chen et al., 2016). Other tasks that have benefited from social representations are sarcasm detection (Amir et al., 2016) and political opinion prediction (Talmacel and Leon, 2017). 3 Dataset We experiment with the dataset of Waseem and Hovy (2016), containing tweets manually annotated for hate speech. The authors retrieved around 136k tweets over a period of two months. They bootstrapped their collection process with a search for commonly used slurs and expletives related to religious, sexual, gender and ethnic minorities. From the results, they identified terms and references to entities that frequently showed up in hateful tweets. Based on this sample, they used a public Twitter API to collect the entire corpus of ca. 136k tweets. After having manually annotated a randomly sampled subset of 16, 914 tweets under the categories racism, sexism or none themselves, they asked an expert to review their annotations in order to mitigate against any biases. The inter-annotator agreement was reported at κ = 0.84, with a further insight that 85% of all the disagreements occurred in the sexism class. The dataset was released as a list of 16, 907 tweet IDs along with their corresponding annotations1. Using python's Tweepy library, we could only retrieve 16, 202 of the tweets since some of them have now been deleted or their visibility limited. Of the ones retrieved, 1,939 (12%) are labelled as racism, 3,148 (19.4%) as sexism, and the remaining 11,115 (68.6%) as none; this distribution follows the original dataset very closely (11.7%, 20.0%, 68.3%). We were able to extract community-based information for 1,836 out of the 1,875 unique authors who posted the 16, 202 tweets, covering a cumulative of 16,124 of them; the remaining 39 authors have either deactivated their accounts or are facing suspension. Tweets in the racism class are from 5 of the 1,875 authors, while those in the sexism class are from 527 of them. 4 Methodology 4.1 Representing authors In order to leverage community-based information for the authors whose tweets form our dataset, we create an undirected unlabeled community graph wherein nodes are the authors and edges are the con- nections between them. An edge is instantiated between two authors u and v if u follows v on Twitter or vice versa. There are a total of 1,836 nodes and 7,561 edges. Approximately 400 of the nodes have no edges, indicating solitary authors who neither follow any other author nor are followed by any. Other nodes have an average degree2 of 8, with close to 600 of them having a degree of at least 5. The graph is overall sparse with a density of 0.0075. From this community graph, we obtain a vector representation, i.e., an embedding that we refer to as author profile, for each author using the node2vec framework (Grover and Leskovec, 2016). Node2vec applies the skip-gram model of Mikolov et al. (2013) to a graph in order to create a representation for each of its nodes based on their positions and their neighbors. Specifically, given a graph with nodes V = {v1, v2, . . . , vn}, node2vec seeks to maximize the following log probability: (cid:88) v∈V log P r (Ns(v) v) where Ns(v) denotes the network neighborhood of node v generated through sampling strategy s. In doing so, the framework learns low-dimensional embeddings for nodes in the graph. These embed- dings can emphasize either their structural role or the local community they are a part of. This depends on the sampling strategies used to generate the neighborhood: if breadth-first sampling (BFS) is adopted, the model focuses on the immediate neighbors of a node; when depth-first sampling (DFS) is used, the model explores farther regions in the network, which results in embeddings that encode more informa- tion about the nodes' structural role (e.g., hub in a cluster, or peripheral node). The balance between these two ways of sampling the neighbors is directly controlled by two node2vec parameters, namely p and q. The default value for these is 1, which ensures a node representation that gives equal weight to both structural and community-oriented information. In our work, we use the default value for both p and q. Additionally, since node2vec does not produce embeddings for solitary authors, we map these to a single zero embedding. Figure 1 shows example snippets from the community graph. Some authors belong to densely- connected communities (left figure), while others are part of more sparse ones (right figure). In either case, node2vec generates embeddings that capture the authors' neighborhood. 1https://github.com/ZeerakW/hatespeech/blob/master/NAACL_SRW_2016.csv 2The degree of a node is equal to the number of its direct connections to other nodes. (a) Densely-connected authors (b) Sparsely-connected authors Figure 1: Snippets from the community graph for our Twitter data. 4.2 Classifying content We experiment with seven different methods for classifying tweets as one of racism, sexism, or none. We first re-implement three established and currently best-performing hate speech detection methods -- based on character n-grams and recurrent neural networks -- as our baselines. We then test whether incorporating author profiling features improves their performance. Char n-grams (LR). As our first baseline, we adopt the method used by Waseem and Hovy (2016) wherein they train a logistic regression (LR) classifier on the Twitter dataset using character n-gram counts. We use uni-grams, bi-grams, tri-grams and four-grams, and L2-normalize their counts. Character n-grams have been shown to be effective for the task of hate speech detection (Nobata et al., 2016). Hidden-state (HS). As our second baseline, we take the "RNN" method of Pavlopoulos et al. (2017) which achieves state-of-the-art results on the Wikipedia datasets released by Wulczyn et al. (2017). The method comprises a 1-layer gated recurrent unit (GRU) that takes a sequence w1, . . . , wn of words represented as d-dimensional embeddings and encodes them into hidden states h1, . . . , hn. This is followed by an LR layer that uses the last hidden state hn to classify the tweet. We make two minor modifications to the authors' original architecture: we deepen the 1-layer GRU to a 2-layer GRU and use softmax instead of sigmoid in the LR layer.3 Like Pavlopoulos et al., we initialize the word embeddings to GLoVe vectors (Pennington et al., 2014). In all our methods, words not available in the GLoVe set are randomly initialized in the range ±0.05, indicating the lack of semantic information. By not mapping these words to a single random embedding, we mitigate against the errors that may arise due to their conflation (Madhyastha et al., 2015). A special OOV (out of vocabulary) token is also initialized in the same range. All the embeddings are updated during training, allowing some of the randomly-initialized ones to get task-tuned; the ones that do not get tuned lie closely clustered around the OOV token, to which unseen words in the test set are mapped. Word-sum (WS). As a third baseline, we adopt the "LSTM+GLoVe+GBDT" method of Badjatiya et al. (2017), which achieves state-of-the-art results on the Twitter dataset we are using. The authors first utilize an LSTM to task-tune GLoVe-initialized word embeddings by propagating the error back from an LR layer. They then train a gradient boosted decision tree (GBDT) classifier to classify texts based on the average of the embeddings of constituent words. We make two minor modifications to this method: we use a 2-layer GRU4 instead of the LSTM to tune the embeddings, and we train the GBDT classifier on the L2-normalized sum of the embeddings instead of their average.5 Although the authors achieved 3We also experimented with 1-layer GRU/LSTM and 1/2-layer bi-directional GRUs/LSTMs but performance only worsened or showed no gains; using sigmoid instead of softmax did not have any noteworthy effects on the results either. 4We note the deeper 2-layer GRU slightly improves performance. 5Although GBDT, as a tree based model, is not affected by the choice of monotonic function, the L2-normalized sum ensures uniformity of range across the feature set in all our methods. state-of-the-art results on Twitter by initializing embeddings randomly rather than with GLoVe (which is what we do here), we found the opposite when performing a 10-fold stratified cross-validation (CV). A possible explanation of this lies in the authors' decision to not use stratification, which for such a highly imbalanced dataset can lead to unexpected outcomes (Forman and Scholz, 2010). Furthermore, the authors train their LSTM on the entire dataset (including the test set) without any early stopping criterion, which leads to over-fitting of the randomly-initialized embeddings. Author profile (AUTH). In order to test whether community-based information of authors is in itself suf- ficient to correctly classify the content produced by them, we utilize just the author profiles we generated to train a GBDT classifier. Char n-grams + author profile (LR + AUTH). This method builds upon the LR baseline by appending author profile vectors on to the character n-gram count vectors for training the LR classifier. Hidden-state + author profile (HS + AUTH) and Word-sum + author profile (WS + AUTH). These methods are identical to the char n-grams + author profile method except that here we append the author profiling features on to features derived from the hidden-state and word-sum baselines respectively and feed them to a GBDT classifier. 5 Experiments and Results 5.1 Experimental setup We normalize the input by lowercasing all words and removing stop words. For the GRU architecture, we use exactly the same hyper-parameters as Pavlopoulos et al. (2017),6 i.e., 128 hidden units, Glorot initialization, cross-entropy loss, and the Adam optimizer (Kingma and Ba, 2015). Badjatiya et al. (2017) also use the same settings except they have fewer hidden units. In all our models, besides dropout regularization (Srivastava et al., 2014), we hold out a small part of the training set as validation data to prevent over-fitting. We implement the models in Keras (Chollet and others, 2015) with Theano back- end and use 200-dimensional pre-trained GLoVe word embeddings.7 We employ Lightgbm (Ke et al., 2017) as our GDBT classifier and tune its hyper-parameters using 5-fold grid search. For the node2vec framework, we use the same parameters as in the original paper (Grover and Leskovec, 2016) except we set the dimensionality of node embeddings to 200 and increase the number of iterations to 25 for better convergence. 5.2 Results We perform 10-fold stratified cross validation (CV), as suggested by Forman and Scholz (2010), to eval- uate all seven methods described in the previous section. Following previous research (Badjatiya et al., 2017; Park and Fung, 2017), we report the average weighted precision, recall, and F1 scores for all the methods. The average weighted precision is calculated as: r + ws · Pi (cid:80)10 i=1 (wr · Pi s + wn · Pi n) 10 s, Pi r, Pi n are precision scores on the racism, sexism, and none classes from the ith fold of the where Pi CV. The values wr, ws, and wn are the proportions of the racism, sexism, and none classes in the dataset respectively; since we use stratification, these proportions are constant (wr = 0.12, ws = 0.19, wn = 0.69) across all folds. Average weighted recall and F1 are calculated in the same manner. The results are presented in Table 1. For all three baseline methods (LR, WS, and HS), the addition of author profiling features significantly improves performance (p < 0.05 under 10-fold CV paired t-test). The LR + AUTH method yields the highest performance of F1 = 87.57, exceeding its respective baseline by nearly 4 points. A similar trend can be observed for the other methods as well. These results point 6The authors have not released their models, and we therefore replicate their approach based on the details in their paper. 7http://nlp.stanford.edu/data/glove.twitter.27B.zip to the importance of community-based information and author profiling in hate speech detection and demonstrate that our approach can further improve the performance of existing state-of-the-art methods. Baselines Our methods Method LR HS WS AUTH LR + AUTH HS + AUTH WS + AUTH P 84.07 83.50 82.86 72.13 87.57 87.29 87.11 R 84.31 83.71 83.10 76.05 87.66 87.32 87.20 F1 83.81 83.54 82.37 71.26 87.57 87.29 87.08 Table 1: Average weighted precision, recall and F1 scores of the different methods on the Twitter datasest. All improvements are significant (p < 0.05) under 10-fold CV paired t-test. Method LR HS WS AUTH LR + AUTH HS + AUTH WS + AUTH P 77.29 74.15 76.43 43.33 76.10 74.42 75.12 R 67.92 72.46 67.77 0.31 74.16 73.54 72.46 F1 72.28 73.24 71.78 0.61 75.09 73.91 73.72 Method LR HS WS AUTH LR + AUTH HS + AUTH WS + AUTH P 82.66 76.04 81.75 66.85 86.22 84.15 86.37 R 63.98 68.84 57.37 75.44 79.07 81.32 77.92 F1 72.09 72.24 67.38 70.88 82.47 82.75 81.91 (a) Racism class (b) Sexism class Table 2: Performance of the methods on the racism and sexism classes separately. All improvements are significant (p < 0.05) under 10-fold CV paired t-test. In Table 2, we further compare the performance of the different methods on the racism and sexism classes individually. As in the previous experiments, the scores are averaged over 10 folds of CV. Of particular interest are the scores for the sexism class where the F1 increases by over 10 points upon the addition of author profiling features. Upon analysis, we find that such a substantial increase in performance stems from the fact that many of the 527 unique authors of the sexist tweets are closely connected in the community graph. This allows for their penchant for sexism to be expressed in their respective author profiles. The author profiling features on their own (AUTH) achieve impressive results overall and in particular on the sexism class, where their performance is typical of a community-based generalization, i.e., low precision but high recall. For the racism class on the other hand, the performance of AUTH on its own is quite poor. This contrast can be explained by the fact that tweets in the racism class come from only 5 unique authors who: (i) are isolated in the community graph, or (ii) have also authored several tweets in the sexism class, or (iii) are densely connected to authors from the sexism and none classes which possibly camouflages their racist nature. We believe that the gains in performance will be more pronounced as the underlying community graph grows since there will be less solitary authors and more edges worth harnessing information from.8 Even when the data is skewed and there is an imbalance of hateful vs. non-hateful authors, we do expect our approach to still be able to identify clusters of authors with similar views. 6 Analysis and discussion We conduct a qualitative analysis of system errors and the cases where author profiling leads to the correct classification of previously misclassified examples. Table 3 shows examples of hateful tweets from the dataset that are misclassified by the LR method, but are correctly classified upon the addition of author profiling features, i.e., by the LR + AUTH method. It is worth noting that some of the wins scored 8Regarding the scalability of our approach, we quote the authors of node2vec: "The major phases of node2vec are trivially parallelizable, and it can scale to large networks with millions of nodes in a few hours". by the latter are on tweets that are part of a larger hateful discourse or contain links to hateful content while not explicitly having textual cues that are indicative of hate speech per se. The addition of author profiling features may then be viewed as a proxy for wider discourse information, thus allowing us to correctly resolve the cases where lexical and semantic features alone are insufficient.9 Tweet @Mich McConnell Just "her body" right? @Starius: #GamerGate https://t.co/xuFwsIgxFK WE WIN! ahahahaha #Islam dominates our crime, prison & welfare system & na- tional security. Why are we still importing it? @PeterDut- ton MP #amagenda #auspol @Wateronatrain: @MT8 9 You might like this #patriarchy http://t.co/c9m2pFmFJ3 It seems that Allah sits around all day obsessing about women's hands and faces showing. I guess idiots need a god on their level. #Islam @SalemP08: @MT8 9 @LiljaOB @midnitebacon @Superju- tah @Transic nyc her response is pretty terrifying. @JosephIsVegan @SumbelinaZ @IronmanL1 @Hatewatch Why would you profile white people. Blacks murder at 6 times the rate as whites. Predicted label LR none none sexism sexism LR + AUTH none racism none none none none sexism racism sexism racism Table 3: Examples of improved classification upon the addition of author profiling features (AUTH). However, a number of hateful tweets still remain misclassified despite the addition of author pro- filing features. According to our analysis, many of these tend to contain URLs to hateful content, e.g., "@salmonfarmer1: Logic in the world of Islam http://t.co/6nALv2HPc3" and "@juliarforster Yes. http://t.co/ixbt0uc7HN". Since Twitter shortens all URLs into a standard format, there is no indication of what they refer to. One way to deal with this limitation could be to additionally maintain a blacklist of links. Another source of system errors is the deliberate obfuscation of words by authors in order to evade detection, e.g., "Kat, a massive c*nt. The biggest ever on #mkr #cuntandandre". Current hate speech detection methods, including ours, do not directly attempt to address this issue. While this is a challenge for bag-of-word based methods such as LR, we hypothesize that neural networks operating at the character level may be helpful in recognizing obfuscated words. Figure 2: Visualization of author embeddings in 2-dimensional space. 9We note that the annotators of the dataset took discourse into account when annotating the tweets. However, the dataset was released as a list of tweet ID and corresponding annotation (racism/sexism/none) pairs; there is no annotation available regarding which tweets are related to which other ones. (a) None class (b) Sexism class Figure 3: Visualization of authors from different classes. We further conducted an analysis of the author embeddings generated by node2vec, in order to validate that they capture the relevant aspects of the community graph. We visualized the author embeddings in 2-dimensional space using t-SNE (van der Maaten and Hinton, 2008), as shown in Figure 2. We observe that, as in the community graph, there are a few densely populated regions in the visualization that represent authors in closely knit groups who exhibit similar characteristics. The other regions are largely sparse with smaller clusters. Note that we exclude solitary users from this visualization since we have to use a single zero embedding to represent them. Figure 3 further provides visualizations for authors from the sexism and none classes separately. While the authors from the none class are spread out in the embedding space, the ones from the sexism class are more tightly clustered. Note that we do not visualize the 5 authors from the racism class since 4 of them are already covered in the sexism class. 7 Conclusions In this paper, we explored the effectiveness of community-based information about authors for the pur- pose of identifying hate speech. Working with a dataset of 16k tweets annotated for racism and sexism, we first comprehensively replicated three established and currently best-performing hate speech detection methods based on character n-grams and recurrent neural networks as our baselines. We then constructed a graph of all the authors of tweets in our dataset and extracted community-based information in the form of dense low-dimensional embeddings for each of them using node2vec. We showed that the inclusion of author embeddings significantly improves system performance over the baselines and advances the state of the art in this task. Users prone to hate speech do tend to form social groups online, and this stresses the importance of utilizing community-based information for automatic hate speech detection. In the future, we wish to explore the effectiveness of community-based author profiling in other tasks such as stereotype identification and metaphor detection. References [Amir et al.2016] Silvio Amir, Byron C Wallace, Hao Lyu, and Paula Carvalho M´ario J Silva. 2016. Modelling context with user embeddings for sarcasm detection in social media. arXiv preprint arXiv:1607.00976. [Badjatiya et al.2017] Pinkesh Badjatiya, Shashank Gupta, Manish Gupta, and Vasudeva Varma. 2017. Deep In Proceedings of the 26th International Conference on World learning for hate speech detection in tweets. Wide Web Companion, WWW '17 Companion, pages 759 -- 760, Republic and Canton of Geneva, Switzerland. International World Wide Web Conferences Steering Committee. [Chen and Ku2016] Wei-Fan Chen and Lun-Wei Ku. 2016. Utcnn: a deep learning model of stance classification on social media text. arXiv preprint arXiv:1611.03599. [Chen et al.2016] Huimin Chen, Maosong Sun, Cunchao Tu, Yankai Lin, and Zhiyuan Liu. 2016. Neural sentiment classification with user and product attention. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 1650 -- 1659. [Chollet and others2015] Franc¸ois Chollet et al. 2015. Keras. [Davidson et al.2017] Thomas Davidson, Dana Warmsley, Michael Macy, and Ingmar Weber. 2017. Automated hate speech detection and the problem of offensive language. In Proceedings of the 11th International AAAI Conference on Web and Social Media, ICWSM '17. [Djuric et al.2015] Nemanja Djuric, Jing Zhou, Robin Morris, Mihajlo Grbovic, Vladan Radosavljevic, and Narayan Bhamidipati. 2015. Hate speech detection with comment embeddings. In Proceedings of the 24th International Conference on World Wide Web, WWW '15 Companion, pages 29 -- 30, New York, NY, USA. ACM. [Duggan2014] Maeve Duggan. 2014. Online harassment. [Ebrahimi and Dou2016] Javid Ebrahimi and Dejing Dou. 2016. Personalized semantic word vectors. In Pro- ceedings of the 25th ACM International on Conference on Information and Knowledge Management, pages 1925 -- 1928. ACM. [Eisenstein2015] Jacob Eisenstein. 2015. Written dialect variation in online social media. Charles Boberg, John Nerbonne, and Dom Watt, editors, Handbook of Dialectology. Wiley. [Forman and Scholz2010] George Forman and Martin Scholz. 2010. Apples-to-apples in cross-validation studies: Pitfalls in classifier performance measurement. SIGKDD Explor. Newsl., 12(1):49 -- 57, November. [Grover and Leskovec2016] Aditya Grover and Jure Leskovec. 2016. node2vec: Scalable feature learning for networks. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. [Hovy2015] Dirk Hovy. 2015. Demographic factors improve classification performance. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Confer- ence on Natural Language Processing (Volume 1: Long Papers), volume 1, pages 752 -- 762. [Johannsen et al.2015] Anders Johannsen, Dirk Hovy, and Anders Søgaard. 2015. Cross-lingual syntactic varia- tion over age and gender. In Proceedings of the Nineteenth Conference on Computational Natural Language Learning, pages 103 -- 112. [Ke et al.2017] Guolin Ke, Qi Meng, Thomas Finley, Taifeng Wang, Wei Chen, Weidong Ma, Qiwei Ye, and Tie- Yan Liu. 2017. Lightgbm: A highly efficient gradient boosting decision tree. 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 3149 -- 3157. Curran Associates, Inc. [Kingma and Ba2015] Diederik P. Kingma and Jimmy Ba. 2015. Adam: A method for stochastic optimization. In Proceedings of the 3rd International Conference on Learning Representations, ICLR '15. [Le and Mikolov2014] Quoc V. Le and Tomas Mikolov. 2014. Distributed representations of sentences and docu- ments. CoRR, abs/1405.4053. [Madhyastha et al.2015] Pranava Swaroop Madhyastha, Mohit Bansal, Kevin Gimpel, and Karen Livescu. 2015. Mapping unseen words to task-trained embedding spaces. CoRR, abs/1510.02387. [Mikolov et al.2013] Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. 2013. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781. [Mirkin et al.2015] Shachar Mirkin, Scott Nowson, Caroline Brun, and Julien Perez. 2015. Motivating personality- aware machine translation. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 1102 -- 1108. [Nobata et al.2016] Chikashi Nobata, Joel Tetreault, Achint Thomas, Yashar Mehdad, and Yi Chang. 2016. Abu- sive language detection in online user content. In Proceedings of the 25th International Conference on World Wide Web, WWW '16, pages 145 -- 153, Republic and Canton of Geneva, Switzerland. International World Wide Web Conferences Steering Committee. [Park and Fung2017] Ji Ho Park and Pascale Fung. 2017. One-step and two-step classification for abusive lan- guage detection on twitter. In Proceedings of the First Workshop on Abusive Language Online, pages 41 -- 45. Association for Computational Linguistics. [Pavalanathan and Eisenstein2015] Umashanthi Pavalanathan and Jacob Eisenstein. 2015. Confounds and conse- quences in geotagged twitter data. arXiv preprint arXiv:1506.02275. [Pavlopoulos et al.2017] John Pavlopoulos, Prodromos Malakasiotis, and Ion Androutsopoulos. 2017. Deep learn- ing for user comment moderation. In Proceedings of the First Workshop on Abusive Language Online, pages 25 -- 35. Association for Computational Linguistics. [Pennington et al.2014] Jeffrey Pennington, Richard Socher, and Christopher D. Manning. 2014. Glove: Global vectors for word representation. In Empirical Methods in Natural Language Processing (EMNLP), pages 1532 -- 1543. [Srivastava et al.2014] Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhut- dinov. 2014. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15:1929 -- 1958. [Talmacel and Leon2017] Ciprian Talmacel and Florin Leon. 2017. Predicting political opinions in social net- works with user embeddings. In Proceedings of the 2017 13th IEEE International Conference on Intelligent Computer Communication and Processing. [van der Maaten and Hinton2008] Laurens van der Maaten and Geoffrey Hinton. 2008. Visualizing data using t-SNE. Journal of Machine Learning Research, 9:2579 -- 2605. [Waseem and Hovy2016] Zeerak Waseem and Dirk Hovy. 2016. Hateful symbols or hateful people? predictive features for hate speech detection on twitter. In Proceedings of the NAACL Student Research Workshop, pages 88 -- 93, San Diego, California, June. Association for Computational Linguistics. [Waseem2016] Zeerak Waseem. 2016. Are you a racist or am i seeing things? annotator influence on hate speech detection on twitter. In Proceedings of the First Workshop on NLP and Computational Social Science, pages 138 -- 142. Association for Computational Linguistics. [Wulczyn et al.2017] Ellery Wulczyn, Nithum Thain, and Lucas Dixon. 2017. Ex machina: Personal attacks In Proceedings of the 26th International Conference on World Wide Web, WWW '17, pages seen at scale. 1391 -- 1399, Republic and Canton of Geneva, Switzerland. International World Wide Web Conferences Steering Committee. [Yang and Eisenstein2017] Yi Yang and Jacob Eisenstein. 2017. Overcoming language variation in sentiment analysis with social attention. Transactions of the Association for Computational Linguistics. [Yang et al.2016] Yi Yang, Ming-Wei Chang, and Jacob Eisenstein. 2016. Toward socially-infused information extraction: Embedding authors, mentions, and entities. arXiv preprint arXiv:1609.08084. [Yin et al.2009] Dawei Yin, Brian D. Davison, Zhenzhen Xue, Liangjie Hong, April Kontostathis, and Lynne Ed- wards. 2009. Detection of harassment on web 2.0. In Processings of the Content Analysis in the WEB 2.0, 2:1-7. [Zook2012] Matthew Zook. 2012. Mapping racist tweets in response to president obama's re-election. [Online; accessed 15 March 2018].
1604.00461
1
1604
2016-04-02T04:59:21
Embedding Lexical Features via Low-Rank Tensors
[ "cs.CL", "cs.AI", "cs.LG" ]
Modern NLP models rely heavily on engineered features, which often combine word and contextual information into complex lexical features. Such combination results in large numbers of features, which can lead to over-fitting. We present a new model that represents complex lexical features---comprised of parts for words, contextual information and labels---in a tensor that captures conjunction information among these parts. We apply low-rank tensor approximations to the corresponding parameter tensors to reduce the parameter space and improve prediction speed. Furthermore, we investigate two methods for handling features that include $n$-grams of mixed lengths. Our model achieves state-of-the-art results on tasks in relation extraction, PP-attachment, and preposition disambiguation.
cs.CL
cs
Embedding Lexical Features via Low-Rank Tensors Harbin Institute of Technology Mo Yu∗ IBM Watson 6 1 0 2 r p A 2 ] L C . s c [ 1 v 1 6 4 0 0 . 4 0 6 1 : v i X r a [email protected] Raman Arora Johns Hopkins University [email protected] Abstract Modern NLP models rely heavily on engi- neered features, which often combine word and contextual information into complex lexi- cal features. Such combination results in large numbers of features, which can lead to over- fitting. We present a new model that repre- sents complex lexical features-comprised of parts for words, contextual information and labels-in a tensor that captures conjunction information among these parts. We apply low- rank tensor approximations to the correspond- ing parameter tensors to reduce the parame- ter space and improve prediction speed. Fur- thermore, we investigate two methods for han- dling features that include n-grams of mixed lengths. Our model achieves state-of-the-art results on tasks in relation extraction, PP- attachment, and preposition disambiguation. Introduction 1 Statistical NLP models usually rely on hand- designed features, customized for each task. These features typically combine lexical and contextual in- formation with the label to be scored. In relation extraction, for example, there is a parameter for the presence of a specific relation occurring with a fea- ture conjoining a word type (lexical) with depen- dency path information (contextual). In measur- ing phrase semantic similarity, a word type is con- joined with its position in the phrase to signal its role. Figure 1b shows an example in dependency parsing, where multiple types (words) are conjoined with POS tags or distance information. ∗Paper submitted during Mo Yu's PhD study at HIT. Mark Dredze HLTCOE Johns Hopkins University [email protected] Matthew R. Gormley Carnegie Mellon University [email protected] To avoid model over-fitting that often results from features with lexical components, several smoothed lexical representations have been proposed and shown to improve performance on various NLP tasks; for instance, word embeddings (Bengio et al., 2006) help improve NER, dependency parsing and semantic role labeling (Miller et al., 2004; Koo et al., 2008; Turian et al., 2010; Sun et al., 2011; Roth and Woodsend, 2014; Hermann et al., 2014). However, using only word embeddings is not suf- ficient to represent complex lexical features (e.g. φ in Figure 1c). In these features, the same word em- bedding conjoined with different non-lexical prop- erties may result in features indicating different la- bels; the corresponding lexical feature representa- tions should take the above interactions into consid- eration. Such important interactions also increase the risk of over-fitting as feature space grows ex- ponentially, yet how to capture these interactions in representation learning remains an open question. To address the above problems,1 we propose a general and unified approach to reduce the feature space by constructing low-dimensional feature rep- resentations, which provides a new way of combin- ing word embeddings, traditional non-lexical prop- erties, and label information. Our model exploits the inner structure of features by breaking the fea- ture into multiple parts: lexical, non-lexical and (op- tional) label. We demonstrate that the full feature is an outer product among these parts. Thus, a param- eter tensor scores each feature to produce a predic- tion. Our model then reduces the number of param- 1Our paper only focuses on lexical features, as non-lexical features usually suffer less from over-fitting. Figure 1: An example of lexical features used in dependency parsing. To predict the "PMOD" arc (the dashed one) between "see" and "with" in (a), we may rely on lexical features in (b). Here p, c, g are indices of the word "with", its child ("telescope") and a candidate head. Figure (c) shows what the fifth feature (φ) is like, when the candidate is "see". As is common in multi-class classification tasks, each template generates a different feature for each label y. Thus a feature φ = wg ∧ wc ∧ u ∧ y is the conjunction of the four parts. Figure (d) is the one-hot representation of φ, which is equivalent to the outer product (i.e. a 4-way tensor) among the four one-hot vectors. v(x) = 1 means the vector v has a single non-zero element in the x position. eters by approximating the parameter tensor with a low-rank tensor: the Tucker approximation of Yu et al. (2015) but applied to each embedding type (view), or the Canonical/Parallel-Factors Decompo- sition (CP). Our models use fewer parameters than previous work that learns a separate representation for each feature (Ando and Zhang, 2005; Yang and Eisenstein, 2015). CP approximation also allows for much faster prediction, going from a method that is cubic in rank and exponential in the number of lex- ical parts, to a method linear in both. Furthermore, we consider two methods for handling features that rely on n-grams of mixed lengths. Our model makes the following contributions when contrasted with prior work: Lei et al. (2014) applied CP to combine different views of features. Compared to their work, our us- age of CP-decomposition is different in the applica- tion to feature learning: (1) We focus on dimension- ality reduction of existing, well-verified features, while Lei et al. (2014) generates new features (usu- ally different from ours) by combining some "atom" features. Thus their work may ignore some useful features; it relies on binary features as supplemen- tary but our model needs not. (2) Lei et al. (2014)'s factorization relies on views with explicit meanings, e.g. head/modifier/arc in dependency parsing, mak- ing it less general. Therefore its applications to tasks like relation extraction are less obvious. Compared to our previous work (Gormley et al., 2015; Yu et al., 2015), this work allows for higher- order interactions, mixed-length n-gram features, lower-rank representations. We also demonstrate the strength of our new model via applications to new tasks. The resulting method learns smoothed feature representations combining lexical, non-lexical and label information, achieving state-of-the-art perfor- mance on several tasks: relation extraction, preposi- tion semantics and PP-attachment. 2 Notation and Definitions We begin with some background on notation and definitions. Let T ∈ Rd1×···×dK be a K-way ten- sor (i.e., a tensor with K views). In this paper, we consider the tensor k-mode product, i.e. mul- tiplying a tensor T ∈ Rd1×···×dK by a matrix x ∈ Rdk×J (or a vector if J = 1) in mode (view) k. The product is denoted by T ×k x and is of size d1 × ··· × dk−1 × J × dk+1 × ··· × dK. Element- wise, we have (T ×k x)i1...ik−1 j ik+1...iK = Ti1...ik...iK xikj, dk(cid:88)ik=1 for j = 1, . . . , J. A mode-k fiber Ti1...ik−1•ik+1...iK of T is the dk dimensional vector obtained by fixing all but the kth index. The mode-k unfolding T(k) of T is the dk ×(cid:81)i(cid:54)=k di matrix obtained by concate- nating all the(cid:81)i(cid:54)=k di mode-k fibers along columns. Given two matrices W1 ∈ Rd1×r1, W2 ∈ Rd2×r2, we write W1 ⊗ W2 to denote the Kronecker product between W1 and W2 (outer product for vectors). We define the Frobenius product (matrix dot product) A (cid:12) B = (cid:80)i,j AijBij between two matrices with 1 0 1 0 ϕ =wg ∧wc ∧ u ∧ y "see" "PMOD" "telescope" postag(g+1) ="DT" telescope see with PMOD? a a girl word(c)∧word(g) word(c)∧postag(g) word(p)∧word(g) word(c)∧postag(g+1) word(c)∧word(g)∧postag(g+1) word(c)∧word(g)∧distance(g, p) … c p g 0 bcctswlModelPRF1PRF1PRF1HeadEmbCNN(wsize=1)+localfeaturesCNN(wsize=3)+localfeaturesFCTlocalonlyFCTglobal60.6942.3949.9256.4134.4542.7841.9531.7736.16FCTglobal(Brown)63.1539.5848.6662.4536.4746.0554.9529.9338.75FCTglobal(WordNet)59.0044.7950.9260.2039.6047.7750.9534.1840.92PET(PlankandMoschitti,2013)51.240.645.351.037.843.435.432.834.0BOW(PlankandMoschitti,2013)57.237.145.057.531.841.041.127.232.7Best(PlankandMoschitti,2013)55.343.148.554.138.144.739.935.837.8Table7:PerformanceonACE2005testsets.Thefirstpartofthetableshowstheperformanceofdifferentmodelsondifferentsourcesofentitytypes,where"G"meansthatthegoldtypesareusedand"P"meansthatweareusingthepredictedtypes.Thesecondpartofthetableshowstheresultsunderthelow-resourcesetting,wheretheentitytypesareunknown.DevMRRTestMRRModelFine-tuning1,00010,000100,0001,00010,000100,000SUM-46.9535.2930.6952.6341.1937.32SUMY50.8136.8132.9257.2345.0141.23BestRecursiveNN(d=50)Y45.6730.8627.0554.8439.2535.49BestRecursiveNN(d=200)Y48.9733.5031.1353.5940.5038.57FCTN47.5335.5831.3154.3341.9639.10FCTY51.2236.7633.5961.1146.9944.31FCT+LM-49.4337.4632.2253.5642.6339.44FCT+LM+supervisedY53.8237.4834.4365.4749.4445.65joint56.5341.4136.4568.5251.6546.53Table8:PerformanceonthesemanticsimilaritytaskwithPPDBdata.Appendix1:FeaturesUsedinFCT7.1OverallperformancesonACE2005SUM(AB)6=SUM(BA)(7)2n2Vn(8)AA0ofB0B(9)ABA0ofB0(10)Tfe)Relations(11)f⌦e[f:e]FCTCNN@`@R@`@T=@`@R@R@TL1,L2@L@R=@L1@R+@L2@Rs(l,e1,e2,S;T)=nXi=1s(l,ewi,fwi)=nXi=1Tlfwiewi(12)@`@T=nXi=1@`@R⌦fwi⌦ewi,(13)v2(wc)=1 v3(u)=1 v4(y)=1 0 v1(wg)=1 1 0 0 1 0 0 (a) (b) (c) (d) the same sizes; and define element-wise (Hadamard) multiplication a ◦ b between vectors with the same sizes. Tucker Decomposition: Tucker Decomposition represents a d1 × d2 × . . . × dK tensor T as: T = g ×1 W1 ×2 W2 . . . ×K WK (1) where each ×i is the tensor i-mode product and each Wi is a ri × di matrix. Tensor g with size r1 × r2 × . . . × rK is called the core tensor. We say that T has a Tucker rank (r(1), r(2), . . . , r(K)), where r(i) = rank(T(i)) is the rank of mode-i un- folding. To simplify learning, we define the Tucker rank as r(i)=rank(g(i)), which can be bounded sim- ply by the dimensions of g, i.e. r(i) ≤ ri; this allows us to enforce a rank constraint on T simply by re- stricting the dimensions ri of g, as described in §6. CP Decomposition: CP decomposition represents a d1×d2×. . .×dK tensor T as a sum of rank-one tensors (i.e. a sum of outer products of K vectors): T = r(cid:88)j=1 W1[j, :] ⊗ W2[j, :] ⊗ . . . ⊗ WK[j, :] (2) where each Wi is an r × di matrix and Wi[j, :] is the vector of its j-th row. For CP decomposition, the rank r of a tensor T is defined to be the number of rank-one tensors in the decomposition. CP decom- position can be viewed as a special case of Tucker decomposition in which r1 = r2 = . . . = rK = r and g is a superdiagonal tensor. 3 Factorization of Lexical Features Suppose we have feature φ that includes information from a label y, multiple lexical items w1, . . . , wn and non-lexical property u. This feature can be fac- torized as a conjunction of each part: φ = y ∧ u ∧ w1∧. . .∧wn. The feature fires when all (n+2) parts fire in the instance (reflected by the ∧ symbol in φ). The one-hot representation of φ can then be viewed as a tensor eφ = y⊗ u⊗ w1 ⊗···⊗ wn, where each feature part is also represented as a one-hot vector.2 Figure 1d illustrates this case with two lexical parts. Given an input instance x and its associated la- bel y, we can extract a set of features S(x, y). In 2u, y, wi denote one-hot vectors instead of symbols. a traditional log-linear model, we view the instance x as a bag-of-features, i.e. a feature vector F (x, y). Each dimension corresponds to a feature φ, and has value 1 if φ ∈ S(x, y). Then the log-linear model scores the instance as s(x, y; w) = wT F (x, y) = (cid:80)φ∈S(x,y) s(φ; w), where w is the parameter vec- tor. We can re-write s(x, y; w) based on the factor- ization of the features using tensor multiplication; in which w becomes a parameter tensor T : s(x, y; w) = s(x, y;T ) = (cid:88)φ∈S(x,y) s(φ;T ) (3) Here each φ has the form (y, u, w1, . . . , wn), and (4) s(φ;T ) = T ×l y ×f u ×w1 w1... ×wn wn. Note that one-hot vectors wi of words themselves are large (wi > 500k), thus the above formulation with parameter tensor T can be very large, making parameter estimation difficult. Instead of estimating only the values of the dimensions which appear in training data as in traditional methods, we will re- duce the size of tensor T via a low-rank approxima- tion. With different approximation methods, (4) will have different equivalent forms, e.g. (6), (7) in §4.1. Optimization objective: The loss function (cid:96) for training the log-linear model uses (3) for scores, e.g., exp{s(x,y;T )} the log-loss (cid:96)(x, y;T ) = − log . y(cid:48)∈L exp{s(x,y(cid:48);T )} Learning can be formulated as the following opti- mization problem: (cid:80) T minimize: (cid:96)(x, y;T ) (cid:88)(x,y)∈D subject to:  rank(T ) ≤ (r1, r2, ..., rn+2) (Tucker-form) rank(T ) ≤ r (CP-form) (5) where the constraints on rank(T ) depend on the cho- sen tensor approximation method (§2). The above framework has some advantages: First, as discussed in §1 and here, we hope the represen- tations capture rich interactions between different parts of the lexical features; the low-rank tensor ap- proximation methods keep the most important inter- action information of the original tensor, while sig- nificantly reducing its size. Second, the low-rank structure will encourage weight-sharing among lex- ical features with similar decomposed parts, leading to better model generalization. Note that there are examples where features have different numbers of multiple lexical parts, such as both unigram and bi- gram features in PP-attachment. We will use two different methods to handle these features (§5). factorization) Remarks Compared to prior work, e.g. (Lei et al., 2014; Lei et al., 2015), the proposed factorization has the following advantages: (advantages of our 1. Parameter explosion when mapping a view with lexical properties to its representation vec- tor (as will be discussed in 4.3): Our factoriza- tion allows the model to treat word embeddings as inputs to the views of lexical parts, dramati- cally reducing the parameters. Prior work can- not do this since its views are mixtures of lexi- cal and non-lexical properties. Note that Lei et al. (2014) uses embeddings by concatenating them to specific views, which increases dimen- sionality, but the improvement is limited. 2. No weight-sharing among conjunctions with same lexical property, like the child-word "word(c)" and its conjunction with head-postag "word(c) ∧ word(g)" in Figure 1(b). The fac- torization in prior work treats them as indepen- dent features, greatly increasing the dimension- ality. Our factorization builds representations of both features based on the embedding of "word(c)", thus utilizing their connections and reducing the dimensionality. The above advantages are also key to overcome the problems of prior work mentioned at the end of §1. 4 Feature Representations via Low-rank Tensor Approximations Using one-hot encodings for each of the parts of fea- ture φ results in a very large tensor. This section shows how to compute the score in (4) without con- structing the full feature tensor using two tensor ap- proximation methods (§4.1 and §4.2). We begin with some intuition. To score the orig- inal (full rank) tensor representation of φ, we need a parameter tensor T of size d1 × d2 × . . . × dn+2, where d3 = ··· = dn+2 = V is the vocabulary size, n is the number of lexical parts in the feature and d1 = L and d2 = F are the number of different labels and non-lexical properties, respec- tively. (§5 will handle n varying across features.) Our methods reduce the tensor size by embedding each part of φ into a lower dimensional space, where we represent each label, non-lexical property and words with an r1, r2, r3, . . . , rn+2 dimensional vec- tor respectively (ri (cid:28) di, ∀i). These embedded features can then be scored by much smaller ten- sors. We denote the above transformations as ma- trices Wl ∈ Rr1×d1, Wf ∈ Rr2×d2, Wi ∈ Rri+2×di+2 for i = 1, . . . , n, and write corresponding low- dimensional hidden representations as h(l) y = Wly, u = Wf u and h(i) h(f ) In our methods, the above transformations of em- beddings are parts of low-rank tensors as in (5), so the embeddings of non-lexical properties and la- bels can be trained simultaneously with the low-rank tensors. Note that for one-hot input encodings the transformation matrices are essentially lookup ta- bles, making the computation of these transforma- tions sufficiently fast. w = Wiw. 4.1 Tucker Form For our first approximation, we assume that tensor T has a low-rank Tucker decomposition: T = g ×l Wl ×f Wf ×w1 W1 ×w2 ··· ×wn Wn. We can then express the scoring function (4) for a feature φ = (y, u, w1, . . . wn) with n-lexical parts, as: s(y, u, w1,··· , wn; g, Wl, Wf ,{Wi}n = g ×l h(l) u ×w1 h(1) y ×f h(f ) i=1) w1 ··· ×wn h(n) wn , (6) u , h(l) which amounts to first projecting u, y, and wi (for all i) to lower dimensional vectors h(f ) y , h(i) wi , and then weighting these hidden representations us- ing the flattened core tensor g. The low-dimensional representations and the corresponding weights are learned jointly using a discriminative (supervised) criterion. We call the model based on this repre- sentation the Low-Rank Feature Representation with Tucker form, or LRFRn-TUCKER. 4.2 CP Form For the Tucker approximation the number of param- eters in (6) scale exponentially with the number of lexical parts. For instance, suppose each h(i) wi has di- mensionality r, then g ∝ rn. To address scalabil- ity and further control the complexity of our tensor based model, we approximate the parameter tensor using CP decomposition as in (2), resulting in the following scoring function: s(y, u, w1,··· , wn; Wl, Wf ,{Wi}n . (7) r(cid:88)j=1(cid:16)h(l) y ◦ h(f ) u ◦ h(1) i=1) = wn(cid:17)j w1 ◦ ··· ◦ h(n) We call this model Low-Rank Feature Representa- tion with CP form (LRFRn-CP). 4.3 Pre-trained Word Embeddings One of the computational and statistical bottlenecks in learning these LRFRn models is the vocabulary size; the number of parameters to learn in each ma- trix Wi scales linearly with V and would require very large sets of labeled training data. To alle- viate this problem, we use pre-trained continuous word embeddings (Mikolov et al., 2013) as input embeddings rather than the one-hot word encodings. We denote the m-dimensional word embeddings by ew; so the transformation matrices Wi for the lexical parts are of size ri × m where m (cid:28) V . We note that when sufficiently large labeled data is available, our model allows for fine-tuning the pre-trained word embeddings to improve the expres- sive strength of the model, as is common with deep network models. Remarks Our LRFRs introduce embeddings for non-lexical properties and labels, making them bet- ter suit the common setting in NLP: rich linguistic properties; and large label sets such as open-domain tasks (Hoffmann et al., 2010). The LRFR-CP better suits n-gram features, since when n increases 1, the only new parameters are the corresponding Wi. It is also very efficient during prediction (O(nr)), since the cost of transformations can be ignored with the help of look-up tables and pre-computing. 5 Learning Representations for n-gram Lexical Features of Mixed Lengths For features with n lexical parts, we can train an LRFRn model to obtain their representations. How- ever, we often have features of varying n (e.g. both unigrams (n=1) and bigrams (n=2) as in Figure 1). We require representations for features with arbi- trary different n simultaneously. We propose two solutions. The first is a straight- forward solution based on our framework, which handles each n with a (n+2)-way tensor. This strat- egy is commonly used in NLP, e.g. Taub-Tabib et al. (2015) have different kernel functions for differ- ent order of dependency features. The second is an approximation method which aims to use a single tensor to handle all ns. Multiple Low-Rank Tensors Suppose that we can divide the feature set S(x, y) into subsets S1(x, y), S2(x, y), . . . , Sn(x, y) which correspond to features with one lexical part (unigram features), two lexical parts (bigram features), . . . and n lexi- cal parts (n-gram features), respectively. To handle these types of features, we modify the training ob- jective as follows: where the score of a training instance (x, y) is de- T1,T2,··· ,Tn (cid:88)(x,y)∈D (cid:96)(x, y;T1,T2, . . . , ...Tn), i=1(cid:80)φ∈Si(x,y) s(φ;Ti). We fined as s(x, y;T ) =(cid:80)n use the Tucker form low-rank tensor for T1, and the CP form for Ti (∀i > 1). We refer to this method as LRFR1-TUCKER & LRFR2-CP. minimize (8) Word Clusters Alternatively, to handle different numbers of lexical parts, we replace some lexical parts with discrete word clusters. Let c(w) denote the word cluster (e.g. from Brown clustering) for word w. For bigram features we have: s(y, u, w1, w2;T ) = s(y, u∧c(w1), w2;T ) + s(y, u∧c(w2), w1;T ) = T ×l y ×f (u ∧ c(w1)) ×w ew2 + T ×l y ×f (u ∧ c(w2)) ×w ew1 (9) where for each word we have introduced an addi- tional set of non-lexical properties that are conjunc- tions of word clusters and the original non-lexical properties. This allows us to reduce an n-gram feature representation to a unigram representation. The advantage of this method is that it uses a sin- gle low-rank tensor to score features with different numbers of lexical parts. This is particularly helpful when we have very limited labeled data. We denote this method as LRFR1-BROWN, since we use Brown clusters in practice. In the experiments we use the Tucker form for LRFR1-BROWN. 6 Parameter Estimation The goal of learning is to find a tensor T that solves problem (5). Note that this is a non-convex objec- tive, so compared to the convex objective in a tradi- tional log-linear model, we are trading better fea- ture representations with the cost of a harder op- timization problem. While stochastic gradient de- scent (SGD) is a natural choice for learning rep- resentations in large data settings, problem (5) in- volves rank constraints, which require an expensive proximal operation to enforce the constraints at each iteration of SGD. We seek a more efficient learning algorithm. Note that we fixed the size of each trans- formation matrix Wi ∈ Rri×di so that the smaller dimension (ri < di) matches the upper bound on the rank. Therefore, the rank constants are always sat- isfied through a run of SGD and we in essence have an unconstrained optimization problem. Note that in this way we do not guarantee orthogonality and full- rank of the learned transformation matrices. These properties are assumed in general, but are not neces- sary according to (Kolda and Bader, 2009). The gradients are computed via the chain-rule. We use AdaGrad (Duchi et al., 2011) and apply L2 regularization on all Wis and g, except for the case of ri=di, where we will start with Wi = I and reg- ularize with (cid:107)Wi - I(cid:107)2. We use early-stopping on a development set. 7 Experimental Settings We evaluate LRFR on three tasks: relation extraction, PP attachment and preposition disambiguation (see Table 1 for a task summary). We include detailed feature templates in Table 2. PP-attachment and relation extraction are two fundamental NLP tasks, and we test our models on the largest English data sets. The preposition disam- biguation task was designed for compositional se- mantics, which is an important application of deep learning and distributed representations. On all these tasks, we compare to the state-of-the-art. We use the same word embeddings in Belinkov et al. (2014) on PP-attachment for a fair comparison. For the other experiments, we use the same 200-d word embeddings in Yu et al. (2015). Relation Extraction We use the English portion of the ACE 2005 relation extraction dataset (Walker et al., 2006). Following Yu et al. (2015), we use both gold entity spans and types, train the model on the news domain and test on the broadcast conversation domain. To highlight the impact of training data size we evaluate with all 43,518 relations (entity mention pairs) and a reduced training set of the first 10,000 relations. We report precision, recall, and F1. We compare to two baseline methods: 1) a log- linear model with a rich binary feature set from Sun et al. (2011) and Zhou et al. (2005) as described in Yu et al. (2015) (BASELINE); 2) the embedding model (FCM) of Gormley et al. (2015), which uses rich linguistic features for relation extraction. We use the same feature templates and evaluate on fine- grained relations (sub-types, 32 labels) (Yu et al., 2015). This will evaluate how LRFR can utilize non- lexical linguistic features. PP-attachment We consider the prepositional phrase (PP) attachment task of Belinkov et al. (2014),3 where for each PP the correct head (verbs or nouns) must be selected from content words be- fore the PP (within a 10-word window). We formu- late the task as a ranking problem, where we opti- mize the score of the correct head from a list of can- didates with varying sizes. PP-attachment suffers from data sparsity because of bi-lexical features, which we will model with methods in §5. Belikov et al. show that rich fea- tures – POS, WordNet and VerbNet – help this task. The combination of these features give a large num- ber of non-lexical properties, for which embeddings of non-lexical properties in LRFR should be useful. We extract a dev set from section 22 of the PTB following the description in Belinkov et al. (2014). Preposition Disambiguation We consider the preposition disambiguation task proposed by Ritter et al. (2014). The task is to determine the spatial re- lationship a preposition indicates based on the two objects connected by the preposition. For example, "the apple on the refrigerator" indicates the "support by Horizontal Surface" relation, while "the apple on the branch" indicates the "Support from Above" re- lation. Since the meaning of a preposition depends 3 http://groups.csail.mit.edu/rbg/code/pp Task Relation Extraction PP-attachment Preposition Disambiguation Benchmark Yu et al. (2015) Belinkov et al. (2014) Ritter et al. (2014) Dataset ACE 2005 WSJ Ritter et al. (2014) 32 - 6 1,213 / 607 264 9/3 Numbers on Each View #Labels (d1) #Non-lexical Features (d2) Table 1: Statistics of each task. PP-attachment and preposition disambiguation have both unigram and bigram fea- tures. Therefore we list the numbers of non-lexical properties for both types. Set HeadEmb Context In-between On-path Set Bag of Words Word-Position Preposition Template {I[i = h1], I[i = h2]} (head of M1/M2) I[i = h1/h2 ± 1] (left/right token of wh1/h2 ) I[i > h1]&I[i < h2]&{φ, th1 , th2 , th1 &th2} &{φ, th1 , th2 , th1 &th2} I[wi ∈ P ] &{φ, th1 , th2 , th1 &th2} Template w, p & w (w is wm or wh) wm, wh, wm & wh p, p & wm, p & wh, p & wm & wh Set Bag of Words Distance Prep POS NextPOS VerbNet WordNet Template w (w is wm or wh), wm&wh Dis(wh, wm) & {wm, wh, wm&wh} wp & {wm, wh, wm&wh} t(wh) & {wm, wh, wm&wh} t(wh+1) & {wm, wh, wm&wh} P = {p(wh)} & {wm, wh, wm&wh} I[wp ∈ P ] & {wm, wh, wm&wh} Rh = {r(wh)} & {wm, wh, wm&wh} Rm = {r(wm)} & {wm, wh, wm&wh} Table 2: Up-left: Unigram lexical features (only showing non-lexical parts) for relation extraction (from Yu et al. (2014)). We denote the two target entities as M1, M2 (with head indices h1, h2, NE types th1, th2), and their dependency path as P . Right: Uni/bi-gram feature for PP-attachment: Each feature is defined on tuple (wm, wp, wh), where wp is the preposition word, wm is the child of the preposition, and wh is a candidate head of wp. t(w): POS tag of word w; p(w): a preposition collocation of verb w from VerbNet; r(w): the root hypernym of word w in WordNet. Dis(·,·): the number of candidate heads between two words. Down-left: Uni/bi-gram feature for preposition disambiguation (for each preposition word p, its modifier noun wm and head noun wh). Since the sentences are different from each other on only p, wm and wh, we ignore the words on the other positions. on the combination of both its head and child word, we expect conjunctions between these word embed- dings to help, i.e. features with two lexical parts. We include three baselines: point-wise addition (SUM) (Mitchell and Lapata, 2010), concatena- tion (Ritter et al., 2014), and an SVM based on hand- crafted features in Table 2. Ritter et al. show that the first two methods beat other compositional models. Hyperparameters are all tuned on the dev set. The chosen values are learning rate η = 0.05 and the weight of L2 regularizer λ = 0.005 for LRFR, except for the third LRFR in Table 3 which has λ = 0.05. We select the rank of LRFR-TUCKER with a grid search from the following values: r1 = {10, 20, d1}, r2 = {20, 50, d2} and r3 = {50, 100, 200}. For LRFR-CP, we select r = {50, 100, 200}. For the PP-attachement task there is no r1 since it uses a ranking model. For the Preposition Disambiguation we do not choose r1 since the number of labels is small. 8 Results Relation Extraction All LRFR-TUCKER models improve over BASELINE and FCM (Table 3), making these the best reported numbers for this task. How- ever, LRFR-CP does not work as well on the features with only one lexical part. The Tucker-form does a better job of capturing interactions between differ- ent views. In the limited training setting, we find that LRFR-CP does best. Additionally, the primary advantage of the CP approximation is its reduction in the number of model parameters and running time. We report each model's running time for a single pass on the de- velopment set. The LRFR-CP is by far the fastest. The first three LRFR-TUCKER models are slightly slower than FCM, because they work on dense non- lexical property embeddings while FCM benefits from sparse vectors. PP-attachment Table 4 shows that LRFR (89.6 and 90.3) improves over the previous best stan- dalone system HPCD (88.7) by a large margin, with exactly the same resources. Belinkov et al. (2014) also reported results of parsers and parser re-rankers, which can access to additional resources (complete parses for training and complete sentences as in- puts) so it is unfair to compare them with the stan- dalone systems like HPCD and our LRFR. Nonethe- Method BASELINE FCM LRFR1-TUCKER LRFR1-TUCKER LRFR1-TUCKER LRFR1-TUCKER LRFR1-CP r1 - r2 - r3 - Parameters Full Set (D=43,518) Reduced Set (D=10,000) P 60.2 32/N 264/N 200/N 62.9 32/N 200/Y 62.1 200/N 63.5 32/N 200/Y 62.4 20/Y 57.4 32/Y 50/Y 61.3 F1 55.3 55.4 57.0 56.6 56.1 54.8 55.5 R 51.2 49.6 52.7 51.1 51.0 52.4 50.7 F1 - 46.3 45.5 45.6 46.0 47.8 48.6 20/Y 20/Y 20/Y 20/Y 200/Y R - 37.1 40.8 40.1 41.2 46.1 41.6 P - 61.6 51.5 52.8 52.1 49.7 58.3 Prediction Time (ms) - 2,242 3,076 2,972 2,538 1,198 502 Table 3: Results on test for relation extraction. Y(es)/N(o) indicates whether embeddings are updated during training. System SVM (Belinkov et al., 2014) HPCD (Belinkov et al., 2014) LRFR1-TUCKER & LRFR2-CP LRFR1-BROWN RBG (Lei et al., 2014) Charniak-RS (McClosky et al., 2006) RBG + HPCD (combined model) Resources Used distance, word, embedding, clusters, POS, WordNet, VerbNet distance, embedding, POS, WordNet, VerbNet distance, embedding, POS, WordNet, VerbNet distance, embedding, clusters, POS, WordNet, VerbNet dependency parser dependency parser + re-ranker dependency parser + distance, embedding, POS, WordNet, VerbNet Acc 86.0 88.7 90.3 89.6 88.4 88.6 90.1 Table 4: PP-attachment test accuracy. The baseline results are from Belinkov et al. (2014). less LRFR1-TUCKER & LRFR2-CP (90.3) still out- performs the state-of-the-art parser RBG (88.4), re- ranker Charniak-RS (88.6), and the combination of the state-of-the-art parser and compositional model RBG + HPCD (90.1). Thus, even with fewer re- sources, LRFR becomes the new best system. Not shown in the table: we also tried LRFR1- TUCKER & LRFR2-CP with postag features only (89.7), and with grand-head-modifier conjunctions removed (89.3) . Note that compared to LRFR, RBG benefits from binary features, which also ex- ploit grand-head-modifier structures. Yet the above reduced models still work better than RBG (88.4) without using additional resources.4 Moreover, the results of LRFR can still be potentially improved by combining with binary features. The above results show the advantage of our factorization method, which allows for utilizing pre-trained word embed- dings, and thus can benefit from semi-supervised learning. Preposition Disambiguation LRFR improves (Ta- ble 5) over the best methods (SUM and Concate- nation) in Ritter et al. (2014) as well as the SVM Method SVM - Lexical Features SUM Concatenation LRFR1-TUCKER & LRFR2-CP LRFR1-BROWN LRFR1-BROWN - Control Accuracy 85.09 80.55 86.73 87.82 88.18 84.18 Table 5: Accuracy for spatial classification of PPs. based on the original lexical features (85.1). In this task LRFR1-BROWN better represents the unigram and bigram lexical features, compared to the usage of two low-rank tensors (LRFR1-TUCKER & LRFR2- CP). This may be because LRFR1-BROWN has fewer parameters, which is better for smaller training sets. We also include a control setting (LRFR1-BROWN - Control), which has a full rank parameter ten- sor with the same inputs on each view as LRFR1- BROWN, but represented as one hot vectors without transforming to the hidden representations hs. This is equivalent to an SVM with the compound cluster features as in Koo et al. (2008). It performs much worse than LRFR1-BROWN, showing the advantage of using word embeddings and low-rank tensors. 4Still this is not a fair comparison since we have differ- ent training objectives. Using RBG's factorization and training with our objective will give a fair comparison and we leave it to future work. Summary For unigram lexical features, LRFRn- TUCKER achieves better results than LRFRn-CP. However, in settings with fewer training examples, features with more lexical parts (n-grams), or when faster predictions are advantageous, LRFRn-CP does best as it has fewer parameters to estimate. For n- grams of variable length, LRFR1-TUCKER & LRFR2- CP does best. In settings with fewer training exam- ples, LRFR1-BROWN does best as it has only one parameter tensor to estimate. 9 Related Work Dimensionality Reduction for Complex Features is a standard technique to address high-dimensional features, including PCA, alternating structural op- timization (Ando and Zhang, 2005), denoising au- toencoders (Vincent et al., 2008), and feature em- beddings (Yang and Eisenstein, 2015). These meth- ods treat features as atomic elements and ignore the inner structure of features, so they learn separate em- bedding for each feature without shared parameters. As a result, they still suffer from large parameter spaces when the feature space is very huge.5 Another line of research studies the inner struc- tures of lexical features: e.g. Koo et al. (2008), Turian et al. (2010), Sun et al. (2011), Nguyen and Grishman (2014), Roth and Woodsend (2014), and Hermann et al. (2014) used pre-trained word embed- dings to replace the lexical parts of features ; Sriku- mar and Manning (2014), Gormley et al. (2015) and Yu et al. (2015) propose splitting lexical fea- tures into different parts and employing tensors to perform classification. The above can therefore be seen as special cases of our model that only embed a certain part (view) of the complex features. This restriction also makes their model parameters form a full rank tensor, resulting in data sparsity and high computational costs when the tensors are large. Composition Models (Deep Learning) build rep- resentations for structures based on their component word embeddings (Collobert et al., 2011; Bordes et al., 2012; Socher et al., 2012; Socher et al., 2013b). When using only word embeddings, these models achieved successes on several NLP tasks, but some- times fail to learn useful syntactic or semantic pat- terns beyond the strength of combinations of word 5For example, a state-of-the-art dependency parser (Zhang and McDonald, 2014) extracts about 10 million features; in this case, learning 100-dimensional feature embeddings involves es- timating approximately a billion parameters. embeddings, such as the dependency relation in Fig- ure 1(a). To tackle this problem, some work de- signed their model structures according to a specific kind of linguistic patterns, e.g. dependency paths (Ma et al., 2015; Liu et al., 2015), while a recent trend enhances compositional models with linguis- tic features. For example, Belinkov et al. (2014) concatenate embeddings with linguistic features be- fore feeding them to a neural network; Socher et al. (2013a) and Hermann and Blunsom (2013) en- hanced Recursive Neural Networks by refining the transformation matrices with linguistic features (e.g. phrase types). These models are similar to ours in the sense of learning representations based on lin- guistic features and embeddings. Low-rank Tensor Models for NLP aim to handle the conjunction among different views of features (Cao and Khudanpur, 2014; Lei et al., 2014; Chen and Manning, 2014). Yu and Dredze (2015) pro- posed a model to compose phrase embeddings from words, which has an equivalent form of our CP- based method under certain restrictions. Our work applies a similar idea to exploiting the inner struc- ture of complex features, and can handle n-gram features with different ns. Our factorization (§3) is general and easy to adapt to new tasks. More impor- tantly, it makes the model benefit from pre-trained word embeddings as shown by the PP-attachment results. 10 Conclusion We have presented LRFR, a feature representation model that exploits the inner structure of complex lexical features and applies a low-rank tensor to effi- ciently score features with this representation. LRFR attains the state-of-the-art on several tasks, includ- ing relation extraction, PP-attachment, and preposi- tion disambiguation. We make our implementation available for general use.6 Acknowledgements A major portion of this work was done when MY was visiting MD and RA at JHU. This research was supported in part by NSF grant IIS-1546482. 6https://github.com/Gorov/LowRankFCM References [Ando and Zhang2005] Rie Kubota Ando and Tong Zhang. 2005. A framework for learning predictive structures from multiple tasks and unlabeled data. The Journal of Machine Learning Research, 6. [Belinkov et al.2014] Yonatan Belinkov, Tao Lei, Regina Barzilay, and Amir Globerson. 2014. Exploring com- positional architectures and word vector representa- tions for prepositional phrase attachment. Transac- tions of the Association for Computational Linguistics, 2. [Bengio et al.2006] 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. [Bordes et al.2012] Antoine Bordes, Xavier Glorot, Ja- son Weston, and Yoshua Bengio. 2012. A seman- tic matching energy function for learning with multi- relational data. Machine Learning. [Cao and Khudanpur2014] Yuan Cao and Sanjeev Khu- In danpur. 2014. Online learning in tensor space. Proceedings of the 52nd Annual Meeting of the Associ- ation for Computational Linguistics (Volume 1: Long Papers). [Chen and Manning2014] Danqi Chen and Christopher 2014. A fast and accurate dependency In Proceedings of Manning. parser using neural networks. EMNLP. [Collobert et al.2011] Ronan Collobert, Jason Weston, L´eon Bottou, Michael Karlen, Koray Kavukcuoglu, and Pavel Kuksa. 2011. Natural language processing (almost) from scratch. JMLR, 12. [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. [Gormley et al.2015] Matthew R. Gormley, Mo Yu, and Mark Dredze. 2015. Improved relation extraction with feature-rich compositional embedding models. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing. [Hermann and Blunsom2013] Karl Moritz Hermann and Phil Blunsom. 2013. The role of syntax in vector space models of compositional semantics. In Associa- tion for Computational Linguistics. [Hermann et al.2014] Karl Moritz Hermann, Dipanjan Das, Jason Weston, and Kuzman Ganchev. 2014. Se- mantic frame identification with distributed word rep- resentations. In Proceedings of the 52nd Annual Meet- ing of the Association for Computational Linguistics (Volume 1: Long Papers). [Hoffmann et al.2010] Raphael Congle Zhang, and Daniel S. Weld. 2010. Learning 5000 Hoffmann, the 48th relational extractors. Annual Meeting of the Association for Computational Linguistics. In Proceedings of [Kolda and Bader2009] Tamara G Kolda and Brett W Bader. 2009. Tensor decompositions and applications. SIAM review, 51(3). [Koo et al.2008] Terry Koo, Xavier Carreras, and Michael Collins. 2008. Simple semi-supervised dependency parsing. In Proceedings of ACL. [Lei et al.2014] Tao Lei, Yu Xin, Yuan Zhang, Regina Barzilay, and Tommi Jaakkola. 2014. Low-rank ten- In Proceed- sors for scoring dependency structures. ings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). [Lei et al.2015] Tao Lei, Yuan Zhang, Llu´ıs M`arquez, Alessandro Moschitti, and Regina Barzilay. 2015. High-order low-rank tensors for semantic role label- In Proceedings of the 2015 Conference of the ing. North American Chapter of the Association for Com- putational Linguistics: Human Language Technolo- gies. [Liu et al.2015] Yang Liu, Furu Wei, Sujian Li, Heng Ji, Ming Zhou, and Houfeng WANG. 2015. A dependency-based neural network for relation classi- fication. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Lan- guage Processing (Volume 2: Short Papers). [Ma et al.2015] Mingbo Ma, Liang Huang, Bowen Zhou, and Bing Xiang. 2015. Dependency-based convo- lutional neural networks for sentence embedding. In Proceedings of the 53rd Annual Meeting of the Associ- ation for Computational Linguistics and the 7th Inter- national Joint Conference on Natural Language Pro- cessing (Volume 2: Short Papers). [McClosky et al.2006] David McClosky, Eugene Char- niak, and Mark Johnson. 2006. Effective self-training for parsing. In Proceedings of the main conference on human language technology conference of the North American Chapter of the Association of Computa- tional Linguistics. [Mikolov et al.2013] Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. 2013. Dis- tributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pages 3111–3119. [Miller et al.2004] Scott Miller, Jethran Guinness, and Alex Zamanian. 2004. Name tagging with word clus- In Proceedings of ters and discriminative training. HLT-NAACL. [Mitchell and Lapata2010] Jeff Mitchell and Mirella La- pata. 2010. Composition in distributional models of semantics. Cognitive science, 34(8). ACE 2005 multilingual training corpus. Linguistic Data Consortium, Philadelphia. [Yang and Eisenstein2015] Yi Yang and Jacob Eisenstein. 2015. Unsupervised multi-domain adaptation with feature embeddings. In Proceedings of the 2015 Con- ference of the North American Chapter of the Asso- ciation for Computational Linguistics: Human Lan- guage Technologies, pages 672–682, Denver, Col- orado, May–June. Association for Computational Lin- guistics. [Yu and Dredze2015] Mo Yu and Mark Dredze. 2015. Learning composition models for phrase embeddings. Transactions of the Association for Computational Linguistics, 3. [Yu et al.2015] Mo Yu, Matthew R. Gormley, and Mark Dredze. 2015. Combining word embeddings and feature embeddings for fine-grained relation extrac- In North American Chapter of the Association tion. for Computational Linguistics (NAACL). [Zhang and McDonald2014] Hao Zhang and Ryan Mc- Donald. 2014. Enforcing structural diversity in cube- pruned dependency parsing. In Proceedings of ACL. [Zhou et al.2005] GuoDong Zhou, Jian Su, Jie Zhang, and Min Zhang. 2005. Exploring various knowledge in relation extraction. In Proceedings of ACL. [Nguyen and Grishman2014] Thien Huu Nguyen and Ralph Grishman. 2014. Employing word representa- tions and regularization for domain adaptation of rela- tion extraction. In Association for Computational Lin- guistics (ACL). [Ritter et al.2014] Samuel Ritter, Cotie Long, Denis Pa- perno, Marco Baroni, Matthew Botvinick, and Adele Goldberg. 2014. Leveraging preposition ambiguity to assess representation of semantic interaction in cdsm. In NIPS Workshop on Learning Semantics. [Roth and Woodsend2014] Michael Roth and Kristian Woodsend. 2014. Composition of word representa- tions improves semantic role labelling. In Proceedings of EMNLP. Socher, [Socher et al.2012] Richard Brody Huval, Christopher D. Manning, and Andrew Y. Ng. 2012. Semantic compositionality through recursive matrix- In Proceedings of EMNLP-CoNLL vector spaces. 2012. [Socher et al.2013a] Richard John Bauer, Christopher D Manning, and Andrew Y Ng. 2013a. Parsing with compositional vector grammars. In Proceedings of ACL. Socher, [Socher et al.2013b] Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D. Manning, An- drew Ng, and Christopher Potts. 2013b. Recursive deep models for semantic compositionality over a sen- timent treebank. In Proceedings of EMNLP. Srikumar [Srikumar and Manning2014] Vivek and Christopher D Manning. 2014. Learning distributed representations for structured output prediction. In Advances in Neural Information Processing Systems. [Sun et al.2011] Ang Sun, Ralph Grishman, and Satoshi Sekine. 2011. Semi-supervised relation extraction with large-scale word clustering. In Proceedings of the 49th Annual Meeting of the Association for Computa- tional Linguistics: Human Language Technologies. [Taub-Tabib et al.2015] Hillel Taub-Tabib, Yoav Gold- berg, and Amir Globerson. 2015. Template kernels In Proceedings of the 2015 for dependency parsing. Conference of the North American Chapter of the As- sociation for Computational Linguistics: Human Lan- guage Technologies. [Turian et al.2010] Joseph Turian, Lev Ratinov, and Yoshua Bengio. 2010. Word representations: a simple and general method for semi-supervised learning. In Association for Computational Linguistics. [Vincent et al.2008] Pascal Vincent, Hugo Larochelle, Yoshua Bengio, and Pierre-Antoine Manzagol. 2008. Extracting and composing robust features with denois- ing autoencoders. In Proceedings of the 25th interna- tional conference on Machine learning. [Walker et al.2006] Christopher Walker, Stephanie Strassel, Julie Medero, and Kazuaki Maeda. 2006.
1605.04359
1
1605
2016-05-14T01:13:48
Occurrence Statistics of Entities, Relations and Types on the Web
[ "cs.CL" ]
The problem of collecting reliable estimates of occurrence of entities on the open web forms the premise for this report. The models learned for tagging entities cannot be expected to perform well when deployed on the web. This is owing to the severe mismatch in the distributions of such entities on the web and in the relatively diminutive training data. In this report, we build up the case for maximum mean discrepancy for estimation of occurrence statistics of entities on the web, taking a review of named entity disambiguation techniques and related concepts along the way.
cs.CL
cs
Occurrence Statistics of Entities, Relations and Types on the Web Submitted in partial fulfillment of requirements for the degree of Master of Technology by Aman Madaan Under the Guidance of Prof. Sunita Sarawagi 6 1 0 2 y a M 4 1 ] L C . s c [ 1 v 9 5 3 4 0 . 5 0 6 1 : v i X r a Department of Computer Science and Engineering Indian Institute of Technology Bombay April, 2014 Occurrence Statistics of Entities, Relations and Types on the Web April 2014 Abstract The problem of collecting reliable estimates of occur- rence of entities on the open web forms the premise for this report. The models learned for tagging en- tities cannot be expected to perform well when de- ployed on the web. This is owing to the severe mis- match in the distributions of such entities on the web and in the relatively diminutive training data. In this report, we build up the case for maximum mean discrepancy for estimation of occurrence statistics of entities on the web, taking a review of named en- tity disambiguation techniques and related concepts along the way. 1 Introduction 1.1 Problem Statement that make sense, which understands what the user is looking for and which is gifted with the intelligence of locating the desideratum. There are several pieces in the puzzle of the semantic web, this report is an attempt to understand one important piece; entities on the web and their co occurrence statistics. Given a knowledge base such as Yago or Freebase consisting of entities and relations, and the Web, our goal is to attach reliable estimates of the frequency of occurrences on the Web of various entities and re- lations as singletons, pairs (ordered and unordered) in a sentence. The aim is to collect statistics so as to be able to assign prior probabilities to the set of entities and relations that can co-exist in a sentence or a paragraph. These statistics have applications in query interpretation and language understanding tasks. We can view it as being analogous to statistics in relational catalogs. The Internet is a web of mostly unstructured knowl- edge woven around things. However, these things; people, places, technologies, movies, products, books etc. are mostly just mentioned by their name, with other crucial bits of information about them scattered around the point of mention. The cosmic scale of such unstructured information has stemmed the dream of a semantic web. A web which is aware of the links 1.2 Named Entity Recognition and Disambiguation For collecting the statistics about entities on the web, we need a method to determine which words in the free flowing interminable text are of interest, i.e. rep- resent entities. Consider the following sentence : 1 Michael Jordan is a Professor at Berkeley We first want to identify all the named entities in the text. The task is called named entity recognition and is formally defined as : Definition 1 (Named entity recognition1) Named-entity recognition (NER) (also known as entity identification and entity extraction) is a subtask of information extraction that seeks to locate and classify atomic elements in text into predefined categories such as the names of persons, organi- zations, locations, expressions of times, quantities, monetary values, percentages, etc. but we do not stop at that, we want to link each of the named entities thus recognized to a knowledge base2. Thus, our problem has a 2 step solution : • Step 1 : Identify entities Michael Jordan PERSON is a professor at Berkeley INSTITUTION • Step 2 : Link entities to knowledge bases : Jordan ENTITY Michael wikipedia.org/wiki/Michael_I._Jordan) is a professor at Berkeley ENTITY (http: //en.wikipedia.org/wiki/University_of_ California,_Berkeley) (http://en. The stanford NER library is a popular choice for recognizing named entities. [5] 1.2.1 Applications In simple terms, disambiguating named entities in the unstructured text imparts a structure to the document. We need two more data points to further appreciate the power that such a tool provides to us. The first is the size of the web. As of 31st March 2014, there are atleast 1.8 billon indexed web pages.[7] The second is the number of wikipedia entities. The wikipedia statistics [8] esti- mate the number of pages to be around 32 million. 2The knowledge base is a catalog of entities, like Wikipedia. Refer section [2] 2 Yago, a catalog of entities made from wikipedia has 12, 727, 222 entities. Imparting structure to documents at this magnitude has far reaching implications in the information extraction and is a bridge towards the hitherto dream of a semantic web. is highly recommended that reader http://www.google.co.in/insidesearch/ google It pays features/search/knowledge.html, knowledge graph project, a visit. the the 1.2.2 Terminology The following terms are widely used in the literature on named entity disambiguation and thus in this ar- ticle. • Mention, Spot A piece of text which needs to be disambiguated. For example, the sentence "Amazon has at- tracted a lot of visitors". • Entity A named entity as defined in the definition 1. • Candidates A set of entities which might be the correct dis- ambiguation for a given mention. For example, possible candidates for the sentence above are "Amazon river" and "Amazon.com". • Prior Probability of a mention linking to a particular entity. For example, the mention "Amazon" may be used to refer to the website (say) 60% of the time. • Knowledge base A catalog of Entities where an entity is as defined above. For example, Wikipedia or yago. 1.3 A Baseline : Label and Collect The baseline which presents itself given the above problem is labeling the corpora with the named enti- ties and then collecting the markings, keeping track of which entity was seen when along the way. As in- tuitive as it seems, the method is unlikely to perform well in the present scenario, owing to the mismatch in the training and test distribution [20]. Our training data, hand labeled corpora, is paltry in comparison with the massive open web, where such systems are supposed to be deployed. This is true even for large training datasets like the Wikipedia. 1.4 Maximum mean discrepancy The observation that we don't really want the indi- vidual labels is a first step towards a better solution. There are 3 reported methods for direct estimation of class ratios [20]. We are interested in using one of them, maximum mean discrepancy (mmd) for solving the problem in hand. We introduce mmd and propose a formulation for determining class ratios in section 5. 1.5 Structure Section 2 gives an overview of what are knowledge bases. This is important since the concept of such repositories of structured knowledge is central to the report. Section 3 begins with an introduction to the prob- lem of named entity disambiguation, the terminol- ogy and applications, and goes on to cover the tech- niques for named entity disambiguation in some de- tail. We give and overview of the two broad categories of disambiguation techniques, Local and global dis- ambiguation. Section 4 begins with a discussion on definition of Aggregate statistics and some of their applications. Finally, in section 5, we discuss Maximum mean dis- crepancy and its application for estimating the ag- gregate statistics over entities. 2 Structured Knowledge Repositories 2.1 What are knowledge bases? Before the digital age, Encyclopedias, such as the En- cyclopedia Britannica were hailed as the repositories containing all that is known to the mankind. As the computer age dawned, it didn't take long for people to realize that a lot can be achieved if somehow all this information could be made available in a digi- tal format. Wordnet [15] was perhaps the first such attempt. As the years passed, the research effort in the field of information extraction and creating struc- tured knowledge got a huge pat on the back from the explosion of the web. Wikipedia catalyzed the com- munity, which motivated development of structured knowledge bases like dbpedia and yago. We discuss how knowledge bases fit in the context of named entity disambiguation, and give a list of several important knowledge bases, along with links to each for the interested reader. 2.2 Knowledge bases and Named En- tity Disambiguation Many named entity disambiguation algorithms ex- ploit large knowledge bases. On the other hand, reli- able named entity disambiguators will be conducive towards fabrication of gargantuan knowledge bases from the open web. We thus see a chicken and egg situation here. As is often the case in such standoffs, the cycle is broken with the help of extensive man- ual effort. In the present case, Wikipedia helps the situation. 2.3 Existing Knowledge Bases We give a brief overview of some of the popular knowledge bases. 2.3.1 Wordnet • Wordnet has a clean, hand crafted type hi- erarchy. Well documented APIs, such as the nltk toolkit (http://www.nltk.org/howto/ wordnet.html) are available for using wordnet for a plethora of tasks, such as listing all the senses of a word, finding distances between 2 concepts and the likes. • Introduction to Wordnet http://wordnetcode. princeton.edu/5papers.pdf 3 2.3.2 YAGO • An attempt to create a knowledge base the clean type hierarchy of that combines information that wordnet with the huge Wikipedia provides. http://www.mpi-inf. mpg.de/yago-naga/yago/ has link to an online interface. Refer [16] for details. intuition behind having a global strategy for disam- biguation, and the optimization problem that results from such an objective. The final section summarizes a recent work which pragmatically selects global and local evidences, to get the best of both worlds. 3.1 Local Disambiguation of named 2.3.3 DBpedia • DBpedia http://dbpedia.org/About extracts information from the Wikipedia into RDF and provides an interface that can be used to ask se- mantic questions. Users can use SPARQL to ask complicated queries with results spanning sev- eral pages. Amazon also provides a DBpedia machine image for the users of AWS. 2.3.4 Patty • Patty http://www.mpi-inf.mpg.de/ yago-naga/patty/ is a repository of rela- tion patterns. The aim is to create "Wordnet" for relations. The authors also create a sub- sumption hierarchy for the 350, 569 pattern synsets. Refer [18] for details. 2.3.5 Freebase • Freebase [19] relies on crowd sourcing for cre- ation of a rich but clean knowledge base. The de- velopment of Freebase follows the same chain as Wikipedia, with users flagging issues, and clean- ing and augmenting information. Freebase also provides access to itself using web APIs. 3 Named Entity Disambigua- tion Techniques We have already given an introduction to the problem and the applications in the introduction. The next section discusses the solutions based on local disam- biguation, i.e., figuring out the correct entity based on just the local evidences. Section 3.2 discusses the entities 3.1.1 Introduction In local disambiguation, we collect just local evi- dences for each mention for its disambiguation. This was state of the art until the CSAW[1] paper came along. We start by defining the problem and dis- cussing the general form of solutions. We then pro- vide a short summary of approach followed in Wikify [9] and the famous Milne and Witten paper [6]. A solution based on machine learning[1] concludes the subsection. 3.1.2 Problem definition We need to disambiguate a mention by collecting the local evidences. The evidences can be anything, POS tags, gender information, dictionary lookup etc. By local disambiguation, we mean that we cannot use the disambiguation information for any other entities for solving the problem. 3.1.3 Solutions Every local disambiguation techniques fall into one of the following two categories[9] • Knowledge based Derived from the classical word sense disam- biguation literature, this technique depends on the information drawn from the definitions pro- vided by the knowledge base. (See Lesk's algo- rithm [14]). This is based on the overlap of con- text with the definitions of each of the candidate senses as given in the knowledge base. • Machine Learning based This method is based on collecting features from the mention and its surroundings, and training 4 a classifier to give a verdict on a particular sense being a likely disambiguation of a mention. Ma- chine learning based local disambiguation was almost unanimously adopted by the ned com- munity as the solution for local disambiguation. AIDA changed the scene by introducing a knowl- edge based local similarity score which works well. 3.1.4 Related Work Wikify[9] The biggest contribution of this paper is perhaps presenting Wikipedia as the catalog against which were supposed to disambiguate. The paper also identifies two broad methods of doing named entity disambiguation : Knowledge based and data based. Since the paper dates back to 2007, when the problem of NED was not as established, there are a lot of references to the problem of word disambigua- tion. Learning to link with Wikipedia[6] This paper de- fined three different features for disambiguation : • Commonness : This is the prior defined in Chap- ter 1. this paper, the relatedness • Relatedness : Perhaps the biggest contribution of score, gives a measure for determining how similar the two entities are. This measure is based on the number of common inlinks to entities in question. The relatedness measure as defined here has been used in a lot of works. In fact, all the approaches presented in the subsequent subsections use this relatedness score, popular as the Milne-Witten score for finding out entity entity similarity. This score is defined as follows r(γ, γ(cid:48)) = logg(γ)(cid:84) g(γ(cid:48))−log(max{g(γ),(γ(cid:48))}) logc−log(min{g(γ),(γ(cid:48))}) Where -- g(γ) : Set of wikipedia pages that link to γ -- c : Total number of Wikipedia pages -- r(γ, γ(cid:48)) : Relatedness of topics γ and γ(cid:48) The algorithm selects a few unambiguous links in the document, and uses the similarity of the candidates with these unambiguous links as a criteria for disam- biguation. Thus, in some sense, although the tech- nique is not totally local, it shies away from doing anything to maintain coherence among the entities that are unveiled and thus we do not call this method a "Global method", which are discussed in the follow- ing subsection. 3.1.5 Machine learning based local disam- biguation As mentioned, there are primarily two approaches for local disambiguation. This subsection discusses a machine learning based local disambiguation method in some detail. This subsection is based on the local disambiguation approach taken in [1]. Definitions We first repeat the definitions for quick reference : • s : Spot, an Entity to be disambiguated (Chris- tian leader John Paul) • γ : An entity label value (http://en. wikipedia.org/wiki/Po-pe_John_Paul_II) • fs(γ) : A feature function that creates a vector of features given a spot and a candidate entity label. Local compatibility : Feature design The feature function takes the spot and the candidate as argu- ments. • The following information about a candidate γ is used -- Text from the first descriptive paragraph of γ -- Text from the whole page for γ -- Anchor text within Wikipedia for γ. -- Anchor text and 5 tokens around γ • We now have 4 pieces of information about γ. We take each of these, and apply the following operations with one argument as the spot 5 -- Dot-product between word count vectors -- Cosine similarity in TFIDF vector space -- Jaccard similarity between word sets Thus, for a candidate - mention pair, we get a total of 12 Features (3 operations, 4 argument pairs). In addition to these, we also use a sense probability prior as defined in the introduction. A popular way of obtaining the prior is counting the number of times the spot has been linked to a particular entity. For example, the hypertext "Linux" might be linked to the page for the Linux kernel 70% of the times, and to the page for Linux based operating systems rest of the times. • Disambiguating each entity using the local clues misses out on a major piece of information : Topic of a page • A page is usually has one topic, you can expect all the entities to be related to the topic somehow Michael Jackson : 30 Disambiguations John Paul : 10 disambiguations But if they are mentioned on the same page, the page is most likely about Christianity, A big hint to- wards disambiguating both of them. Compatibility Score Once we have the features, we train the classifier by using the following optimization objective : Since the CSAW[1] paper, every work on named entity disambiguation includes a notion of Topical co- herence in the solution. • Local compatibility score between a spot s and a candidate is given by wT fs(γ) • w is trained using an SVM like training objective wT fs(γ) − wT fs(γ) ≥ 1 − s Finding the best candidate Note that a multi class classifier is not learned for several reasons, all of which can be mapped to the large number of classes. 3.2.2 Challenges Though the notion of topical coherence is very natu- ral and intuitive, there are a lot of challenges involved when it comes to actually mapping these intuitions to an optimization problem. We present the challenges involved and the solution given by the CSAW team. • Capturing local compatibility -- Create a scoring function to rank possible candidates 3.2 Collective Disambiguation of • Inculcating topical coherence in the overall ob- Named Entities 3.2.1 The key intuition jective -- Define Topical coherence We have seen several different "local" solutions, at- tempting to solve the problem by collecting evidence around a mention and then using it to disambiguate. Milne and Witten [6] came close to inculcating some sort of coherence, but they couldn't totally build up the intuition. It was after a wait of 2 years that CSAW [1] took the game to a whole new level by working on the following key intuition : • A document is usually about one topic Out of these two challenges, various solutions to the problem of capturing the local compatibility are presented in Chapter 2. In this subsection, we focus on the problem of collective disambiguation. 3.2.3 The Dominant Topic Model • Need to define a collective score based on pair- wise topical coherence of all γs used for labeling. 6 Data: A Document d Result: Annotated document d' with every mention linked to the best candidate entity foreach mention m in the document do calculate argmaxcm∈ΓwT fm(cm) where Γ = cm : cm is a possible disambiguation of m end Algorithm 1: Local disambiguation • The pairwise topical coherence, r(γs, γ(cid:48) s) is as de- fined above. • For a page, overall topical coherence : Σs(cid:54)=s(cid:48)∈S0r(γs, γ(cid:48) s) • Can be written as clique potential as in case of node potential exp(Σs(cid:54)=s(cid:48)∈S0r(γs, γ(cid:48) s)) 3.2.4 The Optimization objective With different notations as above, we would like to maximize the following to get the best results. Σs(cid:54)=s(cid:48)∈S0 r(γs, γ(cid:48) s) + 1S0 Σs∈S0wT fs(γ) 1 (S0 2 ) 3.2.5 Solving the optimization objective The authors compare 2 different approaches for solv- ing the optimization objective. • LP rounding approach Γ + Γ2 binary variables were introduced. The first set of binary variables decide the candidate that each mention takes, and the second set has one binary variable for each possible candidate pair. The authors relax this integer program- ming to a linear programming and then used rounding with a threshold of 0.5 to obtain the best solution. • Hill climbing Starting from all assignments set to NA, assign- ments are done based on local potentials only. The following figure ( from the paper) illustrates the process. 3 3.3 Pragmatic combination of Local and Global Disambiguations In verbose, we want that the entity-entity coher- ence be maximized, while choosing the disambigua- tion which is the best. 3Reproduced from [1] 3.3.1 Introduction Recall that Chapter 2 was about local disambigua- tion. In subsection 3, we saw how global disambigua- tion can be combined with the overall objective. A 7 recent work, Robust disambiguation of named en- tities in text [10], proposes that blindly opting for global disambiguation may not be always right. Con- sider the sentence : "Manchester will play Madrid in Barcelona". All the 3 named entities in the sentence are Cities as well as football clubs. Collective disambiguation may coerce all the three mentions to be either football clubs or cities. The work aims to solve this problem by being selective about when to go for collective dis- ambiguation. 3.3.2 Approach This approach first creates a mention to candidate graph. The sample graph for the sentence "They per- formed Kashmir written by Page and Plant. Page played unusual chord on his Gibson." is as shown below : Figure 1: Mention Entity Graph Having created the graph, we need to assign the edge weights. Clearly, there are 2 kinds of edges in- volved : • Mention - Entity edge : The authors used a knowledge based approach to assign this weight. This is as outlined in subsection 2. The details about this score are given in [11]. • Entity - Entity edge : Milne witten score as de- fined in subsection 2 is used for this purpose. With the graph ready, the authors pluck the in a greedy manner such that there is only one edge between each mention and entity. 8 3.4 Further Readings on Named En- tity Disambiguation For this report, only a small subset of the papers was selected to cover as much ground as possible. The following list may be valuable to the interested readers. • Mining evidences for named entity disam- biguation The authors discuss a modified LDA model for gathering more words that are impor- tant to disambiguate an entity. Li, Yang, et al. "Mining evidences for named entity disambigua- tion." Proceedings of the 19th ACM SIGKDD international conference on Knowledge discovery and data mining. ACM, 2013. • We have emphasized on Wikipedia as the catalog. The following work presents a general approach Sil, Avirup, et al. "Linking named entities to any database." Proceedings of the 2012 Joint Con- ference on Empirical Methods in Natural Lan- guage Processing and Computational Natural Language Learning. Association for Computa- tional Linguistics, 2012. • Large scale named entity disambiguation. Cucerzan, Silviu. "Large-Scale Named En- tity Disambiguation Based on Wikipedia Data." EMNLP-CoNLL. Vol. 7. 2007. • One of the initial works on NED Bunescu, Razvan C., and Marius Pasca. "Using Encyclopedic Knowledge for Named entity Dis- ambiguation." EACL. Vol. 6. 2006. • Quick entity annotations for short text Suchanek, Fabian M., Gjergji Kasneci, and Ger- hard Weikum. "Yago: a core of semantic knowl- edge." Proceedings of the 16th international con- ference on World Wide Web. ACM, 2007. 4 Distributional Statistics of 4.1.2 How often do the 2 entities appear to- Named entities gether? Once you have a catalog of things, it makes sense to ask which of these "things" are more important than the others. In fact, one might extend the ques- tion and ask, "Which pairs (or triples) of these things appear together on the open web?". We define sev- eral different statistics one might be interested in over these entity catalogs, discuss some applications, propose a baseline method and finally, prepare the ground for the next section by giving an outline of a solution which is aimed at directly providing us with the statistics we are looking for. 4.1 What Statistics? 4.1.1 Which sense dominates for an entity? For starters, we might want to calculate the number of times a particular "sense" of an entity4 is used. For example, the entity Michael Jordan has several disambiguations, : The Professor, Basketballer and the botinist. We want to find out the distribution of occurrences of these senses. We call this number the sense prior. It is important to note that Entity Prior is dif- ferent from mention prior, which is the fraction of times a mention links to a particular entity. For ex- ample, the text "Gingerbread" might refer to several different concepts; from perhaps the most famous An- droid 2.3 to the novel. Mention prior is to find out how many Gingerbreads mentions on the web refer to Gingerbread the Operating system. Entity sense prior would tell us how frequent is Gingerbread the OS compared with Gingerbread the novel. A second interesting statistic would be to count how many times do two given entities, taking two given senses appear together. For example, We might want to know how many times does Nokia http://en.wikipedia.org/wiki/Nokia ap- pears with Gingerbread http://en.wikipedia.org/ wiki/Gingerbread_(operating_system) We call these counts Entity bi grams. We note that in contrast to word bi-grams and relational grams [12], entity bi grams are symmetric, and there is no obvious use case where we might need to know the or- der dependent occurrence count of the entities. How- ever, such a formulation will lead to a sparse distribu- tion, since each count will have to be normalized by the total number of entity bigrams. We thus define the entity bi gram count as follows : Entity Bi Gram(E2E1) = P (E2 follows E1) = P (E2E1) (2) We propose an application of Entity bi grams for finding out important entities motivated by [12]. 4.2 Applications We list a few applications of the sense prior and out- line an application of the entity bigrams. 4.2.1 Sense Prior A prior over the sense will be helpful in many appli- cations related to information retrieval. • Entity Querying • Knowledge graph based searching Sense Prior(Si, E) = P (E appears as the ith sense) = P (Si"E(cid:48)(cid:48)) 4.2.2 Entity Bigrams Where Si is the ith sense5 of the entity E. (1) 4Please note that we refer to entity in general terms. For example, any object having a YAGO id is an entity 5ith disambiguation in Wikipedia parlance 9 Given an entity, we want to find out other important entities that are related to it. For example, given an entity Barack Obama, President of the USA, we need to provide top 10 entities that are "close" to Barack Obama the President. Since the solution is only a slight modification of the solution presented in [13] for finding out important relations, we only sketch an outline here. For the entity we are interested in, Say X, create a node. Now attach to the node X all the entities E for which P (EX) >  where  is some threshold. Let the weight of the edge be defined as 5 MMD for estimating ratios of named entities in text This section discusses the MMD approach for direct estimation of class ratios[20]. We first provide an in- tuition for the solution, follow it up with some results P (EX) + P (XE) (3) 5.1 Introduction We then apply personalized page rank on the X sub graph, starting with X having a page rank of 1 and other nodes having a page rank of 0. We can then sort the nodes based on the their page ranks upon convergence. 4.3 Baseline Approach : Label and Collect How do we collect the aforementioned statistics? This question shouldn't be too difficult to answer now. The whole of part 3 was dedicated towards tag- ging entity mentions in the text. We can use any of the methods (for example, AIDA can be set up as a rest service) to tag the corpus, and then iterate over the corpus to collect these statistics in single pass. 4.4 Solution based on estimating class ratios While estimating class ratios by doing per mention disambiguation seems pretty intuitive, we are doing more than what we need to do. We are not interested in what each mention disambiguates to, a count of how many times does a particular entity appears is the desideratum. There are 3 different methods in the open domain for directly estimating the class ra- tio[20] , without going through the label and collect route. In particular, [20] discuss a solution based on maximum mean discrepancy and proves some upper bounds on errors. If mmd really works, we should expect better esti- mation of the sense prior and the entity grams. The next section outlines the mmd based solution and how mmd may be used to estimate the sense priors for different entities. The following hypothetical example is aimed to cap- ture the gist of class ratio estimation using mmd. Suppose that in a factory producing balls, there are 3 different ball production machines, (say) A, B and C. Since neither of the machines is perfect, they do not produce spherical balls. Rather, the balls are ellipsoids. Thus, for each ball, we have 3 different features corresponding to the three semi-axes. Since all the machines are different, they have their own unique view of how balls should look like, and thus we expect that the semi axes are a good way of telling the machine which produced a given ball. Also assume that for all the 3 machines, we also have the most likely (expected) semi axes measures of the balls produced by them. Let us call these φa(x), φb(x), and φc(x). These are the expected fea- ture weights. Suppose we are given a 150 balls produced from these three machines. For 120 balls out of them, we know the machine from which the ball was produced. For the remaining 30 balls, we are asked to give an estimate of how many balls came from machine A, B and C. How do we do this? Of course, we can learn a clas- sifier from the 120 known instances and then learn the label each of the 30 balls and collect counts (la- bel and collect approach). MMD takes the following route to reach the solution. Suppose we are magically given the true class ra- tios, say, θa, θb and θc. Let φ be the average of the semi axes of the 30 balls. Let φ(cid:48) be defined as φ(cid:48) = φa ∗ θa + φb ∗ θb + φc ∗ θc Clearly, we would expect φ to match φ(cid:48). Note that we don't really know the θs, but all is not lost since we know what to look for; we look for (1) 10 the thetas that minimize : φa ∗ θa + φb ∗ θb + φc ∗ θc − φ(cid:48)2 (2) • Suppose we somehow get the true class ratios θ. The true mean of the feature vector of the ¯φy. unlabeled data can then be obtained by Σyθy While ensuring that : • All the θs sum to 1. • All the θs are non negative. • So ideally, Σyθy ¯φy = ¯φu The objective thus is This is the motivation behind MMD for class ratio estimation. Σy∈ Y Σyθy ¯φy − ¯φu2 (3) argmin θ 5.2 MMD Formulation With the above example by our side 5.2.1 Problem Definition We reproduce the problem statement from [20] • Let X = x ∈ Rd be the set of all instances and Y = 0, 1, ..., c be the set of all labels. • Given a labeled dataset D(⊂ X x Y ), design an estimator that for any given set U (⊂ X) can estimate the class ratios θ = [θ0, θ1, ..., θc] Where θy denotes the fraction of instances with class label y in U 5.2.2 Objective • Match two distributions based on the mean of features in the hilbert space induced by a kernel K. • Assume that distribution of features is same in both training and test data PU (xy) = PD(xy),∀y ∈ Y • Thus, the test distribution must equal Q(x) = ΣyPD(xy)θy • Let ¯φy and ¯φu denote the true means of the fea- ture vectors of the y th class and the unlabeled data Such that • ∀y, θy ≥ 0 y=0 θy = 1 • (cid:80)c Interesting discussion on theoretical bounds on the error in the class ratios thus predicted and methods for learning Kernel can be found in [20] 5.2.3 Estimating entity ratios using MMD Given a corpus with mentions identified (using, say [5]), we want reliable estimates of frequency of each of the entities. In this subsection, we gloss over the solution. • Features Each mention has several candidate disambigua- tions. This gives one way of formulating the fea- tures. For each mention, we can have a (sparse) feature vector having non zero scores for the can- didates. • Training data Can be obtained by splicing the named entity disambiguation pipeline of any of the popular named entity disambiguators. [21] discusses how to achieve this for AIDA, a popular named entity disambiguator. 6 Conclusion The potential of open web can only be harnessed to its full extent by adding structure to it. The pro- cess involves creating structured repositories derived 11 from the web that can answer interesting questions pertaining to entities that exist on the web. Many such smart applications that rely on struc- tured web will rely on frequencies of occurrence of the former. The report has been a buildup to achieving that. We started by briefing what knowledge bases are. In the second part, we introduced the problem of disambiguating the mentions of named entities and presented solutions roughly spanning last 8 years of research in the field. In the third part, we elaborated on what is meant by aggregate statistics and presented several appli- cations of the same. We presented maximum mean discrepancy approach for class ratio estimation via an example and discussed the problem formulation. We briefly outlined how mmd can be applied for es- timating occurrence statistics of entities. State of the art approaches for named entity dis- ambiguation brush the figure of 90% accuracy. It is thus expected that the focus of the community will now shift to making the process of disambigua- tion faster and integrating the disambiguators in the search pipeline. It remains to be seen how approaches based on direct estimation of entity occurrence ratios perform in comparison with the standard tools, both in terms of speed and accuracy. 7 Acknowledgement This report is a summary of selected readings un- dertaken while working under the guidance of Prof. Sunita Sarawagi on application of mmd for collect- I ing occurrence statistics of entities on the web. would like to thank her for the guidance. It was immensely helpful in gaining the understanding re- quired for writing this report. Thanks to Mr. Arun Iyer for all the help with understanding maximum mean discrepancy and its implementation. References [1] Kulkarni, Sayali, et al. "Collective annotation of Wikipedia entities in web text." Proceedings of the 15th ACM SIGKDD international conference on Knowledge discovery and data mining. ACM, 2009. [2] http://www.cse.iitb.ac.in/~soumen/OWI/ Slides/ [3] William Cohen's Survey available at 2 [4] http://en.wikipedia.org/wiki/ Named-entity_recognition [5] http://nlp.stanford.edu/software/ CRF-NER.shtml [6] Milne, David, and Ian H. Witten. "Learning to link with wikipedia." Proceedings of the 17th ACM conference on Information and knowledge management. ACM, 2008. [7] ws http://www.worldwidewebsize.com/ [8] http://en.wikipedia.org/wiki/Wikipedia: Statistics [9] Mihalcea, Rada, and Andras Csomai. "Wikify!: linking documents to encyclopedic knowledge." Proceedings of the sixteenth ACM conference on Conference on information and knowledge man- agement. ACM, 2007. [10] Hoffart, Johannes, et al. "Robust disambigua- tion of named entities in text." Proceedings of the Conference on Empirical Methods in Natural Language Processing. Association for Computa- tional Linguistics, 2011. [11] Hoffart, Johannes, et al. "Kore: keyphrase over- lap relatedness for entity disambiguation." Pro- ceedings of the 21st ACM international confer- ence on Information and knowledge management. ACM, 2012. Lectures by Prof. Soumen Chakarbarti provided useful insights into the problem of named entity dis- ambiguation. [12] Balasubramanian, Niranjan, Stephen Soderland, and Oren Etzioni. "Rel-grams: a probabilistic model of relations in text." Proceedings of the 12 [21] Using Structured learning for named entity disambiguation, http://www.cse.iitb.ac.in/ ~amanmadaan/docs/rnd/structentity.pdf Joint Workshop on Automatic Knowledge Base Construction and Web-scale Knowledge Extrac- tion. Association for Computational Linguistics, 2012. [13] Balasubramanian, Niranjan, Stephen Soderland, and Oren Etzioni Mausam. "Generating Coherent Event Schemas at Scale." Proceedings of the Em- pirical Methods in Natural Language Processing. ACM (2013). [14] Michael Lesk. 1986. Automatic sense disam- biguation using machine readable dictionaries: how to tell a pine cone from an ice cream cone. In Proceedings of the 5th annual international conference on Systems documentation (SIGDOC '86), Virginia DeBuys (Ed.). ACM, New York, NY, USA, 24-26. DOI=10.1145/318723.318728 http://doi.acm.org/10.1145/318723.318728 [15] http://wordnet.princeton.edu/wordnet/ [16] Suchanek, Fabian M., Gjergji Kasneci, and Ger- hard Weikum. "Yago: a core of semantic knowl- edge." Proceedings of the 16th international con- ference on World Wide Web. ACM, 2007. [17] Auer, Soren, et al. "Dbpedia: A nucleus for a web of open data." The semantic web. Springer Berlin Heidelberg, 2007. 722-735. [18] Nakashole, Ndapandula, Gerhard Weikum, and Fabian Suchanek. "PATTY: a taxonomy of rela- tional patterns with semantic types." Proceedings of the 2012 Joint Conference on Empirical Meth- ods in Natural Language Processing and Compu- tational Natural Language Learning. Association for Computational Linguistics, 2012. [19] Bollacker, Kurt, et al. "Freebase: a collabora- tively created graph database for structuring hu- man knowledge." Proceedings of the 2008 ACM SIGMOD international conference on Manage- ment of data. ACM, 2008. [20] Iyer, Arun, Saketha Nath, and Sunita Sarawagi. "Maximum Mean Discrepancy for Class Ratio Es- timation: Convergence Bounds and Kernel Selec- tion." Proceedings of The 31st International Con- ference on Machine Learning. 2014. 13
1906.05685
2
1906
2019-06-14T12:48:25
A Focus on Neural Machine Translation for African Languages
[ "cs.CL", "cs.LG", "stat.ML" ]
African languages are numerous, complex and low-resourced. The datasets required for machine translation are difficult to discover, and existing research is hard to reproduce. Minimal attention has been given to machine translation for African languages so there is scant research regarding the problems that arise when using machine translation techniques. To begin addressing these problems, we trained models to translate English to five of the official South African languages (Afrikaans, isiZulu, Northern Sotho, Setswana, Xitsonga), making use of modern neural machine translation techniques. The results obtained show the promise of using neural machine translation techniques for African languages. By providing reproducible publicly-available data, code and results, this research aims to provide a starting point for other researchers in African machine translation to compare to and build upon.
cs.CL
cs
A Focus on Neural Machine Translation for African Languages Laura Martinus Explore / Johannesburg, South Africa Jade Abbott Retro Rabbit / Johannesburg, South Africa [email protected] [email protected] 9 1 0 2 n u J 4 1 ] L C . s c [ 2 v 5 8 6 5 0 . 6 0 9 1 : v i X r a Abstract African languages are numerous, complex and low-resourced. The datasets required for machine translation are difficult to dis- cover, and existing research is hard to re- produce. Minimal attention has been given to machine translation for African languages so there is scant research regarding the prob- lems that arise when using machine transla- tion techniques. To begin addressing these problems, we trained models to translate En- glish to five of the official South African lan- guages (Afrikaans, isiZulu, Northern Sotho, Setswana, Xitsonga), making use of modern neural machine translation techniques. The results obtained show the promise of us- ing neural machine translation techniques for African languages. By providing reproducible publicly-available data, code and results, this research aims to provide a starting point for other researchers in African machine transla- tion to compare to and build upon. Introduction 1 Africa has over 2000 languages across the con- tinent (Eberhard et al., 2019). South Africa it- self has 11 official languages. Unlike many ma- jor Western languages, the multitude of African languages are very low-resourced and the few re- sources that exist are often scattered and difficult to obtain. Machine translation of African languages would not only enable the preservation of such languages, but also empower African citizens to contribute to and learn from global scientific, so- cial and educational conversations, which are cur- rently predominantly English-based (Alexander, 2010). Tools, such as Google Translate (Google, 2019), support a subset of the official South African languages, namely English, Afrikaans, isiZulu, isiXhosa and Southern Sotho, but do not translate the remaining six official languages. Unfortunately, in addition to being low- resourced, progress in machine translation of African languages has suffered a number of prob- lems. This paper discusses the problems and re- views existing machine translation research for African languages which demonstrate those prob- lems. To try to solve the highlighted problems, we train models to perform machine translation of English to Afrikaans, isiZulu, Northern Sotho (N. Sotho), Setswana and Xitsonga, using state-of- the-art neural machine translation (NMT) archi- tectures, namely, the Convolutional Sequence-to- Sequence (ConvS2S) and Transformer architec- tures. Section 2 describes the problems facing ma- chine translation for African languages, while the target languages are described in Section 3. Related work is presented in Section 4, and the methodology for training machine translation models is discussed in Section 5. Section 6 presents quantitative and qualitative results. 2 Problems The difficulties hindering the progress of machine translation of African languages are discussed be- low. Low availability of resources for African lan- guages hinders the ability for researchers to do machine translation. Institutes such as the South African Centre for Digital Language Resources (SADiLaR) are attempting to change that by pro- viding an open platform for technologies and resources for South African languages (Bergh, 2019). This, however, only addresses the 11 offi- cial languages of South Africa and not the greater problems within Africa. Discoverability: The resources for African lan- guages that do exist are hard to find. Often one needs to be associated with a specific academic Model (Google, 2019) (Abbott and Martinus, 2018) (Wilken et al., 2012) (McKellar, 2014) (van Niekerk, 2014) Afrikaans 41.18 isiZulu N. Sotho 7.54 71.0 7.9 37.9 Setswana Xitsonga 33.53 28.8 37.31 40.3 Table 1: BLEU scores for English-to-Target language translation for related work. institution in a specific country to gain access to the language data available for that country. This reduces the ability of countries and institutions to combine their knowledge and datasets to achieve better performance and innovations. Often the existing research itself is hard to discover since they are often published in smaller African con- ferences or journals, which are not electronically available nor indexed by research tools such as Google Scholar. Reproducibility: The data and code of exist- ing research are rarely shared, which means re- searchers cannot reproduce the results properly. Examples of papers that do not publicly provide their data and code are described in Section 4. Focus: According to Alexander (2009), African society does not see hope for indigenous lan- guages to be accepted as a more primary mode for communication. As a result, there are few ef- forts to fund and focus on translation of these lan- guages, despite their potential impact. Lack of benchmarks: Due to the low discov- erability and the lack of research in the field, there are no publicly available benchmarks or leader boards to new compare machine translation tech- niques to. This paper aims to address some of the above problems as follows: We trained models to trans- late English to Afrikaans, isiZulu, N. Sotho, Setswana and Xitsonga, using modern NMT tech- niques. We have published the code, datasets and results for the above experiments on GitHub, and in doing so promote reproducibility, ensure dis- coverability and create a baseline leader board for the five languages, to begin to address the lack of benchmarks. 3 Languages We provide a brief description of the Southern African languages addressed in this paper, since many readers may not be familiar with them. The isiZulu, N. Sotho, Setswana, and Xitsonga lan- guages belong to the Southern Bantu group of African languages (Mesthrie and Rajend, 2002). 2 The Bantu languages are agglutinative and all ex- hibit a rich noun class system, subject-verb-object word order, and tone (Zerbian, 2007). N. Sotho and Setswana are closely related and are highly mutually-intelligible. Xitsonga is a language of the Vatsonga people, originating in Mozambique (Bill, 1984). The language of isiZulu is the second most spoken language in Southern Africa, belongs to the Nguni language family, and is known for its morphological complexity (Keet and Khumalo, 2017; Bosch and Pretorius, 2017). Afrikaans is an analytic West-Germanic language, that descended from Dutch settlers (Roberge, 2002). 4 Related Work This section details published research for ma- chine translation for the South African languages. The existing research is technically incomparable to results published in this paper, because their datasets (in particular their test sets) are not pub- lished. Table 1 shows the BLEU scores provided by the existing work. Google Translate (Google, 2019), as of Febru- ary 2019, provides translations for English, Afrikaans, isiZulu, isiXhosa and Southern Sotho, six of the official South African languages. Google Translate was tested with the Afrikaans and isiZulu test sets used in this paper to determine its performance. However, due to the uncertainty regarding how Google Translate was trained, and which data it was trained on, there is a possibility that the system was trained on the test set used in this study as this test set was created from publicly available governmental data. For this reason, we determined this system is not comparable to this paper's models for isiZulu and Afrikaans. Abbott and Martinus (2018) trained Trans- former models for English to Setswana on the par- allel Autshumato dataset (Groenewald and Fourie, 2009). Data was not cleaned nor was any addi- tional data used. This is the only study reviewed that released datasets and code. Wilken et al. (2012) performed statistical phrase-based transla- tion for English to Setswana translation. This re- Target Language # Total Sentences # Training Sentences # Dev Sentences # Test Sentences # Tokens # Tokens (English) Afrikaans 53 172 37 219 12 953 3 000 714 103 733 281 isiZulu N. Sotho 26 728 30 777 21 543 18 709 6 234 5 019 3 000 3 000 673 200 374 860 504 515 528 229 Setswana 123 868 86 706 34 162 3 000 2 401 206 1 937 994 Xitsonga 193 587 135 510 55 077 3 000 2 332 713 1 978 918 Table 2: Summary statistics for each dataset. Source Note that the funds will be held against the Vote of the Provin- cial Treasury pending disburse- ment to the SMME Fund . Auctions S E R V I C E S T A N D A R D S Target Lemali nyangweni wezimali. izohlala em- Back Translation The funds will be kept at the department of funds . Issue Translation does not match the source sentence at all. Ilungelo lomthengi lokwamukela ukuthi umphakeli unalo ilungelo lokuthengisa izimpahla AMAQOPHELO EMISEBENZI Consumer's right to ac- cept that the supplier has the right to sell goods Translation does not match the source sentence at all. A space between each letter in the source sentence. Table 3: Examples of issues pertaining to the isiZulu dataset. search used linguistically-motivated pre- and post- processing of the corpus in order to improve the translations. The system was trained on the Aut- shumato dataset and also used an additional mono- lingual dataset. McKellar (2014) used statistical machine trans- lation for English to Xitsonga translation. The models were trained on the Autshumato data, as well as a large monolingual corpus. A factored machine translation system was used, making use of a combination of lemmas and part of speech tags. van Niekerk (2014) used unsupervised word segmentation with phrase-based statistical ma- chine translation models. These models translate from English to Afrikaans, N. Sotho, Xitsonga and isiZulu. The parallel corpora were created by crawling online sources and official govern- ment data and aligning these sentences using the HunAlign software package. Large monolingual datasets were also used. Wolff and Kotze (2014) performed word trans- lation for English to isiZulu. The translation sys- tem was trained on a combination of Autshumato, Bible, and data obtained from the South African Constitution. All of the isiZulu text was syllab- ified prior to the training of the word translation system. It is evident that there is exceptionally little re- search available using machine translation tech- niques for Southern African languages. Only one of the mentioned studies provide code and datasets 3 for their results. As a result, the BLEU scores ob- tained in this paper are technically incomparable to those obtained in past papers. 5 Methodology The following section describes the methodology used to train the machine translation models for each language. Section 5.1 describes the datasets used for training and their preparation, while the algorithms used are described in Section 5.2. 5.1 Data The publicly-available Autshumato parallel cor- pora are aligned corpora of South African gov- ernmental data which were created for use in ma- chine translation systems (Groenewald and Fourie, 2009). The datasets are available for download at the South African Centre for Digital Language Resources website.1 The datasets were created as part of the Autshumato project which aims to pro- vide access to data to aid in the development of open-source translation systems in South Africa. The Autshumato project provides parallel cor- pora for English to Afrikaans, isiZulu, N. Sotho, Setswana, and Xitsonga. These parallel corpora were aligned on the sentence level through a com- bination of automatic and manual alignment tech- niques. The official Autshumato datasets contain many 1Available online at: https://repo.sadilar. org/handle/20.500.12185/404 duplicates, therefore to avoid data leakage be- tween training, development and test sets, all du- plicate sentences were removed.2 These clean datasets were then split into 70% for training, 30% for validation, and 3000 parallel sentences set aside for testing. Summary statistics for each dataset are shown in Table 2, highlighting how small each dataset is. Even though the datasets were cleaned for du- plicate sentences, further issues exist within the datasets which negatively affects models trained with this data. In particular, the isiZulu dataset is of low quality. Examples of issues found in the isiZulu dataset are explained in Table 3. The source and target sentences are provided from the dataset, the back translation from the target to the source sentence is given, and the issue pertaining to the translation is explained. 5.2 Algorithms We trained translation models for two established NMT architectures for each language, namely, ConvS2S and Transformer. As the purpose of this work is to provide a baseline benchmark, we have not performed significant hyperparameter optimization, and have left that as future work. The Fairseq(-py) toolkit was used to model the ConvS2S model (Gehring et al., 2017). Fairseq's named architecture "fconv" was used, with the default hyperparameters recommended by Fairseq documentation as follows: The learning rate was set to 0.25, a dropout of 0.2, and the maximum tokens for each mini-batch was set to 4000. The dataset was preprocessed using Fairseq's prepro- cess script to build the vocabularies and to bina- rize the dataset. To decode the test data, beam search was used, with a beam width of 5. For each language, a model was trained using traditional white-space tokenisation, as well as byte-pair en- coding tokenisation (BPE). To appropriately select the number of tokens for BPE, for each target lan- guage, we performed an ablation study (described in Section 6.3). The Tensor2Tensor implementation of Trans- former was used (Vaswani et al., 2018). The mod- els were trained on a Google TPU, using Ten- sor2Tensor's recommended parameters for train- ing, namely, a batch size of 2048, an Adafactor op- timizer with learning rate warm-up of 10K steps, 2Available https://github.com/ online at: LauraMartinus/ukuxhumana and a max sequence length of 64. The model was trained for 125K steps. Each dataset was en- coded using the Tensor2Tensor data generation al- gorithm which invertibly encodes a native string as a sequence of subtokens, using WordPiece, an algorithm similar to BPE (Kudo and Richardson, 2018). Beam search was used to decode the test data, with a beam width of 4. 6 Results Section 6.1 describes the quantitative performance of the models by comparing BLEU scores, while a qualitative analysis is performed in Section 6.2 by analysing translated sentences as well as atten- tion maps. Section 6.3 provides the results for an ablation study done regarding the effects of BPE. 6.1 Quantitative Results The BLEU scores for each target language for both the ConvS2S and the Transformer models are re- ported in Table 4. For the ConvS2S model, we provide results for sentences tokenised by white spaces (Word), and when tokenised using the op- timal number of BPE tokens (Best BPE), as deter- mined in Section 6.3. The Transformer model uses the same number of WordPiece tokens as the num- ber of BPE tokens which was deemed optimal dur- ing the BPE ablation study done on the ConvS2S model. In general, the Transformer model outper- formed the ConvS2S model for all of the lan- guages, sometimes achieving 10 BLEU points or more over the ConvS2S models. The results also show that the translations using BPE tokenisation outperformed translations using standard word- based tokenisation. The relative performance of Transformer to ConvS2S models agrees with what has been seen in existing NMT literature (Vaswani et al., 2017). This is also the case when using BPE tokenisation as compared to standard word-based tokenisation techniques (Sennrich et al., 2015). Overall, we notice that the performance of the NMT techniques on a specific target language is related to both the number of parallel sentences and the morphological typology of the language. In particular, isiZulu, N. Sotho, Setswana, and Xit- songa languages are all agglutinative languages, making them harder to translate, especially with very little data (Chahuneau et al., 2013). Afrikaans is not agglutinative, thus despite having less than half the number of parallel sentences as Xit- 4 Model ConvS2S (Word) ConvS2S (Best BPE) Transformer Afrikaans 16.17 25.04 (4k) 35.26 (4k) isiZulu 0.28 1.79 (4k) 3.33 (4k) N. Sotho 7.41 12.18 (4k) 24.16 (4k) Setswana 24.18 26.36 (40k) 28.07 (40k) Xitsonga 36.96 37.45 (20k) 49.74 (20k) Table 4: BLEU scores calculated for each model, for English-to-Target language translations on test sets. songa and Setswana, the Transformer model still achieves reasonable performance. Xitsonga and Setswana are both agglutinative, but have signif- icantly more data, so their models achieve much higher performance than N. Sotho or isiZulu. The translation models for isiZulu achieved the worst performance when compared to the others, with the maximum BLEU score of 3.33. We at- tribute the bad performance to the morphological complexity of the language (as discussed in Sec- tion 3), the very small size of the dataset as well as the poor quality of the data (as discussed in Sec- tion 5.1). 6.2 Qualitative Results We examine randomly sampled sentences from the test set for each language and translate them us- ing the trained models. In order for readers to understand the accuracy of the translations, we provide back-translations of the generated trans- lation to English. These back-translations were performed by a speaker of the specific target lan- guage. More examples of the translations are pro- vided in the Appendix. Additionally, attention visualizations are provided for particular transla- tions. The attention visualizations showed how the Transformer multi-head attention captured certain syntactic rules of the target languages. 6.2.1 Afrikaans In Table 5, ConvS2S did not perform the trans- lation successfully. Despite the content being re- lated to the topic of the original sentence, the se- mantics did not carry. On the other hand, Trans- former achieved an accurate translation. Inter- estingly, the target sentence used an abbreviation, however, both translations did not. This is an ex- ample of how lazy target translations in the orig- inal dataset would negatively affect the BLEU score, and implore further improvement to the datasets. We plot an attention map to demonstrate the success of Transformer to learn the English-to- Afrikaans sentence structure in Figure 1. isiZulu 6.2.2 Despite the bad performance of the English-to- isiZulu models, we wanted to understand how they were performing. The translated sentences, given in Table 6, do not make sense, but all of the words are valid isiZulu words. Interestingly, the ConvS2S translation uses English words in the translation, perhaps due to English data occurring in the isiZulu dataset. The ConvS2S however cor- rectly prefixed the English phrase with the correct prefix "i-". The Transformer translation includes invalid acronyms and mentions "disease" which is not in the source sentence. 6.2.3 Northern Sotho If we examine Table 7, the ConvS2S model strug- gled to translate the sentence and had many repeat- ing phrases. Given that the sentence provided is a difficult one to translate, this is not surprising. The Transformer model translated the sentence well, except included the word "boithabio", which in this context can be translated to "fun" - a concept that was not present in the original sentence. 6.2.4 Setswana Table 8 shows that the ConvS2S model translated the sentence very successfully. The word "khumo" directly means "wealth" or "riches". A better syn- onym would be "letseno", meaning income or "let- lotlo" which means monetary assets. The Trans- former model only had a single misused word (translated "shortage" into "necessity"), but oth- erwise translated successfully. The attention map visualization in Figure 2 suggests that the attention mechanism has learnt that the sentence structure of Setswana is the same as English. 6.2.5 Xitsonga An examination of Table 9 shows that both models perform well translating the given sentence. How- ever, the ConvS2S model had a slight semantic failure where the cause of the economic growth was attributed to unemployment, rather than vice versa. 5 (a) Visualization of multi-head attention for Layer 1 for the word "cannot". The coloured bars are individual attention heads. The word "cannot" is translated to "kan nie ... nie" where the second negative "nie" occurs at the end of the sentence. (b) Visualization of multi-head attention for Layer 2 for the word "a". The coloured bars are individ- ual attention heads. The word "a" is translated to "'n", as is successfully captured by the attention mechanism. Figure 1: Visualizations of multi-head attention for an English sentence translated to Afrikaans using the Trans- former model. Table 5: English to Afrikaans Translations: For the source sentence we show the reference translation, and the translations by the various models. We also show the translation of the results back to English, performed by an Afrikaans speaker. Source Target ConvS2S Back Translation Transformer Back Translation Identity documents are issued to South African citizens or permanent residence permit holders who are 16 years or older. ID's word uitgereik aan Suid-Afrikaanse burgers en persone wat 'n permanente verblyfpermit het en 16 jaar oud of ouer is. Identiteitsdokumente word uitgereik aan Suid-Afrikaanse burgers of permanente verblyfpermit wat 16 jaar of ouer is. Identity documents are issued to South-African residents or permanent residence permits that are 16 years or older. Identiteitsdokumente word aan Suid-Afrikaanse burgers of permanente verblyfhouers wat 16 jaar of ouer is, uitgereik. Identity documents are issued to South-African residents or permanent residence holders that are 16 years or older. Table 6: English to isiZulu Translations: For the source sentence, we show the reference translation, and the translations by the various models. We also show the translation of the results back to English, performed by a isiZulu speaker. Source Target ConvS2S Back Translation Transformer Back Translation Note that the funds will be held against the Vote of the Provincial Treasury pending disburse- ment to the SMME Fund . Lemali izohlala emnyangweni wezimali . Qaphela ukuthi izimali izokhokhela i-Vote of the Provincial Treasury ngokuthengiswa kwabe- SMME . Be aware the monies will pay the Vote of the Provincial Treasury with the paying by the SMME. Qaphela ukuthi izimali zizobanjwa kweVME esifundazweni saseTreasury zezifo ezithunyelwa ku-MSE . Be aware that the money will be held by VME with facilities of Treasury with diseases sent to MSE . 6 Table 7: English to Northern Sotho Translations: For the source sentence we show the reference translation, and the translations by the various models. We also show the translation of the results back to English, performed by a Northern Sotho speaker. Source Target ConvS2S Back Translation No fishing vessel will be registered without a fishing right and a permit to engage in fishing activities . Ga go sekepe sa go rea dihlapi seo se tla go retisetarwa/ngwadiwa ka ntle ga go ba le tokelo ya go rea dihlapi le tumelelo ya go kgatha tema mererong wa go rea dihlapi . Ga go phemiti ya go rea dihlapi e tla ngwadiwa ka ntle le phemiti ya go rea dihlapi le phemiti ya go rea dihlapi . There is no permit for fishing that can be registered for without a permit for fishing and a permit for fishing. Transformer Back Translation Ga go sekepe sa go rea dihlapi seo se tla go ngwadiwa tokelo ya go rea dihlapi le tumelelo ya go rea dihlapi ka mabaka a boithabio. There is no fishing boat that will give you the right to fish and permission to fish for fun. Table 8: English to Setswana Translations: For the source sentence we show the reference translation, and the translations by the various models. We also show the translation of the results back to English, performed by a Setswana speaker. Source Target ConvS2S Back Translation Transformer Back Translation If there is a shortage of bees in the sunflower lands during the flowering period it may lead to a possible loss of production by 25% . Fa palo ya dinotshe e le kwa tlase mo masimong a disonobolomo ka nako ya go thuntsha dithunya go ka tlisa phokotso ya kumo e e ka nnang 25% . Fa go na le tlhaelo ya dinotshe mo masimong a sonobolomo ka nako ya go thunya dithunya go ka tlisetsa tatlhegelo ya kumo ka 25% If there is a shortage of bees in the sunflower fields during the blooming season this can bring about a loss of income by 25% Fa go na le botlhokwa ba dinotshe mo masimong a disonobolomo fa nako ya go supa dithunya e ka simolola go thunya go ka fokotsa tatlhego ya kumo ka 25% . If there is a need/importance/necessity/requirement/relevance for bees in the sunflower farms/fields when the blossoming season begins this can reduce loss of income by 25% Table 9: English to Xitsonga Translations: For the source sentence we show the reference translation, and the translations by the various models. We also show the translation of the results back to English, performed by a Xitsonga speaker. Source Target ConvS2S Back Translation Transformer Back Translation we are concerned that unemployment and poverty persist despite the economic growth experi- enced in the past 10 years . hi na swivilelo leswaku mpfumaleko wa mitirho na vusweti swi ya emahlweni hambileswi ku nga va na ku kula ka ikhonomi eka malembe ya 10 lawa ya hundzeke . hi vilela leswaku ku pfumaleka ka mitirho na vusweti swi papalata ku kula ka ikhonomi eka malembe ya 10 lama nga hundza . We are concerned that the lack of jobs and poverty has prevented economic growth in the past 10 years. hi na swivilelo leswaku mpfumaleko wa mitirho na vusweti swi ya emahlweni hambileswi ku nga va na ku kula ka ikhonomi eka malembe ya 10 lawa ya hundzeke . We have concerns that there is still lack of jobs and poverty even though there has been eco- nomic growth in the past 10 years. 7 (Sennrich et al., 2015), over the number of to- kens required by BPE, for each language, on the ConvS2S model. The results of the ablation study are shown in Figure 3. Figure 3: The BLEU scores for the ConvS2S of each target language w.r.t the number of BPE tokens. As can be seen in Figure 3, the models for lan- guages with the smallest datasets (namely isiZulu and N. Sotho) achieve higher BLEU scores when the number of BPE tokens is smaller, and decrease as the number of BPE tokens increases. In con- trast, the performance of the models for languages with larger datasets (namely Setswana, Xitsonga, and Afrikaans) improves as the number of BPE to- kens increases. There is a decrease in performance at 20 000 BPE tokens for Setswana and Afrikaans, which the authors cannot yet explain and require further investigation. The optimal number of BPE tokens were used for each language, as indicated in Table 4. 7 Future Work Future work involves improving the current datasets, specifically the isiZulu dataset, and thus improving the performance of the current machine translation models. As this paper only provides translation models for English to five of the South African languages and Google Translate provides translation for an additional two languages, further work needs to be done to provide translation for all 11 official lan- guages. This would require performing data col- lection and incorporating unsupervised (Lample et al., 2018; Lample and Conneau, 2019), meta- learning (Gu et al., 2018), or zero-shot techniques (Johnson et al., 2017) . Figure 2: Visualization of multi-head attention for Layer 5 for the word "concerned". "Concerned" trans- lates to "tshwenyegile" while "gore" is a connecting word like "that". 6.3 Ablation Study over the Number of Tokens for Byte-pair Encoding BPE (Sennrich et al., 2015) and its variants, such as SentencePiece (Kudo and Richardson, 2018), aid translation of rare words in NMT systems. However, the choice of the number of tokens to generate for any particular language is not made obvious by literature. Popular choices for the number of tokens are between 30,000 and 40,000: Vaswani et al. (2017) use 37,000 for WMT 2014 English-to-German translation task and 32,000 to- kens for the WMT 2014 English-to-French trans- lation task. Johnson et al. (2017) used 32,000 Sen- tencePiece tokens across all source and target data. Unfortunately, no motivation for the choice for the number of tokens used when creating sub-words has been provided. Initial experimentation suggested that the choice of the number of tokens used when run- ning BPE tokenisation, affected the model's final performance significantly. In order to obtain the best results for the given datasets and models, we performed an ablation study, using subword-nmt 8 are numerous 8 Conclusion African languages and low- resourced. Existing datasets and research for machine translation are difficult to discover, and the research hard to reproduce. Additionally, very little attention has been given to the African languages so no benchmarks or leader boards exist, and few attempts at using popular NMT techniques exist for translating African languages. This paper reviewed existing research in ma- chine translation for South African languages and highlighted their problems of discoverability and reproducibility. In order to begin addressing these problems, we trained models to translate English to five South African languages, using modern NMT techniques, namely ConvS2S and Trans- former. The results were promising for the lan- guages that have more higher quality data (Xit- songa, Setswana, Afrikaans), while there is still extensive work to be done for isiZulu and N. Sotho which have exceptionally little data and the data is of worse quality. Additionally, an ablation study over the number of BPE tokens was performed for each language. Given that all data and code for the experiments are published on GitHub, these benchmarks provide a starting point for other re- searchers to find, compare and build upon. at The source code and the data used are https://github.com/ available LauraMartinus/ukuxhumana. Acknowledgements The authors would like to thank Reinhard Cromhout, Guy Bosa, Mbongiseni Ncube, Seale Rapolai, and Vongani Maluleke for assisting us with the back-translations, and Jason Webster for Google Translate API assistance. Research sup- ported with Cloud TPUs from Google's Tensor- Flow Research Cloud (TFRC). References Jade Z Abbott and Laura Martinus. 2018. Towards neural machine translation for African languages. arXiv preprint arXiv:1811.05467. Neville Alexander. 2009. Evolving African approaches to the management of linguistic diversity: The ACALAN project. Language Matters, 40(2):117 -- 132. Neville Alexander. 2010. The potential role of transla- tion as social practice for the intellectualisation of African languages. PRAESA Cape Town. 9 Lian´e van den Bergh. 2019. Sadilar. https://www. sadilar.org/. Mary C. Bill. 1984. 100 years of Tsonga publications, 18831983. African Studies, 43(2):67 -- 81. Sonja E. Bosch and Laurette Pretorius. 2017. A Computational Approach to Zulu Verb Morphology within the Context of Lexical Semantics. Lexikos, 27:152 -- 182. Victor Chahuneau, Eva Schlinger, Noah A Smith, and Chris Dyer. 2013. Translating into morphologically rich languages with synthetic phrases. In Proceed- ings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 1677 -- 1687. David M Eberhard, Gary F. Simons, and Charles D. Ethnologue: Languages of the Fennig. 2019. worlds. twenty-second edition. Jonas Gehring, Michael Auli, David Grangier, De- nis Yarats, and Yann N Dauphin. 2017. Convolu- tional sequence to sequence learning. arXiv preprint arXiv:1705.03122. Google. 2019. Google translate. //translate.google.co.za/. 2019-02-19. https: Accessed: Hendrik J Groenewald and Wildrich Fourie. 2009. In- troducing the Autshumato integrated translation en- vironment. In Proceedings of the 13th Annual Con- ference of the EAMT, Barcelona, May, pages 190 -- 196. Citeseer. Jiatao Gu, Yong Wang, Yun Chen, Kyunghyun Cho, and Victor OK Li. 2018. Meta-learning for low- resource neural machine translation. arXiv preprint arXiv:1808.08437. Melvin Johnson, Mike Schuster, Quoc V Le, Maxim Krikun, Yonghui Wu, Zhifeng Chen, Nikhil Thorat, Fernanda Vi´egas, Martin Wattenberg, Greg Corrado, et al. 2017. Googles multilingual neural machine translation system: Enabling zero-shot translation. Transactions of the Association for Computational Linguistics, 5:339 -- 351. C Maria Keet and Langa Khumalo. 2017. Gram- mar rules for the isizulu complex verb. Southern African Linguistics and Applied Language Studies, 35(2):183 -- 200. Taku Kudo and John Richardson. 2018. Sentencepiece: A simple and language independent subword tok- enizer and detokenizer for neural text processing. arXiv preprint arXiv:1808.06226. Guillaume Lample and Alexis Conneau. 2019. Cross- lingual language model pretraining. arXiv preprint arXiv:1901.07291. Guillaume Lample, Alexis Conneau, Ludovic Denoyer, and Marc'Aurelio Ranzato. 2018. Unsupervised machine translation using monolingual corpora only. In International Conference on Learning Represen- tations (ICLR). Cindy A. McKellar. 2014. An English to Xitsonga sta- tistical machine translation system for the govern- ment domain. In Proceedings of the 2014 PRASA, RobMech and AfLaT International Joint Sympo- sium, pages 229 -- 233. Rajend Mesthrie and Mesthrie Rajend. 2002. Lan- guage in South Africa. Cambridge University Press. Daniel R van Niekerk. 2014. Exploring unsupervised word segmentation for machine translation in the South African context. In Proceedings of the 2014 PRASA, RobMech and AfLaT International Joint Symposium, pages 202 -- 206. Paul T Roberge. 2002. Afrikaans: considering origins. Language in South Africa, pages 79 -- 103. Rico Sennrich, Barry Haddow, and Alexandra Birch. 2015. Neural machine translation of rare words with subword units. arXiv preprint arXiv:1508.07909. Ashish Vaswani, Samy Bengio, Eugene Brevdo, Fran- cois Chollet, Aidan N. Gomez, Stephan Gouws, Llion Jones, Łukasz Kaiser, Nal Kalchbrenner, Niki Parmar, Ryan Sepassi, Noam Shazeer, and Jakob Uszkoreit. 2018. Tensor2tensor for neural machine translation. CoRR, abs/1803.07416. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. CoRR, abs/1706.03762. Ilana Wilken, Marissa Griesel, and Cindy McKellar. 2012. Developing and improving a statistical ma- chine translation system for English to Setswana: a linguistically-motivated approach. In Twenty-Third Annual Symposium of the Pattern Recognition Asso- ciation of South Africa, page 114. Friedel Wolff and Gideon Kotze. 2014. Experiments with syllable-based Zulu-English machine transla- tion. In Proceedings of the 2014 PRASA, RobMech and AfLaT International Joint Symposium, pages 217 -- 222. Sabine Zerbian. 2007. A first approach to informa- tion structuring in Xitsonga/Xichangana. Research in African Languages and Linguistics, 7(2005- 2006):1 -- 22. 10 A Appendix Additional translation results from ConvS2S and Transformer are given in Table 10 along with their back- translations for Afrikaans, N. Sotho, Setswana, and Xitsonga. We include these additional sentences as we feel that the single sentence provided per language in Section 6.2, is not enough demonstrate the capabilities of the models. Given the scarcity of research in this field, researchers might find the additional sentences insightful into understanding the real-world capabilities and potential, even if BLEU scores are low. Table 10: For each source sentence we show the reference translation, and the translations by the various models. We also show the translation of the results back to English, performed by a home-language speaker. Source Afrikaans Target ConvS2S Back Translation Transformer Back Translation Source N. Sotho Target ConvS2S Back Translation Transformer Back Translation Source Setswana Target ConvS2S Back Translation Transformer Back Translation Source Xitsonga Target ConvS2S Back Translation Transformer Back Translation If you want to work as a tourist guide in the Western Cape, you need to be registered with the provincial Tourist Guide Office. As jy in die Wes-Kaap wil werk as 'n toergids, moet jy geregistreer wees by die provinsiale Toergidskantoor. As jy wil werk as 'n toergids in die Wes-Kaap, moet jy by die provinsiale Toeristeids gereg- istreer wees. If you want to work as a tour guide in the Western Cape, you have to be registered at the provincial <UNK>. As jy wil werk as 'n toergids in die Wes-Kaap wil werk, moet jy geregistreer wees by die provinsiale Toergids kantoor. If you want to work as a tour guide in the Western Cape want to work, you have to be registered at the provincial Tour guide office. A veterinary import permit is needed to import animals or animal products into the Republic of South Africa . Tumelelo ya thekontle ya diphoofolo go di tliwa ka nageng e a hlokagala go reka diphoofolo le ditweletwa ta diphoofolo ka ntle go tlia ka mo Repabliking ya Afrika Borwa . Tumelelo ya thekontle ya diphoofolo e a nyakega go reka diphoofolo ta diphoofolo goba ditweletwa ta diphoofolo ka ntle ga Afrika Borwa . Permission to import animals is needed to buy animals for animals products animals outside of South Africa. Tumelelo ya thekontle ya diphoofolo go di tliwa ka nageng e a hlokagala go reka diphoofolo le ditweletwa ta diphoofolo ka ntle go tlia ka mo Repabliking ya Afrika Borwa . Permission to import animals from outside the country is needed to buy animals and products for animals without bringing them into the Republic of South Africa. Councillors , together with officials , must ensure that there is enough money to deliver services and promote the planned development . Bakhanselara mmogo le baofisiri , ba tshwanetse go netefatsa gore go na le thelete e e lekaneng go rebola ditirelo le go tsweletsa tlhabololo e e rulagantsweng . Bakhanselara , mmogo le batlhankedi , ba tshwanetse go netefatsa gore go na le madi a a lekaneng a go rebola ditirelo le go rotloetsa tlhabololo e e rulagantsweng . Counselors, together with <UNK>, must ensure there is enough money to permit continuous services and to encourage development as planned. Bakhanselara mmogo le batlhankedi , ba tshwanetse go netefatsa gore go na le madi a a lekaneng go rebola ditirelo le go tsweletsa tlhabololo e e rulagantsweng . Counselors together with <UNK>, are supposed to ensure that there's enough funds to permit services and to continue development as planned. Improvement of performance in the public service also depends on the quality of leadership provided by the executive and senior management . Ku antswisa matirhelo eka mfumo swi tlhela swi ya hi nkoka wa vurhangeri lowu nyikiwaka hi vulawuri na vufambisi nkulu . Ku antswisiwa ka matirhelo eka mitirho ya mfumo swi tlhela swi ya hi nkoka wa vurhangeri lebyi nyikiwaka hi vufambisi na mafambiselo ya xiyimo xa le henhla . The improvement of the governments work depends on the quality of the leadership which is provided by the management and the best system implemented. Ku antswisiwa ka matirhelo eka vukorhokeri bya mfumo na swona swi ya hi nkoka wa vurhang- eri lebyi nyikiwaka hi komitinkulu na mafambiselo ya le henhla . The improvement of service delivery by the government also depends on the quality of leader- ship which is provided by the high committee and the best implemented system. 11
1507.00209
1
1507
2015-07-01T12:39:50
Dimensionality on Summarization
[ "cs.CL", "cs.IR" ]
Summarization is one of the key features of human intelligence. It plays an important role in understanding and representation. With rapid and continual expansion of texts, pictures and videos in cyberspace, automatic summarization becomes more and more desirable. Text summarization has been studied for over half century, but it is still hard to automatically generate a satisfied summary. Traditional methods process texts empirically and neglect the fundamental characteristics and principles of language use and understanding. This paper summarizes previous text summarization approaches in a multi-dimensional classification space, introduces a multi-dimensional methodology for research and development, unveils the basic characteristics and principles of language use and understanding, investigates some fundamental mechanisms of summarization, studies the dimensions and forms of representations, and proposes a multi-dimensional evaluation mechanisms. Investigation extends to the incorporation of pictures into summary and to the summarization of videos, graphs and pictures, and then reaches a general summarization framework.
cs.CL
cs
Dimensionality on Summarization Key Lab of Intelligent Information Processing, Chinese Academy of Sciences, Beijing, P.R.China Aston University, Birmingham, UK Hai Zhuge ABSTRACT Summarization is one of the key features of human intelligence. It plays an important role in understanding and representation. With rapid and continual expansion of texts, pictures and videos in cyberspace, automatic summarization becomes more and more desirable. Text summarization has been studied for over half century, but it is still hard to automatically gen- erate a satisfied summary. Traditional methods process texts empirically and neglect the fundamental characteristics and principles of language use and understanding. This paper summarizes previous text summarization approaches in a multi-dimensional classification space, introduces a multi-dimensional methodology for research and development, unveils the basic characteristics and principles of language use and understanding, investigates some fundamental mechanisms of summarization, studies the dimensions and forms of representa- tions, and proposes a multi-dimensional evaluation mechanisms. Investigation extends to the incorporation of pictures into summary and to the summarization of videos, graphs and pic- tures, and then reaches a general summarization framework. Further, some basic behaviors of summarization are studied in the complex space consisting of cyberspace, physical space and social space. The basic viewpoints include: (1) a representation suitable for summarization should have a core, indicated by its intention and extension; (2) summarization is an open process of various interactions, involved in various explicit and implicit citations; and, (3) the form of summary is diverse and summarization carries out through multiple dimensions. Keywords: Natural language processing, classification, semantic link, dimension, text summariza- tion, video summarization, graph summarization, picture summarization. Author’s homepage: http://www.knowledgegrid.net/~h.zhuge 1 1. Introduction Versatile summaries accompany our daily life. Some summaries are mainly in form of text such as the abstracts of scientific papers, the prefaces of books, the tables of contents, CVs, the headlines of news, webpages with hyperlinks, book reviews, Wikipedia, and the results of Web search. Some summaries incorporate pictures, videos, graphs, or tables into texts. Applications include Web por- tals such as Yahoo, YouTube, posters, slides, medical certificate, TV guides, advertisements and conference programs. A good summary should be able to quickly attract attention, represent the core idea, and effectively convey the meaning according to interests. These summaries that people often see are made by humans. 1.1 Automatic text summarization The development of cyberspace accelerates the expansion of texts since people can more and more easily and freely publish writings. Efficiently finding necessary contents in the ocean of texts is very important because life is short while new texts are continually generated. With the development of sciences, researchers are limited in time and energy to read more and more publications. Researchers have to focus on the literature within recent years. This has led to more and more reinventions. Original innovation, especially systematic and fundamental innovation, has become more and more difficult. Automatic summarization is a natural idea to solve this problem. Researchers have made great efforts to find the better solution. However, existing approaches are empirical and focus on special types of text. It is necessary to review previous efforts and explore the foundation of summarization. There are different definitions of text summarization. The common point is regarding text sum- marization as an automatic process of distilling the most important language representation units from a text to produce an abridged version for a particular task and user [Mani and Maybury, 1999] [Mani, 2001]. The generic summarizers usually generate important contents in text(s) without considering users. The query-focused summarizers generate responses to user queries. The extractive summarizers se- lect appropriate phrases or sentences from the text and then compose them. The abstractive summa- rizers can use different (probably more general) words to represent the main meaning of text. So far, most text summarizers are extractive. Important sentences can be extracted out according to the sta- tistical analysis and experience on the input text while making abstraction needs knowledge on and beyond the text. Automatic text summarization systems generally concern the following three issues: (1) Selection. Scan and extract important language units (e.g., sentences). (2) Ordering. Determine the order of the extracted units. (3) Realization. Compose the extracted units to get fluent new text. 1.2 Summarization of summarization literature: a multi-dimensional perspective Research on automatic text summarization started half century ago [Luhn et al., 1958] [Baxen- dale, 1958]. Research methods can be summarized by a multi-dimensional classification space [Zhuge, 2008, 2012], as shown in Figure 1. Methods can be classified by input and output. There are three types of inputs: (1) single text [Luhn et al., 1958], (2) multiple texts [McKeown, 1995] [Radev, et al., 1998, 2002] [Nanba et al., 1999] [Agarwal et al., 2011], and (3) hybrid, which inputs one text and retrieves multiple relevant texts and then summarizes them so that readers can know more relevant contents. It is useful in summarizing a scientific topic [V.Qazvinian and D.R.Radev, 2008] [Chen and Zhuge, 2013]. 2 There are two types of outputs: (1) extractive summarization (extracting important sentences from the given text) [Edmundson, 1969] [Mihalcea, 2005] [Shen, et al., 2007], and (2) synthesized summarization (summarization is a reformulated, compressed, abstracted, or synthesized text) [McKeown, et al., 1999] [Knight, 2002]. Sentences in output should be coherent to facilitate read- ers’ understanding [Brandow et al, 1995] [Regina Barzilay and Mirella Lapata, 2008]. Methods can also be classified by techniques as follows: (1) Information fusion. Summary is generated by identifying themes in text and selecting appro- priate sentences for composition [Barzilay, 1999] [Barzilay & KcKeown, 2005]. (2) Information retrieval. Features such as frequency of words and phrases, locations, and ranks of sentences were used to extract important sentences [Baxendale, 1958] [Edmundson, 1969]. (3) Machine learning. Machine learning methods apply statistical techniques to extraction, in- cluding Bayes Methods [Kupiec et al. 1995] [Daumé and Marcu 2006][Louis, 2014], rich features and decision trees [Lin and Hovy, 1997], Markov Models [Conroy, 2001], Neural Networks [Nenkova, 2005], classification [Teufel 2002] [Pang and Lee, 2004], and hybrid machine learning method [Fattah, 2014]. (4) Natural language analysis. Methods based on natural language analysis were used in sum- marization [Barzilay, et al., 1997] [Silber and McCoy, 2002] [Erkan, 2004]. (5) Classification and clustering. Classification and clustering are the basic components of the multi-document summarization methods. It is usually used with graph analysis and infor- mation retrieval [Erkan, 2004] [Hilda Hardy, 2002]. Applications include summarizing posi- tive and negative classifications in texts [Hu and Liu, 2004] [Pang and Lee, 2004]. (6) Semantics-based. Cognition scientists simulated human reading and understanding process as a series of propositions input and reduction cycles [Kintsch and Dijk, 1978; Britton and Graesser, 1996]. Text understanding is modeled by proposition network. The latent semantic analysis technique was used to identify semantically important sentences. Summarization patterns were discussed [Gong and Liu, 2001]. Discovering semantic community is a way to summarize a network of language units [Zhuge, 2009]. (7) Other methods, including information extraction (extracting entities, relations, and structures), document compression, ranking method [Rau, et al., 1989] [Daumé III, et al., 2004] [Car- bonell, 1998], probabilistic approaches [Knight, 2002] [Qazvinian et al., 2010], and cita- tion-based approaches [Abu-Jbara and Radev 2011] [Elkiss et al., 2008]. The faceted naviga- tion approach is not traditional text summarization, but it is a special summarization because it can extract different facets in large text(s) to enable users to read only the interested facet [Xu and Zhuge, 2012]. Similarly, the association relation between words was used for mul- ti-document summarization [O.Gross, et al, 2014]. The approach to summarizing differences between document groups was studied [Wang, et al., 2012]. Evaluation concerns human, semi-automatic and automatic methods based on the pre-defined standards [Mani and Maybury, 1999]. Methods for creating and evaluating summaries are usually coordinated each other [Hahn, 2000]. Every point in the space coordinates all methods specified at every dimensions. Text summarization research has been extended to multi-medias and social events. Summarizing videos is a research topic in multimedia area [DeMenthon, et al., 1998] [Ekin, et al., 2004]. Some social events can be detected and summarized with wide use of online social networks [Zubiaga, 2012]. 3 Semantics-based Classification and Clustering Techniques Natural Language Analysis Machine learning Information Retrieval Information Fusion Others Bayes Decision Tree Hidden Markov Neural network Method Single Multiple Hybrid Input Human Graph Text Extractive Semi-Automatic Picture Audio Synthesized Automatic Video Others Output Evaluation Object Figure. 1. A multi-dimensional classification space of summarization methods. 1.3 Characteristics of text summarization Previous research methods have the following characteristics: (1) From text to text. The main focus of research is on text itself. It is a natural idea to select and organize important sentences from the original text to form a summary. A different opinion is that language representations (e.g., words and sentences) indicate semantics ra- ther than semantics itself, and interaction plays an important role in representation and un- derstanding [Zhuge, 2010]. And, the knowledge for summarization is often beyond text. For example, ‘A love story’ is the high-level summarization of a novel, but the word ‘story’ may not be an important word in the novel or it even does not appear in the novel. Why can human use words beyond text? An explanation is that humans have commonsense on rep- resentation ‘a novel tells a story’ and representation ‘story’. (2) Automation. Summarization process excludes humans. It is ideal and efficient but summa- rization systems do not have minds and experiences as human. Humans experience with representation (at multiple levels), understanding and summarization in lifetime. Adding a ground with more indicators to a summary is a way to help representation and understand- ing, e.g., ‘A love story in Qing Dynasty of China’ includes a time indicator ‘Qing Dynasty’ and a location indicator ‘China’. But, automatic summarization exclude interaction inevita- bly leads to an awkward summary. (3) Closed system. The process of automatic summarization is closed, does not interact with other processes in cyberspace or social space. Actually, reviews and comments in cyber- space are open, easily available, and valuable for composing and improving summaries. 4 1.4 Questions Many areas such as information retrieval and classification have significantly influenced research on summarization. Methodology has not been formed to guide research and development. It is critical for developing summarization research through thinking the following questions: (1) What is summarization? (2) Whether the best summary of a given representation exists or not? (3) What are the fundamental principles and rules of language use and understanding behind summarization? (4) What is the appropriate research methodology for studying summarization and developing summarization systems? (5) Whether a general summarization exists or not? 1.5 Summarization and dimensions Summarization is involved in representation and understanding. In language study, students are often requested to make summarizations after reading articles. Scientists summarize their ideas as abstracts placed before the main texts in papers so that readers can quickly know the main idea be- fore reading the main text. Survey papers are summarizations of previous works on particular topics. Humans have the ability to represent and summarize what they have read. This ability can be en- hanced through language learning, using and understanding, for example, journalists are specialized in summarizing events as news in the form that can attract readers. A text can be understood from different aspects because of the nature of language use and understanding. Humans have the ability to summarize non-symbol representations, which can be regarded as a different dimension from text. For example, people can write summaries after attending conferences, watching movies, visiting museums and traveling in the physical space. Summarization enables people (from novice to experts) to quickly know the general and important information. Humans live in a multi-dimensional space. The ability to understand, think through and use di- mensions is an important part of human intelligence. The physical space including the nature and versatile artificial physical space like museum can be represented as a space of multiple dimensions such as time, region, and type (different types of museums may include different samples). A set of representations can be classified by different methods. Regarding each method as a di- mension forms a multi-dimensional classification space, where every point represents a class that has a projection at every dimension. For example, a publication space can include the following dimen- sions: subject, time, author, and publisher. The classification space can be normalized to ensure the effectiveness of operations on the space just like the normal forms of relational database. In a com- plex multi-dimensional classification space, a dimension can be a hierarchy of classifications and one point can be semantically linked to another [Zhuge, 2011, 2012]. Objects can be located in a space of multiple dimensions such as time, topic, and publication type (book, journal, or conference) for efficient retrieval and management. A representation can be summarized from different dimensions. 2. Multi-Dimensional Methodology There are different viewpoints on text understanding. For example, rationalism believes that the meaning of text is determined by its structure and derivation rules. The principles underlying the structure of language are biologically determined by human minds and genetically transmitted. Hu- mans share the same underlying linguistic structure [Chomsky, 1986, 2006]. Social constructivism 5 believes that any text is involved in society (e.g., in power relationships) and history [M. Foucault, 1966, 1969]. Evolutionism concerns the process of mental development and innate mental structures [Stern, 1985]. The innate mental structure that equips a man (especially a child) to interact with the world includes more than Chomsky’s universal grammar of linguistic structure. The cyberspace, physical space and social space have structures, and the brains have evolved with ways to recognize and represent these structures and the structure of themselves. More phenomena have shown that what a man (especially a child) learns about the world is based on an innate mental structure [Mac- Carthy, 2007, 2008]. Rationalism Empiricism Any method is limited in its inventor’s knowledge and understandings of problems. Integrating different methods is a way to break the limitations. Various methods can be organized in a mul- ti-dimensional methodological space as shown in Figure 2. Each dimension consists of some specific methods. Complex Methodology Evolutionism Social constructionism Pragmatism Figure 2. A multi-dimensional methodological space. The space involves in the following high-level dimensions [Zhuge, 2012]: (1) Empiricism. It believes that knowledge comes from experience and emphasizes evidence, especially data sensed through equipment or derived from experiment. It assumes that knowledge (including method) is convincible and reliable, at least within a certain scope. (2) Evolutionism. It believes that complex systems or species develop through evolution. Sum- maries should be able to evolve with various interactions in the complex space like the evolu- tion of the contents in Wikipedia. Writers, readers and languages evolve and influence each other. (3) Individual and social constructionism. It believes that meaning and understanding develop with individual and society. For summarization, writing and reading involve in both individ- ual thinking and social experience and interaction. 6 (4) Rationalism. It regards reasoning as the main source of knowledge. Rational study derives new theories and methods according to existing theories, methods and phenomena. (5) Pragmatism. It argues that knowledge comes from practical use. Research should be useful and benefit human life and social development. Solving the problems emerged in practice provides instances for rational thinking and verification. Different dimensions regulate different classes of method. Coordinating different dimensions is a way to generate new methods. A complex methodology is regulated by a subspace or a point, which has a projection at every dimension of the methodology space. This paper attempts to explore the problem of summarization from multiple dimensions (espe- cially from empiricism, rationalism, evolutionism, and social/individual constructionism) so as to form a general summarization methodology. 3. Basic Characteristics and Principles of Language Use and Understanding As a kind of language representation, summarization should be based on the basic principles of lan- guage use. Observing and rethinking the basic characteristics of human language use can inspire re- search on summarization as language use including listening, speaking, reading, writing, under- standing, and thinking. The basic characteristics of language use and understanding (1) Human minds cannot directly access each other. (2) Humans create and use languages to realize interaction between minds. (3) Knowledge in minds evolves and self-organizes through language use. (4) The use of language relies on knowledge. (5) The representation of knowledge is not unique, and the understanding of representation is not unique. These characteristics lead to the following principles: Separation Principle. The following three kinds of separations are involved in language: (1) Structure (grammar) and semantics are separated. Semantics cannot be directly derived from structure. Actually, people do not rely on grammar to communicate with each other in daily life. (2) Knowledge for representation (e.g., grammars and idioms) and knowledge to be represented (e.g., scientific knowledge) are separated. (3) Representation and its summarization are separated. This leads to the separation of author’s meaning, summarizer’s understanding, and readers’ understanding. The above separation principles lead to the natural obstacle of summarization. The problem of designing a suitable summarizer can be transformed into the problem of search- ing a suitable summarizer in cyberspace. The following are principles of selecting a suitable sum- marizer. Social Selection Principle. The suitable summarizer for summarizing a representation is rendered by the social network of its writers and readers. Knowledge selection is a kind of social selection. Knowledge Selection Principle. The person who shares the represented knowledge and the knowledge for representation is suitable for summarization. 7 The above principle means that even people sharing the represented knowledge may not be the suitable person for summarizing the representation because they may not have the knowledge of representation. A friend of author may not be the suitable summarizer. The suitable person should have similar experience with the author (including education, work, etc.) through which knowledge is learned and shared. The following lemmas can be derived from the knowledge selection principle: Suitable Summarizer. (1) Authors who commonly cited a representation are the candidates of suitable summarizers. This is because the represented knowledge was shared and the knowledge for representation is at the same level. (2) Authors are the best persons to summarize their own representations. This is because authors have the knowledge for representation and the knowledge to be represented. However, authors have limited time and may be influenced by individual characteristics (e.g., health and mood, and worldview) and social characteristics (e.g., culture, economy and influence). The evaluation of summarization follows some principles. Relativity Principle. Satisfactory of summary is relative. A summary that satisfies one person may not satisfy the other. Different persons can make different summaries for the same text, and one person can generate different summaries for the same text at different times. This is because knowledge of different peo- ple evolves personally. The inexact principle and the relativity principle indicate the following prin- ciples: Moderate Principle. A summary can be only moderately satisfied. The moderate principle indicates that the best summary does not exist. So, the pursuit of the best summary is insignificant. Dynamicity Principle. The satisfied summaries of a representation vary with time. This is because knowledge, interest and understanding are specific to people and change with the evolution of knowledge and society. Openness Principle. A satisfied summary can be reached only through an open social process of interactions and representations. The openness principle implies that establishing static criteria for evaluating summarization is unnecessary, and that a closed system is incapable for reaching a satisfied summary. The above fundamental characteristics and principles indicate the following strategies for sum- marization. Summarization strategies. (1) Making use of the summaries of the persons who have rich social relations with the original au- thors. More types of links render more common knowledge and experience [Zhuge, 2009]. This is because the establishment of rich social relations indicates common individual characteristics and social characteristics. (2) Adapting to readers’ interests. The interests of readers determine the selection of summaries. A good summarizer should know its potential readers. This requests a summarizer to collect and analyze readers’ interests according to their reading behaviors and attitudes to summaries. This is to pursuit a suitable summary rather than the best summary. 8 (3) Making summarization through human-machine interaction, which can make full use of the ad- vantages of both human and machines. It is the right way to pursue a satisfied summarization through a human-machine symbiotic system [Licklider, 1960]. (4) Enabling different summaries to cooperate and compete with each other for impact at multiple dimensions (e.g., acceptance for reading and adoption for generating new summaries). Ranking reviews to encourage contribution and competition among reviews reflect social value in a sum- marization environment. Different summaries may represent different characteristics of the summarizer. Integrating individuals of diverse characteristics can cooperate with each other in making new summaries. (5) Transforming summarizations into the problem of searching suitable persons or summaries in the social networks of authors, readers, summarizers, representations and links. (6) Enabling summarizers to know the background of representations, including technological, social and economic aspects. 4. General Citation ⎯ Definition, Measure and Axiom Citation is the basic element of a scientific paper. It enables readers to trace the origin and access relevant knowledge. It reflects the author’s thinking, comment, innovation, and summarization. It records the development track of science. Generally, citation is a kind of representation of selection and language use. Exploring citation is a way to explore the nature of summarization. Summarization is requested at the advanced stage of language development when the complex structure of representation emerges. Citation is a basic semantic link of constructing a complex text. Therefore, it is necessary to understand citation when studying summarization. Explicit citation is often used in scientific papers and books, in form of ‘[reference number]’ or ‘(author, year)’. A research area emerges and evolves through continual citing a set of papers on the same set of concepts through time. As shown in Figure 3, a new paper A (denoting the title, author, abstract, etc.) becomes an often-cited paper and then becomes a source paper when the area is gradu- ally formed. A survey paper summarizes an area through citing many papers in the area, and it is often cited as it helps later researchers to quickly know this area. During the development of a re- search area, different survey papers may appear at different development stages or on different facets [Afantenos, et al., 2005], the later survey paper can benefit from the summaries of previous survey papers. Citation and summarization are often involved in a reciprocity process [Novwak and Sig- mund, 2005]. Different from static text, the citation network dynamically renders the source, the formation and evolution of the area, the backbone, the impact of researchers and institutions, potential knowledge flows through citation links [Zhuge, 2006], and the networks of cooperation between researchers and between institutions with the evolution of the area. Summaries of different scales can be obtained through zoom-in-and-zoom-out on the citation network. It is feasible to transform a citation net- work into a text by using some language patterns (for example, “the idea of A was extended by B”, “the idea of A was used by B”, and “the idea of A inspired B”) to represent different citations, main roles, relations, and development track. Hyperlink of the Web is a kind of explicit citation that freely complements, explains, or extends the content of the current Web pages. Homepage like Yahoo is the summarization of its web pages. Different from scientific papers, webpages can be changed, and links can be also changed, so the hyperlink network of webpages evolve notably. An advanced faceted navigator provides mul- ti-facet summarization of the contents in a website for users [Xu and Zhuge, 2013]. 9 Cite A Cite Cite A B1 B2 Bk Citing Summarizing Cite A B1 B2 C1 C1 Cite Bk Cp D1 D2 D3 D4 Time Area Evolving Figure 3. An area emerges when new papers often cite some old papers. The citation network evolves with partially summarizing an area and rendering topics, important roles, relations and de- velopment track. Implicit citation is used in free texts and literature works. Some implicit citations have mark words such as “someone says” and according to “someone’s opinion”. These implicit citations can be located and transformed into explicit citation by searching these mark words and the references according to author names mentioned in text and then inserting uniform citation marks like scientific papers. Some implicit citations just reuse others’ sentences or clauses without any mark word. For example, the sentence “It’s Greek to me!” appeared in text implicitly cite the scenario used in 1599 in Shakespeare's play Julius Caesar, and “into thin air” cites the book written by Jon Krakauer pub- lished in 1997 and many other earlier works. Transforming implicit citations needs to compare common clauses in works published in different times. Citation is a kind of representation by individual selection and language use. Summarizing vari- ous citations can reach a notion of general citation. Definition (General Citation). Citation is an individual selection of relevant representations for ex- plaining, evidencing, complementing, commenting, or revising a representation, either explicitly or implicitly, according to individual motivation and knowledge. Diverse individual selections evolve the citation network. Citations form the intention and extension of a representation. The extension of representation A consists of all representations that cite A and are cited by A. If representation A cites a set of representations B, then B constitutes an extension of A. If representa- tion A cites a set of representations B, and A is cited by a set of representations C, then both B and C constitute the extension of A. The core representation renders the core idea of a representation. A good article renders just one core. The core representation of a scientific paper is rendered by its keywords, title, abstract and conclusion. The representation that has a direct link to the core representation is close-core repre- sentation. For example, two paragraphs sharing some words are linked by these common words. Representations linked to the close-core representations are relevant-to-core representation. Other representations are peripheral representations. 10 The intention of representation is indicated by core representations and by citation from other representations. The intention of representation p is indicated by (1) the core of p, Core(p), con- sisting of the core representations of p; and, (2) the representations that cite p. A core representation has a high rank in the citation network. It is usually emphasized in various ways to attract attention. For scientific papers, a core representation reflects motivation, problem or solution. The intention of a representation is rendered by commonsense, which is indicated by the basic representations. In natural language, commonsense is indicated by distinctive words and idi- oms. Some scientists tried to codify many commonsense to enable computers to have artificial intel- ligence beyond algorithm [Lenat, etc. 1991]. A core representation takes the priority of emerging when reading. In scientific papers, the core representations usually appear in the front and in the end (e.g., title, abstract and conclusion) so that readers can be impressed before and after reading the main body. This helps enhance the memory of the core by focusing and refocusing on the core when building or retrieving the semantic images in the mental space. Humans have been composing complex representations and making summarization through times, so we have the following axiom. Axiom (Additive Axiom). A representation can be composed by a set of representations. This axiom is the basis of representation (including using languages) and summarization (espe- cially, for multi-document summarization). Therefore, a representation p can be formalized as a structure of representations: p=p (p) p ∪ … ∪ p {p, …, p}, which represents a recursive structure of an abstraction p (p), an union p ∪ … ∪ p, and a set of representations {p, …, p}. Figure 4 depicts the extension and the intention rendered by citations. Cite representation in sci- entific papers is rendered by the paragraph or the sentence that includes the cite mark commonly used in a community. Cite(o1→p) Cite(on→p) Extension Core(p) Cite Cite(o2→p) Core(q2) Cite Core(o1) Core(o2) Core(q1) Intension Core(qm) Core(on) Figure 4. Extension and intention rendered by citation. Dictionaries explain words in texts, so they can be regarded as the basic implicit citations to all texts. From this point of view, any text has a set of basic citations. So, the above statement is suita- ble for text. 11 The basic behaviors of summarization include emerging, selecting, citing (explicitly or implicitly), and organizing representations according to requirement and motivation. Text summarization is a special case of summarization. Definition (Summarization as citation). The summarization S of a set of representations P is ren- dered by its intention Int(P) and extension Ext(B) as follows, where S(Int(P)) is the summarization of the intention of P, S(Int(P)∪Ext(P)) is the summarization of the intention and extension of P, p→p’ means that p cites p’, {Cite(pi→p) i∈[1, …, m]} denotes the set of cite representations in pi that cites p, and Cite(pi→p) describes p from the view of the author of pi. S(P) = <S(Int(P)), S(Int(P)∪Ext(P))>. Int(P) = <Core(p), Core(p) ∪ {Cite(ok→p) k∈[1, …, n], p∈P}>. Ext(P) ={Int(qi) ∪ Int(oj) p→ qi, oj→p, i, j∈[1, …, n] , p∈P}. Different from previous notions of summarization, this definition gives the minimum summary (the summary of the intention) and the maximum summary (the summary of the intention and the extension) of a representation, and it regards citation as the fundamental behavior and mechanism of summarization. 5. Dimension of Representation 5.1 Dimensions of structuring summary Structuring summary in an appropriate form is important as summary is mainly for human to read and understand. An appropriate form concerns the innovative cyber display based on human mental structure, psychological structure and innovative display. The following are some dimensions for organizing a summary. (1) Time. Organizing representations in time order or reverse time order. Time order is in line with human innate sense of time and the process of reading. (2) Author. The original structure of the core representations takes the priority to appear in summary. The reason is that authors are the best person to organize his representation. Authors can have their own styles (patterns) in organizing representations. (3) Core. Features such as location, front size and color render a core representation. The core representations in one representation (e.g., text) render its topic. Relevant representations are arranged at the places closed to the core representation. This priority arranges relevant representations distributed in the original representation at the places close to the core rep- resentations in the summary. This is a phenomenon of semantic locality [Zhuge, 2010]. For a set of closely relevant representations, the order of organizing representations in a summary should consider the formation process of the set, which reflects certain semantics of the set. Citation between scientific papers reflects such an order, which should be considered in multi-document summarization. The linear order of traditional text representations is in line with human physiological character- istics and innate sense of time. It is unclear so far how human mind organize knowledge. To reflect not only reading characteristics but also understanding characteristics, it is a reasonable method to combine the linear organization with the order of generalization and specialization. Further, we can consider organize representations with a multi-dimensional classification space. A dimension like topic can organize coordinates as a tree representing multi-level generalization and specialization. Sub-dimensions can be arranged according to the measure of relevance between co- ordinates. Figure 5 shows a three-dimensional space for organizing representations through time 12 dimension, author dimension and topic dimension. It enables readers to know the topic movement of a particular author or a group of authors through time. It also enables readers to know the role of author such as the source and the novice during the development of a topic at certain time. The mul- ti-dimensional organization can provide multiple threads for readers to browse as indicated by the two-way arrows: (1) Generalization and specialization threads through a topic tree. (2) Time threads within a topic. (3) Topic relevancy threads within a period at the time dimension. (4) The evolution of topics in the area through the time dimension. Topic Humans experience in a multi-dimensional space but have to use a two-dimensional media such as paper and screen to externalize representation. Information loses through transformation from the internal representation to the form of display. Inventing a new interface that can easily convey rep- resentations through multiple channels is a way to improve human understanding. Topic1 Topic4 Topic2 SubTopic SubTopic Topic3 Time A Zhuge Z Author Figure 5. A three-dimensional space for organizing representations. The two-way arrows represent possible browse threads through the dimensions of time, topic and author. A multi-dimensional space can be represented in different forms [Zhuge, 2008]. Figure 6 shows a space with four dimensions: topic, region, time and author, each of which is defined by a tree struc- ture. Every point in the space has one projection at every dimension (a node in the tree). Moving from one point to the other point changes the projections at every dimension. This form of represen- tation can represent a space of any number of dimensions. This form of representation looks similar to the wind-rose plot, which can efficiently convey the meaning of how wind speed and direction are typically distributed at a location. The difference is that the win-rose plot specifies the uniform value: speed, while a point in the multi-dimensional space can have different types of values (projections) at different dimensions. 13 Region Topic Time Author Figure 6. A display form of multi-dimensional space. 5.2 Summarization on-demand Summarization carries out in an interaction environment where people read, write, cite and com- municate with personal spaces. The personal spaces reflect personal reading experience, interests and knowledge based on the texts that have been read. A summarization can be satisfied only when it matches the personal space of the reader. The general process of summarization on demand is shown in Figure 7. The summarization sys- tem is responsible for classifying, linking and reorganizing representations. The function ‘Classify- ing & Linking’ classifies representations according to the given dimensions, connects representations by discovering implicit relations, transforming implicit relations into explicit relations, discovering communities, and identifying appropriate representations. Users can adapt the dimensions to gener- ate new summaries and to add summaries to the system for composition and comparison. Citation links between summaries and source representations help analysis and reuse. The information mod- eling provides the appropriate models for processing and organizing representations. The knowledge provides the rules of representation and understanding. The summarization strategies support the processing of representations under uncertain conditions. The arrows in red color denote the following transformations: (1) Transform representations (including, citation structure) into a multi-dimensional classifica- tion space (denoted as A in Figure 7) by classifying and linking representations. (2) Transform a point or a subspace of A into a point or a subspace in the user personal spaces (denoted as B, C and D), which are also multi-dimensional classification spaces that represent users’ interests and personalities. 14 Define personal space Adapt personal space Contribute summaries Event Summary Time Location B Citations Citations Classifying & Linking Citation structure A On-demand d C D Summarization Knowledge Information modeling Strategies Figure 7. Summarization on demand. 5.3 Forms Previous research on text summarization neglects the innovation of displaying summary as research- ers assume that the form of output is the same as the input. However, the form of summary signifi- cantly influences the understandability of summary. Interface innovation enables users to easily un- derstand a summary. The following are possible forms of interface: (1) Simple structure. Simple structures such as list, tree and grid have been widely used to sum- marize representations in daily life, e.g., displaying table of contents, family trees, organiza- tion structures, and properties on map. Different structures are suitable for different applica- tions. (2) Hypertext. A summary can be in form of a hypertext, where some texts are summarized as a hyperlink, and some texts containing hyperlinks are summarized as a hyperlink at the higher level. The advantage is that the content is the same as the original text and readers can read the concise top-level content first and then read the details by clicking the link if they are interested in. The following steps implement this: (a) Give the expected size of summary and interest. (b) Rank the paragraphs of the text according to the interest. 15 (c) Shrink the low rank paragraphs as hyperlinks. (d) Do (a) if the size of the text is greater than expected, otherwise end. Automatic link generation was studied in hypertext area [Salton, et al, 1997]. An interactive visual text analysis tool can help readers understand the summary [Liu et al., 2012]. (3) Semantic link network. A graph with meaningful nodes and links can clearly summarize the main concepts and cues within text(s) [Zhuge, 2009, 2011]. A semantic link network of important concepts and relations can help readers quickly know the main cues and measures in representations. The key is how to extract appropriate nodes and links from representa- tions. Different from linear reading, a semantic link network enables readers to know a general view and the main measures of large representations immediately. The semantic link network can be regarded as the map of the cyberspace and social space. Semantic link network can be regarded as the extension of the semantic net (Quillian, 1966) and correla- tional nets (Ceccato, 1961), which represents the relations between concepts. (4) Multimedia. Coordinating texts, pictures and videos can render a summary from different channels of sense. It is particularly useful in making slides or posters for scientific research according to papers, and summarizing historical and literature works. A semantic link network is a way to organize multimedia. (5) Emerging. This function is to emerge pictures or video clips relevant to the important repre- sentations in viewing scope while displaying. An eye tracking mechanism can help auto- matically locate the scope. Evaluation is needed to ensure the effectiveness of reading. (6) New devices. New interface devices like 3D monitor will significantly influence the repre- sentation of summary. Optimizing the layout of display needs to consider three dimensions. 3D printer extends display from cyberspace to the physical space. 4D printer will further extend display to the formation of the objects sensed from more dimensions. The advanced summarizer could create new objects that can be seen, touched, smelled, heard and even tasted. People could hold what they think and write. The new interfaces provide a new cognitive environment for humans. Enabling the form to accurately convey the core meaning of what is to be represented is the key. 6. Multi-Dimensional Evaluation Previous evaluation methods focus on summary, which is just one dimension of summarization, and it is not reasonable to pursuit the best summary. The reasonable method is to study the multiple dimensions of the summarization environment and to consider the reasonable result. Summarization is involved in individual and social construction processes, so it concerns multi- ple dimensions. The basic characteristics and principles of language use and understanding indicate the following dimensions for evaluating a summarization: (1) Reader. It includes the following sub-dimensions: a) Interest. A summary should match the interests of readers. Sometimes, readers only need one aspect of a representation. Readers’ comments and previous reading behav- iors (e.g., the often clicked hyperlinks) reflect interests. b) Cognitive level. A summary should match the reader’s cognitive level. Therefore, concepts at the reader’s cognitive level should be selected. (2) Author. A summarizer can understand the input representation better if it knows more about the author, including the relevant articles and social networks. (3) Input. Input should also be evaluated because some representations are unnecessary for summarization. On one hand, a very simple and short representation such as a short para- 16 graph of text and a picture is unnecessary for summarization as they can be quickly under- stood. On the other hand, the input should match readers’ interest first. (4) Summarizer. a) Openness. The closed systems designed by particular persons are unable to make satisfied summarization because only the persons sharing knowledge with the writer can make sat- isfied summarization. b) Adaptability. A summarization system should be improvable during use, and be able to adapt to readers’ updates and adapt to new representations (especially on the same topic). c) Interactivity. This also implies that a summarizer should be able to interact with readers so that it can select the appropriate representations (e.g., sentences) and use the representa- tions that the reader is familiar with. Further, it should interact with other people (includ- ing authors) to get more concepts and rules, and with the systems to get more information. (5) Output (Summary). It includes the following sub-dimensions: a) Core representation. The core representations and the relations between them should be reserved in summary. b) Coherence. Coherence between representations (e.g., sentences) can increase readablitiy [Brandow et al, 1995] [Regina Barzilay and Mirella Lapata, 2008]. c) Completeness. A summary should be self-complete: all core representations that match reader’s interest should be included. (6) Usage. It includes the number of people who have used the summary and their attitudes. 7. Incorporating pictures into summary It is a natural idea to incorporate pictures into summary since pictures have been widely used to render meaning in many representations. Many applications have incorporated pictures into sum- maries, e.g., transforming a paper into slides or a poster, transforming a novel into a carton book, and creating a webpage according to a set of texts and pictures. There could be different ways to arrange pictures in displays but picture should be selected ac- cording to the core sentences and arranged near the core sentences according to the semantic locality principle [Zhuge, 2010]. The summary with pictures is more attractive than the text-only summary. A picture can convey meaning in about 1-10 seconds due to its familiarity and complexity to the viewer. In contrast, read- ers need to scan the whole text to know the text-only summary. The reading order of the two summaries is different. Pictures take the priority in conveying meaning while reading the summary with pictures. The following are two kinds of reading order: (1) browse all the pictures → read the text beside each picture, and (2) view a picture → read beside text →…→ view last picture → read beside text. Pictures and texts may be viewed again but pictures still take priority during reviewing. Further, the two types of summaries have different memory effects. The summary incorporating pictures can enhance reader’s short-term and long-term memory. An explanation is that the summary with pictures gives readers stronger impression and provides more dimensions for rendering meaning, and establishes more links to render meaning. A picture reflects a view of the physical space while natural language indicates a semantic image in mind. A summary rendered by both pictures and natural language provides more indicators for readers to build semantic images. For extractive text summarization, to keep consistency between sentences can enhance readabil- ity. One advantage of incorporating pictures into summary is that pictures provide a different bridge between language units (e.g., sentences), especially when connection sentence cannot be found in 17 original text. For example, the picture with tags a and b (e.g., hotel and garden, indicating “a pic- ture of hotel with nice garden”) can bridge the sentence containing a (e.g., garden, indicating “It is a beautiful garden”), and the sentence containing b (e.g., hotel, indicating “The hotel is near the sea”). This new bridge can enhance the readability of a summary. New generation search engines have integrated pictures, the summaries of texts and hyperlinks in their formatted search results, which provides richer content for users than the link list provided by old search engines. However, a pre-designed format cannot adapt to user requirements. The following are some problems and strategies. (1) How to select appropriate pictures? Humans are specialized in recognizing pictures as they ex- perience and reflect the physical space and form knowledge in mind. However, machines need to rely on human instruction to process pictures. The Web 2.0 provides the platform for people to upload and tag pictures on the Web. The semantic link networks of texts, pictures, tags and users indicate a kind of social semantics of picture usage and thus provide the ground for selec- tion. So building the networks is the key to solve the problem. From the evolution construction and social construction point of views [Zhuge, 2012], tags might have been used in some texts by people. Language representations like tags indicate the usage of the pictures. Existing ap- proaches such as feature-based approaches and machine learning approaches can be used to classify pictures. Image retrieval techniques can help find candidate pictures [Gudivada and Raghavan, 1995]. (2) How to organize pictures and texts? a) Use pictures to replace the corresponding representations in the original text, to summa- rize the rest representation, and to organize the summary according to the original struc- ture. b) Select and use pictures to replace the texts in summary. c) Select and insert pictures into summary at appropriate places. d) Classifying pictures from multiple dimensions including time and location, which help distinguish pictures of different dimensions so that appropriate pictures can be selected to match the text in the summary. e) Construct a semantic link network of pictures, tags and language representations in rele- vant texts as the summary. A semantic link can be regarded as a citation that semanti- cally connects two things [Zhuge, 2011]. (3) How to identify events in pictures and link them to appropriate texts? The strategy is to make use of sensors and create semantic links between pictures and texts by detecting common projections at physical and social dimensions. Current smart cameras (e.g., smart phones) can record the time and physical location of taking photos, which are the projections of pictures on the time dimension and the location dimension. The photos are probably relevant to the events happened at the same time and location. Using pictures to summarize text is a new direction of summarizing text. Empirical research has been done in this direction [Zhu, 2007] [UzZaman, 2011] [Agrawal, 2011]. Research can lead to a new form of summary that can increase readability and understandability. Online picture-sharing systems like Flicker provide rich picture resources for implementing this idea. As new pictures are continually added to the online systems, a good summarization system should be able to keep up-to-date pictures in summarization. Figure 8 depicts the idea of constructing a semantic link network of pictures and tags as a sum- mary. The core words such as “CIKM2012”, “hotel”, “golf” and “garden” can be identified by comparing the source text and tags. Then, the relations like “back of” relying on the core words can be identified. So, the techniques of text summary can be extended to the construction of semantic link network and image retrieval [Gudivada and Raghavan, 1995]. Further, pictures can be extended to the snapshots of videos. Different from image retrieval (e.g., search images according to key- 18 Source Text Last year, to present a paper, I attended CIKM2012 held in Hawaii, United State of American. I lived in a small but very beautiful hotel. In front of the hotel there is a beautiful golf course, surrounded by trees. I can often see rainbows after raining. The back of the hotel is a beautiful garden, which closes to the sea. I can see the sea from the windows of my room. Topic Requirement HotelOf CIKM2012 HotelOf BackOf BackOf In Hawaii In In Hotel In USA.Hawaii Location USA.Hawaii Location words), the picture-based summarization approach has a ground of texts (a network of source texts or summaries) when searching the picture-text repository. Upload New York USA Hawaii Location Web Pictures, Tags Hotel Golf Rainbow Trees Garden Sea Beauty Figure 8. A summarization system consisting of a multi-dimensional classification space of sum- mary in form of semantic link network of pictures and language representations and a requirement space defined and managed by users. The generated summary is not unique as the tag sets of different pictures may be overlapped. Ex- isting summaries can be put into the space and linked to the tag set. In this way, the existing sum- maries can be reused when making new summarizations. It is important to ensure that the generated network of symbols and images should be small to fa- cilitate understanding. According to the efficiency principle and regional principle, the radius of the Activities Scene 2012 Time Topic 19 network should be small. The radius can be defined as the maximum length of link chain from the center (determined by core nodes) to any node. In real application, a summarization system should enable readers to adjust the radius according to requirement. Incorporating pictures into a summary enables a summarizer to summarize events. Events can be classified into points in a complex space with the following dimensions: (1) Time. Dimensions evolve with time. Different types of events may have different distribu- (2) Location. An event happens at a physical location, which can be captured by GPS, IP, or (3) People. Different classes of people play different roles in society and thus are likely in- tions at the time dimension. communication network. volved in different events. (4) Category. The category hierarchy of events. (5) Representation. It usually includes some sub-dimensions: feature representation, pattern representation, language representation (including text, voice, and movie), and function representation (different objects such as car, mobile phone, house and road have different functions) 8. Summarizing Videos, Graphs and Pictures 8.1 Summarizing videos Automatic video summarization is to enable machines to generate a clip of a long video or a set of long videos. It is important in video management, retrieval and browsing. It becomes more and more important with wide use of digital cameras in our society for security, news, entertainment, education, advertisements, etc. Humans are able to make operations to summarize a movie according to their understandings and requirements, but are limited in ability to view and summarize huge volumes of videos generated everyday. Automatic video summarization can help humans quickly know the key content in big video volumes. There are two fundamental classes of video summarization: (1) focusing on still picture (static storyboard), a small collection of salient images extracted from video sources; and, (2) focusing on moving pictures (moving storyboard), a collection of image sequences, and the corresponding audio abstract extracted from the original sequence, which results in a short video clip. Summarizing a video requires machines to identify the essential characteristics of the video. Video summarization concerns the simplification of motion. A video sequence can be represented as trajectory curves in a high-dimensional feature space, which can be decomposed into curve segments of low dimension for simplification [DeMenthon, et al., 1998]. The patterns of events, conversations, and behaviors should be characterized to get semantically meaningful summaries of complicated video contents [Tewfik, 1999]. Low-level features such as color, boundary, and shot classification can help summarize videos. For particular applications like football games [Ekin, 2003], important sections such as slow-motion segments and goals in game are known by humans, so it is easy to find the important sections. Some criteria such as coverage (the summary should represent the original one) and diversity (the elements of the summary should be distinct from each other) were proposed [Shroff, 2010]. Some approaches focus on some contents about who, what, where, and when in the framework of the video contents to produce a concept-level summary [Chen, 2009]. Existing re- search is generally empirical and focuses on particular applications. Modern movies provide more channels (e.g., voice and music) for understanding than early silent movies. Current online movies contain subtitles, which provide a new condition for making summa- rization of videos through natural language processing. These subtitles provide the basis for gener- ating a piece of text as the summary of movies. 20 A semantics-based approach to summarizing videos is to construct a semantic structure on videos by introducing semantic links into videos. The higher abstraction level of the structure presents mo- re general summary of the video. A semantic link network of video components enables users to query the interested components and navigates in the network according to interest, e.g., the seman- tic link network of video components can help play the main thread of a story development. To realize more meaningful video summarization, it is important to represent body language, spoken language, emotion, habit and psychological activities in microscopic. Behavior recognition is the basic components of understanding videos. In macroscopic, it is important to represent the background of the video and relevant social structure, interests, fashion, rules, regulations, laws and culture of society in a summarization system. These concern in-depth understanding of the basic in- teraction principles in the complex space consisting of cyberspace, social space and physical space. 8.2 Summarizing graphs Graphs are the generalization of various real networks in cyberspace (e.g., data structures), phys- ical space (e.g., supply chains, material flow networks) and social space (e.g., social networks of things). Summarizing data structures can provide more general data services. The summarization of rela- tional database takes table as input and produces a reduced version of the table through rewriting and generalization. The resulting table is expected to provide tuples with less precision than the original but more informative [Saint-Paul, 2005]. Summarizing data streams supports more general funda- mental queries on data streams such as point, range, and inner-product queries [G.Cormode and S. Muthukrishnan, 2005]. Fuzzy set was used to summarize data structures [Yager, 1982] [G. Raschia and N. Mouaddib, 2002]. The Resource Space Model supports multi-dimensional generalization and specialization [Zhuge, 2008, 2012]. Transformation between different data structures can help summarization [Zhuge, 2008]. A unified representation such as XML (Extensible Markup Lan- guage) and OWL (Web Ontology Language) helps transformation and unify summarization. Summarization can help humans understand large-scale graphs. Summarizing a large-scale graph of data is important to graph data management as it can render the patterns hidden in data [Navlakha, 2008] [Tian, 2008]. An interactive graph summarization approach was proposed [Zhang, 2010]. Sta- tistics is a useful means for machines to summarize graphs. Network analysis techniques such as degree distribution and community discovery can be used to find more important part and the hier- archy of a graph. In some areas like CAD, graph components have formal specifications. Making abstraction on graph components can be done through mathematical derivation. So, summarization in these areas has the reasons of summarization and the correctness guarantee of using summaries. If we regard a text as a graph of words or sentences, text summarization can be regarded as a problem of summarizing a semantic link network [Zhuge, 2009], where nodes and edges can be texts, pictures and videos. 8.3 Summarizing pictures The main purpose of summarizing pictures is to generate a small set of pictures from a large set of pictures according to interest. There have been more and more real requirements of summarizing pictures with the explosion of digital pictures online in recently years due to the wide deployment of cameras and popularity of smart phones. The summarization of pictures also helps incorporate ap- propriate pictures into the summary as discussed before. Humans can make a humanized summarization because they have experience and knowledge out of pictures. It is hard to enable machines to make a humanized summarization. Discovering the se- 21 mantic link networks that the pictures involved in can help automatic summarization. Automatic summarization of pictures can be extended to include the solutions to the following issues: (1) Generating a piece of text to represent a set of pictures. A solution is to transform this issue into an information retrieval and text summarization issue: Select the representative tags of these pictures, search relevant texts according to these tags (or select the texts that contain or link to these pictures), and then summarize these texts. Another way is to establish basic se- mantic links between pictures, find the best matched text, and make necessary text summari- zation. The establishment of the semantic links relies on the relations between their tags de- termined by existing texts and links and the categories of pictures. (2) Selecting one picture to represent a set of related pictures. A solution is to transform this issue into a text summarization issue: Transform pictures into texts according to the way de- scribed in (1), summarize the texts, and then select a picture to represent the summary by matching its tags and the core words of the summary. (3) Generating a small network of pictures from a large set of related pictures. A solution is to establish the semantic links between pictures, discover the communities of the semantic link network of pictures, select one picture to represent one community, and construct a network of the representative pictures. (4) Generating a small network of texts according to a large set of pictures. A solution is to discover the communities of the semantic link network of pictures, to select one text to rep- resent one community according to the tags of pictures within the community, and to con- struct a semantic link network of the representative texts. A solution to implement this idea is to make use of existing summaries made by humans and the corresponding pictures in the networks of pictures, tags, summaries, source texts and people who involved in forming and using these things. The key problem is to select a better picture from the candidates that have the same projections on the dimensions of time, location and topic, because the semantic links between pictures may be poor. For example, it is hard to automatically find the abstraction relationship between pictures. Modern cameras can generate pictures with time and location information, so the summarization of pictures can be carried out in a space of four dimensions: language, feature, time and location. The problem of summarizing texts, pictures, and videos can be generalized as one problem. The relations between texts, between pictures, and between videos can be mutually enforced, explained and rendered. The form of summary can be a semantic link network of texts, pictures, audios, and videos. 9. General Summarization 9.1 Unification Humans have been pursuing the ways to represent thoughts, behaviors, artifacts and the nature. Various devices and approaches have been invented and developed to represent and process different forms such as natural languages, pictures, videos and graphs. Various representations constitute a representation space with particular structure and operations. Summarization is a kind of operation that inputs one or more representations in this space and then outputs a new representation. Let’s recall how human process representations generated through different channels. People ha- ve the following common experience: Scanning the symbols in a novel generates some images in mind, and the images emerge before symbols when recall. Similar images will be generated when seeing the movie about the novel. A distinguished characteristic is that humans generate behaviors (including mental behaviors) different from the input. This indicates that human mind uniformly 22 processes various things at certain cognitive level. This indicates the possibility of creating a unified method for processing different objects such as texts, pictures, videos and graphs. Cognitive psychologists argue that people usually remember meaning rather than exact represen- tation and that meaning represents through the perceptual and motor systems for interacting with the world. The categorical organization of knowledge strongly influences the way to encode and re- member experiences [Anderson, 2010]. This is the psychological basis of classification. Humans represent what they have seen or felt as semantic images in the mental space through interacting and experiencing in the physical space, and summarizing representations and revising representations during communicating with each other in social space where motivations are gener- ated. To facilitate communication, humans indicate the mental semantic images in the language commonly used in society, but it is hard to communicate in the form of what they have seen or felt. A semantic image can be an image-like form when representing daily life or a symbol-like form when representing abstract concepts. Discovering unity in diversity is a scientific research method, which has generated many im- portant scientific principles and theories, for example, Maxwell successfully unified electricity and magnetism. However, unifying different theories is hard because it needs to uncover the common nature behind existing theories, and different theories may represent different aspects of a domain and use different representation systems that are difficult to be unified. Sometimes, pursuing unity is an adventure like the pursuit of a unified field theory. Knowledge representation approaches such as the production rule [Davis, et al, 1977], the frame [Minsky, 1975] and the semantic net [Quillian, 1966] are symbol systems that can carry out reason- ing for solving problems. A unified representation should reflect the most fundamental characteris- tics of concerned representations. The Unified Modeling Language (UML) uniformly represented business processes and behaviors, software architectures, processes and behaviors, and data struc- tures. Establishing a unified representation enables a summarization system to uniformly process vari- ous representations. A transformational development of the fundamental infrastructure of cyber- space (e.g., a new generation computer) and smarter devices will influence the generation of new representations. 9.2 Transformation with dimension reduction A text can be transformed into a semantic link network of words, sentences and paragraphs. One semantic link network of texts can link to the other semantic link networks of texts to form a larger semantic link network through such relations as citation and coauthor. A video can also be transformed into a semantic link network of video clips. Links between words in subtitles and video clips can be established. Links between videos are enriched through the mediation of words. For the videos with scripts, words will play more important role in representing videos. In addition, voice and music can render the link between videos. A unified method for summarizing different forms can be developed by transforming texts, vide- os, pictures and graphs into semantic link networks. A complex semantic link network of different forms enables one form (e.g., movies) to link to other forms (e.g., novel, script, pictures of actors and actress, posters, comments, related movie, etc). The form of summary can be a small semantic link network of texts, videos, audios, pictures and graphs, which provides more semantic indicators than single type of form like silent movie. Appropriate coordination between different forms concerns humanity and sociology. The size of summary depends on user requirement and cognitive level. Cyberspace consists of huge links among texts, videos, audios, pictures and graphs, corre- sponding to human senses and the structures of cyberspace, physical space and social space. Any 23 text, video, audio, picture or graph does not exist independently, has explicit or implicit links to other form of representations. One form of representation like text usually links to other forms of repre- sentation like pictures, and possibly to video, audio and graph, which can be regarded as citation for explanation, complementation or extension. The network evolved with social interactions deter- mines different summaries at different times. Transformation between representations is a way to realize unification. It inputs one form of representation and outputs another form of representation. Summarization is a special transfor- mation that operates dimension reduction for easier understanding. From this point of view, summa- rization can be regarded as a transformation of reducing the dimensions of a representation so that the dimensions of representation can be linked to and merge with the dimensions in the mental space. Therefore, we have the following definition. Definition (Multi-dimensional summarization). Multi-dimensional summarization is a func- tion S(P(d1, …, dm)) = T(di, …, dj), which transforms a representation p(d1=p1 …, dm=pm) in the source space of representations P with dimensions d1, …, and dm into a representation t(di=ti, …, dj=pj) in the target space of representations T with dimensions di, …, and dj (m≥j≥i≥1) such that t contains the core of p at dimensions di, …, and dj. The dimensions of P vary with different sources and the dimensions of T vary with the readers of the summary. Some relations may exist between dimensions. Usually, T has a small number of di- mensions. The scale of summary can be regarded as a dimension. The reason is that a reader can easily and quickly understand the summary if the dimension of the target space is the same as the dimension of the reader’s personal space, which represents the reader’s mind (cognitive architec- ture). The definition of summarization based on citation given in section 4 gives the range of T, and (di, …, dj) reflects the basic cognitive level of reader. 9.3 Cognitive level Cognitive psychologists have been exploring mental concepts through rational definition, prototype, exemplar and knowledge studies. They try to find the basic cognitive level in the concept hierarchy shared by people [Murphy, 2002]. However, different communities can have different cognitive levels. The basic cognitive level can be established for the hierarchy of universal concepts. The cyberspace including the Wikipedia is reflecting more and more of the hierarchy of the universal concepts. The cognitive hierarchy of different communities corresponds to different sub-graphs of the hierarchy and has different basic cognitive levels. The cognitive level for a particular research field can be reflected by all of its papers. It stands for the basic cognitive level of all the authors in the field. Relevant research concerns commonsense, knowledge level, and abstraction [Newell, 1982] [Minsky, 2006] [Tenenbaum, 2011]. Physical instruments such as functional magnetic resonance imaging fMRI and electroencephalography EGG have been used to detect the physical status of mind [Turkeltaub, 2002]. The relations between language and brain have attracted many researchers [Friederici, 2000] [Bates and Dick, 2002]. A summary is suitable if its cognitive level is the same as the reader’s cognitive level. The following are some rules to make a suitable summary: (1) If the cognitive level of the original representation is the same as the reader’s cognitive level, the summary should use the core representations in the original representation. 24 (2) If the cognitive level of the original representation is higher than the reader’s cognitive level, the summary should use more specific concepts in the commonsense category hierarchy. (3) If the cognitive level of the original representation is lower than the reader’s cognitive level, the summary should use more general concepts in the commonsense category hierarchy. 9.4 Representation lattice In psychology, representation is a kind of hypothetical internal cognitive symbol that represents ex- ternal reality. Externalization of the internal representation involves in complex mental, physical and social behaviors. Ontology helps establish a general representation from the nature of the world, knowledge and knowing. From the pragmatism point of view, ontology was developed by IT pro- fessionals for information sharing [Gruber, 1993] [Ashburner, 2000]. Ontology helps explain repre- sentation and establish the links between representations. This enables summarization systems to use more general or specific concepts in summary. Representations can be generalized, united, classified and semantically linked to form a lattice of representations at a cognitive level of ontology as shown in Figure 9. A cognitive level determines a representation lattice. Operations on representations enrich the structure of the lattice. Abstraction and analogy are the important operations of generating representations [Zhuge, 2010, 2011, 2012]. The abstract representation reflects the common characteristics of a set of different types of con- cerned representations. Abstract representation is particularly useful for developing theories. Math- ematical tools such as logic, algebra and graph can help develop abstract representations. However over abstract representation may not be useful in real applications. Abstract Representation Generalization Cognitive Level Representations Ontology Semantic link Network Classification Union Figure 9. Representation lattice at certain cognitive level. The union of representations integrates different representations to provide a global view of these representations. It is important to ensure the understandability and expressiveness of the integrated representation. As a kind of union, data integration enables users to get a global view of data gener- ated from different sources [Friedman, et al, 1999; Lenzerini, 2002; Halevy et al, 2006]. The union of the semantic link network and the classification space forms a complex classification space. A complex space incorporating multi-dimensional classification space and semantic link network was 25 used to represent and organize semantic images. Different representations of the same thing can be linked to the same semantic image for understanding and thinking [Zhuge, 2010, 2011, 2012]. The general summarization inputs a representation and a cognitive level at certain ontology and then outputs a representation lattice and a recommended representation. 12. Conclusion Summarization is an open representation of representation, in diverse forms, from multiple di- mensions, and through interactions in multiple spaces. The basic interactions include selecting, cit- ing and organizing representations according to requirement and motivation. Texts have been the major means to reflect the evolution of human society. It is necessary to explore automatic summarization of texts expanding rapidly in cyberspace. However, existing ap- proaches are empirical, mainly relying on statistics, structure and linguistic analysis while neglecting the nature of representation and understanding. This paper summarizes previous approaches and explores the fundamental theory and method for summarization from multiple dimensions. The core viewpoint is that summarization is carried out with various interactions involved in human, machine, and various representations including text, picture, and video. Writers and readers represent mainly through explicit or implicit citations. Studying the summarization of pictures, videos and graphs reaches a general summarization method. It is hard for automatic summarization systems to realize human-level summarization as it con- cerns the essential natural and social differences between human and the systems. Putting summa- rization into a human-machine-nature symbiotic network is a way to make a breakthrough. A signif- icant progress of summarization research relies on an innovative summarization of philosophy, psy- chology, linguistics, cognitive science, neuroscience, physics, computer science, and artificial intel- ligence from multiple dimensions. This work is an attempt to help broaden the scope of summarization research and inspire cross-disciplinary research to develop this area. References [1] [2] S. Afantenos, V. Karkaletsis, and P. Stamatopoulos, Summarization from Medical Documents: A Survey, Artifi- cial Intelligence in Medicine, 33(2)(2005)157-177. R. Agrawal, S. Gollapudi, A.Kannan, and K.Kenthapadi, Enriching Textbooks with Images. In Proceedings of the 20th ACM International Conference on Information and Knowledge Management, pp. 1847-1856, 2011. [3] N. Agarwal, K. Gvr, R. S. Reddy, C. P. Rosé. SciSumm: a multi-document summarization system for scientific [4] [5] [6] [7] [8] [9] articles. ACL2011, pages 115-120. A. Abu-Jbara and D. Radev. Coherent citation-based summarization of scientific papers. ACL2011, pp. 500–509. M. Ashburner, et al., Gene Ontology: tool for the unification of biology, Nature Genetics, 25, (2000) pp.25 - 29. J. R. Anderson, Cognitive Psychology and Its Implications, Seventh Edition, Worth Publishers, 2010. R. Barzilay and M. Elhadad. Using lexical chains for text summarization. Proceedings of ISTS’97. R. Barzilay, K. R. McKeown, and M. Elhadad. Information fusion in the context of multi-document summariza- tion. Proceedings of ACL’99. R. Barzilay, K. McKeown, Sentence Fusion for Multidocument News Summarization, Computational Linguistics, 31(3)(2005)297-328. [10] R. Barzilay and M. Lapata, Modeling Local Coherence: An Entity-Based Approach, Computational Linguistics, 1(34)(2008)1-34. opment, 2(4)(1958)354-361. 293-310. [11] P. Baxendale, Machine-made index for technical literature – an experiment. IBM Journal of Research and Devel- [12] E. Bates and F. Dick, Language, gesture, and the developing brain, Developmental Psychobiology, 40(2002) [13] R. Brandow, K. Mitze and L. F. Rau, Automatic consideration of electronic publications by sentence selection, Information Processing & Management, 5(31)(1995)675-685. [14] Britton, Bruce K., and Arthur C. Graesser, eds. Models of understanding text. Psychology Press, 1996. 26 [15] J. Carbonell and J. Goldstein. The use of MMR, diversity-based reranking for reordering documents and produc- ing summaries. Proceedings of ACM SIGIR’98. pp. 335–336. [16] S. Ceccato, Linguistic Analysis and Programming for Mechanical Translation, Gordon and Breach, New York. [17] B.-W. Chen, J.-C. Wang, and J.-F. Wang, A Novel Video Summarization Based on Mining the Story-Structure and Semantic Relations Among Concept Entities, IEEE Transactions on Multimedia, 11(2)(2009)295-312. J.Chen and H.Zhuge, Summarization of Scientific Documents by Detecting Common Facts in Citations, Future Generation Computer Systems, 32(2014)246-252. [19] C. L.A. Clarke, et al. Novelty and diversity in information retrieval evaluation. Proceedings of ACM SIGIR’08. pp. [18] 1961. 659–666. [20] N. Chomsky, Language and Mind, Cambridge University Press, 3rd ed. 2006. [21] N. Chomsky, Knowledge of Language: Its Nature, Origin, and Use, Praeger Publisher, 1986. [22] A.M. Collins and E.F. Loftus, A spreading-activation theory of semantic processing. Psychological Review, 82(6)(1975)407-428. J. M. Conroy and D. P. O'leary. Text summarization via hidden markov models, Proceedings of SIGIR 2001, pp. 406-407. [24] G. Cormode and S. Muthukrishnan, An improved data stream summary: the count-min sketch and its applications, [23] Journal of Algorithms, 55(1)(2005)58-75. [25] H. Daumé III. and D. Marcu. A tree-position kernel for document compression. Proceedings of DUC2004. [26] H. Daumé III and D. Marcu. Bayesian query-focused summarization. ACL2006, pp. 305–312. [27] R. Davis, B. Buchanan, and E. Shortliffe, Production rules as a representation for a knowledge-based consultation program, Artificial intelligence, 8(1)(1977)15-45. [28] D. DeMenthon, V. Kobla, and D. Doermann, Video Summarization by Curve Simplification, in Proceedings of the 6th ACM International Conference on Multimedia, 1998, pp.211-218. [29] H. P. Edmundson. New methods in automatic extracting. Journal of the ACM, 16(1969)23–42. [30] A. Elkiss, et al. Blind men and elephants: What do citation summaries tell us about a research article? Journal of the American Society for Information Science and Technology archive, 59(1)(2008)51-62. [31] A. Elkiss, Siwei Shen, Anthony Fader. Lexrank: Graphbased lexical centrality as salience in text summarization. Journal of Artificial Intelligence Research, 22(2004) 457–479. [32] A. Ekin, A.M. Tekalp, and R. Mehrotra, Automatic soccer video analysis and summarization, IEEE Transactions SIGIR2001, pp.19-25. ACM SIGIR, 2014. 1993, Pages 199–220. on Image Processing, 12(7)(2003)796-807. 40(4)(2014)592-600. [33] M. A. Fattah, A hybrid machine learning model for multi-document summarization, Applied Intelligence, [34] A. D. Friederici, M. Meyer, D.Y.V. Cramon, Auditory Language Comprehension: An Event-Related fMRI Study on the Processing of Syntactic and Lexical Information, Brain and Language, 74(2)(2000) 289–300. [35] M. Friedman, A.Y. Levy, and T.D. Millstein, Navigational plans for data integration, AAAI 1999. [36] M. Foucault, The Order of Things, Gallimard, 1966. [37] M. Foucault, The Archaeology of Knowledge. First published by Editions Gallimard, 1969. [38] Y. Gong and X. Liu, Generic text summarization using relevance measure and latent semantic analysis, ACM [39] L. A. Gottschalk and G. C. Gleser, The measurement of psychological states through the content analysis of ver- bal behavior. Berkeley: University of California Press, 1969. [40] O. Gross, A. Doucet, and H. Toivonen, Document Summarization based on word association, In Proceedings of [41] V. N. Gudivada and V.V. Raghavan. Content based image retrieval systems, Computer, 9(28)(1995)18-22. [42] T. R. Gruber, A translation approach to portable ontology specifications, Knowledge Acquisition, Vol. 5, Issue 2, [43] U. Hahn, The Challenges of Automatic Summarization. Computer, 33(11)(2000)29-36. [44] H. Hardy, N. Shimizu, T. Strzalkowski, L. Ting, X. Zhang, and G.B. Wise, Cross-document summarization by concept classification, ACM SIGIR 2002, pp. 121-128. [46] [45] A. Halevy, A. Rajaraman and J. Ordille, Data integration: the teenage years, Proceedings of the 32nd International Conference on Very Large Data Bases (VLDB 2006), pp.9-16. J. Hornak, E.T Rolls, and D. Wade, Face and voice expression identification in patients with emotional and behavioural changes following ventral frontal lobe damage, Neuropsychologia, 34(4)(1996)247-261. [47] M. Hu and B. Liu, Mining and summarizing customer reviews, ACM KDD 2004, pp. 168-177. [48] W. Kintsch and T. A. V. Dijk, Toward a model of text comprehension and production. Psychological re- view, 85(5)(1978)363-394. [50] [49] K. Knight and D. Marcu. Summarization beyond sentence extraction: A probabilistic approach to sentence com- pression, Artificial Intelligence, 139(1)(2002)91–107. J. Kupiec, J. Pedersen, and F. Chen. A trainable document summarizer. Proceedings SIGIR’95, 68-73, New York, USA. [51] D.B. Lenat and E.A. Feigenbaum, On the thresholds of knowledge, Artificial intelligence, 47(1-3) (1991)185-250. 27 2014. [52] J. C. R. Licklider, Man-Computer Symbiosis, IRE Transactions on Human Factors in Electronics, HFE-1(1960)4-11. [53] S. Liu, M. X. Zhou, S. Pan, Y. Song, W. Qian, W. Cai, and X. Lian, TIARA: Interactive, Topic-Based Visual Text Summarization and Analysis, ACM Trans. on Intelligent Systems and Technology, 3(2)(2012), article no.25. [54] G. R. Loftus and N. H.Mackworth, Cognitive determinants of fixation location during picture viewing. Journal of Experimental Psychology: Human Perception and Performance, 4(4), 1978, 565-572. [55] A. Louis, A Bayesian Method to incorporate background knowledge during automatic text summarization, ACL [56] M. Lenzerini, Data integration: A theoretical perspective, Proceedings of MOD-SIGACT-SIGART Symposium on Principles of Database Systems (PDOS), 2002, pp.233-246. [57] H. P. Luhn. The automatic creation of literature abstracts. IBM Journal of Research Development, 2(1958)159–165. J. McCarthy, From here to human-level AI, Artificial Intelligence, 171(18)(2007)1174-1182. J. McCarthy, The well-designed child, Artificial Intelligence, 172(18)(2008)2003-2014. I. Mani, and M. T. Maybury, Advances in Automatic Text Summarization. MIT Press, 1999. I. Mani, Automatic Summarization, John Benjamins B.V., 2001. [58] [59] [60] [61] [62] K. R. McKeown and D. R. Radev. Generating summaries of multiple news articles. Proc ACM SIGIR’95, USA. the 21st ACM SIG- [63] K. R. McKeown, et al., Towards multidocument summarization by reformulation: progress and prospects, Pro- [64] R. Mihalcea. Language Independent extractive summarization. AAAI 2005, pp.1688-1689. [65] M. Minsky. A Framework for Representing Knowledge, in The Psychology of Computer Vision, P. Winston (Ed.), [66] M. Minsky, The Emotion Machine: Commonsense Thinking, Artificial Intelligence, and the Future of the Human pp. 74–82. ceedings of AAAI-99. McGraw-Hill, 1975. Mind, Simon & Schuster, 2006. 926-931. [67] G. L. Murphy, The Big Book of Concepts, MIT Press, 2002. [68] H. Nanba and M. Okumura. Towards multi-paper summarization using reference information. IJCAI 1999, pages [69] A. Nenkova. Automatic text summarization of newswire: Lessons learned from the document understanding con- ference. Proceedings of AAAI 2005, Pttsburgh, USA. pp.419-432. [70] S. Navlakha, R. Rastoji, N. Shrivastava, Graph Summarization with Bounded Error, ACM SIGMOD 2008, [71] A. Newell, The knowledge level, Artificial Intelligence, 18(1982) 87–127. [72] M. A. Nowak and K. Sigmund, Evolution of indirect reciprocity, Nature, 427(27)(2005)1291-1298. [73] B. Pang and L. Lee, A sentimental education: sentiment analysis using subjectivity summarization based on min- imum cuts, ACL 2004, Article No.271. [74] S. V. Paunonen and M. C. Ashton, Big Five factors and facets and the prediction of behavior. Journal of Person- ality and Social Psychology. American Psychological Association. 2001. [75] V.Qazvinian and D.R.Radev, Scientific paper summarization using citation summary networks, COLING '08 Proceedings of the 22nd International Conference on Computational Linguistics, vol. 1,2008, pp.689-696. [76] V. Qazvinian and D. R. Radev. Identifying non-explicit citing sentences for citation-based summarization. ACL 2010, pages 555–564. [77] M. R. Quillian, Semantic Memory, PhD dissertation, Carnegie Institute of Technology (now CMU). (1966) [78] D. R. Radev, Kathleen R. Mckeown. Generating natural language summaries from multiple on-line sources. [79] G. Raschia and N. Mouaddib, SAINTETIQ: a fuzzy set-based approach to database summarization, Fuzzy Sets Computational Linguistics, 24(3): 469-500. and Systems, 129(2)(2002)137–162. [80] L. F. Rau, P. S. Jacobs, U. Zernik. Information extraction and text summarization using linguistic knowledge ac- quisition, Information Processing & Management, 25(4)(1989)419-428. [81] E. D. Reichle, A. Pollatsek, D. L. Fisher, K. Rayner, Toward a model of eye movement control in reading, Psychological Review, 105(1)(1998)125-157. [82] K. Rayner, Eye movements in reading and information processing: 20 years of research. Psychological Bulletin, [83] D.N. Stern, Interpersonal World of the Infant: A view from psychoanalysis and development psychology, Basic 124(3)(1998)372-422. Books, 1985. [84] G. Salton, A. Singhal, M. Mitra, C. Buckley, Automatic text structuring and summarization, Information Pro- cessing & Management, 33(2)(1997)193–207. [85] R. Saint-Paul, G. Raschia and N. Mouaddib, General purpose database summarization, VLDB 2005, pp.733-744. [86] D. Shen, J.-T. Sun, H. Li, Q. Yang, and Z. Chen. Document summarization using conditional random fields, IJCAI 2007, pp.2862-2867. [87] H. G. Silber and K. F. McCoy. Efficiently computed lexical chains as an intermediate representation for automatic text summarization, Computational Linguistics, 28(4)(2002)487-496. 28 pp.567-580. [88] N.Shroff, P. Turaga, and R. Chellappa, Video Précis: Highlighting Diverse Aspects of Videos, IEEE Transactions on Multimedia, 12(8)(2010)853-868. [89] Y. R. Tausczik and J. W. Pennebaker, The Psychological Meaning of Words: LIWC and Computerized Text Analysis Methods. Journal of Language and Social Psychology, 29(1) (2009)24–54. [90] S. Teufel. Summarizing scientific articles: Experiments with relevance and rhetorical Status. Computational Lin- guistics, 28(4)(2002)409-445. J. Nam and A. H. Tewfik, Dynamic Video Summarization and Visualization, ACM Multimedia1999, pp.53-56. J.W. Schooler, S.Ohlsson and K.Brooks, Thoughts beyond words: When language overshadows insights, Journal of Experimental Psychology: General. 122(2)(1993)166-183. J.B. Tenenbaum, C. Kemp, T.L. Griffiths, N.D. Goodman, How to grow a mind: Statistics, structure, and abstraction, Science, Vol. 331 no. 6022 pp. 1279-1285, 2011. [94] Y. Tian, R. A. Hankins, and J. M. Patel, Efficient Aggregation for Graph Summarization, ACM SIGMOD 2008, [91] [92] [93] [95] P. E. Turkeltaub, G. F. Eden, K. M. Jones, and T. A. Zeffiro, Meta-Analysis of the Functional Neuroanatomy of Single-Word Reading: Method and Validation, NeuroImage, 16(3), Part A, (2002)765-780. [96] N.UzZaman, J. P. Bigham, and J. F. Allen, Multimodal summarization of complex sentences. In Proceedings of the 16th ACM International Conference on Intelligent User Interfaces, 2011, pp. 43-52. [97] G. Wallas, The Art of Thought. 1926. [98] D.Wang, S. Zhu, T. Li and Y. Gong, Comparative document summarization via discriminative sentence selection, ACM Transactions on Knowledge Discovery from Data, 6(3)(2012), article no.12. [99] B.Xu and H.Zhuge, Faceted navigation through keyword interaction, World Wide Web, 17(4)(2014)671-689. [100] B.Xu and H.Zhuge, A Text Scanning Mechanism Simulating Human Reading Process, IJCAI 2013. [101] R. R. Yager, A New Approach to the Summarization of Data, Information Sciences, 28(1)(1982)69-86. [102] N. Zhang, Y. Tian, J.M. Patel, Discovery-Driven Graph Summarization, IEEE ICDE 2010, pp.880-891. [103] X. Zhu, A. B. Goldberg, M. Eldawy, C. R. Dyer, and B.Strock, A text-to-picture synthesis system for augmenting communication. In AAAI, Vol. 7, pp. 1590-1595. 2007. [104] H.Zhuge, The Web Resource Space Model, Springer, 2008. [105] H. Zhuge, Discovery of knowledge flow in science, Communications of the ACM, 49 (5) (2006) 101-107. [106] H. Zhuge, The Web Resource Space Model, Springer, 2008. [107] H. Zhuge, Y. Xing and P. Shi, Resource Space Model, OWL and Database: Mapping and Integration, ACM Transactions on Internet Technology, 8/4, 2008. [108] H. Zhuge and Y. Xing, Probabilistic Resource Space Model for Managing Resources in Cyber-Physical Society, IEEE Transactions on Service Computing, 5(3)(2012) 404-421. [109] H. Zhuge, Communities and emerging semantics in semantic link network: discovery and learning, IEEE Trans- actions on Knowledge and Data Engineering, 21(6) (2009) 785-799. [110] H. Zhuge, Interactive semantics. Artificial Intelligence, 174(2) (2010) 190-204. [111] H. Zhuge, Semantic linking through spaces for cyber-physical-socio intelligence: A methodology, Artificial Intel- ligence, 175 (2011) 988-1019. edition). [112] H. Zhuge, The Knowledge Grid ⎯ Toward the Cyber-Physical Society, Springer, 2012, 2nd Edition (2004, 1st [113] A. Zubiaga, D. Spina, E. Amigo, and J. Gonzalo, Towards real-time summarization of scheduled events from twitter streams, in Proceedings of ACM HT2012, 2012, pp.319-320. 29
1710.02717
1
1710
2017-10-07T18:30:38
Group Sparse CNNs for Question Classification with Answer Sets
[ "cs.CL" ]
Question classification is an important task with wide applications. However, traditional techniques treat questions as general sentences, ignoring the corresponding answer data. In order to consider answer information into question modeling, we first introduce novel group sparse autoencoders which refine question representation by utilizing group information in the answer set. We then propose novel group sparse CNNs which naturally learn question representation with respect to their answers by implanting group sparse autoencoders into traditional CNNs. The proposed model significantly outperform strong baselines on four datasets.
cs.CL
cs
Group Sparse CNNs for Question Classification with Answer Sets Mingbo Ma Liang Huang School of EECS Oregon State University Corvallis, OR 97331, USA {mam,liang.huang}@oregonstate.edu Bing Xiang Bowen Zhou IBM Watson Group T. J. Watson Research Center Yorktown Heights, NY 10598, USA {bingxia,zhou}@us.ibm.com 7 1 0 2 t c O 7 ] L C . s c [ 1 v 7 1 7 2 0 . 0 1 7 1 : v i X r a Abstract Question classification is an important task with wide applications. However, tra- ditional techniques treat questions as gen- eral sentences, ignoring the corresponding answer data. In order to consider answer information into question modeling, we first introduce novel group sparse autoen- coders which refine question representa- tion by utilizing group information in the answer set. We then propose novel group sparse CNNs which naturally learn ques- tion representation with respect to their answers by implanting group sparse au- toencoders into traditional CNNs. The proposed model significantly outperform strong baselines on four datasets. 1 Introduction Question classification has applications in many domains ranging from question answering to di- alog systems, and has been increasingly popular in recent years. Several recent efforts (Kim, 2014; Kalchbrenner et al., 2014; Ma et al., 2015) treat questions as general sentences and employ Con- volutional Neural Networks (CNNs) to achieve re- markably strong performance in the TREC ques- tion classification task. We argue, however, that those general sentence modeling frameworks neglect two unique proper- ties of question classification. First, different from the flat and coarse categories in most sentence classification tasks (i.e. sentimental classification), question classes often have a hierarchical struc- ture such as those from the New York State DMV FAQ1 (see Fig. 1). Another unique aspect of ques- tion classification is the well prepared answers for each question or question category. These answer 1Crawled from http://nysdmv.custhelp.com/app/home. This data and our code will be at http://github.com/cosmmb. 1: Driver License/Permit/Non-Driver ID a: Apply for original b: Renew or replace ... 2: Vehicle Registrations and Insurance a: Buy, sell, or transfer a vehicle b: Reg. and title requirements ... 3: Driving Record / Tickets / Points ... (49 questions) (24 questions) (22 questions) (42 questions) Figure 1: Examples from NYDMV FAQs. There are 8 top-level categories, 47 sub-categories, and 537 questions (among them 388 are unique; many questions fall into multiple categories). sets generally cover a larger vocabulary (than the questions themselves) and provide richer informa- tion for each class. We believe there is a great po- tential to enhance question representation with ex- tra information from corresponding answer sets. To exploit the hierarchical and overlapping structures in question categories and extra infor- mation from answer sets, we consider dictionary learning (Cand`es and Wakin, 2008; Rubinstein et al., 2010) which is a common approach for rep- resenting samples from many correlated groups with external information. This learning pro- cedure first builds a dictionary with a series of grouped bases. These bases can be initialized ran- domly or from external data (from the answer set in our case) and optimized during training through Sparse Group Lasso (SGL) (Simon et al., 2013). To apply dictionary learning to CNN, we first develop a neural version of SGL, Group Sparse Autoencoders (GSAs), which to the best of our knowledge, is the first full neural model with group sparse constraints. The encoding matrix of GSA (like the dictionary in SGL) is grouped into different categories. The bases in different groups can be either initialized randomly or by the sentences in corresponding answer categories. Each question sentence will be reconstructed by a few bases within a few groups. GSA can use either linear or nonlinear encoding or decoding while SGL is restricted to be linear. Eventually, to model questions with sparsity, we further pro- pose novel Group Sparse Convolutional Neural Networks (GSCNNs) by implanting the GSA onto CNNs, essentially enforcing group sparsity be- tween the convolutional and classification layers. This framework is a jointly trained neural model to learn question representation with group sparse constraints from both question and answer sets. 2 Group Sparse Autoencoders 2.1 Sparse Autoencoders Autoencoder (Bengio et al., 2007) is an unsuper- vised neural network which learns the hidden rep- resentations from data. When the number of hid- den units is large (e.g., bigger than input dimen- sion), we can still discover the underlying struc- ture by imposing sparsity constraints, using sparse autoencoders (SAE) (Ng, 2011): 2.2 Group Sparse Autoencoders Group Sparse Autoencoder (GSA), unlike SAE, categorizes the weight matrix into different groups. For a given input, GSA reconstructs the input signal with the activations from only a few groups. Similar to the average activation ρj for sparse autoencoders, GSA defines each grouped average activation for the hidden layer as follows: ηp = 1 mg m(cid:88)i=1 g(cid:88)l=1 (cid:107)hi p,l(cid:107)2 (3) where g represents the size of each group, and ηj first sums up all the activations within pth group, then computes the average pth group respond across different samples' hidden activations. Similar to Eq. 2, we also use KL divergence to measure the difference between estimated intra- group activation and global group sparsity: η ηp + (1 − η) log KL(η(cid:107)ηp) = η log where G is the number of groups. Then the objec- tive function of GSA is: (4) 1 − η 1 − ηp Jsparse(ρ) = J + α s(cid:88)j=1 KL(ρ(cid:107)ρj) (1) Jgroupsparse(ρ, η) = J + α where J is the autoencoder reconstruction loss, ρ is the desired sparsity level which is small, and thus Jsparse(ρ) is the sparsity-constrained version of loss J. Here α is the weight of the sparsity penalty term defined below: KL(ρ(cid:107)ρj) = ρ log where ρ ρj + (1 − ρ) log 1 − ρ 1 − ρj (2) ρj = 1 m hi j m(cid:88)i=1 represents the average activation of hidden unit j over m examples (SAE assumes the input features are correlated). As described above, SAE has a similar objec- tive to traditional sparse coding which tries to find sparse representations for input samples. Besides applying simple sparse constraints to the network, group sparse constraints is also desired when the class categories are structured and overlapped. In- spired by group sparse lasso (Yuan and Lin, 2006) and sparse group lasso (Simon et al., 2013), we propose a novel architecture below. s(cid:88)j=1 G(cid:88)p=1 KL(ρ(cid:107)ρj) KL(η(cid:107)ηp) (5) + β where ρ and η are constant scalars which are our target sparsity and group-sparsity levels, resp. When α is set to zero, GSA only considers the structure between difference groups. When β is set to zero, GSA is reduced to SAE. 2.3 Visualizing Group Sparse Autoencoders In order to have a better understanding of GSA, we use the MNIST dataset to visualize GSA's internal parameters. Fig. 2 and Fig. 3 illustrate the pro- jection matrix and the corresponding hidden acti- vations. We use 10,000 training samples. We set the size of the hidden layer to 500 with 10 groups. Fig. 2(a) visualizes the input image for hand writ- ten digit 0. In Fig. 2(b), we find similar patterns within each group. For example, group 8 has different forms of digit 0, and group 9 includes different forms of digit 7. However, it is difficult to see any mean- ingful patterns from the projection matrix of basic autoencoders in Fig. 2(c). (a) (b) (c) Figure 2: The input figure with hand written digit 0 is shown in (a). Figure (b) is the visualization of trained projection matrix W on MNIST dataset. Different rows represent different groups of W in Eq. 5. For each group, we only show the first 15 (out of 50) bases. The red numbers on the left side are the indices of 10 different groups. Figure (c) is the projection matrix from basic autoencoders. 1 2 3 4 5 6 7 8 9 10 (a) (b) Figure 3: (a): the hidden activations h for the input image in Fig. 2(a). The red numbers corresponds to the index in Fig. 2(b). (b): the hidden activations h for the same input image from basic autoencoders. Fig. 3(a) shows the hidden activations with re- spect to the input image of digit 0. The patterns of the 10th row in Fig. 2(b) are very similar to digit 1 which is very different from digit 0 in shape. Therefore, there is no activation in group 10 in Fig. 3(a). The majority of hidden layer activations are in groups 1, 2, 6 and 8, with group 8 being the most significant. When compared to the projection matrix visualization in Fig. 2(b), these results are reasonable since the 8th row has the most similar patterns of digit 0. However, we could not find any meaningful pattern from the hidden activations of basic autoencoder as shown in Fig. 3(b). GSA could be directly applied to small image data (e.g. MINIST dataset) for pre-training. How- ever, in tasks which prefer dense semantic rep- resentations (e.g. sentence classification), we still need CNNs to learn the sentence representation automatically. In order to combine advantages from GSA and CNNs, we propose Group Sparse Convolutional Neural Networks below. 3 Group Sparse CNNs CNNs were first proposed by (LeCun et al., 1995) in computer vision and adapted to NLP by (Col- lobert et al., 2011). Recently, many CNN-based techniques have achieved great successes in sen- tence modeling and classification (Kim, 2014; Kalchbrenner et al., 2014). Following sequential CNNs, one dimensional convolutions operate the convolution kernel in se- quential order xi,j = xi ⊕ xi+1 ⊕ ··· ⊕ xi+j, where xi ∈ Re represents the e dimensional word representation for the i-th word in the sentence, and ⊕ is the concatenation operator. Therefore xi,j refers to concatenated word vector from the i-th word to the (i + j)-th word in sentence. A convolution operates a filter w ∈ Rn×e to a window of n words xi,i+n with bias term b(cid:48) by ai = σ(w · xi,i+n + b(cid:48)) with non-linear activation 1 2 3 4 5 6 7 8 9 10 Figure 4: Group Sparse CNN. We add an extra dictionary learning layer between sentence representation z and the final classification layer. W is the projection matrix (functions as a dictionary) that converts z to the group sparse representation h (Eq. 5). Different colors in the projection matrix represent different (cid:124) instead of W for presentation purposes. Darker colors in h mean larger values groups. We show W and white means zero. function σ to produce a new feature. The filter w is applied to each word in the sentence, generating the feature map a = [a1, a2,··· , aL] where L is the sentence length. We then use a = max{a} to represent the entire feature map after max-pooling. In order to capture different aspects of patterns, CNNs usually randomly initialize a set of filters with different sizes and values. Each filter will generate a feature as described above. To take all the features generated by N different filters into count, we use z = [ a1,··· , aN ] as the final rep- resentation. In conventional CNNs, this z will be directly fed into classifiers after the sentence rep- resentation is obtained, e.g. fully connected neural networks (Kim, 2014). There is no easy way for CNNs to explore the possible hidden representa- tions with underlaying structures. In order to exploit these structures, we pro- pose Group Sparse Convolutional Neural Net- works (GSCNNs) by placing one extra layer be- tween the convolutional and the classification lay- ers. This extra layer mimics the functionality of GSA from Section 2. Shown in Fig. 4, after the conventional convolutional layer, we get the fea- ture map z for each sentence. In stead of directly feeding it into a fully connected neural network for classification, we enforce the group sparse con- straint on z in a way similar to the group sparse constraints on hidden layer in GSA from Sec. 2. Then, we use the sparse hidden representation h in Eq. 5 as the new sentence representation, which is then fed into a fully connected neural network for classification. The parameters W in Eq. 5 will also be fine tunned during the last step. Different ways of initializing the projection ma- trix in Eq. 5 can be summarized below: • Random Initialization: When there is no an- swer corpus available, we first randomly ini- tialize N vectors to represent the group infor- mation from the answer set. Then we clus- ter these N vectors into G categories with g centroids for each category. These centroids from different categories will be the initial- ized bases for projection matrix W which will be learned during training. • Initialization from Questions: Instead of using random initialized vectors, we can also use question sentences for initializing the projection matrix when the answer set is not available. We need to pre-train the sentences with CNNs to get the sentence representa- tion. We then select G largest categories in terms of number of question sentences. Then we get g centroids from each category by k- means. We concatenate these G × g vectors to form the projection matrix. • Initialization from Answers: This is the most ideal case. We follow the same proce- dure as above, with the only difference being using the answer sentences in place of ques- tion sentences to pre-train the CNNs. 4 Experiments Since there is little effort to use answer sets in question classification, we did not find any suit- Any interesting places to visit in Lisbon………………N filters(PoolingFeed into NNGroup Sparse Auto-EncoderConvolutional LayerWTzhzhW,b(·)W,b(·)W,b(·) Datasets TREC INSURANCE DMV YAHOO Ans 50 319 47 678 No Yes Yes No Ct Cs Ndata Ntest Nans Multi-label 6 - 8 27 - 2176 2859 10365 5952 1580 388 8871 500 303 50 3027 Table 1: Summary of datasets. Ct and Cs are the numbers of top-level and sub- categories, resp. Ndata, Ntest, Nans are the sizes of data set, test set, and answer set, resp. Multilabel means each question can belong to multiple categories. able datasets which are publicly available. We collected two datasets ourselves and also used two other well-known ones. These datasets are summarized in Table 1. INSURANCE is a pri- vate dataset we collected from a car insurance company's website. Each question is classified into 319 classes with corresponding answer data. All questions which belong to the same category share the same answers. The DMV dataset is col- lected from New York State the DMV's FAQ web- site. The YAHOO Ans dataset is only a subset of the original publicly available YAHOO Answers dataset (Fleming et al., 2012; Shah and Pomerantz, 2010). Though not very suitable for our frame- work, we still included the frequently used TREC dataset (factoid question type classification) for comparison. We only compare our model's performance with CNNs for two following reasons: we consider our "group sparsity" as a modification to the general CNNs for grouped feature selection. This idea is orthogonal to any other CNN-based models and can be easily applied to them; in addition, as dis- cussed in Sec. 1, we did not find any other model in comparison with solving question classification tasks with answer sets. There is crucial difference between the INSUR- ANCE and DMV datasets on one hand and the YA- HOO set on the other. In INSURANCE and DMV, all questions in the same (sub)category share the same answers, whereas YAHOO provides individ- ual answers to each question. For multi-label classification (INSURANCE and DMV), we replace the softmax layer in CNNs with a sigmoid layer which predicts each category independently while softmax is not. All experimental results are summarized in Ta- ble 2. The improvements are substantial for IN- SURANCE and DMV, but not as significant for YAHOO and TREC. One reason for this is the CNN† +sparsity‡ WR WQ WA TREC INSUR. DMV 93.6 93.2 93.8 94.2 - 51.2 51.4 53.5 53.8 55.4 60 62 62 64 66 YAHOO dataset sub 20.8 20.2 21.8 22.1 22.2 top 53.9 54.2 54.5 54.1 55.8 unseen 47 46 48 48 53 results. Experimental Table 2: Baselines: †sequential CNNs (α = β = 0 in Eq. 5), ‡CNNs with global sparsity (β = 0). WR: randomly initialized projection matrix. WQ: question- initialized projection matrix. WA: answer set- initialized projection matrix. There are three dif- ferent classification settings for YAHOO: subcate- gory, top-level category, and top-level accuracies on unseen sub-labels. questions in YAHOO/TREC are shorter, which makes the group information harder to encode. Another reason is that each question in YA- HOO/TREC has a single label, and thus can not fully benefit from group sparse properties. Besides the conventional classification tasks, we also test our proposed model on an unseen- label case. In these experiments, there are a few sub-category labels that are not included in the training data. However, we still hope that our model could still return the correct parent cate- gory for these unseen subcategories at test time. In the testing set of YAHOO dataset, we randomly add 100 questions whose subcategory labels are unseen in training set. The classification results of YAHOO-unseen in Table 2 are obtained by map- ping the predicted subcategories back to top-level categories. The improvements are substantial due to the group information encoding. 5 Conclusions In order to better represent question sentences with answer sets and group structure, we first presented a novel GSA framework, a neural version of dic- tionary learning. We then proposed group sparse convolutional neural networks by embedding GSA into CNNs, which result in significantly better question classification over strong baselines. Acknowledgment We thank the anonymous reviewers for their sug- gestions. This work is supported in part by NSF IIS-1656051, DARPA FA8750-13-2-0041 (DEFT), DARPA XAI, a Google Faculty Research Award, and an HP Gift. References Yoshua Bengio, Pascal Lamblin, Dan Popovici, and Hugo Larochelle. 2007. Greedy layer-wise training of deep networks. In Advances in Neural Informa- tion Processing Systems 19. Emmanuel J. Cand`es and Michael B. Wakin. 2008. In IEEE. volume 25. An Introduction To Compressive Sampling. Signal Processing Magazine, http://dx.doi.org/10.1109/msp.2007.914731. R. Collobert, J. Weston, L. Bottou, M. Karlen, K. Kavukcuoglu, and P. Kuksa. 2011. Natural lan- guage processing (almost) from scratch. In Journal of Machine Learning Research. volume 12, pages 2493–2537. Simon Fleming, Dan Chalmers, and Ian Wakeman. 2012. A deniable and efficient question and answer service over ad hoc social networks. In Information Retrieval. 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. Association for Computational Linguistics. Yoon Kim. 2014. Convolutional neural networks for sentence classification. In Proceedings of the 2014 Conference on Empirical Methods in Natural Lan- guage Processing (EMNLP). Association for Com- putational Linguistics, Doha, Qatar, pages 1746– 1751. http://www.aclweb.org/anthology/D14-1181. Y. LeCun, L. Jackel, L. Bottou, A. Brunot, C. Cortes, J. Denker, H. Drucker, I. Guyon, U. Mller, E. Sckinger, P. Simard, and V. Vapnik. 1995. Com- parison of learning algorithms for handwritten digit recognition. In International Conference on Artifi- cial Neural Networks. pages 53–60. Mingbo Ma, Liang Huang, Bing Xiang, and Bowen Zhou. 2015. Dependency-based convolutional neu- ral networks for sentence embedding. In Proceed- ings of ACL 2015. Andrew Ng. 2011. Sparse autoencoder. In CS294A Lecture notes. Stanford University, page 72. R. Rubinstein, A. M. Bruckstein, and M. Elad. 2010. Dictionaries for sparse representation modeling. In Neural Computation. Chirag Shah and Jefferey Pomerantz. 2010. Evaluating and predicting answer quality in community qa. In Proceedings of the 33rd International ACM SIGIR Conference on Research and Development in Infor- mation Retrieval. ACM, New York, NY, USA. Noah Simon, Jerome Friedman, Trevor Hastie, and Rob Tibshirani. 2013. A sparse-group lasso. In Journal of Computational and Graphical Statistics. Ming Yuan and Yi Lin. 2006. Model selection and es- timation in regression with grouped variables. In Journal of the Royal Statistical Society. volume 68, pages 49–67.
1910.11769
1
1910
2019-10-25T14:40:14
DENS: A Dataset for Multi-class Emotion Analysis
[ "cs.CL" ]
We introduce a new dataset for multi-class emotion analysis from long-form narratives in English. The Dataset for Emotions of Narrative Sequences (DENS) was collected from both classic literature available on Project Gutenberg and modern online narratives available on Wattpad, annotated using Amazon Mechanical Turk. A number of statistics and baseline benchmarks are provided for the dataset. Of the tested techniques, we find that the fine-tuning of a pre-trained BERT model achieves the best results, with an average micro-F1 score of 60.4%. Our results show that the dataset provides a novel opportunity in emotion analysis that requires moving beyond existing sentence-level techniques.
cs.CL
cs
DENS: A Dataset for Multi-class Emotion Analysis Chen Liu and Muhammad Osama and Anderson de Andrade Wattpad Toronto, ON, Canada cecilia, muhammad.osama, [email protected] 9 1 0 2 t c O 5 2 ] L C . s c [ 1 v 9 6 7 1 1 . 0 1 9 1 : v i X r a Abstract We introduce a new dataset for multi-class emotion analysis from long-form narratives in English. The Dataset for Emotions of Nar- rative Sequences (DENS) was collected from both classic literature available on Project Gutenberg and modern online narratives avail- able on Wattpad, annotated using Amazon Mechanical Turk. A number of statistics and baseline benchmarks are provided for the dataset. Of the tested techniques, we find that the fine-tuning of a pre-trained BERT model achieves the best results, with an av- erage micro-F1 score of 60.4%. Our results show that the dataset provides a novel opportu- nity in emotion analysis that requires moving beyond existing sentence-level techniques. Introduction 1 Humans experience a variety of complex emotions in daily life. These emotions are heavily reflected in our language, in both spoken and written forms. Many recent advances in natural language pro- cessing on emotions have focused on product re- views (McAuley et al., 2015) and tweets (Mo- hammad et al., 2018; Kant et al., 2018). These datasets are often limited in length (e.g. by the number of words in tweets), purpose (e.g. prod- uct reviews), or emotional spectrum (e.g. binary classification). Character dialogues and narratives in story- telling usually carry strong emotions. A memo- rable story is often one in which the emotional journey of the characters resonates with the reader. Indeed, emotion is one of the most important as- pects of narratives. In order to characterize narra- tive emotions properly, we must move beyond bi- nary constraints (e.g. good or bad, happy or sad). In this paper, we introduce the Dataset for Emo- tions of Narrative Sequences (DENS) for emotion analysis, consisting of passages from long-form fictional narratives from both classic literature and modern stories in English. The data samples con- sist of self-contained passages that span several sentences and a variety of subjects. Each sample is annotated by using one of 9 classes and an indi- cator for annotator agreement. 2 Background the categorical (Plutchik, 1979), basic emotion Using model (Mohammad and Kiritchenko, 2015; Mohammad, 2012) studied creating lexicons from tweets for use in emotion analysis. Recently, (Mohammad et al., 2018), (Klinger et al., 2018) and (Kant et al., 2018) proposed shared-tasks for multi-class emotion analysis based on tweets. Fewer works have been reported on understand- ing emotions in narratives. Emotional Arc (Rea- gan et al., 2016) is one recent advance in this direction. The work used lexicons and unsuper- vised learning methods based on unlabelled pas- sages from titles in Project Gutenberg1. For labelled datasets on narratives, (Alm et al., 2005) provided a sentence-level annotated cor- pus of childrens' stories and (Kim and Klinger, 2018) provided phrase-level annotations on se- lected Project Gutenberg titles. To the best of our knowledge, the dataset in this work is the first to provide multi-class emo- tion labels on passages, selected from both Project Gutenberg and modern narratives. The dataset is available upon request for non-commercial, re- search only purposes2. 3 Dataset In this section, we describe the process used to col- lect and annotate the dataset. 1https://www.gutenberg.org/ 2Please send requests to: academic [email protected] 3.1 Plutchiks Wheel of Emotions The dataset is annotated based on a modified Plutchiks wheel of emotions. The original Plutchiks wheel consists of 8 pri- mary emotions: Joy, Sadness, Anger, Fear, Antici- pation, Surprise, Trust, Disgust. In addition, more complex emotions can be formed by combing two basic emotions. For example, Love is defined as a combination of Joy and Trust (Fig. 1). 3.2 Passage Selection We selected both classic and modern narratives in English for this dataset. The modern narratives were sampled based on popularity from Wattpad. We parsed selected narratives into passages, where a passage is considered to be eligible for annota- tion if it contained between 40 and 200 tokens. In many long-form narratives, non- conversational passages are intended for transition or scene introduction, and may not carry any emotion. We divided the eligible passages into two parts, and one part was pruned using selected emotion-rich but ambiguous lexicons such as cry, punch, kiss, etc.. Then we mixed this pruned part with the unpruned part for annotation in order to reduce the number of neutral passages. See Appendix A.1 for the lexicons used. 3.3 Mechanical Turk (MTurk) MTurk was set up using the standard sentiment template and instructed the crowd annotators to 'pick the best/major emotion embodied in the pas- sage'. to clar- We further provided instructions ify the intensity of an emotion, such as: "Rage/Annoyance is a form of Anger", "Seren- ity/Ecstasy is a form of Joy", and "Love includes Romantic/Family/Friendship", along with sample passages. We required all annotators have a 'master' MTurk qualification. Each passage was labelled by 3 unique annotators. Only passages with a majority agreement between annotators were ac- cepted as valid. This is equivalent to a Fleiss's κ score of greater than 0.4. For passages without majority agreement be- tween annotators, we consolidated their labels us- ing in-house data annotators who are experts in narrative content. A passage is accepted as valid if the in-house annotator's label matched any one of the MTurk annotators' labels. The remaining passages are discarded. We provide the fraction of annotator agreement for each label in the dataset. Though passages may lose some emotional con- text when read independently of the complete nar- rative, we believe annotator agreement on our dataset supports the assertion that small excerpts can still convey coherent emotions. During the annotation process, several anno- tators had suggested for us to include additional emotions such as confused, pain, and jealousy, Figure 1: Plutchik's wheel of emotions (Wikimedia, 2011) The intensity of an emotion is also captured in Plutchik's wheel. For example, the primary emo- tion of Anger can vary between Annoyance (mild) and Rage (intense). We conducted an initial survey based on 100 stories with a significant fraction sampled from the romance genre. We asked readers to identify the major emotion exhibited in each story from a choice of the original 8 primary emotions. We found that readers have significant difficulty in identifying Trust as an emotion associated with romantic stories. Hence, we modified our annota- tion scheme by removing Trust and adding Love. We also added the Neutral category to denote pas- sages that do not exhibit any emotional content. The final annotation categories for the dataset are: Joy, Sadness, Anger, Fear, Anticipation, Sur- prise, Love, Disgust, Neutral. Genre Mystery/Thriller Paranormal Fantasy Horror Romance Action/Adventure Other Distribution (%) 19.7 16.6 13.2 11.3 8.7 5.3 9.3 Table 1: Genre distribution of the modern narratives which are common to narratives. As they were not part of the original Plutchiks wheel, we decided to not include them. An interesting future direction is to study the relationship between emotions such as pain versus sadness or confused versus surprise and improve the emotion model for narratives. 3.4 Dataset Statistics The dataset contains a total of 9710 passages, with an average of 6.24 sentences per passage, 16.16 words per sentence, and an average length of 86 words. The vocabulary size is 28K (when lowercased). It contains over 1600 unique titles across multi- ple categories, including 88 titles (1520 passages) from Project Gutenberg. All of the modern nar- ratives were written after the year 2000, with no- table amount of themes in coming-of-age, strong- female-lead, and LGBTQ+. The genre distribution is listed in Table 1. In the final dataset, 21.0% of the data has con- sensus between all annotators, 73.5% has major- ity agreement, and 5.48% has labels assigned after consultation with in-house annotators. The distribution of data points over labels with top lexicons (lower-cased, normalized) is shown in Table 2. Note that the Disgust category is very small and should be discarded. Furthermore, we suspect that the data labelled as Surprise may be noisier than other categories and should be dis- carded as well. Table 3 shows a few examples labelled data from classic titles. More examples can be found in Table 6 in the Appendix A.2. 4 Benchmarks We performed benchmark experiments on the dataset using several different algorithms. In all experiments, we have discarded the data labelled with Surprise and Disgust. We pre-processed the data by using the SpaCy3 pipeline. We masked out named entities with entity-type specific placeholders to reduce the chance of benchmark models utilizing named en- tities as a basis for classification. Benchmark results are shown in Table 4. The dataset is approximately balanced after discarding the Surprise and Disgust classes. We report the average micro-F1 scores, with 5-fold cross valida- tion for each technique. We provide a brief overview of each bench- mark experiment below. Among all of the benchmarks, Bidirectional Encoder Representa- tions from Transformers (BERT) (Devlin et al., 2018) achieved the best performance with a 0.604 micro-F1 score. Overall, we observed that deep-learning based techniques performed better than lexical based methods. This suggests that a method which at- tends to context and themes could do well on the dataset. 4.1 Bag-of-Words-based Benchmarks We computed bag-of-words-based benchmarks using the following methods: (TF-IDF + SVM) • Classification with TF-IDF + Linear SVM • Classification with Depeche++ Emotion lex- icons (Araque et al., 2018) + Linear SVM (Depeche + SVM) • Classification with NRC Emotion lexicons (Mohammad and Turney, 2010, 2013) + Lin- ear SVM (NRC + SVM) • Combination of TF-IDF and NRC Emotion lexicons (TF-NRC + SVM) 4.2 Doc2Vec + SVM We also used simple classification models with learned embeddings. We trained a Doc2Vec model (Le and Mikolov, 2014) using the dataset and used the embedding document vectors as fea- tures for a linear SVM classifier. 4.3 Hierarchical RNN For this benchmark, we considered a Hierarchical RNN, following (Sordoni et al., 2015). We used two BiLSTMs (Graves et al., 2005) with 256 units each to model sentences and documents. The to- kens of a sentence were processed independently 3https://spacy.io/ Label Neutral Fear Sadness Anger Joy Love Anticipation Surprise Disgust Gutenberg Total Top Lexicons 318 159 195 192 241 162 147 102 4 1711 1412 1402 1306 1266 1157 1020 362 74 take, love, long, really, want, always, though, away, look left, behind, right, want, let, death, go, say, think father, always, little, look, something, us, really, mother, think feel, much, well, man, look, us, say, something, love see, always, let, long, make, hand, away, get, really hand, know, right, let, happy, get, ever, us, look know, long, life, make, get, think, blood, want, feel love, find, looking, know, well, much, something, door, really get, hand, inside, let, hate, table, men, always, make Table 2: Dataset label distribution Text I found this was a little too close upon him, but I made it up in what follows. He stood stock-still for a while and said nothing, and I went on thus: "You cannot," says I, 'without the highest injustice, believe that I yielded upon all these persuasions without a love not to be questioned, not to be shaken again by anything that could happen afterward. If you have such dishonourable thoughts of me, I must ask you what foundation in any of my behaviour have I given for such a suggestion?" She stretched hers eagerly and gratefully towards him. What had happened? Through all the numbness of her blood, there sprang a strange new warmth from his strong palm, and a pulse, which she had almost forgotten as a dream of the past, began to beat through her frame. She turned around all a-tremble, and saw his face in the glow of the coming day. Ah! That moving procession that has left me by the road-side! Its fantastic colors are more brilliant and beautiful than the sun on the undulating waters. What matter if souls and bodies are failing beneath the feet of the ever-pressing multitude! It moves with the majestic rhythm of the spheres. Its discordant clashes sweep upward in one harmonious tone that blends with the music of other worlds -- to complete God's orchestra. Table 3: Sample data from classic titles Label Angry Anticipation Joy Model TF-IDF + SVM Depeche + SVM NRC + SVM TF-NRC + SVM Doc2Vec + SVM HRNN BiRNN + Self-Attention ELMo + BiRNN Fine-tuned BERT micro-F1 0.450 0.254 0.286 0.458 0.403 0.469 0.487 0.516 0.604 Table 4: Benchmark results (averaged 5-fold cross val- idation) of other sentence tokens. For each direction in the token-level BiLSTM, the last outputs were con- catenated and fed into the sentence-level BiLSTM as inputs. The outputs of the BiLSTM were connected to 2 dense layers with 256 ReLU units and a Softmax layer. We initialized tokens with publicly avail- able embeddings trained with GloVe (Pennington et al., 2014). Sentence boundaries were provided by SpaCy. Dropout was applied to the dense hid- den layers during training. 4.4 Bi-directional RNN and Self-Attention (BiRNN + Self-Attention) One challenge with RNN-based solutions for text classification is finding the best way to combine word-level representations into higher-level repre- sentations. Self-attention (Yang et al., 2016; Lin et al., 2017; Sinha et al., 2018) has been adapted to text classification, providing improved interpretability and performance. We used (Lin et al., 2017) as the basis of this benchmark. The benchmark used a layered Bi-directional RNN (60 units) with GRU cells and a dense layer. Both self-attention layers were 60 units in size and cross-entropy was used as the cost function. Note that we have omitted the orthogonal reg- ularizer term, since this dataset is relatively small compared to the traditional datasets used for train- ing such a model. We did not observe any signifi- cant performance gain while using the regularizer term in our experiments. 4.5 ELMo embedding and Bi-directional RNN (ELMo + BiRNN) Deep Contextualized Word Representations (ELMo) (Peters et al., 2018) have shown recent success in a number of NLP tasks. The unsuper- vised nature of the language model allows it to utilize a large amount of available unlabelled data in order to learn better representations of words. We used the pre-trained ELMo model (v2) available on Tensorhub4 for this benchmark. We fed the word embeddings of ELMo as input into a one layer Bi-directional RNN (16 units) with GRU cells (with dropout) and a dense layer. Cross- entropy was used as the cost function. 4.6 Fine-tuned BERT from Bidirectional Encoder Representations Transformers (BERT) (Devlin et al., 2018) has achieved state-of-the-art results on several NLP tasks, including sentence classification. We used the fine-tuning procedure outlined in the original work to adapt the pre-trained uncased 5 to a multi-class passage classifica- BERTLARGE tion task. This technique achieved the best result among our benchmarks, with an average micro-F1 score of 60.4%. 5 Conclusion We introduce DENS, a dataset for multi-class emotion analysis from long-form narratives in En- glish. We provide a number of benchmark results based on models ranging from bag-of-word mod- els to methods based on pre-trained language mod- els (ELMo and BERT). 4https://tfhub.dev/google/elmo/2 5https://tfhub.dev/google/bert_ uncased_L-24_H-1024_A-16/1 Our benchmark results demonstrate that this dataset provides a novel challenge in emotion analysis. The results also demonstrate that attention-based models could significantly im- prove performance on classification tasks such as emotion analysis. Interesting future directions for this work in- clude: 1. incorporating common-sense knowledge into emotion analysis to capture semantic context and 2. using few-shot learning to bootstrap and improve performance of underrepresented emo- tions. Finally, as narrative passages often involve in- teractions between multiple emotions, one avenue for future datasets could be to focus on the multi- emotion complexities of human language and their contextual interactions. References Cecilia Alm, Dan Roth, and Richard Sproat. 2005. Emotions from text: Machine learning for text-based emotion prediction. Oscar Araque, Lorenzo Gatti, Jacopo Staiano, and Marco Guerini. 2018. Depechemood++: a bilingual emotion lexicon built through simple yet powerful techniques. 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. Alex Graves, Santiago Fern´andez, and Jurgen Schmid- huber. 2005. Bidirectional lstm networks for im- proved phoneme classification and recognition. In International Conference on Artificial Neural Net- works, pages 799 -- 804. Springer. Neel Kant, Raul Puri, Nikolai Yakovenko, and Bryan Catanzaro. 2018. Practical text classification with large pre-trained language models. arXiv preprint arXiv:1812.01207. Evgeny Kim and Roman Klinger. 2018. Who feels what and why? annotation of a literature corpus with semantic roles of emotions. In Proceedings of the 27th International Conference on Computational Linguistics, pages 1345 -- 1359. Association for Com- putational Linguistics. Roman Klinger, Orphee De Clercq, Saif Mohammad, Iest: Wassa-2018 and Alexandra Balahur. 2018. In Proceedings of implicit emotions shared task. the 9th Workshop on Computational Approaches to Subjectivity, Sentiment and Social Media Analysis, pages 31 -- 42, Brussels, Belgium. Association for Computational Linguistics. Andrew J. Reagan, Lewis Mitchell, Dilan Kiley, Christopher M. Danforth, and Peter Sheridan Dodds. 2016. The emotional arcs of stories are dominated by six basic shapes. EPJ Data Science, 5:31. Koustuv Sinha, Yue Dong, Jackie Chi Kit Cheung, and Derek Ruths. 2018. A hierarchical neural attention- In Proceedings of the 2018 based text classifier. Conference on Empirical Methods in Natural Lan- guage Processing, pages 817 -- 823. Association for Computational Linguistics. Alessandro Sordoni, Yoshua Bengio, Hossein Vahabi, Christina Lioma, Jakob Grue Simonsen, and Jian- Yun Nie. 2015. A hierarchical recurrent encoder- decoder for generative context-aware query sugges- tion. In Proceedings of the 24th ACM International on Conference on Information and Knowledge Man- agement, pages 553 -- 562. ACM. Wikimedia. 2011. Robert plutchik's wheel of emo- tions. File: Plutchik-wheel.svg. Zichao Yang, Diyi Yang, Chris Dyer, Xiaodong He, Alex Smola, and Eduard Hovy. 2016. Hierarchi- cal attention networks for document classification. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Compu- tational Linguistics: Human Language Technolo- gies, pages 1480 -- 1489. Association for Computa- tional Linguistics. Quoc V. Le and Tomas Mikolov. 2014. Distributed representations of sentences and documents. CoRR, abs/1405.4053. Zhouhan Lin, Minwei Feng, Cicero Nogueira dos San- tos, Mo Yu, Bing Xiang, Bowen Zhou, and Yoshua Bengio. 2017. A structured self-attentive sentence embedding. Julian McAuley, Rahul Pandey, and Jure Leskovec. 2015. Inferring networks of substitutable and com- In Proceedings of the 21th plementary products. ACM SIGKDD international conference on knowl- edge discovery and data mining, pages 785 -- 794. ACM. Saif M. Mohammad. 2012. #emotional tweets. In *SEM 2012: The First Joint Conference on Lexical and Computational Semantics -- Volume 1: Proceed- ings of the main conference and the shared task, and Volume 2: Proceedings of the Sixth International Workshop on Semantic Evaluation (SemEval 2012), pages 246 -- 255, Montr´eal, Canada. Association for Computational Linguistics. Saif M. Mohammad, Felipe Bravo-Marquez, Mo- hammad Salameh, and Svetlana Kiritchenko. 2018. In Pro- Semeval-2018 task 1: Affect in tweets. ceedings of the International Workshop on Semantic Evaluation (SemEval-2018). Association for Com- putational Linguistics. Saif M. Mohammad and Svetlana Kiritchenko. 2015. Using hashtags to capture fine emotion cate- gories from tweets. Computational Intelligence, 31(2):301 -- 326. Saif M. Mohammad and Peter D. Turney. 2010. Emo- tions evoked by common words and phrases: Us- ing mechanical turk to create an emotion lexicon. In Proceedings of the NAACL HLT 2010 Workshop on Computational Approaches to Analysis and Gener- ation of Emotion in Text, CAAGET '10, pages 26 -- 34, Stroudsburg, PA, USA. Association for Compu- tational Linguistics. Saif M. Mohammad and Peter D. Turney. 2013. Crowdsourcing a word-emotion association lexicon. 29(3):436 -- 465. 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. Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. 2018. Deep contextualized word rep- resentations. In Proc. of NAACL. Robert Plutchik. 1979. Emotions: A general psy- Psycology choevolutionary theory, volume 1. Press,Taylor and Francis Group. A Appendices A.1 Lexicons cry flower chuckle kiss shiver knife punch blood exclaim moon wind tear yell punch touch warm dead chill Table 5: Lexicons used to prune part of the data for labelling A.2 Sample Data Table 6 shows sample passages from classic titles with corresponding labels. Text He took his screwdriver and again took off the lid of the coffin. Arthur looked on, very pale but silent. When the lid was removed he stepped forward. He evidently did not know that there was a leaden coffin, or at any rate, had not thought of it. When he saw the rent in the lead, the blood rushed to his face for an instant, but as quickly fell away again, so that he remained of a ghastly whiteness. He was still silent. Van Helsing forced back the leaden flange, and we all looked in and recoiled. The chair went to matchwood at the bottom, and we rolled apart into the gut- ter. He sprang to his feet, waving his fists and wheezing like an asthmatic. "Had enough?" he panted. "You infernal bully!" I cried, as I gathered myself together. The judges sat grave and mute, gave me an easy hearing, and time to say all that I would, but, saying neither Yes nor No to it, pronounced the sentence of death upon me, a sentence that was to me like death itself, which, after it was read, confounded me. I had no more spirit left in me, I had no tongue to speak, or eyes to look up either to God or man. The Prince burst into a yelling, shrieking fit of laughter. Instantly the yellow- haired serfs in waiting, the Calmucks at the hall-door, and the half-witted dwarf who crawled around the table in his tow shirt, began laughing in cho- rus, as violently as they could. The Princess Martha and Prince Boris laughed also; and while the old man's eyes were dimmed with streaming tears of mirth, quickly exchanged nods. The sound extended all over the castle, and was heard outside of the walls. "Do not be such an unreasonable child", he remonstrated, feebly. "I do not love you with the wild, irrational passion of former years; but I have the ten- derest regard for you, and my heart warms at the sight of your sweet face, and I shall do all in my power to make you as happy as any man can make you who -- " I looked around for his birds, and not seeing them, asked him where they were. He replied, without turning round, that they had all flown away. There were a few feathers about the room and on his pillow a drop of blood. I said nothing, but went and told the keeper to report to me if there were anything odd about him during the day. Table 6: Sample data from classic titles Label Fear Anger Sadness Joy Love Neutral
1703.09527
1
1703
2017-03-28T12:08:46
Is This a Joke? Detecting Humor in Spanish Tweets
[ "cs.CL", "cs.AI" ]
While humor has been historically studied from a psychological, cognitive and linguistic standpoint, its study from a computational perspective is an area yet to be explored in Computational Linguistics. There exist some previous works, but a characterization of humor that allows its automatic recognition and generation is far from being specified. In this work we build a crowdsourced corpus of labeled tweets, annotated according to its humor value, letting the annotators subjectively decide which are humorous. A humor classifier for Spanish tweets is assembled based on supervised learning, reaching a precision of 84% and a recall of 69%.
cs.CL
cs
Is This a Joke? Detecting Humor in Spanish Tweets Santiago Castro, Matías Cubero, Diego Garat, and Guillermo Moncecchi Universidad de la República, Montevideo, Uruguay {sacastro, mcubero, dgarat, gmonce}@fing.edu.uy 7 1 0 2 r a M 8 2 ] L C . s c [ 1 v 7 2 5 9 0 . 3 0 7 1 : v i X r a Abstract. While humor has been historically studied from a psychologi- cal, cognitive and linguistic standpoint, its study from a computational perspective is an area yet to be explored in Computational Linguistics. There exist some previous works, but a characterization of humor that allows its automatic recognition and generation is far from being specified. In this work we build a crowdsourced corpus of labeled tweets, annotated according to its humor value, letting the annotators subjectively decide which are humorous. A humor classifier for Spanish tweets is assembled based on supervised learning, reaching a precision of (cid:8)(cid:4)% and a recall of (cid:6)(cid:9)%. Keywords: Humor · Computational Humor · Humor Recognition · Machine Learning · Natural Language Processing (cid:1) Introduction The human being as a species is characterized by laughter. Humor, which is a potential cause of laughter, is an essential component of human communication. Not only does it allow people to feel comfortable, but also produces a cozier environment. While humor has been studied from a psychological, cognitive [(cid:8)] and even linguistic [(cid:1)(cid:6)] standpoint, its study from a computational viewpoint is still an area to be explored within Computational Linguistics. There exist some previous works [(cid:1)(cid:4)]; however, a humor characterization that allows its automatic recognition and generation is far from being specified, particularly for the Spanish language. Identifying humor in a text can be seen as an intermediate step for the resolution of more complex tasks. It would be interesting to generate jokes, or humor in general, based on the knowledge of which attributes enrich texts in a better way. Another appealing use case is to exploit the outcome of a humor detector to decide automatically if a text span can be taken seriously or not. On the other hand, by way of a more direct use, humor identification can be used to find jokes on Twitter, to search for potentially funny tweets about certain trending topic or to search for humorous answers to comments on the social network. We address herein the problem of detecting humor in Spanish tweets. It should be noted that this is different from trying to recognize humor in arbitrary texts, due to tweets' length. Here it could be assumed that tweets are either humorous or not, but not both, because they are brief (up to (cid:1)(cid:4)(cid:0) characters). This is not always the case in others texts, as jokes could only exist in some parts but not on the whole text. Another advantage considered is that there are plenty of tweets available to analyze. Since there is no clear definition of what humor is, how can we detect something that is in principle vaguely stated? We explore different ideas, and we finally decide to let people define it themselves by voting tweets from a web page and an Android app, in which they can label a tweet as humorous or not humorous. Once we have defined which tweets are humorous, we tackle the problem of humor detection using a supervised learning approach. In other words, we infer a function that identifies humor from labeled data. We use several techniques such as Support Vector Machine, Nearest Neighbors, Decision Trees and Naive Bayes. In order to build a set of features, we first study the state of the art of the Computational Humor area, focused on recognition and in Spanish. In Sect. (cid:2) we present the humor detection problem and its state of the art, including features studied in previous works. In Subsect. (cid:3).(cid:1) we show the corpus built for this purpose and in Subsect. (cid:3).(cid:2) we describe the classifier used. Afterwards, we present an experimental evaluation in Sect. (cid:4) and finally the conclusions in Sect. (cid:5). (cid:2) Computational Humor Computational Humor is a recent field of study about recognizing and generating humor through automatic processing. The task of language understanding is rather hard, and so are tasks related to humor. Furthermore, humor entails the usage of figurative language, which obviously makes language handling harder. Humor by itself is not a clearly determined concept. According to Real Academia Española(cid:1), humor is defined as a way of presenting reality, highlighting the comic or ridiculous side. As for comedy, it is a kind of drama meant to cause laughter. However, what causes laughter? There are several theories which try to answer this question, and consequently attempt to find what humor is. A report on the state of the art about Humor and Computational Humor [(cid:1)(cid:4)] enumerates some of them. The main ideas of these theories are described hereinafter. Readers will notice that these ideas are similar, in spite of putting the focus on different attributes. Gruner [(cid:6)] develops a theory which claims that humor is related to superiority feelings, asserting that there is always a winner in every joke. Freud and Strachey [(cid:4)] and Minsky [(cid:1)(cid:3)] state that humor is about relieving repressed feelings. In this case, laughter relieves the stress caused by taboo topics, such as death, marriage or sex. The Theory of the Incongruity Resolution [(cid:2)(cid:1)] claims that two objects (cid:1) http://dle.rae.es/ are presented under the same concept, with details applying to both and with similarities, but as narration progresses it turns out that only one is possible. Furthermore, we have The Semantic Script Theory of Humor and The General Theory of Verbal Humor [(cid:1)], [(cid:2)(cid:0)]. They state that humor is about two scripts which come into conflict with each other, where there are two opposed subjects contrasted, such as big vs small, death vs life, normal vs abnormal, among others. Let us introduce an example(cid:2): - A ver, tocate la espalda con la rodilla, mente positivista. - Nada es imposible. - Seriously? Touch your back with your knee, you positivist mind. - Nothing is impossible. Following the Superiority Theory, the reader is the winner when he laughs at the positive person, feeling superior as the latter lose the dispute. According to the Relief Theory, we laugh with the purpose of releasing tension, which in this case can be provoked by talking about the limits of life, such as when saying "nothing is impossible". The Theory of the Incongruity Resolution also applies here due to the fact that there is ambiguity; with "nothing is impossible" the example implies that all your dreams may come true, but the person is answered as if the statement was literal. (cid:2).(cid:1) Humor Detection The concrete goal of this research is to classify tweets written in Spanish as hu- morous or not humorous. In order to accomplish this, jokes need to be completely expressed within the text, and no further information must be required (apart from contextual information). Since Twitter allows only brief publications - no more than (cid:1)(cid:4)(cid:0) characters - we freely assume the text to be a unit: either the whole tweet is humorous, or it is not. (cid:2).(cid:2) State of the Art We did not find any attempt to automatically recognize humor for Spanish. Notwithstanding, Mihalcea and Strapparava [(cid:1)(cid:2)] and Mulder and Nijholt [(cid:1)(cid:4)] built humor detectors for English making use of one-liners, i. e., texts of approximately fifteen words. Supervised learning was used to produce an outcome - humorous or not humorous content - based on features which might reflect certain properties that humor should satisfy. Furthermore, Reyes, Buscaldi, and Rosso [(cid:1)(cid:8)] and Reyes et al. [(cid:1)(cid:9)] have gathered and studied features specific to humor, without having the objective of creating a recognizer. A concise compilation of the features presented in these works is shown below: (cid:2) Taken from https://twitter.com/chistetipico/status/(cid:4)(cid:3)(cid:0)(cid:5)(cid:4)(cid:9)(cid:0)(cid:0)(cid:9)(cid:8)(cid:1)(cid:2)(cid:2)(cid:9)(cid:1)(cid:5)(cid:8)(cid:4). It has been slightly adapted to maintain an appropriate language. Adult Slang: According to Mihalcea and Strapparava [(cid:1)(cid:2)], adult slang is popular in jokes. Let us remember that the Relief Theory states that laughter releases stress caused by taboo subjects, and adult slang could be one. WordNet Domains [(cid:2)(cid:3)] can be used to search for words tagged with the domain "Sexuality" in potentially humorous texts. Alliteration: This is about the repetition of phonemes in a text. It is a general- ization of the rhyme. As stated in [(cid:1)(cid:2)], structural and phonetic properties of jokes are at least as important as their content. Ambiguity: It may be explained by the Incongruity Resolution Theory that ambiguity plays an important role, as it gives more than one interpretation to texts. Sjöbergh and Araki [(cid:2)(cid:2)], Basili and Zanzotto [(cid:2)], and Reyes, Buscaldi, and Rosso [(cid:1)(cid:8)] mention different ways to measure it, such as counting the number of meanings of the words that appear or counting the number of possible syntax trees. Antonymy: Following the Semantic Script Theory of Humor, we could look for opposed terms in texts, and that is how this feature is supported. The idea is to take into account pairs of antonym words mentioned in texts. Wordnet [(cid:3)] is useful since it is a lexical database which contains antonyms for English words, among other relations. Keywords: There are certain words that are more used in humorous contexts than in normal situations [(cid:2)(cid:2)]. An example of these are words related to animal contexts, lawyers, etc. Language model perplexity: In Reyes, Buscaldi, and Rosso [(cid:1)(cid:8)] a language model is built from narrative texts, and perplexity(cid:3) is used as a feature. Humorous texts have a higher perplexity than those which are not humorous. Negativity: There is a certain kind of humor which tends to have negative connotations [(cid:9)] [(cid:1)(cid:9)]. It can be about denying, such as when saying "no", "don't" or "never", when talking about subjects with negative polarity such as "bad", "illegal" or "wrong" or when it is related to words referring to stressful subjects, such as "alcohol" or "lie". People-centered words: Humorous texts are constantly referring to scenarios related to people, with dialogues and references such as "you", "I", "woman" and "my". This is supported by Mihalcea and Pulman [(cid:9)] and Mihalcea and Strapparava [(cid:1)(cid:1)]. Mihalcea and Strapparava [(cid:1)(cid:2)] used the features Adult Slang, Alliteration and Antonymy, while Sjöbergh and Araki [(cid:2)(cid:2)] focused on Alliteration, Ambiguity, Keywords and People-centered words. Both studies collected humorous one- liners from the Internet. Sjöbergh and Araki [(cid:2)(cid:2)] employed only the British National Corpus (BNC) as negative samples whereas Mihalcea and Strapparava [(cid:1)(cid:2)] additionally used proverbs and news headlines from Reuters. In both works (cid:3) Perplexity is a measurement of how well a probability model predicts a sample. Low perplexity indicates the probability model is good at predicting the sample. It is defined as 2− 1 log2 p(xi), where x1, . . . , xn are the sample data and p(xi) is the probability assigned to each one. i=1 Pn n they tried with Naïve Bayes and Support Vector Machine classifiers, resulting in no significant difference between these techniques. On one hand, Mihalcea and Strapparava [(cid:1)(cid:2)] achieved their best accuracy with headlines: (cid:9)(cid:6).(cid:8)(cid:5)%, while they reached (cid:8)(cid:4).(cid:8)(cid:2)% with proverbs and (cid:7)(cid:9).(cid:1)(cid:5)% with the BNC. Alliteration proved to be the most accurate feature. On the other hand, Sjöbergh and Araki [(cid:2)(cid:2)] achieved an accuracy of (cid:8)(cid:5).(cid:4)(cid:0)%, with Keywords being the most useful. Table (cid:1) summarizes the main differences and compares both studies. Table (cid:1). Comparison of the approach of both works. The results are not directly comparable as they use different corpora. Negative samples Accuracy Features Mihalcea and Strapparava [(cid:1)(cid:2)] Sjöbergh and Araki [(cid:2)(cid:2)] BNC sentences, news headlines and proverbs (cid:9)(cid:6).(cid:9)(cid:5)% with headlines, (cid:7)(cid:9).(cid:1)(cid:5)% with the BNC and (cid:8)(cid:4).(cid:8)(cid:2)% with the proverbs Other sentences from BNC (cid:8)(cid:5).(cid:4)(cid:0)% Adult Slang, Alliter- ation and Antonymy Alliteration, Ambiguity, Keywords and People-centered words (cid:3) Proposal (cid:3).(cid:1) Corpus Our first goal is to build a corpus with samples of humorous and non-humorous tweets. Based on Mihalcea and Strapparava [(cid:1)(cid:2)], we choose to use non-humorous sample tweets that fall into the following topics: news, reflections and curious facts. For humorous samples, we extracted tweets from accounts which appeared after having searched for the keyword "chistes" ("jokes" in Spanish). In total, (cid:1)(cid:6),(cid:4)(cid:8)(cid:8) tweets were extracted from humorous accounts and (cid:2)(cid:2),(cid:8)(cid:7)(cid:5) from non- humorous. The two groups are composed of (cid:9) Twitter accounts each, with the non-humorous containing (cid:3) of each topic. The amount of tweets in each topic is similar. We tagged all tweets from news, reflections and curious facts as non-humorous, as random sampling showed that there was no humor in them. Conversely, not all tweets that were extracted from a humorous account were in fact humorous. Many of them were used to increase their number of followers, to express their opinion about a fact or to support a cause through retweets. A crowdsourced web(cid:4) and a mobile(cid:5) annotation was carried out in order to tag all tweets from humorous accounts. In order to obtain as many annotations (cid:4) http://clasificahumor.com (cid:5) https://play.google.com/store/apps/details?id=com.clasificahumor.android as possible, we wanted to keep it simple. Therefore, we showed random tweets to annotators (avoiding duplicates), providing no instructions, and let them implicitly define what humor is. In addition, the user interface was simple, as shown in Fig. (cid:1). The users could either provide a ranking of humor between one and five, express that the tweet was not humorous or skip it. Fig. (cid:1). Page used to annotate tweets, with an example tweet on screen. In total, (cid:3)(cid:3),(cid:5)(cid:3)(cid:1) annotations were achieved, after filtering some of them that occurred in a short time lapse in the same session and with the same tag. About half of the labels were non-humorous, while the other half was divided approximately between the five rankings. A histogram of the annotations is shown in Fig. (cid:2). Regarding the agreement among annotators, the Fleiss' Kappa measurement for tweets with (cid:2) annotations(cid:6) is (cid:0).(cid:4)(cid:1)(cid:6) and for those with (cid:6) annotations it is (cid:0).(cid:3)(cid:2)(cid:5). Based on this analysis, we have to decide which tweets are considered hu- morous. Let us define the tweets considered humorous as positives and the ones considered as non-humorous as negatives. The decision consisted in marking as positives those tweets whose ratio of humorous annotations is greater than or equal to (cid:0).(cid:6) and as negatives those lower than or equal to (cid:0).(cid:3). The rest are considered as doubtful. The criterion of giving a (cid:0).(cid:1) handicap to the positives was thereby performed, as they are obtained from humorous accounts. This may be seen as if the source is giving its opinion too. Additionally, those tweets (cid:6) Note that Kappa assumes a fixed number of annotators. For this reason, we measure it with (cid:2) and (cid:6), in order to give an idea of the agreement having a value with many tweets but few annotators, and other value with few tweets but many annotators. Fig. (cid:2). Histogram of annotations. Note that most tweets have few annotations. with no annotations fall into the category of doubtful. Figure (cid:3)a illustrates the proportions of each category. To sum up, (cid:5),(cid:9)(cid:5)(cid:2) tweets are considered positive. The rest of the tweets obtained from humorous accounts are not taken into account, even though the negatives can also be used. The corpus composition is shown in Fig. (cid:3)b. (cid:3).(cid:2) Classifier Firstly, we split data into (cid:8)(cid:0)% for training and (cid:2)(cid:0)% for later evaluation. Similarly to the works mentioned in this document, we built a humor classifier but for the Spanish language. Such works used Support Vector Machine (SVM) and a Multinomial version of Naïve Bayes (MNB). However, more machine learning techniques are tried here: Decision Trees (DT), k Nearest Neighbors (kNN) and a Gaussian version of Naïve Bayes (GNB). Tweets are tokenized using Freeling [(cid:1)(cid:5)]. Also, a higher quantity of features was implemented, which is described below.(cid:7) Adult slang: Here we count the relative number of tokens in the tweets which appeared in a previously built dictionary about adult slang. This dictionary contains (cid:1)(cid:3)(cid:2) words, and it was built using bootstrapping, in a similar manner to Mihalcea and Strapparava [(cid:1)(cid:0)], with a seed of (cid:2)(cid:1) words. Dictionary-lookup features are computed with this formula (where the multiset intersection is used): (cid:7) The codebase for the classifier and the corpus built can be found in https://github. com/pln-fing-udelar/pghumor. (a) Graph showing the percentage of tweets from humorous accounts in each category. (b) Pie displaying the ratio between positives and negatives in the corpus, after the decision was made. Fig. (cid:3) f eatureV alue(tweet) = tweet ∩ dictionary ptweet Animal presence: In this case we compare against a handcrafted dictionary about animals. This dictionary contains (cid:1)(cid:0)(cid:3) names, including typical typo- graphic misspellings and grammatical mistakes. Antonyms: Given a tweet, this feature counts the relative number of pairs of antonyms existing in it. WordNet [(cid:3)] antonymy relationship and Spanish language enrichment provided by the Multilingual Central Repository [(cid:5)] are used for this. This feature was discarded since after performing Recursive Feature Elimination [(cid:7)] (RFE) we found out the classification worsened. Dialog: This feature only establishes if a tweet is a dialog. Exclamations: The relative number of exclamation marks are counted. First and Second person: These two features try to capture verbs conjugated in the first and second persons and nouns and adjectives which agree with such conjugations (in Spanish, nouns and adjectives express gender and number at the end of the word). Hashtags: The amount of hashtags in the tweet is counted. It is suspected that the higher this amount is, the more informal the tweet is. Thus, it is more likely to be humorous. Keywords: An intuitively handmade dictionary of (cid:4)(cid:3) common words found in jokes was built for this, and it was used for checking purposes. Links: This feature counts the number of links contained in a tweet. Negation: Here we count the relative quantity of times the word "no" appears in the tweet. It was removed after running RFE. Non-Spanish words: The relative number of words containing non-Spanish words is counted. It was discarded after running RFE. Out of vocabulary: The idea behind this is to keep record of the relative count of words not found in dictionaries. These are four features based on the combination of the dictionaries used: Freeling, Freeling-Google (cid:8), Freeling-Wiktionary (cid:9) and Wiktionary. Questions-answers: One interesting attribute for tweets is to count how many questions and answers are present, one after another. Topic distance: The idea is to check if a tweet is somewhat near to a joke category in Chistes.com, or whether it is closer to a Wikipedia's sentence, from Wikicorpus [(cid:1)(cid:7)]. This is carried out using a Multinomial Naïve Bayes classifier together with the Bag of Words technique. Uppercase words: The relative amount of words completely in uppercase is counted. (cid:8) https://www.google.com (cid:9) https://www.wiktionary.org (cid:4) Experimental Evaluation Provided that our work is the only one using this corpus, and even the only one with the goal of classifying humor in Spanish, we cannot directly compare it with any other work. Hence, we developed two baselines to compare it with, aiming them to be simple ideas which could be crafted to face this task. The first one (BL(cid:1)) is a Multinomial Naïve Bayes classifier combined with Bag of Words similarly to the Topic Distance feature. The second one (BL(cid:2)) is a classifier which predicts all tweets with the most likely outcome, non-humorous, having a frequency of almost (cid:8)(cid:3)%. A comparison using mainly the F1 score is intended. We want to pay attention to the positives (the humorous) but also granting the same degree of importance to false positives and false negatives. Nonetheless, we take advantage of the runs in order to also pay attention to other measurements. The results are shown in Table (cid:2). Table (cid:2). Results obtained with the different techniques over the test set. NPV, TNR and Neg. F(cid:1) refer to Precision, Recall and F1 score, respectively, when reversing the roles positive-negative. (cid:0).(cid:6)(cid:1)(cid:7) (cid:0).(cid:8)(cid:4)(cid:6) (cid:0).(cid:7)(cid:1)(cid:4) (cid:0).(cid:9)(cid:6)(cid:6) (cid:0).(cid:8)(cid:9)(cid:2) N/A (cid:0).(cid:0)(cid:0)(cid:0) N/A (cid:0).(cid:8)(cid:3)(cid:0) (cid:1).(cid:0)(cid:0)(cid:0) (cid:0).(cid:7)(cid:1)(cid:4) BL(cid:1) BL(cid:2) (cid:0).(cid:9)(cid:0)(cid:7) SVM (cid:0).(cid:8)(cid:3)(cid:6) (cid:0).(cid:6)(cid:8)(cid:9) (cid:0).(cid:7)(cid:5)(cid:5) (cid:0).(cid:9)(cid:3)(cid:8) (cid:0).(cid:9)(cid:7)(cid:2) (cid:0).(cid:9)(cid:5)(cid:5) DT (cid:0).(cid:9)(cid:3)(cid:2) GNB (cid:0).(cid:9)(cid:1)(cid:5) MNB (cid:0).(cid:8)(cid:4)(cid:8) (cid:0).(cid:6)(cid:0)(cid:0) (cid:0).(cid:7)(cid:0)(cid:3) (cid:0).(cid:9)(cid:2)(cid:3) (cid:0).(cid:9)(cid:7)(cid:8) (cid:0).(cid:9)(cid:5)(cid:0) kNN (cid:0).(cid:9)(cid:5)(cid:1) NPV TNR Neg. F1 Accuracy (cid:0).(cid:8)(cid:8)(cid:5) (cid:0).(cid:8)(cid:3)(cid:0) (cid:0).(cid:9)(cid:2)(cid:5) (cid:0).(cid:8)(cid:8)(cid:9) (cid:0).(cid:8)(cid:6)(cid:5) (cid:0).(cid:9)(cid:1)(cid:4) (cid:0).(cid:9)(cid:1)(cid:7) Precision Recall F1 (cid:0).(cid:6)(cid:6)(cid:5) (cid:0).(cid:6)(cid:7)(cid:5) (cid:0).(cid:6)(cid:7)(cid:0) (cid:0).(cid:9)(cid:3)(cid:3) (cid:0).(cid:9)(cid:3)(cid:0) (cid:0).(cid:5)(cid:7)(cid:5) (cid:0).(cid:7)(cid:8)(cid:2) (cid:0).(cid:6)(cid:6)(cid:3) (cid:0).(cid:9)(cid:5)(cid:2) (cid:0).(cid:8)(cid:8)(cid:2) (cid:0).(cid:8)(cid:1)(cid:3) (cid:0).(cid:6)(cid:6)(cid:3) (cid:0).(cid:7)(cid:3)(cid:0) (cid:0).(cid:9)(cid:3)(cid:4) (cid:0).(cid:9)(cid:6)(cid:9) The best results are obtained with SVM, even in terms of accuracy. Also, kNN shows satisfactory output. These two approaches outperform the baselines, with the former clearly surpassing the latter. Meanwhile, GNB and DT have poor precision, although GNB certainly does a better job among these two and has the best recall. The confusion matrix for SVM is shown in Table (cid:3). Table (cid:3). Confusion matrix for SVM classifier with respect to the test set Positive Negative (cid:3)(cid:8)(cid:1) (cid:5)(cid:8)(cid:0)(cid:5) (cid:8)(cid:4)(cid:2) (cid:1)(cid:6)(cid:5) Positive Negative (cid:5) Conclusions A crowdsourced corpus has been assembled, which serves the purpose of this work and could be useful for future research. It contains over (cid:3)(cid:0),(cid:0)(cid:0)(cid:0) annotations for (cid:1)(cid:6),(cid:4)(cid:8)(cid:8) tweets, coming from humorous accounts, and it also counts with (cid:2)(cid:2),(cid:8)(cid:7)(cid:5) sourced from non-humorous accounts. Uses of such corpus include analyzing its data, as well as performing tasks similar to the work described herein. We have built a classifier which outperforms the baselines outlined. Support Vector Machine proved to be the best technique. It has a precision of (cid:8)(cid:3).(cid:6)%, a recall of (cid:6)(cid:8).(cid:9)%, a F1 score of (cid:7)(cid:5).(cid:5)% and an accuracy of (cid:9)(cid:2).(cid:5)%. Nevertheless, it must be highlighted that the corpus built does not depict a great variety of humor. Hence, some features perform well in this work but might not perform so well in another context. As a future work, more complex features could be crafted, such as trying to detect wordplay and puns, ambiguity, perplexity against some language model, inter alia. Other Machine Learning techniques could also be tried. It would be interesting if we take advantage of the star ranking people provided; maybe this can also suggest how funny a joke is. As a harder task, humor generation could be tackled. Finally, it could be studied how the influence of humor varies between different social contexts, depending on gender, age, interest areas, mood, etc. References (cid:1). Attardo, S., and Raskin, V.: Script theory revis(it)ed: Joke similarity and joke representation model. Humor: International Journal of Humor Research ((cid:1)(cid:9)(cid:9)(cid:1)) (cid:2). Basili, R., and Zanzotto, F.M.: Parsing Engineering and Empirical Robustness. Natural Language Engineering (cid:8)((cid:3)), (cid:9)(cid:7)–(cid:1)(cid:2)(cid:0) ((cid:2)(cid:0)(cid:0)(cid:2)) (cid:3). Fellbaum, C. (ed.) MIT Press, Cambridge, MA ((cid:1)(cid:9)(cid:9)(cid:8)) (cid:4). Freud, S., and Strachey, J.: Jokes and Their Relation to the Unconscious ((cid:1)(cid:9)(cid:0)(cid:5)) (cid:5). Gonzalez-Agirre, A., Laparra, E., and Rigau, G.: Multilingual Central Repository version (cid:3).(cid:0): upgrading a very large lexical knowledge base. In: Proceedings of the (cid:6)th Global WordNet Conference (GWC (cid:2)(cid:0)(cid:1)(cid:2)), Matsue ((cid:2)(cid:0)(cid:1)(cid:2)) (cid:6). Gruner, C.: The Game of Humor: A Comprehensive Theory of Why We Laugh. Transaction Publishers ((cid:2)(cid:0)(cid:0)(cid:0)) (cid:7). Guyon, I., Weston, J., Barnhill, S., and Vapnik, V.: Gene Selection for Cancer Classification using Support Vector Machines. Machine Learning (cid:4)(cid:6)((cid:1)-(cid:3)), (cid:3)(cid:8)(cid:9)–(cid:4)(cid:2)(cid:2) ((cid:2)(cid:0)(cid:0)(cid:2)) (cid:8). International Journal of Humor Research: HUMOR, ((cid:1)(cid:9)(cid:8)(cid:8)). http://www.degruyter. com/view/j/humr (visited on (cid:0)(cid:5)/(cid:2)(cid:0)(cid:1)(cid:5)) (cid:9). Mihalcea, R., and Pulman, S.: Characterizing humour: An exploration of features in humorous texts. In: Computational Linguistics and Intelligent Text Processing, pp. (cid:3)(cid:3)(cid:7)–(cid:3)(cid:4)(cid:7). Springer((cid:2)(cid:0)(cid:0)(cid:7)) (cid:1)(cid:0). Mihalcea, R., and Strapparava, C.: Bootstrapping for fun: Web-based construction of large data sets for humor recognition. In: Proceedings of the Workshop on Negotiation, Behaviour and Language (FINEXIN (cid:2)(cid:0)(cid:0)(cid:5)), pp. (cid:8)(cid:4)–(cid:9)(cid:3) ((cid:2)(cid:0)(cid:0)(cid:5)) (cid:1)(cid:1). Mihalcea, R., and Strapparava, C.: Learning to Laugh (automatically): Compu- tational Models for Humor Recognition. Computational Intelligence (cid:2)(cid:2)((cid:2)), (cid:1)(cid:2)(cid:6)– (cid:1)(cid:4)(cid:2) (cid:1)(cid:2). Mihalcea, R., and Strapparava, C.: Making Computers Laugh: Investigations in Automatic Humor Recognition. In: Proceedings of the Conference on Human Language Technology and Empirical Methods in Natural Language Processing. HLT '(cid:0)(cid:5), pp. (cid:5)(cid:3)(cid:1)–(cid:5)(cid:3)(cid:8). Association for Computational Linguistics, Vancouver, British Columbia, Canada ((cid:2)(cid:0)(cid:0)(cid:5)) (cid:1)(cid:3). Minsky, M.: Jokes and the logic of the cognitive unconscious. Springer ((cid:1)(cid:9)(cid:8)(cid:0)) (cid:1)(cid:4). Mulder, M.P., and Nijholt, A.: Humour Research: State of Art. Technical Report TR-CTIT-(cid:0)(cid:2)-(cid:3)(cid:4), Enschede: Centre for Telematics and Information Technology University of Twente ((cid:2)(cid:0)(cid:0)(cid:2)) (cid:1)(cid:5). Padró, L., and Stanilovsky, E.: FreeLing (cid:3).(cid:0): Towards Wider Multilinguality. In: Proceedings of the Language Resources and Evaluation Conference (LREC (cid:2)(cid:0)(cid:1)(cid:2)), Istanbul, Turkey ((cid:2)(cid:0)(cid:1)(cid:2)) (cid:1)(cid:6). Raskin, V.: Semantic Mechanisms of Humor. Springer ((cid:1)(cid:9)(cid:8)(cid:5)) (cid:1)(cid:7). Reese, S., Boleda, G., Cuadros, M., Padró, L., and Rigau, G.: Wikicorpus: A Word-Sense Disambiguated Multilingual Wikipedia Corpus. In: Proceedings of (cid:7)th Language Resources and Evaluation Conference (LREC'(cid:1)(cid:0)), La Valleta, Malta ((cid:2)(cid:0)(cid:1)(cid:0)) (cid:1)(cid:8). Reyes, A., Buscaldi, D., and Rosso, P.: An Analysis of the Impact of Ambiguity on Automatic Humour Recognition. In: TSD, pp. (cid:1)(cid:6)(cid:2)–(cid:1)(cid:6)(cid:9) ((cid:2)(cid:0)(cid:0)(cid:9)) (cid:1)(cid:9). Reyes, A., Rosso, P., Martí, M.A., and Taulé, M.: Características y rasgos afectivos del humor: un estudio de reconocimiento automático del humor en textos escolares en catalán. Procesamiento del Lenguaje Natural (cid:4)(cid:3), (cid:2)(cid:3)(cid:5)–(cid:2)(cid:4)(cid:3) ((cid:2)(cid:0)(cid:0)(cid:9)) (cid:2)(cid:0). Ruch, W., Attardo, S., and Raskin, V.: Toward an Empirical Verification of the General Theory of Verbal Humor. HUMOR: the International Journal of Humor Research ((cid:1)(cid:9)(cid:9)(cid:3)) (cid:2)(cid:1). Rutter, J.: Stand-up as Interaction: Performance and Audience in Comedy Venues. Citeseer ((cid:1)(cid:9)(cid:9)(cid:7)). (cid:2)(cid:2). Sjöbergh, J., and Araki, K.: Recognizing Humor Without Recognizing Meaning. In: Masulli, F., Mitra, S., and Pasi, G. (eds.) WILF. Lecture Notes in Computer Science, pp. (cid:4)(cid:6)(cid:9)–(cid:4)(cid:7)(cid:6). Springer ((cid:2)(cid:0)(cid:0)(cid:7)) (cid:2)(cid:3). Strapparava, C., Valitutti, A.: WordNet Affect: an Affective Extension of WordNet. In: LREC, pp. (cid:1)(cid:0)(cid:8)(cid:3)–(cid:1)(cid:0)(cid:8)(cid:6) ((cid:2)(cid:0)(cid:0)(cid:4))
1910.08294
1
1910
2019-10-18T07:56:08
Towards Computing Inferences from English News Headlines
[ "cs.CL", "cs.AI" ]
Newspapers are a popular form of written discourse, read by many people, thanks to the novelty of the information provided by the news content in it. A headline is the most widely read part of any newspaper due to its appearance in a bigger font and sometimes in colour print. In this paper, we suggest and implement a method for computing inferences from English news headlines, excluding the information from the context in which the headlines appear. This method attempts to generate the possible assumptions a reader formulates in mind upon reading a fresh headline. The generated inferences could be useful for assessing the impact of the news headline on readers including children. The understandability of the current state of social affairs depends greatly on the assimilation of the headlines. As the inferences that are independent of the context depend mainly on the syntax of the headline, dependency trees of headlines are used in this approach, to find the syntactical structure of the headlines and to compute inferences out of them.
cs.CL
cs
Towards Computing Inferences from English News Headlines Elizabeth Jasmi George1[0000-0001-6012-5364] and Radhika Mamidi1[0000-0003-0171-0816] 1 LTRC, International Institute of Information Technology, Hyderabad, India
 [email protected], [email protected] Abstract. Newspapers are a popular form of written discourse, read by many people, thanks to the novelty of the information provided by the news content in it. A headline is the most widely read part of any newspaper due to its ap- pearance in a bigger font and sometimes in colour print. In this paper, we sug- gest and implement a method for computing inferences from English news headlines, excluding the information from the context in which the headlines appear. This method attempts to generate the possible assumptions a reader formulates in mind upon reading a fresh headline. The generated inferences could be useful for assessing the impact of the news headline on readers includ- ing children. The understandability of the current state of social affairs depends greatly on the assimilation of the headlines. As the inferences that are indepen- dent of the context depend mainly on the syntax of the headline, dependency trees of headlines are used in this approach, to find the syntactical structure of the headlines and to compute inferences out of them. Keywords: Computing Inferences, Presuppositions, Conventional implicatures, Pragmatics, News Discourse, News Headline. Introduction 1. The headline of a news report appears at the top of the news report and is often print- ed in a bigger font and some times in bright colour. The marketability of a news story depends to a great extent on the ability of the headline to attract readers. A headline generally tries to summarise the content of the news story, with a strong intention of communicating the context to the reader. Headlines also try to attract the attention of the newsreaders, prompting them to read on through the news story. Headline func- tions as a number of speech acts. It urges, warns and informs the reader [11]. This work views headline as a potential source of rich information capable of generating multiple inferences relevant to the current social state making it worthy of adding to the general knowledge. This work was done as a part of building a system for children to learn about cur- rent affairs in a simpler way. In this work, we consider headline as a standalone unit of discourse, without any context or supporting background information and compute the inferences that arise from the headline alone. Our experiment attempts to compute inferences based on syntactical triggers. This paper focuses on inferences, in particular presuppositions and conventional implicatures which are independent of context and omit conversational implicature which requires context information to formulate. The number of triggers used in this experiment is limited and the results include negatives in some cases. 1.1. Presupposition and Conventional Implicature According to Levinson [15] presupposition is used to describe any kind of back- ground assumption against which an action, theory, expression or utterance makes sense or is rational and conventional implicatures are non-truth-conditional inferences that are not derived from superordinate pragmatic principles like the maxims but are simply attached by convention to particular lexical items or expressions. According to Fromkin et al. [6], presuppositions are implicit assumptions about the world, required to make an utterance meaningful or appropriate. Not unlike lexical presuppositions conventional implicatures are associated with specific words and re- sult in additional conveyed meanings when those words are used, according to Yule [21]. Presuppositions are denoted by '>>' and conventional implicatures are denoted by '≈'. For an utterance "The King of France is Wise." there can be a presupposition that >> There is a present king of France. For an utterance "Amelia is a Toddler but she is quiet." there can be a conventional implicature that ≈ Toddlers are not usually quiet [3]. As an example, upon reading a headline 'Schaeuble says British were 'deceived' in Brexit campaign', a reader may make the following inferences. (i). Schaeuble exists. (ii). Schaeuble said something. (iii). Schaeuble believes that the British were 'de- ceived' in Brexit campaign. (iv). Brexit campaign happened. (v). Brexit can have campaign (vi). The British government was deceived in the Brexit campaign (vii). The British citizens were deceived in the Brexit campaign. The inferences (vi) and (vii) which are conversational implicatures need more contextual information along with the headline under consideration to support them. So generating inferences like (vi) and (vii) is not attempted in this work and we try to generate inferences similar to those stated from (i) to (v). 1.2. Related Work Cianflone et al. [1] have introduced the novel task of predicting adverbial presupposi- tion triggers, and this paper explores the scope of computing presupposition state- ments from the syntax structure provided by dependency trees of news headlines. The approach used in that paper uses deep learning while this paper demonstrates a rule- Based approach. The RTE task [22] dataset consisted of text(t)-hypothesis(h) pairs with the task of judging for each pair whether t entails h. In this work, we attempt to generate hypotheses for news headlines rather than judging whether a hypothesis is correct. Burger and Ferro [23] attempted to generate a large corpus of textual entail- ment pairs from the lead paragraph and headline of a news article. To the best of our knowledge, ours is the first work towards computing presuppositions and convention- al implicatures from English news headlines. 1.3. Linguistic Definitions and Characteristics of Headlines According to Dor [4], headlines are "the negotiators between stories and readers" and they have four functions of summarising, highlighting, attracting and selecting. The headline together with the lead or the opening paragraph summarises a news story. Gattani [8] identifies three broad macro headline functions. (i). The informative head- line, which gives a good idea about the topic of the news story. (ii). The indicative headline, which addresses what happened in the news story. (iii). Eye catcher head- line, which does not inform about the content of the news story but is designed to entice people to read the story. The greater the mental effort required for processing a headline, the less relevant it becomes [4]. While reading a headline the reader should be able to construct assumptions, either based on what can be perceived in their im- mediate environment or on the basis of assumptions already stored in their memory. The relevance of a headline is directly proportional to the amount of contextual ef- fects and inversely proportional to the cognitive processing effort required to recover these effects [18]. Headlines are characterised by the density of the information present in them and they have the syntactic characteristics of telegraphic speech. They also contain bold expressions, polarisation, exaggerations and provocative wording [14]. While pro- cessing headlines, more information should be expected from a shorter span of words. The grammatical rules for proper English sentences would be frequently violated ei- ther for filling more information in the short space available or for promoting the cu- riosity of the reader. News headlines use a special language called 'block language', a name first coined by Straumann [9]. Block language has a structure different from the normal clause or sentence structure but it often conveys a complete message. This language usually consists of lexical items lower than sentences. 1.4. Relevance of this Work This work computes inferences from headlines. The inferences generated can be fed to a learning system which grades the impact created by the headline, based on sensi- tivity, child-Friendliness, clarity and various other parameters as required. It is advan- tageous to evaluate the impact because an ordinary reader naturally reads through the headlines in the newspaper before starting to read the whole news articles. The under- standability of the headline contributes towards the ease of understanding of the news story that follows it. Data 2. The dataset used in this work is comprised of around 350 headlines collected manual- ly from different news websites [25-27] about four popular events which appeared continuously in news reports for a time span of a few months. The topics selected for including in the dataset are 'Brexit', 'Disputes over the South China Sea', 'Syrian refugee crisis' and 'Pyeongchang Winter Olympics'. In the dataset, the headlines were arranged in chronological order to facilitate their use in studying the gradual evolution of the headlines, assuming that the reader has already read the previous headlines for the same news item. The timestamp associated with headlines in the dataset is not used in the present work, though it might be useful for future developments to evalu- ate how headlines evolve as the news on that topic progresses in course of time and how readers understand them based on their awareness of the previous headlines on the same topic. 2.1. Format of Data The data used as input for computing inferences using our rule-Based system are in the format: Headline [source: News source Timestamp]. A subset of the same dataset is used for collecting human inferences for evaluation purpose. Some Examples of headline data is given below. U.S. vows new North Korea sanctions ahead of Olympics face-off [source: Reuters February 07, 2018 06:39 PM IST] Schaeuble says British were "deceived" in Brexit campaign [source: Reuters June 23, 2017 07:18 PM IST] Proposed Method 3. In this work, it is assumed that only the headline is available to the reader for under- standing the topic of the news and that the reader is completely ignorant of the previ- ous happenings under the same topic of news. The inferences of headlines are com- puted based on some logical conclusions attained, rooted in certain grammatical rela- tions present in the headline. Rusu et al. [20] suggest subject-predicate-object triplet extraction from sentences which motivated this work. In the case of a news headline, the participants are the composer of the headline, who is the speaker and the common person reading the headline, who is the addressee. For computing inferences, we be- gin with the extraction of nouns and verbs. The algorithm is outlined below. _____________________________________________________________________ Algorithm 1. Computing Inferences from a news headline: _____________________________________________________________________ 1: Extract one headline from the dataset and preprocess it by removing the punctua- tions. 2: Annotate the headline with POS tags for all tokens in it, using Stanford CoreNLP [16]. 3: Get all the verbs in the headline by comparing the POS tags of the tokens against the regular expression 'V.+'. 4: Get corresponding dependencies for all the verbs of the headline, using Stanford CoreNLP annotated with 'depparse'. Refer section 3.1 5: Get all nouns and pronouns from the headline by comparing the POS tags of the tokens against the regular expression 'N.+P.+'. 6: Generate explicit inferences from headline using Stanford OpenIE [7] 7: Generate more inferences using the rule-Based system under section 3.2 based on grammatical relations held between tokens in the headline. _____________________________________________________________________ In the algorithm, we start with dependency parsing the headline, thus obtaining the verbs occurring in the headline with their dependencies. We get the headline tagged with POS tagger from Stanford and then extract the list of nouns and list of verbs in the headline. The verbs are also lemmatised to get the base form of the verbs present in the headline. The lemmatised form is used when a different form of the verb other than the tense form in which it appears in the headline, is required for a changed tense form in the computed inferences. A few rule-Based approaches are implemented to get inferences from the headline. Stanford openIE [7] gives inferences which are di- rectly stated in the headline. The headline "How the company kept out 'subversives'" gives the inference "company kept out 'subversives' " by openIE [7]. More inferences assumed from the syntactical structure of the headline are generated by the rule-Based system. 3.1. Extracting Dependencies The Stanford dependencies are binary grammatical relations held between a 'gover- nor' and a 'dependent' as specified in the Stanford dependencies manual [17], which provides documentation for the set of dependencies defined for English. The depen- dencies obtained from the Stanford CoreNLP dependency parser [16] are generated as a dependency tree which contains dependencies as tuples like those in the examples given below for the headline 'Rescue rules by Bank of England will divide Britain'. (i). {'dep': 'nmod', 'governor': 2, 'governorGloss': 'rules', 'dependent': 4, 'dependent- Gloss': 'Bank'} (ii). {'dep': 'case', 'governor': 6, 'governorGloss': 'England', 'dependent': 5, 'depen- dentGloss': 'of'} (iii). {'dep': 'nmod', 'governor': 4, 'governorGloss': 'Bank', 'dependent': 6, 'dependent- Gloss': 'England'} (iv). {'dep': 'aux', 'governor': 8, 'governorGloss': 'divide', 'dependent': 7, 'dependent- Gloss': 'will'} (v). {'dep': 'dobj', 'governor': 8, 'governorGloss': 'divide', 'dependent': 9, 'dependent- Gloss': 'Britain'} 3.2. Rule-Based System for Inference Generation In this work, we use a rule-Based system that is comprised of rules based on com- monly occurring syntactical patterns. These patterns are modelled as inference trig- gers. Inference generation logic for an associated inference trigger is configured as a rule. Multiple iterations are performed on the dependency relations to generate infer- ences. Node JS tense conjugator [24] is used to find the required tense form of the verb to be attached in the computed inferences. Since this work demonstrates the use of syntax structures to generate inferences using only a few triggers in the scope of inference triggers, the addition of more known triggers like iterative -- anymore, return, another time, to come back, restore, repeat etc. change of state verbs -- stopped, began, continued, start, finish, carry on, cease, leave, enter, come, go, arrive etc. Factive verbs -- regrets, aware, realise, know, be sorry that, be proud that, be indifferent that, be glad that, be sad that etc. Verbs of judging -- accuse, criticise, blame, apologise, forgive, condemn, impeach etc. which humans are better at making inferences upon should be included for more ac- curate results, by elaborating the rules using string comparison of the verb under con- sideration with these above-mentioned triggers. The Current set of inference triggers and rules used in computing inferences from headlines are listed below. The set of rules can be extended with more patterns to improve the quality of inferences. Presence of a Future Tense Verb. Presence of a future tense verb in the headline could suggest that we can infer that the event described by the noun is yet to happen. If dependent is 'aux'(auxiliary) and 'dependentGloss' is the string 'will' then iterate once again through the dependencies to find a dependent 'dobj'(direct object) which is the noun phrase which is the (accusative) object of the verb where the 'governor- Gloss' of both dependency relations match. Eg: "Russian state television will not broadcast Olympics without national team." can have an inference >>"Olympics is not yet broadcast ". Fig. 1. Dependency structure for the headline 'Russian state television will not broadcast Olympics without national team'. _____________________________________________________________________ Algorithm 2. Computing Inferences Based on the Presence of a Future Tense in a Headline: _____________________________________________________________________ 1: Consider VD as the set of verbs in the headline with their dependencies, obtained from parser 2: for each dependency tuple D in VD 3: if 'dep' of D is= 'aux' and 'dependentGloss' of D is = 'will' then 4: for each dependency tuple ND in VD 5: if 'dep' of ND is = 'dobj' and 'governorGloss' of ND is = 'governorGloss' of D then 6: output 'dependentGloss' of ND 7: output "is not yet" 8: output past tense of ('governorGloss' of D) _____________________________________________________________________ Presence of the Conjunction 'but'. Presence of the conjunction 'but' could suggest that we can infer that the subject was expected to undergo 'negation' of that which is mentioned in the part of the headline after the conjunction 'but'. Fig. 2. Dependency structure for the headline 'Olympics-It's ready but will they come?' Eg: "Olympics-It's ready but will they come?" can have a inference >>" Olympics - being ready was expecting coming". _____________________________________________________________________ Algorithm 3. Computing Inferences Based on the Presence of Conjunction 'but' in a Headline: _____________________________________________________________________ 1: Consider VD as the set of verbs in the headline with their dependencies, obtained from parser 2: for each dependency tuple D in VD 3: if 'dep' of D is = 'conj:but' then 4: output "being " 5: output 'governorGloss' of D 6: output " was [not] expecting " 7: output Gerund of ('dependentGloss' of D ) _____________________________________________________________________ Presence of 'again' in a Clause with a Verb. Presence of 'again' as an adverbial modifier in a clause with a verb could suggest that we can infer that the event de- scribed by the noun has already happened. Eg: "Norway regulator again rejects "Donut" fish farm volume plan." can have an inference >>"Norway regulator has rejected "Donut" fish farm volume plan before". Fig. 3. Dependency structure for the headline 'Norway regulator again rejects "Donut" fish farm volume plan' _____________________________________________________________________ Algorithm 4. Computing Inferences of a Headline Which has Presence of 'again' in a Clause with a Verb: _____________________________________________________________________ 1: Consider VD as the set of verbs in the headline with their dependencies, obtained from parser 2: Consider N is the set of all nouns in the headline 3: for each dependency tuple D in VD 4: if 'dep' of D is = 'advmod' and 'dependentGloss' of D is 'again' or if any noun in N is 'dependentGloss' with 'dep' of D = 'nsubj' then 5: for each dependency tuple ND in VD 6: if 'dep' of ND is = 'nsubj' and 'governorGloss' of ND is = 'governorGloss' of D then 7: output 'dependentGloss' of ND 8: output past tense of ('governorGloss' of D) "before" _____________________________________________________________________ Get all the nouns in the headline and iterate through them until the 'dependentGloss' of a tuple is a noun in the headline and the dependent is 'nsubj'(nominal subject) that is a noun phrase which is the syntactic subject of a clause or if dependency relation is 'advmod'(adverb modifier). Then if the 'governorGloss' is 'again' follow from step 5 of Algorithm 4. Presence of 'further' as an Adverb. Presence of 'further' as an adverb could suggest that we can infer that now it is already in the state described by the 'noun' related to the verb modified by the adverb 'further'. Eg: "UK economy to slow further." can have an inference >>"Economy is already slow". Fig. 4. Dependency structure for the headline 'UK economy to slow further' Presence of a 'noun compound'. Presence of noun compound like 'Brexit campaign' could suggest that we may infer that 'Brexit' that is the first part 'N1' of the noun compound can be /can have a 'campaign', that is the second part 'N2' of the noun compound. The problem of computing semantic relation of the nouns N1 and N2 in the noun compound is not dealt with in this experiment. Only common sense assimi- lation that "N1 can be N2" or "N1 can have N2" is generated. Eg: "Russia's Olympic ban strengthens Putin's reelection hand." can have an inference >>"Olympic can be /can have ban". Fig. 5. Dependency structure for the headline 'Russia's Olympic ban strengthens Putin's reelec- tion hand' Presence of a 'verb' in Past Tense. If the 'verb' is in the past tense in a headline it could suggest that we can infer that, the event has already happened. Eg: "The dude released this video before he went on a killing spree" can have an in- ference >>"dude has released this video". Fig. 6. Dependency structure for the headline 'The dude released this video before he went on a killing spree' Presence of Nominal Modifier 'of'. If there is a nominal modifier 'of' then it could suggest that we can infer that the dependent 'has' governor. Eg: "Bank of England plans rescue." can have an inference >> "England has Bank". Fig. 7. Dependency structure for the headline 'Bank of England plans rescue' 4. Results and Discussion The unavailability of annotated inferences makes the comparison and evaluations difficult for this task. The inferences generated with the system are compared with manually annotated inferences for 100 randomly collected headlines. Annotators are two research scholars doing research in Linguistics and fluent in English. They did the annotation of the subset of the dataset for evaluation manually, based on the anno- tation guidelines provided to them (see section 6.2 of the Appendix). Annotation guidelines with explanatory examples for the inference triggers mentioned in section 3.2 were given to the annotators and they were asked to look for the surface structure of the headline in general and use human judgement in making inferences. No upper limit on the number of generated human inferences was imposed. 11.8% of the inferences generated by the annotators were of the existential types, such as those beginning with a clause like "there exists". The inference triggers other than the existential ones are occurring less in headlines compared to normal discourse, due to the peculiarity of block language used. Table 1. Accuracy and Generated Percentage of Inferences Computed Inference Trigger Percentage of Accurate But Again Further Inferences 69.3 82.7 94 Future Tense Noun Compound 54.4 93 Percentage of Inaccurate Inferences Percentage of Miss- ing Inferences 0 8.3 6 3 40.2 30.7 9 0 4 5.4 The percentages of computed inferences for some inference triggers used in this ex- periment is given in Table 1. For a headline 'Britain takes step towards Brexit with repeal bill' our system generates the following inferences (i). Britain takes step (ii). Britain takes step towards Brexit (iii). Britain takes step with repeal bill (iv). repeal can be/can have bill (v). Brexit has step. Table 2. Comparison of manually annotated inferences with computed inferences for a headline Headline Manually Annotated Inferences Computed Inferences Percentage of Correct Inferences Percentage of Incor- rect results IOC extends North Korea deadline for Pyeongchan g games Olympic- s:Medals at Winter- Olympics through years Schaeuble Says British were "de- ceived" in Brexit cam- paign 1. IOC has power to extend deadline 2. North Korea has deadline 3. Deadline can be extended 4. There exists North Korea 5. There exists Pyeonchang games 1. There exists Winter Olympics 2. Olympics has medals 3. Olympics had been happen- ing through years 4. There exists medals in years Olympics was conducted 1. Schaeuble exists 2. Schaeuble believes that the British were "deceived" in Brexit campaign 3. Brexit can have campaign 4.Schaeuble said something. 5. Schaeuble believes that the British were 'deceived' in Brexit campaign. 6. Brexit campaign happened. 1. Korea can have deadline 2. Pyeongchang has games 40% 0% 3. Games has deadline 1. Winter can have olympics 2. Olympics has medals 75% 0% 3. years had medals 16.7% 33% 1. Schaeuble Says British were "deceived" 2. Brexit can be/ can have campaign 3. campaign has deceived Table 2 shows the comparison results of manually annotated inferences with the com- puted inferences for the three headlines in the first column and gives the percentage of correct computed inferences and percentage of incorrect results out of the computed inferences for those headlines. For example for the last headline -- "Schaeuble Says British were "deceived" in Brexit campaign" only one of the manually annotated in- ferences -- "Brexit can be/can have campaign" is computed by our Rule-Based sys- tem thus making the percentage of correct computed inferences to be 16.7%, and out of the three computed inferences "campaign has deceived" is wrong and thus the per- centage of incorrect results in the computed inferences is 33%. 5. Conclusions and Future Work In this work, we considered headline as a stand-alone unit of text without attaching any information from the context in which it appeared in a news report. Based on the observation that the presence of certain words and tense conditions can trigger infer- ences from a headline, we tried to generate inferences based on a set of rules, formu- lated based on certain grammatical relations present in the headline. In future, the rule set could be expanded to include more observations and complex rules to compute more inferences. These inferences can be used to measure the impact and sensitivity of a headline mainly for checking the appropriateness when used in a platform de- signed for children. This experiment was more of an attempt towards computing in- ferences from the headline and the results are not complete due to the limited propor- tion of rules implemented compared to the large list of cases generating presupposi- tions and conventional implicatures. This approach of applying logic on the syntactic structure to generate inferences stand different from alternative approaches using deep learning techniques because of the lesser data, time and compute requirement. Acknowledgements. We would like to thank Dr.Monojit Choudhury, Microsoft Re- search- Bangalore, for suggesting this topic of research as part of the Computational Socio-pragmatics course he taught at IIIT-H. We would also like to thank all the anonymous reviewers for carefully reading through our manuscript and offering valu- able suggestions. Appendix 6. Annotation Guidelines Purpose of Annotation 6.1. This Annotation task targets to provide the possible presuppositions for a news head- line. Presuppositions can be any background assumption against which the headline makes sense or is rational. Presuppositions are denoted by a '>>' symbol. A sentence and its negative counterpart share the same set of presuppositions, so the headline "Karnataka CM meets prime minister Narendra Modi " will have the following pre- supposition >> "Narendra Modi is the prime minister" which is true for the statement "Karnataka CM meets prime minister Narendra Modi" as well as its negative coun- terpart "Karnataka CM does not meet prime minister Narendra Modi ". 6.2. Guidelines for Annotating Presuppositions For annotating, look for presupposition triggers, which are the linguistic items that are particular words or some aspects of the surface structure of the headline in general, which generates presuppositions. The following are some presupposition triggers with examples. Definite Descriptions. Example. Hunterston B: Pictures show cracks in Ayrshire nuclear reactor >> There exists cracks in Ayrshire nuclear reactor. Factive Verbs. Factive verbs like regrets, aware, realize, know, be sorry that, be proud that, be indifferent that, be glad that, be sad that etc. Example. Corbyn 'regrets' Labour MPs' resignations >> Labour MPs resigned. Implicative Verbs. Implicative verbs like manage, remember, bother, get, dare, care, venture, condescend, happen, be careful, have the misfortune, have the sense, take the time, take the trouble, take the opportunity etc. Example. How Russia Managed to Destroy Saudi Arabia ? >> Russia destroyed Saudi Arabia. Change of State Verbs. Change of state verbs like stopped, began, continued, start, finish, carry on, cease, leave, enter, come, go, arrive etc. Examples. (i). Britain continued to struggle with Brexit >> Britain was struggling with Brexit. (ii). China has stopped stockpiling metals. >> China had been stockpiling metals. Iteratives. Iteratives like again, anymore, return, another time, to come back, restore, repeat, for the nth time etc. Examples. (i). HTC in talks with Micromax, Lava and Karbonn to return to Indian market >> Micromax, Lava and Karbonn had been in Indian market previously. (ii). BoE's Carney says will reassess outlook when there is Brexit clarity >> Outlook has been assessed before. Verbs of Judging. Verbs of judging like accuse, criticise, blame, apologize, forgive, condemn, impeach etc. Examples. (i). Trump blames financial market 'disruption' on Democrats >> Trump thinks that financial market disruption is bad. (ii). Amnesty criticises Hungary over treatment of migrants >> Amity thinks that Hungary was treating migrants bad. Temporal Clauses. Temporal clauses like before, while, after, when, during, whenev- er etc. Example. Britons were endlessly lied to during Brexit campaign >> There was a Brexit campaign. Cleft Sentences. Cleft sentences like i. What he wanted to buy was a Fiat, ii. It is Jaime for whom we are looking, iii. All we want is peace etc. Example. It is Jaime for whom we are looking >> We are looking for someone. Implicit Clefts with Stressed Constituents. Implicit clefts with stressed constituents like capital letters, or bold type, or underlined type can give rise to presuppositions. Comparisons and Contrasts. Comparisons and contrasts like too, back, in return etc. can give rise to presuppositions. Example. Russia is a better negotiator than Italy >> Italy is a negotiator. Non-restrictive Relative Clauses. Example. John, who passed the test, was elated. >> John passed the test. Counterfactual Conditionals. Example. If I had a guarantee, then I'd love them >> I don't have a guarantee. Questions. Example. What's missing from your low carb breakfast? >> Something is missing from your low carb breakfast. Similarly who can be replaced by someone, where by somewhere, how by somehow to generate presuppositions.Yes/No questions will generally have vacuous presupposi- tions. Example. Are you living with mild or moderate depression? >> Either you are living with mild or moderate depression or you are not. More than Two Words in Quotes. More than two words in quotes can give a pre- supposition that something is said. News headlines sometimes have quotes to empha- size words. So it may not be an utterance always. So we assume that more than 2 words in quotes mean something is said. Example. Merkel says May's Brexit proposals "not the breakthrough". >> Merkel says "not the breakthrough". Future Tense Verb. Presence of future tense verb in the headline can create a presup- position that the event described in the noun has not happened yet. Example. Russian state television will not broadcast Olympics without national team >> Olympics is not yet broadcast by Russian state television. The Conjunction 'but' Suggest a Contrast. Example. Olympics-It's ready but will they come? >> Being ready was expecting them to come. Gender-Specific Statements. Example. New Zealand Prime Minister Jacinda Ardern gives birth to first child. >> Jacinda Arden is a female. Since the headlines use tricky language to attract readers, human intuition while list- ing the presuppositions is required. Format of the annotation is to write presupposi- tions preceding with a '>>' following the headline, and after writing all presupposi- tions for a headline, ending it with a '' with one presupposition statement in a line. Presuppositions should be expressed as simple sentences in simple English. References 1. Andre Cianflone, Yulan Feng, Jad Kabbara, Jackie Chi Kit Cheung. Let's do it "again": A First Computational Approach to Detecting Adverbial Presupposition Triggers. Proceed- ings of the 56th Annual Meeting of the Association for Computational Linguistics, Volume 1: Long Papers (2018). Retrieved from https:// aclweb.org/anthology/P18-1256, last ac- cessed 2019/09/02. 2. Abbott, Barbara. Where have some of the presuppositions gone?. Michigan State Universi- ty (2006). doi: https://doi.org/10.1075/slcs.80.02abb 3. Christopher Potts. Into the conventional-implicature dimension (2006). doi: https://doi.org/ 10.1111/j.1747-9991.2007.00089.x 4. Daniel Dor. On newspaper headlines as relevance optimizers. Journal of Pragmatics 35, 695 -- 721 (2003). doi: https://doi.org/10.1016/s0378-2166(02)00134-0 5. Dijk, V. News Analysis: Case Studies of International and National News in the Press. New Jersey: Lawrence Erlbaum Associates Publishers (1988). doi: https://doi.org/ 10.4324/9780203357828 6. Fromkin, Victoria, Rodman, Robert, and Hyams, Nina. An introduction to language, 8th ed., Thomson/Wadsworth (2007). 7. Gabor Angeli, Melvin Johnson Premkumar, and Christopher D. Manning. Leveraging Linguistic Structure For Open Domain InformationExtraction. In Proceedings of the Asso- ciation of Computational Linguistics(ACL), (2015). doi: https://doi.org/ 10.3115/v1/ p15-1034 8. Gattani, Akshay. Automated natural language headline generation using discriminative machine learning models (2007), Retrieved from Simon Fraser University Homepage last accessed 2019/09/02. 9. Heinrich Straumann. Newspaper headlines : a study in linguistic method. G. Allen & Un- win, Limited, London, (1935). Retrieved from https://trove.nla.gov.au last accessed 2019/09/02. 10. H. Paul Grice. "Logic and conversation." In Cole, P., and J.L.Morgan, eds. Speech Acts. New York: Academic Press, 41 -- 58, (1975). doi: https://doi.org/10.1057/9780230005853_5 11. Iarovici, Edith, Amel, Rodica. The strategy of the headline. Semiotica 77-4, 441 -- 459, (1989). doi: https://doi.org/10.1515/semi.1989.77.4.441 12. Karttunen, Lauri, and Stanley Peters. Conventional implicature. In Syntax and Semantics 11: Presupposition, ed. D.A. Dinneen and C.-K. Oh, 1 -- 56. New York: Academic Press, (1979), Retrieved from http://web.stanford.edu/ last accessed 2019/09/02. 13. Kristina Toutanova, Dan Klein, Christopher Manning, and Yoram Singer. Feature-Rich Part-of-Speech Tagging with a Cyclic Dependency Network. In Proceedings of HLT- NAACL 2003, pp. 252-259, (2003). doi: https://doi.org/10.3115/1073445.1073478 14. Kronrod, Ann, Engel, Orit. Accessibility theory and referring expressions in newspaper headlines. Journal of Pragmatics 33, 683 -- 699, (2001). doi: https://doi.org/10.1016/ s0378-2166(00)00013-8 15. Levinson, Stephen C. Pragmatics. Cambridge: Cambridge University Press, (1983). doi: https://doi.org/10.1017/CBO9780511813313 16. Manning, Christopher D., Mihai Surdeanu, John Bauer, Jenny Finkel, Steven J. Bethard, and David McClosky. The Stanford CoreNLP Natural Language Processing Toolkit In Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pp. 55-60, (2014). doi: https://doi.org/10.3115/v1/p14-5010 17. Marie-Catherine de Marneffe, Christopher D. Manning, Stanford typed dependencies manual (2008), Revised for the Stanford Parser v. 3.7.0, (2016). Retrieved from Stanford NLP group homepage https:// nlp.stanford.edu/ last accessed 2019/09/02 Amsterdam, (2000). doi: https://doi.org/10.1075/pbns.75 18. Pilkington, Adrian. Poetic Effects: A Relevance Theory Perspective. John Benjamins, 19. Práš ková, E. Grammar in newspaper headlines.University of Pardubice, (2009). Re- trieved from University of Pardubice homepage https://dk.upce.cz last accessed 2019/09/02 20. Rusu, Delia, Dali, Lorand, Fortuna, Blaž, Grobelnik, Marko, and Mladenic, Dunja. Triplet extraction from sentences. In Proceedings of the 10th International Multi-Confer- ence Information Society- IS, pp. 8-12, (2007). Retrieved from semanticScholar homepage https://pdfs.semanticscholar.org/ 21. Yule, G. Pragmatics. Oxford: Oxford University Press, (1996). doi: https://doi.org/ 10.1017/CBO9780511757754.011 22. Ido Dagan, Oren Glickman, and Bernardo Magnini. The PASCAL Recognising Textual Entailment Challenge. In Quinonero-Candela et al., editor, MLCW 2005, LNAI Volume 3944, pages 177 -- 190. Springer-Verlag, (2006). doi: https://doi.org/10.1007/11736790_9 23. John Burger and Lisa Ferro. Generating an entailment corpus from news headlines. In Proceedings of the ACL Workshop on Empirical Modeling of Semantic Equivalence and Entailment, pages 49 -- 54, Ann Arbor, Michigan, June. Association for Computational Lin- guistics, (2005). doi: https://doi.org/10.3115/1631862.1631871 24. Spencer Kelly and many contributors. compromise- modest natural-language processing in javascript. https://www.npmjs.com/package/compromise last accessed 2019/09/02. 25. Reuters Homepage, https://in.reuters.com/ last accessed 2019/09/02. 26. The Hindu Homepage, https://www.thehindu.com/ last accessed 2019/09/02. 27. BBC Homepage, https://www.bbc.com/ last accessed 2019/09/02.
1209.1301
1
1209
2012-08-19T02:31:29
Evaluation of Computational Grammar Formalisms for Indian Languages
[ "cs.CL" ]
Natural Language Parsing has been the most prominent research area since the genesis of Natural Language Processing. Probabilistic Parsers are being developed to make the process of parser development much easier, accurate and fast. In Indian context, identification of which Computational Grammar Formalism is to be used is still a question which needs to be answered. In this paper we focus on this problem and try to analyze different formalisms for Indian languages.
cs.CL
cs
Evaluation of Computational Grammar Formalisms for Indian Languages Nisheeth Joshi [1], It i Mathur [2] [1] [2] Department of Computer Science, Apaji Inst itute, Banasthali University, Rajasthan, India nisheeth.joshi@redif fmail.com [1], [email protected] [2] ABSTRACT Natural Language Parsing has been the most prominent research area since the genesis of Natural Language Processing. Probabilistic Parsers are being developed to make the process of parser development much easier, accurate and fast. In Indian con text, identification of which Computational Grammar Formalism is to be used is still a question which needs to be answered. In th is paper we focus on to analyze different try th is problem and formalisms for Indian languages. Index Terms— Indian Languages, Computational Grammars, Linguistic Theor ies, Syntactic Structures, Evaluation1 1. INTRODUCTION Natural Language Parsing has been an impor tant activity in Natural Language Processing (NLP) development. But, even since the introduction of mach ine learn ing techniques into NLP application development, the scenario changed drastically. Th is new approach appeared to be very promising, as it helped in rapid prototype developmen t of NLP systems. In this technique, large amount of data was used, on to which various models like Hidden Markov Model (HMM), Conditional Random Fields (CRF), Neural Networks (NN), Support Vector Mach ines (SVM) etc. were applied. These approaches are also termed as statistical approaches or Statistical Natural Language Processing (SNLP). This was a very effective way of application developmen t, with applications attain ing 60-75% accuracy with very little effort. Un fortunately, this approach soon lost its sh ine as after a poin t of optimized performance, they become very less helpful in improvemen t of the systems[1]. Moreover , it failed to implement broad coverage parsing or deep parsing. Proc. of International Conference in Computer Engineering and Technology, 2012, Organized by Jodhpur Institute of Engineer ing and Technology, Jodhpur . Sponsored by IEEE, USA and Institution of Engineers (India), Kolkatta. Due to this reason , NLP researchers, in order to tr ied a new improve performance of their systems, approach. They initially stared with a rule based (traditional) approach. This was called the seed data. Once this was done, it was then supplied to mach ine learn ing techn iques. This approach was termed as hybrid approach (partially rule based and par tially statistical). We can find evidence of improved systems in literature wh ich used th is approach[2][3]. This approach even helped in development of probabilistic parsers like Stan ford parser[4], Charniak parser[5], MaltParser[6]. These all parsers where supplied with different computational grammars formalisms or with treebanks, wh ich were developed using manually parsed sen tences, based on one of the formalisms, for example Penn Treebank[7] TIGER Treebank[8] Paraguay Dependency Treebank[9]. In one or the other way, grammar formalisms were used for development of deep parsers. In th is paper, we attempt to study the performance of some of the popular computational grammar formalism techn iques, which could be used in development of deep language processing applications like a deep parser, mach ine translators, seman tic role labeler etc. The motivation for this study came from the fact that free word order is one of the areas were grammar formalism has not yet reached the level of good accuracy. In th is area there have been numerous claims to prove super iority of dependency grammar over other formalisms[10][11]. But, often discussions based on th is formalism ignore more practical aspects like usability and expressivity. In order to examine free word order approach, we conducted our study on Hindi. Since all other Indian languages follow the same phenomena. The approach suggested in this study can be applied to other languages. 2. COMPUTATIONAL GRAMMAR FORMALISMS In general computational grammars can be divided in to three categor ies based on their functionality. They are Ph rase Structure Grammars, Dependency Grammars, and Hybr id Grammars. A ph rase structure grammar is the one wh ich uses the approach shown by transformational grammars where specific tree positions are associated with assignments of various syn tactic roles, such as subject and object. This concept is the motivation for having elemen ts appear in var ious positions in the tree in the process of der iving the final syntactic structure. Some of the popular formalisms of this category are Tree Adjoining Grammar (TAG) [12], Head Dr iven Phrase Structure (HPSG) [13] Grammar . Hybrid grammar augments ph rase structure grammar by expressing non -projective syntactic relations, wh ile main tain ing a more formally defined architecture then ph rase structure grammar . Lexical Functional Grammar (LFG)[14] is an example of hybr id grammar. A dependency grammar consists of a set of words and a set of directed binary dependency relations between words, such that  No words depends on itself  Each dependent has one and on ly one head  A head may have many dependen ts  There is one distinguished word which is the head of the sen tence and depends on no other word  All other words in a sentence are dependents such that the whole sen tence is connected. Dependency grammars have been studied by Gaifman[15] who studied linear precedence in dependency relations, Hudson [16] who introduced word grammar, Starosta [17] who studied lexicase grammar and Bhar ti et al[18] who showed the similarities between Paninian Grammar (PG) and dependency grammar and the suitability of PG in Indian context. 3. METHODOLODY In order to understand the pros and corns of different grammar formalism, we tested all three types of grammar formalisms. From phrase structure stable, we selected TAG, LFG from hybrid and PG from dependency framework. We developed parallel grammars three for all frameworks and took a detailed note of development process and var iations in syn tactic structures. We recorded time taken to construct each sentence, the total time taken to complete the task and the average time taken for the task. We also noted the difficulty level with which each grammar was developed. Since all three grammar formalism are somewh at distinct in nature, it was very much necessary to develop a mechan ism wh ich would not be biased towards one grammar and penalize others. To ensure the equivalence, we tested each grammar using the same set of sentences. The test case con tained grammatical as well as ungrammatical sentences. Each grammar was required to distinguish between the two categories. Moreover each grammar was required to provide predicate, argumen ts and modifiers for each sentence which was parsed. Figure 1 and 2 give a br ief idea of the type of sen tences used. Var ious types of sen tences used in the test case were:  Basic sen tences with auxiliary verbs  Sentences having case assigning post positions  Sentences marking subjects  Adpositional sen tences  Sentences with generative constructions  Sentences with descr iptive adjectives  Sentences with predicative adjectives  Sentences with relative/co-relative constructions (a) लडक(cid:551) ने लडके को मारा ladkii ne ladke ko mara gir l-Erg boy-Acc hit (b) मारा लडक(cid:551) न े लडके को mara ladkii ne ladke ko (c) लडके को लडक(cid:551) ने मारा ladke ko ladkii ne mara (d) मारा लडके को लडक(cid:551) ने mara ladke ko ladkii ne (e) लडके को म ारा लडक(cid:551) ने ladke ko mara ladkii ne (f) लडक(cid:551) ने मारा लडके को ladkii ne mara ladke ko Figure 1: Simple Hindi Test Sentence with various variations [19] (a) जो खड़ी है वो लडक(cid:551) ल ंबी है jo khar i hai vo ladkii lambii hai Rel standing be Co-Rel girl tall is (b) जो लडक(cid:551) खड़ी है वो ल ंबी है jo ladkii khar i hai vo lambii hai (c) वो लडक(cid:551) ल ंबी है जो खड़ी है vo ladkii khar i hai jo lambii hai (d) * वो लडक(cid:551) ल ंबी है जो लडक(cid:551) खड़ी है vo ladkii lambi hai jo ladkii khari hai (e) * वो ल ंबी है जो लडक(cid:551) खड़ी है vo lambi hai jo ladkii khari hai (f) वो लडक(cid:551) जो खड़ी है ल ंबी है vo ladkii jo khar i hai lambii hai (g) * वो जो लडक(cid:551) खड़ी है ल ंबी है vo jo ladkii khar i hai lambii hai Figure 2: Simple Hindi Test Sentence with various variations [19] LFG and DG had no problems to handle these type of sen tences. We used Lexicalized TAG (LTAG) which is the modification of TAG and can handle word order variation . We did this study using ten grammar writes, which were provided with the sentences and were asked to construct the grammars for each sen tence. In order to understand the usability of each grammar , we provided each writer with 35 sen tences from various categor ies, as discussed above. Each wr iter was provided with a short tutor ial of each grammar . Shor tly after the tutor ial of a par ticular grammar , the writers were asked to implement the sen tences for the said grammar . Their performance was calculated on the measure discussed above. Writer PG Acc. 74% TAG Acc. 71% 84% LFG Acc. 61% W2 73% 64% 66% 93% 88% 94% 98% 60% 83% 88% W5 W5 W3 W4 8 min 79% 8 min 80% W1 Dur. 9 min 10 min 13 min 17 min 9 min Dur. Dur. 41 28 min min 43 31 min min 48 27 min min 56 35 min min 61 36 min min 67 37 min min 71 38 min min 59 39 min min 55 35 min min 59 34 min min 68.5 56 86.0 34 81.9 Average 10.3 min % min % min % Table 1: Total Time Taken and Accuracy Achieved by Each Grammar Writer 11 min 11 min 7 min W10 W7 W8 W9 89% 73% 97% 93% 95% 70% 83% 87% 67% 69% 62% 73% 71% 79 % Task Difficulty PG TAG LFG Basic Sentences 1 (8) 2 (7) 3(9) Auxiliary Verbs 3 (9) 4 (8) 2 (9) Case Assigning PPs 4 (7) 3 (8) 4 (6) Adpositional Sentences 4 (6) 3 (9) 4 (7) Descriptive Adjectives 3 (8) 2 (7) 4 (7) Genitive Case 2 (9) 3 (7) 4 (6) Predictive Adjectives 2 (8) 3 (7) 4 (7) Relative Clause 5 (8) 4 (7) 5 (8) Table 2: Highest Voted Ranks by Grammar Writers for each grammar 4. RESULTS We calculated the results for total and average time taken to complete the task, accuracy with wh ich the task was completed, difficulty ratings provided by each wr iter, for each formalism, on different categor ies of sentences. The types of errors committed. The results of the study are provided in the following sections. 4.1 Time Taken and Accuracy Table 1 summar izes the average time taken to complete the task by each wr iter and the accuracy with wh ich they did it. Looking at the data, it is clearly seen that time taken to complete the task was least in PG and most in LFG, TAG was in between the two. The average time taken by the writers to complete the task for PG, TAG and LFG is 10.3 min, 34 min and 56 min respectively. PG took least time with which the sen tences were completed. We also measured average accuracy of each wr iter . Here TAG scored more accuracy then the other formalisms. 4.2 Difficulty Rating After the task, we provided the questionnaire to the writers. We asked them to provide us with the difficulty rating for each type of sen tence, for each grammar . We asked them to ranks the difficulty of sentences between 1 and 5, where 1 being the easiest and 5 being the toughest. As it was not possible to provide results for all the wr ites here. In Table 2, we provide the ranks given major ity of wr iters. The sores without brackets are the ranks given and the ones in bracket are the no. of wr iters who gave this rank. We can see that PG sores very well in simple, generative and predictive adjective cases, but do not perform well on other categories of the sentences. TAG on the other hand performs moderately well. It sores highest in four categor ies of sentences. LFG scores highest in just one. 4.3 Error Analysis We also examined the types of errors committed by differen t formalisms, as we wan ted to know, why writer had great difficulty with LFG as compared to PG or TAG. In Paninian Grammar , we analyzed that wr iters faced great difficulty in assigning relationsh ips to dependency structures. Th is could be due to the notational convention of the formalism or due to the difficulty with the concepts of head and dependents. We also saw that whenever a directional error was made, the correct rule was framed for implemen ting the that the dependency. Th is shows difficulty was with the notion and not with the concepts. Moreover PG although being least r igorous out of the th ree, showed some sluggishness while dealing with complex sen tences. In Tree Adjoining Grammar , we saw that most errors were in the formation of the der ived trees. Between adjunction and substitution operations, adjunction proved to be more error prone. Almost 80% errors were made due to incorrect adjunction operation. This shows tha t wr iters had great difficulty understanding the adjunction operation. In Lexical Functional Grammar, we saw that grammar wr iter’s had great difficulty in associating features with constituent structures. In some cases the writers got confused as to use noun phrase and verb phrase in constituent structure or to use subject and predicate in feature structure. Although this formalism is the most perfect in terms of linguistic phenomena as it captures all the aspects of the language’s grammar, it is also fair ly difficulty to understand, as it takes time for the grammar wr ite to understand and implemen t grammar using it. 5. CONCLUSION We wanted to study the applicability of differen t grammar formalism on Indian languages, so that different NLP tasks like development of a deep probabilistic parser or developmen t of a Treebank could be under taken . In doing so, we gathered insigh ts into the differen t formalisms and understood the merits and demerits of each . We found out that though Pan inain Grammar was preferred for simple sentences, overall performance of TAG was good. It scored better in the average accuracy attained to wr ite the sentences. Although this is a preliminary study and more in-depth evaluations are required before making any sound conclusions. But, with some con fidence we can say that TAG can perform better in most of the difficult cases as compared to dependency grammar . [1]. [2]. 6. REFERENCES J.G. Neal, E.L. Feit and C.A. Montgomery, “Benchmark Investigation/Identification Project,” Machine Translation, Springer, Germany, Vol 8, No. 1-2, pp77-84, 1993. T. Baldwin, J. Beavers, E.M. Bender, D. Flickinger, A. Kim, and S. Oepen, “Beauty and the beast: What running a broad-coverage precision grammar over thee bnc taught us about the grammar — and the corpus,” Linguistic Evidence: Empirical, Theoretical, and Computational Perspectives, Mouton de Gruyter, Berlin, Germany, pp 49–70., 2005. [7]. [8]. [9]. [3]. [4]. [5]. [6]. S. A. Waterman, “Distributed parse mining,” In Proceedings of the NAACL Workshop on Software Engineering, Testing, and Quality Assurance for Natural Language Processing, USA, 2009. C.D. Manning and H Schütze, “Foundations of Statistical Natural Language Processing”, MIT Press, USA, 1999. E. Charniak, “A Maximum Entropy Inspired Parser”, In Proceedings of NAACL, USA, 2000. J. Nivre, J. Hall and J. Nilsson, “MaltParser: A Data- Driven Parser-Generator for Dependency Parsing,” In Proceedings of the fifth international conference on Language Resources and Evaluation, Genoa, Italy, pp. 2216-2219, May, 2006. A Taylor, A. Warner and B. Santorini, “The Penn Treebank: An Overview”, Treebanks: Building and Using Parsed Corpora, Kluwer Academic Publishers, Netherlands, 2003. S. Brants, S. Dipper, P. Eisenberg, S. Hansen, E. König, W. Lezius, C. Rohrer, G. Smith, and H. Uszkoreit, “TIGER: Linguistic interpretation of a German corpus,” Research on Language and Computation, Springer, Germany, Vol 9, No. 2, pp 597-620, 2004. J Hajič, B Hladká and P. Pajas, “ The Prague Dependency Treebank: Annotation Structure and Support,” In Proceedings of the IRCS Workshop on Linguistic Databases, Pennsylvania, USA, pp 105-114, 2001. [10]. M. Covington, “Parsing Discontinuous Constituents Dependency in Dependency Grammar,” Computational Linguistics, MIT Press, USA, Vol 16, No. 4, pp-234-236, 1990 [11]. R. Sangal and V Chaitanya, “An Intermediate Language for Machine Translation: An approach based on Sanskrit using conceptual graph notation”, Journal of Computer Society of India, Mumbai, India, Vol 17, pp 9-21, 1987. A.K. Joshi, “An Introduction to Tree Adjoining Grammars,” Mathematics of Language, John Benjamins, Netherlands, 1987. I.A. Sag, T Wasow and E.M. Bender, “Syntactic Theory,” 2 Edition, CSLI Publications, USA, 2001. [14]. M. Dalrymple, “Lexical Functional Grammar: Syntax and Semantics”, Academic Press, USA, 2001. [15]. H. Gaifman, “Dependency systems and phrase structure systems,” Information and Control, USA, Vol 8, pp 304- 337, 1965. J. Hudson, “Word Grammar,” Basil Blackwell, England, 1984. S. Starosta, “The Case for Lexicase: An Outline of Lexicase Grammatical Theory,” Cassell, London, 1988. [18]. A. Bharti, V. Chaitanya, R. Sangal, “Natural Language Processing: A Paninian Perspective,” PHI, India, 1999. [19]. V. Dwivedi, “Tropicalization the in Hindi and Correlative Construction,” Theoretical Perspectives on Word Order in South Asian Languages, CSLI Publications, USA, 1994. [12]. [13]. [16]. [17].
1902.10126
2
1902
2019-03-21T08:43:35
BUT-FIT at SemEval-2019 Task 7: Determining the Rumour Stance with Pre-Trained Deep Bidirectional Transformers
[ "cs.CL", "cs.AI", "cs.LG", "stat.ML" ]
This paper describes our system submitted to SemEval 2019 Task 7: RumourEval 2019: Determining Rumour Veracity and Support for Rumours, Subtask A (Gorrell et al., 2019). The challenge focused on classifying whether posts from Twitter and Reddit support, deny, query, or comment a hidden rumour, truthfulness of which is the topic of an underlying discussion thread. We formulate the problem as a stance classification, determining the rumour stance of a post with respect to the previous thread post and the source thread post. The recent BERT architecture was employed to build an end-to-end system which has reached the F1 score of 61.67% on the provided test data. It finished at the 2nd place in the competition, without any hand-crafted features, only 0.2% behind the winner.
cs.CL
cs
BUT-FIT at SemEval-2019 Task 7: Determining the Rumour Stance with Pre-Trained Deep Bidirectional Transformers Martin Fajcik, Luk´as Burget, Pavel Smrz Brno University of Technology, Faculty of Information Technology 612 66 Brno, Czech Republic {ifajcik,burget,smrz}@fit.vutbr.cz 9 1 0 2 r a M 1 2 ] L C . s c [ 2 v 6 2 1 0 1 . 2 0 9 1 : v i X r a Abstract This paper describes our system submitted to SemEval 2019 Task 7: RumourEval 2019: De- termining Rumour Veracity and Support for Rumours, Subtask A (Gorrell et al., 2019). The challenge focused on classifying whether posts from Twitter and Reddit support, deny, query, or comment a hidden rumour, truthful- ness of which is the topic of an underlying dis- cussion thread. We formulate the problem as a stance classification, determining the rumour stance of a post with respect to the previous thread post and the source thread post. The re- cent BERT architecture was employed to build an end-to-end system which has reached the F1 score of 61.67 % on the provided test data. It finished at the 2nd place in the competition, without any hand-crafted features, only 0.2 % behind the winner. Introduction 1 Fighting false rumours at the internet is a tedious task. Sometimes, even understanding what an ac- tual rumour is about may prove challenging. And only then one can actually judge its veracity with an appropriate evidence. The works of (Ferreira and Vlachos, 2016; Enayet and El-Beltagy, 2017) focused on prediction of rumour veracity in thread discussions. These works indicated that the verac- ity is correlated with stances of the discussion par- ticipants towards the rumour. Following this as- sumption, the participants of the SubTask A in the SemEval competition Task 7 were asked to clas- sify whether the stance of each post in a given Twitter or Reddit thread supports, denies, queries or comments hidden rumour. Potential applica- tions of such a function are wide, ranging from an analysis of popular events (political discussions, academy awards, etc.) to quickly disproving fake news during disasters. Stance classification (SC) in its traditional form is concerned with determining the attitude of a towards a target source text text (Mohammad et al., 2016) and it has been studied thoroughly for discussion threads (Walker et al., 2012; Hasan and Ng, 2013; Chuang and Hsieh, 2015). However, the objective of SemEval 2019 Task 7 is to determine the stance to hidden rumour which is not explic- itly given (it can be often inferred from the source post of the discussion -- the root of the tree-shaped discussion thread -- as demonstrated in Figure 1). The competitors were asked to classify the stance of the source post itself too. Figure 1: An example of discussion's source post denying the actual rumour which is present in the source post -- annotated with the red cursive The approach followed in our work builds on re- cent advances in language representation models. We fine-tune the pre-trained end-to-end Bidirec- tional Encoder Representations from Transform- ers (BERT) model (Devlin et al., 2018), while us- ing the discussion's source post, target's previous post and the target post itself as inputs to deter- mine the rumour stance of the target post. Our implementation is available online.1 2 Related Work Previous SemEval competitions: In recent years, there were two SemEval competitions targeting the stance classification. The first one focused on the setting in which the actual rumour was pro- vided (Mohammad et al., 2016). The organizers of SemEval-2016 Task 6 prepared a benchmarking system based on SVM using hand-made features and word embeddings from their previous system for sentiment analysis (Mohammad et al., 2013), outperfoming all the challenge participants. 1www.github.com/MFajcik/RumourEval2019 .@AP I demand you retract the lie that people in #Ferguson were shouting "kill the police", local reporting has refuted your ugly racism The second was previous RumourEval compe- tition won by a system based on word vectors, handcrafted features2 and an LSTM (Hochreiter and Schmidhuber, 1997) summarizing informa- tion of the discussion's branches (Kochkina et al., 2017). Other submissions were either based on similar handcrafted features (Singh et al., 2017; Wang et al., 2017; Enayet and El-Beltagy, 2017), features based on sets of words for determining language cues such as Belief or Denial (Bahuleyan and Vechtomova, 2017), post-processing via rule- based heuristics after the feature-based classifica- tion (Srivastava et al., 2017), Convolutional Neu- ral Networks (CNNs) with rules (Lozano et al., 2017), or end-to-end CNNs that jointly learnt word embeddings (Chen et al., 2017). End-to-End approaches: (Augenstein et al., 2016) encodes the target text by means of a bidi- rectional LSTM (BiLSTM), conditioned on the source text and empirically shows that the condi- tioning on the source text matters. (Du et al., 2017) proposes target augmented embeddings -- embed- dings concatenated with an average of the source text embeddings and applies these to compute an attention based on the weighted sum of the target embeddings that were previously transformed via the BiLSTM. (Mohtarami et al., 2018) proposes an architecture that encodes the source and the target text via a LSTM and a CNN separately and then uses a memory network together with a similarity matrix to capture the similarity between the source and the target text, and infers a fixed-size vector suitable for the stance prediction. 3 Dataset Provided dataset was collected from Twitter and Reddit tree-shaped discussions. The stance labels were obtained via crowdsourcing. The Twitter dis- cussions are based on recent popular topics -- Syd- ney siege, Germanwings crash etc. and there are 9 total topics covered in the training data. The Twit- ter part of test data contains different topics. The Reddit discussions cover various topics and the discussions are in most cases not related to each other. We provide a deeper insight at dataset in Appendix A.1. 2The features included: a flag indicating whether a tweet is a source tweet of a conversation, the length of the tweet, an indicator of the presence of urls and images, punctuation, cosine distance to source tweet and all other tweets in the conversation, the count of negation and swear words, and an average of word vectors corresponding to the tweet. S train 925 in % 18 dev 102 in % 7 test 157 in % 9 D 378 7 82 6 101 6 Q 395 8 120 8 93 5 C 3519 67 1181 80 1476 81 Total 5217 1485 1827 Histogram and distribution of exam- Table 1: ples through classes in the train/dev/test dataset splits. The individual examples belong into 327/38/81 train/dev/test tree-structured discussions. 4 BUT-FIT's System Description 4.1 Preprocessing We replace URLs and mentions with special tokens $U RL$ and $mention$ using tweet- processor3. We use spaCy4 to split each post into sentences and add [EOS] token to terminate each sentence. Then we use tokenizer that comes with Hugging Face pytorch re-implementation of BERT5. The tokenizer lowercases the input and applies the WordPiece encoding (Wu et al., 2016) to split input words into most frequent n-grams present in the pre-training corpus, effectively rep- resenting text at the sub-word level while keeping only 30,000 token vocabulary. 4.2 Model Following the recent trend in transfer learning from language models (LM), we employ the pre- trained BERT model. The model is first trained on the concatenation of BooksCorpus (800M words) (Zhu et al., 2015) and English Wikipedia (2,500M words) using the multi-task objective consisting of LM and machine comprehension (MC) sub- objectives. The LM objective aims at predict- ing the identity of 15% randomly masked to- kens present at the input6. Given two sentences from the corpus, the MC objective is to clas- sify whether the second sentence follows the first sentence in the corpus. The sentence is re- placed randomly in half of the cases. During the pre-training, the input consists of two docu- ments, each represented as a sequence of tokens 3https://github.com/s/preprocessor 4https://spacy.io/ 5https://github.com/huggingface/ pytorch-pretrained-BERT 6The explanation of token masking is simplified and we refer readers to read details in the original paper (Devlin et al., 2018). Figure 2: An architecture of BUT-FIT's system. Text segment containing document1 is annotated with green color, segment that contains document2 (target post) is annotated with blue cursive. The input representation is obtained by summing the input embedding matrices E = Et + Es + Ep ∈ RL×d, with L being the input length and d input dimensionality. The input is passed N times via transformer encoder. Finally, the [CLS]-token level output is fed via two dense layers yielding the class predictions. divided by special [SEP ] token and preceeded by [CLS] token used by the MC objective, i.e. [CLS]document1[SEP ]document2[SEP ]. The input tokens are represented via jointly learned to- ken embeddings Et, segment embeddings Es cap- turing whether the word belongs into document1 or document2 and positional embeddings Ep since self-attention is position-invariant operation (see (Devlin et al., 2018) for details). In our solution, we follow the assumption that the stance of the discussion's post depends only on itself, the source thread post and previous thread post. Since the original input is composed of two documents, we experimented with various ways of encoding the input (Section 6) ending up with just a concatenation of source and previous post as document1 (left empty in case of source post be- ing the target post) and target post as document2. The discriminative fine-tuning of BERT is done using the [CLS]-token level output and passing it via two dense layers yielding the posterior prob- abilities as depicted in Figure 2. Weighted cross- entropy loss is used to ensure the flat prior over the classes. 4.3 Ensembling Before submission we trained 100 models, which differed just by learning rate. We experimented with 4 different system fusions in order to increase F1 measure and compensate for overfitting: TOP-N fusion chose 1 model randomly to add into the ensemble, then randomly shuffled the rest and tried adding them into ensemble one at the time, while iteratively calculating ensemble's F1 by av- eraging the output probabilities to approximate the bayesian model averaging. If adding model into ensemble increased the F1, model has been per- manently included in the ensemble. The process has been repeated until no further model improv- ing the ensemble's F1 has been found. This re- sulted into set of 17 best models. EXC-N fusion chose all models into the ensemble and then iterativly dropped one model at the time s.t. dropping it resulted in the largest increase of the ensemble's F1, stopping when dropping any ensemble's model did not increased the F1. Using this approach, we ended up using 94 models. TOP-Ns is analogous to TOP-N fusion, but we average the pre-softmax scores instead of output class probabilities. OPT-F1 fusion aims at learning weights summing up to 1 for weighted average of the output prob- abilities from models selected via the procedure used in TOP-N. The weights are estimated using modified Powell's method from SciPy to maxi- mize the F1 score on dev data. 5 Experimental Setup We implemented our models in pytorch, where we use Hugging Face re-implementation (Footnote 5) in "bert-large-uncased" setting pre-trained with 24 transformer layers, hidden unit size of d = 1024, 16 attention heads and 335M parameters. When building an ensemble, we picked the learn- ing rates from the interval [1e−6, 2e−6]. Each epoch, we iterate over dataset in an ordered man- [CLS] oh sweet and whole ##some red ##dit , is it true us citizens have to pay to use us dollar bills as currency ? [ e ##os ] to use a dollar bill - no . . . . behind the scene taxes / fees - of course ! [ e ##os ] cu ##z . . . ' mu ##rica [ e ##os ] [SEP] no , like we are tax ##ed as a country to use the usd [ e ##os ] [SEP]Encoded InputTransformer EncoderN timesDense/TanhDense/SoftmaxToken embeddingsPositional embeddingsSegment embeddings++Pre-trained parameters[CLS]-token level output Branch-LSTM FeaturesNN BiLSTM+SelfAtt BERTbase BERTbig−noprev BERTbig−nosrc BERTbig BERTbig EXC-N∗ BERTbig TOP-N∗ BERTbig OPT-F1 BERTbig TOP-Ns - Acctest macro F1dev #Θ 453K 84.10 45.46 ± 1e−2 205K 82.84 47.55 ± 6e−3 28M 83.59 51.40 ± 1e−2 109M 84.67 52.61 ± 2e−2 335M 84.33 53.72 ± 2e−2 335M 84.51 56.24 ± 9e−3 335M 84.08 85.50 85.22 85.39 85.50 58.63 62.58 62.68 61.73 - - - - 49.30 macro F1test 44.55 ± 2e−2 46.81 ± 6e−3 53.39 ± 3e−2 52.91 ± 4e−2 55.13 ± 3e−3 56.70 ± 3e−2 60.28 60.67 61.27 61.67 F1S 43.80 40.29 42.21 43.49 42.37 43.02 44.29 48.89 48.25 48.03 49.11 F1Q 55.00 40.12 45.20 59.88 55.17 56.93 57.07 62.80 62.86 62.26 64.45 F1D 7.10 17.69 17.75 18.42 24.44 26.53 35.02 37.50 39.74 42.77 41.29 F1C 91.30 80.43 81.92 90.36 90.15 90.51 90.41 91.94 91.83 92.01 91.84 Table 2: Our achieved results. Results for single model were obtained by training at least 10 models and we report mean and standard deviation for these. #Θ denotes the number of parameters. The columns F1S through F1C contain individual F1 scores for problem classes. All ensemble models are optimized for F1-score on dev data. BiLSTM+SelfAtt contains 4.2M parameters without pre-trained BERT embeddings. BERTbig−nosrc and BERTbig−noprev denote ablations with empty source or target post respectively. Note that the accuracy is biased towards different training data prior as shown in Table 1. Our SemEval submissions are denoted with ∗. Winning BLCU-nlp system achieved 61.87 F1 score on test data. More available at http://tinyurl.com/y3m5mskd. ner, starting with shortest sequence as we found this to be helpful. We truncate sequences at max- imum length l = 200 with a heuristic -- firstly we truncate the document1 to length l/2, if that is not enough, then we truncate the document2 to the same size. We kept batch size at 32 and keep other hyperparameters the same as in BERT paper. We use the same Adam optimizer with L2 weight de- cay of 0.01 and no warmup. We trained the model on GeForce RTX 2080 Ti GPU. and the model complexity. To counteract, we de- cided to discard all the models with less than 55 F1 score on dev data and we averaged the output class probability distributions when ensembling. Our initial experiments used sequences up to length 512, but we found no difference when truncating them down to 200. 6 Results and Analysis We compare our solution with three baselines. The first is branch-LSTM baseline provided by the task organizers7 -- inspired by the winning sys- tem of RumourEval 2017. The second baseline (FeaturesNN) is our re-implementation of first baseline in pytorch without LSTM -- posts are clas- sified via 2 layer network (ReLU/Softmax) only by features named in Footnote 2. In the third case (BiLSTM+SelfAtt), we used the same in- put representation as our submitted model, but re- placed BERT with 1-layer BiLSTM followed by self-attention and a softmax layer as proposed by (Lin et al., 2017), except the orthogonality con- straint is not used as we did not found it helpful. The results are shown in Table 2. Our BERT models encountered high variance of the results during the training. We assume the cause of this might be the problem difficulty, small training set 7http://tinyurl.com/y4p5ygn7 What features weren't helpful: We tried adding a number of features to the pooled output (after dense/tanh layer) including positive, neutral and negative sentiment and all the features used by FeaturesNN baseline. We also tried adding jointly learned POS, NER and dependency tag em- beddings as well as third segment embedding8 or explicit [SEP ] token to separate source and pre- vious post in BERT's input without observing any improvement. 7 Conclusion Our approach achieves 61.67 macro F1 score im- proving over baseline by 12.37%, while using only discussion's source post, previous post and the tar- get post to classify the target post's stance to ru- mour. In our case study, we noticed that few ex- amples are not answerable by human while using only these information sources. Therefore, in fu- ture we would like to extend our system with rele- vance scoring system, scoring the all discussion's posts and picking up the most relevant ones to pre- serve the context of understanding. 8We tried adding the learned representations to the input the same way the segment/positional embeddings are added. Acknowledgments This work was supported by [Acknowledgments will be filled upon acceptance.] References Isabelle Augenstein, Tim Rocktaschel, Andreas Vla- chos, and Kalina Bontcheva. 2016. Stance detec- tion with bidirectional conditional encoding. arXiv preprint arXiv:1606.05464. Hareesh Bahuleyan and Olga Vechtomova. 2017. Uwaterloo at semeval-2017 task 8: Detecting stance towards rumours with topic independent features. In Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval-2017), pages 461 -- 464. Yi-Chin Chen, Zhao-Yang Liu, and Hung-Yu Kao. 2017. Ikm at semeval-2017 task 8: Convolutional neural networks for stance detection and rumor ver- In Proceedings of the 11th International ification. Workshop on Semantic Evaluation (SemEval-2017), pages 465 -- 469. Ju-han Chuang and Shukai Hsieh. 2015. Stance clas- In 29th Pacific Asia sification on ptt comments. Conference on Language, Information and Compu- tation Proceedings of PACLIC 2015: Poster Papers, page 27. 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. Jiachen Du, Ruifeng Xu, Yulan He, and Lin Gui. 2017. Stance classification with target-specific neural at- tention networks. International Joint Conferences on Artificial Intelligence. Omar Enayet and Samhaa R El-Beltagy. 2017. Niletmrg at semeval-2017 task 8: Determining ru- mour and veracity support for rumours on twitter. In Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval-2017), pages 470 -- 474. William Ferreira and Andreas Vlachos. 2016. Emer- gent: a novel data-set for stance classification. In Proceedings of the 2016 conference of the North American chapter of the association for computa- tional linguistics: Human language technologies, pages 1163 -- 1168. Genevieve Gorrell, Kalina Bontcheva, Leon Derczyn- ski, Elena Kochkina, Maria Liakata, and Arkaitz Zu- biaga. 2019. SemEval-2019 Task 7: RumourEval: Determining rumour veracity and support for ru- mours. In Proceedings of SemEval. ACL. Kazi Saidul Hasan and Vincent Ng. 2013. Stance classification of ideological debates: Data, mod- In Proceedings of els, features, and constraints. the Sixth International Joint Conference on Natural Language Processing, pages 1348 -- 1356. Sepp Hochreiter and Jurgen Schmidhuber. 1997. Neural computation, Long short-term memory. 9(8):1735 -- 1780. Elena Kochkina, Maria Liakata, and Isabelle Augen- stein. 2017. Turing at semeval-2017 task 8: Sequen- tial approach to rumour stance classification with branch-lstm. arXiv preprint arXiv:1704.07221. Zhouhan Lin, Minwei Feng, Cicero Nogueira dos San- tos, Mo Yu, Bing Xiang, Bowen Zhou, and Yoshua Bengio. 2017. A structured self-attentive sentence embedding. arXiv preprint arXiv:1703.03130. Marianela Garc´ıa Lozano, Hanna Lilja, Edward Tjornhammar, and Maja Karasalo. 2017. Mama edha at semeval-2017 task 8: Stance classifica- In Proceedings of the tion with cnn and rules. 11th International Workshop on Semantic Evalua- tion (SemEval-2017), pages 481 -- 485. Saif Mohammad, Svetlana Kiritchenko, Parinaz Sob- hani, Xiaodan Zhu, and Colin Cherry. 2016. Semeval-2016 task 6: Detecting stance in tweets. In Proceedings of the 10th International Workshop on Semantic Evaluation (SemEval-2016), pages 31 -- 41. Saif M. Mohammad, Svetlana Kiritchenko, and Xiao- dan Zhu. 2013. Nrc-canada: Building the state- In Pro- of-the-art in sentiment analysis of tweets. ceedings of the seventh international workshop on Semantic Evaluation Exercises (SemEval-2013), At- lanta, Georgia, USA. Mitra Mohtarami, Ramy Baly, James Glass, Preslav Nakov, Llu´ıs M`arquez, and Alessandro Mos- chitti. 2018. Automatic stance detection using arXiv preprint end-to-end memory networks. arXiv:1804.07581. Vikram Singh, Sunny Narayan, Md Shad Akhtar, Asif Ekbal, and Pushpak Bhattacharyya. 2017. Iitp at semeval-2017 task 8: A supervised approach the for rumour evaluation. 11th International Workshop on Semantic Evalua- tion (SemEval-2017), pages 497 -- 501. In Proceedings of Ankit Srivastava, Georg Rehm, and Julian Moreno Schneider. 2017. Dfki-dkt at semeval-2017 task 8: Rumour detection and classification using cascading heuristics. In Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval-2017), pages 486 -- 490. Marilyn A Walker, Pranav Anand, Robert Abbott, and Ricky Grant. 2012. Stance classification using di- In Proceedings of alogic properties of persuasion. the 2012 conference of the North American chap- ter of the association for computational linguistics: Human language technologies, pages 592 -- 596. As- sociation for Computational Linguistics. Cause wow, It almost looks like one!", officialy la- belled in the test data as a comment, but we believe it might be a query as well. A.2 Additional Introspection The following figures 3, 4, 5, 6 contain selected in- sights at the attention matrices A from multi-head attention defined as (1), where Q, K ∈ RL×dk are matrices containing query/value vectors and dk is the key/value dimension. The insights are selected from the heads at the first layer of transformer en- coder. A = QK(cid:62)√ dk (1) Feixiang Wang, Man Lan, and Yuanbin Wu. 2017. Ecnu at semeval-2017 task 8: Rumour evaluation using effective features and supervised ensemble In Proceedings of the 11th International models. Workshop on Semantic Evaluation (SemEval-2017), pages 491 -- 496. 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. Yukun Zhu, Ryan Kiros, Rich Zemel, Ruslan Salakhut- dinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. 2015. Aligning books and movies: Towards story-like visual explanations by watching movies In Proceedings of the IEEE and reading books. international conference on computer vision, pages 19 -- 27. A Supplemental Material A.1 Dataset Insights For each discussion from Twitter and Reddit, the dataset contains its whole tree structure and meta- data, which are different for both sites (e.g. up- votes in Reddit). When analyzing the data, we also uncovered a few anomalies: 12 data points to do not contain any text and according to or- ganizers they were deleted by users at the time of download and been left it in place so as not to break the conversational structure, the query stance of few examples taken from subreddit De- bunkThis9 is strictly dependent on domain knowl- edge and the strict class of some examples is amib- gious and they should probably be labelled with multiple classes. A.1.1 Domain knowledge dependency Examples from subreddit DebunkThis have all the same format "Debunk this: [statement]", e.g. "Debunk this: Nicotine isn't really bad for you, and it's the other substances that makes tobacco so harmful.". All these examples are labelled as queries. instance source/previous post "This A.1.2 Class ambiguity is For crazy! #CapeTown #capestorm #weatherfore- cast https://t.co/3bcKOKrCJB" and target post "@RyGuySA Oh my gosh! Is that not a tornado?! 9https://www.reddit.com/r/DebunkThis/ Figure 3: Intra-segment attention -- the attention is made only between the subword units from the same segment. Figure 4: Attention matrix capturing the subword similarity. Figure 5: 'Soft' local context aggregation. Figure 6: 'Hard' local context aggregation -- the signal is mostly sent further to another transformer encoder layer.
1901.01695
1
1901
2019-01-07T08:03:35
Vector representations of text data in deep learning
[ "cs.CL", "cs.LG" ]
In this dissertation we report results of our research on dense distributed representations of text data. We propose two novel neural models for learning such representations. The first model learns representations at the document level, while the second model learns word-level representations. For document-level representations we propose Binary Paragraph Vector: a neural network models for learning binary representations of text documents, which can be used for fast document retrieval. We provide a thorough evaluation of these models and demonstrate that they outperform the seminal method in the field in the information retrieval task. We also report strong results in transfer learning settings, where our models are trained on a generic text corpus and then used to infer codes for documents from a domain-specific dataset. In contrast to previously proposed approaches, Binary Paragraph Vector models learn embeddings directly from raw text data. For word-level representations we propose Disambiguated Skip-gram: a neural network model for learning multi-sense word embeddings. Representations learned by this model can be used in downstream tasks, like part-of-speech tagging or identification of semantic relations. In the word sense induction task Disambiguated Skip-gram outperforms state-of-the-art models on three out of four benchmarks datasets. Our model has an elegant probabilistic interpretation. Furthermore, unlike previous models of this kind, it is differentiable with respect to all its parameters and can be trained with backpropagation. In addition to quantitative results, we present qualitative evaluation of Disambiguated Skip-gram, including two-dimensional visualisations of selected word-sense embeddings.
cs.CL
cs
AGH University of Science and Technology Faculty of Computer Science, Electronics and Telecommunications Department of Computer Science Doctoral dissertation Vector representations of text data in deep learning Karol Grzegorczyk Advisor: Professor Witold Dzwinel, PhD, DSc Co-advisor: Marcin Kurdziel, PhD Kraków, 2018 Abstract In this dissertation we report results of our research on dense distributed repre- sentations of text data. We propose two novel neural models for learning such representations. The first model learns representations at the document level, while the second model learns word-level representations. For document-level representations we propose Binary Paragraph Vector: a neural network models for learning binary representations of text documents, which can be used for fast document retrieval. We provide a thorough evalua- tion of these models and demonstrate that they outperform the seminal method in the field in the information retrieval task. We also report strong results in trans- fer learning settings, where our models are trained on a generic text corpus and then used to infer codes for documents from a domain-specific dataset. Finally, we propose a model that jointly learns short binary codes and high-dimensional real-valued representations. This model can be used for rapid retrieval of docu- ments highly relevant to the query. In contrast to previously proposed approaches, Binary Paragraph Vector models learn embeddings directly from raw text data. Thus far, the most common way of building binary document representations was to use a data-oblivious locality sensitive hashing method on top of some interme- diate text representation. For word-level representations we propose Disambiguated Skip-gram: a neural network model for learning multi-sense word embeddings. Representations learned by this model can be used in downstream tasks, like part-of-speech tagging or iden- tification of semantic relations. In the word sense induction task Disambiguated Skip-gram outperforms state-of-the-art models on three out of four benchmarks datasets. Our model has an elegant probabilistic interpretation. Furthermore, unlike previous models of this kind, it is differentiable with respect to all its pa- rameters and can be trained with backpropagation. Disambiguated Skip-gram is parametric, i.e. the number of word senses must be specified a priori. That said, we describe and evaluate a pruning strategy that discards word senses with low marginal probabilities. We also introduce a regularization term that influence the expected number of senses. In addition to quantitative results, we present qualitative evaluation of Disambiguated Skip-gram, including two-dimensional vi- sualisations of selected word-sense embeddings. The dissertation opens with a review of background works and closes with a summary of our contributions and a discussion of possible directions for future research. In the appendix we describe datasets and software libraries that were used to conduct the experiments, as well as works that were carried out for this dissertation but did not yield as strong results as the one described in the core chapters. Acknowledgements I would like to thank my advisor Professor Witold Dzwinel for overall guidance and support, my co-advisor Marcin Kurdziel for countless hours spent explain- ing difficult concepts to me and recommending new research directions, Professor Krzysztof Zieliński for introducing me to academia and a fellow PhD candidate Piotr Wójcik for collaboration on a few research papers. This research was supported by National Science Centre, Poland grant no. 2013/09/B/ST6/01549 "Interactive Visual Text Analytics (IVTA): Develop- ment of novel, user-driven text mining and visualization methods for large text corpora exploration". This research was carried out with the support of the "HPC Infrastructure for Grand Challenges of Science and Engineering" Project, co-financed by the European Regional Development Fund under the Innovative Economy Operational Programme. Last but not least, I would like to thank my immediate family for their love. Contents List of Tables List of Figures 1 Introduction 1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Contributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 5 6 7 8 2 Background and related works 2.1.1 Training a supervised machine learning model 2.3 Neural network-based text representations 2.1 Selected concepts in machine learning . . . . . . . . . . . . . . . . . 9 9 . . . . . . . . 10 2.2 Vector representations of text data . . . . . . . . . . . . . . . . . . 12 2.2.1 Vector Space Model . . . . . . . . . . . . . . . . . . . . . . . 13 2.2.2 Bag-of-words model . . . . . . . . . . . . . . . . . . . . . . . 13 2.2.3 Topic modeling . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.2.4 Word Sense Disambiguation . . . . . . . . . . . . . . . . . . 16 . . . . . . . . . . . . . . 17 2.3.1 Artificial neural networks . . . . . . . . . . . . . . . . . . . . 17 2.3.2 Neural network training . . . . . . . . . . . . . . . . . . . . 20 2.3.3 Undirected topic models . . . . . . . . . . . . . . . . . . . . 21 2.3.4 Word embeddings . . . . . . . . . . . . . . . . . . . . . . . . 21 2.3.5 Applications of word embeddings to non-NLP domains . . . 24 2.3.6 Multi-sense word embeddings . . . . . . . . . . . . . . . . . 25 2.3.7 Paragraph and document embeddings . . . . . . . . . . . . . 27 2.4 Deep learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 . . . . . . . . . . . . . . . . . . . . . . . 29 . . . . . . . . . . . . . . . . . . . . . . . . 31 2.5 Cluster analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 2.6 Novel vector representation of text data . . . . . . . . . . . . . . . . 33 2.4.1 Deep architectures 2.4.2 Thought Vectors 3 Binary Paragraph Vector models 34 3.1 Model architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 3.1.1 Distributed bag of n-grams . . . . . . . . . . . . . . . . . . . 36 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . 37 3.1.2 3.2 Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 3.2.1 Information retrieval metrics . . . . . . . . . . . . . . . . . . 39 3.2.2 20 Newsgroups . . . . . . . . . . . . . . . . . . . . . . . . . 40 3.2.3 RCV1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 3.2.4 English Wikipedia . . . . . . . . . . . . . . . . . . . . . . . 46 1 3.2.5 Comparison of binarization methods . . . . . . . . . . . . . 48 3.2.6 Comparison against indirect hashing approaches . . . . . . . 50 3.2.7 Transfer learning . . . . . . . . . . . . . . . . . . . . . . . . 51 . . . . . . . . . . . . . . . . . 53 3.3 Real-Binary Paragraph Vector model 3.4 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 4 Probabilistic multi-sense word embeddings 57 4.1 Disambiguated Skip-gram model . . . . . . . . . . . . . . . . . . . . 57 4.1.1 Regularization in Disambiguated Skip-gram . . . . . . . . . 60 4.2 Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 4.2.1 Qualitative evaluation . . . . . . . . . . . . . . . . . . . . . 63 4.2.2 Word sense induction experiments . . . . . . . . . . . . . . . 68 4.2.3 Word-similarity experiments . . . . . . . . . . . . . . . . . . 69 4.3 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 5 Conclusions and directions for future research 72 5.1 Contributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 5.2 Future research directions . . . . . . . . . . . . . . . . . . . . . . . 73 A Datasets and experimental setup 75 A.1 Datasets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 . . . . . . . . . . . . . . . . . . . . . . . . . 75 A.1.1 20 Newsgroups A.1.2 Reuters corpus volume 1 . . . . . . . . . . . . . . . . . . . . 75 A.1.3 English Wikipedia . . . . . . . . . . . . . . . . . . . . . . . 76 . . . . . . . . . . . . . . . . . . . 77 A.1.4 Word similarities datasets A.1.5 Word sense induction and disambiguation datasets . . . . . 77 A.2 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 A.2.1 TensorFlow . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 A.2.2 AGH deep learning library . . . . . . . . . . . . . . . . . . . 79 B Supplementary material 81 B.1 Improving the multi-prototype vector-space model with transfer learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 B.1.1 The bag-of-senses model . . . . . . . . . . . . . . . . . . . . 82 B.1.2 Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 B.1.3 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 B.2 Scaled-up TF-IDF representation . . . . . . . . . . . . . . . . . . . 85 B.2.1 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 B.3 Automated blog author profiling . . . . . . . . . . . . . . . . . . . . 86 B.4 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 2 List of Tables Information retrieval 20 Newsgroups results. Information retrieval RCV1 results. Information retrieval results for English Wikipedia. 3.1 3.2 3.3 3.4 Comparison of performance of different binary units for 32 bit model . . . . . . . . . . . . . 41 . . . . . . . . . . . . . . . . . . 45 . . . . . . . . . 48 . . . . . . . . . . . . . . . . 50 trained on the 20 Newsgroups dataset. Information retrieval results for 32-bit binary codes . . . . . . . . . 51 Information retrieval dimensional binary codes. . . . . . . . . . . . . . . . . . . . . . . . 52 Information retrieval results for the Real-Binary PV-DBOW model. 54 learning for 128- transfer results for 3.5 3.6 3.7 4.1 Marginal probabilities and nearest neighbors for selected words from the vocabulary. . . . . . . . . . . . . . . . . . . . . . . . . . . 64 from the vocabulary. 4.2 Marginal probabilities and nearest neighbors for selected words 4.3 Average number of senses per word with marginal probability p ≥ 0.05, learned by Disambiguated Skip-gram models with different values of the entropy cost γ. . . . . . . . . . . . . . . . . . . . . . . . . . . 65 . . . . . . . . . . . . . . . . . . . . . . 68 4.4 Adjusted rand index for the Disambiguated Skip-gram model with different dimensionalities, . . . . . . . . . . . . . . . . . . . . . . . . 69 4.5 Adjusted rand index for different 300-dimensional multi-sense word embedding models. . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 4.6 Spearman's correlation coefficient multiplied by 100 for different 300-dimensional models evaluated on the SCWS dataset. . . . . . . 70 4.7 Spearman's correlation coefficient multiplied by 100 for different 300-dimensional models evaluated on WordSim353 dataset. . . . . . 71 A.1 All the groups from the 20 Newsgroups dataset . . . . . . . . . . . 76 B.1 Results for the 20 Newsgroups dataset represented using 2000- dimensional bag-of-senses model compared against bag-of-words model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 B.2 Results for the RCV1 dataset represented using 2000-dimensional B.3 Results bag-of-senses model compared against bag-of-words model. . . . . . 84 for 20 Newsgroups dataset represented using 2000- dimensional TF-IDF-MR model and compressed to 32 dimensions using deep autoencoder. . . . . . . . . . . . . . . . . . . . . . . . . 86 B.4 Results for the RCV1 dataset represented using 2000-dimensional TF-IDF-MR model and compressed to 128 dimensions using deep autoencoder. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 B.5 Classification accuracy. . . . . . . . . . . . . . . . . . . . . . . . . . 87 3 List of Figures 2.1 A software function model. . . . . . . . . . . . . . . . . . . . . . . . 9 2.2 An artificial neuron model: . . . . . . . . . . . . . . . . . . . . . . . 17 2.3 A simple feedforward neural network with one hidden layer. . . . . 19 2.4 Polysemous word mouse pulls clusters of computer parts and cluster of domestic animals to each other. . . . . . . . . . . . . . . . . . . . 25 2.5 A deep autoencoder with hidden layers h1 to h5 and weight matrices W1 to W6. 2.6 Vector representations of text data space with example models. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 . . 33 3.1 The Binary PV-DBOW model. Modifications to the original PV- DBOW model are highlighted in blue. . . . . . . . . . . . . . . . . . 35 3.2 The Binary PV-DM model. Modifications to the original PV-DM model are highlighted in blue. . . . . . . . . . . . . . . . . . . . . . 36 3.3 The 20 Newsgroups dataset precision-recall curves for different code 3.4 dimensionalities and different model variants. t-SNE visualizations of real-valued point codes of seven selected newsgroups from the 20 Newsgroups dataset for different code di- mensionalities. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 t-SNE visualizations of binary codes of seven selected newsgroups from the 20 Newsgroups dataset for different code dimensionalities. 3.6 The precision-recall curves for the RCV1 dataset for different code . . . . . . . . . . . . 42 3.5 44 3.7 dimensionalities and model variants. t-SNE visualizations of binary codes of six selected topics from the RCV1 dataset for different code dimensionalities. . . . . . . . . . . . . . . . . . 46 . . . . . . . . . . 47 3.8 The English Wikipedia precision-recall curves for different code di- mensionalities and different model variants. . . . . . . . . . . . . . . 49 Information retrieval results for 32-bit binary codes . . . . . . . . . 52 3.9 3.10 128-dimensional binarized PV-DBOW model. . . . . . . . . . . . . 53 3.11 The Real-Binary PV-DBOW model. . . . . . . . . . . . . . . . . . . 53 3.12 Information retrieval results for Real-Binary PV-DBOW model with 300-dimensional real-valued codes. . . . . . . . . . . . . . . . . 55 3.13 Performance comparison between real-valued codes learned by Real- Binary PV-DBOW (red curve) and original PV-DBOW (green curve). 56 4.1 Disambiguated Skip-gram model. 4.2 Visualization of the nearest neighbors for selected words from the . . . . . . . . . . . . . . . . . . . 58 vocabulary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 4.3 Visualization of the nearest neighbors for selected words from the vocabulary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 4 4.4 Histograms of marginal probabilities of word senses learned by Dis- ambiguated Skip-gram models with different values of the entropy cost γ. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 A.1 TensorBoard visualization of a PV-DBOW model computation graph. 80 B.1 A deep autoencoder with hidden layers h1 to h7 and weight matrices W1 to W8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 B.2 Precision-recall curves for bag-of-senses experiments. . . . . . . . . 84 B.3 Precision-recall curves for TF-IDF-MR experiments. . . . . . . . . . 86 B.4 t-SNE visualizations of blog posts embeddings. . . . . . . . . . . . . 87 5 Chapter 1 Introduction Prior to deep learning, machine learning often boiled down to numeric optimiza- tion over hand-engineered features. Users of traditional machine learning systems needed to carefully design or select features, and to do that they needed to deeply understand their data. Feature engineering was, and sometimes still is, one of the most time-consuming, daunting and tedious tasks in a machine learning pipeline. Training a state-of-the-art learning algorithm with data represented by a poorly selected set of features most often leads to poor overall performance. Engineering of features is therefore a bottleneck on a way to achieve satisfying results. Some researchers go even further and suggest that we cannot talk about true artificial intelligence (AI) when features are handcrafted. Luckily, due to the recent advancements in neural network research, we can now discover some latent features of data, effectively enabling learning from raw data. A field of study that revolves around learning rich dense representations of data is called representation learning. It is a growing and fascinating field. Representation learning took off together with deep learning in the late 2000s. Since then, many rich representations of images, speech, text and other types of data were proposed. In this dissertation we focus on learning high-quality representations of text data. An ultimate goal of AI is to build an AI-complete system, which is a system as intelligent as a human. A key element of such a system is an ability to fully understand humans, which require, among other, an understanding of natural languages that people use. This goal if far from being met. Nevertheless, intel- ligent systems can perform a lot of useful functions without fully understanding the language, i.e. with just partial understanding. For example, one of the major outcomes of the recent AI revolution is increased popularity of intelligent per- sonal assistants. Example of them are Apple's Siri, Google Assistant, Facebook M, Amazon Alexa, Microsoft Cortana, Samsung's Bixby or Yandex's Alisa. In- telligent personal assistants revolutionize the way we interact with mobile devices and personal computers. Most of them interact with humans using voice. How- ever, in most cases the voice is converted into text as a first step of a processing pipeline. With an advent of deep learning, accuracy of speech recognition systems improved to the extend that speech recognition is sometime considered a solved problem (e.g. [Graves et al., 2013]). Much more difficult is the second step of the pipeline, namely natural language understanding. The first step towards text understanding is to embed small units of text, into some low-dimensional vectors often words but also sentence or phrases, 6 space. Those vectorised representations are then used as an entry for downstream NLP techniques, like structure parsing [Socher et al., 2013], machine transla- tion [Sutskever et al., 2014], question answering [Weston et al., 2015] or image captioning [Karpathy and Fei-Fei, 2015]. Therefore, building rich representations of text data is a key element of modern natural language processing. 1.1 Motivation Amount of digital text data available globally is increasing rapidly. As a conse- quence, ability to quickly retrieve relevant information from massive datasets is becoming more and more important. In many cases quality of search results is more important than retrieval time. However, in some cases users are willing to compromise on the quality of search results in favor of fast retrieval. In general, re- trieval in these settings can be seen as an instance of approximate nearest neighbor search. Such approximation to searching is often realized with locality-sensitive hashing (LSH) methods. The idea is to generate short binary codes for documents that carry semantic information, i.e., similar documents will end up having similar codes. Having such codes, we can treat them as memory addresses and quickly retrieve similar documents by generating a hash for a given query and then taking all documents having the same or similar memory address as the query. Traditionally, LSH codes were generated from text documents represented by the bag-of-words (BoW) representation, which in its simplest form is just a set of word counters. BoW is a popular representation, often used for text document classification and information retrieval. Despite its popularity and applicability, it is a limited and simplistic representation: for example, it does not carry word order information. In the recent years, many dense, high-quality representations of text data were proposed. We describe them in Section 2.3. Many of them can be used to obtain state-of-the-art results in tasks like document classification, sentiment analysis or information retrieval. All of them are real-valued representations. In order to use them for addressing, one still needs to convert them to binary codes using some locality-preserving hashing technique. It would be desirable to be able to build a high-quality distributed binary representation of documents that can be directly used for approximate nearest neighbor search. Word embedding models are ubiquitous, but most of them have one inherent limitation: each word, even ambiguous one, is placed in one unique spot in a vector space. One of the implications of this is that some non-related words are 'drawn' to each other, e.g. high-tech companies are 'drawn' to fruits, because of the word apple. Many solutions were proposed to deal with ambiguity when learning word embeddings. We review them in Section 2.3.6. One of the classification criteria of those methods is a way of estimation of latent variables and parameters of the model. Some of the multi-sense word embedding models employ error backprop- agation while other use variants of the expectation-maximization algorithm. To the best of our knowledge, none of the models trained with backpropagation has a clean probabilistic interpretation. Instead, to discover word senses they employ, for example, implicit context clustering during training. It would be beneficial to have a clean end-to-end differentiable probabilistic multi-sense word embedding model. 7 1.2 Contributions This dissertation can be divided roughly into two main parts. The first focuses on learning distributed representations of documents (Chapter 3). Therein we propose a novel model for learning binary vector representations of text docu- ments, which can be used for fast information retrieval. To the best of our knowl- edge, no one proposed a similar model for learning binary vectors directly from raw text. Existing solutions require a two-step approach, where binary codes are learned from some intermediate real-valued representation. Our model is simple, has smaller memory requirements than the two-step approach and produces com- petitive results. We presented the model at the 2nd Workshop on Representation Learning for NLP [Grzegorczyk and Kurdziel, 2017]. The second major part of this dissertation revolves around dense represen- tations of words (Chapter 4). We introduce a novel neural network that is an extension to the popular skip-gram model. Our contribution consists of adding a disambiguation subnetwork to the model. The resulting solution has an elegant probabilistic interpretation. To assure high-quality of word representations pro- duced by our model we employ some recently introduced deep learning techniques. We test our model against several state-of-the-art models on a few benchmark test sets, and we demonstrate its superior performance. The dissertation opens with a review of background works (Chapter 2) and closes with a summary of our contributions and a presentation of some directions for future research (Chapter 5). Appendix B describes research that we carried out for this dissertation but which did not yield as promising results as the one described in earlier chapters. Finally, Appendix A describes datasets and software libraries that we used to conduct experiments. 8 Chapter 2 Background and related works In this chapter we discuss different ways of representing text data as well as various deep learning concepts. We start with an introduction of selected machine learning (ML) terms and concepts that are frequently used in this dissertation. A more comprehensive introduction to ML can be found in [Bishop, 2006, Murphy, 2012, Abu-Mostafa et al., 2012, Goodfellow et al., 2016]. A layperson's overview of ML concepts is presented [Domingos, 2015]. 2.1 Selected concepts in machine learning In order to deal with complexity of software systems they are often modularized on various levels of abstraction. Software modules or components can be seen as black-boxes that take some input, do some internal processing and output some results. One of the low level abstractions in software is a function. Function, a concept borrowed from the field of mathematics, takes some data x as an input and produces some data y as a result ( Fig. 2.1). In addition, Θ is a set of internal Figure 2.1: A software function model. Where xi are the inputs, Θ are the model parameters and y is an output. function parameters which influence the output. Those parameters encapsulate the knowledge that is needed to produce accurate outputs. Traditionally this knowledge was explicitly given to the system by experts. Machine learning (ML) is a family of algorithms that enable computers to obtain the knowledge in an automated way by learning it from data. In ML terminology the function f is often called an ML model or a hypothesis or en estimator and the goal is to discover or estimate the optimal parameters Θ that produce expected outputs y. The model parameters are sometimes called coefficients. 9 x1x2x3xn...fθ(x)y1y2y3ym... A single data item passed to the ML algorithm is called an example. The example has multiple data fields called features. The features can be binary, numerical, textual or categorical. If all the features are numerical, then the data example can be represented as a vector x in an n-dimensional vector space, where n equals the number of features. Taxonomy of ML is complex, and we are not going to analyze it here, but probably the two main types of ML are: • supervised learning - learning model parameters Θ by providing input data x with desired outputs y, often called labels, • unsupervised learning - learning model parameters Θ without any labeled data, relying exclusively on the input data. The process of estimating optimal values of model parameters Θ is often dubbed fitting parameters to the data. One of the important traits of the su- pervised ML algorithm is its ability to generalize. A model that generalize well performs well not only on the data on which it was trained, but also on data ex- amples which were unknown at the training time. Therefore, examples available in a data set are often split into two subsets. One is called training set and is used to fit the parameters, and the other is called test set and is used to evaluate the model. It is important that the test set is held out during training and is only used to evaluate the model after training. If the model performs well on the training set but poorly on the test set, we say that it is overfitted to the training data or that it has high variance. If the model performs badly even on the training data, we say that it is underfitted or biased. Sometimes it is said that training the model is a bias-variance tradeoff [James et al., 2013, Section 2.2.2]. A good illustration of this dilemma is depicted in [James et al., 2013, Fig. 2.12]. There is a multitude of tasks that are solved using ML. Probably the most common supervised learning tasks are: • regression - predicting a single continuous output value for a given set of inputs, • classification - assigning each data example to appropriate class; when there are only two possible classes we say that it is a binary classification problem; when there are more than two classes we call it a multinomial classification problem. Unsupervised learning tasks include: • clustering - separating data examples into distinct groups, • dimensionality reduction - expressing data in a lower number of dimensions losing as little knowledge as possible. 2.1.1 Training a supervised machine learning model When machine learning is used for regression or classification, the performance of a model is measured by a loss function, a.k.a. a cost function, often denoted by 10 L. There are multiple loss functions used in the field of machine learning. One of the basic loss functions is the mean squared error: L(fΘ(X), y) = 1 N (fΘ(xi) − yi)2, N(cid:88) i=1 (2.1) (2.2) where N is a dataset size. It is sometimes written with an Euclidean norm: L(fΘ(X), y) = fΘ(X) − y2. For simplicity, instead of L(fΘ(X), y) we often write just L(Θ). Fitting the model parameters Θ boils down to the problem of finding the model parameters that yield the lowest cost for the training data. More formally, training can be interpreted as minimizing the cost function L over the model parameters Θ. There is a plethora of numerical optimization methods. One of the most popular optimization methods is Gradient Descent (GD). In GD one needs to randomly initialize parameters, and then iteratively update them: Θs+1 = Θs + ∆Θs, (2.3) where s is a step number. The parameter update matrix ∆Θs is a negative gradient of a loss function, −∇L, multiplied by learning rate hyperparameter α: ∆Θ = −α∇L(Θ). (2.4) Note that since the gradient of the loss function is a set of all possible partial derivatives with respect to model parameters, the loss function needs to be differ- entiable with respect to all of them. In practice, a stochastic variant of Gradient Descent (SGD) is often used for optimization. In SGD the gradients are calculated not for the entire training data but for a limited number of sampled examples. To prevent model from overfitting some regularization term is often added to the cost function. Regularization may penalize high values of model parameters during the optimization process and, as a consequence, cause the hypothesis to be simpler. Probably the two most common regularization methods are the sum of squares of model parameters and the sum of absolute values. The first one is called L2 regularization and the second L1. The mean squared error with L2 regularization takes the form: N(cid:88) L(Θ) = 1 N M(cid:88) (fΘ(xi) − yi)2 + λ i=1 i=1 Θ2 i , (2.5) where λ is a regularization parameter, sometimes dubbed a penalty or shrinkage, and M is a total number of model parameters. In order to speed up convergence and prevent from getting stuck in a local minima the momentum method [Polyak, 1964] is often applied. The momentum modify Eq. 2.4 by adding a fraction of updates from the previous step: ∆Θt = ε∆Θt−1 − α∇L(Θ), (2.6) where ε is a momentum hyperparameter. 11 One of the drawbacks of the cost function presented above is that it may not be a convex function, i.e. it could get stuck in a local minima during optimization, depending on a modeled function f. It is not a problem when the modeled function is linear. However, when we want to learn parameters of a nonlinear function f, then we need to optimize other, more complex cost functions. We will discuss them later on in this chapter. An alternative approach to fitting model parameters is black-box optimization. Methods from this family tune the parameters based only on analysis of signals exiting the model, regardless of an internal structure of the model. One recent example of black-box numerical optimization solution is Google Vizier [Golovin et al., 2017]. 2.2 Vector representations of text data One of the main applications of computers is data processing. Data processing can involve analyzing data, extracting some knowledge from it, converting it into other formats or visualizing it. In general, we can distinguish two types of data: structured and unstructured. Structured data is organized and described by same meta-data, and is often stored in relational databases or spreadsheets. Unstruc- tured data is not organized and is often stored in non-relational databases or directly as raw files in a file-system. Examples of raw data are: images, videos, sound records, or unstructured text documents. Processing unstructured data is more challenging than structured data. However, by and large, there is much more raw data available and it is easier to obtain. For humans, understanding text data is relatively easy. Assuming that a text document is written in a natural language native to the reader, they can un- derstand it without effort. For computers it is much harder to process natural languages. Nevertheless, it is a very important task. There is proliferation of applications that rely on understating of text data. Examples of such applica- tions are: information retrieval, sentiment analysis, question answering, machine translation, text summarization or information extraction. All those tasks can be classified as Natural Language Processing (NLP). A comprehensive introduction to NLP can be found in [Manning and Schütze, 1999, Jurafsky and Martin, 2008]. In this thesis we will focus on one aspect of NLP, which is vector representations of text data. Text data at different levels can be represented by vectors. A single vector can represent a document, a paragraph, a word, or even a single character. One of the most popular applications of vector representations of documents is Information Retrieval (IR). A comprehensive introduction to IR can be found in [Manning et al., 2008]. Below we present just basic IR ideas. Information Retrieval methods attempt to retrieve a relevant document for a given query. In practice, instead of a single document a list of candidates ranked according to the relevance is returned. The simplest ranking model is based on the occurrence of query terms in the ranked document. It is called a Boolean model. Documents matching most of the query terms are placed nn the top of the result list. However, for short queries there could be multiple documents containing them and, therefore, the order of result could be ill-defined. 12 2.2.1 Vector Space Model Probably the most popular IR model is Vector Space Model [Salton et al., 1975] (VSM). In VSM both the query and the documents are represented as vectors in the same vector space. Then, the inner product of two vectors a and b serves as a similarity measure used to rank the results: M(cid:88) sim(a, b) = aTb = aibi, (2.7) where M is a number of dimensions in a vectors space. Often the inner product is normalized by vectors lengths to make the measure independent of them. This way we obtain cosine similarity: i=1 sim(a, b) = cos(a, b) = aTb ab. (2.8) The most common way to place documents and a query in a vector space is to represent them as counts of words from a vocabulary. The resultant number of dimensions of the space equals the vocabulary size. A simple count is often referred to as frequency ft,d of a term t in a document d. Often sublinear scaling is applied to term frequencies: (cid:26)1 + log(ft,d) 0 T F (t, d) = if ft,d > 0, otherwise. (2.9) However, this schema does not take into account that some words are statisti- cally more common than the other and, therefore, values in some dimensions will be much higher than in others. To solve this issue, term frequencies are often multiplied by inverse document frequencies: IDF (t) = log N n(t) , (2.10) where N is the total number of documents in the corpus and n(t) is a number of documents containing term t. It is beneficial to smooth IDF term by adding 1 to it: IDFsmoothed(t) = log(1 + ). (2.11) N n(t) Resultant combined schema is often called TF-IDF. There are many variations of TF-IDF weighting scheme used in information retrieval and machine learning. See [Manning et al., 2008, section 6.4] for details. 2.2.2 Bag-of-words model When documents represented in a form of term frequencies are used for applica- tions other than Information Retrieval, we often call it the bag-of-words (BoW) representation. BoW research dates back to the 1950s [Harris, 1954]. One of the popular applications of BoW is text classification. For example, given a set of emails we want to be able to tell which of them are unsolicited and which are not. 13 An inherent limitation of the BoW representation is that the order of words in a document is not preserved. Phrase "The Allies defeated the Axis" and "The Axis defeated the Allies" are represented by the same vector. The other drawback of BoW is that resultant vectors are sparse. Even if document has thousands unique words, it still is just a fraction of the vocabulary size, which can be in hundreds of thousands. Another limitation is that multiple senses of polysemous and homonymous words are represented by a single dimension. For example, a document dealing with river banks and a document about the federal bank will both have high value in a dimension associated with a word bank. Conversely, in BoW we have multiple dimensions for synonymous words, which causes some features to be redundant. We will discuss how to deal with those limitations later in the thesis (Section 2.2.4). One of the generalizations of bag-of-words is to extend the vocabulary by adding to it combinations of words occurring next to each other in sentences. This generalization is called bag-of-n-grams. Using the example from previous paragraph we will have separate dimension for bigrams (word pairs) "Allies de- feated" and "Axis defeated" and, therefore, those two phrases will be represented by different vectors. The drawback of bag-of-n-grams is even higher dimensionality and sparsity than in the case of BoW. At this point it is worth noting that for some algorithms high dimensionality is not a problem while for others is a major issue. One simple machine learning algorithm which is very scalable and deals well with high dimensionality is naive Bayes classifier. This classifier is based on the Bayes' theorem: P (AB) = P (BA)P (A) (2.12) where A and B are some events, P (AB) is a posterior probability of event A given event B, P (A) is a prior probability of event A, P (B) is an evidence and P (BA) is likelihood. Employing naive Bayes classifier, the probability of a document d belonging to a class c is estimated in the following way: P (B) , Classifications boils down to selecting the class with the highest probability: P (cd) = P (dc)P (c) P (d) P (dc)P (c) c = arg max c∈C P (d) . (2.13) , (2.14) where c is the predicted class and C is a set of all classes. The evidence P (d) is constant for all the classes and, therefore, we can eliminate it from the equation: (2.15) P (dc)P (c). c = arg max c∈C Prior P (c) can be easily estimated by just counting how many times class c occurs in the corpus and normalizing by the total number of classes. Estimation of the likelihood P (dc) is slightly more involved. Assuming that features in the bag-of- words representation are independent, we can estimate likelihood as: P (dc) = P (wic), (2.16) Nd(cid:89) i=1 14 where Nd is a number of words in a document d and wi is a word at position i in the document. We can estimate the probability of a word given a class in the following way: (cid:80)M count(wi, c) j=1 count(wj, c) P (wic) = , (2.17) where M is a vocabulary size. Therefore, the total number of parameters of naive Bayes classifier equals the number of words in the vocabulary (likelihood parameters) summed with the number of classes (prior parameters). In practice, for text data multinomial variant of naive Bayes classifiers is used. As we demonstrated, the number of parameters of naive Bayes classifier is a liner function of number of features and, therefore, high-dimensionality of feature space is not a problem. However, for many other algorithms (e.g. neural networks discussed later on in this chapter) relation between the number of features and the number of parameters is exponential, which poses high memory or low input dimensionality requirements. 2.2.3 Topic modeling For years researches have been trying to build low-dimensional representations of text. The simplest way to cope with high-dimensionality is to select a limited number of most frequent words from a vocabulary (e.g. 2000) and represent doc- uments as frequencies of only those selected terms. Such a simplistic solution is sufficient in some applications but not in many. One of the more sophisticated approaches is to try to discover latent topics of the documents. This approach is called topic modeling. Probably the first topic model was Latent Semantic Analysis (LSA) [Deerwester et al., 1990], a.k.a. Latent Semantic Indexing. LSA attempts to discover topics by decomposing word-document co-occurrence matrix using Singular Value Decomposition: X = UΣVT, (2.18) where each column of X is the bag-of-words representation of a single document, each column of U is a distribution of words in a single topic and each row of V is a distribution of topics in a single document. Σ is a diagonal matrix whose diagonal elements are called singular values. As a result of decomposition we get documents represented as distributions of topics. In addition, we obtain definitions of topics in a form of distributions of words. For example, a topic regarding Middle East issues will probably have high values for words like 'Israel', 'Arab' or 'Palestine'. More recent topic model is latent Dirichlet allocation (LDA) [Blei et al., 2003]. LDA makes a very crude but useful assumption that documents are generated randomly by sampling words from sampled topics. As a consequence, all the documents in the collection share the same set of topics, but each document exhibit those topics in different proportions. In practice those distributions need to be inferred from training data. One limitation of LDA is that all topics are independent. In reality some topics can be highly correlated with other topics. To address this limitation Lafferty & Blei proposed correlated topic models (CTM) [Lafferty and Blei, 2006], which explicitly model correlations between topics. 15 From a probabilistic point of view topic models can be seen as directed prob- abilistic graphical models, where documents point to topics, which subsequently point to words. Topic models can also be seen as mixture distributions, i.e. each document is represented as a mixture of topics, where topics are probability dis- tributions over words. One problem with mixtures is that they are linear combi- nations of random variables. Therefore they cannot take into account non-linear relationships between variables. We can imagine that some topic has high proba- bility of existence of some combination of words but low probability of occurrence of those words in isolation. Later we will show how to tackle this problem. As we mentioned above, one of the drawbacks of the bag-of-words represen- tation is its inability to cope with polysemous words. Ambiguity is one of the biggest challenges of natural language understanding. In the following subsection we discuss ways to disambiguate polysemous words and to embed this information in representations of text data. 2.2.4 Word Sense Disambiguation Word Sense Disambiguation (WSD) is a problem studied for many years in the field of Natural Language Processing [Lesk, 1986, Yarowsky, 1995, Schütze, 1998]. The problem boils down to determining which meaning of a given ambiguous word should be selected in a given context. Ambiguity is formalized by two concepts: polysemy and homonymy. Polysemy is the coexistence of many possible meanings of a single word. Homonymy is when multiple words have the same spelling and pronunciation by just mere linguistic coincidence. Important difference is that in the case of homonymy there are multiple words with separate lemmas while in the case of polysemy there is just one lemma. Examples of polysemous words are: mouse, apple, fox, crane, window, plant or palm. Examples of homonymous words: bank, rock, taxi, bear or check. When natural language is processed by computers it often does not matter whether ambiguous word is a polyseme or a homonym. There are three main approaches to WSD, namely supervised, knowledge-based and unsupervised. In a supervised approach machine learning model is trained on a large number of sense-annotated sentences. Knowledge-based methods rely on an external lexical database like WordNet [Miller, 1995], DBpedia [Lehmann et al., 2014], BabelNet [Navigli and Ponzetto, 2012] or ConceptNet [Speer et al., 2017]. The most popular method from this family is a classic Lesk algorithm [Lesk, 1986]. Finally, unsupervised methods neither require sense-annotated corpora nor knowledge bases. In this family of methods, one needs to discover possible word senses prior to disambiguation. Therefore, this approach is often called Word Sense Induction. The seminal work that goes in this direction is [Schütze, 1998], where authors propose to discover senses by clustering occurrences of ambiguous words. When we are able to disambiguate polysemous words we can apply this skill to crate a document representation that has separate dimensions for separate word senses. Specifically, Reisinger et al. [Reisinger and Mooney, 2010] proposed a multi-prototype vector-space model, where each word is represented by multiple word vectors. They discover senses using word sense discrimination [Schütze, 1998], i.e. by clustering word occurrences. Resultant vectors for a given word not 16 only represent different word senses but also different word usages. This method is generic, i.e. any embedding method and clustering algorithm can be used. Similar approach is adopted by Huang et al. in [Huang et al., 2009]. They propose a bag-of-concepts document representation, where each dimension corre- sponds to one abstract concept, which can be described by multiple words. For example, all three: the Earth, the world, and the globe, will be represented by just one dimension. To build this representations the authors rely on an external knowledge base. Specifically, they analyze anchor text in Wikipedia hyperlinks and observe that multiple different anchor texts point to a single wiki page. In this section we discussed a basic vector space model and standard extensions to it. A more comprehensive survey is presented in [Turney et al., 2010]. 2.3 Neural network-based text representations Learning high-quality distributed representations of text data is a complex task. Due to their high capacity, neural networks are an obvious choice for doing this. In the following subsections we present selected neural network-based text repre- sentations. We start with an introduction of selected concept in neural network models. 2.3.1 Artificial neural networks Artificial neural networks are a family of learning algorithms loosely inspired by the human brain. The building block of a neural network is an artificial neuron. The first models of the artificial neuron (Fig. 2.2) were proposed in the 1940s [Mc- Figure 2.2: An artificial neuron model: xi are inputs, θi are weights (a.k.a. pa- rameters), b is a bias term, y is a weighted sum of the inputs and the bias, f (y) is an activation function (a.k.a. transfer function) and z is the output. Culloch and Pitts, 1943]. The neuron has multiple inputs xi and one output z. Internally, a weighted sum of inputs and a bias term is calculated: n(cid:88) y = b + xiθi, (2.19) where θi are input weights, a.k.a. parameters. For convenience, the bias term is often appended to the weights the input vector is appended with a fixed value of i=1 17 x1x2x3xn...θ1...θ2θnθ3+f(y)yz1b 1. Then we can calculate y as a dot product of input and weight vectors: y = xTθ. (2.20) This weighted sum, often called neuron pre-activation, is then passed to an acti- vation function. The simplest form of the activation function is a step function: (cid:26)1 f (y) = if y > 0, 0 otherwise. (2.21) When the Heaviside step function is used as an activation function of an artificial neuron, then resultant model is called perceptron [Rosenblatt, 1958]. In practice, continuous functions are often used as activators. One popular activation function is the logistic function, often dubbed a sigmoid function due to its shape: σ(x) = 1 1 + e−x . (2.22) An important trait of this function is that the output is always between 0 and 1 and, therefore, we can use it to model probabilities. Manual setting of neuron parameters would make wider adoption of those models infeasible. Therefore, we need to be able to learn neuron weights automat- ically. As in the case of other machine learning methods, we do this by minimizing a cost function. In the case of a neuron with a logistic activation function the cost function L of model weights Θ takes the form: [yi log σ(xi) + (1 − yi) log(1 − σ(xi))], (2.23) N(cid:88) i=1 L(Θ) = − 1 N where N is a dataset size. This function can be derived from a maximum likelihood principle. An artificial neural network (NN) is a composition of multiple artificial neurons. The most popular type of NN is a feedforward NN. Sometimes they are also called multilayer perceptrons (MLPs). However, this name should be used with caution, since activations in MLPs are rarely step functions. Moreover, activations are often not only continuous but also nonlinear. Otherwise, the network could be reduced to just one big neuron, since a function which is a combination of linear functions is still a linear function. The most appealing feature of a feedforward network is that it is, theoretically, sufficient to approximate any continuous function [Cybenko, 1989]. In practice, however, to model any function a single-layer network would have to have so many hidden neurons that its training would be infeasible. Ability to model different functions is often called model capacity. A network with higher capacity is able to model more complicated functions. To increase the model capacity one could add multiple hidden layers with relatively small numbers of neurons, instead of adding many hidden units to a single hidden layer. Networks with many hidden layers will be described later in this chapter. The cost function of the feedforward neural network is the cost function of the output layer. If there is only one sigmoid neuron in the output layer, the cost function could be defined by Eq. 2.23. However, it is more common to use multiple 18 Figure 2.3: A simple feedforward neural network with one hidden layer. There are m input signals, h hidden neurons and n output neurons. Weights for each neuron are rows in weight matrices Θ1 and Θ2. For simplicity, bias terms are not presented. output neurons. For example, when the network is used for classification, we want as many neurons in the output layer as there are classes. We want the correct neuron to output high value (high probability) and the other neurons to output low values (low probabilities). To this end, we often use the softmax activation function, which is a generalization of the logistic function: for i = 1,··· , K, (2.24) pi(x) = , exi(cid:80)K k=1 exk where K is the number of output neurons. Softmax ensures that the values in the output layer sums up to one and, therefore, can be interpreted as probabilities assigned to given classes. When NN is used with the softmax output layer, we got a vector of probabilities as an output, which we need to compare with a label (represented using one-hot encoding) in order to calculate the loss. When we want to compare two probability vectors a and b, it is good to use the cross-entropy function: ai log(bi), (2.25) where K is a number of dimensions. The Cross-entropy is a special case of entropy function defined for a vector of probabilities p: S(a, b) = − K(cid:88) i=n S(p) = − K(cid:88) i=n N(cid:88) i=1 pi log(pi), (2.26) In order to calculate the training loss we need to average the cross-entropy over the entire training set: L(fΘ(X), Y) = 1 N S(fΘ(xi), yi), (2.27) where N is dataset size, and fΘ is the function that describes the whole neural network. 19 x1x2x3xm...z1z3z2zn......Θ1Θ2y1y2y3yh 2.3.2 Neural network training In order to minimize a neural network cost function using a gradient-based opti- mization method, like Gradient Descent, one need to calculate the derivative of a loss function with respect to all the weights Θ in all the layers of the network. The problem is that we calculate error at the output of the network, but then we need to calculate partial derivatives of the error with respect of the previous layers' weights. The lack of a fast and easy method to do this delayed applications of NN for many years. The revival of interest in NN started in mid-eighties with a discovery of backpropagation algorithm [Rumelhart et al., 1986], which enabled calculation of the gradients in all hidden layers. Backpropagation can be inter- preted as an implementation of the chain rule for computing the derivative of the composition of functions. The chain rule states that the derivative of a composed function is a product of derivatives of the outer and the inner function. In practice, we compute gradients in four steps. First, we do forward propagation and obtain a vector of values y at the output of the network. Next, we compare this output with expected labels y to compute a loss or an error, denoted by δoutput. δoutput = y − y. Then, we recursively compute errors for each layer l in the network: δl = ΘT l δl+1 ◦ f(cid:48) l (zl), (2.28) (2.29) where, ◦ is the Hadamard product (element-wise multiplication) and f(cid:48) l (zl) is a derivative of an activation function of layer l evaluated for the input of that layer zl. Finally, we can calculate a vector of partial derivatives of the cost function L with respect to the weights of layer l: ∂L ∂Θl = δl+1f T l (zl). (2.30) In practice, neural networks are often trained in mini-batches and, therefore, Eq. 2.30 takes the form: M(cid:88) i=0 ∂L ∂Θl = 1 M δi l+1(f i l (zl))T, (2.31) where M is a total number of training examples in a mini-batch. Having partial derivatives of the cost function with respect to the weights one can use gradient descent, or other gradient-based optimization algorithm, to find the optimal set of network weights. One of the key features of the backpropagation is that an error for a given layer is computed in terms of an error of the preceding layer (looking from the back of the network). This has one important implication. If an error, for some reason, become very small in one layer, then an error in a subsequent layer (again looking from the back) will be also small, or even smaller (if weights are small). This phenomenon is known as the vanishing gradient problem. Related to it one is the exploding gradient problem, where errors become bigger and bigger in subsequent layers. Those two problems prevented practical use of deep neural networks, i.e. 20 networks with more than one hidden layer1, in the early years of backpropagation based neural models. In the 1990s, neural networks were overshadowed by support vector machines (SVM) [Cortes and Vapnik, 1995]. SVM tries to find a hyperplane that sepa- rates classes with as wide margin as possible. The margin is often a soft margin, which is immune to the outliers and, therefore, generalizes well. By definition, hyperplane can separate only classes that are lineary separable. To separate non- lineary separable classes dedicated kernel functions are used. One of the factors which enabled SVMs to flourish is their relatively low computational and memory requirements. Current renaissance of neural networks started in 2006 with a proposal of methods that enable training of NN with more than one hidden layer. We will discuss deep neural networks later in this chapter. 2.3.3 Undirected topic models As we mention in Section 2.2.3, classic topic models are unable to capture convo- luted, non-linear relationships between word distributions in topics. To solve this problem, Hinton & Salakhutdinov proposed the replicated softmax [Hinton and Salakhutdinov, 2009] binary topic model. The model is a special variant of the restricted Boltzman machine (RBM) [Smolensky, 1986], two-layer undirected gen- erative model, which is often trained with the Contrastive Divergence (CD) [Hin- ton, 2002] algorithm. Original CD assumes a model with binary input and output units. However, in the case of topic modeling input should model word counts. To this end, Hinton & Salakhutdinov had to modify CD algorithm to account for word counts. The authors demonstrated that replicated softmax generalize better than LDA, i.e. produces better topic distributions for unseen documents. More- over, since RBM is an undirected graphical model, not only word distributions in a document are conditioned on topic distributions but also topic distributions are conditioned on word distributions. 2.3.4 Word embeddings As we wrote in Section 2.2, an inherent limitation of the bag-of-words representa- tion is that each word is assigned to a separate dimension, which causes sparseness and high-dimensionality. If we were to use this model to create vector representa- tions of words, we would end up with a one-hot encoding. The one-hot encoding conveys no information about meanings of words. In particular it does not reflect whether given words are similar to each other or completely different. Such a representation is called a discrete or local representation. Alternatively, we can encode words using a distributed representation [Hinton, 1984, Hinton, 1986], which describes each word using a vector from a relatively low-dimensional continuous vectors space. Since words are embedded in a low- dimensional vectors space, those representation are often called word embeddings. Embeddings capture semantic and syntactic relationships between words. When using embeddings, semantically or syntactically similar words are represented by 1In recent years people tend to use term deep learning to describe all neural networks, even shallow ones 21 'similar' vectors, i.e. vectors having low cosine distance. Individual dimensions in embedded space do not have any specific interpretation. It is only the distance between points in a vector space that is meaningful. Word embeddings are often learned by taking advantage of the distributional hypothesis [Harris, 1954]. According to this hypothesis words that occur in the same contexts often have similar meanings. One of the limitations of relying on co- occurrence is that antonymous words can sometimes be placed near each other in the vectors space For example words good and bad often occur in similar contexts and therefore could end up having similar vectors, which in turn would make them useless in some downstream tasks, like sentiment analysis. in the form of a neural probabilistic language model In practice word embeddings are often trained using neural networks. Probably the first significant neural network-based word embedding model was proposed by Bengio et al. [Bengio et al., 2003]. Neural probabilistic language model is a simple feedforward NN with a linear input layer and a non-linear hidden layer, similar to the one depicted in Fig. 2.3 on page 19. The input layer defines projections from one-hot encoding of words to low-dimensional vectors. The network is initialized with random weights and is trained using stochastic gradient descent. Bengio et al. work inspired several other researches. Among them were the authors of word2vec [Mikolov et al., 2013a] software library. Word2vec implements two separate embedding algorithms. They are conceptually different, but similar from a computational point of view. The first algorithm is called continuous bag- of-words (CBOW) and it learns word vectors by trying to predict a word given its context. To this end, CBOW defines two vector representations for each word w from the vocabulary V , namely input embedding vector vw and output embedding vector uw. The probability of the center word w given its context Cw is defined as: where r is a vector representation of the context Cw, defined as: P (w Cw) = , evT w(cid:48)∈V evT w(cid:48) r wr(cid:80) (cid:88) uw. r = w∈Cw (2.32) (2.33) (2.34) During training CBOW maximizes the log-probability: log P (w Cw). The con- text Cw is usually defined as a fixed number of words to the left and to the right of the center word. Alternatively, the context can be defined as simply a fixed number of preceding words. The second algorithm, called skip-gram, follows a basic structure introduced with CBOW. However, instead of predicting the center words given their contexts, it predicts the context words c given the center words w. To this end, it maximizes the log-probability: log(cid:81) P (c w), where: c∈Cw P (c w) = (cid:80) evT wuc c(cid:48)∈V evT wuc(cid:48) . In practice, both word2vec models are implemented as simple neural networks with just one hidden layer and two weight matrices. Skip-gram network looks like the one presented in Fig. 2.3, where the weight matrix Θ1 contains input 22 embedding vectors vw, the weight matrix Θ2 contains output embedding vectors uw and the the output activation function is softmax (Eq. 2.24). The CBOW model can also be seen as a neural network similar to the one depicted in Fig. 2.3. However this model contains a summation operation (Eq. 2.33) between the weight matrices. Embeddings in the word2vec models are learned as a side-effect of a multino- mial classification. Therefore, the loss function compares the probability distribu- tions over center words (in the case of CBOW) or context words (in the case of skip-gram) with a given one-hot encoding of the ground truth. However, using a standard softmax for predicting a target word would be extremely computationally demanding. In particular, the softmax normalization factor needs to be computed by summing terms from all vocabulary words. Therefore, some approximation of the full softmax is needed. In the follow-up paper, Mikolov et al. [Mikolov et al., 2013b] suggested using one of the two approximate cost functions, namely hierarchical softmax [Morin and Bengio, 2005] or negative sampling. Hierarchical softmax builds a Huffman binary tree where leaves are all the words from the vocabulary. In order to estimate the probability of a given word, one traverse the tree from the root to a leaf. Negative sampling, on the other hand, is a simplifica- tion of Noise Contrastive Estimation [Gutmann and Hyvärinen, 2010] technique. Thorough analysis of hierarchical softmax and negative sampling loss functions, as well as derivation of gradients for both word2vec algorithms, is presented in [Rong, 2014]. Measuring the quality of word vectors is not an easy task. To do this, Mikolov et al. created Semantic-Syntactic Word Relationship test set2, which contains almost 20k semantic and syntactic questions for words and almost 3k for phrases. The questions are in form: X is to Y as Z is to what? For example: Poland is to Polish as England to what? Mikolov et al. demonstrated that both skip-gram and CBOW outperform earlier word vector models, especially the one introduced in [Bengio et al., 2003], on both semantic and syntactic questions. On semantic questions higher accuracy was obtained using skip-gram model while on syntactic questions CBOW performed better. One of the limitations of skip-gram model is that morphology of words is ignored. Two words sharing some common lemma are treated as separate entities. In many cases the algorithm will learn similar vectors for those words because they occur in similar contexts. However, if some variant of a given word is rare, the vector learned by the model could be placed far away in the vector space from the vector of the main form of the word. This is particularly important in the case of natural languages with rich morphology, like Finnish or German. To overcome this limitation Bojanowski et al. [Bojanowski et al., 2017] enriched skip-gram with subword information. To this end, they condition the probability of context words not on a center word vector but on a sum of the center word vector and its subword vectors. In their experiments they consider character n-grams of size 3, 4, 5 and 6. Since the number of all posible character n-grams is huge, the authors place them in some fixed-size hash table (e.g. 106 elements) and embeddings are learned for hashes instead of n-grams. Bojanowski et al. report results superior to the original skip-gram both on word similarity and analogy tasks. Their extension 2Available at https://github.com/dav/word2vec/tree/master/data 23 was initially implemented as a part of the fastText 3 software library. Recently Wu et al. [Wu et al., 2017] proposed a StarSpace model4, which has a different training objective than skip-gram and fastText. Instead of learning to predict context words based on the center word it learns to compare words, i.e. to accurately tell whether two word embeddings are similar, or dissimilar, given some similarity function (e.g. cosine). To this end, the loss function is computed on a set of sampled positive and negative examples. The model is able to learn not only word embeddings but also embeddings for other types of inputs. To this end, Wu et al. introduce a notion of entity represented by a set of discrete features. StarSpace is able to embed different types of entities in the same space. This is useful for document classification (classify by finding nearest labels to a given document) or recommendations (recommend items to a given user by finding nearest items). Wu et al. report state-of-the-are results in a variety of tasks. Their model is also very fast, partially due to the use of Hogwild [Recht et al., 2011] optimizer, which is a parallel asynchronous version of stochastic gradient descent. As proved by Levy & Goldberg [Levy and Goldberg, 2014], when skip-gram is optimized with negative sampling, it is implicitly factorizing a word-context co- occurrence matrix. To be more specific, this factorization can be seen as truncated Singular Value Decomposition. Similar observation was made by Pennington et al. [Pennington et al., 2014]. Moreover, the authors propose their own embedding method, dubbed GloVe, where they explicitly create co-occurrence matrix X for all vocabulary words. Each cell xi,j of the matrix represents the number of times words i occurs in the same context as word j. This defines the probability that word j appears in the same context as word i: Pi,j = xi,j xi , (2.35) where xi is the number of occurrences of the word i. Non-zero elements of this sparse co-occurrence matrix are passed as an input to the GloVe learning algo- rithm. More recent embedding methods were proposed by Shazeer et al. [Shazeer et al., 2016] and by Xun et al. [Xun et al., 2017]. The first of those methods is called Swivel and was designed to work in a distributed environment and be trained with larger text corpora than word2vec or GloVe. The second method assumes that embeddings are learned not from a continuous corpora but from a set of text documents. This allows it to leverage both local and global contexts when learning embeddings. Local context is interpreted as co-occurrence matrix while global context is a topic model for an enclosing document 2.3.5 Applications of word embeddings to non-NLP do- mains Interestingly, language modeling can be applied also to non-NLP domains. This is possible because words in sentences can be treated as just some identifiers in some sequences. For example, Perozzi et al. [Perozzi et al., 2014] apply word2vec to 3Available at https://github.com/facebookresearch/fastText 4Reference implementation https://github.com/facebookresearch/ available at StarSpace 24 learn distributed representations of vertices in social networks. In order to achieve this, they apply truncated random walks in networks and they treat the walks as sentences. To resemble sentences, walks need to start from random places in the graph and be truncated after passing a few nodes. Embeddings are learned as an auxiliary task of predicting vertex given previously visited vertices. They call their method DeepWalk. The authors demonstrate state-of-the-art results in multi-label classification tasks. An extension of DeepWalk is node2vec [Grover and Leskovec, 2016]. Instead of learning representations of vertices, the authors suggest learning representations of nodes in a graph. node2vec outperforms DeepWalk in the multi-label classification tasks. Word embedding models were also adapted for recommendation systems. For example, Spotify5 uses word2vec to learn 40-dimensional song embeddings. To this end, users' play lists (or play queues) are treated as sentences. The assumption is that songs occurring close to each other on play lists are similar. Embeddings are learned only for songs which have been played at least 500 times. This way, embeddings are learned for approximately 4 × 106 tracks. Feature vectors for newly added songs, or songs rarely played, are discovered using convolutional neural network based on only audio signals6. 2.3.6 Multi-sense word embeddings Word embeddings are extremely useful but they still have one limitation: they represent each word, even polysemous or homonymous one, by a single vector. Another problem with ambiguous words is that they pull clusters of separate word domains to each other. This is depicted in Fig. 2.4. We can alleviate this problem Figure 2.4: Polysemous word mouse pulls clusters of computer parts and cluster of domestic animals to each other. by crating a multi-prototype vector-space model, as described in Section 2.2.4. Recently researches have been trying to tailor the multi-prototype vector-space model to word embeddings. For example in [Huang et al., 2012] the authors present a new neural network model that learns word embeddings by predicting words based on their contexts (as in case of CBOW model) and on a global context. The global context is a weighted average of all word vectors in a given document. Then, they carry out context clustering as in [Reisinger and Mooney, 2010]. Since the clustering need to be performed separately for each word form the dictionary, this method does not scale well to very big dictionaries. 5One of the biggest music streaming services: https://www.spotify.com/ 6For details see https://youtu.be/ZOyBfpcFFVE?t=2488 25 keyboardtouchpadcomputerrathamstercatmouse Even more revolutionary work is [Neelakantan et al., 2014], where the authors propose a multi-sense skip-gram (MSSG) model. It is an extension of skip-gram that directly learns multiple sense vectors of words. As in the case of skip-gram, they train a neural network to predict context words and they get embeddings as a side effect of optimization. However, instead of conditioning prediction on a center word vector they condition it on a center word sense vector. To this end, for each training example they predict a sense of the center word, prior to predicting a context words. They do this by first measuring similarity between a context vector and cluster centers for all learned senses and then selecting a sense (clus- ter) that is nearest to the context. They build context vector by averaging global vectors of context words. Global vectors are trained in addition to sense vectors and are used exclusively to build vectorized representations of contexts. Cluster centers are stored for all senses of all vocabulary words and are updated after each training example. Neelakantan et al., evaluate the MSSG model in the word similarity task, with a special accent on contextual word similarity. The model outperforms state-of-the-art models, in particular [Huang et al., 2012, Mikolov et al., 2013a]. One advantage of [Neelakantan et al., 2014] over [Huang et al., 2012] is that the former does not require explicit context clustering prior to net- work training. However, context clustering is still implicitly performed during the network training. Therefore, this model cannot be seen as purely probabilistic, which can be considered as its limitation. A probabilistic model for learning multi-sense embeddings was proposed in [Tian et al., 2014]. Their model is called multi-prototype skip-gram (MPSG). The authors use finite Gaussian mixture model to model word senses. Its latent variables are estimated using expectation-maximization (EM) algorithm [Dempster et al., 1977]. MPSG gives almost as good results in contextual word similarity task as [Huang et al., 2012]. At the same time it is much faster and memory efficient than [Huang et al., 2012]. MPSG assumes a fixed number of word meanings. This limitation is addressed by adaptive skip-gram (AdaGram) model proposed in [Bartunov et al., 2016]. This model can be seen as a non-parametric vari- ant of [Tian et al., 2014], where a number of senses is discovered separately for each word. Specifically, AdaGram employs a Dirichlet process to model multiple senses. Latent variables in AdaGram are also estimated using an instance of the EM algorithm. The authors test their solution in a word sense induction task and for that they introduce a new Wikipedia Word-sense Induction (WWSI) dataset consisting of almost 200 target words and over 3.5 × 104 contexts. They also suggest that contextual word similarity task is not a good evaluation method for multi-sense word embeddings models. This opinion is confirmed by an observation made by [Upadhyay et al., 2017], that achieving good results in the word sense induction task does not necessarily correlates with good results in the contextual word similarity task. This also correlates with the observation made by [Faruqui et al., 2016] that word similarity evaluation is not a good criterion not only for multi-sense word embeddings but even for single-sense embeddings. The authors of [Qiu et al., 2016] point out that both [Tian et al., 2014] and [Bar- tunov et al., 2016] model sense embedding based on single sense word embeddings of context words (i.e. global vectors). They propose a novel probabilistic model that takes into account the relations between senses of neighboring words. Specif- ically, they use a hidden Markov model, where words are observations and senses 26 are hidden states. Latent parameters of their model are estimated using a vari- ant of the EM algorithm. They report state-of-the-art results on a word sense induction task. A slightly different approach is presented by [Liu et al., 2015], where the au- thors use topic modeling to discover multiple word senses. Specifically, they use latent Dirichlet allocation [Blei et al., 2003] to model hidden topics over all vo- cabulary words. In this context the topics are interpreted as senses. Therefore, a probability distribution over all the senses is associated with each word. There are also models that learn multi-sense embeddings using external on- tology (e.g. WordNet). Examples are [Chen et al., 2014, Jauhar et al., 2015]. Finally, in [Li and Jurafsky, 2015], the authors discuss usefulness of multi-sense word models. They show that in some NLP tasks multi-sense embeddings do not outperform single-prototype ones. 2.3.7 Paragraph and document embeddings Until now we were discussing distributed representations of words. However, in many cases it is useful to have distributed representations of paragraphs or even whole documents. The simplest way to do this is to take a weighted average of embeddings of all words that occur in a given document. One active field of re- search is to directly learn distributed representations of groups of words or even whole documents. Probably the most important work that goes in this direc- tion is the Paragraph Vector [Le and Mikolov, 2014] model, commonly known as doc2vec. Paragraph Vector is a simple yet powerful extension to word2vec. As in case of word2vec, Paragraph Vector is not a single algorithm, but two concep- tually different, yet computationally similar, models. They are Paragraph Vector Distributed Memory (PV-DM) and Paragraph Vector Distributed Bag of Words (PV-DBOW). PV-DM, like CBOW, tries to predict target word based on context words. However, unlike CBOW, PV-DM also takes a paragraph embedding (or a document embedding) as an input. Paragraph embedding can be either con- catenated with word embeddings or averaged. This approach is similar to the one proposed in [Huang et al., 2012]. However, in contrast to the model described in [Huang et al., 2012], paragraph embeddings in PV-DM model are not weighted average of word embeddings but separate vectors that are learned during training. As a result, PV-DM learns simultaneously both word embeddings and document embeddings. Paragraph Vector Distributed Bag of Words (PV-DBOW) is a simpler model than PV-DM. It predicts all words in the document based on the document em- bedding. Therefore, in contrast to PV-DM, PV-DBOW does not learn word em- beddings, but only document (or paragraph) embeddings. Both Paragraph Vector models work in two modes, namely training mode and inference mode. During training the model is fed with training data and document embeddings as well as softmax weights are modified. Later, when we generate embeddings for new, previously unseen documents, data is fed to the model in the same way, but only embeddings are modified in the optimization process. Softmax weights are fixed in the inference phase. The inference phase is not as time-consuming as the training phase. Nonetheless, the need to iteratively optimize the cost in order to obtain embeddings for new documents is one of the 27 weaknesses of Paragraph Vector. sification and sentiment analysis tasks. Both Paragraph Vector algorithms achieve state-of-the-art results on text clas- 2.4 Deep learning As we mention in Section 2.3.1, due to the vanishing and exploding gradient issue training neural networks with more than one hidden layer is challenging. Yet it is believed that the human brain works in a multi-tier fashion, where data is partially processed by different visual cortices at different abstraction levels. Therefore, for years researchers were trying to tackle the vanishing and exloding gradient problem. The breakthrough results were published by Hinton et al. in 2006 [Hinton and Salakhutdinov, 2006]. The authors noticed that the error backpropagation can be successfully employed to train multilayer neural networks as long the weights are not randomly selected but already carry some knowledge about the training data. To this end, the authors used a so-called deep belief network (DBN), which is a stack of restricted Boltzman machines (RBMs), to pre-train the network. This pre-training phase is unsupervised, i.e. it does not require labeled data. In practice, Contrastive Divergence or Persistent Contrastive Divergence [Tiele- man, 2008] learning algorithms are often used to train RBMs layer-by-layer. After pre-training, the network can be fine-tuned in either supervised or unsupervised manner. In the first case, the network is treated as a standard multilayer percep- tron (MLP) and is fine-tuned with backpropagation algorithm, where the model loss is calculated based on the labels. In the second case, the pre-trained network is unfolded to form a deep autoencoder, as the one presented in Fig. 2.5. In an Figure 2.5: A deep autoencoder with hidden layers h1 to h5 and weight matrices W1 to W6. The goal of the training is to restore the output o that resemble input i as closely as possible. After the training, an encoder part of the autoencoder can be used to generate a low-dimensional representation h3 of input data i. unfolded network the second half of layers is an transposed copy of the first half. After unfolding, the deep autoencoder is fine-tuned using error backpropagation. The goal of the training of a deep autoencoder is to be able to recreate the input at the output of the network. As a result of the training, a fixed-size (often low- dimensional) representation of the input data is created in the center layer of the 28 ih1h2h3h4h5oW1W2W3W4W5W6encoderdecoder network. As reported in [Hinton and Salakhutdinov, 2006], both described deep architectures yielded state-of-the-art results on multiple tasks, including image classification and information retrieval. Hinton's work brought about a revival of interest in neural networks. Many important works were published in the years to come. Nair et al. showed [Nair and Hinton, 2010] that using a rectified linear function instead of a sigmoid function as an activation of hidden layers of the network noticeably improves the perfor- mance and stabilizes the training process. Srivastava at al. proposed [Srivastava et al., 2014] a new regularization method called dropout. Their idea is to randomly disable some fraction of units in hidden layers. More specifically, neurons' acti- vations are randomly set to zero with some specific probability (0.5 is a common value). Dropout quickly became an integral part of neural network researcher's toolbox. Wan et al. extended dropout to randomly disable some neurons' inputs, independently for each neuron in the layer. In order to achieve this, weights are randomly set to zero. Their method is called DropConnect [Wan et al., 2013] and they report results superior to dropout. More recent deep learning research showed that it is possible to efficiently train deep neural networks without the pre-training phase (e.g. [Martens, 2010]). However, it is believed that unsupervised, generative training is not less impor- tant than the supervised one and, therefore, researchers are trying to improve the performance of pre-trained networks as well. An example of work that goes in this direction is [Grzegorczyk et al., 2015a], where authors adapted the Sparse Initialization technique, originally proposed for the network trained without pre- training [Martens, 2010], to initialize deep belief network. Other modification to DBN training was proposed in [Grzegorczyk et al., 2016], where the authors encourage weight vectors to be orthogonal to each other during Contrastive Di- vergence training. The idea is not novel in itself, but it was previously applied only to the networks trained in an supervised manner. Other important deep learning research include batch normalization [Ioffe and Szegedy, 2015] and deep residual learning [He et al., 2016], which enables training of neural networks with hundreds or even thousands layers. A comprehensive introduction to deep learning can be found in [Goodfellow et al., 2016, LeCun et al., 2015]. 2.4.1 Deep architectures There are many architectures of deep neural networks. One of the most popular is a convolutional neural network (CNN). Originally CNNs were designed to process images. To this end, they process input data sequentially, using small sliding window. At each position of the window the same network weights are used. Due to this parameter sharing, input images can have high resolution , while weight matrices can be kept relatively small. One of the consequences of this architecture is that not all input neurons have connections to all output neurons. Because of this, they are not fully-connected layers. To combine results from outputs of convolutional layers, pooling layers are used. CNNs can have many alternated convolutional and pooling layers. CNNs obtain state-of-the-art results in object detection and scene classification tasks [LeCun et al., 1998, Krizhevsky et al., 2012, Szegedy et al., 2015]. Recently, they are used not only for image processing 29 but for other content types as well, including text (e.g. [Kim, 2014]). Another popular architecture is a recurrent neural networks (RNN). RNNs dates back to the down of artificial neural networks. While CNNs use shared parameters in space, RNNs use shared parameters in time. Prior to discovery of backpropagation algorithm, RNNs remained rather conceptual models without practical applications. A few years after backpropagation was proposed, its re- current variant, namely backpropagation through time [Werbos, 1990] (BPTT), was derived. However, since BPTT suffers from vanishing and exploding gradinet problem no less than the classic error backpropagation, training RNN was chal- lenging. One of the successful attempts to tackle this problem is to use memory cells with gated units, instead of simple neurons. This approach was introduced in the late 1990s in the form of long short-term memory (LSTM) [Hochreiter and Schmidhuber, 1997]. Many variants of LSTM have been developed. One of the extensions to the LSTM, which is gaining popularity, is Gated Recurrent Unit [Cho et al., 2014] (GRU). GRU is conceptually simpler than LSTM and perform no worse than it. In recent years we observe a resurgence in RNNs. For example, Sutskever et al. demonstrated [Sutskever et al., 2011] how one can build character-level lan- guage model by feeding big text corpus, character-by-character, to an RNN. After training, the model can predict with high accuracy the next character in a stream of text. This prediction can be used to automatically correct spelling mistakes or to implement an automatic language translation system. Graves [Graves, 2013] trained an RNN on handwritten characters. Trained model was able to generate sequences of images which, when combined, looked like handwritten text. In [Yuan et al., 2016] the authors demonstrate how to use LSTM networks to perform word sense disambiguation. RNNs are used not only in academia but are already be- coming popular in industry in form of production-ready software. For example Google Allo instant messaging mobile application uses LSTM-based RNN to sug- gest answers based on the conversation history7. LSTMs are also used for Smart Reply feature recently added to Gmail8. Another popular application of LSTM is an Apple's QuickType keyboard9, which suggest the next word to be typed. Finally, recurrent neural networks should not be confused with recursive neural networks. The later are designed to learn tree-like structures. One of the common applications is part-of-speech tagging. For example, [Zhu et al., 2015] combine RNNs with recursive networks to obtain state-of-the-art result on sentiment anal- ysis task. Another deep architecture that has been gaining popularity in the recent years is a generative adversarial network (GAN) [Goodfellow et al., 2014]. GAN is a system of two networks working together. One of the networks is responsible for stochastic generation of some type of data (e.g. images). The second network takes as an input either the output of the first network or the real data provided by the user. The second network is optimized to be able to distinguish whether the input was real or confabulated. However, the loss is also propagated to the 7https://research.googleblog.com/2016/05/chat-smarter-with-allo.html 8https://research.googleblog.com/2017/05/efficient-smart-reply-now-for-gmail. html 9https://www.techleer.com/articles/161-unfolding-of-rnn-popular-deep-learning-model 30 first network, which causes this network to learn to generate data that resemble real data. Consequently, the two networks compete with each other. GANs are used for, example, to generate highly realistic images, e.g. for computer games' scenes. Another neural architecture that has recently been successfully applied in deep settings is a siamese network. The siamese network is a neural model that consists of two or more identical subnetworks with shared parameters. The subnetworks are connected at the top by some output layer, which measure the difference between outputs of the two subnetworks. In general, supervised learning requires a lot of labeled data to perform well during prediction. However, sometimes we want the network to be able to distinguish objects based on just one example from each of the target classes. This is called one-shot learning and it is one of the main applications of deep siamese networks. Interestingly, the network is trained not with just one example from each class but multiple examples from each class. However, those classes are different than classes used during prediction. During training, pairs of examples are sampled from this multi-example-per-class training set. The pair consists of either two examples belonging to the same class or to two different classes. Effectively, the network learns to distinguish whether two examples belong to the same class or not. In the actual reference dataset, as we mention above, we have just one example from each of the test classes. Prediction boils down to comparing a test example with all of examples from this single- example-per-class dataset and selecting the class of the most similar example. Recently, convolutional siamese network proved to yield state-of-the-art results in one-shot image recognition task [Koch et al., 2015]. 2.4.2 Thought Vectors One could argue that Paragraph Vector models, described in Section 2.3.7, can be used to generate dense representations of sentences, by treating a sentence as a short document. However, recently some works have been published which directly address a vectorized representation of sentences. Those representations are often called though vectors. The name is based on an assumption that a single sentence carries just one thought. The most important work that goes in this direction is skip-thought vectors [Kiros et al., 2015]. The authors propose a model which is inspired by the skip-gram model from [Mikolov et al., 2013a]. Instead of predicting context words based on a given center word, they predict two surrounding sentences (one to the left and one to the right) based on a given center sentence. Prediction is done based on vectorized representations of sentences. The center sentence needs to be encoded to form a vector. Consequently, surrounding sentences need to be decoded. Skip-thought vectors is a generic approach. Any encoding and decoding model can be used. The authors of [Kiros et al., 2015] experimented with convolutional networks, LSTM-based recurrent networks and GRU-based networks. A single cost function is defined based on encoder and two decoders (for sentences to the left and right). The training leads to the optimal encoder and decoders parameters. After training, any sentence can be encoded to obtain its though vector. One advantage of skip-thought vectors over Paragraph Vector models is that the former does not require optimization at the test time, i.e. inference phase is not needed. 31 Kiros et al. reported state-of-the-art results, outperforming known methods on semantic relatedness, paraphrase detection and text classification tasks. How- ever, more recently, one simple baseline method was proposed, which outperforms skip-thought vectors. Specifically, Arora et al. [Arora et al., 2017] presented dense vectorized representation of sentences in form of weighted average of word em- beddings, where the weights are inversely proportional to word frequencies. What distinguishes Arora et al. approach from earlier similar ones is that, in addition to weighting, they remove from the weighted average its projection on its first principal component. Arora et al. provide a neat probabilistic interpretation of their method, which is based on the assumption that each sentence is backed by one discourse and computing the first principal component is used to estimate a discourse vector. 2.5 Cluster analysis The goal of clustering is to group similar objects together or partition different objects into separate groups. Since there are many ways of defining similarity, there is multitude of clustering algorithms as well. Probably the simplest one is k-means algorithm. K-means partition observations represented by numerical features into k distinct groups. The algorithm starts with randomly assigning all observation to one of the k clusters. Then, we iteratively repeat two steps: 1. for each cluster compute its centroid by averaging observations' vectors feature-wise, 2. reassign each observation to a cluster with a centroid closest to the observa- tion. Euclidean distance is used to find the closest cluster. After convergence, we get data separated into k distinct groups with small within-cluster variance. Simplicity and low computational requirements leads to high popularity of k-means. There are many variations of this algorithm. One modification often used for clustering text documents is spherical k-means [Dhillon and Modha, 2001]. One serious limitation of k-means algorithms is that we have to specify the number of expected clusters. Sometimes we do not know in advance how many distinct groups there are in our data. For experiments described later on in this dissertation we use hierarchical clus- tering algorithms. These algorithms do not require specifying an expected number of groups to which data should be partitioned. Hierarchical clustering can by ei- ther agglomerative or divisive. The former is a bottom-up approach, where we start with a separate cluster for each example in a dataset, and then we recur- sively group together the most similar clusters. The latter is a top-down approach, where we start with one big cluster containing all data examples, and then we re- cursively split it into more compact parts. There are many more clustering algorithms. Good overview of cluster analysis techniques is presented in [Aggarwal and Reddy, 2013]. A comprehensive survey of text document clustering methods can be found in [Anastasiu et al., 2013], which has been published as a chapter in [Aggarwal and Reddy, 2013]. 32 2.6 Novel vector representation of text data In Fig. 2.6 we summarize various ways of representing text data in a vector space. In the following chapters we propose solutions that fit to one of the four areas of this chart. Specifically, in Chapter 3 we introduce a novel binary dense rep- Figure 2.6: Vector representations of text data space with example models. resentation of text documents and demonstrate its applicability to information retrieval task. In Chapter 4 we propose a simple neural network model for learn- ing multi-sense word embeddings. In both cases we compare proposed models with competing state-of-the-art solutions and demonstrate their superiority. 33 sparsedenseworddocumentBoWword2vecPVone-hotGloVeBinary PVDisamb. S-G Chapter 3 Binary Paragraph Vector models We live in the age of big data. Every day all around the world vast amount of data is collected by a variety of sensors, logging systems, CCTV cameras and other devices. Moreover, due to social media popularity user generated content is also growing at a very high rate. Data growth is considered to be exponential. According to [Gantz and Reinsel, 2012] amount of digital data double every two years. Therefore, being able to search and retrieve relevant information from huge datasets in relatively short time is crucial. Basic information retrieval models, described in Section 2.2, are not sufficient when the search space is large. In many cases users are willing to compromise on quality of search results in favor of fast retrieval. They prefer to have good but not ideal results immediately, rather than the best possible results after some delay. One of the approaches that goes in this direction is approximate nearest neighbor (ANN) search, pioneered by [Arya et al., 1998]. There are many ANN algorithms available. Many of them employ hashing. Hashing groups documents into buckets. Each bucket has a short unique address. A fast hashing function computes the address based on the content of the document, enabling access in a constant time to other documents from the same bucket. If the hashing function returns similar addresses (i.e. addresses that differ in few bits only) for similar documents, then in order to perform search we could compute an address for the query, and then retrieve documents in the query's bucket and nearby buckets. This idea was first implemented as Locality Sensitive Hashing (LSH) [Indyk and Motwani, 1998, Broder, 1997] in the late 1990s, and since then was extended in a variety of ways [Charikar, 2002, Gong and Lazebnik, 2011, Wang et al., 2014]. Most of the algorithms from this family are data-oblivious, i.e. can generate hashes for any type of data. Nevertheless, some methods target specific kind of input data, like text, image or speech. Thanks to deep learning a family of locality-preserving hashing methods is growing rapidly. For example, Deng et al. [Deng et al., 2010] demonstrated how to generate short binary codes of speech spectrograms. More recently, Lin et al. [Lin et al., 2015] generated binary hash codes of images using convolutional neural network trained in supervised manner. Binary codes have also been applied to fast cross-modal retrieval [Wang et al., 2013, Masci et al., 2014]. Fast retrieval of text documents was the main motivation for semantic hashing model proposed by Salakhutdinov & Hinton [Salakhutdinov and Hinton, 2009]. The authors employ a deep autoencoder with a narrow coding layer to generate memory addresses of documents. As described in Section 2.4, the deep autoen- 34 coder weights are pre-trained using deep belief network, i.e. stacked restricted Boltzman machines, in a generative fashion. Then, decoder layers are created as transposed copy of encoder layers and the whole network is fine-tuned using error backpropagation. To make codes binary the authors used a sigmoid coding layer in the autoencoder. However, that in itself would not be sufficient, since sigmoid values could get stuck in a very narrow range and, therefore, not generalize well. To force sigmoid activations to be distributed, the authors proposed to add Gaus- sian noise to the inputs of logistic units. To counterbalance the noise, the network will learn to have activations either close to zero or close to one. A standard deviation of the Gaussian noise was selected based on the validation set. After training, test data was feed through the encoder and its output was rounded to obtain binary codes. Semantic hashing is reported to yield slightly better results than LSH and to be up to 50 times faster. However, it still has one limitation. The approach proposed by Salakhutdinov & Hinton assumes that documents passed to the autoencoder network are presented in a form of relatively low-dimensional bag-of-words vectors. As discussed throughout this dissertation, there are good representations that can capture a lot more of the semantic content of documents. Therefore, it would be desirable to be able to generate hashes from raw text documents, instead of their BoW representations. In this chapter we propose a shallow neural network which does exactly that. We combine semantic hashing with the Paragraph Vector model [Le and Mikolov, 2014]. As the former, our model enables generation of relatively short binary codes of documents that compress or summarize their content. However, in contrast to the original semantic hashing network, our model takes raw text documents as an input. Therefore, our model combines two formerly separate approaches, namely document embedding and semantic hashing, in one. 3.1 Model architecture As described in Section 2.3.7, in their 2014 paper Le & Mikolov proposed not a single machine learning model, but two separate ones: Paragraph Vector Dis- tributed Memory (PV-DM) and Paragraph Vector Distributed Bags of Words (PV-DBOW). To learn binary codes we added a rounded sigmoid function to these two models. The resultant Binary Paragraph Vector models are depicted in Fig. 3.1 and Fig. 3.2. Modifications to the original Paragraph Vector models are highlighted in blue. Figure 3.1: The Binary PV-DBOW model. Modifications to the original PV- DBOW model are highlighted in blue. 35 document'swordsampledsoftmaxroundedsigmoidembeddinglookupreal-valuedembeddingbinaryembeddingdocument Figure 3.2: The Binary PV-DM model. Modifications to the original PV-DM model are highlighted in blue. As mentioned above, Salakhutdinov & Hinton added Gaussian noise to the inputs of logistic units. Later, Krizhevsky & Hinton demonstrated [Krizhevsky and Hinton, 2011] that binarization can be done in a simpler way. In particular, they rounded the output of the logistic function during training to obtain binary activations. This approach resemble the initial McCulloch & Pitts neuron model with the Heaviside step function, which makes hard decisions. However, since the rounded logistic function is not smooth, its derivative cannot be calculated everywhere (it is zero for every value except 0.5 and positive infinity at 0.5). To overcome this limitation, Krizhevsky & Hinton propose to compute gradients for binarized layer like for a standard smooth logistic layer. An alternative way for learning binary codes is to use binary stochastic neu- rons (BSN) instead of deterministic ones. BSN yield 0 or 1 at its output with a probability specified by the pre-acitvation. There are many variants of BSNs. We evaluate some of them in Section 3.2.5. Nevertheless, of all tested approaches, the Krizhevsky's method yielded the best results in our preliminary experiments. Therefore, we chose the Krizhevsky's approach as a binarization method in our models. When seen as neural networks, both original Paragraph Vector models have just one hidden layer with a linear activation function. The modification introduced in this chapter can be seen as a non-linear activation function for the hidden layer of those networks. 3.1.1 Distributed bag of n-grams The paragraph vector distributed bag of words model learns paragraph embedding by predicting all words in a document. Unlike the PV-DM model, PV-DBOW does not take a word context as an input, and therefore could be considered a weaker model. We attempted to alleviate this weakness. Instead of predicting document's words we tried to predict document's n-gram, i.e. sequences of consecutive words in the document. We discovered that when predicting all words and all bigrams we get up to 5% improvement over the un- 36 sampledsoftmaxroundedsigmoidconcatenatedcontextbinaryconcatenatedcontextdocumentembeddinglookupwordembeddinglookupdocumentcentralword...context words igram model. Adding trigrams to the dictionary does not further improve the performance. It is beneficial to take all words from a dictionary and all bigrams. However, for large corpora the set of all uni- and bi-grams will be big and, therefore, the output layer weigh matrix could be too big to fit in the memory. Therefore, in practice the dictionary should be as big as possible, depending on available memory. The dictionary can be shrunk by taking only a predefined number of globally most popular n-gram, or n-grams that occur no less than a specified number of times in the corpus. Finally, this extension is applicable only to the PV-DBOW model, since in the case of PV-DM we explicitly predict center word (unigram) based on its context. After conducting experiments with n-grams in binary PV-DBOW model we discovered that similar observation was previously made by Li et al. [Li et al., 2015]. However, they demonstrate the use of n-grams in a sentiment analysis task only and on one dataset only. We show that inclusion of n-grams improves information retrieval results as well. One more observation by Li et al. that coincides with ours is that, contrary to the Le and Mikolov's claims, PV-DBOW outperforms PV-DM, in spite of having simpler architecture. This observation is also confirmed by [Lau and Baldwin, 2016]. Implementation 3.1.2 The proposed models have been implemented using the TensorFlow library. In addition to the models proposed above, we also implemented the original PV- DBOW and PV-DM models, to generate 32-bit real-valued codes. In the case of the PV-DBOW model, training data consists of pairs of document and n-gram identifiers. In the case of PV-DM, a single training example consists of a document identifier, context words identifiers and a center word identifier. Training examples are globally shuffled and split into mini-batches. It is important to shuffle examples globally, not only within documents. When training with examples shuffled only within documents, the networks fit to the leading documents in a dataset, which consequently leads to poor overall performance. This requirement poses a technical challenge, since training set size often exceeds available memory. Resorting to distributed computing1 is often the only solution. Shuffled training examples can be written to a file and then the network can be trained in an online fashion with low memory requirements, by reading examples from the file in mini-batches. At the input to the network, both word and document identifiers have to be pre- sented using one-hot representation. Luckily, we do not need to convert identifiers into one-hot codes. TensorFlow provides an embedding_lookup function, which takes integer identifiers and the embedding matrix as inputs and returns embed- dings associated with provided identifiers. In the case of PV-DBOW this function effectively implements the whole first layer of the network depicted in Fig. 2.3. As explained in Section A.2.1, TensorFlow is multi-threaded by nature and uses as many CPU or GPU cores as available. However, sometimes computations are slowed down by I/O operations. To speed up training, we feed mini-batches to TensorFlow session from multiple threads. This way the overall training time is 1Global shuffling can be easily done using Apache Hadoop or Apache Spark distributed pro- cessing frameworks. 37 shortened approximately 6 times. However, since we use Python API, all threads from our thread pool use just one CPU core. This is due to the global interpreter lock, a standard Python mechanism that prevents multiple threads from running in parallel. To overcome this limitation, we could use multiple processes to feed the data. However, in order to share a TensorFlow session between processes, we would have to set up a distributed TensorFlow cluster. There are at least two ways of implementing the Krizhevsky's approach to bi- narization. One is based on the stop_gradient TensorFlow function. This function prevents gradients from being computed for all tensors that constitute an input to it. The Krizhevsky's binarization can be implemented in the following way: f (x) = σ(x) + stop_gradient(round(σ(x)) − σ(x)), (3.1) where x are inputs to the binarized sigmoid corresponding to the current mini- batch embeddings and f (x) is a hidden layer activation function. Effectively, in the forward pass f (x) is an identity function and, therefore, Eq. 3.1 is reduced to: (3.2) In the backward pass, the graph vertices that rely on stop_gradient are blocked and consequently gradients are computed for: ff orward(x) = round(σ(x)). fbackward(x) = σ(x). (3.3) As an alternative implementation, we can override gradient function for the round operation with identity function. We can do this easily since TensorFlow allows to override gradient functions for selected operations. 3.2 Experiments We tested our implementation in an information retrieval task using three popu- lar text datasets: 20 Newsgroups, RCV1-v2 and English Wikipedia. The datasets are described in Section A.1. We removed stopwords, words shorter than two characters and words longer than 15 characters. We also experimented with stem- ming the corpora, but ultimately we discovered that stemming does not improve performance, and decided not to apply it. Our model has a lot of hyperparameters. Performing a full grid search over all the hyperparameters would be infeasible. Therefore, we decided to make some reasonable choices based on common sense. We decided to use AdaGrad [Duchi et al., 2011] optimization method, since it performed better than other methods we used in preliminary experiments (in addition to AdaGrad we experimented with stochastic gradient descent with momentum, Adam [Kingma and Ba, 2014], Adadelta [Zeiler, 2012] and FTRL [McMahan et al., 2013] optimizers). Mini batch size was set to 128. As explained in Section 2.3.4, in the Paragraph Vector model, as well as in word2vec, gradient of the softmax function need to be approximated. To approximate this gradient we used sampled softmax method [Cho et al., 2015] with 64 classes (words or n-grams from the dictionary) sampled for each mini- batch. Embeddings were initialized with random numbers drawn from an uniform distribution in the range [− 0.5 d ], where d is an embedding size. Prediction layer weights and biases were initialized with zeros. d , 0.5 38 In the case of the PV-DM model we decided to concatenate a document em- bedding with context words embeddings, instead of summing or averaging. This way order of words within a context is not lost and also the dimensionality of the document embeddings is not tied to the dimensionality of the word embeddings. We experimented with different windows sizes. To our surprise, the best result was obtained for a minimal one-word one-sided window. To verify correctness of our implementation, we trained the PV-DM model implementation available in a popular gensim [Rehurek and Sojka, 2010] library on both the 20 Newsgroups and RCV1-v2 datasets for different window sizes. As in the case of our imple- mentation, the best results were obtained for a context window of size just 1. One explanation for this observation could be that 20 Newsgroups and RCV1 are too small datasets to learn high-quality word embeddings. If word embeddings, which are learnt alongside document embeddings, are of low quality, then instead of helping to predict the center word they could make the prediction harder. To select remaining hyperparameters we created a validation subset by ran- domly extracting 25% documents from the training set. To improve quality of the embeddings we applied dropout [Srivastava et al., 2014] during training. The probability of keeping the activations was selected on the validation sets separately for the PV-DBOW, Binary PV-DBOW, PV-DM and Binary PV-DM models and separately for each dataset. Two others hyperparameters that needs to be selected based on the validation sets are the epoch number and the learning rate. For sim- plicity, we decided to use the same learning rate in the training and the inference phase. All the experiment were conducted on the HP Apollo XL750f Gen9 liquid cooled HPC machines equipped with two Intel Xeon E5-2680v3 processors, 128 GB RAM and two Nvidia Tesla K40 GPUs. We used Python version 2.7.5 and TensorFlow version 0.11. As explained in Section A.2.1, TensorFlow is able to run the experiment on either CPU or GPU, and, when GPU is available, it is advised to run on it. However, at the time of conducting the experiments not all the TensorFlow kernels used in our model (e.g. AdaGrad optimizer) had GPU implementations. Therefore, some parts of the computation graph were evaluated on the GPU and some parts on the CPU. Information retrieval metrics 3.2.1 Probably the most popular metrics used to evaluate results of information retrieval (IR) systems are precision and recall. The precision tells us the fraction of relevant results among all returned results. The recall tells us the fraction of returned results among all relevant results. IR system rarely returns a single result. More often a list of ranked results, i.e. sorted by relevance, is returned. In practice, for ranking we often use cosine similarity in case of documents represented by real-valued vectors and the Hamming distance in case of documents represented by binary vectors. When we ask for a very limited number of results, e.g. 10, then most likely most of the results are relevant and, therefore, an average precision among them is high. When we increase the number of requested results, the precision is expected to decline but the recall will grow. If we query the system for all stored documents, then the recall will be 1 but the precision most likely be very low. 39 The datasets we use do not come with predefined sets of test queries. Therefore, in order to evaluate the performance of the model we sample a document from a test set and treat it as a query to retrieve relevant documents. We repeat this operation many times and average the results. To speed-up the computations we do this in mini-batches. First, we select some number of query documents. Then we compute similarity between those query documents and remaining test documents. We can do this in a batched way regardless whether we are using cosine similarity or the Hamming distance. Finally, we calculate relevancy by comparing with actual topic assignments. This comparison also is batched. To this end, we store labels as one-hot vectors (or a-few-hot vectors in the case of multi-label datasets) and we perform matrix multiplication between query documents labels and all test documents labels. Precision and recall are defined at specified cut-off level of ranked result list. To measure the performance of IR system precisions are often computed for all possible recall values. We can then plot a precision-recall curve. Systems having bigger area under the curve (AUC) perform better than those having lower area. One of the approximation to AUC is mean average precision (MAP). In order to compute average precision, we sum precisions at different recall levels and then divide it by the total number of relevant documents for a given query. MAP is an average precision averaged over all queries. One of the limitations of precision and recall metrics is that they work only for a binary relevance measure2. Sometimes, instead of telling whether the result is relevant to the query or not, it is better to specify the degree of relevancy. Some documents can be partially relevant to the query. The most popular IR metric used to evaluate multi-level relevance systems is normalized discounted cumulative gain at a k-th position (N DCG@k) [Järvelin and Kekäläinen, 2002]. The gain is just a different name for how a given document is relevant to the query. Cumulative gain at a specific position on the result list, e.g. on the 10-th position, is a sum of all the gains from the top to this position on the list. Discounted cumulative gain is a cumulative gain where gains further on the list are penalized in the following way: k(cid:88) ri log2 i i=2 DCG@k = r1 + , (3.4) where ri is a relevance of a document at the i-th position on the result list to the query. Finally, normalized DCG@k (N DCG@k) is a DCG at a position k divided by the 'ideal' DCG at this position, i.e. DCG for the case where most relevant documents are placed on the top of the result list. 20 Newsgroups 3.2.2 Since 20 Newsgroups is a relatively small dataset, we decided to predict all words (and, in the case of PV-DBOW, all bigrams) during training. The total num- ber of classes to be predicted for PV-DBOW (unique words and bigrams) was slightly over 106. Using the validation set we selected following hyperparameters: 10 training epochs, 50% dropout, learning rate 1.3 for PV-DBOW, 0.3 for Binary 2In practice, we can relax the definitions of precision and recall to deal with multi-level relevancy, but it is not a standard precision-recall definition 40 PV-DBOW, 1.2 for PV-DM and 0.2 for Binary PV-DM. In the case of the 20 Newsgroups dataset a relevancy measure is straightforward. If a retrieved docu- ment has the same label as a query document, then it is relevant. Otherwise it it not. Both Paragraph Vector and Binary Paragraph Vector results for different code sizes are reported in Tab. 3.1. The results were generated in the following way. Code dimensionality Model PV-DBOW 300 Binary PV-DBOW PV-DM Binary PV-DM PV-DBOW 128 Binary PV-DBOW PV-DM Binary PV-DM PV-DBOW 64 Binary PV-DBOW PV-DM Binary PV-DM PV-DBOW 32 Binary PV-DBOW PV-DM Binary PV-DM Include bigrams MAP NDCG@10 no yes no yes N/A no yes no yes N/A no yes no yes N/A no yes no yes N/A 0.37 0.43 0.28 0.32 0.38 0.29 0.4 0.45 0.34 0.35 0.41 0.34 0.42 0.46 0.36 0.36 0.43 0.33 0.43 0.46 0.32 0.32 0.43 0.29 0.75 0.76 0.68 0.71 0.73 0.63 0.75 0.75 0.69 0.69 0.73 0.65 0.74 0.74 0.65 0.65 0.72 0.6 0.71 0.72 0.53 0.54 0.7 0.49 Table 3.1: Information retrieval 20 Newsgroups results. The best binary results for each code dimensionality are highlighted. We took 200 recall values evenly distributed between 0 and 1. For each of those recall values we took the first document from the dataset and treated it as a query. All remaining documents were sorted according to relevance. The list was cut off when the given recall level was reached. For small recall values, cut-off level was close to the beginning of the list. For higher recall values, more documents had to be taken to reach the expected recall. Afterwards we evaluated the precision among the documents remaining in the list. The whole procedure was repeated for all test documents in the dataset, i.e. each document in turn was treated as a query. Obtained precision values were averaged. 41 To shed more light on the information retrieval results we also drew the precision-recall curves Fig. 3.3. The curves are generated by connecting aver- (a) 300 dimensions (b) 128 dimensions (c) 64 dimensions (d) 32 dimensions Figure 3.3: The 20 Newsgroups dataset precision-recall curves for different code dimensionalities and different model variants. For real-valued codes cosine distance was used as a similarity measure. For binary codes the Hamming distance was used as a similarity measure. For comparison, on plot (b) we also report results from [Salakhutdinov and Hinton, 2009, Fig. 6]. aged precision values for 200 different recall values evenly distributed between 0 and 1. As expected, binary codes give worse results than real-valued ones, but the difference is very small. Taking into account that binary codes use 32 times less memory than floating point ones, the closeness of the results seem to be impres- sive. The results are also much better than the seminal semantic hashing results. For example, 128-dimensional binary codes results are almost 20% higher than those reported in [Salakhutdinov and Hinton, 2009]. The precision-recall curves reveal that PV-DBOW gives slightly better results than PV-DM for both real-valued and binary codes. Since this behavior is contrary to the results reported in [Le and Mikolov, 2014], we verified experiments for floating point codes using the gensim library. Surprisingly, we identified a similar trend. As discussed earlier, this behavior can be caused by relatively small dataset size, not sufficient for PV-DM to perform well. In addition to the information retrieval experiment we also generated two- 42 10-210-1100Recall0.00.10.20.30.40.50.60.70.80.9PrecisionPV-DBOW uni- & bi-gramsPV-DBOW unigrams onlyBinary PV-DBOW uni- & bi-gramsBinary PV-DBOW unigrams onlyBinary PV-DM10-210-1100Recall0.00.10.20.30.40.50.60.70.80.9PrecisionPV-DBOW uni- & bi-gramsPV-DBOW unigrams onlyBinary PV-DBOW uni- & bi-gramsBinary PV-DBOW unigrams onlyBinary PV-DMSemantic hashing10-210-1100Recall0.00.10.20.30.40.50.60.70.80.9PrecisionPV-DBOW uni- & bi-gramsPV-DBOW unigrams onlyBinary PV-DBOW uni- & bi-gramsBinary PV-DBOW unigrams onlyBinary PV-DM10-210-1100Recall0.00.10.20.30.40.50.60.70.80.9PrecisionPV-DBOW uni- & bi-gramsPV-DBOW unigrams onlyBinary PV-DBOW uni- & bi-gramsBinary PV-DBOW unigrams onlyBinary PV-DM dimensional visualizations of coded for documents from selected newsgroups. To reduce dimensionality from that of our model (respectively 32, 64, 128 and 300 dimensions) to two we used the stat-of-the-art t-distributed Stochastic Neighbor Embedding (t-SNE) [van der Maaten and Hinton, 2008] method. The visualiza- tions of real-valued codes are presented in Fig. 3.4 and of binary codes in Fig. 3.5. (a) 300 dimensions (b) 128 dimensions (c) 64 dimensions (d) 32 dimensions Figure 3.4: t-SNE visualizations of real-valued point codes of seven selected newsgroups from the 20 Newsgroups dataset for different code dimensionali- ties. Cosine distance was used as a similarity measure. Selected groups: green - soc.religion.christian, red - talk.politics.guns, blue - rec.sport.hockey, brown - talk.politics.mideast, magenta - comp.graphics, black - sci.crypt. The selection of newsgroups and colors are the same as in [Salakhutdinov and Hinton, 2009, Fig. 5]. As we can see, binary codes provide almost as good visual separation of topics as real-valued ones. Moreover, the separation appears to be better than the one presented in [Salakhutdinov and Hinton, 2009]. 3.2.3 RCV1 Since the RCV1-v2 corpus is approximately 35 times bigger than 20 Newsgroups its set of unique uni- and bigrams is much bigger as well. Specifically, it has ap- proximately 107 elements. Using such a big dictionary would require huge softmax weight matrix. Therefore, we shrank the dictionary by taking uni- and bigrams 43 (a) 300 dimensions (b) 128 dimensions (c) 64 dimensions (d) 32 dimensions Figure 3.5: t-SNE visualizations of binary codes of seven selected newsgroups from the 20 Newsgroups dataset for different code dimensionalities. The Hamming distance was used as a similarity measure. The color-group mappings are the same as in Fig. 3.4. occurring at least 10 times in the training set. Resultant dictionary has approxi- mately 8 × 105 elements. Following [Salakhutdinov and Hinton, 2009], to form a test set we split the dataset into two halves. Experiments on the validation set revealed that the optimal epoch number for RCV1 is just one, learning rate 1.1 for PV-DBOW, 0.4 for Binary PV-DBOW, 1.1 for PV-DM and 0.5 for Binary PV- DM. Validation experiments also established 50% dropout rate for PV-DBOW, 30% rate for Binary PV-DBOW and 10% dropout rate for PV-DM and Binary PV-DM. In the case of the RCV1 dataset, deciding whether the document is relevant to the query or not is not as straightforward as in the case of the 20 Newsgroups dataset. As explained in Section A.1.2, each document is not assigned to a single topic but is described by a hierarchy of topics. Therefore, we cannot apply a binary relevance measure. Instead, we calculate the relevance as a fraction of overlapping labels in a retrieved document and a query document. The same strategy was adopted by Salakhutdinov and Hinton. Results for both Paragraph Vector and Binary Paragraph Vector for differ- ent code sizes are reported in Tab. 3.2. The results were calculated similarly to 44 Code dimensionality Model PV-DBOW 300 Binary PV-DBOW PV-DM Binary PV-DM PV-DBOW 128 Binary PV-DBOW PV-DM Binary PV-DM PV-DBOW 64 Binary PV-DBOW PV-DM Binary PV-DM PV-DBOW 32 Binary PV-DBOW PV-DM Binary PV-DM Include bigrams MAP NDCG@10 no yes no yes N/A no yes no yes N/A no yes no yes N/A no yes no yes N/A 0.25 0.26 0.21 0.23 0.22 0.18 0.25 0.27 0.22 0.24 0.23 0.18 0.26 0.27 0.23 0.25 0.23 0.18 0.26 0.27 0.22 0.25 0.23 0.17 0.79 0.8 0.76 0.78 0.78 0.72 0.79 0.8 0.74 0.77 0.78 0.69 0.77 0.79 0.69 0.74 0.78 0.63 0.75 0.77 0.6 0.66 0.77 0.53 Table 3.2: Information retrieval RCV1 results. The best binary results for each code dimensionality are highlighted. the 20 Newsgroups case. However, since RCV1 is a much bigger dataset, treat- ing each document as a query would be computationally prohibitive. Therefore, we randomly selected 10 percent of test documents as queries. Comparison of precision-recall curves is depicted in Fig. 3.6. As in the case of the 20 News- groups dataset, PV-DBOW gives slightly better results than PV-DM. Results for 128-dimensional binary codes are approximately 20% higher than those reported in [Salakhutdinov and Hinton, 2009]. We also generated two-dimensional visualizations of codes for selected topics from the RCV1 dataset. They are presented in Fig. 3.7. Topic selection and color assignment are the same as in [Salakhutdinov and Hinton, 2009, Fig. 5]. Three of five topics are clearly separated. Within two topics, i.e. government borrowing and accounts/earnings, a few subgroups can be discerned. 45 (a) 300 dimensions (b) 128 dimensions (c) 64 dimensions (d) 32 dimensions Figure 3.6: The precision-recall curves for the RCV1 dataset for different code di- mensionalities and model variants. For real-valued codes cosine distance was used as a similarity measure. For binary codes the Hamming distance was used as a sim- ilarity measure. For comparison, in plot (b) we also report results from [Salakhut- dinov and Hinton, 2009, Fig. 7]. 3.2.4 English Wikipedia In order to test Binary PV models with dataset even bigger than RCV1 we trained them on the English Wikipedia snapshot3, which has almost 4 × 106 articles. We used words and bigrams with at least 100 occurrences, which gives a vocabulary with approximately 1.5 × 106 elements. To test our models we held out randomly selected 10% of all articles. From the remaining documents we took another 10% to form a validation set, which was used to select model hyperparameters. The following hyperparameters were selected with validation experiments: learning rate 1.4 for PV-DBOW, 0.9 for Binary PV-DBOW, 0.5 for PV-DM and 0.6 for Binary PV-DM. A dropout rate of 10% for PV-DBOW and Binary PV-DBOW, and no dropout for PV-DM and Binary PV-DM. To assess the relevancy of articles from English Wikipedia we employ categories assigned to them. Since Wikipedia categorization is complex (see Section A.1.3 for details), we adopted a simplified relevancy measure: two articles are relevant if 3From April 5th, 2016 46 10-210-1100Recall0.10.20.30.40.50.60.7PrecisionPV-DBOW uni- & bi-gramsPV-DBOW unigrams onlyBinary PV-DBOW uni- & bi-gramsBinary PV-DBOW unigrams onlyBinary PV-DM10-210-1100Recall0.00.10.20.30.40.50.60.7PrecisionPV-DBOW uni- & bi-gramsPV-DBOW unigrams onlyBinary PV-DBOW uni- & bi-gramsBinary PV-DBOW unigrams onlyBinary PV-DMSemantic hashing10-210-1100Recall0.10.20.30.40.50.60.7PrecisionPV-DBOW uni- & bi-gramsPV-DBOW unigrams onlyBinary PV-DBOW uni- & bi-gramsBinary PV-DBOW unigrams onlyBinary PV-DM10-210-1100Recall0.10.20.30.40.50.60.7PrecisionPV-DBOW uni- & bi-gramsPV-DBOW unigrams onlyBinary PV-DBOW uni- & bi-gramsBinary PV-DBOW unigrams onlyBinary PV-DM (a) 300 dimensions (b) 128 dimensions (c) 64 dimensions (d) 32 dimensions Figure 3.7: t-SNE visualizations of binary codes of six selected topics from the RCV1 dataset for different code dimensionalities. The Hamming distance was used as a similarity measure. Selected topics: green - disasters and accidents, red - government borrowing, blue - accounts/earnings, magenta - energy markets, black - EC monetary/economic. they share at least one category. We also removed from the test set categories with less than 20 documents as well as documents that were left with no categories. Overall, the relevancy is measured over almost 106 categories, making English Wikipedia harder than the previous two benchmarks. Results for Paragraph Vector and Binary Paragraph Vector for different code sizes are reported in Tab. 3.3. As in the case of RCV1, when calculating these num- bers we randomly selected 10 percent of test documents and used only those docu- ments as queries. Results for this benchmark are weaker than in the case of the two previous datasets. This is not a surprise, since Wikipedia has a much wider range of topics than both 20 Newsgroups and RCV1. Comparison of precision-recall curves is depicted in Fig. 3.8. To obtain those results we needed to overcome some technical difficulties stemmed from dataset size. As explained in Section 3.2.1, in order to compute relevancy between query documents and test documents in a batched way, we perform matrix multiplication between a mini-batch of query document labels and all test document labels. To this end, we need to store la- bels in a one-hot (or a few-hot) format. Since there are approximately 106 labels 47 Code dimensionality Model PV-DBOW 300 Binary PV-DBOW PV-DM Binary PV-DM PV-DBOW 128 Binary PV-DBOW PV-DM Binary PV-DM PV-DBOW 64 Binary PV-DBOW PV-DM Binary PV-DM PV-DBOW 32 Binary PV-DBOW PV-DM Binary PV-DM Include bigrams MAP NDCG@10 no yes no yes N/A no yes no yes N/A no yes no yes N/A no yes no yes N/A 0.25 0.26 0.15 0.2 0.25 0.18 0.25 0.26 0.18 0.18 0.24 0.16 0.24 0.26 0.17 0.19 0.24 0.16 0.23 0.25 0.16 0.17 0.23 0.15 0.59 0.61 0.46 0.54 0.59 0.51 0.59 0.6 0.48 0.49 0.59 0.46 0.58 0.6 0.46 0.49 0.57 0.44 0.55 0.58 0.41 0.44 0.55 0.41 Table 3.3: Information retrieval results for English Wikipedia. The best binary results for each code dimensionality are highlighted. and 105 test documents, storing labels as dense matrices would be very memory demanding. Therefore, we store them in a sparse, compressed row matrix format. 3.2.5 Comparison of binarization methods As stated in Section 3.1, instead of the deterministic binarization method, pro- posed by Salakhutdinov and Krizhevsky, one can also employ binary stochastic neurons. Binary stochastic neurons yield either 0 or 1 at their output. In order to train the network with BSNs using error backpropagation one needs to estimate the gradient of the expected loss under stochastic activations. Probably the simplest gradient estimator for BSNs is the straight-through esti- mator proposed by Bengio et al. [Bengio et al., 2013, section 4]. In this approach it is assumed that errors are backpropagated as if BSN was the identity function. 48 (a) 300 dimensions (b) 128 dimensions (c) 64 dimensions (d) 32 dimensions Figure 3.8: The English Wikipedia precision-recall curves for different code di- mensionalities and different model variants. For real-valued codes cosine distance was used as a similarity measure. For binary codes the Hamming distance was used as a similarity measure. Therefore, the gradient is simply: dBSN (a) da = 1, (3.5) where a is neuron pre-activation. Bengio et al. also consider a modification to the straight-through estimator, where the gradient equals the derivative of the sigmoid function used to calculate the probability of activation of the BSN: dBSN (a) da = dσ(a) da = σ(a)(1 − σ(a)). (3.6) Bengio et al. assert that Eq. 3.6 produces better results than Eq. 3.5. However, Raiko et al. claim the opposite [Raiko et al., 2014, section 3]. We therefore consider both variants in our evaluation. Performance of BSNs can be improved by using the slope-annealing trick pro- posed by Chung et al. [Chung et al., 2016, section 3.3]. The idea is to gradually increase the slope s of the sigmoid function during training to increase the prob- ability of activation P : P = σ(s ∗ a). 49 (3.7) 10−210−1100Recall0.00.10.20.30.40.50.60.7PrecisionPV-DBOW uni- & bi-gramsPV-DBOW unigrams onlyBinary PV-DBOW uni- & bi-gramsBinary PV-DBOW unigrams onlyBinary PV-DM10−210−1100Recall0.00.10.20.30.40.50.60.7PrecisionPV-DBOW uni- & bi-gramsPV-DBOW unigrams onlyBinary PV-DBOW uni- & bi-gramsBinary PV-DBOW unigrams onlyBinary PV-DM10−210−1100Recall0.00.10.20.30.40.50.60.7PrecisionPV-DBOW uni- & bi-gramsPV-DBOW unigrams onlyBinary PV-DBOW uni- & bi-gramsBinary PV-DBOW unigrams onlyBinary PV-DM10−210−1100Recall0.00.10.20.30.40.50.60.7PrecisionPV-DBOW uni- & bi-gramsPV-DBOW unigrams onlyBinary PV-DBOW uni- & bi-gramsBinary PV-DBOW unigrams onlyBinary PV-DM At the beginning of the training the network weights are not yet fitted to data, and, consequently, decision made by BSN can be random. Therefore, we start the training with a slope s = 1.0. Later on, when weights are more fitted to the data, we increase the slope and consequently make BSNs more 'confident'. In Tab. 3.4 comparison of both deterministic and stochastic binary units is pre- sented. In case of the former, we tried the approaches proposed by Salakhutdinov Binarization approach Salakhutdinov & Hinton binarization Krizhevsky & Hinton binarization BSN with Eq. 3.5 straight-through gradient estimator BSN with Eq. 3.5 straight-through gradient estimator with slope-annealing BSN with Eq. 3.6 straight-through gradient estimator BSN with Eq. 3.6 straight-through gradient estimator with slope-annealing MAP NDCG@10 0.19 0.32 0.25 0.37 0.54 0.42 0.3 0.14 0.22 0.5 0.33 0.48 Table 3.4: Comparison of performance of different binary units for 32 bit model trained on the 20 Newsgroups dataset. and Krizhevsky. In case of the latter, we examined straight-through gradient es- timator in both described variants (Eq. 3.5 and Eq. 3.6). Model hyperparameters were selected separately for each binarization approach using hold-out validation set. Standard deviation of the Gaussian noise added to the pre-activation sig- nal in the Salakhutdinov's binarization is 0.4. Learning rate for that case is 1.0. Learning rates for BSN have higher values. They are 1.5 for Eq. 3.5 and as high as 11.0 for Eq. 3.6. In contrast to the Krizhevsky's binarization, dropout does not improve the results of the Salakhutdinov's binarization. Neither in case of BSNs. In variants that use slope annealing we increase the slope hiperparameter by 0.1 in each epoch. As can be concluded from the table Tab. 3.4, BSNs give relatively good results, but not as good as a simple deterministic approach proposed by Krizhevsky & Hinton. 3.2.6 Comparison against indirect hashing approaches The Binary Paragraph Vector models enable simple generation of document hashes. Alternatively, similar codes can be obtained in two stages, by first learning real-valued document embeddings and then applying to these embeddings an off- the-shelf state-of-the-art locality-preserving hashing technique. To validate this approach we generated real-valued codes using PV-DBOW model and then ap- plied to them one of the four hashing techniques: an autoencoder with sigmoid coding layer and the Krizhevsky's binarization, a Gaussian-Bernoulli Restricted Boltzmann Machine (RBM) [Welling et al., 2004], random hyperplane projection (a.k.a. SimHash) [Charikar, 2002] and iterative quantization (ITQ) [Gong and Lazebnik, 2011]. We considered two variants, where hashes are generated either from low-dimensional or high-dimensional document embeddings. Results are pre- sented in Tab. 3.5 and Fig. 3.9. As can be seen in Fig. 3.9, two of the tested methods, namely an autoencoder 50 Binarization model e 20 Newsgroups Autoencoder with Gaussian-Bernoulli 32 Krizhevsky's binarization 300 32 300 32 300 32 300 Random hyperplane projection (SimHash) Iterative quantization RBM z i s . d e b m E 0 1 @ G C D N 0.57 0.56 0.39 0.55 0.53 0.31 0.58 0.58 P A M 0.32 0.29 0.26 0.36 0.27 0.13 0.31 0.31 RCV1 EN Wikipedia 0 1 @ G C D N 0.67 0.71 0.52 0.71 0.66 0.56 0.68 0.71 P A M 0.16 0.17 0.12 0.16 0.16 0.12 0.17 0.17 P A M 0.24 0.22 0.23 0.26 0.21 0.17 0.23 0.22 0 1 @ G C D N 0.42 0.44 0.19 0.33 0.44 0.36 0.46 0.44 Table 3.5: Information retrieval results for 32-bit binary codes constructed by first inferring 32d or 300d real-valued paragraph vectors and then employing another unsupervised model or hashing algorithm for binarization. Paragraph vectors were inferred using PV-DBOW with bigrams. and ITQ, yielded precisions for low recall values slightly higher than Binary Para- graph Vector. However, the area under the curve is still smaller than in the case of Binary PV. Given the simplicity of end-to-end training of Binary Paragraph Vector models there is no clear benefit from using two-stage approach. The train- ing and inference time in the Binary Paragraph Vector models is almost the same as that of the original PV. Autoencoder used in this comparative experiment was implemented using Ten- sorFlow library. We trained it for 10 epochs, splitting data into mini-batches of 100 examples. AdaGrad with learning rate of 1.0 was used for optimization. A dropout rate of 10% was used. RBM was implemented using AGH deep learning library described in Section A.2.2. We trained it for 10 epochs with learning rate of 0.01. The cost function was optimized by gradient descent optimizer with momentum equal to 0.5, This model also used a weight cost of 0.0002. The training was car- ried out in mini-batches of 128 examples. For SimHash and ITQ we used simple implementations provided by Dong Guosheng4 with default hyperparameters. 3.2.7 Transfer learning As shown in the previous sections, our model enables learning of short, high- quality binary codes for text documents. However, in all cases presented above (20 Newsgroups, RCV1 and Wikipedia) the models were evaluated on test examples held out from the datasets used to fit the model's parameters. In other words, test examples were from the same domain as training examples. One could pose a question: what if we want to generate binary codes for documents that are not associated with any domain-specific corpus? One of the solution in this case could be to train the model based on a big generic text corpus covering wide variety of domains. To validate this approach, we trained the Binary PV-DBOW model on 4Available at https://github.com/dongguosheng/lsh 51 (a) 20 Newsgroups (b) RCV1 (c) English Wikipedia Figure 3.9: Information retrieval results for 32-bit binary codes constructed by first inferring 32d real-valued paragraph vectors and then employing another un- supervised model or hashing algorithm for binarization. Paragraph vectors were inferred using PV-DBOW with bigrams. English Wikipedia snapshot and then we inferred binary codes for the test parts of the 20 Newsgroups and RCV1 datasets. The results are presented in Tab. 3.6 and in Fig. 3.10. Dataset 20 Newsgroups RCV1 MAP NDCG@10 0.19 0.18 0.51 0.66 Table 3.6: dimensional binary codes. Information retrieval results for transfer learning for 128- As expected, the results are worse than those for the cases when the model was trained on domain-specific training sets. However, the precision-recall curves are, approximately, only 10% lower than in case of training with domains-specific data. It can, therefore, be concluded that the codes learned in the transfer learning settings preserve a lot of the semantic similarity of documents. 52 10-210-1100Recall0.00.10.20.30.40.50.60.70.80.9PrecisionBinary PV-DBOW uni- & bi-gramsAutoencoder with Krizhevsky's binarizationGaussian-Bernoulli RBMRandom hyperplane projection LSHIterative quantization10-210-1100Recall0.10.20.30.40.50.60.7PrecisionBinary PV-DBOW uni- & bi-gramsAutoencoder with Krizhevsky's binarizationGaussian-Bernoulli RBMRandom hyperplane projection LSHIterative quantization10−210−1100Recall0.00.10.20.30.40.50.60.7PrecisionBinary PV-DBOW uni- & bi-gramsAutoencoder with Krizhevsky's binarizationGaussian-Bernoulli RBMRandom hyperplane projection LSHIterative quantization (a) 20 Newsgroups (b) RCV1 Figure 3.10: 128-dimensional binarized PV-DBOW model. 3.3 Real-Binary Paragraph Vector model As described in [Salakhutdinov and Hinton, 2009], when a document collection is huge, it is beneficial to perform a two-stage search. First, a shortlist of candidate documents is selected. The shortlist is constructed by filtering documents using short binary codes and a Hamming ball of some small radius, e.g. 5. Then, by using longer, possibly real-valued codes, precise ranking is performed for docu- ments within the Hamming ball. In this section we propose a neural model that can jointly learn short binary codes and longer, real-valued representations. To this end, we added additional linear projection layer in the middle of the Binary PV-DBOW network, as depicted in Fig. 3.11. During training, projection weights Figure 3.11: The Real-Binary PV-DBOW model. Modifications to the original PV-DBOW model are highlighted in blue. are optimized alongside softmax weights and document embeddings. During the inference stage, the projection weights are fixed. We call this model Real-Binary Paragraph Vector Distributed Bag of Words (Real-Binary PV-DBOW). Projection weights are randomly initialized by sampling from a uniform distribution. We also tried initializing the projection weights using the method described in [Glorot and Bengio, 2010], but this did not improve results. We evaluated the Real-Binary PV-DBOW using the same text datasets as in the case of Binary PV-DBOW, namely 20 Newsgroups, RCV1 and English Wikipedia. The only metric that we report in this evaluation is NDCG@10. We do not report MAP, because MAP is estimated using the whole recall range and the inherent trait of the filtering approach is that high recall levels may not be 53 10-210-1100Recall0.00.10.20.30.40.50.60.70.80.9Precisiontraining on the 20 Newsgroups training settraining on English Wikipedia10-210-1100Recall0.10.20.30.40.50.60.7Precisiontraining on the RCV1 training settraining on English Wikipediahigh-dimensionalembeddinglow-dimensionalembeddingbinaryembeddinglinearprojectionroundedsigmoidsampledsoftmaxembeddinglookupdocumentdocument'sword accessible. In Tab. 3.7 and in Fig. 3.12 we report performance of Real-Binary Code size Radius 1 2 3 28 24 20 16 20 Newsgroups A 0.79 0.72 0.65 0.63 0.6 0.55 B 0.85 0.8 0.79 0.76 0.73 0.72 NDCG@10 RCV1 A B 0.85 0.77 0.73 0.81 0.76 0.7 0.74 0.69 0.79 0.73 0.72 0.79 English Wikipedia A 0.66 0.62 0.56 0.5 0.42 0.39 B 0.7 0.65 0.59 0.55 0.52 0.52 Table 3.7: Information retrieval results for the Real-Binary PV-DBOW model. Real valued representations have 300 dimensions. (A) Binary codes are used for selecting documents within a given Hamming distance to the query and real- valued representations are used for ranking. (B) For comparison, variant A was repeated with binary codes inferred using plain Binary PV-DBOW and a real- valued representation inferred using original PV-DBOW model. PV-DBOW for different Hamming ball radii. As can be seen, vast majority of documents that are left in the Hamming ball after filtering are very relevant to the query. In particular, NDCG@10 values for Real-Binary PV-DBOW are higher than results for plain Binary PV-DBOW. In addition to the main experiment, where both binary codes and real-valued representations are learned by Real- Binary PV-DBOW (A), we also report results for variant (B), where binary codes are inferred using plain Binary PV-DBOW and real-valued representations are inferred using original PV-DBOW model. The second variant gives slightly better results, but in the first approach we get both real-valued and binary codes from the same model, thereby reducing the memory requirements. Fig. 3.13 compares accuracy of 300-dimensional real-valued codes learned by Real-Binary PV-DBOW with the codes learned by the original PV-DBOW model. Since the two-tier model entails strong dimensionality reduction in the projection matrix, codes generated by this model are slightly worse than those generated by the vanilla PV-DBOW. However, the difference is relatively small, and we believe that it can be acceptable for searching with pre-filtering. 3.4 Conclusions In this chapter we presented three novel neural network models for direct learn- ing of low-dimensional binary codes of text documents. Our models are simple extensions to the well-known Paragraph Vector Distributed Bag of Words and Paragraph Vector Distributed Memory neural networks, collectively referred to as doc2vec. A useful trait of the codes learned by our models is that, documents hav- ing the same, or similar, topics end up having high probability of code collisions. This feature makes the models eligible for approximate nearest neighbor search. In particular, we obtain state-of-the-art results in an information retrieval task on three benchmark datasets. 54 (a) 20 Newsgroups (b) RCV1 (c) English Wikipedia Figure 3.12: Information retrieval results for Real-Binary PV-DBOW model with 300-dimensional real-valued codes. To speed up the search, the search space is narrowed to documents with binary codes within small Hamming distance to the query. These documents are ranked accordingly to the cosine distance of real- valued representations. On the plot, precisions are drawn only for recall levels for which at least 10 documents were returned. Binary PV-DM model accounts for the order of words in the documents. Nev- ertheless, it yields worse results than Binary PV-DBOW, which disregards word ordering. This observation is consistent with previous studies on the original PV models. To improve results with PV-DM, we tried to pre-train its word vectors on English Wikipedia. Unfortunately, this settings did not produce noticeably better results. One of the use cases of approximate nearest neighbor search is document pre- filtering. The idea is to use binary codes to select some number of candidates, and then apply a more precise search method, based on real-valued codes, for final search or ranking. Since in this scenario we need both short binary codes and longer real-valued codes, we proposed a two-tier neural network model that simultaneously learns both kinds of representations. Advantages of this model are shorter combined training time and smaller memory requirements. We demonstrated experimentally that the Binary Paragraph Vector models can be used for information retrieval. We believe that they can be used to other tasks 55 10-210-1Recall0.20.30.40.50.60.70.80.91.0Precision28-bit codes, Hamming radius 224-bit codes, Hamming radius 224-bit codes, Hamming radius 320-bit codes, Hamming radius 316-bit codes, Hamming radius 310-210-1Recall0.20.30.40.50.60.70.80.91.0Precision28-bit codes, Hamming radius 224-bit codes, Hamming radius 224-bit codes, Hamming radius 320-bit codes, Hamming radius 316-bit codes, Hamming radius 310−210−1Recall0.20.30.40.50.60.7Precision28-bit codes, Hamming radius 128-bit codes, Hamming radius 224-bit codes, Hamming radius 224-bit codes, Hamming radius 320-bit codes, Hamming radius 316-bit codes, Hamming radius 3 (a) 20 Newsgroups (b) RCV1 (c) English Wikipedia Figure 3.13: Performance comparison between real-valued codes learned by Real- Binary PV-DBOW (red curve) and original PV-DBOW (green curve). In both cases 300-dimensional real-valued codes were generated and cosine distance was used as a similarity measure. For reference, performance for binary codes learned by Real-Binary PV-DBOW (blue curve) is also presented. In this case the Ham- ming distance was used as a similarity measure. as well. One of the applications could be probabilistic data structures (PDS). PDS are used to generate and store some summarization of data. In contrast to deter- ministic data structures, like hash tables, they require significantly less memory and, therefore, can be applied to much bigger datasets. They are often used for web analytics and big data mining, where they provide approximations of some basic statistics, like cardinality. They are particularly useful for on-line and stream pro- cessing. Examples of PDS are Bloom filter [Bloom, 1970], HyperLogLog [Durand and Flajolet, 2003] or Count-Min Sketch [Cormode and Muthukrishnan, 2005]. We believe that one promising research direction is to use Binary Paragraph Vector as a basis for probabilistic data structures applied to stream or real-time processing. 56 10-210-1100Recall0.00.10.20.30.40.50.60.70.80.9PrecisionPV-DBOWReal-Binary PV-DBOW, real-valued codesReal-Binary PV-DBOW, binary codes10-210-1100Recall0.10.20.30.40.50.60.7PrecisionPV-DBOWReal-Binary PV-DBOW, real-valued codesReal-Binary PV-DBOW, binary codes10−210−1100Recall0.00.10.20.30.40.50.60.7PrecisionPV-DBOWReal-Binary PV-DBOW, real-valued codesReal-Binary PV-DBOW, binary codes Chapter 4 Probabilistic multi-sense word embeddings An inherent limitation of leading word embedding models [Mikolov et al., 2013a, Pennington et al., 2014, Bojanowski et al., 2017, Wu et al., 2017] is that for each word, even ambiguous one, only one vector is learned. As we discuss in Section 2.3.6, there are ongoing efforts to overcome this limitation. Currently these efforts focus on multi-sense word embedding models, which are able to learn multiple vector representations per word. In this chapter we propose a novel neural model for learning multi-sense word embeddings and we perform its thorough experimental evaluation. On three out of four benchmark datasets our model gives better results in the word sense in- duction task than competing state-of-the-art solutions. Also, in contrast to the previously proposed neural models, our solution is end-to-end differentiable and has an elegant probabilistic interpretation. 4.1 Disambiguated Skip-gram model We propose a neural model for learning multi-sense word embeddings that is a simple extension to the skip-gram model (Section 2.3.4). In skip-gram context words are conditioned on the center word (Eq. 2.34). Our model learns multi- sense word vectors by attempting to predict surrounding context words based on a given sense of the center word. Therefore, for each vocabulary word w we define a fixed number k of sense embedding vectors: vw,s, s = 1, . . . , k. We then define the probability of a context word c ∈ Cw given a sense s of the center word w as: (cid:80) P (c w, s) = evT w,suc c(cid:48)∈V evT w,suc(cid:48) , (4.1) where uc are output embedding vectors (defined as in the vanilla skip-gram). This parametrization has been used previously in the MPSG model [Tian et al., 2014]. In contrast to previous works on multi-sense word embeddings, we also define a probabilistic model for word senses. In particular, to predict the sense of the center word we condition this sense on the context. To this end, for each vocabulary word w, we introduce k sense disambiguation vectors qw,s, s = 1, . . . , k and a context embedding vector rw. We then define the probability that the center 57 word w is in the sense s as: P (s w, Cw) = (cid:80) eqT w,s¯rw j=1,...,k eqT w,j¯rw , (4.2) where ¯rw is a vector representation of the context of the word w, defined as the average of the context embedding vectors: 1 ¯rw = rc. (4.3) (cid:88) #Cw c∈Cw Our approach can be seen as extending the skip-gram model by adding to it a sense disambiguation subnetwork (depicted in the bottom of Fig. 4.1). Therefore, Figure 4.1: Disambiguated Skip-gram model. we call our model Disambiguated Skip-gram. Ideally, we would disambiguate center words during training by sampling senses from the categorical probability distribution defined by Eq. 4.2. Unfortunately, we would then not be able to backpropagate gradients through our model, be- cause sampling is not differentiable. Alternatively, we could simply ignore the sampling and predict the context words based on the expected sense embeddings, i.e. maximize the log-probability: log P (Cw ew) = log (cid:89) c∈Cw (cid:80) eeT wuc c(cid:48)∈V eeT wuc(cid:48) , where: k(cid:88) s=1 ew = P (s w, Cw)vw,s. 58 (4.4) (4.5) contextembeddingcontex wordembeddinglookup...context wordsall senses of a center word...word senseembeddinglookupcontextwordexpectedsenseembeddingpredictionweightedsenseembeddingselement-wisemultiplication .........center word sensesprobabilitydistribution.........sensedisambiguation However, modeling word senses with expected sense embedding vectors is not necessarily the best choice. In most cases a word in a given context has one and only one meaning. For example, a word palm in a given context is either a body part or a kind of tree. A mean of the vector representations of these two senses does not represent a specific sense. This is the reason why samples form the categorical distribution defined in Eq. 4.2 are more suitable for modeling senses of the center words. As we mentioned above, we cannot backpropagate gradients through the sam- ples from the categorical distribution defined by Eq. 4.2. Therefore we have to use some gradient estimator. There are many gradient estimators for stochastic binary units (some of them are described in Section 3.2.5). Well-performing gradi- ent estimators for backpropagation through samples from a categorical distribution were proposed only recently, independently by two research teams, under names Gumbel-Softmax distribution [Jang et al., 2016] and concrete distribution [Mad- dison et al., 2016]. The general idea in these estimators is to express the sam- ples via the Gumbel-Max trick [Gumbel, 1954] and then approximate the arg max operator in this trick with a softmax function with temperature hyperparameter. Concretely, given a categorical probability distribution p1, . . . , pk the Gumbel-Max trick expresses the samples as: z = arg max i=1,...,k (log pi + gi), (4.6) where gi are i.i.d. distribution replaces the arg max operator with a continuous relaxation: samples form Gumbel(0, 1) distribution. The Gumbel-Max log(pi)+gi t(cid:80)k e j=1 e zi = log(pi)+gi t , for i = 1..k, (4.7) where t is the temperature hyperparameter. At the beginning of training the tem- perature is set to one. During training the temperature decays toward zero, which consequently moves the softmax function towards the arg max operator. Note that gradients are not propagated to the Gumbel noise gi, as it is sampled from a fixed distribution. Overall, this gradient estimator can be seen as a reparameter- ization trick [Kingma and Welling, 2013] for an approximation to the categorical distribution. To devise an effective training algorithm for Disambiguated Skip-gram we sub- stitute samples from the categorical distribution over center word senses with samples from the Gumbel-Max distribution over these senses. This means that we effectively apply softmax twice: first to calculate the sense probabilities (Eq. 4.2) and then to approximate the arg max operator in the Gumbel-Max trick. We then use the resultant continuous samples zw,s to calculate a relaxed sense embedding vector: vw = zw,svw,s. (4.8) k(cid:88) s=1 Finally, we define the training objective for Disambiguated Skip-gram as the max- imization of the log-probability: (cid:89) c∈Cw (cid:80) evT wuc c(cid:48)∈V evT wuc(cid:48) . (4.9) L = log P (Cw vw) = log 59 Note that when the temperature in the Gumbel-Max distribution t → 0 the objec- tive in Eq. 4.9 approaches log-probability of the context words under true samples from the categorical distribution over the center word senses. Our model could be considered similar to the multiple-sense skip-gram (MSSG) model proposed by Neelakantan et al. [Neelakantan et al., 2014]. However, in contrast to our solution, they do not condition the word senses on the contexts in a probabilistic manner. Instead, to select a proper sense for the center word they perform a hard cluster assignment. This sense selection approach has no probabilistic interpretation. 4.1.1 Regularization in Disambiguated Skip-gram In Disambiguated Skip-gram context embedding vectors rw perform a role similar to output embedding vectors uw. Specifically, they both represent context words, albeit in two different tasks: sense disambiguation and context word prediction, respectively. In practice we simplify Disambiguated Skip-gram by tying these two set of vectors. This also gives us a performance benefit over Neelakantan et al. MSSG algorithm. In particular, to build the context representation Neelakantan et al. use so-called global vectors, which are single-sense word vectors learned in addition to multi-sense embeddings. In Disambiguated Skip-gram this role is fulfilled by context embedding vectors. We get this vectors essentially 'for free', because they are tied to output embeddings. We also tried modeling contexts by averaging embeddings for all senses of all context words. However, this approach did not yielded promising results. In our model each word has its own set of sense disambiguation vectors qw,s. In practical implementation we first look up these vectors from a weights matrix and then we predict the sense of the center word using the looked-up vectors. One problem with this approach is that the sense disambiguation vectors for rare words receive few updates during training and therefore are difficult to fit. To overcome this limitation, we first pre-train Disambiguated Skip-gram with sense disambiguation vectors tied between all words from the vocabulary. Furthermore, for simplicity we use the objective defined by Eq. 4.4 during this pre-training. After the pre-training phase we initialize separate sense disambiguation vectors for all vocabulary words using the pre-trained values. This way we first learn multi-sense word embeddings based on a shared disambiguation model and then we fine-tune those embeddings using a separate disambiguation model for each vocabulary word. We carry out this fine-tuning for multiple epochs. Different words have different sense distributions and some senses occur more often then others. Therefore, it would be beneficial to have a mechanism for controlling the granularity of the senses learned by Disambiguated Skip-gram. One way to achieve this is to control how 'confident' are the probability distributions predicted by the disambiguation subnetwork (Eq. 4.2). A technique that can influence the confidence of the softmax activations was recently studied in [Pereyra et al., 2017]. The basic idea is to penalize distributions with high or low entropy (Eq. 2.26). We employ this idea by adding to the training objective an entropy S of the distribution defined in Eq. 4.2 multiplied by a hyperparameter γ. This hyperparameter, which we further call an entropy cost, controls the strength of the regularization. One caveat is that when softmax activations are close to zero, the 60 entropy term can be undefined, since limx→0 log(x) = −∞. To prevent this, we add a small constant  to the softmax activations under the logarithm, resulting in numerically stable expression: Le = −γ P (s w, Cw) log(P (s w, Cw) + ), (4.10) k(cid:88) s=1 We employ a positive entropy cost in order to learn more fine-grained senses and a negative entropy cost in order to learn more balanced distributions. In practice, we add a small negative entropy cost during pre-training and often use a positive entropy cost during fine-tuning. Another regularization method that we use in Disambiguated Skip-gram is inspired by our earlier work [Grzegorczyk et al., 2016]. Therein we investigated the impact of regularization term that encourages orthogonality between weight vectors on the performance of pre-trained deep neural networks. The goal of our research was to force the network to learn more diverse sets of latent features in hidden layers, and consequently to obtain better results in common machine learning tasks. In order to learn a broad set of features, weight vectors in hidden layers should point in different directions. We encouraged orthogonality between latent features by introducing an additional term to the weight update rule, which penalizes parallel components of the weight vectors: wk ← wk − 1 n − 1 okjwj, k = 1, . . . , n, (4.11) (cid:88) j(cid:54)=k where n is a number of hidden units, okj is a non-orthogonality coefficient (defined below) and wj is the j-th weight vector. In the summation we skip the case where j = k, because obviously we do not want to penalize the network for having weight vectors parallel to themselves. We investigated three variants of the non- orthogonality coefficients, namely cosine of the angle between the weight vectors: (cid:107)wi(cid:107)(cid:107)wj(cid:107) , the dot product between the weight vectors: oij = wT i wj i (cid:54)= j, oij = wT i wj, i (cid:54)= j, and the Gram-Schmidt orthogonalization: oij = wT wT i wj i wi , i (cid:54)= j. (4.12) (4.13) (4.14) In [Grzegorczyk et al., 2016], we have chosen the first of those variants as our orthogonalization strategy and we have shown that the resulting regularization term improves performance of pre-trained deep networks on image recognition and document retrieval tasks. Our idea in this work is to encourage different sense embedding vectors to point in different directions, similar to the feature vectors in [Grzegorczyk et al., 2016]. 61 To this end, we penalize the Huber loss [Huber et al., 1964] over dot products between sense embedding vectors: 2x2 w (cid:26) 1 (cid:88) for xw ≤ 1.0, otherwise, xw − 1 2 where: LH(xw) = xw = w,ivw,j, w ∈ V. vT (4.15) (4.16) i,j=1,...,k i(cid:54)=j We multiply the Hubber loss by a hyperparameter δ, which we further call parallel penalty, and add it to the training objective (Eq. 4.9). The advantage of the Huber loss over the classic squared error cost is that it grows less rapidly and, therefore, is easier to optimize during training. Specifically, for inputs xw ≤ 1.0 the Huber loss is equal to the squared loss, while for bigger inputs it becomes linear. In addition to the regularizers introduced above, we tried regularizing the model by penalizing the weights in the disambiguation subnetwork using standard L1 and L2 norms, but in our preliminary experiments we did not observed any benefit from doing so. Also, to further improve the training we tried applying batch normalization [Ioffe and Szegedy, 2015] in the context prediction subnetwork, as well as in the sense disambiguation subnetwork. We did not observe any tangible benefit from that. 4.2 Experiments To assess the performance of Disambiguated Skip-gram we performed experiments similar to those reported in [Bartunov et al., 2016, section 5] and [Neelakantan et al., 2014, section 6]. We trained Disambiguated Skip-gram with the Westbury Lab Wikipedia corpus, described in Section A.1.3. The corpus was lowercased, stopwords were removed and numbers were converted to a unique token. We did not apply any stemming or lemmatization. However, we include in the vocabulary only words that occurs at least 100 times in the corpus. This gives a vocabulary of 1.32 × 105 words. We trained Disambiguated Skip-gram in four basic variants: for 3 and 5 senses and for 50 and 300 dimensions. Additionally, we repeated those tests with the entropy cost and the parallel penalty. We apply one epoch of pre-training with a learning rate decaying from 1.0 to zero. We then train the network for three fine- tuning epochs with learning rate equals to 0.1, 0.05 and 0.01, respectively. As we mention above, during fine-tuning we replace vanilla softmax in the subnetwork with the Gumbel-Softmax distribution. In the first epoch of fine-tuning we decay the Gumbel-Softmax temperature from 1.0 to 0.5. In the following epochs we keep the temperature fixed at a 0.5. We also tried letting the network to learn the Gumbel-Softmax temperature by itself, i.e. considered it a model parameter, effectively reducing the number of hyperparameters. Unfortunately, this did not lead to good performance. After fine-tuning, we feed the corpus once more through our model and average the sense probability distributions separately for each word from the vocabulary. This way, we estimate marginal sense probabilities for all words in the vocabulary. 62 This allows us to prune sense representation, i.e. senses with low marginal prob- ability. This technique is especially useful when combined with high entropy cost γ. We implemented Disambiguated Skip-gram using TensorFlow [Abadi et al., 2016]. All experiments were conducted on the HP Apollo XL730f Gen9 liquid cooled HPC machines equipped with two Intel Xeon E5-2680v3 processors (24 cores) and 128 GB RAM. We used Python version 2.7.5 and TensorFlow version 1.3. It takes from 9 to 12 hours to pre-train the model, depending on dimension- ality and the number of senses. Duration of a single fine-tuning epoch vary from 10 to 18 hours. 4.2.1 Qualitative evaluation In order to qualitatively evaluate our model, we selected 5 nearest neighbors (word senses) for 10 popular ambiguous words. We used cosine similarity to build the nearest neighbors lists. If multiple senses of some word appear on the nearest neighbors list, we merge them into one neighbor. We also merge simple variants of words (e.g. plurals). Results for four different values of the entropy cost γ are presented in Tab. 4.1 and Tab. 4.2. In the tables we also include marginal prob- abilities of senses. As we can see, for higher values of the entropy cost γ, marginal probabilities are less balanced. In those cases, there is one or two dominating senses, while other senses are pruned. To shed light on relations between senses of the test words we also projected embedding vectors to R2 and pictured placed nearest neighbors on a plane. These results are presented in Fig. 4.2 and Fig. 4.3. We used Principal Components Analysis to reduce the embedding dimensionality. In most cases our model discovers senses accurately. For example, in the case of 'fox', the first sense for the model without the entropy cost is a broadcasting company, the second is an animal and the third is a family name. In the case of 'mouse', the first sense is a cartoon character, the second is a pointing device and the third is an animal. We should note here that most of the words from Tab. 4.1 and Tab. 4.2 have two dominating senses, rather than three. In those cases, one of the senses is usually split by our model into two. However, the split is not random but corresponds to different contexts in which those senses occur. For example both sense 1 and sense 3 of word 'plant' in Tab. 4.2 describe a factory. However, sense 1 is a agricultural factory while sense 3 is a petrochemical factory. To better understand how the entropy cost influences the number of senses, we fine-tuned 5-sense, 50-dimensional models with the entropy cost γ ranging from 0.0 (no penalty) to 1.0, and counted senses having marginal probability p ≥ 0.05. In Fig. 4.4 we present histograms of marginal probabilities of senses of all words from the vocabulary. As depicted, in the case there is no entropy cost (black curve) marginal probabilites are distributed quite evenly: there are very few word senses with probabilities close to 0.0 or 1.0. For higher values of the entropy cost, marginal probability distributions are more polarized, i.e. there are more word senses with probabilities close to 0.0 or 1.0. Assuming that we prune senses having probabilities smaller than 0.05, we get on average 4.7 active senses for model without a penalty and as low as 2.5 senses on average for model with a strong γ = 1.0 entropy cost ( Tab. 4.3). 63 Sense 1 Nearest neighbors wozniak macworld macintosh ipod sculley wozniak blackberry tomato potato popcorn nbc cbs network syndication espn nbc cbs abc syndication network cbs nbc abc cable colmes cbs nbc abc colmes wttg crossbar puck lob sliothar offside crossbar puck lob offside dribbled crossbar puck lob header dribbled band indie punk alternative supergroup alternative glam progre- ssive indie psychedelic alternative punk indie glam progressive alternative punk glam indie psychobilly factory botanical labo- ratory farm nurseryman weed planted shed grinder laboratory Word γ P apple fox net rock plant 0.0 0.28 0.25 0.25 0.5 0.01 0.75 0 0.0 0.52 0.25 0.6 0.5 0.68 0.75 0.86 0.0 0.26 0.25 0.24 0.5 0.23 0.75 0 0.0 0.41 0.25 0.7 0.5 0.72 0.75 0.73 0.0 0.18 0.25 0.08 0.5 0.04 0.75 0.02 Sense 2 Nearest neighbors macintosh imac iigs iie iic macintosh iigs imac iie iic macintosh blackberry iigs imac apricot macintosh blackberry iigs imac apricot badger wolf coyote weasel marten badger squirrel weasel raccoon marten badger marten raccoon beaver mink vulpes porcupine raccoon marten mink trawl streamline maximising minimises counteracts trawl minimises maximising streamlines stickiness ebitda deadweight isk annualized deducting ebitda deducting deadweight offsetting isk punk rockabilly pop psychedelia funk boulder basalt outcrop quartzite cliffs basalt boulders quartzite cliff outcropping basalt boulders quartzite outcrop cliffs flowering perennial shrub grass fungus flowering grasses shrub fungus herbaceous flowering shrub grasses herbaceous fungus flowering woody herbaceous shrub aster P 0.46 0.64 0.95 1 0.24 0.18 0.14 0.09 0.32 0.33 0.77 1 0.34 0.17 0.17 0.18 0.45 0.46 0.48 0.98 P 0.26 0.11 0.04 0 0.25 0.22 0.18 0.06 0.41 0.43 0 0 0.26 0.13 0.11 0.1 0.38 0.45 0.48 0 Sense 3 Nearest neighbors strawberry peach raspberry blueberry plum peach pecan persimmon prune blueberry miller allen plummer crowe buck miller allen terry russell soper allen russell miller turner berry raccoon sauk hammond mendota meskwaki ebitda earnings annualized taxable depreciation ebitda annualized jpy deadweight gni boulder quartzite granite sandstone basalt granite bluff pine pigeon ledge pine bluff eagle pigeon turtle big little sandy alum butte refinery smelter petroche- mical processing factory refinery factory megawatt smelter cogeneration refinery factory smelter megawatt sellafield Table 4.1: Marginal probabilities and nearest neighbors for selected words from the vocabulary. Codes learned with a 3-sense, 300-dimensional Disambiguated Skip- gram model trained with different values of the entropy cost γ. The neighbors are selected are presented only for senses with a marginal probability higher than 0.05. (Part I) 64 Word γ Sense 1 P Nearest neighbors bank mouse table light core 0.0 0.40 0.25 0.41 0.5 0.1 0.75 0.07 0.0 0.47 0.25 0.49 0.5 0.49 0.75 0.48 0.0 0.38 0.25 0.36 0.5 0.31 0.75 0.26 0.0 0.3 0.25 0.28 0.5 0.24 0.75 0.16 0.0 0.21 0.25 0.17 0.5 0.13 0.75 0.09 savings hsbc citibank barclays lloyds savings hsbc citibank lloyds barclays cashier savings citibank robbers jpmorgan bookie bookmaker heist holdup cashier mickey rabbit goofy cat porky rabbit goofy cat porky tigger rabbit goofy porky tigger tweety goofy porky tweety mickey tigger foosball carom lang- uishing pool slipping foosball ept languishing pool leaderboard standings ept foosball leaderboard ittf standings relegation ittf ept creditable shade reflection ibo radiant shines lighter ibo illuminates shade wbu flyweight ibo welterwei- ght wbu bantamweight flyweight featherweight welterweight ibo backbone nucleus co- hesive interplay nexus backbone integral exp- anding interplay newer assembled integral foun- ding dynamic comprised comprised founding proto sugarcubes replacements Sense 2 Nearest neighbors credit loans depositors fdic lending depositors fdic credit lending landsbanki depositor fdic lenders liquidity unsecured depositors overdraft un- secured issuer borrowers cursor joystick trackball touchpad touchscreen rat mice rodent mus elegans mice rodent rat mus elegans rodent mice mus rat musculus sortable column lookup hashed tray sortable column lookup tray hashed sortable tray column chairs buckets sortable tray tallies lists chairs sunlight illumination bright refracted luminous sunlight bright dichroic refracted phosphors refracted sunlight dichroic luminous phosphors refracted illuminates sunlight glows shine microarchitecture threading opteron ultrasparc merom microarchitecture threading opteron xeon merom microarchitecture threading opteron merom penryn microarchitecture merom penryn conroe opteron P 0.35 0.37 0.3 0.19 0.35 0.5 0.51 0.52 0.4 0.48 0.66 0.74 0.42 0.44 0.48 0.55 0.4 0.42 0.46 0.77 P 0.25 0.22 0.6 0.75 0.19 0.01 0 0 0.22 0.16 0.03 0 0.28 0.28 0.29 0.29 0.39 0.41 0.4 0.14 Sense 3 Nearest neighbors mouth confluence opposite upstream side confluence kolpa river opposite mouth savings hsbc citibank jpmorgan bancorp hsbc citibank jpmorgan lloyds icici rodent vole shrew pygmy rat sortable list alphabe- tical descending brackets sortable descending list alphabetically please heavy lvt lrv lynx wheeled heavy lvt lynx lrv searchlights heavy lvt lrv shermans unarmoured lvt heavy shermans turreted lrv integrates competencies focus components combines combine competencies com- ponent integral structured competencies component integral envisions incorporating fringe absorbing gastown nucleus Table 4.2: Marginal probabilities and nearest neighbors for selected words from the vocabulary. Codes learned with a 3-sense, 300-dimensional Disambiguated Skip- gram model trained with different values of the entropy cost γ. The neighbors are selected are presented only for senses with a marginal probability higher than 0.05. (Part II) 65 (a) apple (b) fox (c) net (d) rock (e) plant Figure 4.2: Visualization of the nearest neighbors for selected words from the vocabulary. Codes learned with a 3-sense, 300-dimensional Disambiguated Skip- gram model. Dimensionality reduced with Principal Components Analysis. The neighbors were selected in the original space using the cosine distance. (Part I) 66 apple_0wozniak_0macworld_0macintosh_0ipod_0sculley_0apple_1macintosh_1imac_1iigs_1iie_1iigs_2iic_1apple_2strawberry_1peach_1raspberry_1blueberry_1plum_1fox_0nbc_2cbs_1network_0syndication_0espn_1fox_1badger_1wolf_1coyote_1weasel_1marten_1fox_2miller_2allen_2plummer_2crowe_2buck_2net_0crossbar_0puck_0lob_0sliothar_2offside_0net_1trawl_1streamlines_0maximising_1minimises_1counteracts_1net_2ebitda_2earnings_2annualized_2taxable_2depreciation_2rock_0band_0indie_0punk_0alternative_0supergroup_0rock_1punk_1rockabilly_1pop_1psychedelia_1funk_1rock_2boulder_1quartzite_1granite_1sandstone_1basalt_1plant_0factory_2botanical_0laboratory_0farms_0nurseryman_1plant_1flowering_1perennial_1shrub_1grass_1fungus_1plant_2refinery_1smelter_1petrochemical_1processing_2factory_2 (a) bank (b) mouse (c) table (d) light (e) core Figure 4.3: Visualization of the nearest neighbors for selected words from the vocabulary. Codes learned with a 3-sense, 300-dimensional Disambiguated Skip- gram model. Dimensionality reduced with Principal Components Analysis. The neighbors were selected in the original space using the cosine distance. (Part II) 67 bank_0savings_2hsbc_2citibank_2barclays_2lloyds_2bank_1credit_1loans_1depositors_1fdic_1lending_1bank_2mouth_2confluence_2opposite_2upstream_2side_2mouse_0mickey_1rabbit_0goofy_0cat_0porky_0mouse_1cursor_1joystick_1trackball_1touchpad_1touchscreen_1mouse_2rodent_1vole_1shrew_1pygmy_1rat_1table_0foosball_2carom_0languishing_0pool_0slipping_0table_1sortable_1column_1lookup_1hashed_1tray_1table_2sortable_2lists_2alphabetical_2descending_2brackets_2light_0shade_0reflection_0ibo_0radiant_0shines_0light_1sunlight_1illumination_1bright_1refracted_1luminous_1light_2heavy_2lvt_2lrv_2lynx_2wheeled_2core_0backbone_0nucleus_0cohesive_0interplay_0nexus_0core_1microarchitecture_1threading_1opteron_1ultrasparc_1merom_1core_2integrates_2competencies_2focus_2components_2combines_2 Figure 4.4: Histograms of marginal probabilities of word senses learned by Dis- ambiguated Skip-gram models with different values of the entropy cost γ. Exper- iments conducted for 5-sense 50-dimensional model. γ Average sense number 0.0 4.7 0.1 4.3 0.25 3.7 0.5 3.2 0.75 2.8 1.0 2.5 Table 4.3: Average number of senses per word with marginal probability p ≥ 0.05, learned by Disambiguated Skip-gram models with different values of the entropy cost γ. 4.2.2 Word sense induction experiments Word sense induction (WSI) is considered the most important task used to quan- titatively assess multi-sense word embedding models [Bartunov et al., 2016]. For WSI experiments, we use four datasets described in Section A.1.5: SemEval-2007, SemEval-2010, SemEval-2013 and Wikipedia Word-sense Induction (WWSI). To disambiguate words from those datasets we first calculate vector representations of associated contexts by averaging all sense embeddings for all context words: ¯cw = (k · #Cw) vcs. (4.17) −1(cid:88) k(cid:88) c∈Cw s=1 Then, we select a sense of the center word whose vector representation has the smallest cosine distance to the context representation: sw = arg max j cos (vwj, ¯cw) . (4.18) To compare sense assignments with gold standard we use adjusted rand index [Hubert and Arabie, 1985]. Results for different dimensionalities, number of senses and different model regularizers are presented in Tab. 4.4. The best results for each dataset and for each dimensionality are highlighted. In most cases adding a small entropy cost or parallel penalty in fine-tuning has a positive effect. Comparison with other multi-sense word embedding models is presented in Tab. 4.5. Results for competing state-of-the-art models were taken from [Bartunov et al., 2016]. Our model outperforms all those models on three out of four benchmark test sets. 68 0.00.20.40.60.81.0Marginal probability0123Count×104γ=0.0γ=0.25γ=0.5γ=0.75 Dim. Sense num. Penalty SemEval-2007 SemEval-2010 SemEval-2013 WWSI 50 300 3 5 3 5 No penalty γ = 0.25 γ = 0.5 δ = 0.0001 δ = 0.005 No penalty γ = 0.25 γ = 0.5 δ = 0.0001 δ = 0.005 No penalty γ = 0.25 γ = 0.5 δ = 0.0001 δ = 0.005 No penalty γ = 0.25 γ = 0.5 δ = 0.0001 δ = 0.005 0.0711 0.0803 0.0853 0.0729 0.074 0.0638 0.0826 0.0637 0.0617 0.0594 0.0799 0.0807 0.0818 0.0916 0.084 0.0765 0.0795 0.0653 0.0761 0.0762 0.1 0.0898 0.0795 0.0966 0.102 0.107 0.116 0.0908 0.11 0.108 0.098 0.091 0.0781 0.0976 0.104 0.117 0.113 0.0911 0.114 0.121 0.0501 0.0435 0.0406 0.0545 0.0515 0.04 0.0432 0.0449 0.04 0.0413 0.0583 0.0487 0.0497 0.0546 0.0538 0.0445 0.0454 0.0495 0.0441 0.0433 0.272 0.243 0.161 0.271 0.28 0.304 0.244 0.182 0.306 0.289 0.273 0.235 0.169 0.277 0.275 0.292 0.259 0.183 0.291 0.296 Table 4.4: Adjusted rand index for the Disambiguated Skip-gram model with different dimensionalities, sense numbers and different regularization terms, eval- uated on different test datasets. The best results for each dataset and for each dimensionality are highlighted. 4.2.3 Word-similarity experiments The aim of the word-similarity task is to tell how two given words are similar to each other. Word-similarity datasets consist of word pairs with numerical similar- ity measures specified by experts. Predictions made by the model are compared against those gold standards. Unfortunately, many word-similarity datasets do not provide contexts and therefore are not suited to evaluate multi-sense word embeddings. As described in Section A.1.4 one popular dataset that does provide contexts is SCWS [Huang et al., 2012]. We use it as the main word-similarity benchmark in this work. Following [Bartunov et al., 2016] we use two metrics to assess contextual word-similarity: avgSimC(w1,w2) = k(cid:88) k(cid:88) P (s1 w1, Cw1)P (s2 w2, Cw2) cos(vw1,s1, vw2,s2) s1=1 s2=1 and maxSimC(w1, w2) = cos(vw1,s1, vw2,s2), 69 (4.19) (4.20) Model MSSG NP-MSSG MPSG AdaGram Disambiguated Skip-gram SemEval-2007 SemEval-2010 SemEval-2013 WWSI 0.194 0.110 0.160 0.286 0.292 0.033 0.033 0.014 0.061 0.045 0.085 0.044 0.077 0.097 0.117 0.048 0.033 0.044 0.069 0.077 Table 4.5: Adjusted rand index for different 300-dimensional multi-sense word embedding models. Disambiguated Skip-gram was trained with 5 senses, without neither entropy cost nor parallel penalty. MSSG and MPSG were trained with 3 senses. AdaGram was trained with α = 0.15. Results for all models except Disambiguated Skip-gram are taken from [Bartunov et al., 2016]. where: s1 = arg max s=1,...,k s2 = arg max s=1,...,k P (s w1, Cw1) P (s w2, Cw2). (4.21) Performance of Disambiguated Skip-gram in this task and comparison with other word embedding models is presented in Tab. 4.6. Note that the vanilla skip- Model Skip-gram MSSG NP-MSSG MPSG AdaGram Disambiguated Skip-gram avgSimC maxSimC 65.2 69.3 69.1 65.4 61.2 64.4 65.2 57.3 59.8 63.6 53.8 62.0 Table 4.6: Spearman's correlation coefficient multiplied by 100 for different 300- dimensional models evaluated on the SCWS dataset. Disambiguated Skip-gram, MSSG and MPSG were trained with 3 senses. AdaGram was trained with α = 0.15. Metrics definitions and results for all models except Disambiguated Skip- gram taken from [Bartunov et al., 2016]. gram model gives the best results according to maxSimC metric, despite the fact that it models only single sense per word and consequently ignores the context during prediction. This observation indicate that even contextual word-similarity datasets are not well suited to evaluate multi-sense embedding models. For the sake of completeness we also evaluate Disambiguated Skip-gram using one popular context-less datasets, namely WordSim353 [Finkelstein et al., 2001]. Since this dataset does not provide contexts, we simply average similarities be- tween embeddings of all senses of compared words: k(cid:88) k(cid:88) avgSim(w1, w2) = 1 k2 s1=1 s2=1 cos(vw1,s1, vw2,s2) (4.22) Results for this benchmark are presented in Tab. 4.7. 70 Model Skip-gram MSSG NP-MSSG Disambiguated Skip-gram avgSim 70.4 70.9 68.6 70.1 Table 4.7: Spearman's correlation coefficient multiplied by 100 for different 300- dimensional models evaluated on WordSim353 dataset. Disambiguated Skip-gram and MSSG were trained with 3 senses. Metric definition and results for all models except Disambiguated Skip-gram are taken from [Neelakantan et al., 2014]. Tab. 4.6 and Tab. 4.7 demonstrate that Disambiguated Skip-gram retain most of the word similarity features. The fact that Disambiguated Skip-gram performs a bit worse than some of the earlier models should not worry, because, as mentioned, this is not the most important task for evaluation of multi-sense word embedding models. 4.3 Conclusions In this chapter we presented a novel neural model for learning multi-sense word embeddings. We have shown that our method outperforms competing state-of-the- art approaches on the word sense induction task on three out of four benchmark datasets. We also performed qualitative evaluation of our model by querying a few nearest neighbors for ten popular ambiguous words. In contextual word similarity task our model performs slightly worse than some other multi-sense word embeddings. However, as pointed out by Bartunov et al. [Bartunov et al., 2016], word similarity task is not the best way to evaluate this kind of models. It is worth noting that the problem of ambiguity goes beyond text data. For ex- ample, a dimensionality reduction technique proposed by Hinton and Roweis [Hin- ton and Roweis, 2002] and later extended by van der Maaten and Hinton [van der Maaten and Hinton, 2012] is able to place any ambiguous high-dimensional object in multiple separated regions of the low-dimensional space. As a direction for future research we believe that the Disambiguated Skip- gram model can be enriched with subword (character n-gram) information. This strategy has recently turned out to be effective in the case of single-sense word embeddings [Bojanowski et al., 2017]. To adapt this idea to multi-sense models we can either learn character n-gram embeddings separately for each sense or we can share subword embeddings among senses. Disadvantage of the first approach is a significant increase in memory consumption and training time. In the second case, we would most probably need to introduce and learn some subword weights, which will allow us to mix subword into word-senses. 71 Chapter 5 Conclusions and directions for future research Advances in machine learning revolutionize the world and the way we live. Learn- ing algorithms are an becoming essential part of information systems. Text data, including output from speech recognition systems, is one of the most popular modalities used to train those algorithms. Most of the learning algorithms re- quire input data to be presented in a form of relatively short, fixed-size vectors. Therefore, being able to represent text in a dense distributed way is a crucial step in developing well-performing algorithms for text understanding and processing. This thesis contributes new algorithms and models for learning such representa- tions. 5.1 Contributions In this dissertation we focused on building vector representations of text data on two levels, namely a document level and a word level. Some vector representa- tions are generic and can be used for different machine learning tasks. Other are more tailored for specific needs. When it comes to document representations we focused on those used for fast text retrieval. Ideal information retrieval system would have both high precision and high recall. In practice, however, information retrieval systems often need to trade off between precision and recall. When a user is not willing to accept omission of any relevant documents, the recall is of primary importance. However, if the precision of top results is of higher importance than the recall, we can use locality preserving hashing techniques to retrieve documents via fast approximate nearest neighbor search. This kind of search have one im- portant design consideration: it can have some false negatives but should return as few false positives as possible. Those conditions are acceptable in many real world applications: users of search or recommendation engines will not complain if some relevant items are missing, as long as returned items are relevant to their query or context. Probably the most popular approach to approximate nearest neighbor search in text data is to learn binary codes from some real-valued document representa- tions. In this dissertation we proposed Binary Paragraph Vector: a neural network models for learning high-quality binary codes from text data without using an in- termediate representation (e.g. bag-of-words). We compared Binary PV models 72 with the seminal semantic hashing technique and demonstrated their superiority on three popular datasets. Also, we tested these models against methods that first learn real-valued representations and use them to infer binary codes. We showed that there is no clear benefit from using these indirect approaches instead of Binary PV models. Second part of the dissertations revolved around word level embeddings. Learn- ing high quality word embeddings is important because they are used for many downstream NLP tasks, like sentiment analysis, language modeling, question an- swering, part of speech tagging, neural machine translation or text summarization. Most of the leading word embedding techniques learn only one vector per word, consequently ignoring the fact that many words are ambiguous. Recently, however, there is an increasing interest in methods that learn separate vectors for distinct senses of words. We review and compare existing multi-sense word embedding solutions and then we propose Disambiguated Skip-gram: a new neural network that learns high-quality multi-sense word embeddings. Disambiguated Skip-gram outperforms state-of-the-art competing methods in the word sense induction task on three out of four benchmark test sets we used in evaluation. Furthermore, it has a elegant probabilistic interpretation. Finally, unlike previously proposed probabilistic multi-sense word embeddings models, Disambiguated Skip-gram is end-to-end differentiable and, therefore, can be easily trained with backpropaga- tion. 5.2 Future research directions This thesis opens several interesting directions for future research. In the case of binary document embeddings one idea could be to investigate binary document embedding models that takes word order into account and outperform simpler models, like Binary PV-DBOW. Another line of research could focus on speeding up code inference for new documents. An inherent limitation of our solution, and original Paragraph Vector as well, is the need for iterative numerical optimization in the inference phase. This optimization is much faster than training, because most of the model parameters are fixed in this phase. However, some time for convergence is still needed, which makes our models poorly suited for streaming or real-time processing. It would be interesting and valuable to extend Binary Paragraph Vector models to this kind of applications. In Section 3.2.5 we compared different strategies for binarization of activation in Binary PV models. It would be interesting to add relaxed bernoulli distribution to this comparision. Relaxed bernouli is a special case of the Gumbel-Sofmax [Jang et al., 2016, Maddison et al., 2016] distribution, which we successfully used in Disambiguated Skip-gram. In the case of Disambiguated Skip-gram, we believe that the model can be en- riched with subword information, following the technique proposed in [Bojanowski et al., 2017]. The idea is to predict context words using not only a given sense of a center word, but also vector representation of character n-grams in this sense. To this end, we could either store separate subword embeddings for each modeled sense or learn a model that would tell us how a given subword expresses itself in a given sense. Interestingly, character n-grams could also improve document 73 embeddings, so it may be worth trying to also incorporate them into the Binary Paragraph Vector models. Disambiguated Skip-gram is a parametric model, i.e. we need to specify the number of senses to be learned. We suggested using sense pruning to account for the fact that different words have different numbers of meanings. The assumption is that when a sense is pruned, its instances are distributed among remaining senses. An alternative approach could be to merge similar senses of a given word. We believe that this approach is worth investigation. Another research direction could be to evaluate Disambiguated Skip-gram in downstream tasks. Most multi-sense word embedding models, including ours, are evaluated using intrinsic evaluation methods, i.e. on some intermediate task with standardized benchmarks. We believe that it would be interesting to also evaluate Disambiguated Skip-gram in an extrinsic way, i.e. on selected real-word tasks. Since one of the most common architectures that are used with word embeddings is a recurrent neural network, we believe that it would be interesting to implement an LSTM network which takes multi-sense word embeddings as inputs and test it in downstream NLP tasks, e.g. language modeling. The Gumbel-Softmax gradient estimator used in Disambiguated Skip-gram is a biased estimator, i.e. its expected value differs from the true gradient. After we carried out the experiment with Disambiguated Skip-gram, [Tucker et al., 2017] proposed REBAR: an unbiased, but nevertheless low-variance, gradient estimator for models with discrete random variables. They report a good performance of this estimator in several models. It would be interesting to check whether replac- ing Gumbel-Softmax in Disambiguated Skip-gram with REBAR would improve learned embeddings. Yet another interesting direction for future research is multi-task learning in context of multi-sense word embeddings. Traditionally, learning models are de- veloped for specific problems and therefore perform specific tasks. However, in some domains, e.g. computer vision, it is not unusual to share neural network architectures between different tasks. It is more difficult to implement this idea in natural language processing. Nevertheless, some models were recently proposed that address this issue, e.g. [Hashimoto et al., 2017]. It would be interesting to see how multi-sense word embeddings can enrich such architectures. 74 Appendix A Datasets and experimental setup In this appendix we describe benchmark datasets and software libraries that we used to conduct the experiments. A.1 Datasets Experiments in Chapter 3 and Appendix B were conducted based on two popular English language text datasets, namely 20 Newsgroups and RCV1. Some basic test preprocessing was applied to the datasets. All characters were converted to lower case and stopwords (very frequent words that do not convey any specific informations) were removed. In case of some experiments stemming or lemmati- zation was applied on corpora. For stemming we used Porter's algorithm [Porter, 1980]. Below we briefly describe the 20 Newsgroups and RCV1 datasets. 20 Newsgroups A.1.1 The 20 Newsgroups1 dataset consist of 1.13 × 104 train documents and 7.5 × 103 test documents. Documents were collected in the mid 90's from Usenet discussion groups. They are written in an informal style and belong to one of the 20 topics. Documents are evenly distributed among topics. The full set of topics is presented in Tab. A.1. A.1.2 Reuters corpus volume 1 Reuters Corpus, Volume 1 (RCV1)2 is a collection of more than 8×105 professional news bulletins and articles written in years 1996-1997 in English and published by Reuters news agency. The language used is more formal than in the 20 Newsgroups corpus. The articles are annotated by one or more topics that form a hierarchy. The taxonomy of categories is convoluted. There are four top categories in the hierarchy: • markets, • economics, 1Available at http://qwone.com/~jason/20Newsgroups 2Available at http://trec.nist.gov/data/reuters/reuters.html 75 talk.politics.guns talk.politics.mideast talk.politics.misc talk.religion.misc soc.religion.christ alt.atheism sci.med sci.space sci.electronics sci.crypt comp.graphics comp.os.ms-windows.misc comp.sys.ibm.pc.hardware comp.sys.mac.hardware comp.windows.x rec.sport.hockey rec.sport.baseball rec.motorcycles rec.autos misc.forsale Table A.1: All the groups from the 20 Newsgroups dataset • government/social, • corporate/industrial. There exist two variants of the RCV1 corpus. The first variant is an original one published by Reuters company. Unfortunately it contains some erroneous data. For example some documents are not assigned to any of the topics. Other doc- uments' topic assignment violate the topic taxonomy. Therefore David D. Lewis at al. proposed [Lewis et al., 2004] a set of corrections and cleansing techniques. Corrected corpus is reffered as RCV1-v2. We use this variant in our experiments described later on in the dissertation. There is not official split into training and test data. The common choices are 50/50 and 90/10. A.1.3 English Wikipedia As of May 2017, English Wikipedia contains 5.4 × 106 articles written by an open community of editors and contributors. The Wikimedia Foundation, the body which governs Wikipedia, offers free download of backup files for each language separately. Articles are exported in a form of XML files containing not only text of articles but also categorization, metadata and hyperlinks. However, no external media, like graphics or videos, are included. Compressed dump file for English Wikipedia has size almost 14 GB. Due to its size and wide variety of topics, this corpus is often used to train general purpose word vectors. Wikipedia articles can have one or more categories assigned to them. Categories form a hierarchy but not a tree. Categories can have multiple parent categories and cyclic dependencies. In 2014 over 100 teams took part in a Kaggle competition3 aiming at classifying documents from English Wikipedia. Often in order to be able to compare results obtained using Wikipedia re- searchers do not download the latest snapshot but instead use older dumps pre- viously reported in research papers. One of those reference dumps of English Wikipedia is the 2010 Westbury Lab Wikipedia corpus4. It is provided in raw 3Available at https://www.kaggle.com/c/lshtc 4Available at http://www.psych.ualberta.ca/~westburylab/downloads/westburylab. wikicorp.download.html 76 text format. All XML tags were removed but no further text cleansing was ap- plied. In our experiments we also use more recent snapshot from April 5th, 2016. A.1.4 Word similarities datasets To assess quality of word embeddings word similarity datasets are used. The most popular word similarity dataset is WordSim353 [Finkelstein et al., 2001]. The datasets consists of word-word pairs with similarity scores ranked by humans. Words do not need to be synonymous to have high score. Words with differ- ent meanings, but which are often used together also have high scores assigned in WordSim353. For example, the following word-word pairs have high scores in WordSim353 datasets: weather-forecast, hotel-reservation and psychology- psychiatry. In contrast to WordSim353, SimLex-999 [Hill et al., 2016] is a datasets which provides 'genuine' similarity measures between words. Only word that are synonyms will get the high similarity values. There are both monosemous and polysemous words in both of those datasets. Due to the lack of contexts, there is no way to tell which sense of polysemous word is used. To overcome this limita- tion, Huang et al. proposed [Huang et al., 2012] the Contextual Word Similarities (SCWS) dataset. In addition to word-word pairs, the dataset provides textual con- text of each of the words. In contrast to the majority of word similarity datasets, Stanford Rare Word (RW) Similarity Dataset [Luong et al., 2013] contains infre- quent or morphologically complex words. A.1.5 Word sense induction and disambiguation datasets Word sense induction (WSI) datasets are used to assess and compare WSI systems. Those datasets consist of sets of words and for each word set of contexts. Each context is hand-annotated with sense assignment forming so-called gold standards. The WSI systems are given unannotated contexts and are asked to induce senses and disambiguate given words in contexts. The results are compared against the gold standards by using some metric like V-Measure [Rosenberg and Hirschberg, 2007], F-Score [Artiles et al., 2009] or adjusted rand index (ARI) [Hubert and Arabie, 1985]. Some popular WSI datasets frequently used as benchmarks were initially used to compare systems presented at the SemEval workshops organized annually by the Association for Computational Linguistics. Among them is the test dataset prepared for the task 2 of the 2007 edition of SemEval, described in [Agirre and Soroa, 2007]. It consists of over 2.7× 104 short texts from the Wall Street Journal. Each text has one selected word (noun or verb) which sense is hand-annotated. There are 100 distinct sense-annotated words, having 3.68 senses on average. Other popular dataset was prepared for the task 14 of the 2010 edition of Se- mEval and is described in [Manandhar et al., 2010]. It consists of approximately 9 × 103 texts from multiple news sources. As in the case of the above, each text has one selected word which sense is hand-annotated and there are 100 distinct sense-annotated words having on average 3.79 senses. Dataset introduced as a part of the task 13 of the SemEval 2013 workshop [Jurgens and Klapaftis, 2013] contains over 4× 103 contexts for 50 distinct words with a number of contexts per word ranging from 22 to 100. An average the number of senses for this dataset is 77 much higher than for the two previous and equals 6.02. An example of a bigger WSI dataset is the Wikipedia Word-sense Induction (WWSI) dataset described in [Bartunov et al., 2016]. It has over 3.6 × 104 sense- annotated texts for 188 distinct words having 2.2 senses on average. The contexts were extracted from ambiguous English Wikipedia pages, i.e. those that have the following text on top of them: For other uses, see X (disambiguation), where X is a placeholder for the current page name. A.2 Software One of the factors that enabled deep learning to took off was increased popularity of general-purpose computing on graphics processing units (GPU). Writing soft- ware which efficiently runs on GPU is considered to be more challenging than writing software targeting a central processing unit (CPU). Therefore, new soft- ware packages easing deep learning research have been created in recent years. For couple of years, three most popular libraries were Theano [Bastien et al., 2012], Torch [Collobert et al., 2011] and Caffe [Jia et al., 2014]. They all share some common characteristics. Computations are defined in a form of a computation graph using some high level language like Python (in the case of Theano and Caffe) or Lua (in the case of Torch). Computations are executed on either CPU or GPU. If they are executed on Nvidia GPU, then they can take advantage of Nvidia CuDNN, an efficient low level GPU-accelerated library providing implementations of activation functions and other operations common in neural networks. All the software libraries mentioned above provide some extension points. Users are welcome to implement custom activation functions or optimization algorithms. More recent deep learning libraries are TensorFlow [Abadi et al., 2016], CNTK [Yu et al., 2014] and MXNet [Chen et al., 2015]. The first one is supported by Google, the second by Microsoft and the third is an effort of a community of academia and industry contributors. Since TensorFlow was used to conduct experiments described in this dissertation the more elaborate description of this library is provided in a subsequent section. The other part of experiments described in this dissertation was carried out using AGH deep learning library [Grzegorczyk et al., 2015b], which is described below as well. Finally, it is worth mentioning that some researches prefer using higher-level neural networks APIs like Keras5, which enables build models from predefined blocks. A.2.1 TensorFlow According to [Clark, 2016], TensorFlow in just a half year became by far the most popular and versatile deep learning library leaving competition behind. Tensor- Flow was crated as a way to overcome limitations of an earlier deep learning library called DistBelief [Dean et al., 2012]. As in the case of most of the deep learning libraries, computations in TensorFlow are defined in a form of a data flow graph. The graph can be seen as a blueprint for the computations. It is not immediately executed but only when passed to a given TensorFlow session. The graph consists 5https://keras.io/ 78 of operations (dubbed ops for short) that are invoked on tensors. There are three types of tensors: constants, variables and placeholders. Constants are not modified during training and can be used to store model hyperparameters. Variables are often used to store model parameters. They can be modified during the training phase. Placeholders are tensors which are filled with data at execution time and are often used for passing training examples to the graph. After the graph is defined and the session is created a user can fill placeholders with some data and request evaluation of a certain tensor. Often this operation triggers many others dependent operations in the graph to be executed. User can decide where the tensors should be stored and evaluated. It is possible to run the graph on CPU, GPU, a distributed computing cluster or even on a mobile or embedded device. Regardless of execution platform TensorFlow tries to parallelize computations as much as possible. In the case of CPU and GPU platforms, computation are executed concurrently on multiple cores, while in the case of the distributed computing cluster on multiple machines. Moreover, the TensorFlow session enables requesting operation execution from multiple client threads. That way, huge dataset can be fed to the model concurrently by multiple workers. Probably the most appealing feature of TensorFlow is its ability to automati- cally compute gradients for any loss function. In order to compute gradients one need to select one of the many provided optimizers and invoke compute_gradients method on it, passing the loss function to it. There are many standard loss func- tions available in TensorFlow but users are welcome to implement their own as well. As a result, gradients for all parameters depending on the loss are computed. Having gradients one can pass them to the apply_gradients method, which will apply them to the relevant model parameters. Since those two steps often come together, there is a minimize method, which internally performs those two steps. TensorFlow is shipped with TensorBoard, a user-friendly web application for monitoring, analysis and debugging of models written using TensorFlow. In Ten- sorBoard one can display and browse the computation graph, analyze various statistics and monitor how certain model parameters are changing over time. For example in Fig. A.1 visualization of PV-DBOW model computation graph is pre- sented. Two parallel computation flows are visible on the figure. It is a consequence of the fact that PV-DBOW has two separate learning phases, namely training and inference. Each computation flow has its own embeddings, cost function and its own set of gradients. Softmax weight, as well as input_docs and input_labels placeholders are shared among those two phases. A.2.2 AGH deep learning library AGH deep learning library is developed at Department of Computer Science, AGH University of Science and Technology. It supports three types of neural networks models, namely deep belief networks, deep autoencoders and multilayer percep- trons. The networks can be build of one of the five available layer types: sigmoid, rectified linear, linear (with optional Gaussian noise), softmax (in the output layer) and constrained Poisson (for the bag-of-words input data). The library is written in C++11 and exclusively targets Nvidia CUDA platform. Most of linear algebra operations are delegated to the highly optimized Nvidia CUDA BLAS (cuBLAS) 79 Figure A.1: TensorBoard visualization of a PV-DBOW model computation graph. library. Operations that are not provided in cuBLAS are implemented in a form of kernel functions. Random numbers are generated using Nvidia cuRAND li- brary. During training, all of the model parameters and network activations are stored in the GPU device memory. To ease definition of experiments, a high level Python API is provided. Comprehensive description of the library together with performance evaluation is presented in [Grzegorczyk et al., 2015b]. An example of research carried out based on this library is reported in [Grzegorczyk et al., 2015a] and [Grzegorczyk et al., 2016]. We used this library to implement deep autoencoders used to test two simple document representations introduced in Ap- pendix B. 80 Appendix B Supplementary material Although distributed representations of text data are becoming more and more popular we believe there is still place for the traditional bag-of-words model. Its main advantage is simplicity. Unlike dense document representations, word counts can be computed in almost no time. The other advantage is that some machine learning algorithms or models explicitly require discrete input values. An example of such a model is the constrained Poisson model [Salakhutdinov and Hinton, 2009]. Also many topic models are build from simple word counts (e.g. [Hinton and Salakhutdinov, 2009]). Therefore, we believe that improvements to the bag-of- words model is still a vital research area. In this appendix we describe preliminary results towards developing two such methods. B.1 Improving the multi-prototype vector-space model with transfer learning One of the limitations of the bag-of-words model is that all senses of a given polysemous or homonymous word are represented by a single feature. To rectify this, as we discuss in Section 2.2.4, a multi-prototype vector-space model (MP- VSM) [Reisinger and Mooney, 2010] can be constructed. This model uses word sense induction [Schütze, 1998] to discover word senses. By and large, word sense induction requires big corpus to work well. However, this is not always the case. Sometimes we want to create MP-VSM for a relatively small dataset, like 20 Newsgroups. To address this problem, in this section we suggest to enrich MP-VSM with transfer learning. Specifically, as in MP-VSM we induce word senses in a target dataset using word occurrences' contexts clustering. However, unlike in MP-VSM we generate a vectorized representation of context by averaging context's words embeddings generated on a big external corpus. After induction, we represent a target dataset in a form of a multiset of those senses. We call this representation bag-of-senses. Our representation is tested with deep autoencoder. Deep autoencoders are useful for dimensionality reduction and data compression tasks [Hinton and Salakhutdinov, 2006]. After compression, we evaluate the resultant representation on an information retrieval task. We use two popular text benchmark datasets, namely 20 Newsgroups and RCV1-v2. 81 B.1.1 The bag-of-senses model To create the bag-of-senses representation of a target dataset we first need to generate high-quality word embeddings on an external big text corpus. We do this using the continuous bag of words (CBOW) [Mikolov et al., 2013a] model, but other models could be used as well. Then, we select some number of popular words, we randomly select some number of occurrences of those words in the target dataset and we generate vectorized representations of occurrences' contexts by averaging contexts' word vectors scaled by inverse document frequencies (IDF, defined by Eq. 2.10 on page 13) computed based on the target dataset. Then, we cluster contexts for each word separately. We use agglomerative hierarchical clustering with the complete linkage method. We have to limit a number of words for which clustering is carried out and a number of contexts for each word because clustering is a time-consuming operation. After clustering, branches of a resultant dendrogram are cut off at some level. The cut-off level can be considered as a model hyperparameter. For simplicity, we use the same level for all the words. The cut-off level can be seen as a knob by which we regulate how many senses on average there are. After that, we build a sense dictionary. For each word in the dictionary we store a list of its senses. Each sense is represented by a globally unique identifier and a cluster centroid vector. Having the word sense dictionary constructed we can represent target dataset documents as counts of word senses from the dictionary. To this end, for each word occurrence in a given document, its context vectorized representation is generated by averaging context's word embeddings (the same word embeddings that were used in the sense induction stage). Then, the context vectorized representation is compared with vectorized representations of each sense of a given word. The sense with the lowest cosine distance to the context is selected. A counter for that sense identifier in a document representation is incremented. This operation is repeated for all word occurrences in all the documents in a dataset. In the case there is no entry in a dictionary for a given word, this word is omitted. After processing all the documents, some number of the most frequent senses is selected (e.g. 2000) and the final target representation is generated, which include only those selected senses. It is likely that some words will be represented by multiple dimensions (features) in the target representation while others by none. Finally, it is worth mentioning that we cluster context only based on the training set. To convert test set into bag-of-senses we use the same cluster representations as for the training set. Also, since we can cluster context for each word separately it can be considered an embarrassingly parallel problem. B.1.2 Experiments We evaluate our approach on two popular text datasets, namely 20 Newsgroups and RCV1-v2. The datasets are described in Section A.1. Word embeddings are trained on English Wikipedia dump downloaded on April 5th 2016 using the gensim [Rehurek and Sojka, 2010] library. Before embedding generation, stop- words were removed from the corpus. For both datasets, occurrence contexts were selected for 5000 globally most frequent words. In the case of 20 Newsgroups, for each word we randomly selected up to 200 documents containing that word (on average just 90 documents because less popular words occur in less than 100 82 documents) and from each document we randomly selected just one context. By context we mean 5 words before and 5 words after a given word. Since the RCV1 corpus is much bigger than 20 Newsgroups and all 5000 globally most frequent words occur in at least 100 documents we decided to randomly select only 100 documents for each word, which gives us a similar number of contexts to be clus- tered as in the case of 20 Newsgroups. Then, we clustered contexts using hclust package from R software environment. We used version 3.2.1 of R. Optimal cut-off level for 20 Newsgroups selected on the validation set is as high as 0.85, which gives only 5199 unique meanings. For RCV1 it is 0.5, which gives 26037 mean- ings. Validation set for 20 Newsgroups was build by holding out a quarter of the training set, which in the case of 20 Newsgroups is given explicitly. Validation set for RCV1 was constructed by holding out 104 documents from the training set. The training set, in turn, was created by holding out 104 documents for testing from the entire document collection. Finally, for both datasets we prepared target representations of datasets having 2000 dimensions each, corresponding to 2000 globally most common senses. To evaluate the resultant bag-of-senses representation we conducted dimension- ality reduction task, and then performed information retrieval experiments. We used deep autoencoder for dimensionality reduction. For 20 Newsgroups we used network architecture depicted in Fig. B.1 and described in [Grzegorczyk et al., 2016]. Sizes of encoding layers are: 2000, 500, 250, 125 and 32. All of network Figure B.1: A deep autoencoder with hidden layers h1 to h7 and weight matrices W1 to W8. The aim of training is to restore output o to resemble input i as closely as possible. After the training, an encoder part of the autoencoder can be used to generate a low-dimensional representation h4 of input data i. hyperparameters were taken from that publication as well. Deep autoencoder architecture for RCV1 has been taken from [Salakhutdinov and Hinton, 2009]. It is depicted in Fig. 2.5 on page 28. It has one less encoding and decoding layers than the one used for 20 Newsgroups. The sizes are as follow: 2000, 500, 500 and 128. Both autoencoders were pre-trained using deep belief network. Networks were implemented based on the GPU-accelerated AGH deep learning library, described in Section A.2.2. After generating low-dimensional representations of the datasets we perform in- formation retrieval experiments following the procedure described in Section 3.2.1. 83 ih1h2h3h4h5h6h7oW1W2W3W4W5W6W7W8encoderdecoder All the experiments were carried out on the HP Apollo XL750f Gen9 liquid cooled HPC machines equipped with two Intel Xeon E5-2680v3 processors, 128 GB RAM and two Nvidia Tesla K40 GPUs. It takes approximately 30 seconds to cluster contexts for a single word on this machine. B.1.3 Results To evaluate results we use two popular metrics, namely mean average precision (MAP) and normalized discounted cumulative gain (NDCG) [Järvelin and Kekäläi- nen, 2002]. Results for 20 Newsgroups are reported in Tab. B.1 while for RCV1 in Tab. B.2. Precision-recall curves are depicted in Fig. B.2. We compare our re- Model bag-of-words bag-of-senses MAP NDCG@10 0.36 0.38 0.64 0.64 Table B.1: Results for the 20 Newsgroups dataset represented using 2000- dimensional bag-of-senses model compared against bag-of-words model. Both models were compressed to 32 dimensions using the same deep autoencoder. Model bag-of-words bag-of-senses MAP NDCG@10 0.22 0.23 0.74 0.72 Table B.2: Results for the RCV1 dataset represented using 2000-dimensional bag- of-senses model compared against bag-of-words model. Both models were com- pressed to 128 dimensions using the same deep autoencoder. (a) 20 Newsgroups (b) RCV1 Figure B.2: Precision-recall curves for bag-of-senses experiments. sults with a simple bag-of-words representation, where each document is encoded as a multiset of 2000 most frequent words. In the case of bag-of-words as well as in the case of bag-of-senses we considered simple word sense counters. We did not apply any normalization or weighting. In the case of both datasets MAP metric 84 10−210−1100Recall0.00.10.20.30.40.50.60.70.80.9Precisionbag-of-wordsbag-of-senses10−210−1100Recall0.10.20.30.40.50.60.7Precisionbag-of-wordsbag-of-senses value is slightly higher for bag-of-senses than bag-of-words. In the case or RCV1 a few top results are more accurate in the case of bag-of-words but overall AUC is higher for bag-of-senses. Since only one of the two important information retrieval metrics yielded systematically superior results, we decided not to declare results from this section as a part of contribution of this dissertation. B.2 Scaled-up TF-IDF representation As we discuss in Section 2.2.1, the bag-of-words representation can be enriched by taking into account the fact that some words occur in a small number of documents and therefore are more meaningful than words that occur in almost all the documents. However, weighting word counts with IDF shifts document vectors from integer into real-valued space, which sometimes can be considered a limitation. In this section we propose a simple trick that remedy this. Specifically, we suggest encoding documents as term frequencies with L2 normalization (TF) multiplied by inverse document frequencies (IDF) and by the ratio of the mean (MR) of all word counts (TF without any normalization) to the mean of all TF- IDF values: M R = avg(word_count) avg(TF-IDF ) = i=1 D(cid:80) N(cid:80) N(cid:80) D(cid:80) j=1 word_count , (B.1) TF-IDF i=1 j=1 where N is a number of documents in a dataset and D is a number of dimen- sions. In addition, resultant values are discretized (rounded to integers). This way we obtain a representation in which globally frequent terms are penalized but at the same time the mean of all the inputs equals a simple word count represen- tation mean. Therefore, we can feed such document to a network that requires discrete inputs (e.g. constrained Poisson model [Salakhutdinov and Hinton, 2009] or replicated softmax [Hinton and Salakhutdinov, 2009]). It should be noted that obtained model contains almost the same amount of information as the standard TF-IDF model. However, scaling it up to the level of word counts make it possible to use it in models which require word counts as an input. We call this represen- tation TF-IDF-MR. Since scaling factor MR is common for the whole dataset, computation complexity of preparation of TF-IDF-MR equals TF-IDF. B.2.1 Results To evaluate the TF-IDF-MR representation we follow the same procedure as in Section B.1. Specifically, we crated 2000-dimensional representations of the 20 Newsgroups and RCV1 datasets, and then we compressed them to 32 and 128 dimensions, respectively. We used the same autoencoder architectures with the same hyperparmeters values. Then, we performed information retrieval task. Re- sults for 20 Newsgroups are reported in Tab. B.3 while for RCV1 in Tab. B.4. Precision-recall curves are depicted in Fig. B.3. As revealed by these figures, for both datasets, TF-IDF-MR yields slightly better results than simple frequent word multiset representation. To some extent 85 Model MAP NDCG@10 bag-of-words 0.36 TF-IDF-MR 0.37 0.64 0.65 Table B.3: Results for 20 Newsgroups dataset represented using 2000-dimensional TF-IDF-MR model and compressed to 32 dimensions using deep autoencoder. Model MAP NDCG@10 bag-of-words 0.22 TF-IDF-MR 0.23 0.74 0.74 Table B.4: Results for the RCV1 dataset represented using 2000-dimensional TF- IDF-MR model and compressed to 128 dimensions using deep autoencoder. (a) 20 Newsgroups (b) RCV1 Figure B.3: Precision-recall curves for TF-IDF-MR experiments. this observation could be considered obvious because the TF-IDF representation is, by and large, considered a stronger representation than unweighted BoW. Our contribution lies in showing how TF-IDF can be simply adopted to be used by algorithms which require discrete inputs. However, the difference in performance between bag-of-words and TF-IDF-MR is so small, that it could be withing margin of error. Therefore, we decided not to declare those results as a contribution of this dissertation. B.3 Automated blog author profiling As discussed many times in this dissertation, dense vectorized representations of text data are finding more and more applications. One specific problem that, to the best of our knowledge, has not been tackled with the embedding methods is automated blog author profiling. Blog posts and social media posts are written at a massive scale. Being able to profile authors of those short and informal pieces of text is crucial. It can give some insight into the population structure and enables selection of user groups for microtargeted marketing and political campaigns [Schwartz et al., 2013]. 86 10−210−1100Recall0.00.10.20.30.40.50.60.70.80.9Precisionbag-of-wordsTF-IDF-MR10−210−1100Recall0.10.20.30.40.50.60.7Precisionbag-of-wordsTF-IDF-MR As a part of this dissertation we wanted to employ the Paragraph Vector models to predict some basic personal information of authors of blog posts based solely on their content. To this end, we used The Blog Authorship Corpus 1, which consists of almost 7 × 105 posts written by almost 2 × 104 authors. The posts are gender and age annotated. 43% of the authors are teenagers, 42% are in their 20s and the rest are in their 30s. Both sexes are equally represented. We wanted to predict gender and an age group. We started with generation of 300-dimensional document embeddings using Paragraph Vector. Then we trained logistic regression classifier to correctly predict gender and age. Results are presented in Tab. B.5. To improve the accuracy we used stratified 3-folds cross-validation. The results Baseline (predicting a majority class) Prediction based on handcrafted features (from [Schler et al., 2006]) Prediction based on document embeddings Gender Age 0.47 0.51 0.73 0.65 0.74 0.61 Table B.5: Classification accuracy. are compared against baseline (predicting a majority class) and reference results from [Schler et al., 2006], where the authors used handcrafted features to describe genders and age groups. Our results are superior to baseline but unfortunately inferior to the reference. The conclusion could be that the task is relatively hard and in such settings handcrafted features are crucial to describe subtle differences in language style between age groups and genders. (a) Separated by gender (b) Separated by an age group. Figure B.4: t-SNE visualizations of blog posts embeddings. To qualitatively evaluate the generated blog embeddings we compressed them to 2D using t-SNE and placed them on the plane. Visualizations are depicted in Fig. B.4. There is not much difference in gender. There is some difference in age. Teenage authors are separated from those in their 20s and 30s. 1Available at http://u.cs.biu.ac.il/~koppel/BlogCorpus.htm 87 malefemale10s20s30s B.4 Conclusions In this appendix we presented two simple tricks that lead to slight improvement in experiments relying on the bag-of-word representation. Those tricks could be used in processing pipeline downstream algorithms requiring discrete input. Important exemplars of those algorithm are topic models. 88 Bibliography [Abadi et al., 2016] Abadi, M., Agarwal, A., Barham, P., Brevdo, E., Chen, Z., Citro, C., Corrado, G. S., Davis, A., Dean, J., Devin, M., et al. (2016). Ten- sorFlow: Large-scale machine learning on heterogeneous distributed systems. arXiv preprint arXiv:1603.04467. [Abu-Mostafa et al., 2012] Abu-Mostafa, Y. S., Magdon-Ismail, M., and Lin, H.- T. (2012). Learning from data, volume 4. AMLBook Singapore. [Aggarwal and Reddy, 2013] Aggarwal, C. C. and Reddy, C. K. (2013). Data clustering: algorithms and applications. CRC Press. [Agirre and Soroa, 2007] Agirre, E. and Soroa, A. (2007). Semeval-2007 task 02: Evaluating word sense induction and discrimination systems. In Proceedings of the 4th International Workshop on Semantic Evaluations, pages 7 -- 12. Associa- tion for Computational Linguistics. [Anastasiu et al., 2013] Anastasiu, D. C., Tagarelli, A., and Karypis, G. (2013). Document clustering: The next frontier. [Arora et al., 2017] Arora, S., Liang, Y., and Ma, T. (2017). A simple but tough- to-beat baseline for sentence embeddings. In Proceedings of the International Conference on Learning Representations (ICLR). [Artiles et al., 2009] Artiles, J., Amigó, E., and Gonzalo, J. (2009). The role of named entities in web people search. In Proceedings of the 2009 Conference on Empirical Methods in Natural Language Processing (EMNLP), volume 2, pages 534 -- 542. Association for Computational Linguistics. [Arya et al., 1998] Arya, S., Mount, D. M., Netanyahu, N. S., Silverman, R., and Wu, A. Y. (1998). An optimal algorithm for approximate nearest neighbor searching fixed dimensions. Journal of the ACM (JACM), 45(6):891 -- 923. [Bartunov et al., 2016] Bartunov, S., Kondrashkin, D., Osokin, A., and Vetrov, D. (2016). Breaking sticks and ambiguities with adaptive skip-gram. In Proceedings of the 19th International Conference on Artificial Intelligence and Statistics, pages 130 -- 138. [Bastien et al., 2012] Bastien, F., Lamblin, P., Pascanu, R., Bergstra, J., Good- fellow, I., Bergeron, A., Bouchard, N., Warde-Farley, D., and Bengio, Y. (2012). Theano: new features and speed improvements. arXiv preprint arXiv:1211.5590. 89 [Bengio et al., 2003] Bengio, Y., Ducharme, R., Vincent, P., and Jauvin, C. (2003). A neural probabilistic language model. Journal of machine learning research, 3(Feb):1137 -- 1155. [Bengio et al., 2013] Bengio, Y., Léonard, N., and Courville, A. (2013). Estimat- ing or propagating gradients through stochastic neurons for conditional compu- tation. arXiv preprint arXiv:1308.3432. [Bishop, 2006] Bishop, C. M. (2006). Pattern Recognition and Machine Learning. Springer. [Blei et al., 2003] Blei, D. M., Ng, A. Y., and Jordan, M. I. (2003). Latent Dirich- let allocation. the Journal of machine Learning research, 3:993 -- 1022. [Bloom, 1970] Bloom, B. H. (1970). Space/time trade-offs in hash coding with allowable errors. Communications of the ACM, 13(7):422 -- 426. [Bojanowski et al., 2017] Bojanowski, P., Grave, E., Joulin, A., and Mikolov, T. (2017). Enriching word vectors with subword information. Transactions of the Association for Computational Linguistics, 5:135 -- 146. [Broder, 1997] Broder, A. Z. (1997). On the resemblance and containment of In Compression and Complexity of Sequences 1997. Proceedings, documents. pages 21 -- 29. IEEE. [Charikar, 2002] Charikar, M. S. (2002). Similarity estimation techniques from rounding algorithms. In Proceedings of the thiry-fourth annual ACM symposium on Theory of computing, pages 380 -- 388. Association for Computing Machinery. [Chen et al., 2015] Chen, T., Li, M., Li, Y., Lin, M., Wang, N., Wang, M., Xiao, T., Xu, B., Zhang, C., and Zhang, Z. (2015). MXNet: A flexible and efficient machine learning library for heterogeneous distributed systems. arXiv preprint arXiv:1512.01274. [Chen et al., 2014] Chen, X., Liu, Z., and Sun, M. (2014). A unified model for word sense representation and disambiguation. In Proceedings of the 2014 Con- ference on Empirical Methods in Natural Language Processing (EMNLP), pages 1025 -- 1035. Association for Computational Linguistics. [Cho et al., 2014] Cho, K., Van Merriënboer, B., Gulcehre, C., Bahdanau, D., Bougares, F., Schwenk, H., and Bengio, Y. (2014). Learning phrase repre- sentations 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. Association for Computational Linguis- tics. [Cho et al., 2015] Cho, S. J. K., Memisevic, R., and Bengio, Y. (2015). On using very large target vocabulary for neural machine translation. 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, pages 1 -- 10. Association for Computational Linguistics. 90 [Chung et al., 2016] Chung, J., Ahn, S., and Bengio, Y. (2016). Hierarchical mul- tiscale recurrent neural networks. arXiv preprint arXiv:1609.01704. [Clark, 2016] Clark, J. (2016). Google sprints ahead in ai building blocks, leaving rivals wary. Bloomberg Technology, 21 July. Hyperlink. [Collobert et al., 2011] Collobert, R., Kavukcuoglu, K., and Farabet, C. (2011). Torch7: A matlab-like environment for machine learning. In BigLearn, NIPS Workshop, number EPFL-CONF-192376. [Cormode and Muthukrishnan, 2005] Cormode, G. and Muthukrishnan, S. (2005). An improved data stream summary: the count-min sketch and its applications. Journal of Algorithms, 55(1):58 -- 75. [Cortes and Vapnik, 1995] Cortes, C. and Vapnik, V. (1995). Support-vector net- works. Machine learning, 20(3):273 -- 297. [Cybenko, 1989] Cybenko, G. (1989). Approximation by superpositions of a sigmoidal function. Mathematics of Control, Signals, and Systems (MCSS), 2(4):303 -- 314. [Dean et al., 2012] Dean, J., Corrado, G., Monga, R., Chen, K., Devin, M., Mao, M., Senior, A., Tucker, P., Yang, K., Le, Q. V., et al. (2012). Large scale dis- tributed deep networks. In Advances in neural information processing systems, pages 1223 -- 1231. [Deerwester et al., 1990] Deerwester, S., Dumais, S. T., Furnas, G. W., Landauer, T. K., and Harshman, R. (1990). Indexing by latent semantic analysis. Journal of the American society for information science, 41(6):391. [Dempster et al., 1977] Dempster, A. P., Laird, N. M., and Rubin, D. B. (1977). Maximum likelihood from incomplete data via the EM algorithm. Journal of the royal statistical society. Series B (methodological), pages 1 -- 38. [Deng et al., 2010] Deng, L., Seltzer, M. L., Yu, D., Acero, A., Mohamed, A.-r., and Hinton, G. E. (2010). Binary coding of speech spectrograms using a deep auto-encoder. In Interspeech, pages 1692 -- 1695. [Dhillon and Modha, 2001] Dhillon, I. S. and Modha, D. S. (2001). Concept de- compositions for large sparse text data using clustering. Machine learning, 42(1-2):143 -- 175. [Domingos, 2015] Domingos, P. (2015). The master algorithm: How the quest for the ultimate learning machine will remake our world. Basic Books. [Duchi et al., 2011] Duchi, J., Hazan, E., and Singer, Y. (2011). Adaptive sub- gradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 12(Jul):2121 -- 2159. [Durand and Flajolet, 2003] Durand, M. and Flajolet, P. (2003). Loglog counting of large cardinalities. In European Symposium on Algorithms, pages 605 -- 617. Springer. 91 [Faruqui et al., 2016] Faruqui, M., Tsvetkov, Y., Rastogi, P., and Dyer, C. (2016). Problems with evaluation of word embeddings using word similarity tasks. pages 30 -- 35. [Finkelstein et al., 2001] Finkelstein, L., Gabrilovich, E., Matias, Y., Rivlin, E., Solan, Z., Wolfman, G., and Ruppin, E. (2001). Placing search in context: The concept revisited. In Proceedings of the 10th international conference on World Wide Web, pages 406 -- 414. Association for Computing Machinery. [Gantz and Reinsel, 2012] Gantz, J. and Reinsel, D. (2012). The digital universe in 2020: Big data, bigger digital shadows, and biggest growth in the far east. Technical report, IDC. [Glorot and Bengio, 2010] Glorot, X. and Bengio, Y. (2010). Understanding the difficulty of training deep feedforward neural networks. In International Con- ference on Artificial Intelligence and Statistics, pages 249 -- 256. [Golovin et al., 2017] Golovin, D., Solnik, B., Moitra, S., Kochanski, G., Karro, J., and Sculley, D. (2017). Google Vizier: A service for black-box optimization. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowl- edge Discovery and Data Mining, pages 1487 -- 1495. Association for Computing Machinery. [Gong and Lazebnik, 2011] Gong, Y. and Lazebnik, S. (2011). Iterative quanti- zation: A procrustean approach to learning binary codes. In Computer Vision and Pattern Recognition (CVPR), 2011 IEEE Conference on, pages 817 -- 824. IEEE. [Goodfellow et al., 2016] Goodfellow, I., Bengio, Y., and Courville, A. (2016). Deep Learning. MIT Press. http://www.deeplearningbook.org. [Goodfellow et al., 2014] Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., and Bengio, Y. (2014). Generative adversarial nets. In Advances in neural information processing systems, pages 2672 -- 2680. [Graves, 2013] Graves, A. (2013). Generating sequences with recurrent neural networks. arXiv preprint arXiv:1308.0850. [Graves et al., 2013] Graves, A., Mohamed, A.-r., and Hinton, G. (2013). Speech recognition with deep recurrent neural networks. In Acoustics, speech and signal processing (icassp), 2013 ieee international conference on, pages 6645 -- 6649. IEEE. [Grover and Leskovec, 2016] Grover, A. and Leskovec, J. (2016). node2vec: Scal- able feature learning for networks. In Proceedings of the 22nd ACM SIGKDD international conference on Knowledge discovery and data mining, pages 855 -- 864. Association for Computing Machinery. [Grzegorczyk and Kurdziel, 2017] Grzegorczyk, K. and Kurdziel, M. (2017). Bi- nary paragraph vectors. In Proceedings of the 2nd Workshop on Representation Learning for NLP, pages 121 -- 130. Association for Computational Linguistics. 92 [Grzegorczyk et al., 2015a] Grzegorczyk, K., Kurdziel, M., and Wójcik, P. I. (2015a). Effects of sparse initialization in deep belief networks. Computer Science, 16(4):313 -- 327. [Grzegorczyk et al., 2015b] Grzegorczyk, K., Kurdziel, M., and Wójcik, P. I. (2015b). Implementing deep learning algorithms on graphics processor units. In Proceedings of the 11th International Conference on Parallel Processing and Applied Mathematics (PPAM'2015), pages 473 -- 482. Springer. [Grzegorczyk et al., 2016] Grzegorczyk, K., Kurdziel, M., and Wójcik, P. I. (2016). Encouraging orthogonality between weight vectors in pretrained deep neural networks. Neurocomputing, 202:84 -- 90. [Gumbel, 1954] Gumbel, E. J. (1954). Statistical theory of extreme values and some practical applications: a series of lectures. Number 33. US Govt. Print. Office. [Gutmann and Hyvärinen, 2010] Gutmann, M. and Hyvärinen, A. (2010). Noise- contrastive estimation: A new estimation principle for unnormalized statistical models. In International Conference on Artificial Intelligence and Statistics, pages 297 -- 304. [Harris, 1954] Harris, Z. S. (1954). Distributional structure. Word, 10(2-3):146 -- 162. [Hashimoto et al., 2017] Hashimoto, K., xiong, c., Tsuruoka, Y., and Socher, R. (2017). A joint many-task model: Growing a neural network for multiple NLP tasks. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 446 -- 456. Association for Computational Linguistics. [He et al., 2016] He, K., Zhang, X., Ren, S., and Sun, J. (2016). Deep residual learning for image recognition. In IEEE Conference on Computer Vision and Pattern Recognition, pages 770 -- 778. [Hill et al., 2016] Hill, F., Reichart, R., and Korhonen, A. (2016). Simlex-999: Evaluating semantic models with (genuine) similarity estimation. Computa- tional Linguistics. [Hinton, 1984] Hinton, G. E. (1984). Distributed representations. [Hinton, 1986] Hinton, G. E. (1986). Learning distributed representations of con- cepts. In Proceedings of the eighth annual conference of the cognitive science society, volume 1, page 12. Amherst, MA. [Hinton, 2002] Hinton, G. E. (2002). Training products of experts by minimizing contrastive divergence. Neural computation, 14(8):1771 -- 1800. [Hinton and Roweis, 2002] Hinton, G. E. and Roweis, S. T. (2002). Stochastic In Advances in neural information processing systems, neighbor embedding. pages 833 -- 840. 93 [Hinton and Salakhutdinov, 2006] Hinton, G. E. and Salakhutdinov, R. R. (2006). Reducing the dimensionality of data with neural networks. Science, 313(5786):504 -- 507. [Hinton and Salakhutdinov, 2009] Hinton, G. E. and Salakhutdinov, R. R. (2009). Replicated softmax: an undirected topic model. In Advances in neural infor- mation processing systems, pages 1607 -- 1614. [Hochreiter and Schmidhuber, 1997] Hochreiter, S. and Schmidhuber, J. (1997). Long short-term memory. Neural computation, 9(8):1735 -- 1780. [Huang et al., 2009] Huang, A., Milne, D., Frank, E., and Witten, I. H. (2009). Clustering documents using a Wikipedia-based concept representation. In Ad- vances in Knowledge Discovery and Data Mining, pages 628 -- 636. Springer. [Huang et al., 2012] Huang, E. H., Socher, R., Manning, C. D., and Ng, A. Y. (2012). Improving word representations via global context and multiple word prototypes. In Proceedings of the 50th Annual Meeting of the Association for Computational Linguistics: Long Papers-Volume 1, pages 873 -- 882. Association for Computational Linguistics. [Huber et al., 1964] Huber, P. J. et al. (1964). Robust estimation of a location parameter. The Annals of Mathematical Statistics, 35(1):73 -- 101. [Hubert and Arabie, 1985] Hubert, L. and Arabie, P. (1985). Comparing parti- tions. Journal of classification, 2(1):193 -- 218. [Indyk and Motwani, 1998] Indyk, P. and Motwani, R. (1998). Approximate near- est neighbors: towards removing the curse of dimensionality. In Proceedings of the thirtieth annual ACM symposium on Theory of computing, pages 604 -- 613. Association for Computing Machinery. [Ioffe and Szegedy, 2015] Ioffe, S. and Szegedy, C. (2015). Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Pro- ceedings of The 32nd International Conference on Machine Learning, pages 448 -- 456. [James et al., 2013] James, G., Witten, D., Hastie, T., and Tibshirani, R. (2013). An introduction to statistical learning, volume 6. Springer. [Jang et al., 2016] Jang, E., Gu, S., and Poole, B. (2016). Categorical reparame- terization with Gumbel-Softmax. arXiv preprint arXiv:1611.01144. [Järvelin and Kekäläinen, 2002] Järvelin, K. and Kekäläinen, J. (2002). Cumu- lated gain-based evaluation of IR techniques. ACM Transactions on Information Systems (TOIS), 20(4):422 -- 446. [Jauhar et al., 2015] Jauhar, S. K., Dyer, C., and Hovy, E. (2015). Ontologically grounded multi-sense representation learning for semantic vector space mod- els. In Proceedings of the 2015 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 683 -- 693. Association for Computational Linguistics. 94 [Jia et al., 2014] Jia, Y., Shelhamer, E., Donahue, J., Karayev, S., Long, J., Gir- shick, R., Guadarrama, S., and Darrell, T. (2014). Caffe: Convolutional archi- tecture for fast feature embedding. arXiv preprint arXiv:1408.5093. [Jurafsky and Martin, 2008] Jurafsky, D. and Martin, J. H. (2008). Speech and language processing, 2nd edition. Prentice Hall. [Jurgens and Klapaftis, 2013] Jurgens, D. and Klapaftis, I. P. (2013). Semeval- 2013 task 13: Word sense induction for graded and non-graded senses. In Proceedings of the 7th international workshop on semantic evaluation, pages 290 -- 299. Association for Computational Linguistics. [Karpathy and Fei-Fei, 2015] Karpathy, A. and Fei-Fei, L. (2015). Deep visual- semantic alignments for generating image descriptions. In Proceedings of the IEEE conference on computer vision and pattern recognition (CVPR), pages 3128 -- 3137. [Kim, 2014] Kim, Y. (2014). Convolutional neural networks for sentence classifi- cation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1746 -- 1751. Association for Computa- tional Linguistics. [Kingma and Ba, 2014] Kingma, D. and Ba, J. (2014). Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980. [Kingma and Welling, 2013] Kingma, D. P. and Welling, M. (2013). Auto- encoding variational bayes. arXiv preprint arXiv:1312.6114. [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 information processing systems, pages 3294 -- 3302. [Koch et al., 2015] Koch, G., Zemel, R., and Salakhutdinov, R. (2015). Siamese neural networks for one-shot image recognition. In ICML Deep Learning Work- shop, volume 2. [Krizhevsky and Hinton, 2011] Krizhevsky, A. and Hinton, G. E. (2011). Using very deep autoencoders for content-based image retrieval. In Proceedings of the 19th European Symposium on Artificial Neural Networks, pages 489 -- 494. [Krizhevsky et al., 2012] Krizhevsky, A., Sutskever, I., and Hinton, G. E. (2012). ImageNet classification with deep convolutional neural networks. In Advances in neural information processing systems, pages 1097 -- 1105. [Lafferty and Blei, 2006] Lafferty, J. D. and Blei, D. M. (2006). Correlated topic models. In Advances in neural information processing systems, pages 147 -- 154. [Lau and Baldwin, 2016] Lau, J. H. and Baldwin, T. (2016). An empirical evalu- ation of doc2vec with practical insights into document embedding generation. In Proceedings of the 1st Workshop on Representation Learning for NLP, pages 78 -- 86. Association for Computational Linguistics. 95 [Le and Mikolov, 2014] Le, Q. and Mikolov, T. (2014). Distributed representa- In Proceedings of The 31st International tions of sentences and documents. Conference on Machine Learning, pages 1188 -- 1196. [LeCun et al., 2015] LeCun, Y., Bengio, Y., and Hinton, G. (2015). Deep learning. Nature, 521(7553):436 -- 444. [LeCun et al., 1998] LeCun, Y., Bottou, L., Bengio, Y., and Haffner, P. (1998). Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278 -- 2324. [Lehmann et al., 2014] Lehmann, J., Isele, R., Jakob, M., Jentzsch, A., Kon- tokostas, D., Mendes, P., Hellmann, S., Morsey, M., van Kleef, P., Auer, S., and Bizer, C. (2014). DBpedia - a large-scale, multilingual knowledge base extracted from Wikipedia. Semantic Web Journal. [Lesk, 1986] Lesk, M. (1986). Automatic sense disambiguation using machine readable dictionaries: how to tell a pine cone from an ice cream cone. In Pro- ceedings of the 5th annual international conference on Systems documentation, pages 24 -- 26. Association for Computing Machinery. [Levy and Goldberg, 2014] Levy, O. and Goldberg, Y. (2014). Neural word em- In Advances in neural information bedding as implicit matrix factorization. processing systems, pages 2177 -- 2185. [Lewis et al., 2004] Lewis, D. D., Yang, Y., Rose, T. G., and Li, F. (2004). RCV1: A new benchmark collection for text categorization research. Journal of machine learning research, 5:361 -- 397. [Li et al., 2015] Li, B., Liu, T., Du, X., Zhang, D., and Zhao, Z. (2015). Learning document embeddings by predicting n-grams for sentiment classification of long movie reviews. arXiv preprint arXiv:1512.08183. [Li and Jurafsky, 2015] Li, J. and Jurafsky, D. (2015). Do multi-sense embeddings improve natural language understanding? In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1722 -- 1732. Association for Computational Linguistics. [Lin et al., 2015] Lin, K., Yang, H. F., Hsiao, J. H., and Chen, C. S. (2015). Deep learning of binary hash codes for fast image retrieval. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 27 -- 35. [Liu et al., 2015] Liu, Y., Liu, Z., Chua, T.-S., and Sun, M. (2015). Topical word embeddings. In Proceedings of the Twenty-Ninth AAAI Conference on Artificial Intelligence, pages 2418 -- 2424. [Luong et al., 2013] Luong, M.-T., Socher, R., and Manning, C. D. (2013). Bet- In ter word representations with recursive neural networks for morphology. Proceedings of the Seventeenth Conference on Computational Natural Language Learning, pages 104 -- 113. Association for Computational Linguistics. 96 [Maddison et al., 2016] Maddison, C. J., Mnih, A., and Teh, Y. W. (2016). The concrete distribution: A continuous relaxation of discrete random variables. arXiv preprint arXiv:1611.00712. [Manandhar et al., 2010] Manandhar, S., Klapaftis, I. P., Dligach, D., and Prad- han, S. S. (2010). Semeval-2010 task 14: Word sense induction & disambigua- tion. In Proceedings of the 5th international workshop on semantic evaluation, pages 63 -- 68. Association for Computational Linguistics. [Manning et al., 2008] Manning, C. D., Raghavan, P., and Schütze, H. (2008). Introduction to information retrieval. [Manning and Schütze, 1999] Manning, C. D. and Schütze, H. (1999). Founda- tions of statistical natural language processing, volume 999. MIT Press. [Martens, 2010] Martens, J. (2010). Deep learning via Hessian-free optimization. In Fürnkranz, J. and Joachims, T., editors, Proceedings of the 27th International Conference on Machine Learning (ICML-10), pages 735 -- 742. Omnipress. [Masci et al., 2014] Masci, J., Bronstein, M. M., Bronstein, A. M., and Schmid- huber, J. (2014). Multimodal similarity-preserving hashing. IEEE transactions on pattern analysis and machine intelligence, 36(4):824 -- 830. [McCulloch and Pitts, 1943] McCulloch, W. S. and Pitts, W. (1943). A logical calculus of the ideas immanent in nervous activity. The bulletin of mathematical biophysics, 5(4):115 -- 133. [McMahan et al., 2013] McMahan, H. B., Holt, G., Sculley, D., Young, M., Ebner, D., Grady, J., Nie, L., Phillips, T., Davydov, E., Golovin, D., et al. (2013). Ad click prediction: a view from the trenches. In Proceedings of the 19th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 1222 -- 1230. Association for Computing Machinery. [Mikolov et al., 2013a] Mikolov, T., Chen, K., Corrado, G., and Dean, J. (2013a). Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781. [Mikolov et al., 2013b] Mikolov, T., Sutskever, I., Chen, K., Corrado, G. S., and Dean, J. (2013b). Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pages 3111 -- 3119. [Miller, 1995] Miller, G. A. (1995). WordNet: a lexical database for English. Communications of the ACM, 38(11):39 -- 41. [Morin and Bengio, 2005] Morin, F. and Bengio, Y. (2005). Hierarchical proba- bilistic neural network language model. In Aistats, volume 5, pages 246 -- 252. [Murphy, 2012] Murphy, K. P. (2012). Machine learning: a probabilistic perspec- tive. MIT press. 97 [Nair and Hinton, 2010] Nair, V. and Hinton, G. E. (2010). Rectified linear units improve restricted Boltzmann machines. In Fürnkranz, J. and Joachims, T., editors, Proceedings of the 27th International Conference on Machine Learning (ICML-10), pages 807 -- 814. Omnipress. [Navigli and Ponzetto, 2012] Navigli, R. and Ponzetto, S. P. (2012). BabelNet: The automatic construction, evaluation and application of a wide-coverage mul- tilingual semantic network. Artificial Intelligence, 193:217 -- 250. [Neelakantan et al., 2014] Neelakantan, A., Shankar, J., Passos, A., and McCal- lum, A. (2014). Efficient non-parametric estimation of multiple embeddings per word in vector space. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1059 -- 1069. Associa- tion for Computational Linguistics. [Pennington et al., 2014] Pennington, J., Socher, R., and Manning, C. D. (2014). Glove: Global vectors for word representation. In Proceedings of the 2014 Con- ference on Empirical Methods in Natural Language Processing (EMNLP), vol- ume 14, pages 1532 -- 1543. Association for Computational Linguistics. [Pereyra et al., 2017] Pereyra, G., Tucker, G., Chorowski, J., Kaiser, Ł., and Hin- ton, G. (2017). Regularizing neural networks by penalizing confident output distributions. arXiv preprint arXiv:1701.06548. [Perozzi et al., 2014] Perozzi, B., Al-Rfou, R., and Skiena, S. (2014). Deepwalk: Online learning of social representations. In Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 701 -- 710. Association for Computing Machinery. [Polyak, 1964] Polyak, B. T. (1964). Some methods of speeding up the convergence of iteration methods. USSR Computational Mathematics and Mathematical Physics, 4(5):1 -- 17. [Porter, 1980] Porter, M. F. (1980). An algorithm for suffix stripping. Program, 14(3):130 -- 137. [Qiu et al., 2016] Qiu, L., Tu, K., and Yu, Y. (2016). Context-dependent sense In Proceedings of the 2016 Conference on Empirical Methods in embedding. Natural Language Processing (EMNLP), pages 183 -- 191. Association for Com- putational Linguistics. [Raiko et al., 2014] Raiko, T., Berglund, M., Alain, G., and Dinh, L. (2014). Techniques for learning binary stochastic feedforward neural networks. arXiv preprint arXiv:1406.2989. [Recht et al., 2011] Recht, B., Re, C., Wright, S., and Niu, F. (2011). Hogwild: A lock-free approach to parallelizing stochastic gradient descent. In Advances in neural information processing systems, pages 693 -- 701. [Rehurek and Sojka, 2010] Rehurek, R. and Sojka, P. (2010). Software framework for topic modelling with large corpora. In Proceedings of the LREC 2010 Work- shop on New Challenges for NLP Frameworks. 98 [Reisinger and Mooney, 2010] Reisinger, J. and Mooney, R. J. (2010). Multi- prototype vector-space models of word meaning. In Human Language Tech- nologies: The 2010 Annual Conference of the North American Chapter of the Association for Computational Linguistics, pages 109 -- 117. Association for Com- putational Linguistics. [Rong, 2014] Rong, X. (2014). word2vec parameter learning explained. arXiv preprint arXiv:1411.2738. [Rosenberg and Hirschberg, 2007] Rosenberg, A. and Hirschberg, J. (2007). V- measure: A conditional entropy-based external cluster evaluation measure. In Proceedings of the 2007 Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning (EMNLP- CoNLL), pages 410 -- 420. Association for Computational Linguistics. [Rosenblatt, 1958] Rosenblatt, F. (1958). The perceptron: a probabilistic model for information storage and organization in the brain. Psychological review, 65(6):386. [Rumelhart et al., 1986] Rumelhart, D. E., Hinton, G. E., and Williams, R. J. Nature, Learning representations by back-propagating errors. (1986). 323(6088):533 -- 536. [Salakhutdinov and Hinton, 2009] Salakhutdinov, R. and Hinton, G. E. (2009). Semantic hashing. International Journal of Approximate Reasoning, 50(7):969 -- 978. [Salton et al., 1975] Salton, G., Wong, A., and Yang, C.-S. (1975). A vector space model for automatic indexing. Communications of the ACM, 18(11):613 -- 620. [Schler et al., 2006] Schler, J., Koppel, M., Argamon, S., and Pennebaker, J. W. In AAAI spring symposium: (2006). Effects of age and gender on blogging. Computational approaches to analyzing weblogs, volume 6, pages 199 -- 205. [Schütze, 1998] Schütze, H. (1998). Automatic word sense discrimination. Com- putational linguistics, 24(1):97 -- 123. [Schwartz et al., 2013] Schwartz, H. A., Eichstaedt, J. C., Kern, M. L., Dziurzyn- ski, L., Ramones, S. M., Agrawal, M., Shah, A., Kosinski, M., Stillwell, D., Seligman, M. E., et al. (2013). Personality, gender, and age in the language of social media: The open-vocabulary approach. PloS one, 8(9):1 -- 16. [Shazeer et al., 2016] Shazeer, N., Doherty, R., Evans, C., and Waterson, C. Improving embeddings by noticing what's missing. arXiv (2016). Swivel: preprint arXiv:1602.02215. [Smolensky, 1986] Smolensky, P. (1986). Information processing in dynamical sys- tems: Foundations of harmony theory. In Rumelhart, D. E. and McClelland, J. L., editors, Parallel Distributed Processing: Explorations in the Microstruc- ture of Cognition, Vol. 1, pages 194 -- 281. MIT Press. 99 [Socher et al., 2013] Socher, R., Bauer, J., Manning, C. D., and Ng, A. Y. (2013). Parsing with compositional vector grammars. In Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics, pages 455 -- 465. [Speer et al., 2017] Speer, R., Chin, J., and Havasi, C. (2017). ConceptNet 5.5: An open multilingual graph of general knowledge. In AAAI, pages 4444 -- 4451. [Srivastava et al., 2014] Srivastava, N., Hinton, G. E., Krizhevsky, A., Sutskever, I., and Salakhutdinov, R. (2014). Dropout: A simple way to prevent neural net- works from overfitting. The Journal of Machine Learning Research, 15(1):1929 -- 1958. [Sutskever et al., 2011] Sutskever, I., Martens, J., and Hinton, G. E. (2011). Gen- erating text with recurrent neural networks. In Proceedings of the 28th Inter- national Conference on Machine Learning (ICML-11), pages 1017 -- 1024. [Sutskever et al., 2014] Sutskever, I., Vinyals, O., and Le, Q. V. (2014). Sequence to sequence learning with neural networks. In Advances in neural information processing systems, pages 3104 -- 3112. [Szegedy et al., 2015] Szegedy, C., Liu, W., Jia, Y., Sermanet, P., Reed, S., Anguelov, D., Erhan, D., Vanhoucke, V., and Rabinovich, A. (2015). Going deeper with convolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1 -- 9. [Tian et al., 2014] Tian, F., Dai, H., Bian, J., Gao, B., Zhang, R., Chen, E., and Liu, T.-Y. (2014). A probabilistic model for learning multi-prototype word em- beddings. In Proceedings of COLING 2014, the 25th International Conference on Computational Linguistics: Technical Papers, pages 151 -- 160. Dublin City University and Association for Computational Linguistics. [Tieleman, 2008] Tieleman, T. (2008). Training restricted Boltzmann machines using approximations to the likelihood gradient. In Proceedings of the 25th international conference on Machine learning, pages 1064 -- 1071. Association for Computing Machinery. [Tucker et al., 2017] Tucker, G., Mnih, A., Maddison, C. J., Lawson, J., and Sohl- Dickstein, J. (2017). REBAR: Low-variance, unbiased gradient estimates for discrete latent variable models. In Advances in Neural Information Processing Systems 30, pages 2624 -- 2633. [Turney et al., 2010] Turney, P. D., Pantel, P., et al. (2010). From frequency to meaning: Vector space models of semantics. Journal of artificial intelligence research, 37(1):141 -- 188. [Upadhyay et al., 2017] Upadhyay, S., Chang, K.-W., Taddy, M., Kalai, A., and Zou, J. (2017). Beyond bilingual: Multi-sense word embeddings using multilin- gual context. In Proceedings of the 2nd Workshop on Representation Learning for NLP, pages 101 -- 110. Association for Computational Linguistics. [van der Maaten and Hinton, 2008] van der Maaten, L. and Hinton, G. (2008). Journal of Machine Learning Research, Visualizing data using t-SNE. 9(Nov):2579 -- 2605. 100 [van der Maaten and Hinton, 2012] van der Maaten, L. and Hinton, G. (2012). Vi- sualizing non-metric similarities in multiple maps. Machine learning, 87(1):33 -- 55. [Wan et al., 2013] Wan, L., Zeiler, M., Zhang, S., Cun, Y. L., and Fergus, R. (2013). Regularization of neural networks using dropconnect. In Proceedings of the 30th international conference on machine learning (ICML-13), pages 1058 -- 1066. [Wang et al., 2014] Wang, J., Shen, H. T., Song, J., and Ji, J. (2014). Hashing for similarity search: A survey. arXiv preprint arXiv:1408.2927. [Wang et al., 2013] Wang, Q., Zhang, D., and Si, L. (2013). Semantic hashing using tags and topic modeling. In Proceedings of the 36th international ACM SIGIR conference on Research and development in information retrieval, pages 213 -- 222. Association for Computing Machinery. [Welling et al., 2004] Welling, M., Rosen-Zvi, M., and Hinton, G. E. (2004). Ex- ponential family harmoniums with an application to information retrieval. In Advances in neural information processing systems, pages 1481 -- 1488. [Werbos, 1990] Werbos, P. J. (1990). Backpropagation through time: what it does and how to do it. Proceedings of the IEEE, 78(10):1550 -- 1560. [Weston et al., 2015] Weston, J., Bordes, A., Chopra, S., Rush, A. M., van Mer- riënboer, B., Joulin, A., and Mikolov, T. (2015). Towards AI-complete question answering: A set of prerequisite toy tasks. arXiv preprint arXiv:1502.05698. [Wu et al., 2017] Wu, L., Fisch, A., Chopra, S., Adams, K., Bordes, A., and arXiv preprint Starspace: Embed all the things! Weston, J. (2017). arXiv:1709.03856. [Xun et al., 2017] Xun, G., Li, Y., Gao, J., and Zhang, A. (2017). Collaboratively improving topic discovery and word embeddings by coordinating global and local contexts. In Proceedings of the 23rd ACM SIGKDD International Confer- ence on Knowledge Discovery and Data Mining, pages 535 -- 543. Association for Computing Machinery. [Yarowsky, 1995] Yarowsky, D. (1995). Unsupervised word sense disambiguation rivaling supervised methods. In Proceedings of the 33rd annual meeting on As- sociation for Computational Linguistics, pages 189 -- 196. Association for Com- putational Linguistics. [Yu et al., 2014] Yu, D., Eversole, A., Seltzer, M., Yao, K., Huang, Z., Guenter, B., Kuchaiev, O., Zhang, Y., Seide, F., Wang, H., et al. (2014). An introduction to computational networks and the computational network toolkit. Technical report, Microsoft Research. [Yuan et al., 2016] Yuan, D., Doherty, R., Richardson, J., Evans, C., and Al- tendorf, E. (2016). Word sense disambiguation with neural language models. arXiv preprint arXiv:1603.07012. 101 [Zeiler, 2012] Zeiler, M. D. (2012). ADADELTA: an adaptive learning rate method. arXiv preprint arXiv:1212.5701. [Zhu et al., 2015] Zhu, X., Sobhani, P., and Guo, H. (2015). Long short-term In Proceedings of the 32nd International memory over recursive structures. Conference on Machine Learning, pages 1604 -- 1612. 102
1711.00294
1
1711
2017-11-01T11:29:27
Towards Automatic Generation of Entertaining Dialogues in Chinese Crosstalks
[ "cs.CL" ]
Crosstalk, also known by its Chinese name xiangsheng, is a traditional Chinese comedic performing art featuring jokes and funny dialogues, and one of China's most popular cultural elements. It is typically in the form of a dialogue between two performers for the purpose of bringing laughter to the audience, with one person acting as the leading comedian and the other as the supporting role. Though general dialogue generation has been widely explored in previous studies, it is unknown whether such entertaining dialogues can be automatically generated or not. In this paper, we for the first time investigate the possibility of automatic generation of entertaining dialogues in Chinese crosstalks. Given the utterance of the leading comedian in each dialogue, our task aims to generate the replying utterance of the supporting role. We propose a humor-enhanced translation model to address this task and human evaluation results demonstrate the efficacy of our proposed model. The feasibility of automatic entertaining dialogue generation is also verified.
cs.CL
cs
Towards Automatic Generation of Entertaining Dialogues in Chinese Crosstalks Institute of Computer Science and Technology, The MOE Key Laboratory of Computational Linguistics Shikang Du, Xiaojun Wan, Yajie Ye Peking University, Beijing 100871, China {dusk, wanxiaojun, yeyajie}@pku.edu.cn 7 1 0 2 v o N 1 ] L C . s c [ 1 v 4 9 2 0 0 . 1 1 7 1 : v i X r a Abstract Crosstalk, also known by its Chinese name xiangsheng, is a traditional Chinese comedic performing art featuring jokes and funny dialogues, and one of China's most popular cul- tural elements. It is typically in the form of a dialogue be- tween two performers for the purpose of bringing laughter to the audience, with one person acting as the leading comedian and the other as the supporting role. Though general dialogue generation has been widely explored in previous studies, it is unknown whether such entertaining dialogues can be au- tomatically generated or not. In this paper, we for the first time investigate the possibility of automatic generation of en- tertaining dialogues in Chinese crosstalks. Given the utter- ance of the leading comedian in each dialogue, our task aims to generate the replying utterance of the supporting role. We propose a humor-enhanced translation model to address this task and human evaluation results demonstrate the efficacy of our proposed model. The feasibility of automatic entertaining dialogue generation is also verified. Introduction by known its Chinese name 相 Crosstalk, also 声/xiangsheng, is a traditional Chinese comedic per- forming art, and one of China's most popular cultural elements. It is typically in the form of a dialogue between two performers, but much less often can also be a mono- logue by a solo performer, or even less frequently, a group act by multiple performers. The crosstalk language, rich in puns and allusions, is delivered in a rapid, bantering style. The purpose of Xiangsheng is to bring laughter to the audience, and the crosstalk language features humor- ous dialogues (Link 1979; Moser 1990; Terence 2013; Mackerras 2013). The language style of crosstalk is just like chatting or gos- sip, but is more funny and humorous, especially in crosstalks given by two performers. It would be an ideal resource for studying humor in dialogue system. However, there are some special rules in crosstalks. For the crosstalk between two performers, one person acts as the leading comedian (or 逗哏/dougen in Chinese) and the other as the supporting role (or 捧哏/penggen). The two perform- ers usually stand before an audience and deliver their lines in rapid fire by turn. They echo each other in the crosstalk performance. In each turn, the leading role usually tells sto- ries and jokes, or does some sound imitation in his utterance, and the supporting role points out the humorous point in the leading role's performance, or even adds fuel to the leading role's performance, making it funnier. For example, A: 楚国大夫屈原,五月初五死的,我们 应该永远怀念屈原。要是没有屈原, 我们怎么能有这三天假期呢? The mid-autumn festival is in memory of Qu Yuan. We should keep him in mind forever, because his death brings us this 3-day holiday. B: 这个,代价大点儿。 It costs him a lot (to have a holiday). A: 我觉得应该再多放几天假。 I think it would be better with more holidays. B: 那得死多少人啊。 How many people would die then! In this example, B acts as the supporting role. His last response unexpectedly links the number of holiday with the number of people died, which makes the whole dialogue more funny. But in many cases, the supporting one acts as a go-between, gives positive response (such as "当 然/Of course" or "这样/That's why") or negative response (such as "啊?/Ah?"), and sometimes repeats key points in the leading role's utterance, making the narration given by the leading role go smoothly (e.g. A: 虽然道路崎岖,所幸 还有蒙蒙月色/ Although the road is rough, the moonlight is bright. B:还 能 看 见 点/ We can still see things on the road.) In brief, the crosstalk between two performers can be considered a special and challenging dialogue form - the entertaining dialogue. Though general dialogue generation has been widely ex- plored and achieved great success in previous studies (Li et al. 2016; Sordoni et al. 2015; Ritter, Cherry, and Dolan 2011), it is unknown whether such entertaining dialogues can be automatically generated or not. If computers can gen- erate entertaining dialogues well, the AI ability of computer will be further validated. The function of generating en- tertaining dialogues is also very useful in many interactive products, making them more appealing. In this study, we for the first time investigate the possibility of automatic gener- ation of entertaining dialogues in Chinese crosstalks. Given the utterance of the leading comedian in each dialogue, our task aims to generate the replying words of the supporting role. lows: We propose a humor-enhanced translation model to ad- dress this special and challenging task, and the model ex- plicitly leverages a sub-model to measure the humorous characteristic of a dialogue. Human evaluation results on a real Chinese crosstalk dataset demonstrate the efficacy of our proposed model, which can outperform several retrieval based and generation based baselines. The feasibility of au- tomatic entertaining dialogue generation is also verified. The contributions of this paper are summarized as fol- 1) We are the first to investigate the new task of entertain- ing dialogue generation in Chinese crosstalks. 2) We propose a humor-enhanced translation model to ad- dress this challenging task by making use of a sub-model to measure the humorous characteristic of a dialogue. 3) Manual evaluation is performed to verify the efficacy of our proposed model and the feasibility of automatic en- tertaining dialogue generation. In the rest of this paper, we will first describe the details of our proposed model and then present and discuss the evalua- tion results. After that, we introduce the related work. Lastly, we conclude this paper. ignoring the entertaining characteristic of crosstalk. In ma- chine translation, beam search is used in decoding process, which could generate multiple candidates with scores. Usu- ally only the candidate with the highest score could be ac- cepted. These scores reflects the similarity of the candidate and reference. However, just like that some question may have many different answers, there might still be acceptable, or even unexpected but wonderful candidates with lower scores. It's a pity to get these good response ignored just because they shares little similarity with the references in a limited training dataset. To exploit them, and also to ad- dress the crosstalk generation problem, we propose a humor- enhanced machine translation model to generate response utterance in crosstalk. Our proposed model leverages a sub- model to explicitly model the degree of humor of a dialogue, and integrate it with other sub-models, as illustrated in Fig- ure 1. Our Generation Method Given an utterance s of the leading role (i.e. dougen) in Chi- nese crosstalks, our task aims to generate the replying utter- ance r of the supporting role (i.e. penggen), which is called crosstalk response generation (CRG). The generated utter- ance needs to be fluent and related to the leading role's ut- terance. Moreover, it is also expected that the generated ut- terance can make the dialogue more funny and entertaining. As mentioned earlier, our task is a special form of dia- logue generation. In recent years, there are many methods proposed for dialogue generation based on a large set of training data, including the deep learning methods (espe- cially sequence-to-sequence models) (Li et al. 2016). How- ever, deep learning methods usually require a large train- ing set to achieve good performance in dialogue generation tasks, which is hard to obtain for our task. So, we choose a more traditional but effective way based on machine transla- tion to address the new task of crosstalk response generation. penggen often gives comments on dougen's utterance, sometimes penggen even retells the dougen's words but in a more humorous way. We believe that the dougen's response has some potential patterns according to the utterance given by penggen, and treat response generation as a monolin- gual translation problem, in which the given input (utterance given by dougen) is treated as the foreign language and the humorous response as the source language. Machine trans- lation (MT) has already been successfully used in response generation (Ritter, Cherry, and Dolan 2011), in which input post was seen as a sequence of words, and word or phrase based translation was made to generate another sequence of words as response. If we simply treat crosstalk response gen- eration as a general dialogue generation problem, we can apply statistical machine translation (SMT) model (Koehn, Och, and Marcu 2003) to generate responses accordingly, Figure 1: General architecture of our system Response Generation Model We get pairs of aligned utterance and response from the dia- logue fragments in Chinese crosstalks, which are considered monolingual parallel data. The two performers echo each other in a crosstalk, and their roles keep consistent in the whole crosstalk, and the leading role and the supporting role of each utterance can be easily identified. Then we segment the utterances into words. Each pair consists of a sequence of words s({s1, s2, ..., sl}) spoken by the leading role, and a sequence of words ref replied by the supporting role, while the response we generated is denoted as r({r1, r2, ..., rl}). Given the leading role's utterance s, we aim to generate the best response utterance r by using our proposed gener- ation model. The proposed generation model has three sub- models(M1, M2, M3): translation model, language model and humor model. We will introduce each sub-model and then introduce the framework of model combination. Translation Model (M1) The translation model translates the given leading role's utterance s into a sequence of words r, which is treated as the response. Let (si, ri) be a pair of translation units, we can compute the word translation prob- ability distribution φtm(si, ri) , which is defined in (Koehn, Och, and Marcu 2003). Each word si in input utterance is Xiang-shengCorpusWeiboCorpusInputOutputAnotated Xiang-shengTranslation Model (M1)Language Model (M2)CRG modelHumor Model (M3) l(cid:89) i=1 (cid:89) translated to a word in response ri, and the word in response would be reordered. Reordering of generated response is modeled by a rela- tive distortion probability distribution d(ai − bi−1), where ai is the starting position of the word in the input utterance s translated to the i-th word in generated response r, and bi−1 denotes the end position of the word in the input utterance translated into the (i − 1)-th word in the response. We use d = αx−1 as implementation. Thus, the translation score between the leading role's ut- terance s and generated response r is: ptm (r, s) = φtm(si, ri)d(ai − bi−1) (1) Language Model (M2) We use a 4-gram language model in this work. The language model based score is computed as: plm(r) = p(rjrj−3rj−2rj−1) (2) j where rj is the j-th element of r. Humor Model (M3) We want to build a model to measure the degree of humor of a dialogue. However, humor is very complex. In Chinese crosstalks, humor can be expressed by the actors' tone, body language and verbal language. In this study, we mainly focus on modeling the verbally expressed humor in crosstalks. We build a classifier to determine the probability of be- ing humorous for each response candidate in the context of the input utterance. In this model, we evaluate humor in 4 dimensions, just as the same as (Yang et al. 2015) : (a) In- congruity, (b) Ambiguity, (c) Interpersonal Effect, and (d) Phonetic Style. Incongruity structure plays an important role in verbal hu- mor, as stated in (Lefcourt 2001) and (Paulos 2008). Al- though it is hard to determine incongruity, it is relatively easier to calculate the semantic disconnection in a sentence. We use Word2vec to derive the word embeddings and then compute the distances between word vectors. When a listener expects one meaning, but is forced to use another meaning (Yang et al. 2015), there is ambiguity. This distraction often makes people laugh. To measure the am- biguity in the sentence, we collect a number of antonyms and synonyms for feature extraction. Note that antonyms are used as as an important feature in humor detection in (Mihalcea and Strapparava 2005). Using Chinese WordNet (Huang and Hsieh 2010), we get the pairs of antonyms and synonyms. Interpersonal effect is associated with sentimental effect (Zhang and Liu 2014). A word with sentimental polarity re- flects the emotion expressed by the writer. We use a dictio- nary in (Xu et al. 2008) to compute the sentimental polarity of each word, and add them up as the overall sentimental polarity of a sentence. Many humorous texts play with sounds, creating incon- gruous sounds or words. Homophonic words have more po- tential to be phonetically funny. We count the number of ho- mophonic words and words with the same rhyme, with the help of pypinyin1 . Furthermore, adult slang is described in (Mihalcea and Strapparava 2005) as a key feature to recognize jokes, so we count the number of slangs. Note that we extract features from the response alone and also extract features from the whole turn of dialogue con- sisting of both the given input utterance and the response. To summarize, the features we use are listed below: • minimum and maximum distances of each pair of word vectors in the response; • minimum and maximum distances of each pair of word vectors in the whole turn of dialogue (including the given input utterance and the response); • number of pairs of antonyms in the response; • number of pairs of antonyms in the whole turn of dia- • number of pairs of synonyms in the response; • number of pairs of synonyms in the whole turn of dia- • sentimental polarity in the response; • sentimental polarity in the whole turn of dialogue; • number of homophonic words in the response; • number of homophonic words in the whole turn of dia- logue; logue; logue; • number of the words with same rhyme in the response; • number of the words with same rhyme in the whole turn of dialogue; • number of slangs in the response. We choose the random forest classifier (Liaw and Wiener 2002) because it generally outperforms other classifiers based on our empirical analysis. The output probability for r is used as the humor model score phm(r). Model Combination We use a log-linear framework to combine the above three sub-models and get our response generation model. Note that the translation model corre- sponds to two parts. p(rs) = λtm (cid:88) (cid:88) (cid:88) i i + λds + λlm log φtm(si, ri) log d(ai − bi−1) log p(rjrj−3rj−2rj−1) (3) j + λhm log phm(r) where λtm, λds, λlmand λhm are weight parameters of the sub-models and can be learned automatically. 1http://pypi.python.org/pypi/pypinyin Learning and Decoding In the model M1, we use relative frequency to estimate the word translation probability distribution φtm(si, ri), and no smoothing is performed. (cid:80) count(s, r) s(s, r) φtm(s, r) = (4) A special token NULL is added to each utterance and aligned to each unaligned foreign word. The training process is similar to that in (Ritter, Cherry, and Dolan 2011). We use the widely used toolkit Moses (Koehn et al. 2007) to train the translation model. The scikit-learn toolkit2 is used and the probability of prediction is acquired through the API function of predict proba. In order to estimate weight parameters in the combined model, we apply the minimum error rate training (MERT) algorithm (Och 2003), which has been broadly used in SMT. The most common optimization objective function is BLEU-4 (Papineni et al. 2002), which requires human ref- erences. We take the original human response derived from our parallel corpus as the single reference. We use the tool Z-MERT (Zaidan 2009) for estimation. The weight param- eter values that lead to the highest BLEU-4 scores on the development set are finally selected. In the decoding process, we use the beam search algo- rithm to generate the top-100 best response candidates for each input utterance based on M1 and M2. Then we obtain the score of M3 of each candidate, rank the candidates ac- cording to the combined model and select the best candidate as output. Final Reranking with the Humor Model Note that the above combined model is optimized for the BLEU-4 score, but the BLEU-4 score cannot well reflect the humorous aspect of generated responses, so in order to im- prove the humor level of a dialogue, we further select the top-five best response candidates generated by the above combined model and rerank them according to the score of the humor model (M3), and finally use the top-ranked one as the output. Note that We use only top five candidates in this step because it is more efficient and effective to rerank a small number of high-quality candidates, while the readabil- ity and relevance of other candidates with low ranks cannot be guaranteed. The number of five is determined based on the development set. Experiment Setup Experiment Data We collect the crosstalk data from multiple sources: (a) pub- lished books3; (b) websites4 , where Chinese crosstalk fans 2http://scikit-learn.org/stable/index.html 3(1)Liu Yingnan. A Complete Collection of China Tradi- tional Cross Talks 5 Vols., Culture and Art Publishing House, 2010. (2)Wang Wenzhang. Famous Crosstalk Actor's Masterpiece Series, Culture and Art Publishing House, 2004. et,al. 4(1) http://www.xiangsheng.org; (2) http://www.tquyi. com; et, al. collect and collate existing famous crosstalk masterpieces. (c) records of crosstalk play. The dataset we collect consists of over 173, 000 pairs of utterances, from 1, 551 famous ex- cerpts of crosstalks. Since long sentences would slow down our training process, we filtered out responses longer than 60 words. In order to improve qualty, we also filtered out very short responses that are usually 1 modal particles. Over 150, 000 utterances was used in our dataset after this pro- cess. We divide the pairs of utterances and responses in the dataset into three parts, and we randomly select 2000 pairs as the test set, 4000 pairs as the development set for weight pa- rameter estimation, and the rest as the training set for trans- lation model. Since training language model requires a large-scale dataset, which could hardly be offered in the domain of crosstalks, we add Chinese microblog messages from Sina Weibo5 to enlarge the corpus for language model training. The language styles in Weibo and Chinese crosstalks are quite similar in that the sentences in Weibo messages and crosstalks are usually short and informal. We collect 6 mil- lion pieces of Weibo messages and comments from Sina Weibo. Not all utterances in Chinese crosstalks are humorous, because there are many utterances serving as go-betweens, so we have to manually build the training data for humor model learning. Because of the lack of Chinese humorous- ness dataset, we randomly collect 6000 pairs of utterances in Chinese crosstalks, and manually label them into two classes: humorous or not humorous. 348 pairs are marked as humorous, and we replicate the minor class instances and remove some major class instances to make the class distri- bution more balanced. Then we use the labeled data for training the random for- est classifier in the humor model. Comparison Methods We implement retrieval based methods for comparison: • SEQ2SEQ: Treat this problem as translation problem with SEQ2SEQ model with attention. GRU cells are used in RNN, and number of cells are 256. • IR-UR: Retrieve the response which is most similar to the input utterance from both the development set and the training set. • IR-UU: Retrieve the most similar utterance to the input utterance, and then return the response associated with the retrieved utterance; • IR-CXT: Retrieve the response which is most similar to the input utterance and three previous utterances of the input utterance; Similarity was calculated by comparing word-level cosine similarity. Our proposed method consists of all the three sub-models (including the final selection step), named as SMT-H. We 5http://weibo.com further compare our method with the basic machine transla- tion method considering two sub-models M1, M2, named as SMT. Note that in our method, the humor model is used in both the combined model and the final reranking process. Evaluation Metrics We adopt human evaluation to verify the effectiveness of our system. We also report automatic evaluation results with BLEU (Papineni et al. 2002). But in the dataset only one ref- erence response is provided for each given utterance, and the humor aspect cannot be well captured by the BLEU metrics. So we rely both on automatic and human evaluation results for this special task. We employ two human judges to rate each generated re- sponse in three aspects: Readability: It reflects the grammar correctness and flu- Entertainment: It reflects the level of humor of the re- ency; sponse; Relevance: It reflects the semantic relevance between the input utterance and the response generated. It also reflects logic and sentimental consistency. Each judge is asked to assign an integer score in the range of 0 ∼ 2 to each generated response with respect to each aspect. The score 0 means "poor" or "not at all", 2 means "good" or "very well", and 1 means "partially good" or "ac- ceptable". For example, In readability, 1 means that there are some grammar mistakes but human evaluator can still understand the meaning of the response. To help human raters to determine whether the generated response is relevant to the input utterance, we also provide previous two rounds of dialogues of the input utterance to the raters. Result and Analysis Automatic Evaluation Results As shown in 1, we found the BLEU score of our SMT-H is higher than baselines in the 2000 utterances test set, which can be simply explained since more global features could be accessed in our SMT-H model. t-test results on BLEU scores of the two model show that their difference is signifi- cant (p < 1 × 10−5). SMT-H SMT SEQ2SEQ IR-UU IR-UR IR-CXT RND BLEU-4 BLEU-3 BLEU-2 BLEU-1 16.62 15.13 16.03 2.6 4.4 3.14 0.00 22.41 20.62 20.63 5.52 6.83 6.34 1.65 18.99 17.39 17.76 3.51 5.15 4.17 0.00 29.57 27.39 27.66 12.53 13.13 13.76 9.73 Table 1: Automatic Evaluation Result of SMT, SMT-H and SEQ2SEQ As expected, the SEQ2SEQ model could get better scores in our automatic test than ordinary SMT model, but not bet- ter than our SMT-H model. A larger training set might help improve performance of the deep learning based model. BLEU scores of all IR based models are lower than 5% One possible reason is that the crosstalk dataset is not very large, and the utterances in the dataset are very diversified, so it is hard for retrieval based methods to find proper responses from the dataset directly. While generation based methods are more flexible and they can generate new responses for in- put utterances. For the retrieval based methods, IR-UR per- forms better than IR-UU, which is contrary to our intuition. This phenomenon has been discussed in (Ritter, Cherry, and Dolan 2011). Human Evaluation Results We randomly selected 150 input utterances in the test set and asked two raters to label the responses generated by retrieval based methods and machine translation based methods. The percentage of each rating level is calculated for each method with respect to each aspect, as shown in Figure 2. Since retrieval based methods extract existing utterances directly from the dataset, the readability of the retrieved responses is usually very good and thus we do not need to label the readability of these responses. We further compute the rela- tive ratio of the average rating score of each method to the average rating score of the basic SMT model with respect to each aspect, as shown in Table 2, and a ratio score larger than 100% means the corresponding method performs bet- ter than the basic SMT model, while a ratio score lower than 100% means the corresponding method performs worse than the basic SMT model. As can be seen from the human evaluation results, the responses generated by machine translation based methods are much more entertaining and relevant than retrieval based methods. We also find that that IR-UR returns more rele- vant responses than IR-UU. It also reveal that the translation model could generate more entertaining but less fluent re- sponse than SEQ2SEQ model. It could be explained that the responses generated by SEQ2SEQ model are too ordinary to get people feel amused. Comparing SMT with SMT-H, we can see that SMT-H re- ceives higher rating scores than SMT with respect to fluency and entertainment. The comparison results demonstrate that the use of the humor model can indeed make the gener- ated responses more entertaining, which is very important for Chinese crosstalks. An auxiliary effect by using the hu- mor model is to improve the readability of the generated re- sponses. Now we show two examples of input utterances and dif- ferent responses generated by IR-UU, SMT and SMT-H as follows: (a) Readability scores (b) Entertainment scores (c) Relevance scores Figure 2: Percentages of human evaluation scores Readability Entertainment Relevance SMT-H SMT SEQ2SEQ 100.00% 100.41% 110.74% 100.00% 120.59% 69.12% 100.00% 98.42% 99.74% IR-CXT IR-UU - - 4.47% 13.41% 28.69% 58.97% 39.84% IR-UR - 8.94% Table 2: Relative ratios of average rating scores of each method to that of SMT 躲?我把扁担一横,立托千斤 闸,迎着他的铁棍--咔!/Hide? I bravely used my shoulder pole to meet against his iron bar... Crack! 铁棍飞。/His iron bar dropped? 扁担折了。/No, my shoulder pole was fractured. 搁在一块儿说个绕嘴的折了拿 什么打?/Put them together and tell me a tongue twister, what else could be used to meet against his weapon? 好- 折啦? /What? It was fractured? A: (context) B: A(input): B(SMT): B(SMT-H): B(IR-UU): B(SEQ2SEQ): 这回该二朝的关系? / (Broken sentences) 都知道。 /We all know that. B(context): A(input): B(SMT): 老乡们/ My Fellow villagers 猪尾巴/ The pork tail 噢!才生下来的?你? /Were just born? You? Are you kidding me? B(SMT-H): 注意吧/ Pay attention B(SEQ2SEQ): 注意吧/ Pay attention B(IR-UU): In the first example, the response generated by SMT-H is more related to the input utterance. In the second example, the Chinese phrase 猪尾巴/"pork tail" has the same pronun- ciation with 注意吧/"pay attention" in the response gener- 嗬/ Ho ated by SMT-H. It is laughable since the supporting role (B) distorts A's utterance's meaning with a skill of homophonic, while the responses generated by SMT and IR-UU are totally irrelevant. Discussion Our method works well with short input. It can generate ap- propriate responses which act as go-between in narration. For example, A: 你爸爸穿衣裳也讲究。/ Your father is dainty about his dress. B(SMT-H): 怎么讲究?/ Dainty? How ? Some responses generated by our method are entertain- ing. For example, A: 龙生龙, 凤生凤, 老鼠的儿子会打洞/Dragon born dragon, chicken born chicken, mouse's son could only make hole. (You are just like a mouse.) B(SMT-H): 你不是后继无鼠了吗这代, 您这套我都 会了。/ You even don't have a mouse-like successor! I've found out your strategy. With the use of the humor model in the combined model and the use of it in the final reranking process, our method can generate better response. For example, A: 比如说我是天上的一颗星星。/ For example, I am a star in the heaven. B(SMT-H): 噢这是不是。/ Oh, is it this one? B(SMT): 是噢是你。/ Well, it's you. B(SEQ2SEQ): 可不对。/ That's right. However, there are still several shortcomings for our method: 1) Some generated responses are not fluent and the read- ability is not good. Some responses are broken sentences. For example, A: 好,新春进步!/Well, hope you make progress in new spring. SMT-HSMTSEQ2SEQReadability Score020406080100Percentage012SMT-HSMTSEQ2SEQIR-UUIR-URIR-CXTEntertainment Score5060708090100Percentage012SMT-HSMTSEQ2SEQIR-UUIR-URIR-CXTRelevance Score020406080100Percentage012 B(SMT-H): 不春进步了。/Not spring progress. The reason may be that the current crosstalk corpus is not adequate for training a high-quality language model, but un- fortunately it is hard to obtain a large crosstalk corpus be- cause fewer and fewer people still work on this performing art and create new crosstalks. 2) In some cases, our method will only give the input words back without translation and rewriting (e.g. 八匹马 呀/Ah, there are eight horses). This may be caused by the data sparsity problem in the dataset. If the words or expres- sions do not or seldom appear in the training corpus, our method cannot find any "translations" to them and can only return them back directly. Related Work The most closely related work is dialogue generation Pre- vious work in this field relies on rule-based methods, from learning generation rules from a set of authored labels or rules (Oh and Rudnicky 2000; Banchs and Li 2012) to build- ing statistical models based on templates or heuristic rules (Levin, Pieraccini, and Eckert 2000; Pieraccini et al. 2009). li-EtAl:2017:EMNLP20175 After the explosive growth of social networks, the large amount of conversation data en- ables the data-driven approach to generate dialogue. Re- search on statistical dialogue systems fall into two cate- gories: 1) information retrieval (IR) based methods (Ji, Lu, and Li 2014), 2) the statistical machine translation (SMT) based methods (Ritter, Cherry, and Dolan 2011). IR based methods aim to pick up suitable responses by ranking can- didate responses. But there is an obvious drawback for these methods that the responses are selected from a fixed re- sponse set and it is not possible to produce new responses for special inputs. SMT based methods treat response gen- eration as a SMT problem on post-response parallel data. These methods are purely data-driven and can generate new responses. More recently, neural network based methods are being applied in this field (Serban et al. 2015; Yao, Zweig, and Peng 2015; Li et al. 2016). In particular, SEQ2SEQ model and reinforcement learning are used to improve the quality of generated responses (Li et al. 2016). Adversarial learn- ing are also applied in this field in recent years (Li et al. 2017). (Serban et al. 2017) introduced stochastic latent vari- able into RNN model into the response generation problem. Neural network based methods are promising for dialogue generation. However, as mentioned in section 2, training a neural network model requires a large corpus. Sometimes it is hard to obtain a large corpus in a specific domain, which limits their performance. Another kind of related work is computational humor. Hu- mor recognition or computation in natural language is still a challenging task. Although understanding universal humor characteristics is almost impossible, there are many attempts to capture latent structure behind humor. Taylor (2009) used ontological semantics to detect humor. Yang (2015) identi- fied several semantic structures behind humor and employed a computational approach to recognizing humor. Other stud- ies also investigate humor with spoken or multimodal sig- nals (Purandare and Litman 2006). But none of these works provide a systematical explanation of humor, not to mention recognizing humor in Chinese crosstalks. Moreover, there are several studies attempting to gener- ate puns and jokes. For example, The JAPE system was de- veloped to automatically generate punning riddles (Binsted and Ritchie 1994; Binsted and Ritchie 1997), and it relies on a template-based NLG system, combining fixed text with slots. Following the seminal work of Binsted and Ritchie, the HAHAcronym system was developed to produce humor- ous acronyms (Stock and Strapparava 2005) and the subse- quent system of (Binsted, Bergen, and McKay 2003) focuses on the generation of referential jokes. More recently, an in- teresting unsupervised alternative to this earlier work was offered (Petrovic and Matthews 2013), and it does not re- quire labeled examples or hard-coded rules. It starts from a template involving three slots and then finds funny triples. However, the task of entertaining dialogue generation has not been investigated. Conclusions and Future Work In this paper, we investigate the possibility of automatic gen- eration of entertaining dialogues in Chinese crosstalks. We proposed a humor-enhanced translation model to generate the replying utterance of the supporting role, given the ut- terance of the leading comedian in Chinese crosstalks. Eval- uation results on a real Chinese crosstalk dataset verify the efficacy of our proposed model, especially the usefulness of the humor model. In future work, we will try to enlarge the dataset by ex- ploiting dialogue data in other similar domains, aiming at further improving the performance. We will also investigate generating the utterance of the leading role in the crosstalks, given the context utterances in several previous turns of dia- logues. References [Banchs and Li 2012] Banchs, R. E., and Li, H. 2012. Iris: a chat-oriented dialogue system based on the vector space model. In ACL, 37–42. ACL. [Binsted and Ritchie 1994] Binsted, K., and Ritchie, G. 1994. An implemented model of punning riddles. Techni- cal report, University of Edinburgh, Department of Artificial Intelligence. [Binsted and Ritchie 1997] Binsted, K., and Ritchie, G. 1997. Computational rules for generating punning rid- dles. HUMOR-International Journal of Humor Research 10(1):25–76. [Binsted, Bergen, and McKay 2003] Binsted, K.; Bergen, B.; and McKay, J. 2003. Pun and non-pun humour in second-language learning. In Workshop Proceedings, CHI. [Huang and Hsieh 2010] Huang, C.-R., and Hsieh, S.- K. Infrastructure for cross-lingual knowledge representation-towards multilingualism in linguistic studies. Taiwan NSC-granteLDBd Research Project (NSC 96-2411- H-003-061-MY3). 2010. [Pieraccini et al. 2009] Pieraccini, R.; Suendermann, D.; Dayanidhi, K.; and Liscombe, J. 2009. Are we there yet? re- search in commercial spoken dialog systems. In TSD, 3–13. Springer. [Purandare and Litman 2006] Purandare, A., and Litman, D. 2006. Humor: Prosody analysis and automatic recognition for f*r*i*e*n*d*s. In EMNLP, 208–215. ACL. [Ritter, Cherry, and Dolan 2011] Ritter, A.; Cherry, C.; and Dolan, W. B. 2011. Data-driven response generation in so- cial media. In EMNLP, 583–593. ACL. [Serban et al. 2015] Serban, I. V.; Sordoni, A.; Bengio, Y.; Courville, A.; and Pineau, J. 2015. Building end-to-end dia- logue systems using generative hierarchical neural network models. arXiv preprint arXiv:1507.04808. [Serban et al. 2017] Serban, I. V.; Sordoni, A.; Lowe, R.; Charlin, L.; Pineau, J.; Courville, A. C.; and Bengio, Y. 2017. A hierarchical latent variable encoder-decoder model for generating dialogues. In AAAI, 3295–3301. [Sordoni et al. 2015] Sordoni, A.; Galley, M.; Auli, M.; Brockett, C.; Ji, Y.; Mitchell, M.; Nie, J.-Y.; Gao, J.; and Dolan, B. 2015. A neural network approach to context- sensitive generation of conversational responses. In NAACL HLT. [Stock and Strapparava 2005] Stock, O., and Strapparava, C. 2005. The act of creating humorous acronyms. Applied Artificial Intelligence 19(2):137–151. [Taylor 2009] Taylor, J. M. 2009. Computational detection of humor: A dream or a nightmare? the ontological seman- tics approach. In WI-IAT, 429–432. IEEE Computer Society. [Terence 2013] Terence, H. 2013. China's comedy show- down. The World of Chinese 3(2):48–51. [Xu et al. 2008] Xu, H.; Lin, H.; Pan, Y.; Hui, R.; and Chen, j. 2008. Constructing the affective lexicon ontology. Journal of the China Society for Scientific and Technical Information 27(2):180–185. [Yang et al. 2015] Yang, D.; Lavie, A.; Dyer, C.; and Hovy, E. H. 2015. Humor recognition and humor anchor extrac- tion. In EMNLP, 2367–2376. ACL. [Yao, Zweig, and Peng 2015] Yao, K.; Zweig, G.; and Peng, B. 2015. Attention with intention for a neural network con- versation model. arXiv preprint arXiv:1510.08565. [Zaidan 2009] Zaidan, O. 2009. Z-mert: A fully configurable open source tool for minimum error rate training of machine translation systems. The Prague Bulletin of Mathematical Linguistics 91:79–88. [Zhang and Liu 2014] Zhang, R., and Liu, N. 2014. Recog- nizing humor on twitter. In CIKM, 889–898. ACM. [Ji, Lu, and Li 2014] Ji, Z.; Lu, Z.; and Li, H. 2014. An infor- mation retrieval approach to short text conversation. arXiv preprint arXiv:1408.6988. [Koehn et al. 2007] Koehn, P.; Hoang, H.; Birch, A.; Callison-Burch, C.; Federico, M.; Bertoldi, N.; Cowan, B.; Shen, W.; Moran, C.; Zens, R.; et al. 2007. Moses: Open In ACL, source toolkit for statistical machine translation. 177–180. ACL. [Koehn, Och, and Marcu 2003] Koehn, P.; Och, F. J.; and Marcu, D. 2003. Statistical phrase-based translation. In NAACL HLT, 48–54. ACL. [Lefcourt 2001] Lefcourt, H. M. 2001. Humor: The psy- chology of living buoyantly. Springer Science & Business Media. [Levin, Pieraccini, and Eckert 2000] Levin, E.; Pieraccini, R.; and Eckert, W. 2000. A stochastic model of human- IEEE machine interaction for learning dialog strategies. Transactions on speech and audio processing 8(1):11–23. [Li et al. 2016] Li, J.; Monroe, W.; Ritter, A.; Jurafsky, D.; Galley, M.; and Gao, J. 2016. Deep reinforcement learning for dialogue generation. In EMNLP. [Li et al. 2017] Li, J.; Monroe, W.; Shi, T.; Jean, S.; Ritter, A.; and Jurafsky, D. 2017. Adversarial learning for neural In Proceedings of the 2017 Confer- dialogue generation. ence on Empirical Methods in Natural Language Process- ing, 2147–2159. Copenhagen, Denmark: Association for Computational Linguistics. [Liaw and Wiener 2002] Liaw, A., and Wiener, M. 2002. Classification and regression by randomforest. R News 2(3):18–22. [Link 1979] Link, E. P. 1979. The genie and the lamp: Rev- olutionary Xiangsheng. publisher not identified. [Mackerras 2013] Mackerras, C. 2013. The performing arts in contemporary China, volume 18. Routledge. [Mihalcea and Strapparava 2005] Mihalcea, R., and Strappa- rava, C. 2005. Making computers laugh: Investigations in In HLT/EMNLP, 531–538. automatic humor recognition. ACL. [Moser 1990] Moser, D. 1990. Reflexivity in the humor of xiangsheng. CHINOPERL 15(1):45–68. [Och 2003] Och, F. J. 2003. Minimum error rate training in statistical machine translation. In ACL, ACL '03, 160–167. ACL. [Oh and Rudnicky 2000] Oh, A. H., and Rudnicky, A. I. 2000. Stochastic language generation for spoken dialogue systems. In ANLP/NAACL-ConvSyst, 27–32. ACL. [Papineni et al. 2002] Papineni, K.; Roukos, S.; Ward, T.; and Zhu, W.-J. 2002. Bleu: a method for automatic eval- uation of machine translation. In ACL, 311–318. ACL. [Paulos 2008] Paulos, J. A. 2008. Mathematics and humor: A study of the logic of humor. University of Chicago Press. [Petrovic and Matthews 2013] Petrovic, S., and Matthews, D. 2013. Unsupervised joke generation from big data. In ACL (2), 228–232. Citeseer.
1812.09355
1
1812
2018-12-21T19:51:47
What Is One Grain of Sand in the Desert? Analyzing Individual Neurons in Deep NLP Models
[ "cs.CL" ]
Despite the remarkable evolution of deep neural networks in natural language processing (NLP), their interpretability remains a challenge. Previous work largely focused on what these models learn at the representation level. We break this analysis down further and study individual dimensions (neurons) in the vector representation learned by end-to-end neural models in NLP tasks. We propose two methods: Linguistic Correlation Analysis, based on a supervised method to extract the most relevant neurons with respect to an extrinsic task, and Cross-model Correlation Analysis, an unsupervised method to extract salient neurons w.r.t. the model itself. We evaluate the effectiveness of our techniques by ablating the identified neurons and reevaluating the network's performance for two tasks: neural machine translation (NMT) and neural language modeling (NLM). We further present a comprehensive analysis of neurons with the aim to address the following questions: i) how localized or distributed are different linguistic properties in the models? ii) are certain neurons exclusive to some properties and not others? iii) is the information more or less distributed in NMT vs. NLM? and iv) how important are the neurons identified through the linguistic correlation method to the overall task? Our code is publicly available as part of the NeuroX toolkit (Dalvi et al. 2019).
cs.CL
cs
What Is One Grain of Sand in the Desert? Analyzing Individual Neurons in Deep NLP Models Fahim Dalvi,∗1 Nadir Durrani,∗1 Hassan Sajjad,∗1 Yonatan Belinkov,2 Anthony Bau,2 James Glass2 1Qatar Computing Research Institute, HBKU Research Complex, Doha 5825, Qatar 2MIT Computer Science and Artificial Intelligence Laboratory, Cambridge, MA 02139, USA {faimaduddin,ndurrani,hsajjad}@qf.org.qa {belinkov,abau,glass}@mit.edu 8 1 0 2 c e D 1 2 ] L C . s c [ 1 v 5 5 3 9 0 . 2 1 8 1 : v i X r a Abstract Despite the remarkable evolution of deep neural networks in natural language processing (NLP), their interpretability re- mains a challenge. Previous work largely focused on what these models learn at the representation level. We break this analysis down further and study individual dimensions (neu- rons) in the vector representation learned by end-to-end neu- ral models in NLP tasks. We propose two methods: Linguis- tic Correlation Analysis, based on a supervised method to extract the most relevant neurons with respect to an extrin- sic task, and Cross-model Correlation Analysis, an unsuper- vised method to extract salient neurons w.r.t. the model itself. We evaluate the effectiveness of our techniques by ablating the identified neurons and reevaluating the network's perfor- mance for two tasks: neural machine translation (NMT) and neural language modeling (NLM). We further present a com- prehensive analysis of neurons with the aim to address the following questions: i) how localized or distributed are dif- ferent linguistic properties in the models? ii) are certain neu- rons exclusive to some properties and not others? iii) is the information more or less distributed in NMT vs. NLM? and iv) how important are the neurons identified through the lin- guistic correlation method to the overall task? Our code is publicly available1 as part of the NeuroX toolkit (Dalvi et al. 2019a). Introduction While neural networks have achieved state-of-the-art perfor- mance in NLP and other spheres of Artificial Intelligence (AI), their opaqueness remains a cause of concern (Doshi- Velez and Kim 2017). Interpreting the behavior of neural networks is considered important for increasing trust in AI systems, providing additional information to decision mak- ers, and assisting ethical decision making (Lipton 2016). Recent work attempted to analyze what linguistic infor- mation is captured in such models when they are trained on a downstream task like neural machine translation (NMT). A typical framework is to generate vector representations for some linguistic unit and predict a property of interest such as morphological features. This approach has also been ap- plied for analyzing word and sentence embeddings (Qian, ∗Authors contributed equally Copyright c(cid:13) 2019, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. 1https://github.com/fdalvi/NeuroX Qiu, and Huang 2016b; Adi et al. 2016), and hidden states in NMT models (Shi, Padhi, and Knight 2016; Belinkov et al. 2017a). The analyses reveal that neural vector represen- tations often contain substantial amount of linguistic infor- mation. Most of this work, however, targets the whole vec- tor representation, neglecting the individual dimensions in the embeddings. In contrast, much work in computer vision investigates properties encoded in individual neurons or fil- ters (Zeiler and Fergus 2014; Zhou et al. 2016). We address this gap by studying individual dimensions (neurons) in the vector representations learned by end-to- end neural models. We aim to increase model transparency by identifying specific dimensions that are responsible for particular properties. We thus strive for post-hoc decom- posibility, in the sense of (Lipton 2016). That is, we ana- lyze models after they have been trained, in order to un- cover the importance of their individual parameters. This kind of analysis is important for improving understanding of the inner workings of neural networks. It also has potential applications in model distillation (e.g., by removing unim- portant neurons), neural architecture search (by guiding the search with important neurons), and mitigating model bias (by identifying neurons responsible for sensitive attributes like gender, race or politeness2). In this work we lay out a methodology for identifying and analyzing individual neu- rons, and open the call to explore such use cases to the re- search community. To this end, we propose two methods to facilitate neu- ron analysis. First, we perform an extrinsic correlation anal- ysis through supervised classification on a number of lin- guistic properties that are deemed important for the task (for example, learning word morphology lies at the heart of modeling various NLP problems). Our classifier extracts important individual (or groups of) neurons that capture cer- tain properties. We call this method Linguistic Correlation Analysis. Second, we propose an alternative methodology to search for neurons that share similar patterns in indepen- dently trained networks, based on the assumption that im- portant properties are captured in multiple networks by in- dividual neurons. We call this method Cross-model Corre- lation Analysis. Such an analysis is more intrinsic and help- 2E.g., controlling the system to generate outputs with the right honorifics ("Sie" vs. "du") in German. ful for highlighting important neurons for the model itself, and in the case when annotated data (supervision) may not be available. Both machine translation and language model- ing are fundamental AI tasks that have seen tremendous im- provements with neural networks in recent years. We evalu- ated our methods for analyzing neurons on these two tasks. We provide quantitative evidence that our rankings are correct by performing several ablation experiments: from masking out important neurons to removing them com- pletely from the training. We then conduct a comprehen- sive analysis of the ranked neurons. Our analysis reveals interesting findings such as i) open class categories such as verb (part-of-speech tag) and location (semantic entity) are much more distributed across the network compared to closed class categories such as coordinating conjunc- tion (e.g., "but/and") or a determiner (e.g., "the"), ii) the model recognizes a hierarchy of linguistic properties and distributes neurons based on it, and iii) important neurons extracted from the Cross-model Correlation method over- lap with those extracted from the Linguistic Correlation method; for example, both methods identified the same neu- rons capturing position as salient. In summary, we make the following contributions: • A general methodology for identifying linguistically- meaningful neurons in deep NLP models. • An unsupervised method for finding important neurons in neural networks, and a quantitative evaluation of the retrieved neurons. • Application to various test cases, investigating core lan- guage properties through part-of-speech (POS), morpho- logical, and semantic tagging. • An analysis of distributed vs. focused information in NMT and NLM models. Related Work Much of the previous work has looked into neural models from the perspective of what they learn about various lan- guage properties. This includes analyzing word and sentence embeddings (Adi et al. 2016; Qian, Qiu, and Huang 2016b; Conneau et al. 2018), recurrent neural network (RNN) states (Shi, Padhi, and Knight 2016; Wang, Chung, and Lee 2017), and NMT representations (Belinkov et al. 2017a; Belinkov et al. 2017b; Dalvi et al. 2017). The language prop- erties mainly analyzed are morphological (Qian, Qiu, and Huang 2016b; Vylomova et al. 2016), semantic (Qian, Qiu, and Huang 2016b) and syntactic (Shi, Padhi, and Knight 2016; Linzen, Dupoux, and Goldberg 2016; Conneau et al. 2018). Most of this work used an extrinsic supervised task and target entire vector representations. We study the individual neurons in the vector representation and propose a simple supervised method to analyze individual/groups of neurons with respect to various properties and linguistic tasks. As an alternative to supervision which is limited to labeled data, we propose an unsupervised method based on correlation between several networks to identify salient neurons. Some recent work on neural language models and ma- chine translation analyzes specific neurons of length (Qian, Qiu, and Huang 2016a; Shi, Knight, and Yuret 2016) and sentiment (Radford, Jozefowicz, and Sutskever 2017). How- ever, not much work has been done along these lines. We present both intrinsic and extrinsic methods to analyze mod- els at the neuron level to gain a deeper insight. In computer vision, there has been much work on vi- sualizing and analyzing individual units such as filters in convolutional neural networks (Zeiler and Fergus 2014; Zhou et al. 2016, among others). Even though some doubts were cast on the importance of individual units (Morcos et al. 2018), recent work stressed their contribution to predict- ing specific object classes via ablation studies similar to the ones we conduct (Zhou et al. 2018). Methodology Let x = {x1, . . . , xn} denote a sequence of input features and consider a neural network model M that maps x to a M(cid:55)−→ z = {z1, . . . , zn}, sequence of latent representations: x where zi ∈ RD. For example, in an NMT system, M could be the encoder, x the input word embeddings, and z the hid- den states. Our goal is to study individual neurons in the model M, which we define as dimensions in the latent repre- sentation. We will use zij to denote the j-th dimension of the latent representation of the i-th word zi. We first explain a Linguistic Correlation Analysis method to find neurons spe- cific to a task. Then we present a Cross-model Correlation Analysis method for ranking based on the correlations be- tween neurons from different networks. Linguistic Correlation Analysis Consider a classification task where the goal is to predict a property l in a property set P3 that we believe is intrinsically learned in the model M, for example word-structure (mor- phology) or semantic information in an NMT model. Our goal is to identify neurons in M that are salient for the prop- erty l ∈ P being considered. We assume that we have super- vision for the task in the form of labeled examples {xi, li} where xi is the i-th word, having a property li ∈ P. Given this labeled training data, we first extract neuron activations zi from the model M for every input word xi. For instance, this may be done by running the NMT encoder on the sen- tence and recording neuron activations for each word. We then train a logistic regression classifier on the {zi, li} pairs using the cross-entropy loss. We opt to train a linear model because of its explanability; the learned weights can be queried directly to get a measure of the importance of each neuron in zi. From a performance point of view, earlier work has also shown that non-linear models present similar trends as of linear models in analyzing representations of neural models (Qian, Qiu, and Huang 2016b; Belinkov et al. 2017a). In order to increase interpretability and to encourage feature ranking in the classification process, we use elastic 3A property could be a part-of-speech tag such as verb, or a semantic entity such as event, or the position of a word in a sentence. A set of properties combined constitutes a task such as POS or semantic tagging. Algorithm 1 Neuron Ranking Extraction Algorithm 1: ordering ← [] (cid:46) ordering will store the neurons in order of decreasing importance 2: for p = 1 to 100 by α do (cid:46) p is the percentage of the weight mass. We start with a very small value and incrementally move towards 100%. tnpt ← GETTOPNEURONSPERTAG(θ, p) (cid:46) tnpt contains the top neurons per tag using the threshold p 3: 4: topN eurons ← L(cid:83) tnpti newN eurons ← topN eurons \ ordering ordering.append(newN eurons) i=1 5: 6: 7: end for 8: return ordering Ranking Neurons: Given the trained weights of the clas- sifier θ ∈ RD×L, we want to extract a ranking of the D neu- rons in the model M. For the label of interest l ∈ P, we sort the weights θl ∈ RD by their absolute values in descend- ing order. Hence the neuron with the highest corresponding absolute weight in θl appears at the top of our ranking. We consider the top n neurons (for the individual property under consideration) that cumulatively contribute to some percent- age of the total weight mass as salient neurons. To extract a ranking of neurons w.r.t. all of the labels in P, we use an iterative process described in Algorithm 1. We start with a small percentage of the total weight mass and choose the most salient neurons for each label l, and increase this % it- eratively, adding newly discovered top neurons to our order- ing. Hence, the salient neurons for each label l will appear at the top of the ordering. The order in which the neurons are discovered indicates their importance to the property set P. Cross-model Correlation Analysis The linguistic correlation analysis is useful for analyzing neurons given a certain property. Now, we present our Cross- model correlation method to identify neurons salient to the model M independent of any property. In essence, it ranks neurons according to their importance to the task the model M is trained on. We hypothesize that salient neurons con- tain important information about the task and are shared across several models. To prove this, we train multiple mod- els M1, . . . , MN for the same task, using identical model settings but with differing training data and initialization. We then rank neurons in one of the models Mi by their best cor- relation coefficient with any neuron from a different model: score(Mij) = max 1≤i(cid:48)≤N 1≤j(cid:48)≤D i(cid:54)=i(cid:48) ρ(Mij, Mi(cid:48)j(cid:48)) where Mij is the j-th neuron in the i-th model and ρ(Mij, Mi(cid:48)j(cid:48)) is the Pearson correlation coefficient.4 We then consider the top neurons in this ranking as the most salient neurons for the overall model. 4Here Mij ∈ RT , corresponding to activations of neuron j in model i, over an evaluation set of size T words. Figure 1: Linguistic Correlation Analysis: Extract neuron activations from a trained model, train a classifier and use weights of the classifier to extract salient neurons. net regularization (Zou and Hastie 2005) as an additional loss term. Formally, the model is trained by minimizing the following loss function: L(θ) = −(cid:88) log Pθ(lixi) + λ1(cid:107)θ(cid:107)1 + λ2(cid:107)θ(cid:107)2 (cid:80) where Pθ(lxi) = exp(θl·zi) l(cid:48) exp(θl(cid:48)·zi) is the probability that word i is assigned label l. The weights θ ∈ RD×L are learned with gradient descent. Here D is the dimensionality of the latent representations zi and L is the size of the label set for P. The overall process is illustrated in Figure 1. 2 i Elastic net regularization enjoys the sparsity effect as in Lasso regularization, which helps identify important indi- vidual neurons. At the same time, it takes groups of highly correlated features into account similar to Ridge regulariza- tion, avoiding the selection of only one feature as in Lasso regularization. This strikes a good balance between localiza- tion and distributivity. This is particularly useful in the case of analyzing neural networks where we hypothesize that the network consists of both individual focused neurons and a group of distributed neurons, depending on the property being learned. The regularization terms are controlled by hyper-parameters λ1 and λ2. We search for the best hyper- parameter values that maintain good accuracy while accom- plishing the desired goal of selecting the salient neurons for a property, as described in the evaluation section. French English German POS Morph 89.5 92.8 MAJ 88.0 NMT 93.2 NLM 92.4 90.1 POS 91.6 93.5 92.9 SEM POS Morph 83.7 84.2 87.3 90.1 86.0 86.5 89.3 93.6 92.3 Table 1: Classifier accuracy when trained on activations of NMT and NLM models. MAJ: local majority baseline. Evaluation using Neuron Ablation Given the list of neurons from a trained model M, we eval- uate the rankings by challenging their presence in the net- work. We clamp the value of a subset of neurons to zero as in (Morcos et al. 2018) and observe the degradation in performance, reflecting how much the network is dependent on them. Our hypothesis is that an ablation of the most im- portant neurons should cause a larger drop in performance compared to the least important neurons. We apply ablation to both the classifier (to evaluate property-specific rankings) and the original model M (to evaluate model-level rankings). Ablation in Classification Given a trained classification model, we keep N% top or bottom neurons and set the ac- tivation values of all other neurons to zero in the test set. We then reevaluate the performance of the already trained classifier. We expect to see low performance (prediction ac- curacy) when using only the bottom neurons versus using only the top neurons. We also retrain the classifier with only the selected N% neurons. This serves multiple purposes: i) it confirms the results from the zeroing-out method, ii) it shows that much of the performance can be regained using the selected neurons, and iii) it facilitates the analysis of how distributed a particular property is across the network. Ablation in Neural Model M: Here, we want to evaluate our rankings of neurons with respect to the model M. Given a ranked list of neurons, we incrementally zero-out N% of the neurons starting from top or bottom and report the drop in performance in terms of BLEU scores (for NMT) or per- plexity (for NLM). Experimental Settings Neural Models: We experimented with two architectures: NMT based on sequence-to-sequence learning with atten- tion (Bahdanau, Cho, and Bengio 2014) and an LSTM based NLM (Hochreiter and Schmidhuber 1997).5 We trained a 2- layer bidirectional NMT model with 500-dimensional word embeddings and LSTM states. The system is trained for 20 epochs, and the model with the best development loss is used for the experiments. We follow similar settings to train a uni- directional NLM model. Data: We experimented with English↔French (EN↔FR) and German→English (DE→EN) language pairs. We used a subset of 2 million sentences from the United Nations multi- parallel corpus (Ziemski, Junczys-Dowmunt, and Pouliquen 2016) for EN↔FR and from the data made available for the IWSLT campaign (Cettolo et al. 2014) for DE→EN. We split the parallel data for each language pair into three equal subsets to train three different models. For language models, we used the source side of the parallel corpora. Language Properties: We evaluated our linguistic corre- lation method by selecting standard tasks of part-of-speech (POS), morphological and semantic tagging. The former two capture word structure in a language and the latter captures its nuanced meaning. Additionally we considered some gen- eral properties, such as the position of words in a sentence and predicting a months of year tag. Classifier Data: We used 20k source-side sentences, ran- domly extracted from the MT training data, for training the classifier, and 4k sentences in the official test sets for test- ing. We tagged these sentences with standard taggers for the different properties; the details of these taggers can be found in the supplementary material. Evaluation In this section, we present the evaluation of our techniques: Linguistic Correlation Analysis Classifier Performance: We first evaluate the classifier performance to ensure that the learned weights are actu- ally meaningful for further analysis and ranking extraction. The classifiers were trained using the activations of already trained neural models (NLM and NMT encoder6). Table 1 shows accuracy of the classifiers trained for different lan- guage pairs and tasks on a blind test set. The classifiers achieve higher accuracies compared to the local majority baseline7 (MAJ) in all cases, except for French (POS:NLM). The overall accuracy trend shows that the neurons possess sufficient information to predict these language properties. Since we are using elastic net regularization, we need to tune the values for λ1 and λ2. The regularization controls the final ranking of the neurons directly: an increase in the value of λ1 introduces further sparsity whereas higher values of λ2 encourage selection of groups of correlated neurons. Our aim is to find a balance between selecting individual neu- rons and a group of neurons while maintaining the original accuracy of the classifier without any regularization (λ1, λ2 = 0). Figure 2 presents the results of a grid search over var- ious regularization values on the English POS tagging task. The accuracy difference is minimal for λ values under 1e−4. We selected a value of 1e−5 for both λ1 and λ2 and used the same for all the experiments. 5We focus on standard architectures for these tasks and leave exploration of recent variants such as the Transformer (Vaswani et al. 2017) or QRNN (Bradbury et al. 2017) for future work. 6We limit ourselves to encoder activations for simplicity. 7Selecting the most frequent tag for each word and the most frequent global tag for the unknown words. Figure 2: Effect of various values of regularization on the overall accuracy of the English POS tagging task. Masking-out 10% 15% 20% Task FR (POS) EN (POS) EN (SEM) DE (POS) FR (POS) EN (POS) EN (SEM) DE (POS) T M N M L N ALL 93.2 93.5 90.1 93.6 92.4 92.9 86.0 92.3 Top 63.2 69.8 51.5 65.9 41.6 54.2 49.7 39.7 Bot 23.8 15.8 16.3 15.7 23.8 18.4 21.9 16.7 Top 73.0 78.3 65.3 78.0 53.6 66.1 56.8 51.7 Bot 24.8 17.9 18.9 15.6 23.8 20.4 22.3 16.7 Top 79.4 84.1 74.2 88.2 59.6 72.4 65.2 67.2 Bot 24.9 21.5 20.7 15.7 24.0 24.7 25.1 16.9 Table 2: Classification accuracy on different tasks using all neurons (ALL). Masking-out: all except top/bottom N% of neurons are masked when testing the trained classifier. Neuron Ablation in the Classifier: After training the classifier, we used Algorithm 1 to extract a ranked list of neurons with respect to each property set and ablated neu- rons in the classifier to verify rankings. We masked-out all the activations (in the test set) except for the selected N % neurons and recomputed test accuracies. Table 2 summa- rizes the results.8 Compared to ALL, the classification ac- curacy drops drastically for both NMT and NLM. However, the performance is distinctly better in the case of keeping the top N% neurons when compared to the bottom N% neurons, showing that the ranking produced by the classifier is correct for the task at-hand. Visualizations: have been used effectively to gain qualita- tive insights on analyzing neural networks (Karpathy, John- son, and Fei-Fei 2015; K´ad´ar, Chrupała, and Alishahi 2016). We used an in-house visualization tool (Dalvi et al. 2019a) for qualitative evaluation of our rankings. Figure 3 visual- izes the activations of the top neurons for a few properties. It shows how single neurons can focus on very specific linguis- tic properties like verb or article. Neuron #1902 focuses on two types of verbs (3rd person singular present-tense and past-tense) where it activates with a high positive value for the former ("Supports") and high negative value for the lat- ter ("misappropriated"). In the second example, the neuron is focused on German articles. Although our results are fo- 8Similar trends were found in the morphological tagging re- sults. Please see supplementary material if interested. (a) English Verb (#1902) (b) German Article (#590) (c) Position Neuron (#1903) Figure 3: Activations of top neurons for specific properties Neuron #1925 (Month) #1960 (Negation) #1590 (Cardinality) Top 10 words August, July, January, September, October, presidential, April, May, February, December no, No, not, nothing, nor, neither, or, none, whether, appeal 50, 10, 51, 61, 47, 37, 48, 33, 43, 49 Table 3: Ranked list of words for some individual neurons in the EN-FR model. cused on linguistic tasks, the methodology is general for any property for which supervision can be created by labeling the data. For instance, we trained a classifier to predict po- sition of the word, i.e., identify if a given word is at the be- ginning, middle, or end of the sentence. As shown in Figure 3(a), the top neuron identified by this classifier activates with high negative value at the beginning (red), moves to zero in the middle (white), and gets a high positive value at the end of the sentence (blue). Another way to visualize is to look at the top words that activate a given neuron. Table 3 shows a few examples of neurons with their respective top 10 words. Neuron #1925 is focused on the name of months. Neuron #1960 is learning negation and Neuron #1590 activates when a word is a number. These word lists give us quick in- sights into the property the neuron has learned to focus on, and allows us to interpret arbitrary neurons in a given net- work. Cross-model Correlation Analysis The Cross-model correlation analysis method ranks the list of neurons based on correlation among several models. In the following, we evaluate the rankings produced by the method by ablating the neurons in the original model M. Neuron Ablation in Model M: We incrementally ablate top/bottom neurons from the ranking and report the drop in performance of the NMT model. Figure 4 shows the effect of ablation on translation quality (BLEU). For all languages, ablating neurons from top to bottom (solid curves) causes a significant early drop in performance compared to ablating neurons in the reverse order (dotted curves). This validates the ranking identified by our method. Ablating just the top 50 neurons (2.5%) leads to drops of 15-20 BLEU points, Extracting Neurons based on a Single Model: Recall that our Cross-model method requires multiple instances of the model to extract neuron rankings. In an effort to probe whether one instance of the model can sufficiently extract similar rankings, we tried several methods that ranked neu- rons of an individual model based on i) variance, and ii) dis- tance from mean (high to low), and compared these with the ranking produced by our method. We found less than 10% overlap among the top 50 neurons of the Cross-model rank- ing and the single model rankings. On ablating the neurons based on several ranking methods, we found the NMT mod- els to be most sensitive to the Cross-model ranking. Less damage was done when neurons were ablated using rank- ings based on variance and distance from mean in both di- rections, high-to-low and low-to-high (See Figure 7). This supports our claim that the Cross-model ranking identifies the most salient neurons of the model. Comparison with Linguistic Correlation Method: Are the neurons discovered by the linguistic correlation method important for the actual model as well? Figure 8 shows the effect on translation when ablating neurons in ranking order determined by English POS and semantic (SEM) tagging, as well as top/bottom Cross-model orderings. As expected, the linguistic correlation rankings are limited to the auxil- iary task and may not result in the most salient neurons for the actual task (machine translation in this case); ablating according to task-specific ordering hurts less than ablating by (top-to-bottom) Cross-model ordering. However, in both cases, degradation in translation quality is worse than ab- lating by bottom-to-top Cross-model ordering. Comparing SEM with POS, it turns out that NMT is slightly more sen- sitive to neurons focused on semantics than POS. Analysis and Discussion The rankings produced by the linguistic correlation and cross-correlation analysis methods give a sense of the most important neurons for an auxiliary task or the overall model. We now dive into neuron analysis based on these rankings. Focused versus Distributed Neurons: Recall that our linguistic-correlation method provides an overall ranking w.r.t. a property set (POS/SEM tagging), and also for each individual property as described in the Methodology sec- tion. Here, we look at the number of salient neurons (ex- tracted from the NMT models) for several different lin- guistic properties,9 as shown in Figure 6. For example, in open-class categories such as nouns (NN/NOM), verbs (VB/VER.simp/VVPP) and adjectives (JJ/ADJ), the in- formation is distributed across several dozen neurons. In comparison, categories such as end of sentence marker (SENT) or WH-Adverbs (WRB) and post-positions (APPO in German) required fewer than 10 neurons. We observed similar trend in the semantic tags: information about closed- class categories such as months of year (MOY) is localized in 9We choose salient neurons for each label by selecting the top neurons that cumulatively represent 25% of the total weight mass. Figure 4: Effect of neuron ablation on translation perfor- mance (BLEU) when removing the top or bottom neurons based on Cross-Correlation analysis ordering. while the bottom 50 neurons hurt the performance by only 0.5 BLEU points. Neuron ablation in NLM: Figure 5 presents the results of ablating neurons of NLM in the order defined by the Cross-model Correlation Analysis method. The trend found in the NMT results is also observed here, i.e. the increase in perplexity (degradation in language model quality) is sig- nificantly higher when erasing the top neurons (solid lines) as compared to when ablating the bottom neurons (dotted lines). Figure 5: Effect of neuron ablation on perplexity when eras- ing from the top and bottom of the Cross-correlation order- ing from the NLM Figure 6: focused versus distributed tags: NN/NOM = Noun, JJ/ADJ = Adjective, VB = Verb, WRB = WH-Adverb, REL = relation, LOC = Location, DOM = Day of Month, MOY = Month of Year, DEC = Decade, VER:simp = Verb simple past, SENT = Full stop, VVPP = Participle Perfect, ART = Article, APPO = Post-position just a couple of neurons. In contrast, an open category like location (LOC) is very distributed. Shared Neurons within and across Properties: Since some information is distributed across the network, we ex- pect to see some neurons that are common across various properties, and others that are unique to certain properties. To investigate this, we intersect top ranked neurons coming from two different properties. Some of these comparisons are interesting. For instance, we found some common neu- rons across all forms of adjectives, but some neurons specif- ically designated to specialized adjectives (e.g., comparative (JJR) and superlative (JJS) adjectives). Similarly across tasks (POS vs. Morph), we found multiple neurons targeting different verb forms (V--F3s and V--F3p , Verb Future 3rd person singular and plural) in the fine-grained morpho- logical tagging that are aligned with a single neuron target- ing the future tense verb tag (VER:futu) in POS tagging. This demonstrates that model recognizes a hierarchy of lin- guistic properties and distributes neurons based on it. Retraining Classifier with the Selected Neurons: In the evaluation section for our linguistic-correlation classifier, we masked-out a majority of the neurons and compared the ac- curacy trends to confirm our ranking. An alternative to ana- lyze is to retrain the classifier with the top or bottom N% neurons alone. Table 4 shows the results after retraining. There are several points to note here: i) training the classi- fier using top neurons performs consistently better than us- ing bottom neurons, reinforcing our previous finding. ii) The classifier is able to regain performance substantially (com- pared to ALL), even using only 10% neurons. iii) Using the bottom N% neurons also restores performance (although not Figure 7: Cross-model ranking compared with single model statistics in DE-EN model. Variance is the ranking based on high variance to low variance. Mean is the ranking from high to low distance from mean. Figure 8: Effect on translation when ablating neurons in the order determined by both methods on the EN-FR model as much as using the top neurons). This shows that the in- formation is distributed across neurons. However, the dis- tribution is not uniform, which results in a large difference between training using top and bottom neurons (i.e., the in- formation distribution is skewed towards the top neurons as expected). Notably, using only 20% of the top neurons, the classifier is able to regain much of the performance drop in most of the cases. This finding entails that our method could be useful for model distillation purposes. Cross-model Correlation Ranking: Analyzing the top neurons identified by our Cross-model correlation method, we found several neurons corresponding to the position of the word in a sentence. Word position has been previously found to be an important property in NMT (Shi, Knight, and Yuret 2016). The fact that our method ranks position neu- rons among the top ranking neurons shows its efficacy. We also observed that the top position neurons identified by our Task FR (POS) EN (POS) EN (SEM) DE (POS) FR (POS) EN (POS) EN (SEM) DE (POS) T M N M L N ALL 93.2 93.5 90.1 93.6 92.4 92.9 86.0 92.3 Top 88.4 89.1 85.6 91.4 83.7 85.8 78.9 87.2 Bot 72.1 80.6 73.4 77.1 61.8 62.4 67.8 41.7 Re-training 10% 15% 20% Top 90.0 90.5 87.0 92.3 86.2 88.2 81.4 89.6 Bot 77.8 84.8 77.8 81.9 71.7 72.5 74.1 67.0 Top 91.1 91.2 87.8 92.8 87.8 89.4 82.7 90.4 Bot 81.8 87.2 80.8 85.3 77.4 79.2 77.6 76.5 Table 4: Classification accuracy on different tasks using all neurons (ALL). Re-training: only top/bottom N% of neurons are kept and the classifier is retrained Linguistic Correlation method are the same as identified by the Cross-model correlation method. Lastly, we found that some of the remaining top Cross-model neurons correspond to fundamental structural properties in a sentence, like rela- tions, conjunctions, determiners and punctuations. Comparing NMT vs. NLM: There is substantially a large performance difference between top and bottom neurons (Refer to Table 4). For example, averaged over all proper- ties, the top 10% NMT neurons are 12.8% (absolute) better accuracy than the bottom 10% neurons, while the top 10% NLM neurons are 25.5% better than the bottom 10% neu- rons. We speculate that NMT model distributes the infor- mation more, compared to the NLM model. However, this could be an artifact of the difference in the architecture of NLM (unidirectional) and NMT (bidirectional). Conclusion and Future Work We proposed two methods to extract salient neurons from a neural model with respect to an extrinsic task or the model itself. We demonstrated the accuracy of our rankings by per- forming a series of ablation experiments. Our Cross-model Correlation method can potentially facilitate research on model distillation and neural architecture search, as it pin- points what is especially important for the model. Our Lin- guistic Correlation method is primarily focused on trying to understand specific dimensions that are responsible for learning particular properties. This can be helpful for un- derstanding and manipulating systems' behavior. In some preliminary experiments, we were able to successfully ma- nipulate verb tense neurons and control whether the system generates output in present or past tense. Some details are presented in (Bau et al. 2019). The source code for extrac- tion and analysis of salient neurons is incorporated in the NeuroX toolkit (Dalvi et al. 2019a) and is available on git.10 Acknowledgments We thank Preslav Nakov and the anonymous reviewers for their useful suggestions on an earlier draft of this paper. This work was funded by Qatar Computing Research Institute, HBKU as part of the collaboration with the MIT Computer Science and Artificial Intelligence Laboratory (CSAIL). Supplementary Material Language Property Data: We annotated the date using Tree-Tagger for French POS tags, LoPar for German POS and morphological tags, and MXPOST for English POS tags. For the semantic (SEM) tagging task, we experiment with the lexical semantic task introduced by (Bjerva, Plank, and Bos 2016).11 We split the available annotated data into 42k sentences for training and 12k sentences for testing. Results on Morphological Tags: Table 5 shows the re- sults for the classifier performance when masking out neu- rons for morphological tags. Table 6 shows the results when the classifier is retrained with N% of the neurons. Masking-out Task T FR (Morph) M DE (Morph) N M FR (Morph) DE (Morph) L N ALL 88.0 87.3 90.1 86.5 10% 15% 20% Top 25.2 21.8 36.3 24.2 Bot 17.3 15.7 13.9 10.7 Top 39.0 33.3 45.1 40.7 Bot 20.3 20.8 15.5 13.0 Top 56.3 53.2 58.4 52.8 Bot 24.3 29.3 19.0 19.2 Table 5: Classification accuracy on morphological tags for French and German using all neurons (ALL). Masking-out: all except top/bottom N% of neurons are masked when test- ing the trained classifier. Retraining Task T FR (Morph) M DE (Morph) N M FR (Morph) L DE (Morph) N ALL 88.0 87.3 90.1 86.5 10% 15% 20% Top 73.5 79.3 79.5 78.3 Bot 65.8 75.4 61.6 66.1 Top 78.0 82.1 82.5 81.6 Bot 71.6 78.9 70.3 72.4 Top 80.6 83.5 84.9 83.0 Bot 75.1 80.5 75.7 77.1 Table 6: Classification accuracy on morphological tags for French and German using all neurons (ALL). Re-training: only top/bottom N% of neurons are kept and the classifier is retrained References [Adi et al. 2016] Adi, Y.; Kermany, E.; Belinkov, Y.; Lavi, O.; and Goldberg, Y. 2016. Fine-grained Analysis of Sen- tence Embeddings Using Auxiliary Prediction Tasks. arXiv preprint arXiv:1608.04207. [Bahdanau, Cho, and Bengio 2014] Bahdanau, D.; Cho, K.; 2014. Neural machine translation by and Bengio, Y. arXiv preprint jointly learning to align and translate. arXiv:1409.0473. 10https://github.com/fdalvi/NeuroX 11The annotated data is limited to English language only. [Bau et al. 2019] Bau, D. A.; Belinkov, Y.; Sajjad, H.; Dur- rani, N.; Dalvi, F.; and Glass, J. 2019. Identifying and Con- trolling Important Neurons in Neural Machine Translation. arXiv preprint arXiv:1811.01157. [Belinkov et al. 2017a] Belinkov, Y.; Durrani, N.; Dalvi, F.; Sajjad, H.; and Glass, J. 2017a. What do Neural Machine Translation Models Learn about Morphology? In Proceed- ings of the 55th Annual Meeting of the Association for Com- putational Linguistics (ACL). Vancouver: Association for Computational Linguistics. [Belinkov et al. 2017b] Belinkov, Y.; M`arquez, L.; Sajjad, H.; Durrani, N.; Dalvi, F.; and Glass, J. 2017b. Evaluat- ing layers of representation in neural machine translation on part-of-speech and semantic tagging tasks. In Proceed- ings of the Eighth International Joint Conference on Natural Language Processing. [Bjerva, Plank, and Bos 2016] Bjerva, J.; Plank, B.; and Bos, J. 2016. Semantic Tagging with Deep Residual Networks. In Proceedings of COLING 2016, the 26th International Con- ference on Computational Linguistics: Technical Papers, 3531 -- 3541. [Bradbury et al. 2017] Bradbury, J.; Merity, S.; Xiong, C.; and Socher, R. 2017. Quasi-Recurrent Neural Networks. In- ternational Conference on Learning Representations (ICLR 2017). [Cettolo et al. 2014] Cettolo, M.; Niehues, J.; Stuker, S.; Bentivogli, L.; and Federico, M. 2014. Report on the 11th IWSLT Evaluation Campaign. Proceedings of the Inter- national Workshop on Spoken Language Translation, Lake Tahoe, US. [Conneau et al. 2018] Conneau, A.; Kruszewski, G.; Lam- ple, G.; Barrault, L.; and Baroni, M. 2018. What you can cram into a single vector: Probing sentence embeddings for In Proceedings of the 56th Annual linguistic properties. Meeting of the Association for Computational Linguistics (ACL). [Dalvi et al. 2017] Dalvi, F.; Durrani, N.; Sajjad, H.; Be- linkov, Y.; and Vogel, S. 2017. Understanding and improv- ing morphological learning in the neural machine translation In Proceedings of the Eighth International Joint decoder. Conference on Natural Language Processing. [Dalvi et al. 2019a] Dalvi, F.; Nortonsmith, A.; Bau, D. A.; Belinkov, Y.; Sajjad, H.; Durrani, N.; and Glass, J. 2019a. NeuroX: A toolkit for analyzing individual neurons in neu- In Proceedings of the AAAI Conference on ral networks. Artificial Intelligence (AAAI). [Dalvi et al. 2019b] Dalvi, F.; Sajjad, H.; Durrani, N.; Be- linkov, Y.; Bau, D. A.; and Glass, J. 2019b. What is one grain of sand in the desert? analyzing individual neurons in deep nlp models. In AAAI Conference on Artificial Intelli- gence (AAAI). [Doshi-Velez and Kim 2017] Doshi-Velez, F., and Kim, B. 2017. Towards A Rigorous Science of Interpretable Ma- chine Learning. In arXiv preprint arXiv:1702.08608. S., [Hochreiter and Schmidhuber 1997] Hochreiter, and Schmidhuber, J. 1997. Long short-term memory. Neural Computation 9(8):1735 -- 1780. ´A.; Chrupała, [K´ad´ar, Chrupała, and Alishahi 2016] K´ad´ar, G.; and Alishahi, A. 2016. Representation of linguistic form and function in recurrent neural networks. arXiv preprint arXiv:1602.08952. [Karpathy, Johnson, and Fei-Fei 2015] Karpathy, A.; John- son, J.; and Fei-Fei, L. 2015. Visualizing and understanding recurrent networks. arXiv preprint arXiv:1506.02078. [Linzen, Dupoux, and Goldberg 2016] Linzen, T.; Dupoux, E.; and Goldberg, Y. 2016. Assessing the Ability of LSTMs to Learn Syntax-Sensitive Dependencies. Transactions of the Association for Computational Linguistics 4:521 -- 535. [Lipton 2016] Lipton, Z. C. 2016. The Mythos of Model In- terpretability. In ICML Workshop on Human Interpretability in Machine Learning (WHI). [Morcos et al. 2018] Morcos, A. S.; Barrett, D. G.; Rabi- nowitz, N. C.; and Botvinick, M. 2018. On the importance of single directions for generalization. In International Con- ference on Learning Representations. [Qian, Qiu, and Huang 2016a] Qian, P.; Qiu, X.; and Huang, X. 2016a. Analyzing linguistic knowledge in sequential model of sentence. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing. [Qian, Qiu, and Huang 2016b] Qian, P.; Qiu, X.; and Huang, X. 2016b. Investigating Language Universal and Specific Properties in Word Embeddings. In Proceedings of the 54th Annual Meeting of the Association for Computational Lin- guistics. A.; [Radford, Jozefowicz, and Sutskever 2017] Radford, Jozefowicz, R.; and Sutskever, I. Learning to generate reviews and discovering sentiment. arXiv preprint arXiv:1704.01444. [Shi, Knight, and Yuret 2016] Shi, X.; Knight, K.; and Yuret, D. 2016. Why Neural Translations are the Right Length. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing. [Shi, Padhi, and Knight 2016] Shi, X.; Padhi, I.; and Knight, K. 2016. Does String-Based Neural MT Learn Source Syn- tax? In Proceedings of the Conference on Empirical Meth- ods in Natural Language Processing. [Vaswani et al. 2017] Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A. N.; Kaiser, L. u.; and Polosukhin, I. 2017. Attention is All you Need. In Advances in Neural Information Processing Systems 30. Curran Asso- ciates, Inc. [Vylomova et al. 2016] Vylomova, E.; Cohn, T.; He, X.; and Haffari, G. 2016. Word Representation Models for Morpho- logically Rich Languages in Neural Machine Translation. arXiv preprint arXiv:1606.04217. [Wang, Chung, and Lee 2017] Wang, Y.-H.; Chung, C.-T.; and Lee, H.-y. 2017. Gate Activation Signal Analysis for Gated Recurrent Neural Networks and Its Correlation with Phoneme Boundaries. arXiv preprint arXiv:1703.07588. [Zeiler and Fergus 2014] Zeiler, M. D., and Fergus, R. 2014. Visualizing and understanding convolutional net- 2017. In European conference on computer vision, 818 -- works. 833. Springer. [Zhou et al. 2016] Zhou, B.; Khosla, A.; A., L.; Oliva, A.; and Torralba, A. 2016. Learning Deep Features for Dis- criminative Localization. CVPR. [Zhou et al. 2018] Zhou, B.; Sun, Y.; Bau, D.; and Torralba, A. 2018. Revisiting the importance of individual units in cnns via ablation. arXiv preprint arXiv:1806.02891. [Ziemski, Junczys-Dowmunt, and Pouliquen 2016] Ziemski, M.; B. 2016. The United Nations Parallel Corpus v1.0. Proceedings of Language Resources and Evaluation. [Zou and Hastie 2005] Zou, H., and Hastie, T. 2005. Regu- larization and variable selection via the elastic net. Journal of the Royal Statistical Society, Series B 67:301 -- 320. Junczys-Dowmunt, M.; and Pouliquen, In the Tenth International Conference on
1812.01207
1
1812
2018-12-04T04:04:56
Practical Text Classification With Large Pre-Trained Language Models
[ "cs.CL" ]
Multi-emotion sentiment classification is a natural language processing (NLP) problem with valuable use cases on real-world data. We demonstrate that large-scale unsupervised language modeling combined with finetuning offers a practical solution to this task on difficult datasets, including those with label class imbalance and domain-specific context. By training an attention-based Transformer network (Vaswani et al. 2017) on 40GB of text (Amazon reviews) (McAuley et al. 2015) and fine-tuning on the training set, our model achieves a 0.69 F1 score on the SemEval Task 1:E-c multi-dimensional emotion classification problem (Mohammad et al. 2018), based on the Plutchik wheel of emotions (Plutchik 1979). These results are competitive with state of the art models, including strong F1 scores on difficult (emotion) categories such as Fear (0.73), Disgust (0.77) and Anger (0.78), as well as competitive results on rare categories such as Anticipation (0.42) and Surprise (0.37). Furthermore, we demonstrate our application on a real world text classification task. We create a narrowly collected text dataset of real tweets on several topics, and show that our finetuned model outperforms general purpose commercially available APIs for sentiment and multidimensional emotion classification on this dataset by a significant margin. We also perform a variety of additional studies, investigating properties of deep learning architectures, datasets and algorithms for achieving practical multidimensional sentiment classification. Overall, we find that unsupervised language modeling and finetuning is a simple framework for achieving high quality results on real-world sentiment classification.
cs.CL
cs
Practical Text Classification With Large Pre-Trained Language Models Neel Kant University of California, Berkeley [email protected] Raul Puri NVIDIA, Santa Clara CA [email protected] Nikolai Yakovenko NVIDIA, Santa Clara CA [email protected] Bryan Catanzaro NVIDIA, Santa Clara CA [email protected] 8 1 0 2 c e D 4 ] L C . s c [ 1 v 7 0 2 1 0 . 2 1 8 1 : v i X r a Abstract Multi-emotion sentiment classification is a natural language processing (NLP) problem with valuable use cases on real- world data. We demonstrate that large-scale unsupervised language modeling combined with finetuning offers a prac- tical solution to this task on difficult datasets, including those with label class imbalance and domain-specific context. By training an attention-based Transformer network (Vaswani et al. 2017) on 40GB of text (Amazon reviews) (McAuley et al. 2015) and fine-tuning on the training set, our model achieves a 0.69 F1 score on the SemEval Task 1:E-c multi- dimensional emotion classification problem (Mohammad et al. 2018), based on the Plutchik wheel of emotions (Plutchik 1979). These results are competitive with state of the art mod- els, including strong F1 scores on difficult (emotion) cate- gories such as Fear (0.73), Disgust (0.77) and Anger (0.78), as well as competitive results on rare categories such as Antic- ipation (0.42) and Surprise (0.37). Furthermore, we demon- strate our application on a real world text classification task. We create a narrowly collected text dataset of real tweets on several topics, and show that our finetuned model outper- forms general purpose commercially available APIs for sen- timent and multidimensional emotion classification on this dataset by a significant margin. We also perform a variety of additional studies, investigating properties of deep learn- ing architectures, datasets and algorithms for achieving prac- tical multidimensional sentiment classification. Overall, we find that unsupervised language modeling and finetuning is a simple framework for achieving high quality results on real- world sentiment classification. Introduction Recent work has shown that language models -- both RNN variants like the multiplicative LSTM (mLSTM) (Krause et al. 2016), as well as the attention-based Transformer net- work (Vaswani et al. 2017) -- can be trained efficiently over very large datasets, and that the resulting models can be transferred to downstream language understanding prob- lems, often matching or exceeding the previous state of the art approaches on academic datasets. However, how well do these models perform on practical text classification prob- lems, with real world data? Copyright c(cid:13) 2019, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. In this work, we train both mLSTM and Transformer lan- guage models on a large 40GB text dataset (McAuley et al. 2015), then transfer those models to two text classifica- tion problems: binary sentiment (including Neutral labels), and multidimensional emotion classification based on the Plutchik wheel of emotions (Plutchik 1979). We examine our performance on these tasks, both against large academic datasets, and on an original text dataset that we compiled from social media messages about several specific topics, such as video games. We demonstrate that our approach matches the state of the art on the academic datasets without domain-specific train- ing and without excessive hyper-parameter tuning. Mean- while on the social media dataset, our approach outperforms commercially available APIs by significant margins, even when those models are re-calibrated to the test set. Furthermore, we notice that 1) the Transformer model generally out-performs the mLSTM model, especially when fine-tuning on multidimensional emotion classification, and 2) fine-tuning the model significantly improves performance on the emotion tasks, both for the mLSTM and the Trans- former model. We suggest that our approach creates models with good generalization to increasingly difficult text classi- fication problems, and we offer ablation studies to demon- strate that effect. It is difficult to fit a single model for text classification across domains, due to unknown words, specialized con- text, colloquial language, and other differences between do- mains. For example, words such as war and sick are not necessarily negative in the context of video games, which are significantly represented in our dataset. By training a language model across a large text dataset, we expose our model to many contexts. Perhaps a small amount of down- stream transfer is enough to choose the right context features for emotion classification in the appropriate setting. Our work shows that unsupervised language modeling combined with finetuning offers a practical solution to spe- cialized text classification problems, including those with large category class imbalance, and significant human label disagreement. Background Supervised learning is difficult to apply to NLP problems be- cause labels are expensive. Following (Radford, J´ozefowicz, and Sutskever 2017), (Radford et al. 2018) and (Dai and Le 2015), we train unsupervised text models on large amounts of unlabelled text data, and transfer the model features to small supervised text problems. The supervised text classi- fication problem used for transfer is binary sentiment on the Stanford Sentiment Treebank (SST) (Socher et al. 2013). Some of these binary text examples are subtle. Prior works show that unsupervised language models can learn nuanced features of text, such as word ordering and double negation, just from the underlying task of next-word predic- tion. However, while this includes difficult examples, it does not necessarily represent sentiment on practical text prob- lems. • The source material (professionally written movie re- • The dataset excludes Neutral sentiment texts and those • The dataset does not include dimensions of sentiment views) does not include colloquial language. with weak directional sentiment. apart from Positive and Negative. Plutchik's Wheel of Emotions We focus our multi- dimension emotion classification on Plutchik's wheel of emotions (Plutchik 1979). This taxonomy, in use since 1979, aims to classify human emotions as a combination of four dualities: Joy - Sadness, Anger - Fear, Trust - Disgust, and Surprise - Anticipation. According to the basic emotion model (Ekman 2013), while humans experience hundreds of emotions, some emotions are more fundamental than others. The commercial general purpose emotion classification API that we compare against, IBM's Watson1, offers classi- fication scores for the Joy, Sadness, Fear, Disgust and Anger emotions -- all present in Plutchik's wheel (Fig. 1). SemEval Multidimension Emotion Dataset The Se- mEval Task 1:E-c problem (Mohammad et al. 2018) offers a training set of 6,857 tweets, with binary labels for the eight Plutchik categories, plus Optimism, Pessimism, and Love. This dataset was created through a process of text selection and human labeling. We show our results on this dataset and compare it to the current state of the art performance. While it is not possible to report rater agreement on these categories for the compilation of the dataset, the authors note that 2 out of 7 raters had to agree for a positive label to be applied, as requiring larger agreement caused a scarcity of 1https://www.ibm.com/watson/services/natural-language- understanding/ Figure 1: Plutchik's wheel of emotions (Plutchik 1979). labels for some categories. This indicates that some of the categories had significant rater disagreement between the human raters. The dataset also included a substantial degree of label class imbalance, with some categories like Anger (37%), Disgust (38%), Joy (36%) and Sadness (29%) rep- resented often in the dataset, while others like Trust (5%) and Surprise (5%) present much less frequently (Fig.2). This class imbalance and human rater disagreement is not uncom- mon for real world text classification problems2. Company Tweet Dataset In addition to the SemEval tweet dataset, we wanted to see how our model would per- form on a similar but domain-specific task: Plutchik emotion classification on tweets relevant to a particular company. We collected tweets on a variety of topics, including: • Video game tweets • Tweets about the company stock We submitted the first batch of 4,000 tweets to human 2We submitted the SemEval training set for re-labeling using our rater instructions. See Fig.3 for an estimate of rater disagree- ment over the SemEval training set. Table 1: Difficult video game tweets. Tweet Encouraging collaboration among players in Sea of Thieves <url> got my first kill on Fortnite all by myself I'm geeked <emoji>perioddddd. Far Cry 5 "Lost On Mars" Gameplay Walkthrough - DLC2: <url>via @YouTube NEW SUBMACHINE GUN IS INSANE! -- Fortnite Best Moments 39 (Fortnite Funny Fails & WTF Moments) <url> Watson Sad Binary -0.302 -0.847 -0.909 -0.936 0.229 0.003 0.047 0.821 Joy 0.194 0.666 0.015 0.178 Fear 0.150 0.225 0.873 0.056 Ours GCL Binary Binary -0.80 +0.60 +0.00 -0.10 Pos Neu Neu Pos Table 2: Label class balance (as percent) for SemEval and company tweet datasets. SemEval (Random) (Active) (All) Size 6,858 4,021 5,024 13,326 Anger Anticipation Disgust 37.2 7.8 22.0 11.7 38.0 5.2 12.3 6.8 14.3 14.7 10.2 12.9 Fear 18.2 1.7 5.6 2.9 Joy 36.2 21.9 19.7 20.6 Sad 29.4 3.4 6.3 4.2 Surprise Trust Ave/None 23.0/2.9 8.2/52.1 11.2/35.6 8.9/47.0 5.3 4.3 7.1 5.0 5.2 6.6 6.5 7.6 raters on the FigureEight3 platform, with rules similar to those used by SemEval, which also used the FigureEight platform for human labeling. Specifically, we verified that raters passed our golden set (answering 70% of test ques- tions correctly). We applied positive labels for each category where 2 out of 5 raters agreed. This is slightly less permis- sive than the 2 out of 7 raters used by SemEval, because we did not have a budget for 7 raters per tweet. After the first pass, we noticed that random sampling led to some categories being severely under-sampled, below 5% of tweets. Thus we employed a bootstrapping technique to pre-classify tweets by category using our current model, and choose tweets with more likely emotion tweets for classi- fication. See Active Learning section for details. We also sampled 5,000 tweets balanced by source category, since video game tweets have much more emotion, thus domi- nated the bootstrapped selections. Henceforth, we refer to the combined company tweets dataset consisting of: • 4,021 random tweets • 5,024 tweets selected for higher emotion content • 4,281 tweets selected for source category balance Table 3: Inter-rater agreement. Humans don't always agree, even on binary sentiment. Dataset Judgments Binary (3 choices) Plutchik (8 choices) SemEval Company (random) Company (active) Company (balanced) 20,514 20,005 25,017 23,812 77.3% 80.7% 79.0% 80.0% 61.1% 67.3% 52.3% 71.0% Finetuning Recent work has shown promising results us- ing unsupervised language modeling, followed by transfer learning to natural language tasks (Radford, J´ozefowicz, and Sutskever 2017), (Radford et al. 2018). Furthermore, these models benefit when the entire model is fine-tuned on the transfer task, as demonstrated in (Howard and Ruder 2018). Specifically, these methods have beaten the state of the art on binary sentiment classification. These models have also attained the best overall score on the GLUE Benchmark4 (Wang et al. 2018), comprised of a variety of text under- standing tasks, including entailment and question answer- ing. 3https://www.figure-eight.com/ 4https://gluebenchmark.com/leaderboard Methodology We use a larger batch size with shorter sequence length, specifically a global batch of 512 and sequence length 64 tokens (tokenized with a 32,000 BPE vocabulary, as de- tailed in Characters and Subword Units. The shorter se- quence length works well because the transfer target are tweets, which are short pieces of text. We trained our lan- guage model on the Amazon Reviews dataset (McAuley et al. 2015) rather than other large datasets like BooksCorpus (Zhu et al. 2015), because reviews are rich in emotional con- text. We also train an mLSTM network on the same dataset, based on the model from (Puri et al. 2018). We chose to compare these particular models because they work in fundamentally different ways and because they collectively hold state of the art results on many significant academic NLP benchmarks. We wanted to test these models on difficult classification problems with real-world data. Unsupervised Pretraining. The language modeling ob- jective can be summarized as a maximum likelihood estima- tion problem for a sequence of tokens. We treat our model as a function with two parts: an encoder fe and decoder fd. The encoder forms the bulk of the model, including the to- ken embedding dictionary as the first module. The decoder is simply a softmax linear layer that projects the encoder output into the dimension equal to the vocabulary size. The objective to maximize is as follows. − log p(x0, . . . , xn) = − n(cid:88) log p(xtxt−1, . . . , x0) t=1 p(xtxt−1, . . . , x0) = fd(hl t) where hl indexed 1 . . . l for timestep t. t is a hidden layer activation in the final layer of fe, The model is tasked with predicting the next token given all of the ones prior by outputting a probability distribution over the vocabulary of tokens. Doing this for each timestep t produces each term in the sum of the log-likelihood formu- lation, and so maximizing the correct probabilities is a way to understand the joint probability distribution of sequences in this corpus of text. Characters and Subword Units. While (Radford, J´ozefowicz, and Sutskever 2017), (Gray, Radford, and Kingma 2017) and (Puri et al. 2018) have shown state of the art results for language modeling and task transfer with character-level mLSTM models, we found that our Table 4: Hyperparameters for language modeling and fine- tuning phases. Language Modeling 512 (size 64 on 8 GPUs) Finetuning 32 64 - kept short because tar- geting tweet application max(batch) ADAM 2 × 10−4 (cosine decay after linear warmup on 2000 iterations) Rdh×32000 global batch size sequence length optimizer lr (schedule) Decoder module 1 × 10−5 (constant after 1/2 epoch lin- ear warmup) Binary: MLP(1024 → nc) with PReLU and 0.3 dropout Multiclass: MLP(4096 → 2048 → 1024 → nc) with PReLU and 0.3 dropout 5 Sigmoid Binary Cross En- tropy +0.02 · LLM # Epochs Loss 1 LLM = Softmax Cross En- tropy Transformer model benefits from modeling language through subword units. Using a byte-pair-encoding (BPE) (Sennrich, Haddow, and Birch 2015) of various sized we notice that a 32,000 word-piece vocabulary achieves a better bits per character (BPC) loss over one epoch of the Amazon Reviews dataset (McAuley et al. 2015) than a small vocabulary. We compute the BPC equivalent over word pieces, following (Mikolov et al. 2012). For the remainder of this work, our Transformer models use 32,000 word pieces5. Recent work (Al-Rfou et al. 2018) has shown that it is possible to train a character level Transformer that is up to 64 layers deep and which beat state of the art BPC over large text datasets. However this requires intermediate layer losses, and other auxiliary losses for optimal convergence. By comparison, (Radford et al. 2018) uses a bytepair en- coding vocabulary with 40,000 word pieces for their state of the art results on language transfer tasks with a Transformer model. Our work closely follows their model. Supervised Finetuning. After the pretraining, we initial- † ize a new decoder f d to be exclusively trained on the super- vised problem. Depending on the task, this decoder may be a single linear layer with activation or an MLP. We also retain the original decoder fd and continue to train it by using lan- guage modeling as an auxiliary loss when finetuning on the new corpus. Error signals from both decoders are backprop- agated into the language model. The differences between the hyperparameters for finetuning and language modeling are described in Table 4. ELMo Baseline We also compare our language models to ELMo (Peters et al. 2018), a contextualized word represen- tation based on a deep bidirectional language model, trained on large text corpus. We use a publicly available pretrained ELMo model from the authors. During finetuning, text is embedded with ELMo before being passed into a decoder † d. Error signals are backpropagated into the ELMo lan- f guage model. Unlike our other models, we do not use an auxiliary language modeling loss during finetuning, as the ELMo language model is bidirectional. Finetuning the ELMo model substantially improves ac- curacy on our tasks, thus we include only finetuned ELMo results. Multihead vs. Single Head Finetuning Decoders The tweet datasets are an example of a multilabel classification problem. We can formulate the problem for the finetuning † decoder, f d as either a collection of single binary problems or multiple problems put together. The single binary problem formulation allows for a focus on one class and end-to-end optimization will only have one error signal. However, because the label classes are imbal- anced in all categories, this may lead to a sparse gradient signal for the positive label, which may impact recall and † precision. Increasing the size of f d to more than one linear layer leads to rapid overfitting and lower validation perfor- mance. The combined binary problems formulation (henceforth described as multihead) allows for a richer error signal that propagates more information through the encoder fe and † sentiment representation in f d. In this setup, constructing a Multilayer network is far more useful, and can be thought of as specifically creating sentiment features to be used at the final layer to predict the presence of the individual emo- tions. We find that the inclusion of easier, more balanced la- bel categories improves performance on harder ones in Table 7. However, the easier categories have slightly lower perfor- mance because the network is not being optimized for only those categories. Thresholding Supervised Results For both the multihead † MLP and the single linear layer instantiating of f d, we found that thresholding predictions produced noticeably better re- sults than using a fixed threshold value such as t∗ = 0.5. This makes sense since the label classes for most categories are very imbalanced. For thresholding, we take a dataset of tweets and split it into training (70%), thresholding (10%) and validation (20%) sets. At each epoch of finetuning on the training set, we calculate validation accuracy and save predictions on the threshold set on the epoch for which this is maximized. To threshold, we search the discretized version of [0, 1]: the linear space T = { i 200 : 1 ≤ i ≤ 200} for the positive label threshold for each category. We denoted the threshold which gave the best score on the threshold set as t∗. IBM Watson and Google NLP6 both offer commercial APIs for binary sentiment analysis, producing scalar val- ues that correspond to a continuous [-1,+1] sentiment score. We applied our thresholding procedure to these scores. In 5Library available https://github.com/google/sentencepiece BPE for in open source: 6https://cloud.google.com/natural-language/ Table 5: Binary sentiment accuracy. The SST dataset includes Positive and Negative labels. Other datasets include Neutral labels. Third party results (Watson and Google) thresholded on the test set. SST (acc) Company -/=/+ Transformer (finetune) mLSTM (finetune) 8k mLSTM(Puri et al. 2018) (Gray, Radford, and Kingma 2017) ELMo (finetuned) ELMo+BiLSTM+Attn (Wang et al. 2018) Watson API Google Sentiment (GCL) API Class Balance 1 < t∗ the case of classification with neutrals we create two thresh- olds 0 < t∗ 2 < 1 which we individually optimized jointly over T as well. With the finetuning procedure, we † found success with a decoder f d = MLP(64, 2), whose two output units yp, yn are probability estimates of the positive and negative labels yp, yn. These units both have sigmoid activations, since we denote a neutral as yp = yn = 0. To threshold these predictions, we searched the cartesian prod- uct T × T to determine 0 < t∗ n < 1. p, t∗ Active Learning We hypothesized that we could achieve greater precision and recall on our datasets if our class label were more equally balanced. To this end, we employed an active learning procedure to select unlabeled tweets to be la- beled. The algorithm consisted of first finetuning a language † model f = (fe, fd, f d ) on labeled tweets for 5 epochs. At peak validation accuracy, we obtain predictions P ∈ R8×nu, for Plutchik sentiment on the unlabeled tweets. From the labeled dataset, we calculate the negative class percentage for each category v ∈ R8. Then we obtain cat- egory a weighting parameter w = 10 × (v − 0.5) so that wi ∈ [−5, 5] for i ∈ 1 . . . 8. Then, we get scores for each unlabeled point as weighted features: s = ew(cid:62)P ∈ Rnu. This way, positive predictions for sentiment categories are weighted by how much they would contribute towards bal- ancing all of the class distributions. The scores s are used as weights in a weighted uniform random sampler, and from this, we sampled 5,000 tweets to be labeled. We found that overall, the method produced tweets with more emotion. Not only was the positive class balance av- eraged across label categories higher (11.2% compared to 8.2% for random sampling), but the percentage of tweets which had no emotion was dramatically lower: 35.6% com- pared to 52.1% for random sampling (Table 2). We hence achieved better class balance than the dataset prior to the augmentation. Results 90.9% 90.4% 93.8% 93.1% 79.9% 91.6% 84.4% 81.3% 50.0/50.0 - - - 56.7% 62.5% 81.2% 88.2/73.5/81.9 87.0/69.3/78.3 78.2% 77.3% 86.0/67.4/78.6 71.4% 81.7/60.1/72.4 - - 42.9/54.0/73.3 69.6/54.0/63.8 22.4/46.0/31.6 of Positive and Negative labels, and the company tweets dataset, which consists of a balance between Positive, Neu- tral and Negative labels. See Table 5. While the Transformer gets close but does not exceed the state of the art on the SST dataset, it exceeds both the mL- STM and ELMo baseline as well as both Watson and Google Sentiment APIs on the company tweets. This is despite op- timally calibrating the API results on the test set. Multi-Label Emotion Tweets The IBM Watson API offers multi-label emotion predictions for five categories: Anger, Disgust, Fear, Joy and Sadness. We compare our models to Watson on these categories for both the SemEval dataset and the company tweets in Table 7. We find that our models outperform Watson on every emo- tion category. SemEval Tweets We submitted our finetuned Transformer model to the SemEval Task1:E-C challenge, as seen in Ta- ble 6. These results were computed by the organizers on a golden test set, for which we do not have access to the truth labels. Our model achieved the top macro-averaged F1 score among all submission, with competitive but lower scores for the micro-average F1 an the Jaccard Index accu- racy 8. This suggests that our model out-performs the other top submission on rare and difficult categories, since macro- average weighs performance on all classes equally, and the most common categories of Joy, Anger, Disgust and Opti- mism get relatively higher F1 scores across all models. 8SemEval at http://alt.qcri.org/semeval2018/. Our entry is #1 in the post- evaluation period for Task1:E-C, as of October 2018. results 2018 seen can be Table 6: Comparison on SemEval Task 1:E-c challenge. Of- ficial results on the golden test set [truth labels hidden]. 7 Binary Sentiment Tweets For binary sentiment, we compare our model on two tasks: the academic SST dataset, which consists of a balanced set Transformer (ours) (Baziotis et al. 2018) (Meisheri and Dey 2018) Accuracy Micro F1 Macro F1 (Jaccard) 0.561 0.542 0.534 0.577 0.595 0.582 0.690 0.709 0.694 Table 7: Transformer vs. mLSTM on Plutchik Tweet Categories (F1 Score). MH: Multi Head, SH: Single Head Company Semeval Transformer (MH) Transformer (SH) mLSTM (SH) ELMo (MH) Watson Transformer (MH) Transformer (SH) mLSTM (SH) ELMo (MH) Watson .486 .491 .426 .306 Anger Anticipation Disgust .684 .679 .636 .515 .358 .779 .774 .668 .506 .498 .441 .371 .319 .325 .179 .769 .765 .691 .351 .331 .413 .425 .189 .215 - - Fear .400 .400 .232 .086 .086 .723 .735 .535 .172 .149 Joy .634 .675 .609 .489 .520 .850 .832 .763 .540 .684 Sadness Surprise Trust Average .333 .286 .260 .182 .096 .712 .699 .557 .348 .359 .269 .210 .201 .161 - .360 .373 .103 .164 - .300 .279 .284 .182 - .240 .247 .000 .239 - .443 .424 .371 .281 - .606 .606 .438 .317 - We also compare the deep learning architectures of the Transformer and mLSTM on this dataset in Table 7 and find that the Transformer outperforms the mLSTM across Plutchik categories. The winner of the Task1:E-c challenge (Baziotis et al. 2018) trained a bidirectional LSTM with an 800,000 word embedding vocabulary derived from training word vectors (Mikolov et al. 2013) on a dataset of 550 million tweets. Similarly, the second place winner of the SemEval leader- board trained a word-level bidirectional LSTM with atten- tion, as well as including non-deep learning features into their ensemble (Meisheri and Dey 2018). Both submissions used training data across SemEval tasks, as well as addi- tional training data outside of the training set. In comparison, we demonstrate that finetuning can be as effective on this task, despite training only on 7,000 tweets. Furthermore, out language modeling took place on the Ama- zon Reviews dataset, which does not contain emoji, hashtags or usernames. We would expect to see improvements if our unsupervised dataset contained emoji, for example. Plutchik on Company Tweets Our models gets lower F1 scores on the company tweets dataset than on equivalent Se- mEval categories. As with the SemEval challenge tweets, the Transformer outperformed the mLSTM. These results are shown in Table 7. Both models performed significantly better than the Watson API on all categories for which Wat- son supplies predictions. We could not conclusively determine whether the single- head or the multihead Transformer will perform better on a given task. Thus we recommend trying both methods on a new dataset. Analysis Classification Performance by Dataset Size We would have liked to label more data for the company tweets dataset, and thus looked into how much extra labeling contributes to finetuned model performance accuracy. First, let us explain the difference between micro and macro averaging of the F1 scores. We can summarize the F1 scores of categories c ∈ C (or any other metric M) through macro and micro averaging to obtain M. The macro method weights each class equally by averaging the metric calcu- lated on each individual class. The micro method accounts for the class imbalances in each category by aggregating all of the true/false positives/negatives first, and then calculat- ing an overall metric. (cid:88) c ∈ C 1 C (cid:88) c ∈ C (cid:88) c ∈ C M macro = M (T Pc, T Nc, F Pc, F Nc) M micro = M (T P , T N , F P , F N ) T P = T Pc, T N = T Nc . . . In one experiment, we decreased the size of the training dataset and observed the resulting macro and micro averaged F1 scores across all categories on company tweets. The re- sults are shown in Fig. 2a. We observe that the macro aver- age is more sensitive to dataset size and falls more quickly than the micro average. The interpretation of this is that cat- egories with worse class imbalance (which consequently in- fluence macro more than micro average) benefit more from having a larger training dataset size. This suggests that we may obtain substantially better results with more data in the harder categories. We conducted a related experiment that focused on the difference in category performance when using a single head † d. We apply the two architec- versus a multihead decoder f tures at different training dataset sizes for three different la- bel categories: Anger, Anticipation and Trust, which we cat- egorize as low, medium and high difficulty, respectively. As seen in Fig. 2b it appears that the difference between the single and multihead becomes more pronounced for more difficult categories, as well as for smaller dataset sizes. We do not have enough data to make a firm conclusion, but this study suggests that we could get more out of the la- beled data that we have, by studying which categories bene- fit from single head and multihead decoders. All categories benefit from more training data, but some categories benefit from from marginal labeled data than others. This suggests further and more rigorous study of the boostrapping meth- ods we used to select tweets for our human labeling budget, as described in the Active Learning section. (a) (b) Figure 2: a) Comparison of macro and micro averages of F1 scores across categories on the company tweets dataset. b) F1 Scores for different categories on different dataset sizes for single head vs. multihead decoder. Dataset Quality and Human Rater Agreement The Se- mEval dataset (Mohammad et al. 2018) applies a positive label for every category where 2 out of 7 vetted raters agree. The reason is for the dataset to contain difficult and subtle examples of sentiments, not just those examples where ev- eryone agrees. The raters also have a tendency to under-label categories, especially when presented multiple options. Following a similar process, we required 2 out of 5 raters for a positive label, and in the case of binary sentiment la- bels (Positive, Neutral, Negative), we rounded toward polar- ized sentiment and away from Neutral labels in the case of a 2/3 split. Applying the SemEval-trained Transformer di- rectly to our company tweets dataset gets reasonably good results (0.338 macro average), also validating that our label- ing technique is similar to that of SemEval. Looking at rater agreement by dataset (Fig. 3), we see that Plutchik category labels contain large rater disagreement, even among vetted raters who passed the golden set test. Fur- thermore, datasets with more emotions (the SemEval dataset and our active learning sampled company tweets) contain higher Plutchik disagreement than random company tweets. This is likely because raters tend to apply the "No Emo- tion" label when they are not sure about a category. As Table 2 shows, the SemEval and active company tweets datasets contain fewer no-emotion tweets than other datsets. It would be interesting to analyze rater disagreement by category, how much this effects classifier convergence, whether getting 7+ ratings per tweet helps classifier conver- gence, and also whether this work could benefit from esti- mating rater quality via agreement with the crowd, as pro- posed in (Khetan, Lipton, and Anandkumar 2017). However this analysis is not straightforward, as the truth data is itself collected through human labeling. Alongside classifier convergence by dataset size (Fig.2b), we think that this could be an interesting area a future re- search. Difficult tweets and challenging contexts. There is not sufficient space for a thorough analysis, but we wanted to suggest why general purpose APIs may not work well on our company tweets dataset. Table 1 samples the largest binary sentiment disagreements between human raters and the Wat- son API. For simplicity, we restrict examples to video game tweets, which comprise 19.1% of our test set. As we can see, all of these examples appear to ascribe negative emotion to generally negative terms which, in a video game context, do not indicate negative sentiment. Our purpose is not to castigate the Watson or the GCL APIs. Rather, we propose that it may not be possible to pro- vide context-independent emotion classification scores that work well across text contexts. It may work better in practice, on some tasks, to train a large unsupervised model and to use a small amount of labeled data to finetune on the context present in the spe- cific dataset. We would like to quantify this further in future work. Recent work (Yang et al. 2017) shows that training an RNN with multiple softmax outputs leads to a much im- proved BPC on language modeling, especially for diverse datasets and models with large vocabularies. This is because the multiple softmaxes are able to capture a larger number of distinct contexts in the text than a single output. Perhaps our Transformer also captures the features rele- vant to a large number of distinct contexts, and the finetun- ing is able to select the most significant of these features, while ignoring those features that -- while adding value in general -- are not appropriate in a video game setting. Conclusion In this work we demonstrate that unsupervised pretraining and finetuning provides a flexible framework that is effec- tive for difficult text classification tasks. We noticed that the finetuning was especially effective with the Transformer net- work, when transferring to downstream tasks with noisy la- bels and specialized context. We think that this framework makes it easy to customize a text classification model on niche tasks. Unsupervised lan- guage modeling can be done on general text datasets, and re- quires no labels. Meanwhile downstream task transfer works well enough, even on small amounts of domain-specific la- belled data, to be accessible to most academics and small organization. It would be great to see this approach applied to a variety of practical text classification problems, much as (Radford Radford, A.; Narasimhan, K.; Salimans, T.; and Sutskever, I. 2018. Improving language understanding by generative pre-training. Radford, A.; J´ozefowicz, R.; and Sutskever, I. 2017. Learn- ing to generate reviews and discovering sentiment. CoRR abs/1704.01444. Sennrich, R.; Haddow, B.; and Birch, A. 2015. Neural ma- chine translation of rare words with subword units. CoRR abs/1508.07909. Socher, R.; Perelygin, A.; Wu, J.; Chuang, J.; Manning, C. D.; Ng, A. Y.; and Potts, C. 2013. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, 1631 -- 1642. Stroudsburg, PA: Association for Computational Linguistics. Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A. N.; Kaiser, L.; and Polosukhin, I. 2017. At- tention is all you need. CoRR abs/1706.03762. Wang, A.; Singh, A.; Michael, J.; Hill, F.; Levy, O.; and Bowman, S. R. 2018. GLUE: A multi-task benchmark and analysis platform for natural language understanding. CoRR abs/1804.07461. Yang, Z.; Dai, Z.; Salakhutdinov, R.; and Cohen, W. W. 2017. Breaking the softmax bottleneck: A high-rank RNN language model. CoRR abs/1711.03953. Zhu, Y.; Kiros, R.; Zemel, R. S.; Salakhutdinov, R.; Urtasun, R.; Torralba, A.; and Fidler, S. 2015. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. CoRR abs/1506.06724. et al. 2018) and (Devlin et al. 2018) have applied language modeling and transfer to a variety of academic text under- standing problems on the GLUE Benchmark. References Al-Rfou, R.; Choe, D.; Constant, N.; Guo, M.; and Jones, L. 2018. Character-level language modeling with deeper self-attention. CoRR abs/1808.044449. Baziotis, C.; Athanasiou, N.; Chronopoulou, A.; Kolovou, A.; Paraskevopoulos, G.; Ellinas, N.; Narayanan, S.; and Potamianos, A. 2018. NTUA-SLP at semeval-2018 task 1: Predicting affective content in tweets with deep attentive rnns and transfer learning. CoRR abs/1804.06658. Dai, A. M., and Le, Q. V. 2015. Semi-supervised sequence learning. CoRR abs/1511.01432. Devlin, J.; Chang, M.-W.; Lee, K.; and Toutanova, K. 2018. Bert: Pre-training of deep bidirectional transformers for lan- guage understanding. Ekman, P. 2013. An argument for basic emotions. Gray, S.; Radford, A.; and Kingma, D. P. 2017. Gpu kernels for block-sparse weights. Howard, J., and Ruder, S. 2018. Fine-tuned language models for text classification. CoRR abs/1801.06146. Khetan, A.; Lipton, Z. C.; and Anandkumar, A. 2017. Learn- ing from noisy singly-labeled data. CoRR abs/1712.04577. 2016. Krause, B.; Lu, L.; Murray, I.; and Renals, S. CoRR Multiplicative LSTM for sequence modelling. abs/1609.07959. McAuley, J.; Targett, C.; Shi, Q.; and van den Hengel, A. 2015. Image-based recommendations on styles and substi- tutes. SIGIR. Meisheri, H., and Dey, L. 2018. Tcs research at semeval- 2018 task 1: Learning robust representations using multi- attention architecture. In Proceedings of The 12th Interna- tional Workshop on Semantic Evaluation, 291 -- 299. Associ- ation for Computational Linguistics. Mikolov, T.; Sutskever, I.; Deoras, A.; Le, H.-S.; Kombrink, S.; and Cernocky, J. 2012. Subword language modeling with neural networks. Technical report, Unpublished Manuscript. Mikolov, T.; Sutskever, I.; Chen, K.; Corrado, G.; and Dean, J. 2013. Distributed representations of words and phrases and their compositionality. CoRR abs/1310.4546. Mohammad, S. M.; Bravo-Marquez, F.; Salameh, M.; and Kiritchenko, S. 2018. Semeval-2018 Task 1: Affect in In Proceedings of International Workshop on Se- tweets. mantic Evaluation (SemEval-2018). Peters, M. E.; Neumann, M.; Iyyer, M.; Gardner, M.; Clark, C.; Lee, K.; and Zettlemoyer, L. 2018. Deep contextualized word representations. CoRR abs/1802.05365. Plutchik, R. 1979. Emotions: A general psychoevolutionary theory. 1. Puri, R.; Kirby, R.; Yakovenko, N.; and Catanzaro, B. 2018. Large scale language modeling: Converging on 40gb of text in four hours. CoRR abs/1808.01371.
1811.00232
2
1811
2019-06-02T10:38:04
Textbook Question Answering with Multi-modal Context Graph Understanding and Self-supervised Open-set Comprehension
[ "cs.CL" ]
In this work, we introduce a novel algorithm for solving the textbook question answering (TQA) task which describes more realistic QA problems compared to other recent tasks. We mainly focus on two related issues with analysis of the TQA dataset. First, solving the TQA problems requires to comprehend multi-modal contexts in complicated input data. To tackle this issue of extracting knowledge features from long text lessons and merging them with visual features, we establish a context graph from texts and images, and propose a new module f-GCN based on graph convolutional networks (GCN). Second, scientific terms are not spread over the chapters and subjects are split in the TQA dataset. To overcome this so called "out-of-domain" issue, before learning QA problems, we introduce a novel self-supervised open-set learning process without any annotations. The experimental results show that our model significantly outperforms prior state-of-the-art methods. Moreover, ablation studies validate that both methods of incorporating f-GCN for extracting knowledge from multi-modal contexts and our newly proposed self-supervised learning process are effective for TQA problems.
cs.CL
cs
Textbook Question Answering with Multi-modal Context Graph Understanding and Self-supervised Open-set Comprehension Daesik Kim1,2,∗ Seonhoon Kim1,3,∗ Nojun Kwak1,† 1Seoul National University 2V.DO Inc. {daesik.kimnojunk}@snu.ac.kr 9 1 0 2 n u J 2 ] L C . s c [ 2 v 2 3 2 0 0 . 1 1 8 1 : v i X r a Abstract In this work, we introduce a novel algorithm for solving the textbook question answering (TQA) task which describes more realistic QA problems compared to other recent tasks. We mainly focus on two related issues with anal- ysis of the TQA dataset. First, solving the TQA problems requires to comprehend multi- modal contexts in complicated input data. To tackle this issue of extracting knowledge fea- tures from long text lessons and merging them with visual features, we establish a context graph from texts and images, and propose a new module f-GCN based on graph con- volutional networks (GCN). Second, scien- tific terms are not spread over the chapters and subjects are split in the TQA dataset. To overcome this so called 'out-of-domain' is- sue, before learning QA problems, we intro- duce a novel self-supervised open-set learn- ing process without any annotations. The ex- perimental results show that our model signifi- cantly outperforms prior state-of-the-art meth- ods. Moreover, ablation studies validate that both methods of incorporating f-GCN for ex- tracting knowledge from multi-modal contexts and our newly proposed self-supervised learn- ing process are effective for TQA problems. Introduction 1 In a decade, question answering (QA) has been one of the most promising achievements in the field of natural language processing (NLP). Fur- thermore, it has shown great potential to be ap- plied to real-world problems. In order to solve more realistic QA problems, types in datasets have evolved into various combinations. Recently, Visual Question Answering (VQA) has drawn huge attractions as it is in the intersection input * Equal contribution. † Corresponding author. This work was supported by Next-Generation Information Computing Development Program through the National Re- search Foundation of Korea (NRF-2017M3C4A7078547). 3Search&Clova, Naver Corp. [email protected] Figure 1: Examples of the textbook question answering task and a brief concept of our work. In this figure, we can see lessons which contain long essays and diagrams in the TQA. Related questions are also illustrated. With a self-supervised method, our model can comprehend contexts converted into context graphs in training and validation sets. Then it learns to solve questions only in the training set in a supervised manner. Input Type Context Part Question Part Text Image Text Image Context QA ◦ - ◦ - Visual QA - ◦ ◦ - Textbook QA ◦ ◦ ◦ ◦ Table 1: Comparison of data types in context and ques- tion parts for context QA, VQA and TQA. It shows that the data format of the TQA task is the most complicated on both of context and question parts. of vision and language. However, the Textbook Question Answering (TQA) is a more complex and more realistic problem as shown in Table 1. Compared to context QA and VQA, the TQA uses both text and image inputs in both the context and the question. The TQA task can describe the real-life pro- cess of a student who learns new knowledge from books and practices to solve related problems (Figure 1). It also has several novel characteris- tics as a realistic dataset. Since the TQA contains visual contents as well as textual contents, it re- quires to solve multi-modal QA. Moreover, for- Nucleic acid classificationfuction of nucleic acid DNA stores genetic information in the cells of all living things. It contains the genetic code. This is the code that instructs cells how to make proteins.nucleotideRNA consists of just one chain of nucleotides. DNA consists of two chains. Nitrogen bases on the two chains of DNA form hydrogen bonds with each other. Hydrogen bonds are relatively weak bonds that form between a positively charged hydrogen atom in one molecule and a negatively charged atom in another molecule.Context GraphQuestionsnitrogen bases in dna includea) adenine.b) uracil.c) ribose.d) two of the aboveWhat is the term for connected sugar, phosphate group and protein?a) hydrogen bondb) deoxyribosec) nucleotided) sugar-phosphate backboneComprehend+SolveLESSONTraining SetValidation SetTraining Set mats of questions are various which include both text-related questions and diagram-related ques- tions. In this paper, we focus on the following two major characteristics of the TQA dataset (Kemb- havi et al., 2017). First, compared to other QA datasets, the con- text part of TQA has more complexity in the as- pect of data format and length. Multi-modality of context exists even in non-diagram questions and it requires to comprehend long lessons to ob- tain knowledge. Therefore, it is important to ex- tract exact knowledge from long texts and arbi- trary images. We establish a multi-modal context graph and propose a novel module based on graph convolution networks (GCN) (Kipf and Welling, 2016) to extract proper knowledge for solving questions. Next, various topics and subjects in the text- books are spread over chapters and lessons, and most of the knowledge and terminology do not overlap between chapters and subjects are split. Therefore, it is very difficult to solve problems on subjects that have not been studied before. To resolve this problem, we encourage our model to learn novel concepts and terms in a self-supervised manner before learning to solve specific questions. Our main contributions can be summarized as follows: • We propose a novel architecture which can solve TQA problems that have the highest level of multi-modality. • We suggest a fusion GCN (f-GCN) to extract knowledge feature from the multi-modal con- text graph of long lessons and images in the textbook. • We introduce a novel self-supervised learn- ing process into TQA training to comprehend open-set dataset to tackle the out-of-domain issues. With the proposed model, we could obtain the state-of-the-art performance on TQA dataset, which shows a large margin compared with the current state-of-the-art methods. 2 Related Work 2.1 Context question answering Context question answering, also known as ma- chine reading comprehension, is a challenging Figure 2: Analysis of contexts in TQA and SQuAD datasets. task which requires a machine not only to com- prehend natural language but also to reason how to answer the asked question correctly. Large amount of datasets such as MCTest (Richardson et al., 2013), SQuAD (Rajpurkar et al., 2016) or MS Marco (Nguyen et al., 2016) have contributed sig- nificantly to the textual reasoning via deep learn- ing approaches. These datasets, however, are re- stricted to a small set of contents and contain only uni-modal problems requiring only textual information. In addition, these sets require rela- tively less complex parsing and reasoning com- pared to TQA dataset (Kembhavi et al., 2017). In this study, we tackle TQA, the practical middle school science problems across multiple modali- ties, by transforming long essays into customized graphs for solving the questions on a textbook. 2.2 Visual question answering As the intersection of computer vision, NLP and reasoning, visual question answering has drawn attention in the last few years. Most of pioneer- ing works in this area (Xu and Saenko, 2016; Yang et al., 2016; Lu et al., 2016) are to learn a joint image-question embedding to identify cor- rect answers where the context is proposed by images alone. Then, various attention algorithms have been mainly developed in this field and meth- ods of fusing textual and visual information such as bilinear pooling (Fukui et al., 2016; Yu et al.) have also been widely studied. Thereafter, datasets focusing on slightly different purposes have been proposed. For instance, CLEVR (Johnson et al., 2017) encouraged to solve the visual grounding problem and AI2D (Kembhavi et al., 2016) sug- gested a new type of data for knowledge extrac- tion from diagrams. In this paper, we incorpo- rate UDPnet (Kim et al., 2018) to extract knowl- edge from diagram parsing graph in the textbook. Recent researches (Teney et al., 2017; Norcliffe- 134 668 - 200 400 600 800 SQuAD TQA0.84 0.79 0.76 0.78 0.80 0.82 0.84 0.86 SQuAD TQAa)Average length of contextsb) Ratio of words in valsetthat appear in trainset Figure 3: Overall framework of our model: (a) The preparation step for the k-th answer among n candidates. The context m is determined by TF-IDF score with the question and the k-th answer. Then, the context m is converted to a context graph m. The question and the k-th answer are also embedded by GloVe and character embedding. This step is repeated for n candidates. (b) The embedding step uses RN NC as a sequence embedding module and f-GCN as a graph embedding module. With attention methods, we can obtain combined features. After concatenation, RN NS and the fully connected module predict final distribution in the solving step. Brown et al., 2018) also have dealt with graph structure to solve VQA problems. 3 Problem Formally, our problem can be defined as follows: a = argmax a∈Ωa p(aC, q; θ) (1) where C is given contexts which consist of tex- tual and visual contents and q is a given question which can contain question diagrams for diagram problems. θ denotes the trainable parameters. With given C and q, we are to predict the best answer a among a set of possible answers Ωa. The TQA contexts contain almost all items in textbooks: topic essay, diagrams and images, lesson summaries, vocabularies, and instructional videos. Among them, we mainly use topic essay as textual contexts and diagrams as visual contexts. Among various issues, the first problem we tackle is the complexity of contexts and variety in data formats as shown in Table 1. Especially, analysis of textual context in Figure 2(a) shows that the average length of contexts in the TQA is 668 words which is almost 5 times larger than that of the SQuAD which has 134 words on av- erage. Also, in (Kembhavi et al., 2017), analy- sis of information scope in TQA dataset provides two important clues that about 80% of text ques- tions only need 1 paragraph and about 80% of di- agram questions only need 1 context image and 1 paragraph. Due to those evidences, we need to add an information retrieval step such as TF-IDF (term frequency -- inverse document frequency) to narrow down scope of contexts from a lesson to a paragraph, which significantly reduces the com- plexity of a problem. Moreover, a graph structure can be suitable to represent logical relations be- tween scientific terms and to merge them with vi- sual contexts from diagrams. As a result, we de- cide to build a multi-modal context graph and ob- tain knowledge features from it. In Figure 2(b), we obtain the percentage of how much the terms in the validation set are appear- ing in the training set. Obviously, the ratio of the TQA (79%) is lower than that of the SQuAD (84%) which can induce out-of-vocabulary and domain problems more seriously in the TQA task. To avoid aforementioned issues, we apply a novel self-supervised learning process before learning to solve questions. 4 Proposed Method Figure 3 illustrates our overall framework which consists of three steps. In a preparation step, we use TF-IDF to select the paragraph most relevant to the given question or candidate answers. Then, we convert it into two types of context graphs for text and image, respectively. In the embedding step, we exploit an RNN (denoted as RNNC in the figure) to embed textual inputs, a question and an answer candidate. Then, we incorporate f-GCN to extract graph features from both the visual and the textual context graphs. After repeating previous steps for each answer candidate, we can stack each Diagramsa) Preparation step for k-th answer among n candidateTF-IDFcontext 1context 2context 33) Answer k2) Questionf-GCNRNNRNNMAX POOLMAX POOLATTENTIONATTENTIONCONCATFCY1 ... Yk Yncontext mTF-IDFDependency Parsingb) Embedding step and Solving stepTop-1FilterbyanchornodesQuestionAnswer kGloVe+Char_embGloVe+Char_embcc k thRNNsTextImageDiagram Parsing4) VisualContext Graph m5) TextualContext Graph mDiagram Parsing1) Diagram Graph*GCN*ATTENTION*ImageTextContext PartQuestion PartDependency TreeDiagram 4.1.2 Graph Understanding using f-GCN Next, we propose f-GCN to extract combined graph features for visual and textual context graphs as shown in Figure 4. Each of context graphs has its own graph matrix C containing node features and a normalized adjacency matrix which are used as inputs of a GCN to comprehend the contexts. Here, the graph matrix C is composed of the word embeddings and the character represen- tation. First, we extract propagated graph features from both of context graphs based on one-layer GCN as c =f (Ct,At) = σ(AtCtW t) H t c =f (Cd,Ad) = σ(AdCdW d), H d (2) where At and Ad are the adjacency matrices for the text and visual contexts, W t and W d are learn- ing parameters of linear layer for the text and vi- sual contexts, and the element-wise operation σ is the tanh activation function. After that, we use dot product function to get at- tention matrix Z of visual context H d c against tex- tual context H t c which contains main knowledge. Then we concatenate features of textual context c to get entire context H t features, c and weighted sum ZT H d H 1 c = [H t c; ZT H d c ], (3) where [· ; ·] is the concatenation operator. Com- pared to the textual-context-only case, we can ob- tain double-sized features which can be more in- formative. Finally, we use a GCN again to propa- gate over entire features of context graphs: H 2 c =f (H 1 c ,At) = σ(AtH 1 c W c). (4) We denote this module except the last GCN as f- GCN1 (eq. (3)) and the whole module including the last GCN as f-GCN2 (eq. (4)). 4.2 Multi-modal Problem Solving The f-GCN and RNNs are used to embed the con- texts and answer the questions as shown in Figure 3(b). Two different RNNs are used in our archi- tecture. One is the comprehending RNN (RNNC) which can understand questions and candidate an- swers and the other is the solving RNN (RNNS) which can answer the questions. The input of the RNNC is comprised of the word embedding, character representation and the occurrence flag for both questions and candidate answers. In word embedding, each word can be Figure 4: Illustration of f-GCN. Both of textual and vi- sual contexts are converted into H d c. With atten- tion methods, we obtain combined features of H t c and c (f-GCN1). Finally, we use GCN again to propagate H d over entire features of context graphs (f-GCN2). c and H t of concatenated features from the embedding step. We exploit another RNN (RNNS) to cope with the variable number of answer candidates which varies from 2 to 7 that can have sequential rela- tions such as "none of the above" or "all of the above" in the last choice. Final fully connected layers decide probabilities of answer candidates. Note that notation policies are included in the sup- plementary. 4.1 Multi-modal Context Graph Understanding 4.1.1 Visual and Textual Context graphs For the visual contexts and the question diagrams, we build a visual context graph using UDPnet (Kim et al., 2018). We obtain names, counts, and relations of entities in diagrams. Then we can es- tablish edges between related entities. Only for question diagrams, we use counts of entities trans- formed in the form of a sentence such as "There are 5 objects" or "There are 6 stages". We build the textual context graphs using some parts of the lesson where the questions can focus on solving problems as follows. Each lesson can be divided into multiple paragraphs and we extract one paragraph which has the highest TF-IDF score using a concatenation of the question and one of the candidate answers (leftmost of Figure 3(a)). Then, we build the dependency trees of the extracted paragraph utilizing the Stanford depen- dency parser (Manning et al., 2014), and designate the words which exist in the question and the can- didate answer as anchor nodes. The nodes which have more than two levels of depth difference with anchor nodes are removed and we build the tex- tual context graphs using the remaining nodes and edges (Process 1 in the supplementary). Visual Context GraphTextual Context GraphGCNGCNAttentionGCNFused Graph RepresentationWeighted SumHtHdHccc represented as eqi/eai by using a pre-trained word embedding method such as GloVe (Pennington et al., 2014). The character representation cqi/cai is calculated by feeding randomly initialized charac- ter embeddings into a CNN with the max-pooling operation. The occurrence flag fqi/fai indicates whether the word occurs in the contexts or not. Our final input representation qw for the question i word qi in RNNC is composed of three compo- nents as follows: eqi =Emb(qi), cqi = Char-CNN(qi) qw i = [eqi; cqi; fqi]. (5) The input representation for the candidate answers is also obtained in the same way as the one for the question. Here, Emb is the trainable word embed- dings and Char-CNN is the character-level convo- lutional network. To extract proper representations for the questions and candidate answers, we ap- ply the step-wise max-pooling operation over the RNNC hidden features. Given each of the question and the candidate an- swer representations, we use an attention mecha- nism to focus on the relevant parts of the contexts for solving the problem correctly. The attentive in- formation Attq of the question representation hq against the context features Hc as in (3) or (4) is calculated as follows: (cid:80)K exp(gk) i=1 exp(gi) , (6) K(cid:88) k=1 Attq = αkHck , αk = gk = hT q MHck . Here, K is the number of words in the con- text C which equals the dimension of the square adjacency matrix A. M is the attention matrix that converts the question into the context space. The attentive information of the candidate answers Atta is calculated similar to Attq. RNNS can solve the problems and its input con- sists of the representations of the question and the candidate answer with their attentive information on the contexts as: (7) RN NS q; Attc a], q; Attc a; Attqd = [hq; ha; Attc = [hq; ha; Attc q ; Attqd a ] is for the text questions and I d I t RN NS I d RN NS where I t RN NS is for the diagram questions. Finally, based on the outputs of RNNS, we use one fully-connected layer followed by a softmax function to obtain a probability distribution of each candidate answer and optimize those with cross-entropy loss. Figure 5: Self-supervised open-set comprehension step in our model. We set contexts as candidates we should predict for the question and the k-th answer. For each answer, we obtain n context candidates from TF-IDF methods and set the top-1 candidate as the correct con- text. While we use the same structure as in Figure 3, we can predict final distribution after all the steps. 4.3 Self-supervised open-set comprehension To comprehend out-of-domain contexts, we pro- pose a self-supervised prior learning method as shown in Figure 5. While we exploit the same ar- chitecture described in the previous section, we have reversed the role of the candidate answer and the contexts in (1) as a self-supervised one. In other words, we set the problem as inferring the Top-1 context for the chosen answer candidate. We assume TF-IDF to be quite reliable in measur- ing closeness between texts. The newly defined self-supervised problem can be formalized as follows: c = argmax c∈Ωc p(cAk, q; θ) (8) where Ak is given k-th answer candidate among n candidates and q is the given question. Then we infer the most related context c among a set of con- texts Ωc in a lesson. For each candidate answer Ak(k = 1, .., n), we get the set of paragraphs Ωc of size j from the cor- responding context. Here, Ωc is obtained by cal- culating TF-IDF between [q; Ak] and each para- graph ω, i.e., Tω = tf-idf([q; Ak], ω), and select- ing the top-j paragraphs. Among the j paragraphs ωi(i = 1,··· , j) in Ωc, the one with the highest TF-IDF score is set as the ground truth: (cid:40) yi = 1, 0, if ωi = argmaxω∈Ωc Tω, otherwise. (9) With Ak, q and ωi ∈ Ωc, we conduct the same process in eq. (2-7) to obtain the i-th input of the context Top-1context mTop-2context Top-nTF-IDFTop-1 is correctContextGraph mSame structure as normal trainingDiagramscontext 1context 2context 3QuestionAnswer kTextImageImageTextContext PartQuestion Partf-GCNRNNRNNMAX POOLMAX POOLATTENTIONATTENTIONCONCATFCY1 ... Yk Yncc k thRNNsGCN*ATTENTION* Model Random MemN+VQA (Kembhavi et al., 2017) MemN+DPG (Kembhavi et al., 2017) BiDAF+DPG (Kembhavi et al., 2017) Challenge IGMN (Li et al., 2018) Our full model w/o visual context Our full model w/ f-GCN2 Our full model w/o SSOC(VAL) w/o SSOC(TR+VAL) w/o f-GCN & SSOC(TR+VAL) Text T/F Text MC Text All Diagram 50.10 50.50 50.50 50.40 22.88 31.05 30.98 30.46 24.96 31.82 32.83 32.72 35.85 36.35 36.61 37.72 37.61 37.47 36.61 35.67 All 29.08 35.11 35.62 35.39 40.48 41.36 45.06 45.52 45.77 45.39 43.97 42.74 33.62 38.73 38.69 38.33 45.57 46.88 54.35 54.11 54.75 54.11 52.06 50.51 - 57.41 62.32 62.22 62.73 62.22 60.02 58.72 - 40.00 49.15 48.76 49.54 48.82 46.86 45.16 Table 2: Comparison of performance with previous methods (Top) and results of ablation studies (Bottom). We demonstrate the accuracies of each type of questions, Text T/F (true-false in text only), Text MC (multiple-choices in text only), Text all (all in text only), Diagram and All. Note that previous methods only used textual context. RN NS RN NS RN NS, I i . After repeating it j times, we put , (i = 1··· , j) into RN NS sequen- all I i tially and optimize this step with the cross-entropy loss. We repeatedly choose all answer candidates Ak, and conduct the same process in this step. With this pre-training stage which shares pa- rameters with the supervised stage, we expect that our model can deal with almost all contexts in a lesson. Moreover, it becomes possible to learn contexts in the validation set or the test set with a self-supervised manner. This step is analogous to a student who reads and understands a textbook and problems in advance. 5 Experiments 5.1 Dataset We perform experiments on the TQA dataset, which consists of 1,076 lessons from Life Sci- ence, Earth Science and Physical Science text- books. While the dataset contains 78,338 sen- tences and 3,455 images including diagrams, it also has 26,260 questions with 12,567 of them having an accompanying diagram, split into train- ing, validation and test at a lesson level. The train- ing set consists of 666 lessons and 15,154 ques- tions, the validation set consists of 200 lessons and 5,309 questions and the test set consists of 210 lessons and 5,797 questions. Since evaluation for test is hidden, we only use the validation set to evaluate our methods. 5.2 Baselines We compare our method with several recent meth- ods as followings: • MemN+VQA, MemN+DPG Both exploits Memory networks to embed texts in lessons and questions. First method uses VQA approaches for diagram questions, and the second one exploits Di- agram Parse Graph (DPG) as context graph on dia- grams built by DsDP-net (Kembhavi et al., 2016). • BiDAF+DPG It incorporates BiDAF (Bi- directional Attention Flow Network) (Seo et al., 2016), a recent machine comprehension model which exploits a bidirectional attention mecha- nism to capture dependencies between question and corresponding context paragraph. For above 3 models, we use experimental re- sults newly reported in (Li et al., 2018). • Challenge This is the one that obtained the top results in TQA competition (Kembhavi et al., 2017). The results in the table are mixed with each of top score in the text-question track and the diagram-question track. • IGMN It uses the Instructor Guidance with Memory Nets (IGMN) based on Contradiction Entity-Relationship Graph (CERG). For diagram questions, it only recognizes texts in diagrams. • Our full model w/o visual context This method excludes visual context to compare with previous methods on the same condition. It uses only one- layer GCN for textual context and self-supervised open-set comprehension (SSOC). • Our full model w/ f-GCN2 From now, all meth- ods include visual context. This method uses f- GCN2 and SSOC. Following methods are for our ablation study: • Our full model This method uses both of our methods, f-GCN1 and SSOC on the training and the validation sets. • Our model w/o SSOC (VAL) This method only uses training set to pretrain parameters in SSOC. • Our model w/o SSOC (TR+VAL) This method eliminates whole SSOC pre-training process. It only uses f-GCN as Graph extractor and was trained only in a normal supervised learning man- ner. • Our model w/o f-GCN & SSOC (TR+VAL) This method ablates both f-GCN module and SSOC process. It replaces f-GCN as vanilla RNN, other conditions are the same. 5.3 Quantitative Results 5.3.1 Comparison of Results Overall results on TQA dataset are shown in Table 2. The results show that all variants of our model outperform other recent models in all type of ques- tion. Our best model shows about 4% higher than state-of-the-art model in overall accuracy. Espe- cially, an accuracy in text question significantly outperforms other results with about 8% margin. A result on diagram questions also shows more than 1% increase over the previous best model. We believe that our two novel proposals, context graph understanding and self-supervised open-set comprehension work well on this problem since our models achieve significant margins compared to recent researches. Even though our model w/o visual context only uses one-layer GCN for textual context, it shows better result compared to MemN+VQA and MemN+DPG with a large margin and IGMN with about 3% margin. IGMN also exploits a graph module of contraction, but ours outperforms es- pecially in both text problems, T/F and MC with over 5% margin. We believe that the graph in our method can directly represents the feature of con- text and the GCN also plays an important role in extracting the features of our graph. Our models with multi-modal contexts show significantly better results on both text and di- agram questions. Especially, results of diagram question outperform over 1% rather than our model w/o visual context. Those results indicate that f-GCN sufficiently exploits visual contexts to solve diagram questions. 5.3.2 Ablation Study We perform ablation experiments in Table 2. Our full model w/ f-GCN2 can achieve best score on diagram questions but slightly lower scores on text questions. Since the overall result of our full model records the best, we conduct ablation study of each module of it. First, we observe an apparent decrease in our model when any part of modules is elimi- Model Our model w/o SSOC 52.06 49.29 43.24 42.64 w/o q-flag w/o a-flag w/o q & a-flag Text Diagram 36.61 35.78 31.50 31.72 All 43.97 42.21 37.09 36.92 Table 3: Results of ablation study about the occurrence flags. We demonstrate the accuracies of Text only, Dia- gram, and total questions without SSOC method. nated. It is surprising that self-supervised open- set comprehension method provides an improve- ment on our model. Our full model shows about 2% higher performance than the model without SSOC(TR+VAL). It is also interesting to com- pare our full model with our model without SSOC(VAL). The results show that using the ad- ditional validation set on SSOC can improve over- all accuracy compared to using only training set. It seems to have more advantage for learning un- known dataset in advance. Our model without f-GCN & SSOC elimi- nates our two novel modules and replace GCN with vanilla RNN. That model shows 1% of per- formance degradation compared with the model without SSOC(TR+VAL) which means that it might not sufficient to deal with knowledge fea- tures with only RNN and attention module. Thus, context graph we create for each lesson could give proper representations with f-GCN module. Table 3 shows the results of ablation study about occurrence flag. All models do not use SSOC method. In (5), we concatenate three components including the occurrence flag to create question or answer representation. We found that the oc- currence flag which explicitly indicates the exis- tence of a corresponding word in the contexts has a meaningful effect. Results of all types degrade significantly as ablating occurrence flags. Espe- cially, eliminating a-flag drops accuracy about 7% which is almost 4 times higher than the decrease due to eliminating f-flag. We believe that disentan- gled features of answer candidates can mainly de- termine the results while a question feature equally affects all features of candidates. Our model with- out both flags shows the lowest results due to the loss of representational power. 5.4 Qualitative Results Figure 6 shows three qualitative results of text- type questions without visual context. We illus- trate textual contexts, questions, answer candi- dates and related subgraphs of context graphs. The first example describes a pipeline on a Figure 6: Qualitative results of text-type questions without visual context. Each example shows all items for a question in the textbook and a textual context subgraph to solve a question. And our predicted distribution for answers and ground truths are also displayed. In the subgraph, gray circles represent words in questions and blue circles represent words related to answers. Green rectangles represent relation types of the dependency graph. "molecules" and "unneeded" as anchor nodes with each word in answer candidates. Then we can eas- ily find an important term, "lysosome" in choice (a). Therfore, choice (a) has a probability close to one among 7 candidates. Figure 7 demonstrates qualitative results of di- agram questions. We exclude relation type nodes in subgraphs of the dependency tree for simplicity and also illustrate diagram parsing graphs of visual contexts and question diagram. The example in the top shows intermediate results of subgraphs on a diagram question without visual context. Even though chosen paragraph in textual context do not include "asthenosphere", graph of a question di- agram contain relation between "asthenosphere" and "lithosphere". Then our model can predict (a) as the correct answer with probability of 0.383. The bottom illustration describes the most com- plex case which has diagrams in both of context and question parts. We illustrate all subgraphs of text and diagrams. While our model can collect sufficient knowledge about cell structure on broad information scope, "cell membrane" can be cho- sen as correct answer with the highest probability. These examples demonstrate abstraction abil- ity and relationship expressiveness which can be huge advantages of graphs. Moreover, those re- sults could support that our model can explicitly interpret the process of solving multi-modal QA. 6 Conclusion In this paper, we proposed two novel methods to solve a realistic task, TQA dataset. We ex- tract knowledge features with the proposed f-GCN and conduct self-supervised learning to overcome the out-of-domain issue. Our method also demon- strates state-of-the-art results. We believe that our work can be a meaningful step in realistic multi- modal QA and solving the out-of-domain issue. Figure 7: Qualitative results of diagram-type questions. We illustrate intermediate subgraphs, and predicted distribution for answers and ground truths. T/F question. Three words, "currents", "core" and "convection" are set as anchor nodes as shown in the left of Figure 6. Within two levels of depth, we can find "outer" node which is the opposite to "inner" in the question sentence. As a result, our model predicts the true and false probabilities of this question as 0.464 and 0.536, respectively, and correctly solves this problem as a false statement. Next example is a multiple choice problem which is more complicated than T/F problem. With an- chor nodes which consist of each answer candi- date and a question such as "causes", "erosion" and "soil", the context graph can be established including nodes in two depth of graph from an- chor nodes. Among the 4 candidates, choice (d) contains the same words, "running" and "water", as our model predicts. Therefore, our model can estimate (d) as the correct answer with the high- est probability of 0.455. The last example shows a more complicated multiple choice problem. In the context graph, we set "organelle", "recycles", runoff carved channels in the soil in figure 19.1 . running water causes most soil erosion , but wind can carry soil away too . what humans do to soil makes it more or less likely to be eroded by wind or water . human actions that can increase soil erosion are described below .the main cause of soil erosion is ____Qa) wind .b) ice wedging .c) abrasion .d) running water .causesdobjcsubjrunningerosioncompoundwatersoila) 0.314 b) 0.118 c) 0.113 d) 0.455Prediction : (d)Ground Truth : (d)the dense , iron core forms the center of the earth . scientists know that the core is metal from studying metallic meteorites and the earths density . seismic waves show that the outer core is liquid , while the inner core is solid . movement within earths outer liquid iron core creates earths magnetic field . these convection currents form in the outer core because the base of the outer core is heated by the even hotter inner core .convection currents occur in the inner core .Qa) trueb) falsecurrentsformnsubjdetthesecompoundconvectiona) 0.464 b) 0.536Prediction : (b)Ground Truth : (b)a lysosome is an organelle that recycles unneeded molecules . it uses enzymes to break down the molecules into their components . then the components can be reused to make new molecules . lysosomes are like recycling centers .____organelle that recycles unneeded moleculesQa) lysosomeb) cytoskeletonc) vesicled) centrioleorganelleacl:relclnsubjlysosomedobjmoleculesrecyclesamoda) 0.913 b) 0.013 c) 0.017 d) 0.025e) 0.016 f) 0.007 g) 0.009 Prediction : (a)Ground Truth : (a)nmodcoreamodoutercaseine) plastidf) golgi apparatusg) endoplasmic reticulumunneededearthquakes are used to identify plate boundaries ( figure 6.14 ) . when earthquake locations are put on a map , they outline the plates . the movements of the plates are called plate tectonics . the lithosphere is divided into a dozen major and several minor plates . each plate is named for the continent or ocean basin it contains . some plates are made of all oceanic lithosphere . a few are all continental lithosphere .what lies exactly below the lithosphere?Qa) asthenosphere.b) volcanoes.c) trench.d) oceanic crust.lithospherea) 0.383 b) 0.232c) 0.186 d) 0.199Prediction : (a)Ground Truth : (a)fewcontinentaloceanicasthenospherelithosphereDiagramOceanicCrustthe cell membrane is like the bag holding the jell-o . it encloses the cytoplasm of the cell . it forms a barrier between the cytoplasm and the environment outside the cell . the function of the cell membrane is to protect and support the cell ...which part forms a barrier between the cytoplasm and the environment outside the cell?Qa) cell wall.b) golgi vesicles.c) cell membrane.d) golgi apparatus.cytoplasmcellevironmentbarriermembranecell wallndgplasmicribosomesDiagramDiagrama) 0.085 b) 0.025 c) 0.872 d) 0.018Prediction : (c)Ground Truth : (c)cytoplasmvacuolenuciqoiusvesiclelysosomecentriolecytoplasmmembraneprotect References Akira Fukui, Dong Huk Park, Daylen Yang, Anna Rohrbach, Trevor Darrell, and Marcus Rohrbach. 2016. Multimodal compact bilinear pooling for visual question answering and visual grounding. arXiv preprint arXiv:1606.01847. Justin Johnson, Bharath Hariharan, Laurens van der Maaten, Li Fei-Fei, C Lawrence Zitnick, and Ross Girshick. 2017. Clevr: A diagnostic dataset for compositional language and elementary visual reasoning. In Computer Vision and Pattern Recognition (CVPR), 2017 IEEE Conference on, pages 1988 -- 1997. IEEE. Aniruddha Kembhavi, Mike Salvato, Eric Kolve, Minjoon Seo, Hannaneh Hajishirzi, and Ali Farhadi. 2016. A di- agram is worth a dozen images. In European Conference on Computer Vision, pages 235 -- 251. Springer. Aniruddha Kembhavi, Minjoon Seo, Dustin Schwenk, Jonghyun Choi, Ali Farhadi, and Hannaneh Hajishirzi. 2017. Are you smarter than a sixth grader? textbook ques- tion answering for multimodal machine comprehension. In 2017 IEEE Conference on Computer Vision and Pat- tern Recognition (CVPR), pages 5376 -- 5384. IEEE. Daesik Kim, YoungJoon Yoo, Jee-Soo Kim, SangKuk Lee, and Nojun Kwak. 2018. Dynamic graph generation net- work: Generating relational knowledge from diagrams. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR). Thomas N Kipf and Max Welling. 2016. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907. Juzheng Li, Hang Su, Jun Zhu, Siyu Wang, and Bo Zhang. 2018. Textbook question answering under instructor guid- ance with memory networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3655 -- 3663. Jiasen Lu, Jianwei Yang, Dhruv Batra, and Devi Parikh. 2016. Hierarchical question-image co-attention for visual ques- tion answering. In Advances In Neural Information Pro- cessing Systems, pages 289 -- 297. Christopher Manning, Mihai Surdeanu, John Bauer, Jenny Finkel, Steven Bethard, and David McClosky. 2014. The stanford corenlp natural language processing toolkit. In Proceedings of 52nd annual meeting of the association for computational linguistics: system demonstrations, pages 55 -- 60. Tri Nguyen, Mir Rosenberg, Xia Song, Jianfeng Gao, Saurabh Tiwary, Rangan Majumder, and Li Deng. 2016. Ms marco: A human generated machine reading compre- hension dataset. arXiv preprint arXiv:1611.09268. Will Norcliffe-Brown, Stathis Vafeias, and Sarah Parisot. 2018. Learning conditioned graph structures for inter- pretable visual question answering. In Advances in Neural Information Processing Systems, pages 8344 -- 8353. Jeffrey Pennington, Richard Socher, and Christopher Man- ning. 2014. Glove: Global vectors for word representa- tion. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pages 1532 -- 1543. Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. Squad: 100,000+ questions for machine comprehension of text. arXiv preprint arXiv:1606.05250. Matthew Richardson, Christopher JC Burges, and Erin Ren- shaw. 2013. Mctest: A challenge dataset for the open- domain machine comprehension of text. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 193 -- 203. Minjoon Seo, Aniruddha Kembhavi, Ali Farhadi, and Bidirectional attention arXiv preprint Hannaneh Hajishirzi. 2016. flow for machine comprehension. arXiv:1611.01603. Damien Teney, Lingqiao Liu, and Anton van den Hengel. 2017. Graph-structured representations for visual ques- tion answering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1 -- 9. Huijuan Xu and Kate Saenko. 2016. Ask, attend and an- swer: Exploring question-guided spatial attention for vi- In European Conference on sual question answering. Computer Vision, pages 451 -- 466. Springer. Zichao Yang, Xiaodong He, Jianfeng Gao, Li Deng, and Alex Smola. 2016. Stacked attention networks for image ques- tion answering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 21 -- 29. Zhou Yu, Jun Yu, Jianping Fan, and Dacheng Tao. Multi- modal factorized bilinear pooling with co-attention learn- ing for visual question answering. A Notations 1, qd 1, ct 1, qt 1, cd l/cd 2,··· , qt 2,··· , qd 2,··· , ct We denote the question text, question diagram, candidate answer, text context and diagram I}, Qd = context as Qt = {qt J}, A = {a1, a2,··· , aK}, Ct = {qd 2,··· , cd L}, and Cd = {cd {ct M}, the respectively where j /ak/ct m is i/qd qt ith/jth/kth/lth/mth word of the question text Qt and the question diagram Qd, candidate answer A, text context Ct and diagram context Cd (C is unified notation for the Ct and Cd). The corresponding representations are denoted as c , respectively. Note that we q,hd ht use the diagram context Cd only in the diagram questions. q, ha, H t c and H d B Implementation Details We initialized word embedding with 300d GloVe vectors pre-trained from the 840B Common Crawl corpus, while the word embeddings for the out- of-vocabulary words were initialized randomly. We also randomly initialized character embed- ding with a 16d vector and extracted 32d char- acter representation with a 1D convolutional net- work. And the 1D convolution kernel size is 5. We used 200 hidden units of Bi-LSTM for the RNNc whose weights are shared between the question Model Our full model w/o visual context w/o UTC(VAL) w/o UTC(TR+VAL) w/o GCN & UTC(TR+VAL) Our full model w/ f-GCN2 w/o UTC(VAL) w/o UTC(TR+VAL) w/o GCN & UTC(TR+VAL) Text T/F Text MC Text All Diagram 62.32 36.61 36.53 60.82 36.57 60.72 35.2 58.62 62.22 37.72 37.32 62.63 36.71 61.42 58.72 35.67 54.35 53.72 52.02 50.24 54.11 54.03 52.49 50.51 49.15 49.08 46.34 44.77 48.76 48.43 46.67 45.16 All 45.06 44.72 43.93 42.36 45.52 45.28 44.22 42.74 Table 4: Results of additional ablation studies. We demonstrate the accuracies of each type of questions: Text T/F (true-false in text only), Text MC (multiple-choices in text only), Text all (all in text only), Diagram and All (total questions). Results of our full model without visual context are on the top of the table and results of our full model with f-GCN2 are in the bottom. and the candidate answers. The maximum se- quence length of them is set to 30. Likewise, the number of hidden units of the RNNs is the same as the RNNc and the maximum sequence length is 7 which is the same as the number of the maxi- mum candidate answers. We employed 200d one layer GCN for all types of graphs, and the num- ber of maximum nodes is 75 for the textual con- text graph, 35 for the diagrammatic context graph, and 25 for the diagrammatic question graph, re- spectively. We use tanh for the activation func- tion of the GCN. The dropout was applied after all of the word embeddings with a keep rate of 0.5. The Adam optimizer with an initial learning rate of 0.001 was applied, and the learning rate was decreased by a factor of 0.9 after each epoch. Figure 8: Additional examples of SSOC steps. C Additional explanation for SSOC In Figure 8, we illustrate examples about detailed steps of SSOC. In the first step, we select one can- didate answer from question-candidate answers pairs (2). Next, we choose a number j, the num- ber of candidate contexts for the pair of question- candidate answer, in the range 2 to 7 like the orig- inal dataset (3). If j is higher than the number of contexts in the lesson, we set j to be the number of contexts. Then, we extract top j paragraphs using the TF-IDF scores to set them as candidate con- texts Ωc (3). We build each context graph in the same way as the original method and get embed- dings with the question-candidate answer pair we selected. Finally, we designate the final candidate which connects to the top 1 paragraph as a correct answer, and others as wrong answers (4). D Results of additional ablation study We perform additional ablation studies for variants of our model. For both our full model without vi- sual context and our full model with f-GCN2, re- sults of ablation studies are shown in Table 4. Both studies seem to demonstrate similar tendency as performances are degraded for ablating each mod- ule. We can conclude that our two novel modules have sufficient contributions to improve the per- formance our model in the TQA problem. E Process of Building Textual Context Graph The procedure for converting the textual context into the graph structures is shown in Process 1. After constructing the dependency trees, we set the nodes included in the question or the candidate answer as anchor nodes and built the final context graph C by removing the nodes which have more than two levels of depth difference with anchor nodes. We also constructed the adjacency matrix A using the remaining nodes and edges. 1. Select one sample from datasetQ. Wegeners idea is correctly referred to asa1. the continental drift hypothesisa2. the continental drift theorya3. the plate tectonics hypothesisa4. the plate tectonics theory2. We select one candidate answer from question-candidate pairs in the first stepQ. Wegeners idea is correctly referred to asa1. the continental drift hypothesis3. Next, we choose a number j which is the number of new candidate contexts answers. Then we extract Top - j paragraphs from the lesson according to TF-IDF scores. (e.g. j=3) Paragraph 1Paragraph 2Paragraph 34. We designate the candidate answer which connect to the top-1 paragraph as a correct answer, and others as wrong answers. Paragraph 1Paragraph 2Paragraph 3Top-1Top-2Top-3TF-IDFCorrectQ+a1+Q+a1+Q+a1+Q. Wegeners idea is correctly referred to asa1. the continental drift hypothesis Process 1 Build textual context and adjacency ma- trices C, A Input: a paragraph, a set of anchor nodes V 1: Construct a dependency tree on each sentence of the given paragraph 2: Split the tree into multiple units each of which represents two nodes and one edge u = {v1, v2} 3: U ← a set of units 4: E ← an empty set of edges 5: for depth ← 1 to 2 do for all nodes v ∈ V do 6: 7: if v ∈ u then 8: 9: 10: 11: 12: 13: 14: end for for all units u ∈ U do E ← E ∪ {u} end for V ← a set of all nodes in E end if end for Output: context matrix C from V with em- bedding matrices, adjacency matrix A from E F Additional Qualitative Results In next pages, we present additional qualitative results of questions in three types. We explicitly demonstrates all intermediate results as subgraphs of visual context and question diagram. Note that we add a legend that indicates which types of data are used in this figure to avoid confusion. In Fig- ure 9 and Figure 10, we illustrate intermediate and final results on text-type question with visual con- text. Next, we demonstrate intermediate and final results on diagram-type question without visual context in Figure 11 and Figure 12. Finally, we present intermediate and final results of the most complicated type, diagram-type question with vi- sual context in Figure 13 and Figure 14. We hope the logical connectivity for solving the problem and how our model works well on the TQA prob- lem are sufficiently understood with those figures. Figure 9: Additional qualitative results on text-type question with visual context. For both examples, a pipeline from visual context to visual context graph is shown. Gray circles represent words in questions and blue circles represent words related to answers. DiagramPrediction : (d) Ground Truth : (d)[["continental", "thospheve"], ["convectlon", "cell"], ["oceanic", "lithosphere"], ["mid", "oceanic", "ridge"], ["outer", "core"], ["subduction"], ["inner", "core"], ["mantle"], ["trench"], ["ho"], ["ocean"], ["there", "are", "11", "objects"], ["there", "are", "2", "stages"]]convection within the earths mantle causes the plates to move . mantle material is heated above the core . the hot mantle rises up towards the surface ( figure 6.16 ) . as the mantle rises it cools . at the surface the material moves horizontally away from a mid-ocean ridge crest . the material continues to cool . it sinks back down into the mantle at a deep sea trench . the material sinks back down to the core . it moves horizontally again , completing a convection cell .plates move over earths surface because of _________Qa) conduction within the crust.b) radiation from the inner core.c) subduction in the outer core.d) convection within the mantle.ContextQuestionmovecausesplatesmoveconvectiontoa) 0.07 b) 0.089 c) 0.083 d) 0.758thospheveDiagramParsingTextual Context graphVisualContext graphDiagram[["slump"], ["a"], ["a"], ["there", "are", "3", "objects"]]slump is the sudden movement of large blocks of rock and soil down a slope . you can see how it happens in figure 10.32 . all the material moves together in big chunks . slump may be caused by a layer of slippery , wet clay underneath the rock and soil on a hillside . or it may occur when a river undercuts a slope . slump leaves behind crescent-shaped scars on the hillside .sudden movement of a large block of rock and soil down a slopeQa) creepb) mass movement.c) landslide.d) slump.e) mudslide.f) gravityContextQuestionsuddenmovementblockslargeslumpisa) 0.06 b) 0.055 c) 0.005 d) 0.919 e) 0.006 f) 0.008slumpf-GCNDiagramParsingTextual Context graphVisualContext graphPrediction : (d) Ground Truth : (d)f-GCNcontinentalconvectionoceanicoutcorelithospherecellContext TextImageTextImageQuestion Figure 10: Additional qualitative results on text-type question with visual context. For both examples, a pipeline from visual context to visual context graph is shown. Gray circles represent words in questions and blue circles represent words related to answers. DiagramPrediction : (d) Ground Truth : (d)[["osculum", "excurrent", "pore"], ["amebocyte"], ["spicule"], ["sporocyte"], ["seculum"], ["rwater", "flow"], ["lchoanocy", "te", "collar", "cell"], ["there", "are", "7", "objects"], ["there", "are", "6", "stages"]]___opening through which water flows out of a spongeQa) porocyte.b) coral reef.c) spicule.d) osculum.ContextQuestionosculumcalledflowsopeningthroughthea) 0.014 b) 0.008 c) 0.017 d) 0.918a) 0.011 b) 0.021 c) 0.011DiagramParsingTextual Context graphVisualContext graphDiagram[["compounc", "or", "moleculc"], ["tissue"], ["organelle"], ["organ"], ["levels", "of", "organizatior"], ["atoms"], ["organism"], ["cell"], ["there", "are", "9", "objects"]]______structure composed of two or more types of tissues that work together to do a specific taskQContextQuestiontissuesstructurecomposedtypesorganaa) 0.144 b) 0.042 c) 0.709 d) 0.022 e) 0.027 f) 0.028 g)0.028f-GCNDiagramParsingTextual Context graphVisualContext graphPrediction : (c) Ground Truth : (c)sponges have several different types of specialized cells , although they lack tissues . you can see the basic sponge body plan and specialized cells in figure 12.4 . as water flows through the sponge , oxygen diffuses from the water to the sponges cells . the cells also expel wastes into the water . the water then flows out of the sponge through an opening called the osculum .e) porifera.f) amebocyte.g) cnidaria.spiculeseculumosculumamebocytesporocyteporeexcurrentspongecells and organelles are made of biochemical molecules . these include nucleic acids and proteins . molecules , in turn , are made of atoms . figure 3.6 shows these different levels of organization in living things . tissues may be organized into organs . an organ is a structure composed of two or more types of tissue that work together to do a specific task . for example , the heart is an organ . it consists of muscle , nerve , and other types of tissues . its task is to pump blood . organs may be organized into organ systems . a) cell membrane.b) prokaryotic cell.c) organ.d) eukaryotic cell.e) organelle.f) nucleus.g) ribosome.organorganellecompounctissueatomscellmoleculcorf-GCNContext TextImageTextImageQuestion Figure 11: Additional qualitative results on diagram-type question without visual context. For both examples, a pipeline from question diagram to question diagram graph is shown. Gray circles represent words in questions and blue circles represent words related to answers. DiagramPrediction : (c) Ground Truth : (c)[["volcano", "links", "to", "continental", "crust"], ["oceanic", "crust", "links", "to", "continental", "crust"], ["continental", "crust"], ["volcano"], ["mountam", "rangef", "l"], ["aerriding", "1", "plate"], ["trench"], ["asthenosphere"], ["oceanic", "crust"],["subducting", "plate"],["there", "are", "12", "objects"] ]a) mountain range.b) continental crust.ContextQuestioncrustdestroyedalwayscollisonsisoceanica) 0.036 b) 0.101 c) 0.803 d) 0.06DiagramParsingTextual Context graphQuestionDiagram graphf-GCNa convergent plate boundary forms where two plates collide . that collision can happen between a continent and oceanic crust , between two oceanic plates , or between two continents . oceanic crust is always destroyed in these collisions .c) oceanic crust.d) lithosphere.oceanicseculumcrustcrustasthenospheretrenchvolcanocontinentalGCNwhich part of the earth is always destroyed at a convergent plate boundary ?QDiagramPrediction : (a) Ground Truth : (a)[["centrosome", "matrlx", "links", "to", "centrioles"], ["centrosome", "matrlx", "links", "to", "microtllamem"], ["centrosome", "matrlx", "links", "to", "mlcrovllli"], ["microtllamem", "links", "to", "mlcrovllli"], ["microtllamem", "links", "to", "microtubule"], ["microtubule", "links", "to", "mlcrovllli"], ["plasma", "membrane", "links", "to", "nucleus"], ["plasma", "membrane", "links", "to", "nuclear", "envelope"], ["intermediate", "filaments", "links", "to", "object"], ["smooth", "endoplasmic", "reticulum", "links", "to", "nucleolus"], ["nucleolus", "links", "to", "chromatins"], ["nucleus", "links", "to", "nuclear", "envelope"], ["mitochondrion", "links", "to", "lysosome"], ["mitochondrion", "links", "to", "cytosol"], ["lysosome", "links", "to", "cytosol"], ["there", "are", "21", "objects"], ["there", "are", "20", "stages"]]a) lysosome.b) nucleus.ContextQuestionlysosomeorganellemoleculesunneededrecyclesaa) 0.962 b) 0.014 c) 0.014 d) 0.01DiagramParsingTextual Context graphQuestionDiagram grapha lysosome is an organelle that recycles unneeded molecules . it uses enzymes to break down the molecules into their components . then the components can be reused to make new molecules . lysosomes are like recycling centers .c) plasma membrane.d) chromatin.lysosomeseculummitochondrioncytosolmicrotllamemreticulumnucleoluschromatinsGCNwhich of the following is an organelle that recycles unneeded molecules ?Qf-GCNQmlcrovllliendoplasmicmicrotubulematrixsmoothContext TextImageTextImageQuestion Figure 12: Additional qualitative results on diagram-type question without visual context. For both examples, a pipeline from question diagram to question diagram graph is shown. Gray circles represent words in questions and blue circles represent words related to answers. Prediction : (d) Ground Truth : (d)[["plasma", "membrane", "links", "to", "mitochondria"], ["rough", "endoplasmic", "reticulum", "links", "to", "ribosomes"], ["nucleus"], ["plasma", "membrane"], ["cytoplasm"], ["lysosome"], ["golgi", "apparatus"], ["rough", "endoplasmic", "reticulum"], ["ribosomes"], ["smooth", "endoplasmic", "reticulum"], ["mitochondria"], ["there", "are", "10", "objects"], ["there", "are", "9", "stages"]]a) plasma membrane.b) lysosome.ContextQuestionreticulummoleculesreceivessentpackagesendoplasmica) 0.135 b) 0.069 c) 0.045 d) 0.75DiagramParsingTextual Context graphQuestionDiagram graphf-GCNthe golgi apparatus is a large organelle that sends proteins and lipids where they need to go . its like a post office . it receives molecules from the endoplasmic reticulum . it packages and labels the molecules . then it sends them where they are needed . some molecules are sent to different parts of the cell . others are sent to the cell membrane for transport out of the cell . small bits of membrane pinch off the golgi apparatus to enclose and transport the proteins and lipids . you can see a golgi apparatus at work in this animation :c) mitochondria.d) the rough endoplasmic reticulum and smooth endoplasmic reticulum.roughplasmaribosomesapparatusgolgiGCNwhere does the golgi apparatus receive molecules from ?QDiagramPrediction : (d) Ground Truth : (d)[["nucleolus", "links", "to", "nucleus"], ["cell", "membrane", "links", "to", "mitochondrion"], ["cell", "membrane", "links", "to", "cell", "wall"], ["nuclear", "membrane", "links", "to", "chloroplast"], ["nuclear", "membrane", "links", "to", "nucleus"], ["centrosome", "links", "to", "vacuole"], ["amyloplast", "links", "to", "chloroplast"], ["chloroplast", "links", "to", "nucleus"], ["nucleolus"], ["cell", "membrane"], ["nuclear", "membrane"], ["golgi", "body"], ["cytoplasm"], ["cell", "wall"], ["centrosome"], ["ribosomes"], ["amyloplast"], ["mitochondrion"], ["chloroplast"], ["vacuole"], ["rougher"], ["smoother"], ["nucleus"], ["there", "are", "15", "objects"], ["there", "are", "15", "stages"]]a) golgi body.b) ribosomes.ContextQuestioncellssupportsmembranesurroundsprotectsa) 0.048 b) 0.037 c) 0.072 d) 0.843DiagramParsingTextual Context graphQuestionDiagram graphthe cell wall is a rigid layer that surrounds the cell membrane of a plant cell . its made mainly of the complex carbohydrate called cellulose . the cell wall supports and protects the cell . the cell wall isnt solid like a brick wall . it has tiny holes in it called pores . the pores let water , nutrients , and other substances move into and out of the cell .c) vacuole.d) cell wall.cellroughercellmembranenucleusnuclearmembraneGCNwhich part surrounds and protects the cell ?f-GCNQmitochondrionamyhloplastchloroplastvacuoleDiagramreticulumendoplasmicreticulumendoplasmicsmoothmembranewallwallContext TextImageTextImageQuestion Figure 13: Additional qualitative results on diagram-type question with visual context. For both examples, pipelines from visual context and question diagram to visual context graph and question diagram graph are shown. Gray circles represent words in questions and blue circles represent words related to answers. Prediction : (b) Ground Truth : (b)[["amoeba"], ["cytoplasm"], ["food", "vacuole", "digests", "food"], ["contractile", "vacuols", "excretes", "water", "and", "waste"], ["food", "being", "engulfed", "by", "aseudopods"], ["nucleus"], ["cell", "membrane"], ["pseudopod"], ["pseudopods"], ["enchaniedleavnina", "com"], ["a"], ["there", "are", "11", "objects"], ["there", "are", "9", "stages"]]a) contractile vacuole.b) pseudopods.Questiona) 0.028 b) 0.877 c) 0.03 d) 0.065DiagramParsingQuestionDiagram graphf-GCNc) food vacuole.d) cell membrane.cellcytoplasmGCNwhat are temporary extensions of the cytoplasm ?Qpseudopodcontractile[["flagellum"], ["euglena"], ["pseudopod"], ["paramecium"], ["amoeba"], ["cilla"], ["b"], ["c"], ["a"], ["there", "are", "9", "objects"], ["there", "are", "3", "stages"]]ContextpseudopodextensioncytoplasmtemporaryareDiagramParsingTextual Context graphVisualContext graphanimal-like protists are called protozoa ( protozoan , singular ) . most protozoa consist of a single cell . protozoa are probably ancestors of animals . protozoa are like animals in two ways : 1 . protozoa are heterotrophs . heterotrophs get food by eating other organisms . some protozoa prey on bacteria . some are parasites of animals . others graze on algae . still others are decomposers that break down dead organic matter . 2 . almost all protozoa can move . they have special appendages for this purpose . you can see different types in figure 9.3 . cilia ( cilium , singular ) are short , hair-like projections . pseudopods are temporary extensions of the cytoplasm . flagella are long , whip-like structures . flagella are also found in most prokaryotes .parameciumflagellumpseudopodamoebacillaheterotrophsDiagramDiagrameuglenavacuolswaterexcretesamoebamembranenucleusPrediction : (b) Ground Truth : (b)[["nuclear", "pore", "links", "to", "nucleolus"], ["nuclear", "pore", "links", "to", "ribosomes"], ["nucleolus", "links", "to", "nucleoplasm"], ["ribosomes", "links", "to", "nucleolus"], ["heterochromatin", "links", "to", "euchromatin"], ["heterochromatin", "links", "to", "nucleolus"], ["inner", "membrane", "links", "to", "outer", "membrane"], ["nuclear", "pore"], ["nucleolus"], ["nucleoplasm"], ["ribosomes"], ["heterochromatin"], ["nuclear", "envelope"], ["chromatin"], ["iological", "diagram", "of", "a", "hum", "by", "chartsanddiagrams"], ["inner", "membrane"], ["outer", "membrane"], ["euchromatin"], ["human", "nucleus", "cell"], ["zizzle"], ["there", "are", "13", "objects"], ["there", "are", "8", "stages"]]a) 1. b) 2 . c) 3. d) 4.Questiona) 0.157 b) 0.518 c) 0.189 d) 0.136DiagramParsingQuestionDiagram graphf-GCNnucleoplasmmembraneGCN how many membrane layers are there ?Qmembranenuclear[["two", "layers", "of", "phospholipid", "molecules"], ["hydrophilic", "head"], ["hydrophobic", "tail"], ["there", "are", "3", "objects"], ["there", "are", "2", "stages"]]ContexttwomembranecytoplasmcomposedlayersDiagramParsingTextual Context graphVisualContext graphthe structure of the cell membrane explains how it can control what enters and leaves the cell . the membrane is composed mainly of two layers of phospholipids . figure 3.8 shows how the phospholipids are arranged in the cell membrane . each phospholipid molecule has a head and two tails . the heads are water loving ( hydrophilic ) , and the tails are water fearing ( hydrophobic ) . the water-loving heads are on the outer surfaces of the cell membrane . they point toward the watery cytoplasm within the cell or the watery fluid that surrounds the cell . the water-fearing tails are in the middle of the cell membrane .phospholipidtwomoleculesofphospholipidsDiagramDiagramlayersporenucleolusribosomesouterheterochromatininnerhydrophilicheadhydrophobictailstructurecellContext TextImageTextImageQuestion Figure 14: Additional qualitative results on diagram-type question with visual context. For both examples, pipelines from visual context and question diagram to visual context graph and question diagram graph are shown. Gray circles represent words in questions and blue circles represent words related to answers. Prediction : (c) Ground Truth : (c)[["anal", "pore"], ["macronucleus"], ["micronucleus"], ["food", "vacuolesf"], ["cilia"], ["there", "are", "5", "objects"], ["there", "are", "5", "stages"]]Questiona) 0.107 b) 0.188 c) 0.558 d) 0.147DiagramParsingQuestionDiagram graphf-GCNGCNwhat are the hair-like protrusions on the outside called ?Qcillaanal[["flagellum"], ["euglena"], ["pseudopod"], ["paramecium"], ["amoeba"], ["cilla"], ["b"], ["c"], ["a"], ["there", "are", "9", "objects"], ["there", "are", "3", "stages"]]Contextprojectionsarehair-likeshortDiagramParsingTextual Context graphVisualContext graphanimal-like protists are called protozoa ( protozoan , singular ) . most protozoa consist of a single cell . protozoa are probably ancestors of animals . protozoa are like animals in two ways : 1 . protozoa are heterotrophs . heterotrophs get food by eating other organisms . some protozoa prey on bacteria . some are parasites of animals . others graze on algae . still others are decomposers that break down dead organic matter . 2 . almost all protozoa can move . they have special appendages for this purpose . you can see different types in figure 9.3 . cilia ( cilium , singular ) are short , hair-like projections . pseudopods are temporary extensions of the cytoplasm . flagella are long , whip-like structures . flagella are also found in most prokaryotes .parameciumflagellumpseudopodamoebacillacillaDiagrameuglenaporefoodvacuolesmicronucleusmacronuclueusPrediction : (d) Ground Truth : (d)[["object", "links", "to", "golgi", "vesicles"], ["filamentous", "cytoskeleton", "links", "to", "jlasma", "membrane"], ["smooth", "endoplasmic", "reticulum", "links", "to", "ribosomes"], ["nucleus", "links", "to", "l", "nucleolus"], ["nucleus", "links", "to", "luclear", "envelope"], ["cell", "wall", "links", "to", "object"], ["cell", "wall", "links", "to", "jlasma", "membrane"], ["cytoplasm", "links", "to", "peroxisome"], ["l", "nucleolus", "links", "to", "luclear", "envelope"], ["tonoplast", "links", "to", "l", "vacuole"], ["object", "links", "to", "jlasma", "membrane"], ["there", "are", "21", "objects"], ["there", "are", "23", "stages"]]a) amyloplast. b) smoother . c) ribosome. d) large central vacuole.Questiona) 0.115 b) 0.155 c) 0.146 d) 0.584DiagramParsingQuestionDiagram graphf-GCNnucleoplasmmembraneGCNwhich part of the following cell takes up the most its volume ?Qmembranenuclear[["large", "central", "vacuole"], ["cell", "wall", "cellulose"], ["nucleus", "with", "nucleolus"], ["cell", "membrane"], ["smoother"], ["golgi", "body"], ["rougher"], ["mitochondria"], ["amyloplast"], ["ribosome"], ["chloroplast"], ["there", "are", "11", "objects"], ["there", "are", "9", "stages"]]ContextlargevolumehelpsvacuolecentralDiagramParsingTextual Context graphVisualContext graphmost plant cells have a large central vacuole . it can make up as much as 90 percent of a plant cells total volume . the central vacuole is like a large storage container . it may store substances such as water , enzymes , and salts . it may have other roles as well . for example , the central vacuole helps stems and leaves hold their shape . it may also contain pigments that give flowers their colors .phospholipidtwomoleculesofmostDiagramlayersporenucleolusribosomesouterheterochromatininnerhydrophilicheadhydrophobictailtotalcellsContext TextImageTextImageQuestionDiagramDiagrama) anal pore. b) macronucleus. c) cilia. d) oral groove.
1904.05078
1
1904
2019-04-10T09:16:24
From Semi-supervised to Almost-unsupervised Speech Recognition with Very-low Resource by Jointly Learning Phonetic Structures from Audio and Text Embeddings
[ "cs.CL", "cs.SD", "eess.AS" ]
Producing a large amount of annotated speech data for training ASR systems remains difficult for more than 95% of languages all over the world which are low-resourced. However, we note human babies start to learn the language by the sounds (or phonetic structures) of a small number of exemplar words, and "generalize" such knowledge to other words without hearing a large amount of data. We initiate some preliminary work in this direction. Audio Word2Vec is used to learn the phonetic structures from spoken words (signal segments), while another autoencoder is used to learn the phonetic structures from text words. The relationships among the above two can be learned jointly, or separately after the above two are well trained. This relationship can be used in speech recognition with very low resource. In the initial experiments on the TIMIT dataset, only 2.1 hours of speech data (in which 2500 spoken words were annotated and the rest unlabeled) gave a word error rate of 44.6%, and this number can be reduced to 34.2% if 4.1 hr of speech data (in which 20000 spoken words were annotated) were given. These results are not satisfactory, but a good starting point.
cs.CL
cs
From Semi-supervised to Almost-unsupervised Speech Recognition with Very-low Resource by Jointly Learning Phonetic Structures from Audio and Text Embeddings Yi-Chen Chen, Sung-Feng Huang, Hung-yi Lee, Lin-shan Lee National Taiwan University, Taiwan [email protected],[email protected], [email protected],[email protected] 9 1 0 2 r p A 0 1 ] L C . s c [ 1 v 8 7 0 5 0 . 4 0 9 1 : v i X r a Abstract Producing a large amount of annotated speech data for train- ing ASR systems remains difficult for more than 95% of lan- guages all over the world which are low-resourced. However, we note human babies start to learn the language by the sounds (or phonetic structures) of a small number of exemplar words, and "generalize" such knowledge to other words without hear- ing a large amount of data. We initiate some preliminary work in this direction. Audio Word2Vec is used to learn the phonetic structures from spoken words (signal segments), while another autoencoder is used to learn the phonetic structures from text words. The relationships among the above two can be learned jointly, or separately after the above two are well trained. This relationship can be used in speech recognition with very low resource. In the initial experiments on the TIMIT dataset, only 2.1 hours of speech data (in which 2500 spoken words were an- notated and the rest unlabeled) gave a word error rate of 44.6%, and this number can be reduced to 34.2% if 4.1 hr of speech data (in which 20000 spoken words were annotated) were given. These results are not satisfactory, but a good starting point. Index Terms: automatic speech recognition, semi-supervised 1. Introduction Automatic speech recognition (ASR) has achieved remarkable success in many applications [1, 2, 3]. However, with existing technologies, machines have to learn from a huge amount of annotated data to achieve acceptable accuracy, which makes the development of such technologies for new languages with low resource challenging. Collecting a large amount of speech data is expensive, not to mention having the data annotated. This remains true for at least 95% of languages all over the world. Substantial effort has been reported on semi-supervised ASR [4, 5, 6, 7, 8, 9, 10, 11]. However, in most cases a large amount of speech data including a good portion annotated were still needed. So training ASR systems with relatively little data, most of which are not annotated, remains to be an important but unsolved problem. Speech recognition under such "very-low" resource conditions is the target task of this paper. We note human babies start to learn the language by the sounds of a small number of exemplar words without hearing a large amount of data. They more or less learn those words by "how they sound", or the phonetic structures for the words. These exemplar words and their phonetic structures then seem to "generalize" to other words and sentences they learn later on. It is certainly highly desired if machines can do that too. In this paper we initiate some preliminary work in this direction. Audio Word2Vec was proposed to transform spoken words (signal segments for words without knowing the underlying words they represent) to vectors of fixed dimensionality [12] Figure 1: The architecture of the proposed approach. carrying information about the phonetic structures of the spo- ken words. Segmental Audio Word2Vec was further proposed to jointly segment an utterance into a sequence of spoken words and transform them into a sequence of vectors [13]. Substan- tial effort has been made to try to align such audio embeddings with word embeddings [14], which was one way to teach ma- chines to learn the words jointly with their sounds or phonetic structures. Approaches of semi-supervised end-to-end speech recognition approaches along similar directions were also re- ported recently [10, 11]. But all these works still used relatively large amount of training data. On the other hand, unsupervised phoneme recognition and almost-unsupervised word recogni- tion were recently achieved to some extent using zero or close- to-zero aligned audio and text data [15, 9], primarily by map- ping the audio embeddings with text tokens, whose "very-low" resource setting is the goal of this paper. In this work, we let the machines learn the phonetic struc- tures of words from the embedding spaces of respective spoken and text words, as well as the relationships between the two. All these can be learned jointly, or separately for spoken and text words individually followed by learning the relationships be- tween the two. It was found the former is better, and reasonable speech recognition was achievable with very low resource. In the initial experiments on the TIMIT dataset, only 2.1 hours of total speech data (in which 2500 spoken words were annotated and the rest unlabeled) gave a word error rate of 44.6%, and this number can be reduced to 34.2% if 4.1 hr of speech data (in which 20000 spoken words were annotated) were given. These results are not satisfactory, but a good starting point. Figure 2: Embedding alignment (red dotted block in middle of Figure 1) realized by transformation between two latent spaces. 2. Proposed Approach For clarity, we denote the speech corpus as X = {xi}M i=1, which consists of M spoken words, each represented as xi = (xi1 , xi2 , ..., xiT ), where xit is the acoustic feature vector at time t and T is the length of the spoken word. Each spo- ken word xi corresponds to a text word in W = {wk}N k=1, where N is the number of distinct text words in the corpus. We can represent each text word as a sequence of subword units, like phonemes or characters, and denote it as yi = (yi1 , yi2 , ..., yiL ), where yil is the one-hot vector for the lth subword and L is the number of subwords in the word. A small set of known paired data is denoted as Z = {(xj, yj)}, where (xj, yj) corresponds to the same text word. In the initial work here we focus on the joint learning of words in audio and text forms, so we assume all training spo- ken words have been properly segmented with good boundaries. Many existing approaches can be used to segment utterances into spoken words automatically [16, 17, 18, 19, 20, 21, 22, 23, 24], including the Segmental Audio Word2Vec [13] mentioned above. Extension to entire utterance input without segmentation is left for future work. A text word corresponds to many different spoken words with varying acoustic factors such as speaker or microphone characteristics, and noise. We jointly refer to all such acoustic factors as speaker characteristics below for simplicity. 2.1. Intra-domain Unsupervised Autoencoder Architecture There are three encoders and two decoders in the architecture of the proposed approach in Figure 1. We use two encoders Ep and Es to encode the phonetic structures and speaker char- acteristics of a spoken word xi into an audio phonetic vector vpa and a speaker vector vs respectively. Meanwhile, we use another encoder Et to encode the phonetic structure of a text word yi into a text phonetic vector vpt, where text words yi are represented as sequences of one-hot vectors for subwords. The audio decoder Da takes the pair (vpa, vs) as input and reconstruct the original spoken word features x(cid:48) i. The text de- coder Dt takes vpt as input and reconstruct the original text word features y(cid:48) i. Two intra-domain losses are used for unsu- pervised training: 1) Intra-domain audio reconstruction loss, which is the mean- square-error between the audio original and the reconstructed features: (cid:107)xi − Da(Ep(xi), Es(xi))(cid:107)2 2. 2) Intra-domain text reconstruction loss, which is the negative log-likelihood for the text vector sequences to be reconstructed: logP r(yiDt(Et(yi))). i 2.2. Cross-domain Reconstruction with Paired Data When the latent spaces for the phonetic structures for spoken words xi and text words yi are individually learned based on the intra-domain reconstruction losses (1)(2), they can be very Lin a r = (cid:88) Lin t r = −(cid:88) i (1) (2) different, since the former are continuous signals with varying length and behavior, while the latter are sequences of discrete symbols with given length. So here we try to learn them jointly using relatively small number of known pairs of spoken words xj and the corresponding text words yj, Z = {(xj, yj)}. Hopefully the two latent spaces can be twisted somehow and end up with a single common latent space, in which both pho- netic vectors for audio and text, vpa and vpt, can be properly represented. So two cross-domain losses below are used: 3) Cross-domain audio reconstruction loss: Lcr a r = (cid:107)xj − Da(Et(yj), Es(xj))(cid:107)2 2. (cid:88) 4) Cross-domain text reconstruction loss: logP r(yjDt(Ep(xj))). (xj ,yj )∈Z Lcr t r = − (cid:88) (xj ,yj )∈Z (3) (4) By minimizing the reconstruction loss for the audio/text fea- tures obtained with the phonetic vectors computed from input sequences in the other domain as in (3)(4), the phonetic vectors of spoken and text words can be somehow aligned to carry some consistent information about the phonetic structures. 2.3. Cross-domain Alignment of Phonetic Vectors with Paired Data On top of the cross-domain reconstruction losses (3)(4), the two latent spaces can be further aligned by a hinge loss for all known pairs of spoken and text words (xj, yj): 5) Cross-domain embedding loss: (cid:107)Ep(xj) − Et(yj)(cid:107)2 2 max(0, λ − (cid:107)Ep(xi) − Et(yj)(cid:107)2 2). (cid:88) (cid:88) (xj ,yj )∈Z (xi,yj ) /∈Z Lcr emb = + (5) In the second term of (5), for each text word yj, we randomly sample xi such that (xi, yj) /∈ Z to serve as a negative sample. In this way, the phonetic vectors corresponding to different text words can be kept far enough apart. Here in (3)(4)(5) the small number of paired spoken and text words {(xj, yj)} ∈ Z serve just as the small number of exemplar words and their sounds when human babies start to learn the language. The reconstruc- tion and alignment across the two spaces is somehow to try to "generalize" the phonetic structures of these exemplar words to other words in the language as human babies do. (6) 2.4. Joint Learning and Inference The total loss function L to be minimized during training is the weighted sum of the above five losses: L = α1Lin a r + α2Lin t r + α3Lcr a r + α4Lcr t r + α5Lcr emb During inference, for each distinct text word wk in training data, we compute its text phonetic vector (vpt )k, k = 1, ..., N. Then for each spoken word xi in testing data, we apply soft- max on the negative distance between its audio phonetic vector vpa and each text phonetic vector (vpt )k to get the posterior probability for each text word P ra(wkxi): P ra(wkxi) = (cid:80)N exp(−(cid:107)Ep(xi) − (vpt )k(cid:107)2 2) j=1 exp(−(cid:107)Ep(xi) − (vpt )j(cid:107)2 2) (7) When a large amount of unpaired text data is available, a language model can be trained and integrated into the infer- ence. Suppose the spoken word xi is the t-th spoken word in . Table 1: Word error rate (WER) (%) performance spectrum for different training data sizes and different N (number of paired words) with joint learning in (6) of Subsection 2.4. N (# of paired) 39809 20000 10000 5000 2500 1000 600 200 100 50 Total Speech Data Size (Paired plus unlabeled) 0.1hr 0.25hr 0.5hr 1.0hr 2.1hr - - - - - 65.0 65.2 69.7 77.2 82.8 - - - - 55.3 57.8 61.7 69.1 76.3 81.8 - - - 48.2 50.3 54.2 57.9 67.6 78.0 80.5 - - 42.3 44.8 47.1 51.5 56.5 68.9 78.3 80.0 - 36.6 38.4 41.0 44.6 50.2 55.4 67.4 82.8 82.1 4.1hr 32.9 34.2 36.4 38.9 42.5 48.2 54.7 67.6 78.7 85.4 an utterance u and its corresponding text word is ut. The log probability for recognition is then: log P r(ut = wkxi) = log P ra(wkxi) (8) where the first term is as in (7), and P rLM (·) is the language model score. All αi and β above are hyperparameters. + β log P rLM (ut = wk), 2.5. Cycle Consistency Regularization We can further add a cycle-consistency loss to the original loss function (6): (cid:107)xj − Da(Et(Dt(Ep(xj))), Es(xj))(cid:107)2 Lcycle = (cid:88) 2 (xj ,yj )∈Z + (cid:107)yj − Dt(Ep(Da(Et(yj), Es(xj))))(cid:107)2 2. (9) Part of the first term was shown by the dotted purple cycle in the right of Figure 1, while part of the second term was shown by the dotted blue loop in the left of the figure. 2.6. Separate Learning then Transformation Because the continuous signals of spoken words and the dis- crete symbol sequences of text words are very different, the alignment between the two latent spaces as mentioned above may not be smooth. For example, during the joint learning in (6) the cross-domain losses (3)(4)(5) inevitably disturb the intra- domain losses (1)(2) and produce distortions on the phonetic structures for the individual audio and text domains. Of course there exist a different option, i.e., training the intra-domain pho- netic structures separately for spoken and text words first, and then learn a transformation between them. This concept can be understood by replacing the red dot- ted block in the middle right of Figure 1 denoted by "Embed- ding Alignment" by that shown in Figure 2. In this way Fig- ure 1 becomes two independent autoencoders, for spoken and text words on the left and right, respectively trained with intra- domain reconstruction losses (1)(2) only, plus a set of alignment transformations Mat and Mta between the two latent spaces. In this way the phonetic structures over the spoken and text words may be better learned separately in different spaces. In the left part of Figure 1, however, a set of GAN-based [9, 25] criteria is needed to disentangle the speaker characteristics from phonetic structures (not shown in Figure 1), while in the origi- nal Figure 1 this disentanglement can be achieved with the help from the text word autoencoder. The phonetic vectors vpa and vpt separately trained are first normalized in all dimensions and projected onto their lower dimensional space by PCA. The projected vectors in the princi- Figure 3: The 2-dim display of the WER (%) performance spec- trum of Table 1 for different training data sizes (hrs), and dif- ferent N (number of paired words). The black dots are the real experimental results. The contours are produced based on lin- ear interpolation among black dots. Table 2: Comparison between Joint Learning of (6) in Subsec- tion 2.4 and Separate Learning then transformation of (10) in Subsection 2.6 for L=1,2,3 layers of GRUs, using phonemes or characters (abbrv. as "Char." in the table) as the subword units, with 4.1 hrs of data and N=39809 and 1000. L=2 31.7 47.4 L=1 32.9 48.2 L=3 31.3 47.5 L=2 67.0 72.5 Joint (with (6)) Phoneme as the subword unit N (# of paired) 39809 1000 Separate (with (10)) L=3 L=1 65.6 68.6 71.8 74.6 Char. Joint L=1 38.6 60.5 pal component spaces are respectively denoted as A = {ai}M for audio and T = {ti}N i=1 i=1 for text. The paired spoken and text words, Z = {(xj, yj)}, are denoted here as Z = {(aj, tj)}, in which aj and tj correspond to the same word. Then a pair of transformation matrices, Mat and Mta are learned, where Mat maps a vector a in A to the space of T, that is, t = Mata, while Mta maps a vector t in T to the space of A. Mat and Mta are initialized as identity matrices and then learned itera- tively with gradient descent minimizing the objective function: (cid:107)aj − Mtatj(cid:107)2 (cid:107)tj − Mataj(cid:107)2 (cid:88) Lt = 2 + +λ ((cid:107)aj − MtaMataj(cid:107)2 2 (aj ,tj )∈Z 2 + (cid:107)tj − MatMtatj(cid:107)2 2). (10) In the first two terms, we want the transformation of aj by Mat to be close to tj and vice versa. The last two terms are for cycle consistency, i.e., after transforming aj to the space of T by Mat and then transforming back by Mta, it should end up with the original aj, and vice versa. λ(cid:48) is a hyper-parameter. 3. Experimental Setup 3.1. Dataset TIMIT [26] dataset was used here. Its training set contains only 4620 utterances (4.1 hours) with a total of 39809 words, or 4893 distinct words. So this dataset is close to the "very-low" re- source setting considered here. We followed the standard Kaldi recipe [27] to extract the MFCCs of 39-dim with utterance-wise cepstral mean and variance normalization (CMVN) applied as (cid:88) (cid:48) (cid:88) (aj ,tj )∈Z (aj ,tj )∈Z Table 3: Ablation studies for the proposed approach of joint learning in (6) when removing a loss term in (1)(2)(3)(4)(5) with 4.1 hrs of data. Loss N 39809 1000 (6) 32.9 48.2 - (1) 33.1 51.4 - (2) 33.9 49.3 - (3) 33.2 48.6 - (4) 44.8 57.0 - (5) 50.4 69.5 Table 4: Contributions by the cycle-consistency in (9) of Sub- section 2.5 for 4.1 hrs of data and different N. Loss (6) Plus cycle (9) the acoustic features. 39809 32.9 41.4 1000 48.2 51.5 N (number of paired words) 200 67.6 66.4 100 78.7 74.7 50 85.4 82.3 3.2. Model Implementation The three encoders Ep, Es and Et in Figure 1 were all Bi-GRUs with hidden layer size 256. The decoders Da and Dt were GRUs with hidden layer size 512 and 256 respectively. The value of threshold λ in (5) was set to 0.01. Hyperparameters (α1, α2, α3, α4, α5, β) were set to (0.2, 1.0, 0.2, 1.0, 5.0, 0.01). We trained a tri-gram language model on the transcriptions of TIMIT data and performed beam search with beam size 10 during inference in (8) to obtain the recognition results. Adam optimizer [28] was used and the ini- tial learning rate was 10−4. The mini-batch size was 32. In re- alizing the embedding alignment in Figure 2, the discriminator used in the audio embedding for disentangling the speaker vec- tor was a two-layer fully-connected network with hidden size 256, and the mapping functions Mat and Mta were linear ma- trices, following the setting of the previous work [9]. 4. Experiments 4.1. Performance Spectrum for Different Training Data Sizes and Different Number of Paired Words First we wish to see the achievable performance in word error rates (WER) (%) over the testing set for the joint learning ap- proach of (6) in Subsection 2.4 when the training data size and the numbers of paired words (N) are respectively reduced to as small as possible. All the encoders and decoders are single- layer GRUs. The results are listed in Table 1 (blank for upper left corner because only smaller number of words can be la- beled and made paired for smaller data size). A 2-dim display of this performance spectrum is shown in Figure 3, where the black dots are the real results in Table 1, while the contours are produced based on linear interpolation among black dots. We can see from Table 1 only 2.1 hr of total data (in which 2500 spoken words were labeled and the rest unlabeled) gave an WER of 44.6% (in red), and this number can be reduced to 34.2% if 4.1 hr of data (in which 20000 words labeled) were available (in blue). We can also see how the WER varied when the total data size was changed for a fixed value of N (e.g. N=2500, the horizontal dotted red line in Figure 3) or N was changed for a fixed data size (e.g. 2.1 hr, the vertical orange line in Figure 3). Right now these numbers are still relatively high (specially for N ≤ 1000 or less than 1.0 hr of data), but the smooth, continuous performance spectrum may imply the proposed approach is a good direction and better performance may be achievable in the future. For example, the aligned pho- netic structures for the N paired words seemed to "generalize" to more words not labeled. Also, it can be found that in the lower half of Figure 3 the contours are more horizontal, imply- ing for small N (e.g. N ≤ 600) the help offered by larger data size may be limited. In the upper half of the figure 3, how- ever, the contours go up on the left implying for larger N (e.g. N ≥ 600) larger data size gave lower WER. 4.2. Different Learning Strategies and Model Parameters Table 1 and Figure 3 are for the joint learning strategy in (6) of Subsection 2.4 and single-layer GRUs. Here we wish to see the performance for the strategy of separate learning plus a trans- formation afterwards in (10) of Subsection 2.6. The results are in the left section (Joint) and middle section (Separate) of Ta- ble 2, for 4.1 hrs of data and N=39809, 1000. Results for 2 and 3 layers of GRUs in encoders/decoders (L=2, 3) are also listed. The results in Table 2 empirically showed joint learning the phonetic structures from spoken and text words together with the alignment between them outperformed the strategy of sep- arate learning then transformation. Very probably the phonetic structures of subword unit sequences of given length are very different from those of signal segments of different length, so aligning and warping them during joint learning gives smoother mapping relationships, while a forced transformation between two separately trained structures may be too rigid. Also, the model with L=2 achieved slightly better results in comparison with L=1 in the case of 4.1 hrs of data here, while overfitting happened with L=3 when N was small. All the above results are for phonemes taken as the subword units. The right col- umn of Table 2 are the results for characters instead with joint learning and L=1. We see characters worked much worse than phonemes. Clearly the phoneme sequences described the pho- netic structures much better than character sequences. 4.3. Ablation Studies and Cycle-consistency Regularization In Table 3, we performed ablation studies for joint learning in (6) of Subsection 2.4 and 4.1 hrs data and N=39809 and 1000 by removing a loss term in (1)(2)(3)(4)(5) in Subsection 2.1, 2.2 and 2.3. We see all reconstruction losses in (1)(2)(3)(4) were useful, but the cross-domain text reconstruction loss in (4) was specially important, obviously because the phoneme sequences described the phonetic structures most precisely, and the cross- domain reconstruction offered good mapping relationships. On the other hand, the cross-domain embedding loss learning from paired spoken and text words in (5) made the most significant contribution here. The knowledge learned here from paired data "generalize" to other unlabeled words. We also tested the cycle-consistency mentioned in (9) of Subsection 2.5 for 4.1 hrs of data and different N. The results in Table 3 showed that the cycle consistency may not help for larger N, but became useful for smaller N (e.g. N ≤ 200) when too few number of such paired words or "anchor points" were inadequate for constructing the mapping relationships. This is because the cycle-consistency condition required every paired spoken and text word to go through all encoders and decoders. 5. Discussion and Conclusion In this work, we investigate the possibility of performing speech recognition with very low resource (small data size with small number of paired labeled words) by joint learning the phonetic structures from audio and text embeddings. Smooth and contin- uous WER performance spectrum when the data size and num- ber of paired words were respectively reduced to as small as possible was obtained. The achieved WERs were still relatively high, but implied a good direction for future work. [16] T. Tran, S. Toshniwal, M. Bansal, K. Gimpel, K. Livescu, and M. Ostendorf, "Parsing speech: a neural approach to integrating lexical and acoustic-prosodic information," in Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2018, New Orleans, Louisiana, USA, June 1-6, 2018, Volume 1 (Long Papers), 2018, pp. 69 -- 81. [Online]. Available: https://aclanthology.info/papers/N18-1007/ n18-1007 [17] H. Tang, L. Lu, L. Kong, K. Gimpel, K. Livescu, C. Dyer, N. A. Smith, and S. Renals, "End-to-end neural segmental models for speech recognition," J. Sel. Topics Signal Processing, vol. 11, no. 8, pp. 1254 -- 1264, 2017. [Online]. Available: https://doi.org/10.1109/JSTSP.2017.2752462 [18] H. Kamper, K. Livescu, and S. Goldwater, "An embedded seg- mental k-means model for unsupervised segmentation and clus- tering of speech," in Automatic Speech Recognition and Under- standing Workshop (ASRU), 2017 IEEE. IEEE, 2017, pp. 719 -- 726. [19] H. Kamper, A. Jansen, and S. Goldwater, "A segmental frame- work for fully-unsupervised large-vocabulary speech recogni- tion," Computer Speech & Language, vol. 46, pp. 154 -- 174, 2017. [20] K. Levin, A. Jansen, and B. Van Durme, "Segmental acoustic in- dexing for zero resource keyword search," in ICASSP, 2015. [21] S. Bengio and G. Heigold, "Word embeddings for speech recog- nition," in INTERSPEECH, 2014. [22] G. Chen, C. Parada, and T. N. Sainath, "Query-by-example keyword spotting using long short-term memory networks," in ICASSP, 2015. [23] S. Settle, K. Levin, H. Kamper, and K. Livescu, "Query-by- example search with discriminative neural acoustic word embed- dings," INTERSPEECH, 2017. [24] A. Jansen, M. Plakal, R. Pandya, D. Ellis, S. Hershey, J. Liu, C. Moore, and R. A. Saurous, "Towards learning semantic audio representations from unlabeled data," in NIPS Workshop on Ma- chine Learning for Audio Signal Processing (ML4Audio), 2017. [25] I. Gulrajani, F. Ahmed, M. Arjovsky, V. Dumoulin, and A. Courville, "Improved training of wasserstein GANs," in NIPS, 2017. [26] J. S. Garofolo, L. F. Lamel, W. M. Fisher, J. G. Fiscus, and D. S. Pallett, "Darpa timit acoustic-phonetic continous speech corpus cd-rom. nist speech disc 1-1.1," NASA STI/Recon technical report n, vol. 93, 1993. [27] D. Povey, A. Ghoshal, G. Boulianne, L. Burget, O. Glembek, N. Goel, M. Hannemann, P. Motlicek, Y. Qian, P. Schwarz et al., "The kaldi speech recognition toolkit," in IEEE 2011 workshop on automatic speech recognition and understanding, no. EPFL- CONF-192584. IEEE Signal Processing Society, 2011. [28] D. P. Kingma and J. Ba, "Adam: A method for stochastic optimization," in 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. [Online]. Available: http://arxiv.org/abs/1412.6980 6. References [1] D. Bahdanau, J. Chorowski, D. Serdyuk, P. Brakel, and Y. Ben- gio, "End-to-end attention-based large vocabulary speech recog- nition," in Acoustics, Speech and Signal Processing (ICASSP), 2016 IEEE International Conference on. IEEE, 2016, pp. 4945 -- 4949. [2] D. Amodei, S. Ananthanarayanan, R. Anubhai, J. Bai, E. Bat- tenberg, C. Case, J. Casper, B. Catanzaro, Q. Cheng, G. Chen et al., "Deep speech 2: End-to-end speech recognition in english and mandarin," in International Conference on Machine Learn- ing, 2016, pp. 173 -- 182. [3] Y. Zhang, W. Chan, and N. Jaitly, "Very deep convolutional net- works for end-to-end speech recognition," in Acoustics, Speech and Signal Processing (ICASSP), 2017 IEEE International Con- ference on. IEEE, 2017, pp. 4845 -- 4849. [4] K. Vesely, M. Hannemann, and L. Burget, "Semi-supervised train- ing of deep neural networks," in Automatic Speech Recognition and Understanding (ASRU), 2013 IEEE Workshop on. IEEE, 2013, pp. 267 -- 272. [5] E. Dikici and M. Sarac¸lar, "Semi-supervised and unsupervised training for automatic speech discriminative language model recognition," Speech Communication, vol. 83, pp. 54 -- 63, 2016. [6] S. Thomas, M. L. Seltzer, K. Church, and H. Hermansky, "Deep neural network features and semi-supervised training for low resource speech recognition," in Acoustics, Speech and Signal Processing (ICASSP), 2013 IEEE International Conference on. IEEE, 2013, pp. 6704 -- 6708. [7] F. Gr´ezl and M. Karafi´at, "Combination of multilingual and semi- supervised training for under-resourced languages," in Fifteenth Annual Conference of the International Speech Communication Association, 2014. [8] K. Vesel`y, L. Burget, and J. Cernock`y, "Semi-supervised dnn training with word selection for asr." in INTERSPEECH, 2017, pp. 3687 -- 3691. [9] Y.-C. Chen, C.-H. Shen, S.-F. Huang, H.-y. Lee, and L.-s. Lee, "Almost-unsupervised speech recognition with close-to-zero re- source based on phonetic structures learned from very small un- paired speech and text data," arXiv preprint arXiv:1810.12566, 2018. [10] S. Karita, S. Watanabe, T. Iwata, A. Ogawa, and M. Delcroix, "Semi-supervised end-to-end speech recognition," Proc. Inter- speech 2018, pp. 2 -- 6, 2018. [11] J. Drexler and J. Glass, "Combining end-to-end and adversarial training for low-resource speech recognition," in 2018 IEEE Spo- ken Language Technology Workshop (SLT). IEEE, 2018, pp. 361 -- 368. [12] Y. Chung, C. Wu, C. Shen, H. Lee, and L. Lee, "Audio word2vec: Unsupervised learning of audio segment representations using sequence-to-sequence autoencoder," in Interspeech 2016, 17th Annual Conference of the International Speech Communication Association, San Francisco, CA, USA, September 8-12, 2016, 2016, pp. 765 -- 769. [Online]. Available: https://doi.org/10.21437/ Interspeech.2016-82 [13] Y.-H. Wang, H.-Y. Lee, and L.-S. Lee, "Segmental audio Word2Vec: Representing utterances as sequences of vectors with applications in spoken term detection," in ICASSP, 2017. [14] Y.-A. Chung, W.-H. Weng, S. Tong, and J. Glass, "Unsupervised cross-modal alignment of speech and text embedding spaces," in Advances in Neural Information Processing Systems, 2018, pp. 7365 -- 7375. [15] D. Liu, K. Chen, H. Lee, and L. Lee, "Completely un- supervised phoneme recognition by adversarially learning in Inter- mapping relationships the International speech 2018, 19th Annual Conference of Speech Communication Association, Hyderabad, India, 2-6 September 2018., 2018, pp. 3748 -- 3752. [Online]. Available: https://doi.org/10.21437/Interspeech.2018-1800 from audio embeddings,"
1802.08979
2
1802
2018-03-02T17:46:59
NL2Bash: A Corpus and Semantic Parser for Natural Language Interface to the Linux Operating System
[ "cs.CL", "cs.SE" ]
We present new data and semantic parsing methods for the problem of mapping English sentences to Bash commands (NL2Bash). Our long-term goal is to enable any user to perform operations such as file manipulation, search, and application-specific scripting by simply stating their goals in English. We take a first step in this domain, by providing a new dataset of challenging but commonly used Bash commands and expert-written English descriptions, along with baseline methods to establish performance levels on this task.
cs.CL
cs
NL2Bash: A Corpus and Semantic Parser for Natural Language Interface to the Linux Operating System Xi Victoria Lin*, Chenglong Wang, Luke Zettlemoyer, Michael D. Ernst Salesforce Research, University of Washington, University of Washington, University of Washington [email protected], {clwang,lsz,mernst}@cs.washington.edu 8 1 0 2 r a M 2 ] L C . s c [ 2 v 9 7 9 8 0 . 2 0 8 1 : v i X r a We present new data and semantic parsing methods for the problem of mapping English sentences to Bash commands (NL2Bash). Our long-term goal is to enable any user to perform operations such as file manipulation, search, and application-specific scripting by simply stating their goals in English. We take a first step in this domain, by providing a new dataset of challenging but commonly used Bash commands and expert-written English descriptions, along with baseline methods to establish performance levels on this task. Abstract Keywords: Natural Language Programming, Natural Language Interface, Semantic Parsing 1. Introduction The dream of using English or any other natural language to program computers has existed for almost as long as the task of programming itself (Sammet, 1966). Although significantly less precise than a formal language (Dijkstra, 1978), natural language as a programming medium would be universally accessible and would support the automation of highly repetitive tasks such as file manipulation, search, and application-specific scripting (Wilensky et al., 1984; Wilensky et al., 1988; Dahl et al., 1994; Quirk et al., 2015; Desai et al., 2016). This work presents new data and semantic parsing meth- ods on a novel and ambitious domain - natural language control of the operating system. Our long-term goal is to enable any user to perform tasks on their computers by sim- ply stating their goals in natural language (NL). We take a first step in this direction, by providing a large new dataset (NL2Bash) of challenging but commonly used commands and expert-written descriptions, along with baseline methods to establish performance levels on this task. The NL2Bash problem can be seen as a type of semantic parsing, where the goal is to map sentences to formal repre- sentations of their underlying meaning (Mooney, 2014). The dataset we introduce provides a new type of target mean- ing representations (Bash1 commands), and is significantly larger (from two to ten times) than most existing semantic parsing benchmarks (Dahl et al., 1994; Popescu et al., 2003). Other recent work in semantic parsing has also focused on programming languages, including regular expressions (Lo- cascio et al., 2016), IFTTT scripts (Quirk et al., 2015), and SQL queries (Kwiatkowski et al., 2013; Iyer et al., 2017; Zhong et al., 2017). However, the shell command data we consider raises unique challenges, due to its irregular syntax (no syntax tree representation for the command options), wide domain coverage (> 100 Bash utilities), and a large percentage of unseen words (e.g. commands can manipulate arbitrary files). * Work done at the University of Washington. 1The Bourne-again shell (Bash) is the most popular Unix shell and command language: https://www.gnu.org/software/bash/. Our data collection approach and baseline models can be trivially gen- eralized to other command languages. We constructed the NL2Bash corpus with frequently used Bash commands scraped from websites such as question- answering forums, tutorials, tech blogs, and course materi- als. We gathered a set of high-quality descriptions of the commands from Bash programmers. Table 1 shows several examples. After careful quality control, we were able to gather over 9,000 English-command pairs, covering over 100 unique Bash utilities. We also present a set of experiments to demonstrate that NL2Bash is a challenging task which is worthy of future study. We build on recent work in neural semantic pars- ing (Dong and Lapata, 2016; Ling et al., 2016), by evalu- ating the standard Seq2seq model (Sutskever et al., 2014) and the CopyNet model (Gu et al., 2016). We also include a recently proposed stage-wise neural semantic parsing model, Tellina, which uses manually defined heuristics for better detecting and translating the command arguments (Lin et al., 2017). We found that when applied at the right sequence granularity (sub-tokens), CopyNet significantly outperforms the stage-wise model, with significantly less pre-processing and post-processing. Our best performing system obtains top-1 command structure accuracy of 49%, and top-1 full command accuracy of 36%. These performance levels, al- though far from perfect, are high enough to be practically useful in a well-designed interface (Lin et al., 2017), and also suggest ample room for future modeling innovations. 2. Domain: Linux Shell Commands A shell command consists of three basic components, as shown in Table 1: utility (e.g. find, grep), option flags (e.g. -name, -i), and arguments (e.g. "*.java", "TODO"). A utility can have idiomatic syntax for flags (see the -exec . . . {} \; option of the find command). There are over 250 Bash utilities, and new ones are regularly added by third party developers. We focus on 135 of the most useful utilities identified by the Linux user group (http: //www.oliverelliott.org/article/computing/ref unix/), that is, our domain of target commands contain only those 135 utilities.2 We only considered the target commands that can 2We were able to gather fewer examples for the less common ones. Providing the descriptions for them also requires a higher level of Bash expertise of the corpus annotators. Natural Language find .java files in the current direc- tory tree that contain the pattern 'TODO' and print their names display the 5 largest files in the cur- rent directory and its sub-directories search for all jpg images on the sys- tem and archive them to tar ball "im- ages.tar" Bash Command(s) grep -l "TODO" *.java find . -name "*.java" -exec grep -il "TODO" {} \; find . -name "*.java" xargs -I {} grep -l "TODO" {} find . -type f sort -nk 5,5 tail -5 du -a . sort -rh head -n5 find . -type f -printf '%s %p\n' sort -rn head -n5 tar -cvf images.tar $(find / -type f -name *.jpg) tar -rvf images.tar $(find / -type f -name *.jpg) find / -type f -name "*.jpg" -exec tar -cvf images.tar {} \; Table 1: Example natural language descriptions and the corresponding shell commands from NL2Bash. In-scope Out-of- scope 1. Single command 2. Logical connectives: &&, , parentheses () 3. Nested commands: - pipeline - command substitution $() - process substitution <() 1. I/O redirection <, << 2. Variable assignment = 3. Compound statements: - if, for, while, util statements - functions 4. Non-bash program strings nested with language interpreters such as awk, sed, python, java Table 2: In-scope and out-of scope syntax for the Bash commands in our dataset. be specified in a single line (one-liners).3 Among them, we omitted commands that contain syntax structures such as I/O redirection, variable assignment, and compound statements because those commands need to be interpreted in context. Table 2 summarizes the in-scope and out-of-scope syntactic structures of the shell commands we considered. 3. Corpus Construction The corpus consists of text–command pairs, where each pair consists of a Bash command scraped from the web and an expert-generated natural language description. Our dataset is publicly available for use by other researchers: https://github.com/TellinaTool/nl2bash/tree/master/data. We collected 12,609 text–command pairs in total (§3.1.). After filtering, 9,305 pairs remained (§3.2.). We split this data into train, development (dev), and test sets, subject to the constraint that neither a natural language description nor a Bash command appears in more than one split (§3.4.). 3.1. Data Collection We hired 10 Upwork4 freelancers who are familiar with shell scripting. They collected text–command pairs from 3We decided to investigate this simpler case prior to synthe- sizing longer shell scripts because one-liner Bash commands are practically useful and have simpler structure. Our baseline results and analysis (§6.) show that even this task is challenging. 4http://www.upwork.com/ web pages such as question-answering forums, tutorials, tech blogs, and course materials. We provided them a web inferface to assist with searching, page browsing, and data entry. The freelancers copied the Bash command from the web- page, and either copied the text from the webpage or wrote the text based on their background knowledge and the web- page context. We restricted the natural language description to be a single sentence and the Bash command to be a one- liner. We found that oftentimes one sentence is enough to accurately describe the function of the command.5 The freelancers provided one natural-language description for each command on a webpage. A freelancer might anno- tate the same command multiple times in different webpages, and multiple freelancers might annotate the same command (on the same or different webpages). Collecting multiple different descriptions increases language diversity in the dataset. On average, each freelancer collected 50 pairs/hour. 3.2. Data Cleaning We used an automated process to filter and clean the dataset, as described below. Our released corpus includes the filtered data, the full data, and the cleaning scripts. Filtering The cleaning scripts removed the following com- mands. • Non-grammatical commands that violate the syntax specification in the Linux man pages (https://linux.die. net/man/). • Commands that contain out-of-scope syntactic struc- • Commands that are mostly used in multi-statement • Commands that contain non-bash language interpreters (e.g. python, c++, brew, emacs). These commands contain strings in other programming languages. shell scripts (e.g. alias and set). tures shown in Table 2. Cleaning We corrected spelling errors in the natural lan- guage descriptions using a probabilistic spell checker (http: //norvig.com/spell-correct.html). We also manually cor- rected a subset of the spelling errors that bypassed the spell checker in both the natural language and the shell commands. For Bash commands, we removed sudo and the shell input 5As discussed in §6.3., in 4 out of 100 examples, a one-sentence description is difficult to interpret. Future work should investigate interactive natural language programming approaches in these scenarios. # sent. # word 8,559 7,790 # words per sent. avg. median 11.7 11 # sent. per word avg. median 14.0 1 Table 3: Natural Language Statistics: # unique sentences, # unique words, # words per sentence and # sentences that a word appears in. # cmd # temp # token # tokens / cmd # cmds / token avg. median avg. median 7.7 7,587 6,234 4,602 11.5 7 1 # utility # flag # reserv. # cmds / util. 38 102 # cmds / flag avg. median avg. median 155.0 101.7 token 206 7.5 15 Table 4: Bash Command Statistics. The top table contains # unique commands, # unique command templates, # unique tokens, # tokens per command and # commands that a token appears in. The bottom table contains # unique utilities, # unique flags, # unique reserved tokens, # commands a utility appears in and # commands a flag appears in. . prompt characters such as "$" and "#" from the beginning of each command. We replaced the absolute pathnames for utilities by their base names (e.g., we changed /bin/find to find). 3.3. Corpus Statistics After filtering and cleaning, our dataset contains 9,305 pairs. The Bash commands cover 102 unique utilities using 206 flags - a rich functional domain. Monolingual Statistics Tables 3 and 4 show the statistics of natural language (NL) and Bash commands in our corpus. The average length of the NL sentences and Bash commands are relatively short, being 11.7 words and 7.7 tokens respec- tively. The median word frequency and command token frequency are both 1, which is caused by the large number of open-vocabulary constants (file names, date/time expres- sions, etc.) that appeared only once in the corpus.6 We define a command template as a command with its arguments replaced by their semantic types. For exam- ple, the template of grep -l "TODO" *.java is grep -l [regex] [file]. Mapping Statistics Table 5 shows the statistics of natural language to Bash command mappings in our dataset. While most of the NL sentences and Bash commands form one- to-one mappings, the problem is naturally a many-to-many mapping problem - there exist many semantically equiv- alent commands, and one Bash command may be phrased in different NL descriptions. This many-to-many mapping is common in machine translation datasets (Papineni et al., # cmd per nl avg. median max 1.09 1 # nl per cmd avg. median max 1.23 22 1 9 Table 5: Natural Language to Bash Mapping Statistics 2002), but rare for traditional semantic parsing ones (Dahl et al., 1994; Zettlemoyer and Collins, 2005). As discussed in §4. and §6.2., the many-to-many mapping affects both evaluation and modeling choices. Utility Distribution Figure 1 shows the top 50 most com- mon Bash utilities in our dataset and their frequencies in log-scale. The distribution is long-tailed: the top most fre- quent utility find appeared 6,268 times and the second most frequent utility xargs appeared 1,047 times. The 52 least common bash utilities, in total, appeared only 984 times.7 Figure 1: Top 50 most frequent bash utilities in the dataset with their frequencies in log scale. U1 and U2 at the bottom of the circle denote the utilities basename and readlink. The appendix (§10.) gives more corpus statistics. 3.4. Data Split We split the filtered data into train, dev, and test sets (Ta- ble 6). We first clustered the pairs by NL descriptions - a cluster contains all pairs with the identical normalized NL description. We normalized an NL description by lower- casing, stemming, and stop-word filtering, as described in §6.1. We randomly split the clusters into train, dev, and test at a ratio of 10:1:1. After splitting, we moved all development and test pairs whose command appeared in the train set into the train set. This prevents a model from obtaining high accuracy by trivially memorizing a natural language 6As shown in figure 1, the most frequent bash utilities appeared over 6,000 times in the corpus. Similarly, natural language words such as "files", "in" appeared in 5,871 and 5,430 sentences, re- spectively. These extremely high frequency tokens are the reason for the significant difference between the averages and medians in Tables 3 and 4. 7 The utility find is disproportionately common in our corpus. This is because we collected the data in two separated stages. As a proof of concept, we initially collected 5,413 commands that contain the utility find (and may also contain other utilities). After that, we allow the freelancers to collect all commands that contain any of the 135 utilities described in §2.. description or a command it has seen in the train set, which allows us to evaluate the model's ability to generalize. # pairs # unique nls Train Dev 609 8,090 7,340 549 Test 606 547 Table 6: Data Split Statistics 4. Evaluation Methodology In our dataset, one natural language description may have multiple correct Bash command translations. This presents challenges for evaluation since not all correct commands are present in our dataset. Manual Evaluation We hired three Upwork freelancers who are familiar with shell scripting. To evaluate a particular system, the freelancers independently evaluated the correct- ness of its top-3 translations for all test examples. For each command translation, we use the majority vote of the three freelancers as the final evaluation. We grouped the test pairs that have the same normalized NL descriptions as a single test instance (Table 6). We report two types of accuracy: top-k full command accuracy (Acck F) and top-k command template accuracy (Acck T). We define Acck F to be the percentage of test instances for which a correct full command is ranked k or above in the model output. We define Acck T to be the percentage of test instances for which a correct command template is ranked k or above in the model output (i.e., ignoring incorrect arguments). Table 7 shows the inter-annotator agreement between the three pairs of our freelancers on both the template judgement (αT) and full-command judgement (αF). Pair 1 Pair 2 Pair 3 αF 0.89 αT 0.81 αF 0.83 αT 0.82 αF 0.90 αT 0.89 Table 7: Inter-annotator agreement. Previous approaches Previous NL-to-code translation work also noticed similar problems. (Kushman and Barzilay, 2013; Locascio et al., 2016) for- mally verify the equivalence of different regular expressions by converting them to minimal deterministic finite automa- ton (DFAs). Others (Kwiatkowski et al., 2013; Long et al., 2016; Guu et al., 2017; Iyer et al., 2017; Zhong et al., 2017) evaluate the generated code through execution. As Bash is a Turing- complete language, verifying the equivalence of two Bash commands is undecidable. Alternatively, one can check command equivalence using test examples: two commands can be executed in a virtual environment and their execu- tion outcome can be compared. We leave this evaluation approach to future work. Some other works (Oda et al., 2015) have adopted fuzzy eval- uation metrics, such as BLEU, which is widely used to mea- sure the translation quality between natural languages (Dod- dington, 2002). Appendix C shows that the n-gram overlap captured by BLEU is not effective in measuring the semantic similarity for formal languages. 5. System Design Challenges This section lists challenges for semantic parsing in the Bash domain. Rich Domain The application domain of Bash ranges from file system management, text processing, network con- trol to advanced operating system functionality such as pro- cess management. Semantic parsing in Bash is equivalent to semantic parsing for each of the applications. In comparison, many previous works focus on only one domain (§7.). Out-of-Vocabulary Constants Bash commands contain many open-vocabulary constants such as file/path names, file properties, time expressions, etc. These form the unseen tokens for the trained model. Nevertheless, a semantic parser on this domain should be able to generate those constants in its output. This problem exists in nearly all NL-to-code trans- lation problems but is particularly severe for Bash (§3.3.). What makes the problem worse is that oftentimes, the con- stants corresponding to the command arguments need to be properly reformatted following idiomatic syntax rules. Language Flexibility Many bash commands have a large set of option flags, and multiple commands can be combined to solve more complex tasks. This often results in multiple correct solutions for one task (§3.3.), and poses challenges for both training and evaluation. Idiomatic Syntax The Bash interpreter uses a shallow syntactic grammar to parse pipelines, code blocks, and other high-level syntax structures. It parses command options us- ing pattern matching and each command can have idiomatic syntax rules (e.g. to specify an ssh remote, the format needs to be [USER@]HOST:SRC). Syntax-tree-based parsing approaches (Yin and Neubig, 2017; Guu et al., 2017) are hence difficult to apply. 6. Baseline System Performance To establish performance levels for future work, we evalu- ated two neural machine translation models that have demon- strated strong performance in both NL-to-NL translation and NL-to-code translation tasks, namely, Seq2Seq (Sutskever et al., 2014; Dong and Lapata, 2016) and CopyNet (Gu et al., 2016). We also evaluated a stage-wise natural language programing model, Tellina (Lin et al., 2017), which includes manually-designed heuristics for argument translation. Seq2Seq The Seq2Seq (sequence-to-sequence) model de- fines the conditional probability of an output sequence given the input sequence using an RNN (recurrent neural network) encoder-decoder (Jain and Medsker, 1999; Sutskever et al., 2014). When applied to the NL-to-code translation prob- lem, the input natural language and output commands are treated as sequences of tokens. At test time, the command sequences with the highest conditional probabilities were output as candidate translations. CopyNet CopyNet (Gu et al., 2016) is an extension of Seq2Seq which is able to select sub-sequences of the input sequence and emit them at proper places while generating the output sequence. The copy action is mixed with the regular token generation of the Seq2Seq decoder and the whole model is still trained end-to-end. Tellina The stage-wise natural language programing model, Tellina (Lin et al., 2017), first abstracts the con- stants in an NL to their corresponding semantic types (e.g. File and Size) and performs template-level NL-to-code translation. It then fills the argument slots in the code tem- plate with the extracted constants using a learned alignment model and reformatting heuristics. 6.1. Implementation Details We used the Seq2Seq formulation as specified in (Sutskever et al., 2014). We used the gated recurrent unit (GRU) (Chung et al., 2014) RNN cells and a bidirectional RNN (Schuster and Paliwal, 1997) encoder. We used the copying mecha- nism proposed by (Gu et al., 2016). The rest of the model architecture is the same as the Seq2Seq model. We evaluated both Seq2Seq and CopyNet at three levels of token granularities: token, character and sub-token. Pre-processing We used a simple regular-expression based natural language tokenizer and the Snowball stem- mer to tokenize and stem the natural language. We con- verted all closed-vocabulary words in the natural language to lowercase and removed words in a stop-word list. We removed all NL tokens that appeared less than four times from the vocabulary for the token- and sub-token-based models. We used a Bash parser augmented from Bashlex (https://github.com/idank/bashlex) to parse and tokenize the bash commands. To compute the sub-tokens8, we split every constant in both the natural language and Bash commands into consecutive sequences of alphabetical letters and digits; all other char- acters are treated as an individual sub-token. (All Bash utilities and flags are treated as atomic tokens as they are not constants.) A sequence of sub-tokens as the result of a token split is padded with the special symbols SUB START and SUB END at the beginning and the end. For example, the file path "/home/dir03/*.txt" is converted to the sub-token sequence: SUB START, "/", "home", "/", "dir", "03", "/", "*", ".", "txt", SUB END. Hyperparameters The dimension of our decoder RNN is 400. The dimension of the two RNNs in the bi-directional encoder is 200. We optimized the learning objective with mini-batched Adam (Kingma and Ba, 2014), using the de- fault momentum hyperparameters. Our initial learning rate is 0.0001 and the mini-batch size is 128. We used varia- tional RNN dropout (Gal and Ghahramani, 2016) with 0.4 dropout rate. For decoding we set the beam size to 100. The hyperparameters were set based on the model's performance on a development dataset (§3.4.). Our baseline system implementation is released on Github: https://github.com/TellinaTool/nl2bash. 8As discussed in §6.2., the simple sub-token based approach is surprisingly effective for this problem. It avoids modeling very long sequences, as the character-based models do, by preserving trivial compositionality in consecutive alphabetical letters and dig- its. On the other hand, the separation between letters, digits, and special tokens explicitly represented most of the idiomatic syntax of Bash we observed in the data: the sub-token based models ef- fectively learn basic string manipulations (addition, deletion and replacement of substrings) and the semantics of Bash reserved tokens such as $, ", *, etc. Model Seq2Seq CopyNet Char Token Sub-token Char Token Sub-token Tellina Acc1 0.24 0.10 0.19 0.25 0.21 0.31 0.29 F Acc3 0.27 0.12 0.27 0.31 0.34 0.40 0.32 F Acc1 0.35 0.53 0.41 0.34 0.47 0.44 0.51 T Acc3 T 0.38 0.59 0.53 0.41 0.61 0.53 0.58 Table 8: Translation accuracies of the baseline systems on 100 instances sampled from the dev set. 6.2. Results Table 8 shows the performance of the baseline systems on 100 examples sampled from our dev set. Since manually evaluating all 7 baselines on the complete dev set is expen- sive, we report the manual evaluation results on a sampled subset in Table 8 and the automatic evaluation results on the full dev set in Appendix C. Table 11 shows a few dev set examples and the baseline system translations. We now summarize the comparison between the different systems. Token Granularity In general, token-level modeling yields higher command structure accuracy compared to us- ing characters and sub-tokens. Modeling at the other two granularities gives higher full command accuracy. This is expected since the character and sub-token models need to learn token-level compositions. They also operate over longer sequences which presents challenges for the neural networks. It is somewhat surprising that Seq2Seq at the character level achieves competitive full command accu- racy. However, the structure accuracy of these models is significantly lower than the other two counterparts.9 Copying Adding copying slightly improves the character- level models. This is expected as out-of-vocabulary charac- ters are rare. Using token-level copying improves full com- mand accuracy significantly from vanilla Seq2Seq. However, the command template accuracy drops slightly, possibly due to the mismatch between the source constants and the com- mand arguments, as a result of argument reformatting. We observe a similarly significant full command accuracy im- provement by adding copying at the sub-token level. The resulting ST-CopyNet model has the highest full command accuracy and competitive command template accuracy. End-To-End vs. Pipline The Tellina model which does template-level translation and argument filling/reformatting in a stage-wise manner yields the second-best full command accuracy and second-best structure accuracy. Nevertheless, the higher full command accuracy of ST-CopyNet (espe- cially on the Acc3 T metrics) shows that learned string-level transformations out-perform manually written heuristics 9 (Lin et al., 2017) reported that incorrect commands can help human subjects, even when their arguments contain errors. This is because in many cases the human subjects were able to change or replace the wrong arguments based on their prior knowledge. Given this finding, we expect pure character-based models to be less useful in practice compared to the other two groups if we cannot find ways to improve their command structure accuracy. Model ST-CopyNet Tellina Acc1 0.36 0.27 F Acc3 0.45 0.32 F Acc1 0.49 0.53 T Acc3 T 0.61 0.62 Table 9: Translation accuracies of ST-CopyNet and Tellina on the full test set. Figure 2: Error overlap of ST-CopyNet and Tellina. The number denotes the percentage out of the 100 dev samples. when enough data is provided. This shows the promise of applying end-to-end learning on such problems in future work. Table 9 shows the test set accuracies of the top-two perform- ing approaches, ST-CopyNet and Tellina, evaluated on the entire test set. The accuracies of both models are higher than those on the dev set10, but the relative performance gap holds: ST-CopyNet performs significantly better than Tellina on the full command accuracy, with only a mild decrease in structure accuracy. Section 6.3. furthur discusses the comparison between these two systems through error analysis. 6.3. Error Analysis We manually examined the top-1 system outputs of ST- CopyNet and Tellina on the 100 dev set examples and com- pared their error cases. Figure 2 shows the error case overlap of the two systems. For a significant proportion of the examples both systems made mistakes in their translation (44% by command struc- ture error and 59% by full command error). This is because the base model of the two systems are similar - they are both RNN based models that perform sequential transla- tion. Many such errors were caused by the NL describing a function that rarely appeared in the train set, or the GRUs failing to capture certain portions of the NL descriptions. For cases where only one of the models makes mistakes, Tellina makes fewer template errors and ST-CopyNet makes fewer full command errors. We categorized the error causes of each system (Figure 3), and discuss the major error classes below. Sparsity in Training Data For both models, the top-one error cause is when the NL description maps to utilities or flags that rarely appeared in the train set (Table 10). As mentioned in section 2., the bash domain consists of a large number of utilities and flags and it is expensive to gather enough training data for all of them. 10One possible reason is that two different sets of programmers evaluated the results on dev and test. Figure 3: Number of error instances in each error classes of ST-CopyNet and Tellina. The classes marked with L are unique to the pipeline system. Sparsity in training data find all the text files in the file system and search only in the disk partition of the root. Constant enumeration Answer "n" to any prompts in the interactive recursive removal of "dir1", "dir2", and "dir3". Complex task Recursively finds all files in a current folder excluding already compressed files and compresses them with level 9. Intelligible/Non-grammatical description Find all regular files in the current directory tree and print a command to move them to the current directory. Table 10: Samples of natural language descriptions for the major error causes. Common Errors of RNN Translation Models The sec- ond major error class is commonly-known errors for RNN- based translation models (utility error, flag error and argu- ment formatting error in Figure 3). When the RNN mis- interprets or overlooks certain chunks of NL descriptions, the decoder can generate a wrong utility/flag or omit a util- ity/flag from the output sequence. Since the ST-CopyNet model also relies on the RNNs to generate sub-token con- tents, it suffers more from such problems - the sub-token based models in general have more command structure er- rors and they frequently generated arguments that are a few edit distance away from the correct ones. Interestingly, we noticed that few command template errors are syntax errors. The output commands often remain executable despite the semantic errors in different Bash components. Constant Enumeration In some cases, the NL descrip- tions contain sequences of constant values as an enumeration of system objects or string patterns (Table 10). We observed that both models struggled to extract all the constants cor- rectly from this type of descriptions and usually failed to set the extracted constants into the correct command slots. Moreover, long sequences of OOVs also down-qualify the RNN encodings and both models made more command structure errors in such cases. Natural Language Delete all empty directories in minimum 2 levels down the root directory Find all Subscription.java files/directories under current directory and enter into the parent directory of the first one found Add executable permission to "pretty-print" Search for the string 'git' in all the files under current directory tree without traversing into '.git' folder and excluding files that have 'git' in their names Rename "file.txt" in directories "v 1", "v 2", and "v 3" each to "v 1.txt", "v 2.txt", and "v 3.txt" respectively and print the conversion Model Output find root -mindepth 2 -type d -empty -delete find root -mindepth 2 -type d -empty -delete find root -mindepth 2 -type d -empty -delete find root -mindepth 2 -type d -empty -delete find root -mindepth 2 -type d -empty -delete find root -mindepth 2 -type d -empty -delete find root -mindepth 2 -type d -empty -delete find . -mindepth 2 -type d -empty -delete cd $(find . -name Subscription.java -printf '%h\n') find . -name Subscription.java . . . incomplete find . -name Subscription.java xargs grep Subscription.java cd $(find . -name Subscription.java xargs -I {} dirname {}) cd $(find . -name Subscription.java xargs -I {} dirname {}) cd $(find . -name Subscription.java xargs -I {} dirname {}) cd $(find . -name Subscription.java xargs -I {} dirname {}) cd $(find . -name "Subscription.java" xargs -I {} dirname {}) chmod +x pretty-print chmod +x prety-printf chmod pretty-print pretty-print chmod +x UNK chmod +x UNK chmod +x UNK-UNK-UNK chmod +x pretty-print chmod [permission] "pretty-print" find . -path ./.git -prune -o -not -name '*git*' -print xargs grep git find . -name git -prune -or -print . . . incomplete find . -name .git -prune -or -name "*.git" -print . . . incomplete find . -not -name "*.*" -not -path UNK -not -path UNK . . . incomplete find . -not \( -path UNK -prune \) -or \( -type f -and ! -name UNK \) -print0 xargs -0 -I {} grep . . . incomplete find . -name '*.git' -not -path '.git' xargs -I {} grep 'git' {} find . -not -name ".git" -not -path "*.git*" -not -name "*git*" xargs -I {} grep git {} find "git" -not -path ".git" -not -name "*" grep "git" ls -d v 1,2,3 xargs -i mv -v {}/file.txt {}/{}.txt mv file.txt v 1.txt mv file.txt v 3.txt mv UNK UNK mv UNK UNK diff current 1 {} ssh -i v 1.txt v 3.txt no output Model Human C-Seq2Seq C-CopyNet T-Seq2Seq T-CopyNet ST-Seq2Seq ST-CopyNet Tellina Human C-Seq2Seq C-CopyNet T-Seq2Seq T-CopyNet ST-Seq2Seq ST-CopyNet Tellina Human C-Seq2Seq C-CopyNet T-Seq2Seq T-CopyNet ST-Seq2Seq ST-CopyNet Tellina Human C-Seq2Seq C-CopyNet T-Seq2Seq T-CopyNet ST-Seq2Seq ST-CopyNet Tellina Human C-Seq2Seq C-CopyNet T-Seq2Seq T-CopyNet ST-Seq2Seq ST-CopyNet Tellina Table 11: Example predictions of the baseline approaches. The prediction errors are underlined. Complex Task We found several cases where the NL de- scription specifies a complex task and would be better bro- ken into separate sentences (Table 10). When the task gets complicated, the NL description gets verbose. As noted in previous work (Bahdanau et al., 2014), the performance of RNNs decreases for longer sequences. Giving high-quality NL description for complex tasks are also more difficult for the users in practice - multi-turn interaction is probably necessary for these cases. Other Classes For the rest of the error cases, we observed that the model failed to translate the specifications in (), long descriptions of regular expressions and intelligible/non- grammatical NL descriptions (Table 10). There are also errors propogated from the pre-processing tools such as the NL tokenizer. In addition, the stage-wise system Tellina made a significant number of mistakes specific to its non- end-to-end modeling approach, e.g. the limited coverage of its set of manually defined heuristic rules. Based on the error analysis, we recommend future work to build shallow command structures in the decoder instead of synthesizing the entire output in sequential manner, e.g. us- ing separate RNNs for template translation and argument fill- ing. The training data sparsity can possibly be alleviated by semi-supervised learning using unlabeled Bash commands or external resources such as the Linux man pages. 7. Comparison to Existing Datasets This section compares NL2Bash to other commonly-used se- mantic parsing and NL-to-code datasets.11 We compare the 11We focus on generating utility commands/scripts from natural language and omitted the datasets in the domain of programming challenges (Polosukhin and Skidanov, 2018) and code base model- Dataset PL # # pairs words # Avg. # Avg. # tokens w. in nl t. in code NL collection Code Semantic collection alignment – – – DSL 86,960 IFTTT C# 66,015 24,857 91,156 C#2NL* SQL 32,337 10,086 1,287 SQL2NL* 3,619 13,491 1794 Regex RegexLib HeartStone Python 665 Java Python 147,546 17,635 137,123 SQL 119,519 9,920 21,413 454 Regex 10,000 SQL 80,654 NL2RX WikiSQL 560 – 13,297 StaQC MTG – – – – DSL 2,380 1,014 NLMAPS Jobs640# GEO880 DSL DSL Freebase917 DSL DSL DSL NL2RX-KB13 Regex ATIS# WebQSP 640 880 917 5,410 4,737 824 – 58 60 – 176 – 854 – 391 284 – 936 – 715 – Django& NL2Bash Python 18,805 Bash 9,305 7,790 6,234 7.0 12 9 36.4 7 21 9 9 10.6 – 10.9 9.8 7.6 – 11.1 – 7.1 14.3 11.7 21.8 38 46 58.84 3524 1,0804 86 60 264 – 16.0 22.9 19.1 – 28.1 scraped scraped game card description extracted using ML synthesized & paraphrased synthesized given code game card source code extracted using ML synthesized expert written Noisy Good Noisy Very Good user written – 19.04 – 7.7 search log turker written expert written given code expert written given NL Very Good scraped Introduced by (Quirk et al., 2015) (Iyer et al., 2016) (Zhong et al., 2018) (Ling et al., 2016) (Yao et al., 2018) (Locascio et al., 2016) (Zhong et al., 2017) (Haas and Riezler, 2016) (Tang and Mooney, 2001) (Zelle and Mooney, 1996) (Cai and Yates, 2013) (Dahl et al., 1994) (Yih et al., 2016) (Kushman and Barzilay, 2013) (Oda et al., 2015) Ours Table 12: Comparison of datasets for translation of natural language to (short) code snippets. *: Both C#2NL and SQL2NL were originally collected to train systems that explain code in natural language. 4: The code length is counted by characters instead of by tokens. : When calculating # tokens for these datasets, the open-vocabulary constants were replaced with positional placeholders. : These datasets were collected from sources where the NL and code exist pairwise, but the pairs were not compiled for the purpose of semantic parsing. #: Both Jobs640 and ATIS consist of mixed manually-generated and automatically-generated NL-code pairs. & The Django dataset consists of pseudo-code/code pairs. datasets with respect to: (1) the programming language used, (2) size, (3) shallow quantifiers of difficulty (i.e. # unique NL words, # unique program tokens, average length of text and average length of code) and (4) collection methodology. Table 12 summarizes the comparison. We directly quoted the published dataset statistics we have found, and computed the statistics of other released datasets to our best effort. Programming Languages Most of the datasets were con- structed for domain-specific languages (DSLs). Some of the recently proposed datasets use Java, Python, C#, and Bash, which are Turing-complete programming languages. This shows the beginning of an effort to apply natural language based code synthesis to more general PLs. Collection Methodology Table 12 sorts the datasets by increasing amount of manual effort spent on the data col- lection. NL2Bash is by far the largest dataset constructed using practical code snippets and expert-written natural lan- guage. In addition, it is significantly more diverse (7,790 unique words and 6,234 unique command tokens) compared to other manually constructed datasets. The approaches of automatically scraping/extracting par- allel natural language and code have been adopted more recently. A major resource of such parallel data are question- answering forums (StackOverflow: https://stackoverflow. com/) and cheatsheet websites (IFTTT: https://ifttt.com/ and RegexLib: http://www.regexlib.com/). Users post code snip- pets together with natural language questions or descriptions in these venues. The problem with these data is that they are loosely aligned and cannot be directly used for training. ing (Nie et al., 2018). Extracting good alignments from them is very challeng- ing (Quirk et al., 2015; Iyer et al., 2016; Yao et al., 2018). That being said, these datasets significantly surpasses the manually gathered ones in terms of size and diversity, hence demonstrating significant potential for future work. Alternatively, Locascio et al. (2016) and Zhong et al. (2017a) proposed synthesizing parallel natural language and code using a synchronous grammar. They also hired Amazon Mechanical Turkers to paraphrase the synthesized natural language sentences in order to increase their natu- ralness and diversity. While the synthesized domain may be less diverse compared to naturally existed ones, they served as an excellent resource for data augmentation or zero-shot learning. The downside is that developing syn- chronous grammars for domains other than simple DSLs is challenging, and other data collection methods are still necessary for them. The different data collection methods are complimentary and we expect to see more future work mixing different strategies. 8. Conclusions We studied the problem of mapping English sentences to Bash commands (NL2Bash), by introducing a large new dataset and baseline methods. NL2Bash is by far the largest NL-to-code dataset constructed using practical code snippets and expert-written natural language. Experiments demon- strated competitive performance of existing models as well as significant room for future work on this challenging se- mantic parsing problem. 9. 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 (IIS1252835, IIS-1562364), gifts from Google and Tencent, and an Allen Distinguished Investigator Award. We thank the freelancers who worked with us to make the corpus. We thank Zexuan Zhong for providing us the statistics of the RegexLib dataset. We thank the anonymous reviewers, Kenton Lee, Luheng He, Omer Levy for constructive feedback on the paper draft, and the UW NLP/PLSE groups for helpful conversations. 10. Bibliographical References Bahdanau, D., Cho, K., and Bengio, Y. (2014). Neural ma- chine translation by jointly learning to align and translate. CoRR, abs/1409.0473. Cai, Q. and Yates, A. (2013). Large-scale semantic parsing via schema matching and lexicon extension. In Proceed- ings of the 51st Annual Meeting of the Association for Computational Linguistics, ACL 2013, 4-9 August 2013, Sofia, Bulgaria, Volume 1: Long Papers, pages 423–433. The Association for Computer Linguistics. Chung, J., Gulc¸ehre, C¸ ., Cho, K., and Bengio, Y. (2014). Empirical evaluation of gated recurrent neural networks on sequence modeling. Dahl, D. A., Bates, M., Brown, M., Fisher, W., Hunicke- Smith, K., Pallett, D., Pao, C., Rudnicky, A., and Shriberg, E. (1994). Expanding the scope of the atis task: The atis- 3 corpus. In Proceedings of the Workshop on Human Lan- guage Technology, HLT '94, pages 43–48, Stroudsburg, PA, USA. Association for Computational Linguistics. Desai, A., Gulwani, S., Hingorani, V., Jain, N., Karkare, A., Marron, M., R, S., and Roy, S. (2016). Program synthesis using natural language. In Proceedings of the 38th International Conference on Software Engineering, number 1 in ICSE '16, pages 345–356, New York, NY, USA. ACM. Dijkstra, E. W. (1978). On the foolishness of "natural language programming". In Friedrich L. Bauer et al., editors, Program Construction, International Summer School, July 26 - August 6, 1978, Marktoberdorf, ger- many, volume 69 of Lecture Notes in Computer Science, pages 51–53. Springer. Doddington, G. (2002). Automatic evaluation of machine translation quality using n-gram co-occurrence statistics. In Proceedings of the Second International Conference on Human Language Technology Research, HLT '02, pages 138–145, San Francisco, CA, USA. Morgan Kaufmann Publishers Inc. Dong, L. and Lapata, M. (2016). Language to logical form with neural attention. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 33–43, Berlin, Germany, August. Association for Computational Linguistics. Gal, Y. and Ghahramani, Z. (2016). A theoretically grounded application of dropout in recurrent neural net- works. In Daniel D. Lee, et al., editors, Advances in Neural Information Processing Systems 29: Annual Con- ference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pages 1019– 1027. Gu, J., Lu, Z., Li, H., and Li, V. O. K. (2016). Incorporating copying mechanism in sequence-to-sequence learning. In Proceedings of the 54th Annual Meeting of the Associ- ation for Computational Linguistics, ACL 2016, August 7-12, 2016, Berlin, Germany, Volume 1: Long Papers. Guu, K., Pasupat, P., Liu, E. Z., and Liang, P. (2017). From language to programs: Bridging reinforcement learning and maximum marginal likelihood. In Proceedings of the 55th Annual Meeting of the Association for Compu- tational Linguistics, ACL 2017, Vancouver, Canada, July 30 - August 4, Volume 1: Long Papers, pages 1051–1062. Haas, C. and Riezler, S. (2016). A corpus and semantic parser for multilingual natural language querying of open- streetmap. In Kevin Knight, et al., editors, NAACL HLT 2016, The 2016 Conference of the North American Chap- ter of the Association for Computational Linguistics: Hu- man Language Technologies, San Diego California, USA, June 12-17, 2016, pages 740–750. The Association for Computational Linguistics. Iyer, S., Konstas, I., Cheung, A., and Zettlemoyer, L. (2016). Summarizing source code using a neural attention model. In Proceedings of the 54th Annual Meeting of the Associ- ation for Computational Linguistics, ACL 2016, August 7-12, 2016, Volume 1: Long Papers, pages 2073–2083, Berlin, Germany. Iyer, S., Konstas, I., Cheung, A., Krishnamurthy, J., and Zettlemoyer, L. (2017). Learning a neural semantic parser from user feedback. In Proceedings of the 55th Annual Meeting of the Association for Computational Lin- guistics, ACL 2017, Vancouver, Canada, July 30 - August 4, Volume 1: Long Papers, pages 963–973. Jain, L. C. and Medsker, L. R. (1999). Recurrent Neural Networks: Design and Applications. CRC Press, Inc., Boca Raton, FL, USA, 1st edition. Kingma, D. P. and Ba, J. (2014). Adam: A method for stochastic optimization. Kushman, N. and Barzilay, R. (2013). Using semantic uni- fication to generate regular expressions from natural lan- guage. In Lucy Vanderwende, et al., editors, Human Lan- guage Technologies: Conference of the North American Chapter of the Association of Computational Linguistics, Proceedings, June 9-14, 2013, pages 826–836, Westin Peachtree Plaza Hotel, Atlanta, Georgia, USA. The Asso- ciation for Computational Linguistics. Kwiatkowski, T., Choi, E., Artzi, Y., and Zettlemoyer, L. (2013). Scaling semantic parsers with on-the-fly ontol- ogy matching. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 1545–1556, Seattle, Washington, USA, October. Association for Computational Linguistics. Lin, X. V., Wang, C., Pang, D., Vu, K., Zettlemoyer, L., and Ernst, M. D. (2017). Program synthesis from natu- ral language using recurrent neural networks. Technical Report UW-CSE-17-03-01, University of Washington De- partment of Computer Science and Engineering, Seattle, WA, USA, March. Ling, W., Blunsom, P., Grefenstette, E., Hermann, K. M., Kocisk´y, T., Wang, F., and Senior, A. (2016). Latent pre- dictor networks for code generation. In Proceedings of the 54th Annual Meeting of the Association for Computa- tional Linguistics, ACL 2016, August 7-12, 2016, Berlin, Germany, Volume 1: Long Papers. Locascio, N., Narasimhan, K., DeLeon, E., Kushman, N., and Barzilay, R. (2016). Neural generation of regu- lar expressions from natural language with minimal do- main knowledge. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, EMNLP, November 1-4, 2016, pages 1918–1923, Austin, Texas, USA. Long, R., Pasupat, P., and Liang, P. (2016). Simpler context- dependent logical forms via model projections. In Pro- ceedings of the 54th Annual Meeting of the Association for Computational Linguistics, ACL 2016, August 7-12, 2016, Berlin, Germany, Volume 1: Long Papers. Mooney, R. J. (2014). Semantic parsing: Past, present, and future. Nie, P., Li, J. J., Khurshid, S., Mooney, R., and Gligoric, M. (2018). Natural language processing and program analy- sis for supporting todo comments as software evolves. In Proceedings of the AAAI Workshop of Statistical Model- ing of Natural Software Corpora. Oda, Y., Fudaba, H., Neubig, G., Hata, H., Sakti, S., Toda, T., and Nakamura, S. (2015). Learning to generate pseudo-code from source code using statistical machine translation (T). In Myra B. Cohen, et al., editors, 30th IEEE/ACM International Conference on Automated Soft- ware Engineering, ASE 2015, Lincoln, NE, USA, Novem- ber 9-13, 2015, pages 574–584. IEEE Computer Society. Papineni, K., Roukos, S., Ward, T., and Zhu, W.-J. (2002). Bleu: A method for automatic evaluation of machine translation. In Proceedings of the 40th Annual Meeting on Association for Computational Linguistics, ACL '02, pages 311–318, Stroudsburg, PA, USA. Association for Computational Linguistics. Polosukhin, I. and Skidanov, A. (2018). Neural Program Search: Solving Programming Tasks from Description and Examples. ArXiv e-prints, February. Popescu, A.-M., Etzioni, O., and Kautz, H. (2003). Towards a theory of natural language interfaces to databases. In Proceedings of the 8th International Conference on In- telligent User Interfaces, IUI '03, pages 149–157, New York, NY, USA. ACM. Quirk, C., Mooney, R. J., and Galley, M. (2015). Language to code: Learning semantic parsers for if-this-then-that recipes. In Proceedings 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, Volume 1: Long Papers, pages 878–888, Beijing, China. The Association for Computer Linguistics. Sammet, J. E. (1966). The use of english as a programming language. Communications of the ACM, 9(3):228–230. Schuster, M. and Paliwal, K. (1997). Bidirectional recurrent neural networks. Trans. Sig. Proc., 45(11):2673–2681, November. Sutskever, I., Vinyals, O., and Le, Q. V. (2014). Sequence to sequence learning with neural networks. In Proceedings of the 27th International Conference on Neural Infor- mation Processing Systems, NIPS'14, pages 3104–3112, Cambridge, MA, USA. MIT Press. Tang, L. R. and Mooney, R. J. (2001). Using multiple clause constructors in inductive logic programming for semantic parsing. In Luc De Raedt et al., editors, Machine Learning: EMCL 2001, 12th European Conference on Machine Learning, Freiburg, Germany, September 5-7, 2001, Proceedings, volume 2167 of Lecture Notes in Computer Science, pages 466–477. Springer. Wilensky, R., Arens, Y., and Chin, D. (1984). Talking to unix in english: An overview of uc. Commun. ACM, 27(6):574–593, June. Wilensky, R., Chin, D. N., Luria, M., Martin, J., Mayfield, J., and Wu, D. (1988). The berkeley unix consultant project. Comput. Linguist., 14(4):35–84, December. Yao, Z., Weld, D., Chen, W.-P., and Sun, H. (2018). Staqc: A systematically mined question-code dataset from stack overflow. In Proceedings of the 27th International Con- ference on World Wide Web, WWW 2018, Lyon, France, April 23 - 27, 2018. Yih, W., Richardson, M., Meek, C., Chang, M., and Suh, J. (2016). The value of semantic parse labeling for knowl- edge base question answering. In Proceedings of the 54th Annual Meeting of the Association for Computational Lin- guistics, ACL 2016, August 7-12, 2016, Berlin, Germany, Volume 2: Short Papers. Yin, P. and Neubig, G. (2017). A syntactic neural model for general-purpose code generation. In Proceedings of the 55th Annual Meeting of the Association for Compu- tational Linguistics, ACL 2017, Vancouver, Canada, July 30 - August 4, Volume 1: Long Papers, pages 440–450. Zelle, J. M. and Mooney, R. J. (1996). Learning to parse database queries using inductive logic programming. In Proceedings of the Thirteenth National Conference on Artificial Intelligence - Volume 2, AAAI'96, pages 1050– 1055. AAAI Press. Zettlemoyer, L. S. and Collins, M. (2005). Learning to map sentences to logical form: Structured classification with probabilistic categorial grammars. In Proceedings of the Twenty-First Conference on Uncertainty in Artificial Intelligence, UAI'05, pages 658–666, Arlington, Virginia, United States. AUAI Press. Zhong, V., Xiong, C., and Socher, R. (2017). Seq2sql: Gen- erating structured queries from natural language using re- inforcement learning. arXiv preprint arXiv:1709.00103. Zhong, Z., Guo, J., Yang, W., Xie, T., Lou, J.-G., Liu, T., and Zhang, D. (2018). Generating regular expressions from natural language specifications: Are we there yet? In Proceedings of the AAAI Workshop of Statistical Modeling of Natural Software Corpora. Appendices A Additional Data Statistics A1. Distribution of Less Frequent Utilities Figure 4 illustrates the frequencies of the 52 least frequent bash utilities in our dataset. Among them, the most frequent utility dig appeared only 38 times in the dataset. 7 utilities appeared 5 times or less. We discuss in the next session that many of such low frequent utilities cannot be properly learned at this stage, since the limited number of training examples we have cannot cover all of their usages, or even a reasonably representative subset. Utility # flags # flags in train set find xargs grep rm echo sort chmod wc cat sleep shred apropos info bg fg wget zless bunzip2 clear 103 32 82 17 5 50 14 13 19 2 17 30 34 0 0 171 0 14 0 68 15 42 7 2 19 4 6 4 0 4 0 2 0 0 2 0 0 0 Table 13: Training set flag coverage. The upper-half of the table shows the 10 most frequent utilities in the corpus. The lower-half of the table shows the 10 least frequent utilities in the corpus. freelancers to judge the correctness of each pair. We also asked the freelancers to judge if the natural language descrip- tion is clear enough for them to understand the descriptor's goal. We then manually examined the judgments made by the two freelancers and summarize the findings below. The freelancers identified errors in 15 of the sampled train- ing pairs, which results in approximately 85% annotation accuracy of the training data. 3 of the errors are caused by the fact that some utilities (e.g. rm, cp, gunzip) han- dle directories differently from regular files, but the natural language description failed to clearly specify if the target objects include directories or not. 4 cases were typos made by our annotators when copying the constant values in a command to their descriptions. Being able to automati- cally detect constant mismatch may reduce the number of such errors. (Automatic mismatch detection can be directly added to the annotation interface.) The rest of the 8 cases were caused by the annotators mis-interpreted/omitted the function of certain flags/reserved tokens or failed to spot syn- tactic errors in the command (listed in Table 14). For many of these cases, the Bash commands are only of medium length - this shows that accurately describing all the infor- mation in a Bash command is still an error-prone task for Bash programmers. Moreover, some annotation mistakes are more thought-provoking as the operations in those ex- amples might be difficult/unnatural for the users to describe at test time. In these cases we should solicit the necessary information from the users through alternative ways, e.g. asking multi-choice questions for specific options or asking the user for examples. Only 1 description was marked as "unclear" by one of the freelancers. The other freelancer still judged it as "clear". Figure 4: Frequency radar chart of the 52 least frequent bash utilities in the datasets. A2. Flag Coverage Table 13 shows the total number of flags (both long and short) a utility has and the number of flags of the utility that appeared in the training set. We show the statistics for the 10 most and least frequent utilities in the corpus. We estimate the total number of flags a utility has by the number of flags we manually extracted from its GNU man page. The estimation is a lower bound as we might miss certain flags due to man page version mismatch and human errors. Noticed that for most of the utilities, only less than half of their flags appear in the train set. One reason contributed to the small coverage is that most command flags has a full-word replacement for readability (e.g. the readable re- placement for -t of cp is --target-directory), yet most Bash commands written in practice uses the short flags. We could solve this type of coverage problem by normalizing the commands to contain only the short flags. (Later we can use deterministic rules to show the readable version to the user.) Nevertheless, for many utilities a subset of their flags are still missing from the corpus. Conducting zero-shot learning for those missing flags is an interesting future work. B Data Quality We asked two freelancers to evaluate 100 text-command pairs sampled from our train set. The freelancers did not author the sampled set of pairs themselves. We asked the Find all executables under /path directory find /path -perm /ugo+x "Executables generaly means executable files, thus needs -type f. Also, /ugo+x should be -ugo+x. The current command lists all the directories too as directories generally have execute permission at least for the owner (/ugo+x allows that, while -ugo+x would require execute permission for all)." Search the current directory tree for all regular non-hidden files except *.o find ./ -type f -name "*" -not -name "*.o" "Criteria not met: non-hidden, requires something like -not -name '.*'." Display all the text files from the current folder and skip searching in skipdir1 and skipdir2 folders find . \( -name skipdir1 -prune , -name skipdir2 -prune -o -name "*.txt" \) -print "Result includes skipdir2 (this directory name only), the -o can be replaced with comma , to solve this." Find all the files that have been modified in the last 2 days (missing -daystart description) find . -type f -daystart -mtime -2 "daystart is not specified in description." Find all the files that have been modified since the last time we checked find /etc -newer /var/log/backup.timestamp -print "'Since the last time we checked', the backup file needs to be updated after the command completes to make this possible." Search for all the .o files in the current directory which have permisssions 664 and print them. find . -name *.o -perm 664 -print "Non-syntactical command. Should be .o or "*.o"." Search for text files in the directory "/home/user1" and copy them to the directory /home/backup find /home/user1 -name '*.txt' xargs cp -av --target-directory=/home/backup/ --parents "--parents not specified in description, it creates all the parent dirs of the files inside target dir, e.g, a file named a.txt would be copied to /home/backup/home/user1/a.txt." Search for the regulars file starting with HSTD (missing case insensitive description) which have been modified yesterday from day start and copy them to /path/tonew/dir -type f -iname 'HSTD*' -daystart -mtime 1 -exec cp {}/path/to new/dir/ \; find . "Case insensitive not specified but -iname used, extra spaces in /path/to new/dir/." Table 14: Training examples whose NL description has errors (underlined). The error explanation is written by the freelancer. Similar trend were observed during the manual evaluation - the freelancers have little problem understanding each other's descriptions. It is worth noting that while we found 15 wrong pairs out of 100, for 13 of them the annotator only misinterpreted one of the command tokens. Hence the overall performance of the annotators is high, especially given the large domain size. C Automatic Evaluation Results We report two types of fuzzy evaluation metrics automati- cally computed over full dev set in table 15. We define TM as the maximum percentage of close-vocabulary token (util- ities, flags and reserved tokens) overlap between a predicted command and the reference commands. (TM is a command structure accuracy measurement.) TMk is the maximum TM score achieved by the top-k candidates generated by a sys- tem. We use BLEU as an approximate measurement for full command accuracy. BLEUk is the maximum BLEU score achieved by the top-k candidates generated by a system. First, we observed from table 15 that while the automatic Model Seq2Seq CopyNet Char Token Sub-token Char Token Sub-token Tellina BLEU1 BLEU3 TM1 TM3 0.64 0.75 0.71 0.61 0.74 0.71 0.70 0.57 0.65 0.65 0.54 0.65 0.64 0.61 49.1 36.1 46 49.1 44.9 55.3 46 56.7 43.9 52 56.8 54.2 61.8 52 Table 15: Automatically measured performance of the base- line systems on the full dev set. evaluation metrics agrees with the manual ones (Table 8) on the system with the highest full command accuracy and the system with the highest command structure accuracy, they do not agree with the manual evaluation in all cases (e.g. character-based models have the second-best BLEU score). Second, the TM score is not discriminative enough – several systems scored similarly on this metrics.
1805.06413
1
1805
2018-05-16T16:38:38
CASCADE: Contextual Sarcasm Detection in Online Discussion Forums
[ "cs.CL" ]
The literature in automated sarcasm detection has mainly focused on lexical, syntactic and semantic-level analysis of text. However, a sarcastic sentence can be expressed with contextual presumptions, background and commonsense knowledge. In this paper, we propose CASCADE (a ContextuAl SarCasm DEtector) that adopts a hybrid approach of both content and context-driven modeling for sarcasm detection in online social media discussions. For the latter, CASCADE aims at extracting contextual information from the discourse of a discussion thread. Also, since the sarcastic nature and form of expression can vary from person to person, CASCADE utilizes user embeddings that encode stylometric and personality features of the users. When used along with content-based feature extractors such as Convolutional Neural Networks (CNNs), we see a significant boost in the classification performance on a large Reddit corpus.
cs.CL
cs
CASCADE: Contextual Sarcasm Detection in Online Discussion Forums Devamanyu Hazarika Soujanya Poria Sruthi Gorantla School of Computing, Artificial Intelligence Initiative, Computer Science & Automation National University of Singapore [email protected] A*STAR, Singapore Indian Institute of Science, Bangalore [email protected] [email protected] Erik Cambria School of Computer Science and Engineering, NTU, Singapore [email protected] Roger Zimmermann School of Computing, National University of Singapore [email protected] Rada Mihalcea Computer Science & Engineering University of Michigan, Ann Arbor [email protected] Abstract The literature in automated sarcasm detection has mainly focused on lexical, syntactic and semantic-level analysis of text. However, a sarcastic sentence can be expressed with contextual presumptions, background and commonsense knowledge. In this paper, we propose CASCADE (a ContextuAl SarCasm DEtector) that adopts a hybrid approach of both content and context-driven modeling for sarcasm detection in online social media discussions. For the latter, CASCADE aims at extracting contextual information from the discourse of a discussion thread. Also, since the sarcastic nature and form of expression can vary from person to person, CASCADE utilizes user embeddings that encode stylometric and personality features of the users. When used along with content-based feature extractors such as Convolutional Neural Networks (CNNs), we see a significant boost in the classification performance on a large Reddit corpus. Introduction 1 Sarcasm is a linguistic tool that uses irony to express contempt. Its figurative nature poses a great challenge for affective systems performing sentiment analysis. Previous research in automated sarcasm detection has primarily focused on lexical, pragmatic cues found in sentences (Kreuz and Caucci, 2007). Interjections, punctuations, sentimental shifts, etc., have been considered as major indicators of sarcasm (Joshi et al., 2017). When such lexical cues are present in sentences, sarcasm detection can achieve high accuracy. However, sarcasm is also expressed implicitly, i.e., without the use of any explicit lexical cues. Such use of sarcasm also relies on the context which involves the presumption of commonsense and background knowledge of an event. When it comes to detecting sarcasm in a discussion forum, it may not only require understanding the context of the previous comments but also need necessary external background knowledge about the topic of discussion. The usage of slangs and informal language also diminishes the reliance on lexical cues. This particular type of sarcasm is tough to detect (Poria et al., 2016). Contextual dependencies for sarcasm can take many forms. As an example, a sarcastic post from Reddit1, "I'm sure Hillary would've done that, lmao." requires background knowledge about the event, i.e., Hillary Clinton's action at the time the post was made. Similarly, sarcastic posts like "But atheism, yeah *that's* a religion!" requires the knowledge that topics like atheism often contain argumentative discussions and are more prone towards sarcasm. In this work, we attempt the task of sarcasm detection in online discussion forums. Particularly, we propose a hybrid network, named CASCADE, that utilizes both content and contextual-information required for sarcasm detection. It starts by processing contextual information in two ways. First, it performs user profiling to create user embeddings that capture indicative behavioral traits for sarcasm. Recent findings suggest that such modeling of the user and their preferences, is highly effective for the given task (Amir et al., 2016). It makes use of users' historical posts to model their writing style (stylometry) and personality indicators, which are then fused into comprehensive user embeddings using a multi-view fusion approach, Canonical Correlation Analysis (CCA). Second, it extracts contextual 1https://www.reddit.com/ 8 1 0 2 y a M 6 1 ] L C . s c [ 1 v 3 1 4 6 0 . 5 0 8 1 : v i X r a information from the discourse of comments in the discussion forums. This is done by document modeling of these consolidated comments belonging to the same forum. We hypothesize that these discourse features would give the important contextual information, background cues along with topical information required for detecting sarcasm. After the contextual modeling phase, CASCADE is provided with a comment for sarcasm detection. It performs content-modeling using a Convolutional Neural Network (CNN) to extract its syntactic features. This CNN representation is then concatenated with the relevant user embedding and discourse features to get the final representation which is used for classification. The overall contribution of this work can be summarized as: • We propose a novel hybrid sarcasm detector, CASCADE that models content and contextual information. • We model stylometric and personality details of users along with discourse features of discussion forums to learn informative contextual representations. Experiments on a large Reddit corpus, SARC, demonstrate significant performance improvement over state-of-the-art automated sarcasm detectors. In the remaining paper, Section 2 compares our model to related works; Section 3 provides the task description and proposed approach; here, Section 3.3 explains the process of learning contextual features comprising user embeddings and discourse features; Section 3.6 presents the hybrid prediction model followed by experimentation details and result analysis in Section 4; finally, Section 5 draws conclusion. 2 Related Work Automated sarcasm detection is a relatively recent field of research. The previous works in the literature can be largely classified into two categories, content and context-based sarcasm detection models. Content-based: These networks model the problem of sarcasm detection as a standard classification task and try to find lexical and pragmatic indicators to identify sarcasm. Numerous works have taken this path and presented innovative ways to unearth interesting cues for sarcasm. Tepperman et al. (2006) investigate sarcasm detection in spoken dialogue systems using prosodic and spectral cues. Carvalho et al. (2009) use linguistic features like positive predicates, interjections and gestural clues such as emoticons, quotation marks, etc. Davidov et al. (2010), Tsur et al. (2010) use syntactic patterns to construct classifiers. Gonz´alez-Ib´anez et al. (2011) also study the use of emoticons, mainly amongst tweets. Riloff et al. (2013) assert sarcasm to be a contrast to positive sentiment words and negative situations. Joshi et al. (2015) use multiple features comprising lexical, pragmatics, implicit and explicit context incongruity. In the explicit case, they include relevant features to detect thwarted sentimental expectations in the sentence. For implicit incongruity, they generalize Riloff et al. (2013)'s work in identifying verb-noun phrases containing contrast in both polarities. Context-based: Usage of contextual sarcasm has increased in the recent past, especially in online platforms. Texts found in microblogs, discussion forums, social media, etc., are plagued by grammatical inaccuracies and contain information which is highly temporal and contextual. In such scenarios, mining linguistic information becomes relatively inefficient and need arises for additional clues (Carvalho et al., 2009). Wallace et al. (2014) demonstrate this need by showing how traditional classifiers fail in instances where humans require additional context. They also indicate the importance of speaker and/or topical information associated to a text to gather such context. Poria et al. (2016) use additional information by sentiment, emotional and personality representations of the input text. Previous works have mainly used historical posts of users to understand sarcastic tendencies (Rajadesingan et al., 2015; Zhang et al., 2016). Khattri et al. (2015) try to find users' sentiments towards entities in their histories to find contrasting evidence. Wallace et al. (2015) utilize sentiments and noun phrases used within a forum to gather context typical to that forum. Such forum based modeling simulates user-communities. Our work follows similar motivation where we explore context provided by user profiling and the topical knowledge embedded in the discourse of comments in discussion-forums (subreddits 2). Amir et al. (2016) perform user modeling by learning embeddings that capture homophily. This work is closest to our approach given 2https://www.reddit.com/reddits/ the fact that we too learn user embeddings to acquire context. However, we take a different approach that involve stylometric and personality description of the users. Empirical evidence shows that these proposed features are better than previous user modeling approaches. Moreover, we learn discourse features which has not been explored before in the context of this task. 3 Method 3.1 Task Definition The task involves detection of sarcasm for comments made in online discussion forums, i.e., Reddit. Let us denote the set U ={u1, ..., uNu} for Nu-users, where each user participates across a subset of Nt-discussion forums (subreddits). For a comment Cij made by the ith user ui in the jth discussion forum tj, the objective is to predict whether the comment posted is sarcastic or not. 3.2 Summary of the Proposed Approach Given the comment Cij to be classified, CASCADE leverages content and context-based information from the comment. For content-based modeling of Cij, a CNN is used to generate the representation vector ci,j for a comment. CNNs generate abstract representations of text by extracting location-invariant local patterns. This vectorci,j captures both syntactic and semantic information useful for the task at hand. user embeddingui of user ui and discourse feature vectortj of forum tj. Finally, all three vectorsci,j, ui, andtj are concatenated and used for the classification (Section 3.6). One might argue that instead For contextual modeling, CASCADE first learns user embeddings and discourse features of all users and discussion forums, respectively (Section 3.3). Following this phase, CASCADE then retrieves the learnt of using one CNN, we could use multiple CNN (explained in (Majumder et al., 2017)) to get better text representations whenever a comment contains multiple sentences. However that is out of the scope of this work. Here, we aim to show the effectiveness of user specific analysis and context-based features extracted from the discourse. Also the use of a single CNN for text representation helps to consistently compare with the state of the art. 3.3 Learning Contextual Features We now detail the procedures to generate the contextual features, i.e., user embeddings and discourse features. The user embeddings try to capture users' traits that correlate to their sarcastic tendencies. These embeddings are created considering the accumulated historical posts of each user (Section 3.4). Contextual information are also extracted from the discourse of comments within each discussion forum. These extracted features are named as discourse features (Section 3.5). The aim of learning these contextual features is to acquire discriminative information crucial for sarcasm detection. 3.4 User Embeddings To generate user embeddings, we model their stylometric and personality features and then fuse them using CCA to create a single representation. Below we explain the generation of user embeddingui, for the ith user ui. Figure 1 also summarizes the overall architecture for this user profiling. 3.4.1 Stylometric features People possess their own idiolect and authorship styles, which is reflected in their writing. These styles are generally affected by attributes such as gender, diction, syntactic influences, etc. (Cheng et al., 2011; Stamatatos, 2009) and present behavioral patterns which aid sarcasm detection (Rajadesingan et al., 2015). We use this motivation to learn stylometric features of the users by consolidating their online comments into documents. We first gather all the comments by a user and create a document by appending them using a special delimiter <END>. An unsupervised representation learning method ParagraphVector (Le and Mikolov, 2014) is then applied on this document. This method generates a fixed-sized vector for each user by performing the auxiliary task of predicting the words within the documents. The choice of ParagraphVector is governed by multiple reasons. Apart from its ability to effectively encode a user's writing style, it has the advantage of applying to variable lengths of text. ParagraphVector also has been shown to perform well for sentiment classification tasks. The existence of synergy between sentiment and sarcastic orientation of a sentence also promotes the use of this method. first mapped to unique vectors such that each vector is represented by a column in matrix D∈ Rds×Nu and Ws∈ Rds×V, respectively. Here, ds is the embedding size andV represents the size of the vocabulary. We now describe the functioning of this method. Every user-document and all words within them are 1 ni Continuous-bag-of-words approach (Mikolov et al., 2013) is then performed where a target word is predicted given the word vectors from its context-window. The key idea here is to use the document vector of the associated document as part of the context words. More formally, given a user-document di for user ui comprising a sequence of ni-words w1, w2, ..., wni, we calculate the average log probability of predicting each word within a sliding context window of size ks. This average log probability is: To predict a word within a window, we take the average of all the neighboring context word vectors log p(wtdi, wt−ks, ..., wt+ks) ni−ksQ t=ks along with the document vector di and use a neural network with softmax prediction: p(wtdi, wt−ks, ..., wt+ks)= eywt∑i eyi Here,y=[y1, ..., yV] is the output of the neural network, i.e., y= Udh(di, wt−ks, ..., wt+ks; D, Ws)+bd bd∈ RV, Ud∈ RV×ds are parameters and h(⋅) represents the average of vectors di, wt−ks, ..., wt+ks taken from D and Ws. Hierarchical softmax is used for faster training (Morin and Bengio, 2005). Finally, after training, D learns the users' document vectors which represent their stylometric features. (1) (3) (2) For user ui, we iterate over all the vi-comments {S1 3.4.2 Personality features Discovering personality from text has numerous NLP applications such as product recognition, mental health diagnosis, etc. (Majumder et al., 2017). Described as a combination of multiple characteristics, personality detection helps in identifying behavior, thought patterns of an individual. To model the dependencies of users' personality with their sarcastic nature, we include personality features in the user embeddings. Previously, Poria et al. (2016) also utilize personality features in sentences. However, we take a different and more-involved approach of extracting the personality features of a user instead. ui} written by them. For each Sj ui, we provide the comment as an input to a pre-trained Convolutional Neural Network (CNN) which has been trained on a multi-label personality detection task. Specifically, the CNN is pre-trained on a benchmark corpus developed by Matthews and Gilliland (1999) which contains 2, 400 essays and is labeled with the Big-Five personality traits, i.e., Openness, Conscientiousness, Extraversion, Agreeableness, and Neuroticism (OCEAN). After the training, this CNN model is used to infer the personality traits present in each comment. This is done by extracting the activations of the CNN's last hidden layer vector which ui. The expectation over the personality vectors for all vi-comments we call as the personality vectorpj made by the user is then defined as the overall personality feature vectorpi of user ui: ui, ..., Svi pi = Ej∈[vi][pj ui ] = 1 pj ui viQ j=1 vi CNN: Here, we describe the CNN that generates the personality vectors. Given a user's comment, which is a text S=[w1, ..., wn] composed of n words, each word wi is represented as a word embedding wi∈ Rdem using the pre-trained FastText embeddings (Bojanowski et al., 2016). A single-layered CNN is filters F[1,2,3]∈ Rdem×h[1,2,3] of heights h[1,2,3], respectively. For each k∈{1, 2, 3}, filter Fk slides across then modeled on this input sequence S (Kim, 2014). First, a convolutional layer is applied having three (4) whose each entry mk,j is obtained as: Figure 1: The figure describes the process of user profiling. Stylometric and Personality embeddings are generated and then fused in a multi-view setting using CCA to get the user embeddings. S and extracts hk-gram features at each instance. This creates a feature map vector mk of size RS−hk+1, mk,j= α( Fk⋅ S[j∶j+hk−1]+ bk) here, bk∈ R is the bias and α(⋅) is a non-linear activation function. feature maps computed from Fk, output ok is calculated as, ok=[ max(m1 1)]. Overall the max-pooling output is calculated by concatenation of each ok to geto=[o1⊕ o2⊕ o3]∈ R3M , where⊕ represents concatenation. Finally,o is projected onto a dense layer with dp neurons followed by the final M feature maps are created from each filter Fk giving a total of 3M feature maps as output. Following this, a max-pooling operation is performed across the length of each feature map. Thus, for all M 1), ..., max(mM (5) sigmoid-prediction layer with 5 classes denoting the five personality traits (Matthews et al., 2003). We use sigmoid instead of softmax to facilitate multi-label classification. This is calculated as, W1∈ Rdp×3M , W2∈ R5×dp,b1∈ Rdp andb2∈ R5 are parameters and α(.) represents non-linear activation. , where (6) y= σ( W2q+b2) q= α( W1o+b1) 3.4.3 Fusion We take a multi-view learning approach to combine both stylometric and personality features into a comprehensive embedding for each user. We use Canonical Correlation Analysis (CCA) (Hotelling, 1936) to perform this fusion. CCA captures maximal information between two views and creates a combined representation (Hardoon et al., 2004; Benton et al., 2016). In the event of having more than two views, fusion can be performed using an extension of CCA called Generalized CCA (see Supplementary). Canonical Correlation Analysis: Let us consider the learnt stylometric embedding matrix D∈ Rds×Nu and personality embedding matrix P∈ Rdp×Nu containing the respective embedding vectors of user ui We call these new matrices as X1 and X2, respectively. Let the correlation matrix for X1 be R11 = T ∈ Rdp×dp and the cross-correlation matrix between them be T∈ Rds×dp. For each user ui, the objective of CCA is to find the linear projections of both R12= X1X2 T ∈ Rds×ds, for X2 be R22= X2X2 in their ith columns. The matrices are then mean-centered and standardized across all user columns. X1X1 embedding vectors that have a maximum correlation. We create K such projections, i.e., K-canonical variate pairs such that each pair of projection is orthogonal with respect to the previous pairs. This is done by constructing: where, A1∈ Rds×K, A2∈ Rdp×K and W T W = ZT Z= I. To maximize correlation between W and Z, W= X T 22 = AΛB − 1 1 A1 and Z= X T , where A1= R 11 A and A2= R − 1 optimal A1 and A2 are calculated by performing singular value decomposition as: 11 R12R − 1 − 1 22 B 2 A2 (7) R 2 2  2 2 (8) … post 1 … <END> … post 2 … <END>… post 1 … <END> … post 2 … <END>Usersu1uNuParagraphVectorStylometric embeddingsu1uNuAverageAveragePersonality embeddingsMultiview Fusion CCAUser embeddings⃗d1⃗dNu⃗pNu⃗p1Post 1Personality CNNPersonality CNN1AveragePersonality CNNPersonality CNNNuPost vPost 1Post v representationci,j is extracted using a CNN and appended with context vectorsui andtj. Figure 2: This figure presents the overall hybrid network CASCADE. For the comment Ci,j, its content-based sentential It can be seen that, W T W= A1 T R11A1= AT A= I T R22A2= BT B= I Once optimal A1 and A2 are calculated, overall user embeddingui∈ RK of user ui is generated by fusion of di andpi as: and ZT Z= A2 also, W T Z= ZT W= Λ ui=(di)T A1+(pi)T A2 (9) (10) (11) 3.5 Discourse Features Similar to how a user influences the degree of sarcasm in a comment, we assume that the discourse of comments belonging to a certain discussion forum contain contextual information relevant to the sarcasm classification. They embed topical information that selectively incur bias towards degree of sarcasm in the comments of a discussion. For example, comments on political leaders or sports matches are generally more susceptible to sarcasm than natural disasters. Contextual information extracted from the discourse of a discussion can also provide background knowledge or cues about the topic of that discussion. To extract the discourse features, we take a similar approach of document modeling performed for stylometric features (Section 3.4.1). For all Nt-discussion forums, we compose each forum's document by appending the comments within them. As before, ParagraphVector is employed to generate discourse representations for each document. We denote the learnt feature vector of jth forum tj astj∈ Rdt. Following the extraction of text representationci,j for comment Ci,j and retrieval of user embeddingui for author ui and discourse feature vectortj for discussion forum tj, we concatenate all three vectors to form the unified text representation ci,j=[ci,j⊕ui⊕tj]. Here,⊕ refers to concatenation. The CNN used for extraction ofci,j has the same design as the CNN we used to extract personality features described in 3.6 Final Prediction Section 3.4.2. Finally, ci,j is projected to the output layer having two neurons with a softmax activation. This gives a softmax-probability over whether a comment is sarcastic or not. This probability estimate is then used to calculate the categorical cross-entropy which is used as the loss function: Loss=−1 N yi,j log2( yi,j) 2Q NQ j=1 i=1 y= sof tmax(Wo ci,j+bo) , where (12) Here, N is the number of comments in the training set, yi is the one-hot vector ground truth of the ith comment and yi,j is its predicted probability of belonging to class j. Redditissoliberalandprogressive !CommentContent ModelingContext Modeling⃗ui⃗tjUser EmbeddingDiscourse feature vectorClassificationCi,j⃗ci,jInput embedding sequence of sentenceConvolution with multiple filter widths and feature mapsMax-pooling over time 4 Experimental Results 4.1 Dataset We perform our experiments on a large-scale self-annotated corpus for sarcasm, SARC3 (Khodak et al., 2017). This dataset contains more than a million examples of sarcastic/non-sarcastic statements made in the social media site Reddit. Reddit comprises of topic-specific discussion forums, also known as subreddits, each titled by a post. In each forum, users communicate either by commenting to the titled post or other's comments, resulting in a tree-like conversation structure. This structure can be unraveled to a linear format, thus creating a discourse of the comments by keeping the topological constraints intact. Each comment is accompanied with its author details and parent comments (if any) which is subsequently used for our contextual processing. It is important to note that almost all comments in the SARC dataset are composed of a single sentence. We consider three variants of the SARC dataset in our experiments. • Main balanced: This is the primary dataset which contains a balanced distribution of both sarcastic and non-sarcastic comments. The dataset contains comments from 1246058 users (118940 in training and 56118 in testing set) distributed across 6534 forums (3868 in training and 2666 in testing set). • Main imbalanced: To emulate real-world scenarios where the sarcastic comments are typically lesser than non-sarcastic ones, we use an imbalanced version of the Main dataset. Specifically, we maintain a 20∶ 80 ratio (approx.) between the sarcastic and non-sarcastic comments in both training/testing sets. • Pol: To further test the effectiveness of our user embeddings, we perform experiments on a subset of Main, comprising of forums associated with the topic of politics. Table 1 provides the comment distribution of all the dataset variants mentioned. Training set Testing set avg. no. of words per comment non-sarc no. of comments non-sarc sarc 77351 77351 25784 77351 6834 6834 no. of comments non-sarc sarc 32333 32333 10778 32333 1703 1703 sarc 55.08 55.21 62.36 55.13 55.13 64.74 ∗non-sarc: non-sarcastic, sarc: sarcastic avg. no. of words per comment non-sarc sarc 55.01 55.48 62.14 55.55 55.55 62.99 Main Pol balanced imbalanced balanced Table 1: Details of comments in the SARC datasets. The choice of using SARC for our experiments comes with multiple reasons. First, this corpus is the first of its kind that was purposely developed to investigate the necessity of contextual information in sarcasm classification. This characteristic aligns well with the main goal of this paper. Second, the large size of the corpus allows for statistically-relevant analyses. Third, the dataset annotations contain a small false-positive rate for sarcastic labels thus providing reliable annotations. Also, its self-annotation scheme rules out the annotation errors induced by third-party annotators. Finally, the corpus structure provides meta-data (e.g., user information) for its comments, which is useful for contextual modeling. 4.2 Training details We hold out 10% of the training data for validation. Hyper-parameter tuning is performed using this validation set through RandomSearch (Bergstra and Bengio, 2012). To optimize the parameters, Adam optimizer (Kingma and Ba, 2014) is used, starting with an initial learning rate of 1e−4. The learnable parameters in the network consists of θ={Ud, D, W[1,2,o,s], F[1,2,3],b[1,2,o,d], b[1,2,3]}. Training termi- hyper-parameters are found to be{ds, dp, dt, K}= 100, dem= 300, ks= 2, M = 128, and α= ReLU nation is decided using early stopping technique with a patience of 12. For the batched-modeling of comments in CNNs, each comment is either restricted or padded to 100 words for uniformity. The optimal (Implementation details are provided in the supplementary). 3http://nlp.cs.princeton.edu/SARC/ Models Main balanced Bag-of-Words CNN CNN-SVM (Poria et al., 2016) CUE-CNN (Amir et al., 2016) CASCADE (no personality features) CASCADE ∆SOT A †:significantly better than CUE-CNN (Amir et al., 2016). Accuracy 0.63 0.65 0.68 0.70 0.68 0.77† ↑ 7% F1 0.64 0.66 0.68 0.69 0.66 0.77† ↑ 8% imbalanced F1 0.76 0.78 0.79 0.81 0.80 0.86† Accuracy 0.68 0.69 0.69 0.73 0.71 0.79† ↑ 6% ↑ 5% Pol Accuracy 0.59 0.62 0.65 0.69 0.68 0.74† ↑ 5% F1 0.60 0.63 0.67 0.70 0.70 0.75† ↑ 5% assert significance when p< 0.05 under paired-t test. Results comprise of 10 runs with different initializations. The bottom row Table 2: Comparison of CASCADE with state-of-the-art networks and baselines on multiple versions of the SARC dataset. We shows the absolute difference with respect to the CUE-CNN system. 4.3 Baseline Models Here we describe the state-of-the-art methods and baselines that we compare CASCADE with. • Bag-of-Words: This model uses a comment's word-counts as features in a vector. The size of the vector is the vocabulary size of the training dataset. • CNN: We compare our model with this individual CNN version. This CNN is capable of modeling only the content of a comment. The architecture is similar to the CNN used in CASCADE (see Section 3.2). • CNN-SVM: This model proposed by Poria et al. (2016) consists of a CNN for content modeling and other pre-trained CNNs for extracting sentiment, emotion and personality features from the given comment. All the features are concatenated and fed into an SVM for classification. • CUE-CNN: This method proposed by Amir et al. (2016) also models user embeddings with a method akin to ParagraphVector. Their embeddings are then combined with a CNN thus forming the CUE-CNN model. We compare with this model to analyze the efficiency of our embeddings as opposed to theirs. Released software4 is used to produce results on the SARC dataset. 4.4 Results Table 2 presents the performance results on the SARC datasets. CASCADE manages to achieve major improvement across all datasets with statistical significance. The lowest performance is obtained by the Bag-of-words approach whereas all neural architectures outperform it. Amongst the neural networks, the CNN baseline receives the least performance. CASCADE comfortably beats the state-of-the-art neural models CNN-SVM and CUE-CNN. Its improved performance on the Main imbalanced dataset also reflects its robustness towards class imbalance and establishes it as a real-world deployable network. We further compare our proposed user-profiling method with that of CUE-CNN, with absolute dif- ferences shown in the bottom row of Table 2. Since CUE-CNN generates its user embeddings using a method similar to the ParagraphVector, we test the importance of personality features being included in our user profiling. As seen in the table, CASCADE without personality features drops in performance to a range similar to CUE-CNN. This suggests that the combination of stylometric and personality features are indeed crucial for the improved performance of CASCADE. 4.5 Ablation Study We experiment on multiple variants of CASCADE so as to analyze the importance of the various features present in its architecture. Table 3 provides the results of all the combinations. First, we test performance for the content-based CNN only (row 1). This setting provides the worst relative performance with almost 10% lesser accuracy than optimal. Next, we include contextual features to this network. Here, the effect of discourse features is primarily seen in the Pol dataset getting an increase of 3% in F1 (row 2). A major boost in performance is observed (8− 12% accuracy and F1) when user embeddings are introduced (row 5). Visualization of the user embedding cluster (Section 4.6) provides insights for this positive trend. 4https://github.com/samiroid/CUE-CNN Overall, CASCADE consisting of CNN with user embeddings and contextual discourse features provide the best performance in all three datasets (row 6). We challenge the use of CCA for the generation of user embeddings and thus replace it with simple concatenation. This however causes a significant drop in performance (row 3). Improvement is not observed even when discourse features are used with these concatenated user embeddings (row 4). We assume the increase in parameters caused by concatenation for this performance degradation. CCA on the other hand creates succinct representations with maximal information, giving better results. 4.6 User Embedding Analysis We investigate the learnt user embeddings in more detail. In particular, we plot random samples of users on a 2D-plane using t-SNE (Maaten and Hinton, 2008). The users who have greater sarcastic comments (atleast 2 more than the other type) are termed as sarcastic users (colored red). Conversely, the users having lesser sarcastic comments are called non-sarcastic users (colored green). Equal number of users from both the categories are plotted. We aim to analyze the reason behind the performance boost provided by the user embeddings as shown in Table 3. We see in Figure 3 that both the user types belong to similar distributions. However, the sarcastic users have a greater spread than the non-sarcastic ones (red belt around the green region). This is also evident from the variances of the distributions where the sarcastic distribution comprises of 10.92 variance as opposed to 5.20 variance of the non-sarcastic distribution. We can infer from this observation that the user embeddings belonging to this non-overlapping red-region provide discriminative information regarding the sarcastic tendencies of their users. 4.7 Case Studies Results demonstrate that discourse features provide an improvement over baselines, especially on the Pol dataset. This signifies the greater role of the contextual cues for classifying comments in this dataset over the other dataset variants used in our experiment. Below, we present a couple of cases from the Pol dataset where our model correctly identifies the sarcasm which is evident only with the neighboring comments. The previous state-of-the-art CUE-CNN, however, misclassifies them. • For the comment Whew, I feel much better now!, its sarcasm is evident only when its previous comment is seen So all of the US presidents are terrorists for the last 5 years. • The comment The part where Obama signed it. doesn't seem to be sarcastic until looked upon as a remark to its previous comment What part of this would be unconstitutional?. Such observations indicate the impact of discourse features. However, sometimes contextual cues from the previous comments are not enough and misclassifications are observed due to lack of necessary commonsense and background knowledge about the topic of discussion. There are also other cases where our model fails despite the presence of contextual information from the previous comments. During exploration, this is primarily observed for contextual comments which are very long. Thus, sequential discourse modeling using RNNs may be better suited for such cases. Also, in the case of user embeddings, CASCADE user concat. course Acc. dis- balanced F1 Main imbalanced Acc. F1 Pol cca - 1. - 2. 3. - 4. - 5.  6.  - -   - - -  -  -  Acc. F1 0.65 0.66 0.69 0.78 0.62 0.63 0.66 0.66 0.68 0.78 0.63 0.66 0.66 0.66 0.69 0.79 0.62 0.61 0.65 0.67 0.71 0.85 0.63 0.66 0.77 0.76 0.80 0.86 0.70 0.70 0.78 0.77 0.79 0.86 0.74 0.75 Table 3: Comparison with variants of the proposed CASCADE network. All combinations use content-based CNN. Figure 3: 2D-Scatterplot of the user embeddings visualized using t-SNE (Maaten and Hinton, 2008). sarcastic non-sarcastic misclassifications were common for users with lesser historical posts. In such scenarios, potential solutions would be to create user networks and derive information from similar users within the network. These are some of the issues which we plan to address in future work. 5 Conclusion In this paper we introduce Contextual Sarcasm Detector called as CASCADE which leverages both content and contextual information for the classification. For contextual details, we perform user profiling along with discourse modeling from comments in discussion threads. When this information is used jointly with a CNN-based textual model, we obtain state-of-the-art performance on a large-scale Reddit corpus. Our results show that discourse features along with user embeddings play a crucial role in the performance of sarcasm detection. References Silvio Amir, Byron C Wallace, Hao Lyu, and Paula Carvalho M´ario J Silva. 2016. Modelling context with user embeddings for sarcasm detection in social media. arXiv preprint arXiv:1607.00976. Adrian Benton, Raman Arora, and Mark Dredze. 2016. Learning multiview embeddings of twitter users. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), volume 2, pages 14–19. James Bergstra and Yoshua Bengio. 2012. Random search for hyper-parameter optimization. Journal of Machine Learning Research, 13(Feb):281–305. Piotr Bojanowski, Edouard Grave, Armand Joulin, and Tomas Mikolov. 2016. Enriching word vectors with subword information. arXiv preprint arXiv:1607.04606. Paula Carvalho, Lu´ıs Sarmento, M´ario J Silva, and Eug´enio De Oliveira. 2009. Clues for detecting irony in In Proceedings of the 1st international CIKM workshop on user-generated contents: oh...!! Topic-sentiment analysis for mass opinion, pages 53–56. ACM. it's so easy;-. Na Cheng, Rajarathnam Chandramouli, and KP Subbalakshmi. 2011. Author gender identification from text. Digital Investigation, 8(1):78–88. Dmitry Davidov, Oren Tsur, and Ari Rappoport. 2010. Semi-supervised recognition of sarcastic sentences in twitter and amazon. In Proceedings of the fourteenth conference on computational natural language learning, pages 107–116. Association for Computational Linguistics. Roberto Gonz´alez-Ib´anez, Smaranda Muresan, and Nina Wacholder. 2011. Identifying 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, pages 581–586. Association for Computational Linguistics. David R Hardoon, Sandor Szedmak, and John Shawe-Taylor. 2004. Canonical correlation analysis: An overview with application to learning methods. Neural computation, 16(12):2639–2664. Harold Hotelling. 1936. Relations between two sets of variates. Biometrika, 28(3/4):321–377. Aditya Joshi, Vinita Sharma, and Pushpak Bhattacharyya. 2015. Harnessing context incongruity for sarcasm detection. In Proceedings 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), volume 2, pages 757–762. Aditya Joshi, Pushpak Bhattacharyya, and Mark J Carman. 2017. Automatic sarcasm detection: A survey. ACM Computing Surveys (CSUR), 50(5):73. Anupam Khattri, Aditya Joshi, Pushpak Bhattacharyya, and Mark Carman. 2015. Your sentiment precedes you: Using an author's historical tweets to predict sarcasm. In Proceedings of the 6th Workshop on Computational Approaches to Subjectivity, Sentiment and Social Media Analysis, pages 25–30. Mikhail Khodak, Nikunj Saunshi, and Kiran Vodrahalli. 2017. A large self-annotated corpus for sarcasm. arXiv preprint arXiv:1704.05579. Yoon Kim. 2014. Convolutional neural networks for sentence classification. In Proceedings of the 2014 Confer- ence on Empirical Methods in Natural Language Processing (EMNLP), pages 1746–1751. Diederik P Kingma and Jimmy Ba. 2014. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980. Roger J Kreuz and Gina M Caucci. 2007. Lexical influences on the perception of sarcasm. In Proceedings of the Workshop on computational approaches to Figurative Language, pages 1–4. Association for Computational Linguistics. Quoc Le and Tomas Mikolov. 2014. Distributed representations of sentences and documents. In Proceedings of the 31st International Conference on Machine Learning (ICML-14), pages 1188–1196. Laurens van der Maaten and Geoffrey Hinton. 2008. Visualizing data using t-sne. Journal of machine learning research, 9(Nov):2579–2605. Navonil Majumder, Soujanya Poria, Alexander Gelbukh, and Erik Cambria. 2017. Deep learning-based document modeling for personality detection from text. IEEE Intelligent Systems, 32(2):74–79. Gerald Matthews and Kirby Gilliland. 1999. The personality theories of hj eysenck and ja gray: A comparative review. Personality and Individual differences, 26(4):583–626. Gerald Matthews, Ian J Deary, and Martha C Whiteman. 2003. Personality traits. Cambridge University Press. 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, pages 3111–3119. Frederic Morin and Yoshua Bengio. 2005. Hierarchical probabilistic neural network language model. In Aistats, volume 5, pages 246–252. Citeseer. Soujanya Poria, Erik Cambria, Devamanyu Hazarika, and Prateek Vij. 2016. A deeper look into sarcastic tweets using deep convolutional neural networks. arXiv preprint arXiv:1610.08815. Ashwin Rajadesingan, Reza Zafarani, and Huan Liu. 2015. Sarcasm detection on twitter: A behavioral modeling approach. In Proceedings of the Eighth ACM International Conference on Web Search and Data Mining, pages 97–106. ACM. Ellen Riloff, Ashequl Qadir, Prafulla Surve, Lalindra De Silva, Nathan Gilbert, and Ruihong Huang. 2013. Sar- casm as contrast between a positive sentiment and negative situation. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 704–714. Efstathios Stamatatos. 2009. A survey of modern authorship attribution methods. Journal of the Association for Information Science and Technology, 60(3):538–556. Joseph Tepperman, David Traum, and Shrikanth Narayanan. 2006. " yeah right": Sarcasm recognition for spoken dialogue systems. In Ninth International Conference on Spoken Language Processing. Oren Tsur, Dmitry Davidov, and Ari Rappoport. 2010. Icwsm-a great catchy name: Semi-supervised recognition of sarcastic sentences in online product reviews. In ICWSM, pages 162–169. Byron C Wallace, Laura Kertz, Eugene Charniak, et al. 2014. Humans require context to infer ironic intent (so computers probably do, too). In Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), volume 2, pages 512–516. Byron C Wallace, Eugene Charniak, et al. 2015. Sparse, contextually informed models for irony detection: Ex- ploiting user communities, entities and sentiment. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Vol- ume 1: Long Papers), volume 1, pages 1035–1044. Meishan Zhang, Yue Zhang, and Guohong Fu. 2016. Tweet sarcasm detection using deep neural network. In Proceedings of COLING 2016, the 26th International Conference on Computational Linguistics: Technical Papers, pages 2449–2460.
1708.04134
1
1708
2017-08-04T03:44:35
A Measure for Dialog Complexity and its Application in Streamlining Service Operations
[ "cs.CL", "cs.AI" ]
Dialog is a natural modality for interaction between customers and businesses in the service industry. As customers call up the service provider, their interactions may be routine or extraordinary. We believe that these interactions, when seen as dialogs, can be analyzed to obtain a better understanding of customer needs and how to efficiently address them. We introduce the idea of a dialog complexity measure to characterize multi-party interactions, propose a general data-driven method to calculate it, use it to discover insights in public and enterprise dialog datasets, and demonstrate its beneficial usage in facilitating better handling of customer requests and evaluating service agents.
cs.CL
cs
A Measure for Dialog Complexity and its Application in Streamlining Service Operations Q. Vera Liao, Biplav Srivastava, Pavan Kapanipathi IBM T J Watson Research Center 7 1 0 2 g u A 4 ] L C . s c [ 1 v 4 3 1 4 0 . 8 0 7 1 : v i X r a Abstract Dialog is a natural modality for interaction between cus- tomers and businesses in the service industry. As customers call up the service provider, their interactions may be rou- tine or extraordinary. We believe that these interactions, when seen as dialogs, can be analyzed to obtain a better understanding of customer needs and how to efficiently ad- dress them. We introduce the idea of a dialog complexity measure to characterize multi-party interactions, propose a general data-driven method to calculate it, use it to dis- cover insights in public and enterprise dialog datasets, and demonstrate its beneficial usage in facilitating better han- dling of customer requests and evaluating service agents. 1 Introduction Service industry thrives on engaging customers using a company's offerings, and dialogs, whether written or spo- ken, is a common form of such an interaction. Over time, organizations collect a sizable volume of dialog data that may be proprietary or public depending on how customer service is provided. As customers call up their service providers for requests, their interactions may be routine or extraordinary. Re- cently, there has been significant interest in the field of service management to automatically analyze such inter- action data to characterize different service sessions, types of customers, and service domains. Such characterization can help understand individual customer needs and facili- tate more satisfying and cost-effective service handling. For example in [18], NLP techniques were introduced to track high-level indicators such as sentiments as customer inter- actions progress in a service center to enable managers to take pro-active actions. Continuing on this theme, we propose a measure of dia- log complexity to characterize service interactions with cus- tomers. Specifically, we measure complexity of service di- alogs at the levels of utterances, turns and overall dialogs. The method takes into consideration the concentration of domain specific terms as a reflection of customer request specificity, as well as the structure of the dialogs as a re- flection of customer demand for quantity of service actions. We propose a system architecture that automates the dia- log complexity calculation, including discovery of domain- specific terms, to make it highly amenable to scale-up to new domains. Using this measure, service providers can differentiate between simple and complex service dialogs, and take the complexity feature into consideration to improve service handling and service evaluation of agents. By applying the complexity measure to historical datasets, insights can be derived on the causes and implications of varying levels of complexity. Such insights can be used to further improve service handling and customer satisfaction. For example, it would be more satisfying and also cost-effective to allocate service dialogs expected to have high complexity to agents that are more experienced but potentially expensive. To manifest the usage of the complexity measure, we conduct multiple experiments in the paper using dialog datasets from online repositories as well as contact centers of service providers. We show that the measure can capture the large diversity in the complexity of service dialogs. Al- though detailed experiments are shown later, for illustration, see Table 1 where user utterances in four service domains are shown of low and high complexity by our measure. By comparing the complexity of different kinds of dialogs and across different service domains, we show that many fac- tors can contribute to varying dialog complexity, including service contexts and speaker characteristics. The dialog complexity measure and insights about com- plexity variations can have wide usage in service industry for managing customer requests, internal processes and op- timizing delivery systems. We discuss these possibilities and also propose a service agents evaluation metric that takes into consideration the complexity of dialogs they han- dle, and show that it makes a difference from the conven- tional evaluation metrics. To summarize, this paper makes the following contribu- tion: (a) introducing the notion of dialog complexity to un- derstand and compare dialogs in a repository (b) proposing a automatic method to calculate it and providing a publicly 1 Ubuntu technical support Insurance support Human Resource support Restaurant booking agent High Complexity sudo adduser user group will homeowners insurance cover flooring? are company email addresses case sensitive? the lucky star serves Chinese food Score 1 1 0.92 0.94 Low Complexity that's my impressions what are some examples of annuities? where am i? coke it is Score 0.25 0.5 0.33 0.33 Table 1. Examples of utterances and its complexity scores in each datasets available API to calculate dialog complexity for four dif- ferent service domains (c) using it to understand varying customer interactions in a variety of domains using public and proprietary data (d) demonstrating its usage to improve service management operations. In the rest of the paper, we first give a background about service dialogs, and introduce the datasets we experiment with. Next, we motivate the desirable characteristics of a dialog complexity measure and propose a method to cal- culate it. We then conduct experiments to show that the proposed measure can characterize diverse customer inter- actions, and to verify that the measure captures service re- quest specificity and quantity. Finally, we discuss its usages in improving service dialog handling and evaluation. 2 Related Work and Background Service science [19] deals with principled approaches to drive innovations in the service ecosystem. For the purpose of the paper, we deal with the interaction (e.g., chat dialog) that a client conducts with a service provider in order to resolve a problem with the product or service the client is interested in. There is a large volume of prior works on design- ing, monitoring and evaluating service dialogs in fields such as marketing, management and service computing (e.g. [1, 3, 4]). This paper is most relevant to prior work developing measures to characterize and compare service dialog sessions. While most previous literature focused on quality and satisfaction measures through customer surveys (e.g., [11, 5]), recent work starts exploring text analytical methods to directly derive measures from dialog contents, such as sentiment based measures [18]. Our focus is dif- ferent in that, beyond evaluation, we are also interested in optimization of dialog handling, and thus, we focus on mea- suring the complexity as a characteristic of a dialog session, instead of the outcome. There is a rich literature on analyzing dialogs. In social science, conversation analysis deals with identifying regular patterns in dialogs and the underlying behavioral reasoning [10]. In computer science, dialog analyses are often driven by advancement of speech and dialog systems [15], focus- ing on developing NLP and machine learning methods to understand, predict and evaluate dialogs (e.g. [22]). Recently, new methods are developed to profile dialogs in different domains, or for different dialog systems, and complexity has been proposed as a data-driven metric for such purpose [6, 7, 16, 17]. These studies were primarily driven by informing the implementation of dialog systems, and tended to focus on assessing the size of domain enti- ties or concepts. In linguistics, dialog complexity has been studied from human readability point of view by identifying linguistic markers for a more or less elaborate styles [2]. In this paper, we proposes a dialog complexity measure con- sidering multiple dimensions of dialogs to enable profiling of diverse services dialogs, and to facilitate the interpreta- tion of complexity profiles for service handling. 2.0.1 Scope and definition of service dialogs: This paper focuses on service dialogs. A service provider may: 1) use a dedicated contact center where one agent re- sponds to one user at a time; or 2) use a public forum where both agents and other users may respond. We consider both types of dialogs in this paper. The interactions may be writ- ten or spoken, and in the case of the latter, we assume to have a transcribed version of the dialog. Recently, auto- mated agent systems, in the forms of spoken dialog system or chatbot, have been on the rise. Our measure does not dif- ferentiate between dialogs with human or automatic agents. We will experiment with datasets from both. A dialog is made up of a series of turns, where each turn is a series of utterances by one or more participants play- ing one or more roles. In the example of customer support center, a user contacts a service center and enters into a di- alog with a customer support agent. The participant roles here are that of a customer and an agent, and the roles inter- leave in every turn. On the other hand, in the example of online support, a person may raise an issue on a public por- tal and anyone may reply. The role of all participants here is a portal user. Since questions and answers do not necessar- ily happen in pair, we consider each user utterance in such a case of single role to define a new turn. 3 Service Dialog Datasets used in Experi- ments We will conduct experiments with the following four dia- log datasets with service agents (both human and automated agents) working in different service domains: Public-Ubuntu technical support: This corpus is scraped from Ubuntu online support IRC channel, where users post 2 questions about using Ubuntu. We obtained the original dataset from [13], and selected 2 months of chatroom logs. We extracted 'helping sessions' from the log data, where one person posted a question and other user(s) provided help. The corpus contain both dyadic and multi-party di- alogs. Public-Insurance QA: This corpus contains questions from insurance customers and answers provided by in- surance professionals. The conversations are in strict Question-Answer (QA) format (with one turn). The corpus is publicly available provided by [8]. Public-Restaurant reservation support: This corpus con- tains conversations between human users and a simulated automated agent that helps users find restaurants and make reservations. The corpus was released for Dialog State Tracking Challenge 2 [9]. Enterprise-Human Resource bot: This corpus is collected from internal deployment of an HR bot - a virtual assistant on an instant messenger tool that provides support for new hires. Although the bot does not engage in continuous con- versations (i.e. carrying memory), it is designed to carry out more natural interactions beyond question-and-answer. For example, it can actively engage users in some social small talks. In Table 2 (left), we present descriptive statistics of these corpora. In Figure 1, we plot distributions of number of turns per dialog. Except for Ubunutu, we define turn as a series of utterances where both the customer and the agent (i.e., all roles) finished speaking in one round. In Ubuntu's open, multi-party, IRC context, all participants have the same role, and hence, we define turn to be the same as ut- terance. From the table and plots, we can observe several characteristics of dialogs varying across these service do- mains. For example, Ubuntu IRC tend to be long dialogs. Insurance QAs are strictly in one turn. Dialogs with the HR bot tend to be short with large variations, while Restaurant booking ones have less variations in length. We can postulate that dialog contexts of these corpora differ in several key dimensions (Table 2 right): 1) Ubuntu is the most specialized domain among the four, because it involves a large number of specialized vocabularies, and the tasks are less commonplace. To verify this, we calculate the percentage of domain specific words overlapping with common English words (extraction method to be discussed in Section 5). The idea is that the lower the percentage, the more specialized the domain is. As expected, we found that Ubuntu has significantly lower percentage(Table 2 column "specialized domain"). 2) Insurance and Restaurant book- ing are more customer centric with standardized processes than the other two. Insurance dialogs are strictly problem- solving question and answer between customer and agent, while Restaurant dialogs are focused interactions where the agent collects customers' preferences for reservations with Figure 1. Distribution of number of turns per dialog a set of pre-defined criteria. There are more variations, and also more off-topic discussions in Ubuntu and HR. 3) Only insurance dialogs are in QA format. 4 Calculating Dialog Complexity The desiderata from a dialog complexity measure are that it can: (a) be automatically calculated; (b) be agnostic to the representation (e.g., intents, entities) and yet be able to incorporate them where available; (c) allow comparison of dialogs; (d) be easy to interpret source of complexity; (e) be composable over dialog structure to allow ease of com- putation and any relative weighing; (f) support boundary condition properties. Given our focus on service dialog handling, the bound- ary conditions are: (a) complexity of an utterance with less complex words should be less than or equal to the same utterance with more complex words. While other defini- tions are possible, we define word complexity in terms of domain specialization, as more domain specific words may reflect more demanding service dialogs for specificity and efficiency; (b) if utterance complexity equals, complexity of a turn with less participants should be less than or equal to a turn with more participants; (c) if content complexity equals, complexity of shorter dialogs should be less than or equal to longer dialogs in the same domain. Based on the desiderata, we define a set of complexity measure at the levels of utterance, turn and dialog. 4.1 Complexity at Utterance Level Let SWL represent the set of stop words, ES stand for the set of English subset (common words), DS for domain specific words and rest of the words are part of noise set NS. An utterance U consists of word phrases wi such that 3 N (dialog) M (turns/ dialog) M (utt./ turn M (words/ utt.) Specialized domain* Standardized procedure Ubuntu Insurance HR Restaurant 3318 25499 3600 2118 18.53 1 2.47 7.37 1 2 2 2 17.90 17.02 51.11 8.24 0.11 0.22 0.25 0.27 (cid:88) (cid:88) QA (cid:88) Table 2. Left:Descriptive statistics of corpora; Right: Features of dialog domains ( *% of domain words overlapping with common English words reflecting domain specificity.) U =(cid:80)U U = N w 1 wi. We define the complexity of a word phrase wi, denoted c(wi), by following terms in the given order c(wi) = (1)  1 (cid:80)U 0.5 0 wi ∈ DS wi ∈ ES wi ∈ SW L c(U ) = i=1 c(wi) U We define the complexity of an utterance, denoted c(U ), by recent papers introduced NLP techniques to automatically generate dialog acts tags (e.g. [20]). We assume a function α(Ui) is available to get the dialog act tag for utterance Ui. Further, for each dialog act j, we denote its weight by wj (in 0-1 range). The weighted turn complexity is calculated by: (cid:80)T i=1 c(Ui) ∗ wα(Ui) T (4) (2) c(TDA) = For experiments, we apply the following: • SWL: default English stop words1 • ES: Over 2000 common English words2 • DS: top k word phrases of a domain obtained from do- main specialist, frequency or other methods. In the next section we present a term frequency based method to automatically identify DS for each service domain. 4.2 Complexity at Turn Level A turn is a collection of utterances where each role gets to speak at least once. For a 2-role dialog, a turn con- sists of two utterances. We propose two definitions of turn complexity. The first one is averaging utterance complexity within a turn, calculated by the following: (cid:80)T c(T ) = i=1 c(Ui) T (3) where the number of utterances Ui within the turn T is denoted by T . Since turn complexity can be seen as a way to reflect the complexity of domain specific information exchange in the turn, in another definition, we introduce dialog acts tag to calculate a weighted sum of utterance complexity. Dialog acts are tags that indicate the communicative function of the utterance [20]. For example, an utterance may intend for requesting information, providing information, or for social functions such as greetings or closing the dialog. Several 1At: http://www.ranks.nl/stopwords 2http://www.talkenglish.com/vocabulary/top-2000-vocabulary.aspx 4.3 Complexity at Dialog Level The utterance and turn complexity measures defined above focus on the content of interactions. To measure complexity at dialog level, we ensure both the content and its structure to be considered. The underlying assumption is that the structure such as length may reflect the quan- tity of task specific actions, which may be orthogonal to the concentration of task specific actions (e.g., some cus- tomers may seek to resolve one difficult problem quickly versus others with many easy requests). Thus, we have two components in the calculation: average turn complexity to reflect the content complexity, and the length of the dialog relative to the maximum length in the dialog dataset of that kind. The latter component can be seen as reflecting the structural complexity (length) of the particular dialog rela- tive to the maximum structural complexity (length) that the service context allows. While we use dialog length as a sim- ple indicator, more sophisticated structural features can be introduced. One can weigh these independent components to arrive at the total dialog complexity. We denote the number of turns Ti in the dialog D by D = N T be the maximum number of turns per dialog in the dataset S (Di ∈ S). Dialog complexity is then calculated as: D. Let N Tmax D (cid:80)N (t) c(D) = w1 ∗ i=1 c(Ti) N T D + w2 ∗ N T N Tmax D D (5) In our experiments, we give equal weight to both with w1 = w2 = 0.5. The identification of optimal weights is beyond the scope of this paper, but can be achieved by building a regression model on annotated dialog complex- ity. 4 4.3.1 Discussion on the calculation While dialog complexity has been studied for readability [2], and size of domain concepts [6, 7, 16, 17], we focus on features that may impact the difficulty of service dia- log handling. Specifically, we consider the concentration of domain specific words as a reflection of customer demand for specificity and/or efficiency, and length of dialogs as a reflection of customer demand for quantity of service ac- tions. One can conceive more advanced metrics such as by including more comprehensive list of features that can pre- dict difficulty of dialog handling (e.g., using machine learn- ing methods), providing additional data is available convey- ing signals about the handling difficulty. Recent research on neural network based dialog quality measures [12] can also be adapted. However, in this paper, we focus on an explain- able measure that may help gain business trust. We leave the expansion and refinement of the metrics to future work. 5 System Architecture The system architecture as shown in Figure 2 is com- prised of four primary modules: (1) Stop words extractor, (2) Domain specific terms extractor, (3) Common terms ex- tractor, and (4) Complexity Calculator. While Section 4 described the Complexity Calculator in detail, in this sec- tion, we focus on the implementation details of the other three modules. The system is developed in Python using li- braries pandas, nltk, and sci-kit learn3. The system is openly available as an API4. The API, presently, has the ability to calculate complexity for dialogs in the four domains of the datasets we introduced about, i.e, HR, restaurant, insurance, and Ubuntu. Furthermore, additional domains can easily be updated with the availability of domain-specific dialog data. As explained in Section 4, choice of SWL, ES and DS play a crucial role. We experimented with a few alternatives and chose SWL and ES from online sources. For DS, we utilize information extraction (IE) and retrieval (IR) tech- niques on dialog corpora. Common IR techniques such as Term Frequency (TF) and Term Frequency-Inverse Docu- ment Frequency (TF-IDF) are used to determine the promi- nent, domain specific terms from the utterances [14]. Other techniques that perform keywords [23] and key phrase ex- tractions [21] from documents can be plugged into the sys- tem. We fix a threshold δ to pick the top-δ percentage of domain specific terms. Since stop words, in general, form the majority of terms in natural language documents [14], we pre-process to remove stop words before DS extraction. For experiments presented in the paper, we employed TF- based DS extractor and set the threshold δ = 50. Note that 3http://www.nltk.org/,http://pandas.pydata.org/,http://scikit- learn.org/stable/ 4https://dialog-complexity.mybluemix.net/ we experimented with δ = 20 and δ = 30 , and the conclu- sions in Section 6 hold. For the sake of simplicity, we will present the following experiments with δ = 50. 6 Experiments: Understanding Service Dia- log Characteristics In this section, we demonstrate the usage of the complex- ity measure for gaining insights on the differences in service dialog interactions. Specifically, we apply the complexity measure to dialogs from different service domains (datasets introduced in Section 3), and different types of speakers (as an experiment, we compare customer v.s. agent), and show different complexity characteristics both at aggregate level and in procedural patterns. By interpreting the complexity characteristics, we gain insights on the contributors of di- alog complexity, which can then be used to facilitate more effective handling of service requests (e.g., to accommodate the underlying needs of the more complex types of dialog). In the experiments, we ask the following research questions: RQ1: What complexity characteristic at aggregate level, i.e. complexity signatures, do different service domains (i.e., datasets) have? Given that the four datasets differ in several key dimen- sions (see Table 2 right), we focus on these dimensions and ask: • RQ1A: What complexity signatures do dialogs in more specialized domain have? • RQ1B: What complexity signatures do dialogs with standardized procedures have? • RQ1C: What complexity signatures do QA dialogs have? RQ2: For multi-turn dialogs, what complexity character- istic in procedural patterns do different service domains have? RQ3: What complexity characteristics do different roles of speaker, specifically customer and agent, have? Does it vary for different service contexts? 6.1 RQ1: Comparing Aggregate Com- plexity Across Datasets Based on the calculations specified in Section 4, we cal- culate the complexity of each utterance, turn, and dialog in the four datasets. Table 3 presents the average values of utterance, turn and dialog complexity for each dataset. Fig- ure 3 plots the distributions of utterance, turn and dialog complexity of datasets. The figures and table paint a clear picture that complexity differs across these datasets at all levels. 5 Figure 2. Architecture of the system to calculate dialog complexity Figure 3. Distribution of utterance(left), turn (middle) and dialog complexity (right) Ubuntu Insurance HR Restaurant M (utt.) M (turn) M (dialog) 0.767 0.789 0.801 0.788 0.407 0.894 0.423 0.518 0.767 0.789 0.803 0.788 Table 3. Average complexity of each corpus Before moving on to discuss the observed differences, we first verify that the differences of complexity distribution between datasets are statistically significant. We conducted pairwise Kolmogorov-Smirnov tests for complexity score distributions at utterance , turn, and dialog levels (Figure 3). K-S test is a statistic that quantifies distances between two empirical distributions, and if significant, it means the two distributions are not the same. We found all the K-S tests to be significant (all p < 0.001), verifying that the complexity distributions of these datasets are all different between each other. 6.1.1 RQ1A - Domain Specialization From Table 3, it appears that dialogs in Ubuntu, the most specialized domain of the four, have the lowest average complexity at all three levels. This is reasonable since the domain-specific words extracted for Ubuntu dialogs tend to be highly specialized words, and are thus less concentrated in utterances. Put it differently, lay people are less of ex- perts in this uncommon domain compared to the other three service domains. Ubuntu dialogs also have the lowest dialog complexity (Figure 3 right) because the structure complexity compo- nent in Equation 5 tends to be low for most dialogs. The reason is that the maximum turn of dialog in this dataset is very high(N Tmax in Equation 5), as the open-chat environ- ment allows free forms and flows of dialogs . D 6.1.2 RQ1B - Standardized Service Dialog As noted in Section 3, the contexts of Insurance and Restau- rant datasets are more customer centric following standard- ized procedure. This difference is evident in experiments where we note that for Insurance and Restaurant there are few occurrences of utterances and turns with low complex- ity (Figure 3 left and middle). This is because there are far fewer off-topic discussions in these dialogs. In contrast, there is a peak in the very low end of utterance and turn complexity for Ubuntu and HR. These are either short utter- ance with almost only stop words, or off-topic discussions with few domain-specific words. Another signature of standardized procedure is that the distribution of dialog complexity (Figure 3 right) is more 6 balanced. This is because the dialog lengths in these do- mains tend to have less variance as the requests are more consistent. Especially in the case of Insurance, users uni- formly submit only one request in a session. 6.1.3 RQ1C - QA Dialog In addition to having the signatures of dialogs with stan- dardized procedures, Insurance dialogs have a complexity signature unique to its QA nature -- having the highest com- plexity of all datasets at all levels (all three in Figure 3). This is because all QA dialogs attempt to solve the problem within one turn. From a content point of view, all utterances have to be highly concentrated on the topic. From a struc- ture perspective, all dialogs uniformly have the same maxi- mum length as the particular dialog context allows only one request per session (N Tmax in Equation 5). D 6.1.4 Turn Complexity Weighted by Dialog Act Tag We note that in strict sequential conversations (Insurance and Restaurant), the average turn complexity (Equation 3) of the dialog corpus would be the same as average utterance complexity, although the distributions vary. We now experi- ment with the case where dialog act is available (Restaurant dataset) for weighted turn complexity (Equation 4) The Restaurant dataset is published with tagging of di- alog acts such as: welcome-msg, inform, offer, request, bye, affirm, negate, thankyou, confirm, select, acknowl- edge, hello, repeat, deny. For simplicity, we only sepa- rate DA tags with social functions from the rest, and define w(welcome-msg) = w(bye) = w(hello) = w(thankyou) = 0, all other wα = 1. Figure 4 shows the distribution of weighted turn complexity. Interestingly, the distribution becomes "flatter", as dialog acts tags provided additional information about the intentions of utterances that are not identifiable by simply looking at the words. Figure 4. Distribution of weighted by dialog act tags turn complexity 6.2 RQ2 - Procedural Patterns of Com- plexity In the second set of experiment, we analyze the procedu- ral patterns of complexity, defined as how the turn complex- ity changes as the dialog progresses. We use the corpora of Restaurant and Ubuntu for the experiment. We follow the following steps: 1) First, we eliminate dialogs with number of turns in the highest and lowest 15 percentile, leaving dialogs of 5-20 turns for HR, and 5-35 turns for Ubuntu. We evenly divide the number of turns in a fixed number of N baskets. Here we set N = 5. 2) We calculate the average turn complexity for each basket. 3) We run k-means clustering (k = 6) to identify clusters of procedural patterns with the complexity value of the 5 baskets. 4) We use the centers of the clusters to represent the signature of procedural patterns for the dataset, as plotted in Figure 5. Figure 5. Kmeans clusters (K=6) of procedu- ral patterns of turn complexity We observe several interesting patterns: 1) For both datasets, turn complexity varies less at the beginning than at the end of dialogs, showing that they tend to have more con- sistent initiating patterns but diverge as the dialogs progress. 2) Dialogs in Restaurant dataset have less procedural vari- ation than those in Ubuntu. This is consistent with the fact that restaurant booking follows a more standardized cus- tomer service procedure. 6.3 RQ3 - Role Differences In the third set of experiment, we compare the com- plexity characteristics of different speaker roles, i.e. cus- tomers and agents. We excluded Ubuntu since it comprises of multi-party open chat. We calculated the average utter- ance complexity of agent and customer for the other three datasets. The result is shown in Table 4. Interestingly, we observed that the utterance complexity of customers is higher than agent in all three datasets. One potential explanation, we observed, is that customers tend to use more succinct phrases focusing on the requests. For example, in the dialogs with the HR bot, which were car- ried out by typing in a chat windows, some users used just 7 Insurance HR Restaurant Agent 0.769 0.770 0.777 Customer 0.808 0.833 0.799 Table 4. Average utterance complexity by roles discrete keywords such as 'travel booking' instead of nat- ural conversations. In contrast, agents tend to speak more politely, and thus using more elaborated sentences. 6.3.1 Discussions on the experiments In the above experiments, we first show that our multi- dimension dialog complexity measure can characterize di- verse service dialogs at aggregate level and by procedural patterns. By comparing the complexity signatures across different service dialog domains and speaker roles, we iden- tify several contributors for varying dialog complexity. In Section 8, we discuss how the dialog complexity measure can be used in combination with the insights gained from empirical analysis of historical datasets to improve handling of services. Before that, we present another set of experi- ments that further validate our interpretation on the contrib- utors of complexity. 7 Experiments - Correlation of Complexity with Service Actions In defining the calculation of dialog complexity, we made two main assumptions: 1)the content based complex- ity (utterance and turn) should reflect user requests' domain specificity; 2) the dialog complexity should reflect the quan- tity of requested actions. We present two experiments below that provide validation for these assumptions. 7.1 Correlation with Domain-specific In- formation Retrieval Success (HRIRS). The knowledge base is constructed by HR knowl- edge about the company, with the addition of common so- cial talks. That is, user requests unrelated to the company, such as "find me a best Thai restaurant", would not be suc- cessfully handled by HRIRS. Without going to the technical details, HRIRS uses a two-level hierarchical natural classifier (NLC) to classify the intent of an user utterance to retrieve the matching an- swer, which represents state-of-art dialog system technol- ogy. With the NLC, user utterances fall into three cate- gories: 1) Correct retrieval, when the two levels of NLC are above confidence threshold and match a mapping rela- tion. A manual evaluation of 3% data showed that more than 87% user utterances in this category received reason- able answers. 2) Low confidence, when either of the two levels of NLC is below confidence threshold. 3) Incorrect retrieval, when the two levels of NLC are above confidence threshold but do not match the mapping relation. The man- ual evaluation showed that more than 75% in this category received wrong answers. N M(complexity) Correct 4426 0.786 Low confidence 1142 0.725 Incorrect 375 0.637 Table 5. Numbers and average complexity of utterances with different HRIRS outcomes Table 5 shows the average utterance complexity of user input in the three categories. All pair-wise t-tests are statis- tically significant (p < 0.001). It indicates that user utter- ances that resulted in successful information retrieval tend to have higher complexity, validating our assumption that domain specificity should be reflected by the complexity measure. This may also imply differences between human- processing and machine-processing of dialogs. While ca- sual, less domain-specialized dialogs could be easier for a human agent to handle, it may be more problematic for in- formation retrieval with domain specific knowledge base. 7.2 Correlation with Quantity of Requests To validate that utterance complexity reflects domain specificity, besides manually examining utterances with high and low complexity as in Table 1, we choose to con- duct an experiment by comparing the complexity of utter- ances that are successfully and unsuccessfully processed by a domain-specific information retrieval system. The idea is that utterances that can be processed by the system should be relevant to the domain, and we should expect them to have higher complexity. Dialogs in the HR dataset are user interactions with an automatic agent using an HR Information Retrieval System In the next experiment, we validate whether higher di- alog complexity is associated with increasing variation of requests within a service session. We use the Restaurant dataset as our case study. In a typical dialog between user and an automated agent for restaurant booking, the conver- sation is complicated by frequent change in customers' re- quest, i.e. asking for a different kinds of restaurant, price range. The change may happen either because the system could not find a satisfying answer for the initial request, or because the customer changed his or her mind midway. We choose to compare the number of restaurant types in dialogs 8 with varying complexity. For simplicity, narrowing down on features of a restaurant such as price range was not con- sidered a new request variation. We started by ranking all dialogs in the Restaurant dataset by dialog complexity in descending order. Then, we selected three groups -- high complexity (rank 1-20), median complexity (rank 1045-1064) and low complexity (rank 1999-2118) from the complexity spectrum. We man- ually labeled the number of restaurant type requests for all 60 dialogs, and present the average number for each group in Table 6. It shows that, the higher the dialog complex- ity is, the more restaurant types were in requests, validat- ing that dialog complexity is strongly correlated (r = 0.54) with the variations in requests. In fact, we observed that di- alogs with the highest complexity are mostly ones where the users were intentionally "breaking" the system, by keeping asking for different kinds of restaurants and typing in repet- itive, even random requests. M(requests) highest complexity 4.20 median complexity 1.45 lowest complexity 1.05 Table 6. Average number of restaurant-types in different dialog complexity groups. groups of customers, tend to speak in more or less complex manners, and allocate the requests to the appropriate agents. For example, by identifying that those having extremely high complexity dialogs with the automatic agents are in- clined to "break the system", one could direct this group of users to human agents in the future. Moreover, insights gained from analyzing historical datasets can be applied to new service contexts or individu- als. That is, one can run the dialog complexity measure on a new dataset and infer characteristics associated with the provided complexity profile. While our experiments served as an illustration of this approach, future research could ex- plore identifying a more complete set of mapping relations between dialog complexity profiles and various contextual, procedural and individual features in service dialogs. 8.2 Improving Service Agents Evaluation A second usage of complexity measure is to improve the evaluation method of service agents. The notion is that, by taking complexity into consideration, agents should be rewarded for handing a more complex dialog with equally satisfying outcome. Here we propose an agent evaluation method that considers dialog complexity and demonstrate its difference with a simulated example. 8 Usage of Dialog Complexity in Services We first discuss the usage of dialog complexity to im- prove service dialogs handling, using the examples and in- sights from the above experiments. We then explore an additional area for the usage of dialog complexity -- to im- prove service agent evaluation. 8.1 Improving Service Handling A direct usage of dialog complexity is to tailor service handling according to the complexity profiles of dialogs. This could be at the service context level. For example, from the above experiments, we discover that in the HR support context, users tend to speak in varying complexity, and one underlying reason is the frequent engagement in so- cial chit-chat. Or, through comparing procedural patterns, we would expect that dialogs in Ubuntu support are less likely to follow consistent procedures compared to restau- rant booking. These insights can be taken into considera- tion when training human agents or developing automatic agents. The usage could also be to tailor service handling for different types of requests or customers, potentially in real- time. We may identify certain kinds of request, or certain Suppose we can have customer support center with M agents. An agent aj handles Naj dialogs in time Taj . A function φ(di) is given to find the customer's satisfaction (C-SAT) with a dialog di and its complexity is measured by function c(di). The goal is to assess the performance of the agent, represented as ω(aj). A most basic version of evaluation method is by the aver- age C-SAT ratings an agent receives, denoted by ω1 (Equa- tion 6). ω1(aj) = 1 Naj ∗ ( φ(di)) (6) An improved version will take the varying time spent for each service session into consideration, and calculate a weighted sum of C-SAT by the percentage of time (over total time Taj ) spent on the corresponding dialog, denoted by ω2 (Equation 7). But the above metrics fail to account for the complexity, i.e., difficulty in handling, of each inter- action. Naj(cid:88) i=1 Naj(cid:88) i=1 ω2(aj) = 1 Taj ∗ ( φ(di) ∗ ti) (7) We propose ω3(aj) as defined by Equation 8. Here, the customer rating of an interaction i is weighted with its com- plexity di and duration ti, and averaged over the whole du- ration that an agent has to be evaluated. The result is a 9 ω3(a1) ω3(a2) ω3(a3) Random allocation to agents Ubuntu Insurance HR Restaurant Ubuntu Insurance HR Restaurant 0.450 0.894 0.439 0.542 0.370 0.873 0.378 0.460 0.444 0.894 0.428 0.536 0.403 0.894 0.425 0.502 Allocation by ascending dialog complexity 0.454 0.896 0.453 0.537 0.483 0.916 0.496 0.601 Table 7. Results of simulated experiment to distinguish agents with dialog complexity Naj(cid:88) i=1 number which will be between 0-1 if c and C-SAT are in that range. This metric would also allow agents who work over different time periods (Ti) and nature of dialogs to be compared. ω3(aj) = ∗ ( 1 Taj c(di) ∗ φ(di) ∗ ti) (8) To see whether these measures actually make an im- pact, we consider a simulated scenario using 1000 real di- alogs randomly selected from each of the four datasets. We assume that there are 3 agents (a1, a2, a3) who handle 300,350 and 350 dialogs in that order. We assume that the agents cover these dialogs in 30, 40 and 50 hours respec- tively. Within a time duration Tai, we assume that the agent takes time to handle a dialog proportional to the number of words in it. We assume that each agent is equally trained and were able to achieve a constant C-SAT,φ(di), for any interaction. Table 7 shows the result of evaluation results of the three agents with the metric we proposed. We consider two cases: (1) where the dialogs are assigned to agents randomly and (2) where the allocation is by increasing order of dialog complexity. We see there is sharp difference in measured performance in the second case where agents were given dialogs with different complexity. Our proposed method ω3 would capture this biased allocation and reward the agent that handled more complex dialogs with equal user satis- faction. On the other hand, conventional metrics such as ω1 and ω2 would not have shown any difference. 9 Conclusion In this paper, we introduced the notion of dialog com- plexity to understand and compare a collection of dialogs that are routinely used in services industry, proposed a method to calculate it and used it to understand customer interactions in a variety of domains at utterance, turn and dialog levels. A dialog complexity measure can conceiv- ably help improving service operation and we discuss its usage for tailoring service handling for varying customer interactions, and demonstrate its usage for improving ser- vice evaluation by taking into consideration the difficulty of dialogs that agents handle. Looking forward, one can extend the current work in many ways. One can explore deeper dialog content (e.g., n- grams) and structure information, or develop machine learn- ing based approach providing that complexity annotation is available, to create more sophisticated metrics and evaluate whether they can effectively predict the complexity of ser- vice dialog handling. One can also explore using the com- plexity metric to manage many aspects of service center op- eration, such as determining the most cost-effective way of handling requests, or even optimizing a contact center dy- namically. References [1] Anton, J.: The past, present and future of customer ac- cess centers. International Journal of Service Industry Management 11(2), 120 -- 130 (2000) [2] Biber, D.: On the complexity of discourse complex- ity: A multidimensional analysis. Discourse Processes 15(2), 133 -- 163 (1992) [3] Bitner, M.J.: Evaluating service encounters: the effects of physical surroundings and employee re- sponses. the Journal of Marketing pp. 69 -- 82 (1990) [4] Christopher, M., Payne, A., Ballantyne, D.: Relation- ship marketing: bringing quality customer service and marketing together (1991) [5] Cronin Jr, J.J., Taylor, S.A.: Measuring service qual- ity: a reexamination and extension. The journal of marketing pp. 55 -- 68 (1992) [6] DuBois, T.M., Rudnicky, A.I.: An open concept met- ric for assessing dialog system. In: IEEE Work. ASRU (2001) [7] Duvall, S.: Implementation of domcat: for analysis complexity domain ural staff.elon.edu/sduvall2/publications/TAPIA.pdf (2006) tool processing. language dialog In: The nat- fac- [8] Feng, M., Xiang, B., Glass, M.R., Wang, L., Zhou, B.: Applying deep learning to answer selection: A study and an open task. In: IEEE Work. ASRU. pp. 813 -- 820 (2015) [9] Henderson, M., Thomson, B., Williams, J.: The sec- ond dialog state tracking challenge. In: 15th Ann. Meeting SIG on Discourse and Dialogue. vol. 263 (2014) 10 [22] Young, S., Gasi´c, M., Thomson, B., Williams, J.D.: Pomdp-based statistical spoken dialog systems: A re- view. Proceedings of the IEEE 101(5), 1160 -- 1179 (2013) [23] Zhang, C.: Automatic keyword extraction from doc- uments using conditional random fields. Journal of Computational Information Systems 4(3), 1169 -- 1180 (2008) [10] Hutchby, I., Wooffitt, R.: Conversation analysis. Polity (2008) [11] Jaiswal, A.K.: Customer satisfaction and service qual- ity measurement in indian call centres. Managing Ser- vice Quality: An International Journal 18(4), 405 -- 416 (2008) [12] Kannan, A., Vinyals, O.: Adversarial evaluation of dialogue models. arXiv preprint arXiv:1701.08198 (2017) [13] Lowe, R., Pow, N., Serban, I., Pineau, J.: The ubuntu dialogue corpus: A large dataset for research in un- structured multi-turn dialogue systems. arXiv preprint arXiv:1506.08909 (2015) [14] Manning, C.D., Raghavan, P., Schutze, H., et al.: In- troduction to information retrieval. Cambridge Univ press (2008) [15] McTear, M.F.: Spoken dialogue technology: enabling the conversational user interface. ACM Computing Surveys (CSUR) 34(1), 90 -- 169 (2002) [16] Pollard, S.: Defining the complexity of natural lan- guage dialogue system domains. In: PhD Thesis, Duke Univ. (2006) [17] Rauterberg, M.: How to measure cognitive com- cite- plexity in human-computer interaction. In: seerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.33.5964 (1996) [18] Roy, S., Mariappan, R., Dandapat, S., Srivastava, S., Galhotra, S., Peddamuthu, B.: Qart: A system for real-time holistic quality assurance for contact center dialogues. In: Proc. 30th AAAI. pp. 3768 -- 3775 (2016), http://dl.acm.org/citation. cfm?id=3016387.3016434 [19] Spohrer, J., Maglio, P.P., Bailey, J., Gruhl, D.: Steps toward a science of service systems. Computer 40(1), 71 -- 77 (Jan 2007), http://dx.doi.org/ 10.1109/MC.2007.33 [20] Stolcke, A., Ries, K., Coccaro, N., Shriberg, E., Bates, R., Jurafsky, D., Taylor, P., Martin, R., Van Ess-Dykema, C., Meteer, M.: Dialogue act model- ing for automatic tagging and recognition of conver- sational speech. Computational linguistics 26(3), 339 -- 373 (2000) [21] Witten, I.H., Paynter, G.W., Frank, E., Gutwin, C., Nevill-Manning, C.G.: Kea: Practical automatic keyphrase extraction. In: Proc. 4th ACM Conf. Dig- ital Lib (1999) 11
1703.04677
2
1703
2017-05-31T11:53:01
A computational investigation of sources of variability in sentence comprehension difficulty in aphasia
[ "cs.CL", "cs.AI" ]
We present a computational evaluation of three hypotheses about sources of deficit in sentence comprehension in aphasia: slowed processing, intermittent deficiency, and resource reduction. The ACT-R based Lewis and Vasishth (2005) model is used to implement these three proposals. Slowed processing is implemented as slowed default production-rule firing time; intermittent deficiency as increased random noise in activation of chunks in memory; and resource reduction as reduced goal activation. As data, we considered subject vs. object rela- tives whose matrix clause contained either an NP or a reflexive, presented in a self-paced listening modality to 56 individuals with aphasia (IWA) and 46 matched controls. The participants heard the sentences and carried out a picture verification task to decide on an interpretation of the sentence. These response accuracies are used to identify the best parameters (for each participant) that correspond to the three hypotheses mentioned above. We show that controls have more tightly clustered (less variable) parameter values than IWA; specifically, compared to controls, among IWA there are more individuals with low goal activations, high noise, and slow default action times. This suggests that (i) individual patients show differential amounts of deficit along the three dimensions of slowed processing, intermittent deficient, and resource reduction, (ii) overall, there is evidence for all three sources of deficit playing a role, and (iii) IWA have a more variable range of parameter values than controls. In sum, this study contributes a proof of concept of a quantitative implementation of, and evidence for, these three accounts of comprehension deficits in aphasia.
cs.CL
cs
A computational investigation of sources of variability in sentence comprehension difficulty in aphasia Paul M atzig ([email protected]) University of Potsdam, Human Sciences Faculty, Department Linguistics, 24 -- 25 Karl-Liebknecht-Str., Potsdam 14476, Germany Shravan Vasishth, ([email protected]) University of Potsdam, Human Sciences Faculty, Department Linguistics, 24 -- 25 Karl-Liebknecht-Str., Potsdam 14476, Germany Felix Engelmann ([email protected]) The University of Manchester, School of Health Sciences Child Study Centre, Coupland 1, Oxford Road, Manchester M13 9PL David Caplan ([email protected]) Massachusetts General Hospital 175 Cambridge St, #340, Boston, Massachusetts 02114 Abstract We present a computational evaluation of three hypotheses about sources of deficit in sentence comprehension in apha- sia: slowed processing, intermittent deficiency, and resource reduction. The ACT-R based Lewis and Vasishth (2005) model is used to implement these three proposals. Slowed processing is implemented as slowed default production-rule firing time; intermittent deficiency as increased random noise in activa- tion of chunks in memory; and resource reduction as reduced goal activation. As data, we considered subject vs. object rela- tives whose matrix clause contained either an NP or a reflexive, presented in a self-paced listening modality to 56 individuals with aphasia (IWA) and 46 matched controls. The participants heard the sentences and carried out a picture verification task to decide on an interpretation of the sentence. These response accuracies are used to identify the best parameters (for each participant) that correspond to the three hypotheses mentioned above. We show that controls have more tightly clustered (less variable) parameter values than IWA; specifically, compared to controls, among IWA there are more individuals with low goal activations, high noise, and slow default action times. This suggests that (i) individual patients show differential amounts of deficit along the three dimensions of slowed processing, in- termittent deficient, and resource reduction, (ii) overall, there is evidence for all three sources of deficit playing a role, and (iii) IWA have a more variable range of parameter values than controls. In sum, this study contributes a proof of concept of a quantitative implementation of, and evidence for, these three accounts of comprehension deficits in aphasia. Keywords: Sentence Comprehension; Aphasia; Computa- tional Modeling; Cue-based Retrieval Introduction In healthy adults, sentence comprehension has long been ar- gued to be influenced by individual differences; a commonly assumed source is differences in working memory capacity (Daneman & Carpenter, 1980; Just & Carpenter, 1992). Other factors such as age (Caplan & Waters, 2005) and cognitive control (Novick, Trueswell, & Thompson-Schill, 2005) have also been implicated. An important question that has not received much attention in the computational psycholinguistics literature is: what are sources of individual differences in healthy adults versus im- paired populations, such as individuals with aphasia (IWA)? It is well-known that sentence processing performance in IWA is characterised by a performance deficit that expresses itself as slower overall processing times, and lower accu- racy in question-response tasks (see literature review in Patil, Hanne, Burchert, De Bleser, & Vasishth, 2016). These per- formance deficits are especially pronounced when IWA have to engage with sentences that have non-canonical word order and that are semantically reversible, e.g. Object-Verb-Subject versus Subject-Verb-Object sentences (Hanne, Sekerina, Va- sishth, Burchert, & Bleser, 2011). Regarding the underlying nature of this deficit in IWA, there is a consensus that some kind of disruption is occur- ring in the syntactic comprehension system. The exact nature of this disruption, however, is not clear. Although a broad range of proposals exist (see Patil et al., 2016), we focus on three influential proposals here: 1. Intermittent deficiencies: Caplan, Michaud, and Hufford (2015) suggest that occasional temporal breakdowns of parsing mechanisms capture the observed behaviour. 2. Resource reduction: A third hypothesis, due to Caplan (2012), is that the deficit is caused by a reduction in re- sources related to sentence comprehension. 3. Slowed processing: Burkhardt, Pinango, and Wong (2003) argue that a slowdown in parsing mechanisms can best ex- plain the processing deficit. Computational modelling can help evaluate these different proposals quantitatively. Specifically, the cue-based retrieval account of Lewis and Vasishth (2005), which was devel- oped within the ACT-R framework (Anderson et al., 2004), is a computationally implemented model of unimpaired sen- tence comprehension that has been used to model a broad ar- ray of empirical phenomena in sentence processing relating to similarity-based interference effects (Lewis & Vasishth, 2005; Nicenboim & Vasishth, 2017; Vasishth, Bruessow, Lewis, & Drenhaus, 2008; Engelmann, Jager, & Vasishth, 2016) and the interaction between oculomotor control and sentence comprehension (Engelmann, Vasishth, Engbert, & Kliegl, 2013).1 The Lewis and Vasishth (2005) model is particularly attrac- tive for studying sentence comprehension because it relies on the general constraints on cognitive processes that have been laid out in the ACT-R framework. This makes it possible to investigate whether sentence processing could be seen as be- ing subject to the same general cognitive constraints as any other information processing task, which does not entail that there are no language specific constraints on sentence com- prehension. A further advantage of the Lewis and Vasishth (2005) model in the context of theories of processing deficits in aphasia is that several of its numerical parameters (which are part of the general ACT-R framework) can be interpreted as implementing the three proposals mentioned above. In Patil et al. (2016), the Lewis and Vasishth (2005) archi- tecture was used to model aphasic sentence processing on a small scale, using data from seven patients. They modelled proportions of fixations in a visual world task, response ac- curacies and response times for empirical data of a sentence- picture matching experiment by Hanne et al. (2011). Their goal was to test two of the three hypotheses of sentence com- prehension deficits mentioned above, slowed processing and intermittent deficiency. In the present work, we provide a proof of concept study that goes beyond Patil et al. (2016) by evaluating the evi- dence for the three hypotheses -- slowed processing, intermit- tent deficiencies, and resource reduction -- using a larger data- set from Caplan et al. (2015) with 56 IWA and 46 matched controls. Before we describe the modelling carried out in the present paper and the data used for the evaluation, we first introduce the cognitive constraints assumed in the Lewis and Vasishth (2005) model that are relevant for this work, and show how the theoretical approaches to the aphasic processing deficit can be implemented using specific model parameters. Having introduced the essential elements of the model architecture, we simulate comprehension question-response accuracies for unimpaired controls and IWA, and then fit the simulated accu- racy data to published data (Caplan et al., 2015) from controls and IWA. When fitting individual participants, we vary three parameters that map to the three theoretical proposals men- tioned above. The goal was to determine whether the distri- butions of parameter values furnish any support for any of the three sources of deficits in processing. We expect that if there is a tendency in one parameter to show non-default values in IWA, for example slowed processing, then there is support for the claim that slowed processing is an underlying source of processing difficulty in IWA. Similar predictions hold for 1The model can be downloaded in its current form from https://github.com/felixengelmann/act-r-sentence-parser-em. the other two constructs, intermittent deficiency and resource reduction; and for combinations of the three proposals. Constraints on sentence comprehension in the Lewis and Vasishth (2005) model In this section, we describe some of the constraints assumed in the Lewis and Vasishth (2005) sentence processing model. Then, we discuss the model parameters that can be mapped to the three theoretical proposals for the underlying processing deficit in IWA. The ACT-R architecture assumes a distinction between long-term declarative memory and procedural knowledge. The latter is implemented as a set of rules, consisting of condition-action pairs known as production rules. These production rules operate on units of information known as chunks, which are elements in declarative memory that are defined in terms of feature-value specifications. For example, a noun like book could be stored as a feature-value matrix that states that the part-of-speech is nominal, number is singular, and animacy status is inanimate:   number animate sing no pos nominal   Each chunk is associated an activation, a numeric value that determines the probability and latency of access from declarative memory. Accessing chunks in declarative mem- ory happens via a cue-based retrieval mechanism. For exam- ple, if the noun book is to be retrieved, cues such as {part-of- speech nominal, number singular, and animate no} could be used to retrieve it. Production rules are written to trigger such a retrieval event. Retrieval only succeeds if the activation of a to-be-retrieved chunk is above a minimum threshold, which is a parameter in ACT-R. The activation of a chunk is determined by several con- straints. Let C be the set of all chunks in declarative memory. The total activation of a chunk i ∈ C equals Ai = Bi + Si + Pi + ε, (1) where Bi is the base-level or resting-state activation of the chunk i; the second summand Si represents the spreading ac- tivation that a chunk i receives during a particular retrieval event; the third summand is a penalty for mismatches be- tween a cue value j and the value in the corresponding slot of chunk i; and finally, ε is noise that is logistically dis- tributed, approximating a normal distribution, with location 0 and scale ANS which is related to the variance of the dis- tribution. It is generated at each new retrieval request. The retrieval time Ti of a chunk i depends on its activation Ai via Ti = F exp(−Ai), where F is a scaling constant which we kept constant at 0.2 here. The scale parameter ANS of the logistic distribution from which ε is generated can be interpreted as implementing the intermittent deficiency hypothesis, because higher values of ANS will tend to lead to more fluctuations in activation of a chunk and therefore higher rates of retrieval failure.2 Increas- ing ANS leads to a larger influence of the random element on a chunk's activation, which represents the core idea of in- termittent deficiency: that there is not a constantly present damage to the processing system, but rather that the deficit occasionally interferes with parsing, leading to more errors. The second summand in (1), representing the process of spreading activation within the ACT-R framework, can be made more explicit for the goal buffer and for retrieval cues j ∈ {1, . . . , J} as Si = J ∑ j=1 WjS ji . (2) Here, Wj = GA J , where GA is the goal activation parameter and S ji is a value that increases for each matching retrieval cue. S ji reflects the association between the content of the goal buffer and the chunk i. The parameter GA determines the total amount of activation that can be allocated for all cues j of the chunk in the goal buffer. It is a free parameter in ACT-R. This parameter, sometimes labelled the "W param- eter", has already been used to model individual differences in working memory capacity (Daily, Lovett, & Reder, 2001). Thus, it can be seen as one way (although by no means the only way) to implement the resource reduction hypothesis. The lower the GA value, the lower the difference in activa- tion between the retrieval target and other chunks. This leads to more retrieval failures and lower differences in retrieval la- tency on average. Finally, the hypothesis of slowed processing can be mapped to the default action time DAT in ACT-R. This de- fines the constant amount of time it takes a selected produc- tion rule to "fire", i.e. to start the actions specified in the ac- tion part of the rule. Higher values would lead to a higher delay in firing of production rules. Due to the longer decay in this case, retrieval may be slower and more retrieval failures may occur. Next, we evaluate whether there is evidence consistent with the claims regarding slowed processing, intermittent de- ficiency, and resource reduction, when implemented using the parameters described above. Simulations In this section we describe our modelling method and the pro- cedure we use for fitting the model results to the empirical data from Caplan et al. (2015). Materials We used the data from 56 IWA and 46 matched controls pub- lished in Caplan et al. (2015). In this data-set, participants listened to recordings of sentences presented word-by-word; 2As an aside, note that Patil et al. (2016) implemented intermit- tent deficiency using another source of noise in the model (utility noise). In future work, we will compare the relative change in qual- ity of fit when intermittent deficiency is implemented in this way. they paced themselves through the sentence, providing self- paced listening data. Participants processed 20 examples of 11 spoken sentence types and indicated which of two pictures corresponded to the meaning of each sentence. This yielded accuracy data for each sentence type. We chose two of the 11 sentence types for the current sim- ulation: simple subject relatives (The woman who hugged the girl washed the boy) vs. object relatives (The woman who the girl hugged washed the boy), and subject relatives with a reflexive (The woman who hugged the girl washed herself ) vs. object relatives with a reflexive (The woman who the girl hugged washed herself ). We chose relative clauses for two reasons. First, relative clauses have been very well-studied in psycholinguistics and serve as a typical example where pro- cessing difficulty is (arguably) experienced due to deviations in canonical word ordering (Just & Carpenter, 1992). Second, the Lewis and Vasishth model already has productions de- fined for these constructions, so the relative clause data serve as a good test of the model as it currently stands. The re- flexive in the second sentence type adds an additional layer of complexity to the sentences. In the model, this is reflected by an additional retrieval process on the reflexive, where the antecedent is retrieved. The Caplan et al. (2015) dataset only provides accuracy data for the dependency between the embedded verb and its subject. We will address this problem in future studies where new data will be collected. Lastly, since the production rules in the model were de- signed for modelling unimpaired processing, using them for IWA amounts to assuming that there is no damage to the pars- ing system per se, but rather that the processing problems in IWA are due to some subset of the cognitive constraints dis- cussed earlier. This also implies that the IWA's parsing sys- tem is not engaged in heuristic processing, as has sometimes been claimed in the literature; see Patil et al. (2016) for dis- cussion on that point. Method For the simulations, we refer to as the parameter space Π the set of all vectors (GA, DAT, ANS) with GA, DAT, ANS ∈ R. For computational convenience, we chose a discretisation of Π by defining a step-width and lower and upper boundaries for each parameter. In this discretised space Π′, we chose GA ∈ {0.2, 0.3, . . . , 1.1}, DAT ∈ {0.05, 0.06, . . . , 0.1}, and ANS ∈ {0.15, 0.2, . . . , 0.45}.3 Π′ could be visualised as a three-dimensional grid of 420 dots, which are the elements p′ ∈ Π′. The default parameter values were included in Π′. This means that models that vary only one or two of the three pa- rameters were included in the simulations. This is motivated by the results of Patil et al. (2016): there, the combined model varying both parameters (default action time (DAT) and util- ity noise) achieved the best fit to the data. Including all mod- 3The standard settings in the Lewis and Vasishth (2005) model are GA = 1, DAT = 0.05 (or 50 ms), and ANS = 0.15. SR control IWA OR control IWA GA DAT ANS GA & DAT GA & ANS DAT & ANS GA & DAT & ANS 19 38 21 40 10 27 20 38 24 41 26 48 18 32 21 38 11 33 20 40 16 36 25 48 18 42 36 53 Table 1: Number of participants in simple subject / object relatives for which non-default parameter values were predicted, in the subject vs. object relative tasks, respectively; for goal activation (GA), default action time (DAT) and noise (ANS) parameters. SR control IWA OR control IWA GA DAT ANS GA & DAT GA & ANS DAT & ANS GA & DAT & ANS 17 40 28 51 5 31 18 39 36 46 26 48 11 35 19 46 11 36 27 44 23 42 37 51 5 31 27 41 Table 2: Number of participants in subject / object relatives with reflexives for which non-default parameter values were predicted, in the subject vs. object relative tasks, respectively; for goal activation (GA), default action time (DAT) and noise (ANS) parameters. els allows us to do a similar investigation. For all participants in the Caplan et al. (2015) data-set, we calculated comprehension question response accuracies, av- eraged over all items of the subject / object relative clause and subject / object relative clause with reflexive conditions. For each p′ ∈ Π′, we ran the model for 1000 iterations for the subject and object relative tasks. From the model output, we determined whether the model made the correct attachment in each iteration, i.e. whether the correct noun was selected as subject of the embedded verb, and we calculated the ac- curacy in a simulation for a given parameter p′ ∈ Π′ as the proportion of iterations where the model made the correct at- tachment. We counted a parsing failures, where the model did not create the target dependency, as an incorrect response. The problem of finding the best fit for each subject can be phrased as follows: for all subjects, find the parameter vector that minimises the absolute distance between the model ac- curacy for that parameter vector and each subject's accuracy. Because there might not always be a unique p′ that solves this problem, the solution can be a set of parameter vectors. If for any one participant multiple optimal parameters were calcu- lated, we averaged each parameter value to obtain a unique parameter vector. This transforms the parameter estimates from the discretised space Π′ to the original parameter space Π. Results In this section we presents the results of the simulations and the fit to the data. First, we describe the general pattern of results reflected by the distribution of non-default parameter estimates per subject. Following that, we test whether tighter clustering occurs in controls. Distribution of normal parameter values Tables 1 and 2 show the number of participants for which a non-default pa- rameter value was predicted. By default values we mean the values GA = 1, DAT = 0.05 (or 50 ms), and ANS = 0.15. It is clear that, as expected, the number of subjects with non- default parameter values is always larger for IWA vs. con- trols, but controls show non-default values unexpectedly of- ten. In controls, the main difference between subject and ob- ject relatives is a clear increase in elevated noise values in object relatives for both simple subject / object relatives and those with reflexives. Perhaps surprisingly, in the reflexives condition (cf. Table 2), controls display higher DAT in subject vs. object relatives. For IWA in simple subject relatives, the single-parameter models are very similar, whereas in simple object relatives, most IWA (95%) exhibit elevated noise values, while a far smaller proportion (71%) showed reduced goal activation val- ues. In the relatives with reflexives, IWA show the same pat- tern in subject and object relatives, with a high degree of non- default parameter estimates for each of the three parameters. Overall, most IWA exhibit non-default parameter settings ANS and DAT. While in subject / object relatives with reflex- ives, a similar number of IWA shows elevated GA settings, we think this might be due to the similar model behaviours that non-default GA and ANS elicit. We address this point in the discussion below. Cluster analysis In order to investigate the predicted clus- tering of parameter estimates, we performed a cluster anal- ysis on the data too see to which degree controls and IWA could be discriminated. If our prediction is correct that, com- pared to IWA, clustering is tighter in controls, we expect that a higher proportion of the data should be correctly assigned to one of two clusters, one corresponding to controls, the other one corresponding to IWA. We chose hierarchical clustering to test this prediction. We combined the data for subject and object relatives into predicted group control IWA accuracy Subject relatives Object relatives IWA controls 24 32 57% IWA controls 21 35 63% 34 12 74% 42 4 91% Table 3: Discrimination ability of hierarchical clustering on the combined data for simple subject / object relative clauses. Numbers in bold show the number of correctly clus- tered data points. The bottom row shows the percentage ac- curacy. predicted group control IWA accuracy Subject relatives Object relatives controls IWA 45 11 20% IWA controls 17 39 70% 31 15 67% 27 19 59% Table 4: Discrimination ability of hierarchical clustering on the combined data for subject / object relative clauses with reflexives. The numbers in bold are the correct classifications of controls/IWA. The bottom row shows the percentage accu- racy. one respective data set, one for simple relatives, and one for relatives with reflexives. We calculated the dendrogram and cut the tree at 2, because we are only looking for the dis- crimination between controls and IWA. The results of this are shown in Table 3 and 4. In simple relatives (cf. Table 3), the clustering is able to identify controls better than IWA, but the identification of IWA is better than chance (50%). In rela- tives with reflexives (cf. Table 4), clustering shows moderate but above chance discrimination ability in subject relatives. In object relatives with reflexives, controls are discriminated barely above chance, while there is an above chance propor- tion of misclassifications in IWA, demonstrating poor perfor- mance of the clustering there. Discriminative ability might improve if all 11 constructions in Caplan et al. (2015) were to be used; this will be investigated in future work. Discussion The simulations and cluster analysis above demonstrate over- all tighter clustering in parameter estimates for controls, and more variance in IWA. This is evident from the clustering re- sults in Tables 3 and 4. These findings are consistent with the predictions of the small-scale study in Patil et al. (2016). However, there is considerable variability even in the param- eter estimates for controls, more than expected based on the results of Patil et al. (2016). The distribution of non-default parameter estimates (cf. Ta- bles 1 and 2) suggest that all three hypotheses are possible explanations for the patterns in our simulation results: com- pared to controls, estimates for IWA tend to include higher default action times and activation noise scales, and lower goal activation. These effects generally appear to be more pronounced in object relatives vs. subject relatives. This means that all the three hypotheses can be considered viable candidate explanations. Overall, more IWA than controls dis- play non-default parameter settings. Although there is evi- dence that many IWA are affected by all three impairments in our implementation, there are also many patients that show only one or two non-default parameter values. Again, this is more the case in object relatives than in subject relatives. In general, there is evidence that all three deficits are plau- sible to some degree. However, IWA differ in the degree of the deficits, and they have a broader range of parameter values than controls. Nevertheless, even the controls show a broad range of differences in parameter values, and even though these are not as variable as IWA, this suggests that some of the unimpaired controls can be seen as showing slowed pro- cessing, intermittent deficiencies, and resource reduction to some degree. There are several problems with the current modelling method. First, using the ACT-R framework with its multiple free parameters has the risk of overfitting. We plan to ad- dress this problem in three ways in future research. (1) Test- ing more constructions from the Caplan et al. (2015) data- set might show whether the current estimates are unique to this kind of construction, or if they are generalisable. (2) We plan to create a new data-set analogous to Caplan's, using German as the test language. Once the English data-set has been analysed and the conclusions about the different candi- date hypotheses have been tested on English, a crucial test of the conclusions will be cross-linguistic generalisability. (3) We plan to investigate whether an approach as in Nicenboim and Vasishth (2017), using lognormal race models and mix- ture models, can be applied to our research question. Second, the use of accuracies as modelling measure has some drawbacks. Informally, in an accuracy value there is less information encoded than in, for example, reading or lis- tening times. In future work, we will implement an approach modelling both accuracies and listening times. Also, counting each parsing failure as 'wrong' might yield overly conserva- tive accuracy values for the model; this will be addressed by assigning a random component into the calculation. This re- flects more closely a participant who guesses if he/she did not fully comprehend the sentence. Lastly, simulating the subject vs. object relative tasks sep- arately yields the undesirable interpretation of participants' parameters varying across sentence types. While this is not totally implausible, estimating only one set of parameters for all sentence types would reduce the necessity of making addi- tional theoretical assumptions on the underlying mechanisms, and allows for easier comparisons between different syntactic constructions. We plan to do this in future work. Although our method, as a proof of concept, showed that all three hypotheses are supported to some degree, it is worth investigating more thoroughly how different ACT-R mecha- nisms are influenced by changes in the three varied parame- ters in the present work. Implementing more of the construc- Engelmann, F., Vasishth, S., Engbert, R., & Kliegl, R. (2013). A framework for modeling the interaction of syntactic pro- cessing and eye movement control. Topics in Cognitive Science, 5(3), 452-474. Hanne, S., Sekerina, I., Vasishth, S., Burchert, F., & Bleser, R. D. (2011). Chance in agrammatic sentence comprehen- sion: What does it really mean? Evidence from Eye Move- ments of German Agrammatic Aphasics. Aphasiology, 25, 221-244. Just, M. A., & Carpenter, P. A. (1992). A capacity theory of comprehension: Individual differences in working mem- ory. Psychological Review, 99(1), 122 -- 149. Lewis, R. L., & Vasishth, S. (2005). An activation-based model of sentence processing as skilled memory retrieval. Cognitive Science, 29(3), 375 -- 419. Nicenboim, B., & Vasishth, S. (2017). Models of retrieval in sentence comprehension. In Proceedings of the First Stan Conference, StanCon. Novick, J. M., Trueswell, J. C., & Thompson-Schill, S. L. (2005). Cognitive control and parsing: Reexamining the role of Broca's area in sentence comprehension. Cognitive, Affective, & Behavioral Neuroscience, 5(3), 263 -- 281. Patil, U., Hanne, S., Burchert, F., De Bleser, R., & Vasishth, S. (2016). A computational evaluation of sentence process- ing deficits in aphasia. Cognitive Science, 40(1), 5 -- 50. Vasishth, S., Bruessow, S., Lewis, R. L., & Drenhaus, H. (2008). Processing polarity: How the ungrammatical in- trudes on the grammatical. Cognitive Science, 32(4), 685 -- 712. tions from Caplan et al. (2015) will, for example, enable us to explore how the different hypotheses interact with each other in our implementation. More specifically, the decision to use the ANS parameter makes the assumption that the high noise levels for IWA influence all declarative memory retrieval pro- cesses, and thus the whole memory, not only the production system. Also, as both the GA and ANS parameters lead to higher failure rates, it will be worth investigating in future work whether a more focussed source of noise, such as utility noise, may be a better way to model intermittent deficiencies. One possible way to delve deeper into identifying the sources of individual variability in IWA could be to inves- tigate whether sub-clusters show up within the IWA param- eter estimates. For example, different IWA being grouped together by high noise values could be interpreted as these patients sharing a common source of their sentence process- ing deficit (in this hypothetical case, our implementation of intermittent deficiencies). We will address this question once we have simulated data for more constructions of the Caplan et al. (2015) data-set. Acknowledgements Paul Matzig was funded by the Studienstiftung des deutschen Volkes. This research was partly funded by the Volkswagen Foundation grant 89 953 to Shravan Vasishth. References Anderson, J. R., Bothell, D., Byrne, M. D., Douglass, S., (2004). An integrated theory of Lebiere, C., & Qin, Y. the mind. Psychological Review, 111(4), 1036 -- 1060. Burkhardt, P., Pinango, M. M., & Wong, K. (2003). The role of the anterior left hemisphere in real-time sentence comprehension: Evidence from split intransitivity. Brain and Language, 86(1), 9 -- 22. Caplan, D. (2012). Resource reduction accounts of syntacti- cally based comprehension disorders. In C. K. Thompson & R. Bastiannse (Eds.), Perspectives on agrammatism (pp. 34 -- 48). Psychology Press. Caplan, D., Michaud, J., & Hufford, R. (2015). Mecha- nisms underlying syntactic comprehension deficits in vas- cular aphasia: New evidence from self-paced listening. Cognitive Neuropsychology, 32(5), 283 -- 313. Caplan, D., & Waters, G. (2005). The relationship between age, processing speed, working memory capacity, and lan- guage comprehension. Memory, 13(3-4), 403-413. Daily, L. Z., Lovett, M. C., & Reder, L. M. (2001). Modeling individual differences in working memory performance: A source activation account. Cognitive Science, 25(3), 315 -- 353. Daneman, M., & Carpenter, P. A. (1980). Individual differ- ences in working memory and reading. Journal of Verbal Learning and Verbal Behavior, 19, 450 -- 466. Engelmann, F., Jager, L. A., & Vasishth, S. (2016). The effect of prominence and cue association in retrieval processes: A computational account. Retrieved from https://osf.io/b56qv/
1704.01074
4
1704
2018-06-01T03:38:59
Emotional Chatting Machine: Emotional Conversation Generation with Internal and External Memory
[ "cs.CL", "cs.AI" ]
Perception and expression of emotion are key factors to the success of dialogue systems or conversational agents. However, this problem has not been studied in large-scale conversation generation so far. In this paper, we propose Emotional Chatting Machine (ECM) that can generate appropriate responses not only in content (relevant and grammatical) but also in emotion (emotionally consistent). To the best of our knowledge, this is the first work that addresses the emotion factor in large-scale conversation generation. ECM addresses the factor using three new mechanisms that respectively (1) models the high-level abstraction of emotion expressions by embedding emotion categories, (2) captures the change of implicit internal emotion states, and (3) uses explicit emotion expressions with an external emotion vocabulary. Experiments show that the proposed model can generate responses appropriate not only in content but also in emotion.
cs.CL
cs
Emotional Chatting Machine: Emotional Conversation Generation with Internal and External Memory Hao Zhou†, Minlie Huang†∗, Tianyang Zhang†, Xiaoyan Zhu†, Bing Liu‡ †State Key Laboratory of Intelligent Technology and Systems, National Laboratory for Information Science and Technology, Dept. of Computer Science and Technology, Tsinghua University, Beijing 100084, PR China ‡Dept. of Computer Science, University of Illinois at Chicago, Chicago, Illinois, USA [email protected] , [email protected] , [email protected], [email protected], [email protected] 8 1 0 2 n u J 1 ] L C . s c [ 4 v 4 7 0 1 0 . 4 0 7 1 : v i X r a Abstract Perception and expression of emotion are key factors to the success of dialogue systems or conversational agents. How- ever, this problem has not been studied in large-scale conver- sation generation so far. In this paper, we propose Emotional Chatting Machine (ECM) that can generate appropriate re- sponses not only in content (relevant and grammatical) but also in emotion (emotionally consistent). To the best of our knowledge, this is the first work that addresses the emotion factor in large-scale conversation generation. ECM addresses the factor using three new mechanisms that respectively (1) models the high-level abstraction of emotion expressions by embedding emotion categories, (2) captures the change of implicit internal emotion states, and (3) uses explicit emo- tion expressions with an external emotion vocabulary. Exper- iments show that the proposed model can generate responses appropriate not only in content but also in emotion. Introduction As a vital part of human intelligence, emotional intelligence is defined as the ability to perceive, integrate, understand, and regulate emotions (Mayer and Salovey 1997). It has been a long-term goal of artificial intelligence to enable a machine to understand affect and emotion (Picard and Pi- card 1997). To create a chatbot capable of communicating with a user at the human level, it is necessary to equip the machine with the ability of perceiving and expressing emo- tions. Existing studies show that addressing affect and emotion in dialogue systems or conversational agents can enhance user satisfaction (Prendinger, Mori, and Ishizuka 2005), and lead to fewer breakdowns in dialogues (Martinovski and Traum 2003). Some initial work has also been done on adjusting dialogue behaviors to suit users' emotional states (Polzin and Waibel 2000), and on generating responses to users' utterances at both the content- and affect-related lev- els (Skowron 2010). However, these studies, mostly inspired by psychology findings, are either rule-based or limited to small-scale data. Recently, neural models trained on large-scale data ∗Corresponding author: Minlie Huang, [email protected] .cn Copyright c(cid:13) 2018, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. have advanced open-domain conversation generation sig- nificantly (Ritter, Cherry, and Dolan 2011; Vinyals and Le 2015; Shang, Lu, and Li 2015; Serban et al. 2016). Most of these models aim to improve the content quality of conversation generation (Gu et al. 2016; Li et al. 2016a; Xing et al. 2017; Mou et al. 2016; Li et al. 2016b). To the best of our knowledge, the emotion factor has not been ad- dressed in existing neural models for conversation genera- tion. Table 1 shows some examples with/without consider- ing emotions. We can see that our ECM model is emotion- ally involved and more empathetic. User: Worst day ever. I arrived late because of the traffic. Basic Seq2Seq: You were late. ECM (Like): I am always here to support you. ECM (Happy): Keep smiling! Things will get better. ECM (Sad): It's depressing. ECM (Disgust): Sometimes life just sucks. ECM (Angry): The traffic is too bad! Table 1: Conversations with/without considering emotion. There are several challenges in addressing the emotion factor in large-scale conversation generation. First, high- quality emotion-labeled data are difficult to obtain in a large- scale corpus, as emotion annotation is a fairly subjective task and emotion classification is also challenging. Second, it is difficult to consider emotions in a natural and coherent way because we need to balance grammaticality and expressions of emotions, as argued in (Ghosh et al. 2017). Last, sim- ply embedding emotion information in existing neural mod- els, as shown in our experiments, cannot produce desirable emotional responses but just hard-to-perceive general ex- pressions (which contain only common words that are quite implicit or ambiguous about emotions, and amount to 73.7% of all emotional responses in our dataset). In this paper, we address the problem of generating emo- tional responses in open-domain conversational systems and propose an emotional chatting machine (ECM for short). To obtain large-scale emotion-labeled data for ECM, we train a neural classifier on a manually annotated corpus. The clas- sifier is used to annotate large-scale conversation data auto- matically for the training of ECM. To express emotion natu- rally and coherently in a sentence, we design a sequence- to-sequence generation model equipped with new mecha- nisms for emotion expression generation, namely, emotion category embedding for capturing high-level abstraction of emotion expressions, an internal emotion state for balanc- ing grammaticality and emotion dynamically, and an exter- nal emotion memory to help generate more explicit and un- ambiguous emotional expressions. In summary, this paper makes the following contributions: • It proposes to address the emotion factor in large-scale conversation generation. To the best of our knowledge, this is the first work on the topic. • It proposes an end-to-end framework (called ECM) to in- corporate the emotion influence in large-scale conversa- tion generation. It has three novel mechanisms: emotion category embedding, an internal emotion memory, and an external memory. • It shows that ECM can generate responses with higher content and emotion scores than the traditional seq2seq model. We believe that future work such as the empathetic computer agent and the emotion interaction model can be carried out based on ECM. Related Work In human-machine interactions, the ability to detect signs of human emotions and to properly react to them can en- rich communication. For example, display of empathetic emotional expressions enhanced users' performance (Partala and Surakka 2004), and led to an increase in user satisfac- tion (Prendinger, Mori, and Ishizuka 2005). Experiments in (Prendinger and Ishizuka 2005) showed that an empathetic computer agent can contribute to a more positive perception of the interaction. In (Martinovski and Traum 2003), the au- thors showed that many breakdowns could be avoided if the machine was able to recognize the emotional state of the user and responded to it sensitively. The work in (Polzin and Waibel 2000) presented how dialogue behaviors can be ad- justed to users' emotional states. Skowron (2010) proposed conversational systems, called affect listeners, that can re- spond to users' utterances both at the content- and affect- related level. These works, mainly inspired by psychological findings, are either rule-based, or limited to small data, making them difficult to apply to large-scale conversation generation. Re- cently, sequence-to-sequence generation models (Sutskever, Vinyals, and Le 2014; Bahdanau, Cho, and Bengio 2014) have been successfully applied to large-scale conversation generation (Vinyals and Le 2015), including neural respond- ing machine (Shang, Lu, and Li 2015), hierarchical recurrent models (Serban et al. 2015), and many others. These mod- els focus on improving the content quality of the generated responses, including diversity promotion (Li et al. 2016a), considering additional information (Xing et al. 2017; Mou et al. 2016; Li et al. 2016b; Herzig et al. 2017), and handing unknown words (Gu et al. 2016). However, no work has addressed the emotion factor in large-scale conversation generation. There are several stud- ies that generate text from controllable variables. (Hu et al. 2017) proposed a generative model which can generate sen- tences conditioned on certain attributes of the language such as sentiment and tenses. Affect Language Model was pro- posed in (Ghosh et al. 2017) to generate text conditioned on context words and affect categories. (Cagan, Frank, and Tsarfaty 2017) incorporated the grammar information to generate comments for a document using sentiment and top- ics. Our work is different in two main aspects: 1) prior stud- ies are heavily dependent on linguistic tools or customized parameters in text generation, while our model is fully data- driven without any manual adjustment; 2) prior studies are unable to model multiple emotion interactions between the input post and the response, instead, the generated text sim- ply continues the emotion of the leading context. Emotional Chatting Machine Background: Encoder-decoder Framework Our model is based on the encoder-decoder framework of the general sequence-to-sequence (seq2seq for short) model (Sutskever, Vinyals, and Le 2014). It is imple- mented with gated recurrent units (GRU) (Cho et al. 2014; Chung et al. 2014). The encoder converts the post sequence X = (x1, x2,··· , xn) to hidden representations h = (h1, h2,··· , hn), which is defined as: ht = GRU(ht−1, xt). (1) The decoder takes as input a context vector ct and the embedding of a previously decoded word e(yt−1) to update its state st using another GRU: st = GRU(st−1, [ct; e(yt−1)]), (2) where [ct; e(yt−1)] is the concatenation of the two vectors, serving as the input to the GRU cell. The context vector ct is designed to dynamically attend on key information of the input post during decoding (Bahdanau, Cho, and Ben- gio 2014). Once the state vector st is obtained, the decoder generates a token by sampling from the output probability distribution ot computed from the decoder's state st as fol- lows: yt ∼ ot = P (yt y1, y2,··· , yt−1, ct), = softmax(Wost). (3) (4) Task Definition and Overview Our problem is formulated as follows: Given a post X = (x1, x2,··· , xn) and an emotion category e of the response to be generated (explained below), the goal is to generate a response Y = (y1, y2,··· , ym) that is coherent with the emotion category e. Essentially, the model estimates t=1 P (yty<t, X, e). The emotion categories are {Angry, Disgust, Happy, Like, Sad, Other}, adopted from a Chinese emotion classification chal- lenge task.1 the probability: P (Y X, e) = (cid:81)m 1The taxonomy comes from http://tcci.ccf.org.cn/confere -nce/2014/dldoc/evatask1.pdf Figure 1: Overview of ECM (the grey unit). The pink units are used to model emotion factors in the framework. In our problem statement, we assume that the emotion cat- egory of the to-be-generated response is given, because emo- tions are highly subjective. Given a post, there may be mul- tiple emotion categories that are suitable for its response, de- pending on the attitude of the respondent. For example, for a sad story, someone may respond with sympathy (as a friend), someone may feel angry (as an irritable stranger), yet some- one else may be happy (as an enemy). Flexible emotion interactions between a post and a response are an impor- tant difference from the previous studies (Hu et al. 2017; Ghosh et al. 2017; Cagan, Frank, and Tsarfaty 2017), which use the same emotion or sentiment for response as that in the input post. Thus, due to this subjectivity of emotional responses, we choose to focus on solving the core problem: generating an emotional response given a post and an emotion category of the response. Our model thus works regardless the response emotion category. Note that there can be multiple ways to enable a chatbot to choose an emotion category for response. One way is to give the chatbot a personality and some back- ground knowledge. Another way is to use the training data to find the most frequent response emotion category for the emotion in the given post and use that as the response emo- tion. This method is reasonable as it reflects the general emo- tion of the people. We leave this study to our future work. Building upon the generation framework discussed in the previous section, we propose the Emotional Chatting Ma- chine (ECM) to generate emotion expressions using three mechanisms: First, since the emotion category is a high- level abstraction of an emotion expression, ECM embeds the emotion category and feeds the emotion category embed- ding to the decoder. Second, we assume that during decod- ing, there is an internal emotion state, and in order to capture the implicit change of the state and to balance the weights between the grammar state and the emotion state dynami- cally, ECM adopts an internal memory module. Third, an explicit expression of an emotion is modeled through an ex- plicit selection of a generic (non-emotion) or emotion word by an external memory module. An overview of ECM is given in Figure 1. In the train- ing process, the corpus of post-response pairs is fed to an emotion classifier to generate the emotion label of each re- sponse, and then ECM is trained on the data of triples: posts, responses and emotion labels of responses. In the inference process, a post is fed to ECM to generate emotional re- sponses conditioned on different emotion categories. Emotion Category Embedding Since an emotion category (for instance, Angry, Disgust, Happy) provides a high-level abstraction of an emotion ex- pression, the most intuitive approach to modeling emotion in response generation is to take as additional input the emotion category of a response to be generated. Each emotion cate- gory is represented by a real-valued, low dimensional vec- tor. For each emotion category e, we randomly initialize the vector of an emotion category ve, and then learn the vectors of the emotion category through training. The emotion cat- egory embedding ve, along with word embedding e(yt−1), and the context vector ct, are fed into the decoder to update the decoder's state st: st = GRU(st−1, [ct; e(yt−1); ve]). (5) Based on st, the decoding probability distribution can be computed accordingly by Eq. 4 to generate the next token yt. Internal Memory The method presented in the preceding section is rather static: the emotion category embedding will not change dur- ing the generation process which may sacrifice grammatical correctness of sentences as argued in (Ghosh et al. 2017). Inspired by the psychological findings that emotional re- sponses are relatively short lived and involve changes (Gross 1998; Hochschild 1979), and the dynamic emotion situation in emotional responses (Alam, Danieli, and Riccardi 2017), we design an internal memory module to capture the emo- tion dynamics during decoding. We simulate the process of expressing emotions as follows: there is an internal emotion state for each category before the decoding process starts; at each step the emotion state decays by a certain amount; once the decoding process is completed, the emotion state should decay to zero indicating the emotion is completely expressed. The detailed process of the internal memory module is il- lustrated in Figure 2. At each step t, ECM computes a read ECMEncoderEmotionEmbeddingInternalMemoryExternalMemoryDecoderEmotion ClassifierEmotional ResponsesCorpusPost2Response2Post3Response3……Post4Response4Post1Response1Training DataPost3Response3LikePost1Response1HappyPost4Response4SadPost2Response2Disgust……PostTrainingInferenceLike Happy SadDisgustAngryI am always here to support you.Keep smiling! Things will get better.It's depressing.Sometimes life just sucks.The traffic is too bad!Worst day ever. I arrived late because of the traffic. (non-emotion) words, such as person and day, we propose an external memory module to model emotion expressions explicitly by assigning different generation probabilities to emotion words and generic words. Thus, the model can choose to generate words from an emotion vocabulary or a generic vocabulary. Figure 3: Data flow of the decoder with an external mem- ory. The final decoding probability is weighted between the emotion softmax and the generic softmax, where the weight is computed by the type selector. The decoder with an external memory is illustrated in Fig- ure 3. Given the current state of the decoder st, the emotion softmax Pe(yt = we) and the generic softmax Pg(yt = wg) are computed over the emotion vocabulary which is read from the external memory and generic vocabulary, respec- tively. The type selector αt controls the weight of generat- ing an emotion or a generic word. Finally, the next word yt is sampled from the next word probability, the concatena- tion of the two weighted probabilities. The process can be formulated as follows: αt = sigmoid(vu (cid:62)st), gst), e st), (11) (12) (13) Pg(yt = wg) = softmax(Wo Pe(yt = we) = softmax(Wo (cid:20) (1 − αt)Pg(yt = wg) (cid:21) , yt ∼ ot = P (yt) = αtPe(yt = we) (14) where αt ∈ [0, 1] is a scalar to balance the choice between an emotion word we and a generic word wg, Pg/Pe is the distribution over generic/emotion words respectively, and P (yt) is the final word decoding distribution. Note that the two vocabularies have no intersection, and the final distribu- tion P (yt) is a concatenation of two distributions. Loss Function The loss function is the cross entropy error between the predicted token distribution ot and the gold distribution pt in the training corpus. Additionally, we apply two regular- ization terms: one on the internal memory, enforcing that the internal emotion state should decay to zero at the end of decoding, and the other on the external memory, con- straining the selection of an emotional or generic word. Figure 2: Data flow of the decoder with an internal mem- ory. The internal memory M I e,t is read with the read gate r,t to update the decoder's state, and the t by an amount M I gr memory is updated to M I e,t+1 with the write gate gw t . gate gr t with the input of the word embedding of the previ- ously decoded word e(yt−1), the previous state of the de- coder st−1, and the current context vector ct. A write gate is computed on the decoder's state vector st. The read gw t gate and write gate are defined as follows: g[e(yt−1); st−1; ct]), g st). t = sigmoid(Wr gr t = sigmoid(Ww gw (6) (7) The read and write gates are then used to read from and write into the internal memory, respectively. Hence, the t ) at each emotion state is erased by a certain amount (by gw step. At the last step, the internal emotion state will decay to zero. This process is formally described as below: M I t ⊗ M I e,t, t ⊗ M I e,t, M I r,t = gr e,t+1 = gw (8) (9) where ⊗ is element-wise multiplication, r/w denotes read/write respectively, and I means Internal. GRU updates its state st conditioned on the previous target word e(yt−1), the previous state of the decoder st−1, the context vector ct, and the emotion state update M I r,t, as follows: st = GRU(st−1, [ct; e(yt−1); M I r,t]). (10) Based on the state, the word generation distribution ot can be obtained with Eq. 4, and the next word yt can be e,t+1 is written sampled. After generating the next word, M I back to the internal memory. Note that if Eq. 9 is executed many times, it is equivalent to continuously multiplying the matrix, resulting in a decay effect since 0 ≤ sigmoid(·) ≤ 1. This is similar to a DELETE operation in memory net- works (Miller et al. 2016). External Memory In the internal memory module, the correlation between the change of the internal emotion state and selection of a word is implicit and not directly observable. As the emotion expressions are quite distinct with emotion words (Xu et al. 2008) contained in a sentence, such as lovely and awe- some, which carry strong emotions compared to generic DecoderAttentionGRUInternalMemoryctstotst-1e( yt-1 )ytIMe,tIg trg twMr,tIMe,t+1Read GateWrite Gate[e( yt-1 ) ; st-1 ; ct]ReadWriteword vectorstate vectornext wordGRUwhataGRUalovely……TypeSelectorGenericSoftmaxEmotionSoftmaxpersonα1-αstMeEytExternalMemory The loss on one sample < X, Y > (X = x1, x2, ..., xn, Y = y1, y2, ..., ym) is defined as: L(θ) = − m(cid:88) ptlog(ot) − m(cid:88) qtlog(αt)+ (cid:107) M I e,m (cid:107), t=1 t=1 (15) where M I e,m is the internal emotion state at the last step m, αt is the probability of choosing an emotion word or a generic word, and qt ∈ {0, 1} is the true choice of an emotion word or a generic word in Y . The second term is used to supervise the probability of selecting an emotion or generic word. And the third term is used to ensure that the internal emotion state has been expressed completely once the generation is completed. Data Preparation Since there is no off-the-shelf data to train ECM, we firstly trained an emotion classifier using the NLPCC emotion clas- sification dataset and then used the classifier to annotate the STC conversation dataset (Shang, Lu, and Li 2015) to con- struct our own experiment dataset. There are two steps in the data preparation process: 1. Building an Emotion Classifier. We trained several classifiers on the NLPCC dataset and then chose the best classifier for automatic annotation. This dataset was used in challenging tasks of emotion classification in NLPCC20132 and NLPCC20143, consisting of 23,105 sentences collected from Weibo. It was manually annotated with 8 emotion cat- egories: Angry, Disgust, Fear, Happy, Like, Sad, Surprise, and Other. After removing the infrequent classes (Fear (1.5%) and Surprise (4.4%)), we have six emotion cate- gories, i.e., Angry, Disgust, Happy, Like, Sad and Other. We then partitioned the NLPCC dataset into training, val- idation, and test sets with the ratio of 8:1:1. Several emo- tion classifiers were trained on the filtered dataset, including a lexicon-based classifier (Liu 2012) (we used the emotion lexicon in (Xu et al. 2008)), RNN (Mikolov et al. 2010), LSTM (Hochreiter and Schmidhuber 1997), and Bidirec- tional LSTM (Bi-LSTM) (Graves, Fern´andez, and Schmid- huber 2005). Results in Table 2 show that all neural clas- sifiers outperform the lexicon-based classifier, and the Bi- LSTM classifier obtains the best accuracy of 0.623. Method Lexicon-based RNN LSTM Bi-LSTM Accuracy 0.432 0.564 0.594 0.623 Table 2: Classification accuracy on the NLPCC dataset. 2. Annotating STC with Emotion. We applied the best classifier, Bi-LSTM, to annotate the STC Dataset with the six emotion categories. After annotation, we obtained an emotion-labeled dataset, which we call the Emotional STC (ESTC) Dataset. The statistics of the ESTC Dataset are shown in Table 3. Although the emotion labels for ESTC Dataset are noisy due to automatic annotation, this dataset is good enough to train the models in practice. As future work, we will study how the classification errors influence response generation. Posts Training Responses Validation Test Posts Posts 217,905 Angry Disgust Happy Like Sad Other 234,635 689,295 306,364 1,226,954 537,028 1,365,371 1,000 1,000 Table 3: Statistics of the ESTC Dataset. Experiments Implementation Details We used Tensorflow4 to implement the proposed model5. The encoder and decoder have 2-layer GRU structures with 256 hidden cells for each layer and use different sets of pa- rameters respectively. The word embedding size is set to 100. The vocabulary size is limited to 40,000. The embed- ding size of emotion category is set to 100. The internal memory is a trainable matrix of size 6×256 and the external memory is a list of 40,000 words containing generic words and emotion words (but emotion words have different mark- ers). To generate diverse responses, we adopted beam search in the decoding process of which the beam size is set to 20, and then reranked responses by the generation probability after removing those containing UNKs, unknown words. We used the stochastic gradient descent (SGD) algorithm with mini-batch. Batch size and learning rate are set to 128 and 0.5, respectively. To accelerate the training process, we trained a seq2seq model on the STC dataset with pre-trained word embeddings. And we then trained our model on the ESTC Dataset with parameters initialized by the parameters of the pre-trained seq2seq model. We ran 20 epoches, and the training stage of each model took about a week on a Titan X GPU machine. Baselines As aforementioned, this paper is the first work to address the emotion factor in large-scale conversation generation. We did not find closely-related baselines in the literature. Affect- LM (Ghosh et al. 2017) cannot be our baseline because it is unable to generate responses of different emotions for the same post. Instead, it simply copies and uses the emotion of the input post. Moreover, it depends heavily on linguistic resources and needs manual parameter adjustments. 2http://tcci.ccf.org.cn/conference/2013/ 3http://tcci.ccf.org.cn/conference/2014/ 4https://github.com/tensorflow/tensorflow 5https://github.com/tuxchow/ecm Nevertheless, we chose two suitable baselines: a general seq2seq model (Sutskever, Vinyals, and Le 2014), and an emotion category embedding model (Emb) created by us where the emotion category is embedded into a vector, and the vector serves as an input to every decoding position, sim- ilar to the idea of user embedding in (Li et al. 2016b). As emotion category is a high-level abstraction of emotion ex- pressions, this is a proper baseline for our model. Automatic Evaluation Metrics: As argued in (Liu et al. 2016), BLEU is not suit- able for measuring conversation generation due to its low correlation with human judgment. We adopted perplexity to evaluate the model at the content level (whether the content is relevant and grammatical). To evaluate the model at the emotion level, we adopted emotion accuracy as the agree- ment between the expected emotion category (as input to the model) and the predicted emotion category of a gener- ated response by the emotion classifier. Method Perplexity Accuracy Seq2Seq 68.0 Emb 62.5 ECM 65.9 w/o Emb 66.1 w/o IMem 66.7 w/o EMem 61.8 0.179 0.724 0.773 0.753 0.749 0.731 Table 4: Objective evaluation with perplexity and accuracy. Results: The results are shown in Table 4. As can be seen, ECM obtains the best performance in emotion accuracy, and the performance in perplexity is better than Seq2Seq but worse than Emb. This may be because the loss function of ECM is supervised not only on perplexity, but also on the se- lection of generic or emotion words (see Eq.15). In practice, emotion accuracy is more important than perplexity con- sidering that the generated sentences are already fluent and grammatical with the perplexity of 68.0. In order to investigate the influence of different modules, we conducted ablation tests where one of the three modules was removed from ECM each time. As we can see, ECM without the external memory achieves the best performance in perplexity. Our model can generate responses without sac- rificing grammaticality by introducing the internal memory, where the module can balance the weights between grammar and emotion dynamically. After removing the external mem- ory, the emotion accuracy decreases the most, indicating the external memory leads to a higher emotion accuracy since it explicitly chooses the emotion words. Note that the emotion accuracy of Seq2Seq is extremely low because it generates the same response for different emotion categories. Manual Evaluation In order to better understand the quality of the generated re- sponses from the content and emotion perspectives, we per- formed manual evaluation. Given a post and an emotion cat- egory, responses generated from all the models were ran- domized and presented to three human annotators. Metrics: Annotators were asked to score a response in terms of Content (rating scale is 0,1,2) and Emotion (rating scale is 0,1), and also to state a preference between any two systems. Content is defined as whether the response is ap- propriate and natural to a post and could plausibly have been produced by a human, which is a widely accepted metric adopted by researchers and conversation challenging tasks, as proposed in (Shang, Lu, and Li 2015). Emotion is defined as whether the emotion expression of a response agrees with the given emotion category. Annotation Statistics: We randomly sampled 200 posts from the test set. For each model we generated 1,200 re- sponses in total: for Seq2Seq, we generated the top 6 re- sponses for each post, and for Emb and ECM, we generated the top responses corresponding to the 6 emotion categories. We calculated the Fleiss' kappa (Fleiss 1971) to measure inter-rater consistency. Fleiss' kappa for Content and Emo- tion is 0.441 and 0.757, indicating "Moderate agreement" and "Substantial agreement" respectively. Method (%) Seq2Seq Emb ECM 2-1 9.0 22.8 27.2 1-1 5.1 9.3 10.8 0-1 1.1 4.3 4.4 2-0 37.6 27.1 24.2 1-0 28.0 19.1 15.5 0-0 19.2 17.4 17.9 Table 5: The percentage of responses in manual evaluation with the score of Content-Emotion. For instance, 2-1 means content score is 2 and emotion score is 1. Results: The results are shown in Table 6. ECM with all options outperforms the other methods in both metrics sig- nificantly (2-tailed t-test, p < 0.05 for Content, and p < 0.005 for Emotion). After incorporating the internal mem- ory and the external memory modules, the performance of ECM in Emotion is improved comparing to Emb, indicating our model can generate more explicit expressions of emo- tion. Besides, the performance in Content is improved from 1.256 of Emb to 1.299 of ECM, which shows the ability of ECM to control the weight of emotion and generate re- sponses appropriate in content. For all emotion categories, the performance of ECM in Emotion outperforms the other methods. However, the per- formances of ECM in Content is worse than baselines in Disgust and Angry categories, due to the fact that there are not sufficient training data for the two categories. For in- stance, the Angry category has 234,635 responses in our ESTC Dataset, much less than the other categories. To evaluate whether ECM can generate responses that are appropriate not only in content but also in emotion, we present results in Table 5 by considering content and emo- tion scores simultaneously6. As we can see, 27.2% of the responses generated by ECM have a Content score of 2 and an Emotion score of 1, while only 22.8% for Emb and 9.0% 6Note that Content and Emotion are two independent metrics. Figure 4: Sample responses generated by Seq2Seq and ECM (original Chinese and English translation, the colored words are the emotion words corresponding to the given emotion category). The corresponding posts did not appear in the training set. Method Seq2Seq Emb ECM Overall Like Sad Disgust Angry Happy Cont. 1.255 1.256 1.299 Emot. Cont. 1.308 0.152 1.348 0.363 0.424 1.460 Emot. Cont. 1.270 0.337 1.337 0.663 0.697 1.352 Emot. Cont. 1.285 0.077 1.272 0.228 0.313 1.233 Emot. Cont. 1.223 0.038 1.035 0.157 0.193 0.98 Emot. Cont. 1.223 0.052 1.418 0.162 0.217 1.428 Emot. 0.257 0.607 0.700 Table 6: Manual evaluation of the generated responses in terms of Content (Cont.) and Emotion (Emot.) . for Seq2Seq. These indicate that ECM is better in generating high-quality responses in both content and emotion. Pref. (%) Seq2Seq Emb ECM Seq2Seq Emb ECM 38.6 43.1 38.8 - 60.2 61.4 - 56.9 - Table 7: Pairwise preference of the three systems. Preference Test: In addition, emotion models (Emb and ECM) are much more preferred than Seq2Seq, and ECM is also significantly (2-tailed t-test, p < 0.001) preferred by annotators against other methods as shown in Table 7. The diverse emotional responses are more attractive to users than the generic responses generated by the Seq2Seq model. And with the explicitly expressions of emotions as well as the appropriateness in content, ECM is much more preferred. Analysis of Emotion Interaction and Case Study Figure 5 visualizes the emotion interaction patterns of the posts and responses in the ESTC Dataset. An emotion in- teraction pattern (EIP) is defined as < ep, er >, the pair of emotion categories of the post and its response. The value of an EIP is the conditional probability P (erep) = P (er, ep)/P (ep). An EIP marked with a darker color oc- curs more frequently than a lighter color. From the figure, we can make a few observations. First, frequent EIPs show that there are some major responding emotions given a post emo- Figure 5: Visualization of emotion interaction. tion category. For instance, when a post expresses Happy, the responding emotion is typically Like or Happy. Second, the diagonal patterns indicate emotional empathy, a common type of emotion interaction. Third, there are also other EIPs for a post, indicating that emotion interactions in conversa- tion are quite diverse, as mentioned earlier. Note that class Other has much more data than other classes (see Table 3), indicating that EIPs are biased toward this class (the first column of Figure 5), due to the data bias and the emotion classification errors. We present some examples in Figure 4. As can be seen, for a given post, there are multiple emotion categories that are suitable for its response in conversation. Seq2Seq gener- ates a response with a random emotion. ECM can generate Post Model Response(Original) Response(Translated) (cid:32)(cid:50)(cid:4)(cid:23)(cid:34)(cid:6)(cid:10)(cid:55)(cid:22)(cid:49)(cid:48)(cid:6)(cid:10)(cid:18)(cid:22)(cid:21)(cid:40)(cid:2) A promise is what a cheater says to a fool. Seq2Seq (cid:32)(cid:50)(cid:4)(cid:23)(cid:34)(cid:6)(cid:10)(cid:55)(cid:22)(cid:49)(cid:48)(cid:6)(cid:10)(cid:18)(cid:22)(cid:21)(cid:40)(cid:2) A promise is what a cheater says to a fool. ECM Like (cid:9)(cid:50)(cid:10)(cid:2) (cid:9)(cid:2)(cid:11)(cid:5)(cid:8)(cid:1)Promise is a single-minded fool Happy (cid:31)(cid:23)(cid:34)(cid:6)(cid:10)(cid:24)(cid:26)(cid:40)(cid:18)(cid:22)(cid:1)I'm just a happy fool Sad (cid:31)(cid:23)(cid:34)(cid:6)(cid:10)(cid:28)(cid:14)(cid:40)(cid:18)(cid:22) I am a sad fool Disgust (cid:6)(cid:10)(cid:55)(cid:22)(cid:49)(cid:48)(cid:6)(cid:10)(cid:18)(cid:22)(cid:21) A cheater says to a fool Angry (cid:8)(cid:47)(cid:15)(cid:16)(cid:8)(cid:16)(cid:4)(cid:20)(cid:36)(cid:31)(cid:16)(cid:12) Whatever you believe or not, I trust in it! (cid:45)(cid:53)(cid:43)(cid:41)(cid:40)(cid:31)(cid:44)(cid:38)(cid:46)(cid:7)(cid:35)(cid:1)Knowing the truth, I laughed myself to tears Seq2Seq (cid:45)(cid:53)(cid:43)(cid:41)(cid:40)(cid:31)(cid:44)(cid:38)(cid:33)(cid:7)(cid:35)(cid:2) After knowing the truth, I burst into tears. ECM Like (cid:7)(cid:6)(cid:39)(cid:4)(cid:13)(cid:7)(cid:6)(cid:39)(cid:4)(cid:12)(cid:1)Too lovely, it's too lovely. Happy (cid:46)(cid:25)(cid:31)(cid:44)(cid:38)(cid:54)(cid:19)(cid:35)(cid:12)(cid:2) I can't help laugh myself to tears. Sad (cid:45)(cid:53)(cid:43)(cid:41)(cid:40)(cid:31)(cid:44)(cid:38)(cid:33)(cid:7)(cid:35)(cid:2) After knowing the truth, I burst into tears. Disgust (cid:52)(cid:34)(cid:43)(cid:40)(cid:51)(cid:34)(cid:17)(cid:40)(cid:5) Is this true? Angry (cid:13)(cid:11)(cid:29)(cid:27)(cid:5)(cid:37)(cid:42)(cid:30)(cid:2) What do you mean? I don't understand. OtherLikeSadDisgustAngryHappyOtherLikeSadDisgustAngryHappy0.050.10.150.20.250.30.35OtherLikeSadDisgustAngryHappyOther Like Sad Disgust Angry Happy0.350.30.250.20.150.10.05 emotional responses conditioned on every emotion category. All these responses are appropriate to the post, indicating the existence of multiple EIPs and the reason why an emotion category should be specified as an input to our system. We can see that ECM can generate appropriate responses if the pre-specified emotion category and the emotion of the post belong to one of the frequent EIPs. Colored words show that ECM can explicitly express emotion by applying the ex- ternal memory which can choose a generic (non-emotion) or emotion word during decoding. For low-frequency EIPs such as < Happy, Disgust > and < Happy, Angry > as shown in the last two lines of Figure 4, responses are not ap- propriate to the emotion category due to the lack of training data and/or the errors caused by the emotion classifier. Conclusion and Future Work In this paper, we proposed the Emotional Chatting Machine (ECM) to model the emotion influence in large-scale con- versation generation. Three mechanisms were proposed to model the emotion factor, including emotion category em- bedding, internal emotion memory, and external memory. Objective and manual evaluation show that ECM can gen- erate responses appropriate not only in content but also in emotion. In our future work, we will explore emotion interactions with ECM: instead of specifying an emotion class, the model should decide the most appropriate emotion category for the response. However, this may be challenging since such a task depends on the topics, contexts, or the mood of the user. Acknowledgments This work was partly supported by the National Science Foundation of China under grant No.61272227/61332007, and a joint project with Sogou. We would like to thank our collaborators, Jingfang Xu and Haizhou Zhao. References [Alam, Danieli, and Riccardi 2017] Alam, F.; Danieli, M.; and Riccardi, G. 2017. Annotating and modeling empathy in spoken conversations. CoRR abs/1705.04839. [Bahdanau, Cho, and Bengio 2014] Bahdanau, D.; Cho, K.; and Bengio, Y. 2014. Neural machine translation by jointly learning to align and translate. CoRR abs/1409.0473. [Cagan, Frank, and Tsarfaty 2017] Cagan, T.; Frank, S. L.; and Tsarfaty, R. 2017. Data-driven broad-coverage gram- mars for opinionated natural language generation (onlg). In ACL, volume 1, 1331–1341. [Cho et al. 2014] Cho, K.; Van Merrienboer, B.; Gulcehre, C.; Bahdanau, D.; Bougares, F.; Schwenk, H.; and Ben- gio, Y. 2014. Learning phrase representations using rnn encoder-decoder for statistical machine translation. CoRR abs/1406.1078. [Chung et al. 2014] Chung, J.; Gulcehre, C.; Cho, K.; and Bengio, Y. Empirical evaluation of gated re- current neural networks on sequence modeling. CoRR abs/1412.3555. 2014. S., [Fleiss 1971] Fleiss, J. L. 1971. Measuring nominal scale Psychological bulletin agreement among many raters. 76(5):378. [Ghosh et al. 2017] Ghosh, S.; Chollet, M.; Laksana, E.; Morency, L.; and Scherer, S. 2017. Affect-lm: A neural language model for customizable affective text generation. In ACL, 634–642. [Graves, Fern´andez, and Schmidhuber 2005] Graves, A.; Fern´andez, S.; and Schmidhuber, J. 2005. Bidirectional lstm networks for improved phoneme classification and recognition. In ICANN, 799–804. Springer. [Gross 1998] Gross, J. J. 1998. The emerging field of emo- tion regulation: An integrative review. Review of general psychology 2(3):271. [Gu et al. 2016] Gu, J.; Lu, Z.; Li, H.; and Li, V. O. 2016. Incorporating copying mechanism in sequence-to-sequence learning. In ACL, 1631–1640. [Herzig et al. 2017] Herzig, J.; Shmueli-Scheuer, M.; Sand- bank, T.; and Konopnicki, D. 2017. Neural response gen- eration for customer service based on personality traits. In Proceedings of the 10th International Conference on Natu- ral Language Generation, 252–256. [Hochreiter and Schmidhuber 1997] Hochreiter, and Schmidhuber, J. 1997. Long short-term memory. Neural computation 9(8):1735–1780. [Hochschild 1979] Hochschild, A. R. 1979. Emotion work, feeling rules, and social structure. American journal of so- ciology 551–575. [Hu et al. 2017] Hu, Z.; Yang, Z.; Liang, X.; Salakhutdinov, R.; and Xing, E. P. 2017. Toward controlled generation of text. In ICML, 1587–1596. [Li et al. 2016a] Li, J.; Galley, M.; Brockett, C.; Gao, J.; and Dolan, B. 2016a. A diversity-promoting objective function for neural conversation models. In NAACL, 110–119. [Li et al. 2016b] Li, J.; Galley, M.; Brockett, C.; Sp- ithourakis, G.; Gao, J.; and Dolan, W. B. 2016b. A persona- based neural conversation model. In ACL, 994–1003. [Liu et al. 2016] Liu, C.; Lowe, R.; Serban, I.; Noseworthy, M.; Charlin, L.; and Pineau, J. 2016. How NOT to eval- uate your dialogue system: An empirical study of unsuper- vised evaluation metrics for dialogue response generation. In EMNLP, 2122–2132. [Liu 2012] Liu, B. 2012. Sentiment analysis and opinion mining. Morgan & Claypool Publishers. [Martinovski and Traum 2003] Martinovski, B., and Traum, D. 2003. Breakdown in human-machine interaction: the In Proceedings of the ISCA tutorial and error is the clue. research workshop, 11–16. [Mayer and Salovey 1997] Mayer, J. D., and Salovey, P. 1997. What is emotional intelligence? Emotional Devel- opment and Emotional Intelligence 3–31. [Mikolov et al. 2010] Mikolov, T.; Karafi´at, M.; Burget, L.; Cernock`y, J.; and Khudanpur, S. 2010. Recurrent neural network based language model. In Interspeech, volume 2, 3. J. 2008. Affective lexicon ontology. Journal of information 27(2):180–185. 2005. H., T., and 2004. Surakka, The effects of affective interventions in Interacting with computers [Miller et al. 2016] Miller, A. H.; Fisch, A.; Dodge, J.; Karimi, A.; Bordes, A.; and Weston, J. 2016. Key- value memory networks for directly reading documents. In EMNLP, 1400–1409. [Mou et al. 2016] Mou, L.; Song, Y.; Yan, R.; Li, G.; Zhang, L.; and Jin, Z. 2016. Sequence to backward and for- ward sequences: A content-introducing approach to gener- ative short-text conversation. In COLING, 3349–3358. [Partala and Surakka 2004] Partala, V. human–computer interaction. 16(2):295–309. [Picard and Picard 1997] Picard, R. W., and Picard, R. 1997. Affective computing, volume 252. MIT press Cambridge. [Polzin and Waibel 2000] Polzin, T. S., and Waibel, A. 2000. Emotion-sensitive human-computer interfaces. In ISCA Tu- torial and Research Workshop (ITRW) on Speech and Emo- tion, 201–206. [Prendinger and Ishizuka 2005] Prendinger, and Ishizuka, M. The empathic companion: A character-based interface that addresses users'affective states. Applied Artificial Intelligence 19(3-4):267–285. [Prendinger, Mori, and Ishizuka 2005] Prendinger, H.; Mori, J.; and Ishizuka, M. 2005. Using human physiology to eval- uate subtle expressivity of a virtual quizmaster in a math- International journal of human-computer ematical game. studies 62(2):231–245. [Ritter, Cherry, and Dolan 2011] Ritter, A.; Cherry, C.; and Dolan, W. B. 2011. Data-driven response generation in so- cial media. In EMNLP, 583–593. [Serban et al. 2015] Serban, I. V.; Sordoni, A.; Bengio, Y.; Courville, A. C.; and Pineau, J. 2015. Hierarchical neu- ral network generative models for movie dialogues. CoRR abs/1507.04808. [Serban et al. 2016] Serban, I. V.; Sordoni, A.; Bengio, Y.; Courville, A. C.; and Pineau, J. 2016. Building end-to- end dialogue systems using generative hierarchical neural network models. In AAAI, 3776–3784. [Shang, Lu, and Li 2015] Shang, L.; Lu, Z.; and Li, H. 2015. Neural responding machine for short-text conversation. In ACL, 1577–1586. [Skowron 2010] Skowron, M. 2010. Affect listeners: Acqui- sition of affective states by means of conversational systems. In Development of Multimodal Interfaces: Active Listening and Synchrony. Springer. 169–181. [Sutskever, Vinyals, and Le 2014] Sutskever, I.; Vinyals, O.; and Le, Q. V. 2014. Sequence to sequence learning with neu- ral networks. In Advances in neural information processing systems, 3104–3112. [Vinyals and Le 2015] Vinyals, O., and Le, Q. 2015. A neu- ral conversational model. CoRR abs/1506.05869. [Xing et al. 2017] Xing, C.; Wu, W.; Wu, Y.; Liu, J.; Huang, Y.; Zhou, M.; and Ma, W. 2017. Topic aware neural response generation. In AAAI, 3351–3357. [Xu et al. 2008] Xu, L.; Lin, H.; Pan, Y.; Ren, H.; and Chen,
1209.2400
1
1209
2012-09-11T19:18:26
Identification of Fertile Translations in Medical Comparable Corpora: a Morpho-Compositional Approach
[ "cs.CL" ]
This paper defines a method for lexicon in the biomedical domain from comparable corpora. The method is based on compositional translation and exploits morpheme-level translation equivalences. It can generate translations for a large variety of morphologically constructed words and can also generate 'fertile' translations. We show that fertile translations increase the overall quality of the extracted lexicon for English to French translation.
cs.CL
cs
Identification of Fertile Translations in Medical Comparable Corpora : a Morpho-Compositional Approach Estelle Delpech, B´eatrice Daille, Emmanuel Morin Universit´e de Nantes - LINA FRE CNRS 2729 Claire Lemaire Lingua et Machina 2 rue de la Houssini`ere BP 92208 44322 Nantes Cedex 3, France c/o Inria Rocquencourt BP 105 Le Chesnay Cedex 78153, France {name.surname}@univ-nantes.fr [email protected] Abstract This paper defines a method for lexicon in the biomedical domain from comparable corpora. The method is based on compositional transla- tion and exploits morpheme-level translation equivalences. It can generate translations for a large variety of morphologically constructed words and can also generate 'fertile' transla- tions. We show that fertile translations in- crease the overall quality of the extracted lex- icon for English to French translation. 1 Introduction Comparable corpora are composed of texts in dif- ferent languages which are not translations but deal with the same subject matter and were produced in similar situations of communication so that there is a possibility to find translation pairs in the texts. Comparable corpora have been used mainly in the field of Cross-Language Information Retrieval and Computer-Aided Translation (CAT). In CAT, which is our field of application, comparable corpora have been used to extract domain-specific bilingual lexi- cons for language pairs or subject domains for which no parallel corpora is available. Another advantage of comparable corpora is that they contain more id- iomatic expressions than parallel corpora do. In- deed, the target texts of parallel corpora are trans- lations and bear the influence of the source lan- guage whereas the target texts of comparable cor- pora are original, spontaneous productions. The main drawback of comparable corpora is that much fewer translation pairs can be extracted than in paral- lel corpora because (i) not all source language terms the corpus in order do have a translation in the target texts and (ii) when there is a translation, it may not be present in its canonical form, precisely because the target texts are not translations. As observed by Baker (1996), translated texts tend to bear features like explica- tion, simplification, normalization and leveling out. For instance, an English-French comparable cor- pus may contain the English term post-menopausal but not its "normalized" or "canonical" transla- tion in French (post-m´enopausique). However, there might be some morphological or paraphras- tic variants in the French texts like post-m´enopause 'post-menopause' or apr`es la m´enopause 'after The solution that consists in the menopause'. increasing the size of to find more translation pairs or to extract par- allel segments of (Fung and Cheung, 2004; Rauf and Schwenk, 2009) is only possible when large amounts of texts are available. In the case of the extraction of domain-specific lexicons, we quickly face the problem of data scarcity: in order to extract high-quality lexicons, the corpus must con- tain text dealing with very specific subject domains and the target and source texts must be highly com- parable. If one tries to increase the size of the cor- pus, one takes the risk of decreasing its quality by lowering its comparability or adding out-of-domain texts. Studies support the idea that the quality of the corpora is more important than its size. Morin et al. (2007) show that the discourse categorization of the documents increases the precision of the lexicon de- spite the data sparsity. Bo and Gaussier (2010) show that they improve the quality of a lexicon if they im- prove the comparability of the corpus by selecting text a smaller - but more comparable - corpus from an initial set of documents. Consequently, one solu- tion for increasing the number or translation pairs is to focus on identifying translation variants. This paper explores the feasibility of identifying "fertile" translations in comparable corpora. In parallel texts processing, the notion of fertility has been defined by Brown et al. (1993). They defined the fertility of a source word e as the number of target words to which e is connected in a randomly selected alignment. Similarly, we call a fertile translation a translation pair in which the target term has more words than the source term. We propose to identify such translations with a method mixing morpholog- ical analysis and compositional translation : (i) the source term is decomposed into morphemes: post- menopausal is split into post- + menopause1 ; (ii) the morphemes are translated as bound morphemes or fully autonomous words: post- becomes post- or apr`es and menopause becomes m´enopause and (iii) the translated elements are recomposed into a target term: post-m´enopause, apr`es la m´enopause. This paper falls into 4 sections. Section 2 out- lines recent research in compositionality-based lex- icon extraction. Section 3 explains the algorithm of morpho-compositional translation. Experimental data and results and described in sections 4 and 5. 2 Related work Most of the research work in lexicon extraction from comparable corpora concentrates on same- length term alignment. To our knowledge, only Daille and Morin (2005) and Weller et al. (2011) tried to align terms of different lengths. Daille and Morin (2005) focus on the specific case of multi- word terms whose meanings are non-compositional and tried to align these multi-word terms with ei- ther single-word terms or multi-word terms using a context-based approach2.Weller et al. (2011) con- centrate on aligning German NOUN-NOUN com- 1We use the following notations for morphemes: trailing hy- phen for prefixes (a-), leading hyphen for suffixes (-a), both for confixes (-a-) and no hyphen for autonomous morphemes (a). Morpheme boundaries are represented by a plus sign (+). 2Context-based methods were introduced by Rapp (1995) and Fung (1997). They consist in comparing the contexts in which the source and target terms occur. Their drawback is that they need the source and target terms to be very frequent. pounds to NOUN NOUN and NOUN PREP NOUN structures in French and English. We chose to work in the framework of (i) compositionality-based translation because: terms form more than 60% of compositional the new terms found in techno-scientific do- mains, and especially in the field of biomedecine (Namer and Baud, 2007) compositionality- based methods have been shown to clearly outperform context-based ones the trans- terms with compositional meaning lation of (Morin and Daille, 2010) that compositionality-based methods offer the opportu- nity to generate fertile translations if combined with a morphology-based approach. (iii) we believe (ii) for 2.1 Principle of compositional translation Compositional translation relies on the principle of compositionality which states that "the meaning of the whole is a function of the meaning of the parts" (Keenan and Faltz, 1985, 24-25). Applied to bilin- gual lexicon extraction, compositional translation (CT ) consists in decomposing the source term into atomic components (D), translating these compo- nents into the target language (T ), recomposing the translated components into target terms (R) and fi- nally filtering the generated translations with a se- lection function (S): CT ("ab") = S(R(T (D("ab")))) = S(R(T ({a, b}))) = S(R({T (a) × T (b)})) = S(R({A, B})) = S({A, B}, {B, A}) = "BA" where "ab" is a source term composed of a and b, "BA" is a target term composed of B and A and there exists a bilingual resource linking a to A and b to B. 2.2 Implementations of compositional translation Existing implementations differ on the kind of atomic components they use for translation. Lexical compositional translation Baldwin and Tanaka, 2004; (Grefenstette, 1999; Robitaille et al., 2006; Morin and Daille, 2010) deals with multi-word term to multi-word term alignment and uses lexical words3 as atomic components : rate of evaporation is translated into French taux d'´evaporation by translating rate as ´evaporation using dictionary lookup. Recomposition may be done by permutating the translated compo- nents (Morin and Daille, 2010) or with translation patterns (Baldwin and Tanaka, 2004). taux and evaporation as Sublexical compositional translation deals with single-word term translation. The atomic compo- nents are subparts of the source single-word term. Cartoni (2009) translates neologisms created by prefixation with a special formalism called Bilin- gual Lexeme Formation Rules. Atomic compo- nents are the prefix and the lexical base: Italian neologism anticonstituzionale 'anticonstitution' is translated into French anticonstitution by translating the prefix anti- as anti- and the lexical base con- stituzionale as constitution. Weller et al. (2011) translate two types of single-word term. German single-word term formed by the concatenation of two neoclassical roots are decomposed into these two roots, then the roots are translated into tar- get language roots and recomposed into an English or French single-word term, e.g. Kalori1metrie2 is translated as calori1metry2. German NOUN1- NOUN2 compounds are translated into French and English NOUN1NOUN2 or NOUN1 PREP NOUN2 multi-word term, e.g. ElektronenN 1-mikroskopN 2 is translated as electronN 1 microscopeN 2. 2.3 Challenges of compositional translation Compositional translation faces four main chal- lenges which are (i) morphosyntactic variation: source and target terms' morphosyntactic structures are different: anti-cancerNOUN → anti-canc´ereuxADJ 'anti-cancerous' ; (ii) lexical variation: source and target terms contain semantically related - but not equivalent - words: machine translation → tra- duction automatique 'automatic translation' ; (iii) fertility: the target term has more content words than the source term: isothermal snowpack → manteau neigeux isotherme 'isothermal snow man- tel' ; (iv) terminological variation: a source term can be translated as different target terms: oophorec- 3as opposed to grammatical words: preposition, determin- ers, etc. tomy → ovariectomie 'oophorectomy', ablation des ovaires 'removal of the ovaries'. Solutions lexical to morphosyntactic, and to some extent terminological variation have been proposed in the form of thesaurus lookup (Robitaille et al., 2006), morphological derivation rules (Morin and Daille, 2010), morphological vari- ant dictionaries (Cartoni, 2009) or morphosyntactic translation (Baldwin and Tanaka, 2004; Weller et al., 2011). Fertility has been addressed by Weller et al. (2011) for the specific case of German NOUN-NOUN compounds. patterns 3 Morpho-compositional translation 3.1 Underlying assumptions Morpho-compositional (morpho- compositional translation) relies on the following assumptions: translation Lexical subcompositionality. The lexical items which compose a multi-word term or a single-word term may be split into semantically-atomic compo- nents. These components may be either free (i.e. they can occur in texts as autonomous lexical items like toxicity in cardiotoxicity) or bound (i.e. they cannot occur as autonomous lexical items, in that case they correspond to bound morphemes like - cardio- in cardiotoxicity). Irrelevance of the bound/free feature in trans- lation. Translation occurs regardless of the compo- nents' degree of freedom: -cardio- may be translated as coeur 'heart' as in cardiotoxicity → toxicit´e pour le coeur 'toxicity to the heart'. Irrelevance of the bound/free feature in allo- morphy. Allomorphy happens regardless of the components' degree of freedom: -cardio-, coeur 'heart', cardiaque 'cardiac' are possible instantia- tions of the same abstract component and may lead to terminological variation as in cardiotoxicity → cardiotoxicit´e 'cardiotoxicity', toxicit´e pour le coeur 'toxicity to the heart', toxicit´e cardiaque 'cardiac toxicity'. Like other sublexical approaches, the main idea behind morpho-compositional translation is to go beyond the word level and work with subword components. In our case, these components are morpheme-like items which either (i) bear refer- ential lexical meaning like confixes4 (-cyto-, -bio- , -ectomy-) and autonomous lexical items (can- toxicity) or (ii) can substantially change the cer, meaning of a word, especially prefixes (anti-, post- , co-...) and some suffixes (-less, -like...). Un- like other approaches, morpho-compositional trans- lation is not limited to small set of source-to-target structure equivalences. It takes as input a single morphologically constructed word unit which can be the result of prefixation 'pretreatment', confix- ation 'densitometry', suffixation 'childless', com- pounding 'anastrozole-associated' or any combi- nations of the four. It outputs a list of n words who may or may not be morphologically con- structed. For instance, postoophorectomy may be translated as postovariectomie 'postoophorectomy', apr`es l'ovariectomie 'after the oophorectomy' or apr`es l'ablation des ovaires 'after the removal of the ovaries'. 3.2 Algorithm As an example, we show the translation of the ad- jective cytotoxic into French using a toy dataset. type be a list of components in language Let Compl l where type equals pref for prefixes, conf for confixes, suf f for suffixes and f ree for free lex- ical units ; T rans be the translation table which maps source and target components ; V arl be a table mapping related lexical units in language l ; Stopl a list of stopwords in language l ; Corpusl a lemmatized, pos-tagged corpus in language l: Compen Compen Compf r Compf r T rans = {{-cyto- → -cyto-, cellule}, conf = {-cyto-} ; f ree = {cytotoxic, cytotoxicity, toxic} ; conf = {-cyto-} ; f ree = {cellule, toxique} ; {toxic → toxique}} ; V aren = {cytoxic → cytoxicity} ; Stopf r = {pour, le} ; Corpusf r = "le/DET cytotoxicit´e/N etre/AUX le/DET propri´et´e/N de/PREP ce/DET qui/PRO etre/AUX toxique/A pour/PREP le/DET cellule/N ./PUN" ; 'The cytotoxicity is the property of what is toxic to the cells.' Morpho-compositional translation takes as input a source language single-word term and outputs zero 4we use the term confix as a synonym of neoclassical roots (Latin or Ancient Greek root words). language single-word terms or target or several multi-word terms. It is the result of the sequen- tial application of four functions to the input single- word term: decomposition (D), translation (T ), re- composition (R) and selection (S). 3.2.1 Decomposition function The decomposition function D works in two steps D1 and D2. conf, Compsrc Step 1 of decomposition (D1) splits the in- put single-word term into minimal components by matching substrings of the single-word term with suf f, the resources Compsrc, Compsrc f ree and respecting some length constraints Compsrc on the substrings. For example, one may split a single-word term SW T1,n of n characters into pre- fix P ref1,i and lexical base LexBasei+1,n pro- pref and SW Ti+1,n ∈ vided that SW T1,i ∈ Compsrc f ree and n − i > L0 ; L0 being empirically Compsrc set to 5. A single-word term is first split into an op- tional prefixe + base1, then base1 is split into base2 + optional suffix, then base2 is split into one or several confixes or lexical items. When several splittings are possible, only the ones with the highest number of minimal components are retained. S(R(T (D2(D1("cytotoxic"'))))) = S(R(T (D2({cyto, toxic})))) Step 2 of decomposition (D2) gives out all possible decompositions of the single-word term by enumerating the different concatenations of its minimal components. For example, if single-word term "abc" has been split into minimal compo- nents {a,b,c}, then it has 4 possible decompositions: {abc}, {a,bc}, {ab,c}, {a,b,c}. For a single-word term having n minimal components, there exists 2n−1 possible decompositions. S(R(T (D2({cyto, toxic})))) = S(R(T ({cyto, toxic}, {cytotoxic}))) The concatenation of the minimal components into bigger components increases the chances of finding translations. For example, consider the single-word term non-cytotoxic and a dictionary having translations for non, cyto and cytotoxic but no translation for toxic. If we stick to the sole out- put of D1 {non-,-cyto-,toxic}, the translation of non- cytotoxic will fail because there is no translation for toxic. Whereas if we also consider the output of D2 which contains the decomposition {non-,cytotoxic}, we will be able to translate non-cytotoxic because the dictionary has an entry for cytotoxic. 3.2.2 Translation function The translation function T provides translations for each decomposition output by D. Applying the compositionality principle to translation, we con- sider that the translation of the whole is a function of the translation of the parts: T (a, b) ∼= T (a) × T (b). For a given decomposition {c1, ...cn} having n i=1 T (ci) possible components, translations. translations are ob- tained using the T rans and V ar resources: T (c) = T rans(c) ∪ T rans(V arsrc(c)) ∪ V artgt(T rans(c)). If one of the component cannot be translated, the translation of the whole decomposition fails. there exists Qn Components' S(R(T ({cyto, toxic}, {cytotoxic}))) = S(R(T (cyto) × T (toxic), T (cytotoxic))) = S(R({cyto, toxique},{cellule, toxique}, {cytotoxicit´e})) 3.2.3 Recomposition function The recomposition function R takes as input the translations outputted by T and recomposes them into sequences of one or several lexical items. It takes place in two steps. Step 1 of recomposition (R1) generates, for a given translation of n items, all of the n! possi- ble permutations of these items. As a general rule, O(n!) procedures should be avoided but we are per- muting small sets (up to 4 items). This captures the fact that components' order may be different in the source and target language (distortion). Once the components have been permutated, we generate, for each permutation, all the different concatenations of its components into lexical items (like it is done in step 2 of decomposition). S(R2(R1({cyto,toxique},{cellule,toxique}, {cytotoxicit´e}))) = S(R2({cyto,toxique}, {cytotoxique}, {toxique,cyto}, {toxiquecyto}, {cellule, toxique}, {celluletoxique}, {toxique, cellule}, {toxiquecellule}, {cytotoxicit´e})) Step 2 of recomposition (R2) filters out the ouput of R1 using heuristic rules. For example, pref ∪ Comptgt a sequence of lexical items L = {l1, ...ln} would be filtered out provided that ∃ l ∈ L l ∈ Comptgt suf f, i.e. recom- position {cytotoxique} would be accepted but not {-cyto-, toxique} because -cyto- is a bound compo- nent (it should not appear as an autonomous lexical item). conf ∪ Comptgt S(R2({cyto,toxique}, {cytotoxique}, {toxique,cyto}, {toxiquecyto}, {cellule, toxique}, {celluletoxique}, {toxique, cellule}, {toxiquecellule}, {cytotoxicit´e})) = S({cytotoxique}, {toxiquecyto}, {cellule, toxique}, {celluletoxique}, {toxique, cellule}, {toxiquecellule}, {cytotoxicit´e}) These concatenations correspond to the final lex- ical units which will be matched against the tar- get corpus with the selection function. For exam- ple, the concatenation {toxiqueA, celluleB} corre- sponds to a translation made of two distinct lexical items: toxique followed by cellule. The concatena- tion {cytotoxiqueAB} corresponds to only one lexi- cal item: cytotoxique. 3.2.4 Selection function The selection function S tries to match the se- quences of lexical items outputted by R with the lemmas of the tokens of the target corpus. We call T = {t1, ...tm} a sequence of tokens from the target corpus, l(tk) the lemma of token tk and p(tk) the part-of-speech of token tk. We call L = {l1, ...ln} a sequence of lexical items outputted by R. L matches T if there exists a strictly increasing sequence of indices I = {i1, ...in} such as l(tij ) = lj and ∀j, 1 ≤ j ≤ n and ∀i, 1 ≤ ij−1 − ij ≤ L1 and ∀tk k /∈ I, l(tk) ∈ Stoptgt ; L1 being empirically set to 3. = S({cytotoxique}, {toxiquecyto}, {cellule, toxique}, {celluletoxique}, {toxique, cellule}, {toxiquecellule}, {cytotoxicit´e}) = "cytotoxicit´e/N", "toxique/A pour/PREP le/DET cellule/N" 'cytotoxicity', 'toxic to the cells' In other words, L is a subsequence of the lemmas of T and we allow at maximum L1 closed-class words between two tokens which match the lemmas of L. For a given sequence of lexical items L, we col- lect from the target corpus all sequences of tokens T1, T2, ...Tp which match L according to our above- mentioned definition. We consider two sequences T 1 and T 2 to be equivalent candidate translations if T 1 = T 2 and ∀(t1i, t2j ) such that t1 ∈ T 1, t2 ∈ T 2, i = j then l(t1i) = l(t2j ) and p(t1i) = p(t2j), i.e. if two sequences of tokens correspond to the same sequence of (lemma, pos) pairs, these two se- quences are considered as the same candidate trans- lation. 4 Experimental data We worked with three languages: English as source language and French and German as target lan- guages. 4.1 Corpora Our corpus is composed of specialized texts from the medical domain dealing with breast can- cer. We define specialized texts as texts be- ing produced by domain experts and directed to- wards either an expert or a non-expert readership (Bowker and Pearson, 2002). The texts were manu- ally collected from scientific papers portals and from information websites targeted to breast cancer pa- tients and their relatives. Each corpus has approxi- mately 400k words (cf. table 1). All the texts were pos-tagged and lemmatized using the linguistic anal- ysis suite XELDA5. We also computed the compa- rability of the corpora. We used the comparability measure defined by (Bo and Gaussier, 2010) which indicates, given a bilingual dictionary, the expecta- tion of finding for each source word of the source corpus its translation in the target corpus and vice- versa. The English-French corpus' comparability is 0.71 and the English-German corpus' comparability is 0.45. The difference in comparability can be ex- plained by the fact that German texts on breast can- cer were hard to find (especially scientific papers): we had to collect texts in which breast cancer was not the main topic. Readership experts non-experts TOTAL EN 218.3k 198.2k 416.5k FR 267.2k 184.5k 451.75k DE 197.2k 201.7k 398.9k Table 1: Composition and size of corpora in words 4.2 Source terms We tested our algorithm on a set of source terms extracted from the English texts. The extraction was done in a semi-supervised manner. Step 1: We wrote a short seed list of English bound mor- phemes. We automatically extracted from the En- glish texts all the words that contained these mor- phemes. For example, we extracted the words postchemotherapy and poster because they con- tained the string post- which corresponds to a bound morpheme of English. Step 2: The extracted words were sorted : those which were not morphologically constructed were eliminated (like poster), and those which were morphologically constructed were kept (like postchemotherapy). The morphologically con- structed words were manually split into morphemes. For example, postchemotherapy was split into post- , -chemo- and therapy. Step 3: If some bound morphemes which were not in the initial seed list were found when we split the words during step 2, we started the whole process again, using the new bound morphemes to extract new morphologically constructed words. We also added hyphenated terms like ER-positive to our list of source terms. We obtained a set 2025 English terms with this procedure. For our experiments, we excluded from this set the source terms which had a translation in the general language dictionary and whose transla- tion was present in the target texts. The final test set for English-to-French experiments contains 1839 morphologically constructed source terms. The test set for English-to-German contains 1824 source terms. 4.3 Resources used in the translation step T Tables 2 and 3 show the size of the resources we used for translation. General language dictionary We used the gen- eral language dictionary which is part of the linguis- tic analysis suite XELDA. Domain-specific dictionary We built this re- source automatically by extracting pairs of cognates from the comparable corpora. We used the same technique as (Hauer and Kondrak, 2011): a SVM classifier trained on examples taken from online dic- tionaries6. 5 http://www.temis.com 6 http://www.dicts.info/uddl.php Morpheme translation table To our knowledge, there exists no publicly available morphology-based bilingual dictionary. Consequently, we asked trans- lators to create an ad hoc morpheme translation table for our experiment. This morpheme translation table links the English bound morphemes contained in the source terms to their French or German equivalents. The equivalents can be bound morphemes or lexical items. In order to handle the variation phenomena de- scribed in section 2.3, we used a dictionary of syn- onyms and lists of morphologically related words. The dictionary of synonyms is the one part of the XELDA linguistic analyzer. The lists of morpho- logically related words were built by stemming the words of the comparable corpora and the entries of the bilingual dictionary with a simple stemming al- gorithm (Porter, 1980). General language Domain-specific Morphemes (TOTAL) prefixes confixes suffixes EN→FR 38k→60k 6.7k→6.7k 242→729 50→134 185→574 7→21 EN→DE 38k→70k 6.4k→6.4k 242→761 50→166 185→563 7→32 Table 2: Nb. of entries in the multilingual resources Synonyms Morphol. EN→EN 5.1k→7.6k 5.9k→15k FR→FR 2.4k→3.2k 7.1k→18k DE→DE 4.2k→4.9k 7.4k→16k Table 3: Nb. of entries in the monolingual resources 4.4 Resources used in the decomposition step (D) The decomposition function uses the entries of the bound morphemes translation table (242 en- tries) and a list of 85k lexical items composed of the entries of the general language dictionary and English words extracted from the Leipzig Cor- pus (Quasthoff et al., 2006) which is a general lan- guage corpus. 5 Evaluation 5.1 Evaluation metrics As explained in section 2.2, compositional trans- lation consists in generating candidate transla- tions. These candidate translations can be filtered out with a classifier (Baldwin and Tanaka, 2004), by keeping only the translations which occur in the target texts of the corpus (Weller et al., 2011; Morin and Daille, 2010) or by using a search engine (Robitaille et al., 2006). Unlike alignment evalua- tion in parallel texts, there is no reference align- mens to which the selected translations can be com- pared and we cannot use standard evaluation met- rics like AER (Och and Ney, 2000). It is also diffi- cult to find reference lexicons in specific domains since the goal of the extraction process is to cre- ate such lexicons. Furthermore, we also wish to evaluate if the algorithm can identify non-canonical translations which, by definition, can not be found in a reference lexicon. Usually, the candidate trans- lations are annotated manually as correct or incor- rect by native speakers. Baldwin and Takana (2004) use two standards for evaluation: gold-standard, silver-standard. Gold-standard is the set of candi- date translations which correspond to canonical, ref- erence translations. Silver-standard corresponds to the gold-standard translations plus the translations which "capture the basic semantics of the source language expression and allow the source language expression to be recovered with reasonable confi- dence" (op. cit.). The first evaluation metric is the precision P which is the number of correct candidate transla- tions Corr over the total number of generated can- didate translations A: P = Corr . In addition to A precision, we propose to indicate the coverage C of the lexicon, i.e. the proportion of source terms (ST) which obtained at least one candidate translation re- gardless of its accuracy: C = PST i=1 α(STi) ST were α(STi) returns 1 if A(STi) ≥ 1 else 0. As augmenting coverage tends to lower precision, we also compute OQ, the overall quality of the lexi- con, to get an idea of the coverage/precision trade- off: OQ = P × C. 5.2 Results Compositional-translation methods give better re- sults when they are applied to general language texts rather than domain-specific texts. This is due to the fact that the translations of the components can be easily found in dictionaries since they belong to the general language and it is also easier to collect large corpora. Working with general language texts, Baldwin and Takana (2004) were able to generate candidate translations for 92% of their source terms and they report 43% (gold-standard) to 84% (sil- ver standard) of correct translations. The size of their corpus exceeds 80M words for each language. Cartoni (2009) works on the translation of prefixed Italian neologisms into French. He considers that the generated neologisms have a "confirmed exis- tence" if they occur more than five times on Inter- net. He finds that between 42% and 94% of the generated neologisms fall into that category. Re- garding domain-specific translation, Robitaille et al. (2006) use a search engine to build corpus from the web and incrementally collect translation pairs. They start with a list of 9.6 pairs (on average) with a precision of 92% and end up with a final output of 19.6 pairs on average with a precision of 81%. Morin and Daille (2009) could generate candidate translations for 15% of their source terms and they report 88% of correct alignments. The size of their corpus is 700k words per language. Weller et al. (2011) were able to generate 8% of correct French translations and 18% of correct English translations for their 2000 German compounds. Their corpus contains approximately 1.5M words per language. canonical translation, We ran the morpho-compositional translation pro- totype on the set of source terms described in section 4.2. The output candidate translations were manually annotated by two translators. Like Baldwin and Takana (2004), we used three an- notation values: recover- able translation and incorrect. In our case, re- coverable translations correspond paraphrastic and morphological For exam- ple, the canonical translation for post-menauposal is post-m´enopausique. Recoverable translations are post-m´enopause 'post-menopause' and apr`es la m´enopause 'after the menopause'. Fertile transla- tions can be canonical translations if a non-fertile translation variants. translation would have been more awkward. For example, the canonical translation for oestrogen- sensitive is sensible aux oestrog`enes 'sensitive to oe- strogens'. A non-fertile translation would sound very unnatural. We computed inter-annotator agree- ment on a set of 100 randomly selected candi- date translations. We used the Kappa statistics (Carletta, 1996) and obtained a high agreement (0.77 for English to German translations and 0.71 for English to French). First, we tested the impact of the linguistic re- sources described in section 4.3 (B for Baseline dic- tionaries, D for Domain-specific dictionary, S for Synonyms, M for Morphologically related words). We also tested a simple Prefix+lemma translation (Pref) in similar vein to the work of Cartoni (2009) to serve as a line of comparison with our method. The results are given in tables 4 and 5. The best results in terms of overall quality are obtained with the combination of the baseline and domain-specific dictionaries (BD). Morphologically related words and synonyms increase coverage to the cost of preci- sion. Regarding English-to-French translations, we were able the generate translations for 26% of the source terms. The gold-standard precision is 60% and the silver standard precision is 67%. Regarding English-to-German translations, we were able the generate translations for 26% of the source terms. The gold-standard precision is 39% and the silver- standard precision is 43%. The prefix+lemma trans- lation method has a very high precision (between 84% and 76%) but produces very few translations (between 1% and 2%). Coverage and precision scores compare well with other approaches know- ing that we have very small domain-specific corpora (400k words per language) and that our approach deals with a large number of morphological con- structions. The lower quality of the German trans- lations can be explained by the fact that the English- German corpus is much less comparable than the English-French corpus (0.45 vs. 0.71). We also tested the impact of the fertile transla- tions on the quality of the lexicon. Tables 6 and 7 show the evaluation scores with and without fer- tile translations. As expected, fertile translations enables us to increase the size of the lexicon but they are less accurate than non-fertile translations. Fertile translations increase the overall quality of C .01 Pref .12 B .15 BS .23 BM BD .26 BSMD .39 GOLD .84 .57 .50 .28 .60 .33 P SILVER .9 .60 .53 .37 .67 .44 GOLD .01 .07 .08 .06 .16 .13 OQ SILVER .01 .07 .08 .09 .17 .17 Table 4: Scores for the EN→FR lexicon C Pref .02 B .13 BS .16 BM .22 BC .26 BCSM .36 GOLD .76 .35 .31 .23 .39 .27 P SILVER .86 .39 .35 .29 .43 .34 GOLD .02 .05 .05 .05 .10 .10 OQ SILVER .02 .05 .05 .06 .11 .12 Table 5: Scores for the EN→DE lexicon the English-French lexicon by 4% to 5%. This is not the case for English-German translations: fer- tile translations result in a big drop in precision. The overall quality does not significantly change. This might be partly due to the low comparabil- ity of the corpus but we think that the main reason lies in the morphological type of the languages in- volved in the translation. It is worth noticing that, if we consider only the non-fertile translations, the English-German lexicon has generally better scores than the English-French one. In fact, fertile vari- ants are more natural and frequent in French than in German. English and German are Germanic lan- guages with a tendency to build new words by agglu- tinating words or morphemes into one single word. Noun compounds such as oestrogen-independent or Ostrogen-unabhangige are common in these two languages. Conversely, French is a Romance lan- guage which prefers to use phrases composed of two nouns and a preposition rather than a single-noun compound (oestrogen-independent would be trans- lated as ind´ependant des oestrog`enes 'independent to oestrogens'). It is the same with the bound mor- pheme/single word alternance. The term cytopro- tection will be translated into German as Zellschutz whereas in French it can be translated as cytopro- tection or protection de la cellule 'protection of the cell'. C P OQ -f .04 .05 .11 .16 .24 +f .12 .15 .23 .26 .39 -f .81 .69 .20 .70 .31 +f .57 .50 .28 .60 .33 -f .03 .03 .02 .11 .07 +f .07 .08 .06 .16 .13 +11 -8.6 +4.8 B BS BM BD BSMD avg. gain Table 6: Scores without (-f) and with (+f) fertile translations (EN→FR) C P OQ -f .06 .08 .12 .17 .24 +f .13 .16 .22 .26 .36 -f .80 .69 .40 .65 .43 +f .35 .31 .23 .39 .27 -f .05 .05 .05 .11 .10 +f .05 .05 .05 .10 .10 +9.2 -28.4 -0.2 B BS BM BC BCSM avg. gain Table 7: Scores without (-f) and with (+f) fertile translations (EN→DE) 6 Conclusion and future work We have proposed a method based on the compo- sitionality principle which can extract translations pairs from comparable corpora. It is capable of deal- ing with a largely variety of morphologically con- structed terms and can generate fertile translations. The added value of the fertile translations is clear- cut for English to French translation but not for En- glish to German translation. The English-German lexicon is better without the fertile translations. It seems that the added-value of fertile translations de- pends on the morphological type of the languages involved in translation. Future work includes the improvement of the identification of morphological variants. The morphological families extracted by the stemming algorithm are too broad for the pur- pose of translation. For example, the words desir- ability and desiring have the same stem but they are too distant semantically to be used to generate trans- lation variants. We need to restrict the morphologi- cal families to a small set of morphological relations (e.g. noun ↔ relational adjective links). We will also work out a way to rank the candidate transla- tions. Several lines of research are possible : go be- yond the target corpora and learn a language model from a larger target corpus, mix compositional trans- lation with a context-based approach, learn part-of- speech patterns translation probabilities from a par- allel corpora (e.g. learning that it is more probable that a noun is translated as another noun or as a noun phrase rather than an adverb). A last improvement could be to gather morpheme correspondences from parallel data. References [Baker, 1996] Baker, M. (1996). Corpus-based transla- tion studies: The challenges that lie ahead. In Ter- minology, LSP and Translation: Studies in Language Engineering in Honour of Juan C. Sager. Somers H., Amsterdam & Philadelphia, john benjamins edition. [Baldwin and Tanaka, 2004] Baldwin, T. and Tanaka, T. (2004). Translation by machine of complex nominals. In Proceedings of the ACL 2004 Workshop on Multi- word expressions: Integrating Processing, pages 24 -- 31, Barcelona, Spain. [Bo and Gaussier, 2010] Bo, L. and Gaussier, E. (2010). Improving corpus comparability for bilingual lexicon extraction from comparable corpora. In 23me In- ternational Conference on Computational Linguistics, pages 23 -- 27, Beijing, Chine. [Bowker and Pearson, 2002] Bowker, L. and Pearson, J. (2002). Working with Specialized Language: A Prac- tical Guide to Using Corpora. Routledge, Lon- don/New York. [Brown et al., 1993] Brown, P., Della Pietra, S., The Della Pietra, V., and Mercer, R. (1993). mathematics of statistical machine translation: pa- rameter estimation. Computational Linguistics, 19(2):263 -- 311. [Carletta, 1996] Carletta, J. (1996). Assessing agreement on classification tasks: The kappa statistic. Computa- tional Linguistics, 22(2):249 -- 254. [Cartoni, 2009] Cartoni, B. (2009). Lexical morphol- In ogy in machine translation: A feasibility study. Proceedings of the 12th Conference of the European Chapter of the ACL, pages 130 -- 138, Athens, Greece. [Daille and Morin, 2005] Daille, B. and Morin, E. (2005). French-English terminology extraction from compara- ble corpora. In Proceedings, 2nd International Joint Conference on Natural Language Processing, volume 3651 of Lecture Notes in Computer Sciences, page 707718, Jeju Island, Korea. Springer. [Fung, 1997] Fung, P. (1997). Finding terminology trans- pages 192 -- 202, lations from non-parallel corpora. Hong Kong. [Fung and Cheung, 2004] Fung, P. and Cheung, P. (2004). Mining Very-Non-Parallel corpora: Parallel sen- tence and lexicon extraction via bootstrapping and EM. In Proceedings of EMNLP 2004, pages 57 -- 63, Barcelona, Spain. [Grefenstette, 1999] Grefenstette, G. (1999). The world wide web as a resource for example-based machine translation tasks. ASLIB'99 Translating and the com- puter, 21. [Hauer and Kondrak, 2011] Hauer, B. and Kondrak, G. (2011). Clustering semantically equivalent words into cognate sets in multilingual lists. In Proceedings of the 5th International Joint Conference on Natural Lan- guage Processing, pages 865 -- 873, Chiang Mai, Thai- land. [Keenan and Faltz, 1985] Keenan, E. L. and Faltz, L. M. (1985). Boolean semantics for natural language. D. Reidel, Dordrecht, Holland. [Morin and Daille, 2010] Morin, E. and Daille, B. (2010). Compositionality and lexical alignment of multi-word terms. In Rayson, P., Piao, S., Sharoff, S., Evert, S., and B., V. M., editors, Language Resources and Evalu- ation (LRE), volume 44 of Multiword expression: hard going or plain sailing, pages 79 -- 95. Springer Nether- lands. [Morin et al., 2007] Morin, E., Daille, B., Takeuchi, K., and Kageura, K. (2007). Bilingual Terminology Min- ing -- Using Brain, not brawn comparable corpora. In Proceedings of the 45th Annual Meeting of the Associ- ation for Computational Linguistics (ACL'07), pages 664 -- 671, Prague, Czech Republic. [Namer and Baud, 2007] Namer, F. and Baud, R. (2007). Defining and relating biomedical terms: Towards a cross-language morphosemantics-based system. In- ternational Journal of Medical Informatics, 76(2- 3):226 -- 33. [Och and Ney, 2000] Och, F. and Ney, H. (2000). A com- parison of alignment models for statistical machine translation. In Proceedings of the 18th Conference on Computational Linguistics, volume 2, pages 1086 -- 1090. [Porter, 1980] Porter, M. F. (1980). An algorithm for suf- fix stripping. Program, 14(3):130 -- 137. [Quasthoff et al., 2006] Quasthoff, U., Richter, M., and Biemann, C. (2006). Corpus portal for search in monolingual corpora. In Proceedings of the fifth inter- national conference on Language Resources and Eval- uation, pages 1799 -- 1802, Genoa, Italy. [Rapp, 1995] Rapp, R. (1995). Identifying word transla- tions in Non-Parallel texts. pages 320 -- 322, Boston, Massachussets, USA. [Rauf and Schwenk, 2009] Rauf, S. and Schwenk, H. (2009). On the use of comparable corpora to improve SMT performance. In Proceedings of the 12th Confer- ence of the European Chapter of the ACL, pages 16 -- 23, Athens, Greece. [Robitaille et al., 2006] Robitaille, X., Sasaki, X., Tonoike, M., Sato, S., and Utsuro, S. (2006). Com- piling French-Japanese terminologies from the web. In Proceedings of the 11th Conference of the Euro- pean Chapter of the Association for Computational Linguistics, pages 225 -- 232, Trento, Italy. [Weller et al., 2011] Weller, M., Gojun, A., Heid, U., Daille, B., and Harastani, R. (2011). Simple methods for dealing with term variation and term alignment. In Proceedings of the 9th International Conference on Terminology and Artificial Intelligence, pages 87 -- 93, Paris, France.
1903.11222
2
1903
2019-08-31T13:37:55
ner and pos when nothing is capitalized
[ "cs.CL" ]
For those languages which use it, capitalization is an important signal for the fundamental NLP tasks of Named Entity Recognition (NER) and Part of Speech (POS) tagging. In fact, it is such a strong signal that model performance on these tasks drops sharply in common lowercased scenarios, such as noisy web text or machine translation outputs. In this work, we perform a systematic analysis of solutions to this problem, modifying only the casing of the train or test data using lowercasing and truecasing methods. While prior work and first impressions might suggest training a caseless model, or using a truecaser at test time, we show that the most effective strategy is a concatenation of cased and lowercased training data, producing a single model with high performance on both cased and uncased text. As shown in our experiments, this result holds across tasks and input representations. Finally, we show that our proposed solution gives an 8% F1 improvement in mention detection on noisy out-of-domain Twitter data.
cs.CL
cs
ner and pos when nothing is capitalized Stephen Mayhew, Tatiana Tsygankova, Dan Roth University of Pennsylvania Philadelphia, PA, 19104 {mayhew, ttasya, danroth}@seas.upenn.edu 9 1 0 2 g u A 1 3 ] L C . s c [ 2 v 2 2 2 1 1 . 3 0 9 1 : v i X r a Abstract For those languages which use it, capitaliza- tion is an important signal for the fundamen- tal NLP tasks of Named Entity Recognition (NER) and Part of Speech (POS) tagging. In fact, it is such a strong signal that model per- formance on these tasks drops sharply in com- mon lowercased scenarios, such as noisy web text or machine translation outputs. In this work, we perform a systematic analysis of so- lutions to this problem in English, modifying only the casing of the train or test data using lowercasing and truecasing methods. While prior work and first impressions might suggest training a caseless model, or using a truecaser at test time, we show that the most effective strategy is a concatenation of cased and lower- cased training data, producing a single model with high performance on both cased and un- cased text. As shown in our experiments, this result holds across tasks and input representa- tions. Finally, we show that our proposed solu- tion gives an 8% F1 improvement in mention detection on noisy out-of-domain Twitter data. 1 Introduction Many languages use capitalization in text, often to indicate named entities. For tasks that are con- cerned with named entities, such as named en- tity recognition (NER) and part of speech tagging (POS), this is an important signal, and models for these tasks nearly always retain it in training.1 But capitalization is not always available. For example, informal user-generated texts can have inconsistent capitalization, and similarly the out- puts of speech recognition or machine translation are traditionally without case. Ideally we would like a model to perform equally well on both cased and uncased text, in contrast with current models. 1For POS tagging, this happens in tagsets that explicitly mark proper nouns, such as the Penn Treebank tagset. Test Tool Task BiLSTM-CRF w/ ELMo NER BiLSTM-CRF w/ ELMo POS Cased Uncased 34.46 92.45 97.85 88.66 Table 1: Modern tools trained on cased data perform well on cased test data, but poorly on uncased (low- ercased) test data. For NER, we evaluate on the testb set of CoNLL 2003, and the scores are reported as F1. For POS, we evaluate on PTB sections 22-24, and the scores represent accuracy. ELMo refers to contextual representations from Peters et al. (2018). Table 1 demonstrates how popular modern sys- tems trained on cased data perform well on cased data, but suffer dramatic performance drops when evaluated on lowercased text. Prior solutions have included models trained on lowercase text, or models that automatically re- cover capitalization from lowercase text, known as truecasing. There has a been a substantial body of literature on the effect of truecasing applied af- ter speech recognition (Gravano et al., 2009), ma- chine translation (Wang et al., 2006), or social me- dia (Nebhi et al., 2015). A few works that evaluate on downstream tasks (including NER and POS) show that truecasing improves performance, but they do not demonstrate that truecasing is the best way to improve performance. In this paper, we evaluate two foundational NLP tasks, NER and POS, on cased text and lower- cased text, with the goal of maximizing the av- erage score regardless of casing. To achieve this goal, we explore a number of simple options that consist of modifying the casing of the train or test data. Ultimately we propose a simple preprocess- ing method for training data that results in a single model with high performance on both cased and uncased datasets. 2 Related Work This problem of robustness in casing has been studied in the context of NER and truecasing. Robustness in NER A practical, common solution to this problem is summarized by the Stanford CoreNLP system (Manning et al., 2014): train on uncased text, or use a truecaser on test data.2 We include these suggested solutions in our analysis below. In one of the few works that address this prob- lem directly, Chieu and Ng (2002) describe a method similar to co-training for training an up- per case NER, in which the predictions of a cased system are used to adjudicate and improve those of an uncased system. One difference from ours is that we are interested in having a single model that works on upper or lowercased text. When tagging text in the wild, one cannot know a priori if it is consistently cased or not. Truecasing Truecasing presents a natural so- lution for situations with noisy or uncertain text capitalization. It has been studied in the context of many fields, including speech recognition (Brown and Coden, 2001; Gravano et al., 2009), and ma- chine translation (Wang et al., 2006), as the out- puts of these tasks are traditionally lowercased. Lita et al. (2003) proposed a statistical, word- level, language-modeling based method for true- casing, and experimented on several downstream tasks, including NER. Nebhi et al. (2015) exam- ine truecasing in tweets using a language model method and evaluate on both NER and POS. More recently, a neural model for truecasing has been proposed by Susanto et al. (2016), in which each character is associated with a label U or L, for upper and lower case respectively. This neural character-based method outperforms word- level language model-based prior work. 3 Truecasing Experiments We use our own implementation of the neural method described in Susanto et al. (2016) as the truecaser used in our experiments.3 Briefly, each sentence is split into characters (including spaces) and modeled with a 2-layer bidirectional LSTM, with a linear binary classification layer on top. We train the truecaser on a dataset from 2https://stanfordnlp.github.io/ CoreNLP/caseless.html 3cogcomp.org/page/publication_view/881 Test set System (Susanto et al., 2016) Wikipedia Wikipedia BiLSTM CoNLL Train CoNLL Test PTB 01-18 PTB 22-24 F1 93.19 93.01 78.85 77.35 86.91 86.22 Table 2: Truecaser word-level performance on English data. This truecaser is trained on the Wikipedia cor- pus. Wikipedia refers to the test set from Coster and Kauchak (2011). CoNLL Test refers to testb. PTB is the Penn Treebank. Wikipedia, originally created for text simplifica- tion (Coster and Kauchak, 2011), but commonly used for evaluation in truecasing papers (Susanto et al., 2016). This task has the convenient property that if the data is well-formed, then supervision is free. We evaluate this truecaser on several data sets, measuring F1 on the word level (see Table 2). At test time, all text is lowercased, and case labels are predicted. First, we evaluate the truecaser on the same test set as Susanto et al. (2016) in order to show that our implementation is near to the original. Next, we measure truecasing performance on plain text extracted from the CoNLL 2003 English (Tjong Kim Sang and De Meulder, 2003) and Penn Tree- bank (Marcus et al., 1993) train and test sets. These results contain two types of errors: idiosyn- cratic casing in the gold data and failures of the truecaser. However, from the high scores in the Wikipedia experiment, we suppose that much of the score drop comes from idiosyncratic casing. This point is important: if a dataset contains id- iosyncratic casing, then it is likely that NER or POS models have fit to that casing (especially with these two wildly popular datasets). As a result, truecasing, since it can't recover these idiosyn- crasies, is not likely to be the best plan. Notably, the scores on CoNLL are especially low, likely because of elements such as titles, by- lines, and documents that contain league standings and other sports results written in uppercase. The higher scores on Penn Treebank corpus suggest that the capitalization standards are more traditional. Many errors are where the truecaser fails to correctly capitalize such words as "Fed- eral" or "Central". In addition, there are many occasions where the truecaser fails to capitalize named entities, for example "Mr. susulu". 4 Methods In this section, we introduce our proposed solu- tions. In all experiments, we constrain ourselves to only change the casing of the training or testing data with no changes to the architectures of the models in question. This isolates the importance of dealing with casing, and makes our observa- tions applicable to situations where modifying the model is not feasible, but retraining is possible. Our experiments aim to answer the extremely common situation in which capitalization is noisy or inconsistent (as with inputs from the internet). In light of this goal, we evaluate each experiment on both cased and lowercased test data, reporting individual scores as well as the average. Our ex- periments on lowercase text can also give insight on best practices for when test data is known to be all lowercased (as with the outputs of some up- stream system). We experiment on five different data casing sce- narios described below. 1. Train on cased Simply apply a model trained on cased data to unmodified test data, as in Table 1. 2. Train on uncased Lowercase the train- ing data and retrain. At test time, we low- ercase all test data. If we did not do this, then scores on the cased test set would suf- fer because of casing mismatch between train and test. Since lowercasing costs nothing, we can improve average scores this way. As such, cased and uncased test data will have the same score. 3. Train on cased+uncased Concatenate orig- inal cased and lowercased training data and retrain a model. Test data is unmodified. Since this concatenation results in twice the number of training examples than other methods, we also experimented with ran- domly lowercasing 50% of the sentences in the original training corpus. We refer to this experiment as 3.5 Half Mixed. We also tried ratios of 40% and 60%, but these were slightly worse than 50% in our evaluations. 4. Train on cased, test on truecased Do noth- ing to the train data, but truecase the test data. Since we lowercase text before truecasing it, the cased and uncased test data will have the same score. 5. Truecase train and test Truecase the train data and retrain. Truecase the test data also. As in experiment 4, cased and uncased test data will have the same score. One way to look at these experiments is as dropout for capitalization, where a sentence is lowercased with respect to the original with prob- ability p ∈ [0, 1]. In experiment 1, p = 0. In ex- periment 2, p = 1. In experiment 3, p = 0.5. Our implementation is somewhat different from stan- dard dropout in that our method is a preprocessing step, not done randomly at each epoch. 5 Experiments Before we show results, we will describe our ex- perimental setup. We emphasize that our goal is to experiment with strong models in noisy settings, not to obtain state-of-the-art scores on any dataset. 5.1 NER We use the standard BiLSTM-CRF architecture for NER (Ma and Hovy, 2016), using an Al- lenNLP implementation (Gardner et al., 2018). We experiment with pre-trained contextual em- beddings, ELMo (Peters et al., 2018), which are generated for each word in a sentence, and con- catenated with GloVe word vectors (lowercased) (Pennington et al., 2014), and character embed- dings. ELMo embeddings are trained with cased inputs, meaning that there will be some mismatch when generating embeddings for uncased text. In all experiments, we train on English CoNLL 2003 Train data (Tjong Kim Sang and De Meul- der, 2003) and evaluate on the CoNLL 2003 Test data (testb). We always evaluate on two different versions: the original version, and a version with all casing removed (e.g. everything lowercase). 5.2 POS Tagging We use a neural POS tagging model built with a BiLSTM-CRF (Ma and Hovy, 2016), and GloVe embeddings (Pennington et al., 2014), charac- ter embeddings, and ELMo pre-trained contextual embeddings (Peters et al., 2018). As our experimental data, we use the Penn Tree- bank (Marcus et al., 1993), and follow the training splits of (Ling et al., 2015), namely 01-18 for train, Exp. 1. Cased 2. Uncased 3. C+U 3.5. Half Mixed 4. Truecase Test 5. Truecase All Test (C) Test (U) 34.46 89.32 89.31 89.05 82.93 90.25 92.45 89.32 91.67 91.68 82.93 90.25 Avg 63.46 89.32 90.49 90.37 82.93 90.25 Exp. 1. Cased 2. Uncased 3. C+U 3.5. Half Mixed 4. Truecase Test 5. Truecase All Test (C) Test (U) 88.66 97.45 97.35 97.36 95.21 97.38 97.85 97.45 97.79 97.85 95.21 97.38 Avg 93.26 97.45 97.57 97.61 95.21 97.38 Table 3: Results from NER+ELMo experiments, tested on CoNLL 2003 English test set. C and U are Cased and Uncased respectively. All scores are F1. Table 4: Results from POS+ELMo experiments, tested on WSJ 22-24, from PTB. C and U are Cased and Un- cased respectively. All scores are accuracies. 19-21 for validation, 22-24 for testing. As with NER, we evaluate on both original and lowercased versions of test. 6 Results Results for NER are shown in Table 3, and results for POS are shown in Table 4. There are several interesting observations to be made. Primarily, our experiments show that the ap- proach with the most promising results was exper- iment 3: training on the concatenation of original and lowercased data. Lest one might think this is because of the double-size training corpus, results from experiment 3.5 are either in second place (for NER) or slightly ahead (for POS). Conversely, we show that the folk-wisdom ap- proach of truecasing the test data (experiment 4) does not perform well. The underwhelming per- formance can be explained by the mismatch in cas- ing standards as seen in Section 3. However, ex- periment 5 shows that if the training data is also truecased, then the performance is good, espe- cially in situations where the test data is known to contain no case information. Training only on uncased data gives good per- formance in both NER and POS -- in fact the high- est performance on uncased text in POS -- but never reaches the overall average scores from ex- periment 3 or 3.5. We have repeated these experiments for NER in several different settings, including using only static embeddings, using a non-neural truecaser, and using BERT uncased embeddings (Devlin et al., 2019). While the relative performance of the experiments varied, the conclusion was the same: training on cased and uncased data produces the best results. When using uncased BERT embeddings, we found that performance on the uncased test set (U) was typically higher than that of ElMo, while the maximum performance on the cased test set (C) was typically lower. This again exemplifies the challenge of using capitalization as a signal while being robust to its absence. 7 Application: Improving NER Performance on Twitter To further test our results, we look at the Broad Twitter Corpus4 (Derczynski et al., 2016), a dataset comprised of tweets gathered from a broad variety of genres, and including many noisy and informal examples. Since we are testing the ro- bustness of our approach, we use a model trained on CoNLL 2003 data. Naturally, in any cross- domain experiment, one will obtain higher scores by training on in-domain data. However, our goal is to show that our methods produce a more ro- bust model on out-of-domain data, not to maxi- mize performance on this test set. We use the rec- ommended test split of section F, containing 3580 tweets of varying length and capitalization quality. Since the train and test corpora are from differ- ent domains, we evaluate on the level of mention detection, in which all entity types are collapsed into one. The Broad Twitter Corpus has no anno- tations for MISC types, so before converting to a single generic type, we remove all MISC predic- tions from our model. Results are shown in Table 5, and a familiar pat- tern emerges. Experiment 3 outperforms exper- iment 1 by 8 points F1, followed by experiment 3.5 and experiment 5, showing that our approach holds when evaluated on a real-world data set. 4https://github.com/GateNLP/broad_ twitter_corpus Exp. 1. Cased 2. Uncased 3. C+U 3.5. Half Mixed 4. Truecase Test 5. Truecase All Mention Detection F1 58.63 53.13 66.14 64.69 58.22 62.66 Table 5: Results on NER+ELMo on the Broad Twitter Corpus, set F, measured as mention detection F1. 8 Conclusion We have performed a systematic analysis of the problem of unknown casing in test data for NER and POS models. We show that commonly-held suggestions (namely, lowercase train and test data, or truecase test data) are rarely the best. Rather, the most effective strategy is a concatenation of cased and lowercased training data. We have demonstrated this with experiments in both NER and POS, and have further shown that the results play out in real-world noisy data. 9 Acknowledgments For their valuable feedback and suggestions, we would like to thank Jordan Kodner, Shyam Upad- hyay, and Nitish Gupta. This work was supported by Contracts HR0011- 15-C-0113 and HR0011-18-2-0052 with the US Defense Advanced Research Projects Agency (DARPA). Approved for Public Release, Distribu- tion Unlimited. The views expressed are those of the authors and do not reflect the official policy or position of the Department of Defense or the U.S. Government. References Eric W Brown and Anni R Coden. 2001. Capitaliza- tion recovery for text. In Workshop on Information Retrieval Techniques for Speech Applications, pages 11 -- 22. Springer. Hai Leong Chieu and Hwee Tou Ng. 2002. Teaching a weaker classifier: Named entity recognition on up- In Proceedings of the 40th Annual per case text. Meeting on Association for Computational Linguis- tics, pages 481 -- 488. Association for Computational Linguistics. Will Coster and David Kauchak. 2011. Learning to simplify sentences using Wikipedia. In Proceedings of the Workshop on Monolingual Text-To-Text Gen- eration, pages 1 -- 9, Portland, Oregon. Association for Computational Linguistics. Leon Derczynski, Kalina Bontcheva, and Ian Roberts. 2016. Broad twitter corpus: A diverse named entity In Proceedings of COLING recognition resource. 2016, the 26th International Conference on Compu- tational Linguistics: Technical Papers, pages 1169 -- 1179, Osaka, Japan. The COLING 2016 Organizing Committee. Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: Pre-training of deep bidirectional transformers for language under- In Proceedings of the 2019 Conference standing. 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. Matt Gardner, Joel Grus, Mark Neumann, Oyvind Tafjord, Pradeep Dasigi, Nelson F. Liu, Matthew Pe- ters, Michael Schmitz, and Luke Zettlemoyer. 2018. AllenNLP: A deep semantic natural language pro- In Proceedings of Workshop for cessing platform. NLP Open Source Software (NLP-OSS), pages 1 -- 6, Melbourne, Australia. Association for Computa- tional Linguistics. Agustin Gravano, Martin Jansche, and Michiel Bacchi- ani. 2009. Restoring punctuation and capitalization in transcribed speech. In Acoustics, Speech and Sig- nal Processing, 2009. ICASSP 2009. IEEE Interna- tional Conference on, pages 4741 -- 4744. IEEE. Wang Ling, Chris Dyer, Alan W Black, Isabel Tran- coso, Ram´on Fermandez, Silvio Amir, Lu´ıs Marujo, and Tiago Lu´ıs. 2015. Finding function in form: Compositional character models for open vocabu- lary word representation. In Proceedings of the 2015 Conference on Empirical Methods in Natural Lan- guage Processing, pages 1520 -- 1530, Lisbon, Portu- gal. Association for Computational Linguistics. Lucian Vlad Lita, Abe Ittycheriah, Salim Roukos, and In Proceed- Nanda Kambhatla. 2003. ings of the 41st Annual Meeting on Association for Computational Linguistics-Volume 1, pages 152 -- 159. Association for Computational Linguistics. tRuEasIng. Xuezhe Ma and Eduard Hovy. 2016. End-to-end sequence labeling via bi-directional LSTM-CNNs- CRF. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Vol- ume 1: Long Papers), pages 1064 -- 1074, Berlin, Germany. Association for Computational Linguis- tics. Christopher D. Manning, Mihai Surdeanu, John Bauer, Jenny Finkel, Steven J. Bethard, and David Mc- Closky. 2014. The Stanford CoreNLP natural lan- guage processing toolkit. In Association for Compu- tational Linguistics (ACL) System Demonstrations, pages 55 -- 60. Mitchell P. Marcus, Beatrice Santorini, and Mary Ann Marcinkiewicz. 1993. Building a large annotated corpus of English: The Penn Treebank. Computa- tional Linguistics, 19(2):313 -- 330. Kamel Nebhi, Kalina Bontcheva, and Genevieve Gor- rell. 2015. Restoring capitalization in# tweets. In Proceedings of the 24th International Conference on World Wide Web, pages 1111 -- 1115. ACM. 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 (EMNLP), pages 1532 -- 1543, Doha, Qatar. Association for Computational Linguistics. Matthew 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, New Orleans, Louisiana. Association for Computational Linguistics. Raymond Hendy Susanto, Hai Leong Chieu, and Wei Lu. 2016. Learning to capitalize with character- level recurrent neural networks: An empirical study. In Proceedings of the 2016 Conference on Empiri- cal Methods in Natural Language Processing, pages 2090 -- 2095, Austin, Texas. Association for Compu- tational Linguistics. Erik F Tjong Kim Sang and Fien De Meulder. 2003. Introduction to the conll-2003 shared task: Language-independent named entity recognition. In Proc. of the Annual Meeting of the North American Association of Computational Linguistics (NAACL). Wei Wang, Kevin Knight, and Daniel Marcu. 2006. In Proceedings Capitalizing machine translation. of the Human Language Technology Conference of the NAACL, Main Conference, pages 1 -- 8, New York City, USA. Association for Computational Linguis- tics.
1905.13497
1
1905
2019-05-31T10:27:58
Attention Is (not) All You Need for Commonsense Reasoning
[ "cs.CL", "cs.AI" ]
The recently introduced BERT model exhibits strong performance on several language understanding benchmarks. In this paper, we describe a simple re-implementation of BERT for commonsense reasoning. We show that the attentions produced by BERT can be directly utilized for tasks such as the Pronoun Disambiguation Problem and Winograd Schema Challenge. Our proposed attention-guided commonsense reasoning method is conceptually simple yet empirically powerful. Experimental analysis on multiple datasets demonstrates that our proposed system performs remarkably well on all cases while outperforming the previously reported state of the art by a margin. While results suggest that BERT seems to implicitly learn to establish complex relationships between entities, solving commonsense reasoning tasks might require more than unsupervised models learned from huge text corpora.
cs.CL
cs
Attention Is (not) All You Need for Commonsense Reasoning Tassilo Klein1, Moin Nabi1 1SAP Machine Learning Research, Berlin, Germany {tassilo.klein, m.nabi}@sap.com 9 1 0 2 y a M 1 3 ] L C . s c [ 1 v 7 9 4 3 1 . 5 0 9 1 : v i X r a Abstract The recently introduced BERT model exhibits strong performance on several language un- derstanding benchmarks. In this paper, we describe a simple re-implementation of BERT for commonsense reasoning. We show that the attentions produced by BERT can be directly utilized for tasks such as the Pronoun Dis- ambiguation Problem and Winograd Schema Challenge. Our proposed attention-guided commonsense reasoning method is conceptu- ally simple yet empirically powerful. Exper- imental analysis on multiple datasets demon- strates that our proposed system performs re- markably well on all cases while outperform- ing the previously reported state of the art by a margin. While results suggest that BERT seems to implicitly learn to establish complex relationships between entities, solving com- monsense reasoning tasks might require more than unsupervised models learned from huge text corpora. 1 Introduction Recently, neural models pre-trained on a lan- guage modeling task, such as ELMo (Peters et al., 2018b), OpenAI GPT (Radford et al., 2018), and BERT (Devlin et al., 2018), have achieved impres- sive results on various natural language processing tasks such as question-answering and natural lan- guage inference. The success of BERT can largely be associated to the notion of context-aware word embeddings, which differentiate it from common approaches such as word2vec (Mikolov et al., 2013) that establish a static semantic embedding. Since the introduction of BERT, the NLP com- munity continues to be impressed by the amount of ideas produced on top of this powerful lan- guage representation model. However, despite its success, it remains unclear whether the repre- sentations produced by BERT can be utilized for tasks such as commonsense reasoning. Particu- larly, it is not clear whether BERT shed light on solving tasks such as the Pronoun Disambigua- tion Problem (PDP) and Winograd Schema Chal- lenge (WSC). These tasks have been proposed as potential alternatives to the Turing Test, because they are formulated to be robust to statistics of word co-occurrence (Levesque et al., 2012). Below is a popular example from the binary- choice pronoun coreference problem (Lee et al., 2017) of WSC: Sentence: The trophy doesn't fit case because it is too small. Answers: A) the trophy B) the suitcase in the suit- Humans resolve the pronoun "it" to "the suit- case" with no difficulty, whereas a system without commonsense reasoning would be unable to dis- tinguish "the suitcase" from the otherwise viable candidate, "the trophy". Previous attempts at solving WSC usually in- volve heavy utilization of annotated knowledge bases (KB), rule-based reasoning, or hand-crafted features (Peng et al., 2015; Bailey et al., 2015; Schuller, 2014; Sharma et al., 2015; Morgenstern et al., 2016). There are also some empirical works towards solving WSC making use of learn- ing (Rahman and Ng, 2012; Tang et al., 2018; Radford et al., 2018). Recently, (Trinh and Le, 2018) proposed to use a language model (LM) to score the two sentences obtained when replac- ing the pronoun by the two candidates. The sen- tence that is assigned higher probability under the model designates the chosen candidate. Probabil- ity is calculated via the chain rule, as the prod- uct of the probabilities assigned to each word in the sentence. Very recently, (Emami et al., 2018) proposed the knowledge hunting method, which is a rule-based system that uses search engines Figure 1: Maximum Attention Score (MAS) for a particular sentence, where colors show attention maps for different words (best shown in color). Squares with blue/red frames correspond to specific sliced attentions Ac for candidates c, establishing the relationship to the reference pronoun indicated with green. Attention is color-coded in blue/ red for candidates "trophy"/ "suitcase"; the associated pronoun "it" is indicated in green. Attention values are compared elementwise (black double arrow), and retain only the maximum achieved by a masking operation. Matrices on the outside with red background elements correspond to the masked attentions Ac ◦ Mc. to gather evidence for the candidate resolutions without relying on the entities themselves. Al- though these methods are interesting, they need fine-tuning, or explicit substitution or heuristic- based rules. See also (Trichelair et al., 2018) for a discussion. The BERT model is based on the "Transformer" architecture (Vaswani et al., 2017), which relies purely on attention mechanisms, and does not have an explicit notion of word order beyond mark- ing each word with its absolute-position embed- ding. This reliance on attention may lead one to expect decreased performance on commonsense reasoning tasks (Roemmele et al., 2011; Zellers et al., 2018) compared to RNN (LSTM) mod- els (Hochreiter and Schmidhuber, 1997) that do model word order directly, and explicitly track states across the sentence. However, the work of (Peters et al., 2018a) suggests that bidirectional language models such as BERT implicitly capture some notion of coreference resolution. In this paper, we show that the attention maps created by an out-of-the-box BERT can be directly exploited to resolve coreferences in long sen- tences. As such, they can be simply repurposed for the sake of commonsense reasoning tasks while achieving state-of-the-art results on the multiple task. On both PDP and WSC, our method out- performs previous state-of-the-art methods, with- out using expensive annotated knowledge bases or hand-engineered features. On a Pronoun Disam- biguation dataset, PDP-60, our method achieves 68.3% accuracy, which is better than the state-of- art accuracy of 66.7%. On a WSC dataset, WSC- 273, our method achieves 60.3%. As of today, state-of-the-art accuracy on the WSC-273 for sin- gle model performance is around 57%, (Emami et al., 2018) and (Trinh and Le, 2018). These re- sults suggest that BERT implicitly learns to estab- lish complex relationships between entities such as coreference resolution. Although this helps in commonsense reasoning, solving this task requires more than employing a language model learned from large text corpora. 2 Attention Guided Reasoning In this section we first review the main aspects of the BERT approach, which are important to un- derstand our proposal and we introduce notations used in the rest of the paper. Then, we intro- duce Maximum Attention Score (MAS), and ex- plain how it can be utilized for commonsense rea- soning. 2.1 BERT and Notation The concept of BERT is built upon two key in- gredients: (a) the transformer architecture and (b) unsupervised pre-training. The transformer architecture consists of two main building blocks, stacked encoders and de- 0.20.10.50.10.70.500.20.20.100.40.20.60.40.10.10.30.20.10.500.70.500.200000.2000.100.3The trophydoesn't fit in the suitcasebecause itis too small Accuracy Method 48.3 % Unsupervised Semantic Similarity Method (USSM) USSM + Cause-Effect Knowledge Base (Liu et al., 2016) 55.0 % USSM + Cause-Effect + WordNet (Miller, 1995) + ConceptNet (Liu and Singh, 2004) KB 56.7 % Subword-level Transformer LM (Vaswani et al., 2017) 58.3 % 53.3 % Single LM (partial) (Trinh and Le, 2018) 60.0 % Single LM (full) (Trinh and Le, 2018) 45.0 % Patric Dhondt (WS Challenge 2016) Nicos Issak (WS Challenge 2016) 48.3 % Quan Liu (WS Challenge 2016 - winner) 58.3 % 53.3 % USSM + Supervised Deepnet USSM + Supervised Deepnet + 3 Knowledge Bases 66.7 % 68.3 % Our Proposed Method Table 1: Pronoun Disambiguation Problem: Results on (top) Unsupervised method performance on PDP-60 and (bottom) Supervised method performance on PDP-60. Results other than ours are taken from (Trinh and Le, 2018). Accuracy Method 50.0 % Random guess USSM + KB 52.0% USSM + Supervised DeepNet + KB 52.8 % 54.5 % Single LM (Trinh and Le, 2018) Transformer (Vaswani et al., 2017) 54.1 % 57.1 % Know. Hunter (Emami et al., 2018) Our Proposed Method 60.3 % Table 2: Results for Winograd Schema Challenge. The other results are taken from (Trichelair et al., 2018) and (Trinh and Le, 2018). coders, which are connected in a cascaded fash- ion. The encoder is further divided into two com- ponents, namely a self-attention layer and a feed- forward neural network. The self-attention allows for attending to specific words during encoding and therefore establishing a focus context w.r.t. to each word. In contrast to that, the decoder has an additional encoder-decoder layer that switches be- tween self-attention and a feed-forward network. It allows the decoder to attend to specific parts of the input sequence. As attention allows for es- tablishing a relationship between words, it is very important for tasks such as coreference resolution and finding associations. In the specific context of pronouns, attention gives rise to links to m candi- date nouns, which we denote in the following as C = {c1, .., cm}. The concept of self-attention is further expanded within BERT by the idea of so called multi-head outputs that are incorporated in each layer. In the following, we will denote heads and layers with h ∈ H and l ∈ L, respectively. Multi-heads serve several purposes. On the one hand, they allow for dispersing the focus on mul- tiple positions. On the other hand, they consti- tute an enriched representation by expanding the embedding space. Leveraging the nearly unlim- ited amount of data available, BERT learns two novel unsupervised prediction tasks during train- ing. One of the tasks is to predict tokens that were randomly masked given the context, notably with the context being established in a bi-directional manner. The second task constitutes next sen- tence prediction, whereby BERT learns the re- lationship between two sentences, and classifies whether they are consecutive. 2.2 Maximum Attention Score (MAS) In order to exploit the associative leverage of self- attention, the computation of MAS follows the no- tion of max-pooling on attention level between a reference word s (e.g. pronoun) and candidate words c (e.g. multiple choice pronouns). The proposed approach takes as input the BERT at- tention tensor and produces for each candidate word a score, which indicates the strength of as- sociation. To this end, the BERT attention ten- sor A ∈ RH×L×C is sliced into several matrices Ac ∈ RH×L, each of them corresponding to the attention between the reference word and a candi- date c. Each Ac is associated with a binary mask matrix Mc. The mask values of Mc are obtained Figure 2: Maximum Attention Score (MAS) for some sample questions from WSC-273: The last example is an example of failure of the method, where the coreference is predicted incorrectly. (cid:40) at each location tuple (l, h), according to: 1 argmax A(l, h) = c Mc(l, h) = 0 otherwise (1) Mask entries are non-zero only at locations where the candidate word c is associated with maxi- mum attention. Limiting the impact of attention by masking allows to accommodate for the most salient parts. Given the Ac and Mc matrix pair for each candidate c, the MAS can be computed. For this purpose, the sum of the Hadamard product for each pair is calculated first. Next, the actual score is obtained by computing the ratio of each Hadamard sum w.r.t. all others according to, ∈ [0, 1] . (cid:80) c∈C(cid:80) l,h Ac ◦ Mc l,h Ac ◦ Mc M AS(c) = (cid:80) (2) Thus MAS retains the attention of each candidate only where it is most dominant, coupling it with the notion of frequency of occurrence to weight the importance. See Fig. 1 for a schematic illustra- tion of the computation of MAS, and the matrices involved. 3 Experimental Results We evaluate our method on two commonsense rea- soning tasks, PDP and WSC. On the former task, we use the original set of 60 questions (PDP-60) as the main benchmark. The second task (WSC-273) is qualitatively much more difficult. The recent best reported result are not much above random guess. This task con- sists of 273 questions and is designed to work against traditional linguistic techniques, common heuristics or simple statistical tests over text cor- pora (Levesque et al., 2012). 3.1 BERT Model Details In all our experiments, we used the out-of-the- box BERT models without any task-specific fine- tuning. Specifically, we use the PyTorch imple- mentation of pre-trained bert − base − uncased models supplied by Google1. This model has 12 layers (i.e., Transformer blocks), a hidden size of 768, and 12 self-attention heads. In all cases we set the feed-forward/filter size to be 3072 for the hidden size of 768. The total number of parame- ters of the model is 110M. 3.2 Pronoun Disambiguation Problem We first examine our method on PDP-60 for the Pronoun Disambiguation task. In Tab. 1 (top), our method outperforms all previous unsupervised results sharply. Next, we allow other systems to take in necessary components to maximize their test performance. This includes making use of supervised training data that maps commonsense reasoning questions to their correct answer. As re- ported in Tab. 1 (bottom), our method outperforms the best system in the 2016 competition (58.3%) by a large margin. Specifically, we achieve 68.3% accuracy, better than the more recently reported re- sults from (Liu et al., 2017) (66.7%), who makes use of three KBs and a supervised deep network. 3.3 Winograd Schema Challenge On the harder task WSC-273, our method also out- performs the current state-of-the-art, as shown in Tab. 2. Namely, our method achieves an accu- racy of 60.3%, nearly 3% of accuracy above the 1https://github.com/huggingface/pytorch-pretrained- BERT 1.00.50.0The drain is clogged with hair. Ithas to be cleaned.The drain is clogged with hair. Ithas to be removed.Steve follows Fred's example in everything. Headmires him hugely.Steve follows Fred's example in everything. Heinfluences him hugely.The fish ate the worm . Itwas hungry.The fish ate the worm . Itwas tasty.The foxes are attacking the chickens at night. I have to kill them.The foxes are attacking the chickens at night. I have to guard them.The man lifted the boy onto hisshoulders.The man lifted the boy onto hisbunk bed. previous best result. This is a drastic improve- ment considering the best system based on lan- guage models outperforms random guess by only 4% in accuracy. This task is more difficult than PDP-60. First, the overall performance of all com- peting systems are much lower than that of PDP- 60. Second, incorporating supervised learning and expensive annotated KBs to USSM provides in- significant gain this time (+3%), comparing to the large gain on PDP-60 (+19%). Finally, for the sake of completeness, (Trinh and Le, 2018) re- port that their single language model trained on a customized dataset built from CommonCrawl based on questions used in comonsense reasoning achieves an higher accuracy than the proposed ap- proach with 62.6%. We visualize the MAS to have more insights into the decisions of our resolvers. Fig. 2 displays some samples of correct and incorrect decisions made by our proposed method. MAS score of dif- ferent words are indicated with colors, where the gradient from blue to red represents the score tran- sition from low to high. 4 Discussion Pursuing commonsense reasoning in a purely un- supervised way seems very attractive for several reasons. On the one hand, this implies tapping the nearly unlimited resources of unannotated text and leveraging the wealth of information therein. On the other hand, tackling the commonsense rea- soning objective in a (more) supervised fashion typically seems to boost performance for very a specific task as concurrent work shows (Kocijan et al., 2019). However, the latter approach is un- likely to generalize well beyond this task. That is because covering the complete set of common- sense entities is at best extremely hard to achieve, if possible at all. The data-driven paradigm en- tails that the derived model can only make gen- eralizations based on the data it has observed. Consequently, a supervised machine learning ap- proach will have to be exposed to all combina- tions, i.e. replacing lexical items with semanti- cally similar items in order to derive various con- cept notions. Generally, this is prohibitively ex- pensive and therefore not viable. In contrast, in the proposed (unsupervised self-attention guided) approach this problem is alleviated. This can be largely attributed to the nearly unlimited text cor- pora on which the model originally learns, which makes it likely to cover a multitude of concept re- lations, and the fact that attention implicitly re- duces the search space. However, all these ap- proaches require the answer to explicitly exist in the text. That is, they are unable to resolve pro- nouns in light of abstract/implicit referrals that re- quire background knowledge - see (Saba, 2018) for more detail. However, this is beyond the task of WSC. Last, the presented results suggest that BERT models the notion of complex relationship between entities, facilitating commonsense rea- soning to a certain degree. 5 Conclusion Attracted by the success of recently proposed lan- guage representation model BERT, in this pa- per, we introduce a simple yet effective re- implementation of BERT for commonsense rea- soning. Specifically, we propose a method which exploits the attentions produced by BERT for the challenging tasks of PDP and WSC. The exper- imental analysis demonstrates that our proposed system outperforms the previous state of the art on multiple datasets. However, although BERT seems to implicitly establish complex relation- ships between entities facilitating tasks such as coreference resolution, the results also suggest that solving commonsense reasoning tasks might require more than leveraging a language model trained on huge text corpora. Future work will en- tail adaption of the attentions, to further improve the performance. References Daniel Bailey, Amelia J Harrison, Yuliya Lierler, Vladimir Lifschitz, and Julian Michael. 2015. The winograd schema challenge and reasoning about In 2015 AAAI Spring Symposium Se- correlation. ries. 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. Ali Emami, Noelia De La Cruz, Adam Trischler, Ka- heer Suleman, and Jackie Chi Kit Cheung. 2018. A knowledge hunting framework for common sense reasoning. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Pro- cessing, pages 1949 -- 1958, Brussels, Belgium. As- sociation for Computational Linguistics. Sepp Hochreiter and Jurgen Schmidhuber. 1997. Long short-term memory. 9(8):1735 -- 1780. Neural computation, Vid Kocijan, Ana-Maria Cretu, Oana-Maria Camburu, Yordan Yordanov, and Thomas Lukasiewicz. 2019. A surprisingly robust trick for the winograd schema challenge. In Proceedings of the 57th Annual Meet- ing of the Association for Computational Linguis- tics, ACL 2019, Florence, Italy, July 28 - August 2, 2019. Association for Computational Linguistics. Kenton Lee, Luheng He, Mike Lewis, and Luke Zettle- moyer. 2017. End-to-end neural coreference reso- In Proceedings of the 2017 Conference on lution. Empirical Methods in Natural Language Process- ing, pages 188 -- 197, Copenhagen, Denmark. Asso- ciation for Computational Linguistics. Hector Levesque, Ernest Davis, and Leora Morgen- In stern. 2012. The winograd schema challenge. Thirteenth International Conference on the Princi- ples of Knowledge Representation and Reasoning. Hugo Liu and Push Singh. 2004. Conceptneta practi- cal commonsense reasoning tool-kit. BT technology journal, 22(4):211 -- 226. Quan Liu, Hui Jiang, Andrew Evdokimov, Zhen-Hua Ling, Xiaodan Zhu, Si Wei, and Yu Hu. 2016. Prob- abilistic reasoning via deep learning: Neural associ- ation models. arXiv preprint arXiv:1603.07704. Quan Liu, Hui Jiang, Zhen-Hua Ling, Xiaodan Zhu, Si Wei, and Yu Hu. 2017. Combing context and commonsense knowledge through neural networks In 2017 for solving winograd schema problems. AAAI Spring Symposium Series. Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. 2013. Efficient estimation of word represen- tations in vector space. CoRR, abs/1301.3781. George A Miller. 1995. Wordnet: a lexical database for english. Communications of the ACM, 38(11):39 -- 41. Leora Morgenstern, Ernest Davis, and Charles L Ortiz. 2016. Planning, executing, and evaluating the wino- grad schema challenge. AI Magazine, 37(1):50 -- 54. Haoruo Peng, Daniel Khashabi, and Dan Roth. 2015. In Proceed- Solving hard coreference problems. ings of the 2015 Conference of the North Ameri- can Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 809 -- 819. Matthew Peters, Mark Neumann, Luke Zettlemoyer, and Wen-tau Yih. 2018a. Dissecting contextual word embeddings: Architecture and representation. In Proceedings of the 2018 Conference on Em- pirical Methods in Natural Language Processing, pages 1499 -- 1509, Brussels, Belgium. Association for Computational Linguistics. Matthew E Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. 2018b. Deep contextualized word rep- resentations. arXiv preprint arXiv:1802.05365. Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. 2018. Improving language under- standing by generative pre-training. URL https://s3- us-west-2. amazonaws. com/openai-assets/research- covers/languageunsupervised/language under- standing paper. pdf. Resolving Altaf Rahman and Vincent Ng. 2012. complex cases of definite pronouns: the winograd schema challenge. In Proceedings of the 2012 Joint Conference on Empirical Methods in Natural Lan- guage Processing and Computational Natural Lan- guage Learning, pages 777 -- 789. Association for Computational Linguistics. Melissa Roemmele, Cosmin Adrian Bejan, and An- drew S Gordon. 2011. Choice of plausible alterna- tives: An evaluation of commonsense causal reason- ing. In 2011 AAAI Spring Symposium Series. Walid S. Saba. 2018. A simple machine learn- ing method for commonsense reasoning? A short commentary on trinh & le (2018). CoRR, abs/1810.00521. Peter Schuller. 2014. Tackling winograd schemas by formalizing relevance theory in knowledge graphs. In Fourteenth International Conference on the Prin- ciples of Knowledge Representation and Reasoning. Arpit Sharma, Nguyen H Vo, Somak Aditya, and Chitta Baral. 2015. Towards addressing the wino- grad schema challengebuilding and using a semantic parser and a knowledge hunting module. In Twenty- Fourth International Joint Conference on Artificial Intelligence. Gongbo Tang, Mathias Muller, Annette Rios, and Rico Sennrich. 2018. Why self-attention? a targeted eval- uation of neural machine translation architectures. arXiv preprint arXiv:1808.08946. Paul Trichelair, Ali Emami, Jackie Chi Kit Cheung, Adam Trischler, Kaheer Suleman, and Fernando Diaz. 2018. On the evaluation of common-sense reasoning in natural language understanding. arXiv preprint arXiv:1811.01778. Trieu H Trinh and Quoc V Le. 2018. A simple method for commonsense reasoning. arXiv preprint arXiv:1806.02847. 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. Rowan Zellers, Yonatan Bisk, Roy Schwartz, and Yejin Choi. 2018. Swag: A large-scale adversarial dataset for grounded commonsense inference. arXiv preprint arXiv:1808.05326.
1910.09702
1
1910
2019-10-22T00:06:52
Fine-Tuned Neural Models for Propaganda Detection at the Sentence and Fragment levels
[ "cs.CL" ]
This paper presents the CUNLP submission for the NLP4IF 2019 shared-task on FineGrained Propaganda Detection. Our system finished 5th out of 26 teams on the sentence-level classification task and 5th out of 11 teams on the fragment-level classification task based on our scores on the blind test set. We present our models, a discussion of our ablation studies and experiments, and an analysis of our performance on all eighteen propaganda techniques present in the corpus of the shared task.
cs.CL
cs
Fine-Tuned Neural Models for Propaganda Detection at the Sentence and Fragment levels Tariq Alhindi† Jonas Pfeiffer∗ Smaranda Muresan†‡ †Department of Computer Science, Columbia University ‡Data Science Institute, Columbia University ∗Ubiquitous Knowledge Processing Lab, Technische Universitat Darmstadt {tariq.a, smara}@columbia.edu [email protected] Abstract This paper presents the CUNLP submission for the NLP4IF 2019 shared-task on Fine- Grained Propaganda Detection. Our system finished 5th out of 26 teams on the sentence- level classification task and 5th out of 11 teams on the fragment-level classification task based on our scores on the blind test set. We present our models, a discussion of our ablation stud- ies and experiments, and an analysis of our performance on all eighteen propaganda tech- niques present in the corpus of the shared task. 1 Introduction Propaganda aims at influencing a target audience with a specific group agenda using faulty reason- ing and/or emotional appeals (Miller, 1939). Au- tomatic detection of propaganda has been studied mainly at the article level (Rashkin et al., 2017; Barr´on-Cedeno et al., 2019). However, in order to build computational models that can explain why an article is propagandistic, the model would need to detect specific techniques present at sentence or even token level. The NLP4IF shared task on fine-grained pro- paganda detection aims to produce models ca- pable of spotting propaganda techniques in sen- tences and text in news articles (Da San Martino et al., 2019a). The data for this task consist of news articles that were labeled at the fragment level with one of eighteen propa- ganda techniques. fragments There are two sub-tasks in this shared task. The first one is a sentence classification task (SLC) to detect whether a sentence has a propaganda frag- ment or not. This binary classification task is eval- uated based on the F1 score of the propaganda class which approximately represents one-third of the data. The second sub-task is a fragment level classification (FLC) task, in which a system needs to detect the type of propaganda technique ex- pressed in a text fragment together with the be- ginning and the end of that text fragment. This task is evaluated based on the prediction of the type of propaganda technique and the intersec- tion between the gold and the predicted spans. The details to the evaluation measure used for the FLC task are explained in Da San Martino et al. (2019a). Both sub-tasks were automatically eval- uated on a unified development set. The system performance was centrally assessed without dis- tributing the gold labels, however allowing for an unlimited number of submissions. The final per- formance on the test set was similarly evaluated, with the difference that the feedback was given only after the submission was closed, simultane- ously concluding the shared-task. In this paper, we describe the data in Section 2, our proposed methods for both sub-tasks in Sec- tion 3, and analyze the results and errors of our models in Section 4. 2 Data The data for this shared task includes 350 articles in the training set, 61 articles in the development set, and 86 articles in the test set. The articles were taken from 48 news outlets; 13 propagandis- tic and 35 non-propagandistic as labeled by Me- dia Bias/Fact Check1. These articles were anno- tated at the fragment level where each annotator was asked to tag the start and end of the propa- ganda text span as well as the type of propaganda technique. Table 1 lists all eighteen propaganda techniques and their frequencies in the training data. Since submissions to the development set were closed after the release of the test set, we di- vided the training set (350 articles) into a training set of 280 articles and a local dev set of 70 articles 1https://mediabiasfactcheck.com/ Propaganda Technique Loaded Language Name Calling,Labeling Repetition Doubt Exaggeration,Minimisation Flag-Waving Appeal to Fear/Prejudice Causal Oversimplification Slogans Appeal to Authority Black-and-White Fallacy Thought-terminating Cliches Whataboutism Reductio ad hitlerum Red Herring Bandwagon Straw Men Obfuscation,Intentional Vagueness,Confusion Total Frequency 2,115 1,085 571 490 479 240 239 201 136 116 109 79 57 54 33 13 13 11 6,041 Table 1: Frequency of all eighteen propaganda tech- niques in the training data to continue to be able to perform ablation studies. We also conduct our error analysis on the local dev set because we do not have access to the gold la- bels of the official dev and test sets of the shared task. More details about the dataset and the anno- tation scheme for the eighteen propaganda tech- niques can be found in Da San Martino et al. (2019b). However, the results on the shared task data are not directly comparable as more articles were added to shared task's data. Da San Martino et al. (2019a) should be referred to for an accurate comparison between partici- pants who all used the same development and test sets. 3 Methods In the following we explain the details of our ap- proach for the SLC and FLC tasks. 3.1 Sentence Level Classification (SLC) We fine-tuned BERT (Devlin et al., 2019) for the binary sentence-level classification task of propaganda vs. non-propaganda. The training set has 16,298 sentences, out of which 4,720 are from the propaganda class. We used bert-base-uncased in our experiments as in preliminary results the cased version did not pro- vide any improvements. The model was trained for 3 epochs using a learning rate of 2e-5, a maximum sequence length of 128, and a batch size of 16. We also experiment with a Logis- tic Regression Classifiers, where we used Lin- guistic Inquiry and Word Count (LIWC) fea- tures (Pennebaker et al., 2001), punctuation fea- tures such as the existence of quotes or ques- tion marks, as well as BERT's prediction prob- abilities for each class. This gave some mi- nor improvement on the development set of the shared-task. However, since we did not have ac- cess to the development set submission after the test set was released, we chose the final model based on the performance on the local develop- ment set. The final model used the fine-tuned BERT model mentioned above with a condition to predict non-propaganda only if the pre- diction probability is above 0.70 for the non- propaganda class. Otherwise the prediction of the sentence will be propaganda even if the ma- jority of the prediction probability mass was for the non-propaganda class. This was a way to handle the unbalance in the training data with- out having to discard part of the data. The 0.70 threshold was chosen after elaborate experiments on both the local and the shared-task's develop- ment sets. This condition consistently provided an improvement of around 5 points in F1 score of the propaganda class on all experiments using differ- ent sets of features as shown in Table 2. 3.2 Fragment Level Classification (FLC) Our architecture for the sequence labeling task builds on the flair framework (Akbik et al., 2018, 2019) that combines character level embeddings with different kinds of word embeddings as input to a BiLSTM-CRF model (Ma and Hovy, 2016; Lample et al., 2016). Akbik et al. (2018) have shown that stacking multiple pre-trained embed- dings as input to the LSTM improves performance on the downstream sequence labeling task. We combine Glove embeddings (Pennington et al., 2014) with Urban Dictionary2 embeddings3. Due to the small-size of our data set we ad- ditionally include one-hot-encoded features based on dictionary look-ups from the UBY dictionary provided by Gurevych et al. (2012). These fea- tures are based on concepts associated with the specific word such as offensive, vulgar, coarse, or ethnic slur. In total, 30 concept features were added as additional dimensions to the embedding representations. 2https://www.urbandictionary.com/ 3https://data.world/jaredfern/urban-dictionary-embedding We also experimented with stacking BERT em- beddings with all or some of the embeddings men- tioned above. However, this resulted on lower scores on both the local and shared task devel- opment sets. The best model used urban-glove embeddings with concatenated one-hot encoded UBY features stacked with both forward and back- ward flair embeddings. The model was trained for a maximum of 150 epochs with early stopping us- ing a learning rate of 0.1, a batch size of 32, and a BiLSTM with hidden size 256. The results of this model are shown in Table 5. Model BERT BERT* BERT BERT* Features text text context context BERT logits + handcrafted** LR BERT logits + handcrafted** LR* BERT logits + tagged spans BERT logits + tagged spans BERT logits + all BERT logits + all LR LR* LR LR* Development P F R 0.69 0.57 0.70 0.63 0.70 0.60 0.70 0.61 0.71 0.61 0.55 0.79 0.53 0.67 0.56 0.71 0.53 0.71 0.52 0.71 0.61 0.66 0.60 0.65 0.61 0.65 0.60 0.66 0.60 0.66 *Non-propaganda class is predicted only if its prediction probability is > 0.80 **handcrafted features include LIWC and presence of questions or quotes 4 Results and Error Analysis Table 2: SLC experiments on different feature sets In this section we discuss the results of both sub- tasks on all three datasets: the local development set, the shared task development and test sets. 4.1 SLC Results In SLC, we ran multiple experiments using BERT with and without additional features as shown in Table 2. The features include using the text passed as is to BERT without any preprocessing. Also, we experimented with adding the context which includes the two sentences that come before and after the target sentence. Context sentences were concatenated and passed as the second BERT in- put, while the target sentence was passed as the first BERT input. In addition, we experimented with using BERT logits (i.e., the probability pre- dictions per class) as features in a Logistic Re- gression (LR) classifier concatenated with hand- crafted features (e.g., LIWC, quotes, questions), and with predictions of our FLC classifier (tagged spans: whether the sentence has a propaganda fragment or not). However, none of these features added any statistically significant improvements. Therefore, we used BERT predictions for our fi- nal model with a condition to predict the major- ity class non-propaganda only if its prediction probability is more than 0.70 as shown in Table 3. This is a modified threshold as opposed to 0.80 in the experiments shown in Table 2 to avoid overfit- ting on a one dataset. The final threshold of 0.70 was chosen after experiments on both the local and shared task development sets, which also repre- sents the ratio of the non-propaganda class in the training set. Discussion of Propaganda Types: To further understand our model's performance in the SLC Dataset Local Dev Development Test P 0.60 0.62 0.58 R 0.75 0.68 0.66 F 0.67 0.65 0.618 *Non-propaganda class is predicted only if its prediction probability is > 0.70 Table 3: SLC best model results on all three datasets task, we looked at the accuracy of each pro- paganda techniques that occur more than 20 times in the local dev set as shown in Table 4. Repetition and Doubt are the two most chal- lenging types for the classifier even though they are in the four most frequent techniques. It is expected for Repetition to be challenging as the classifier only looks at one sentence while Repetition occurs if a word (or more) is re- peatedly mentioned in the article. Therefore, more information needs to be given to the classifier such as word counts across the document of all words in a given sentence. Due to time constrains, we did not test the effect of adding such features. Doubt on the other hand could have been chal- lenging due to its very wide lexical coverage and variant sentence structure as doubt is expressed in many different words and forms in this corpus (e.g. "How is it possible the pope signed this de- cree?" and "I've seen little that has changed"). It is also among the types with high variance in length where one span sometimes go across multiple sen- tences. 4.2 FLC Results In FLC, we only show the results of our best model in Table 5 to focus more on the differ- ences between propaganda techniques. A more Technique Loaded Language Name Calling,Labeling Repetition Doubt Exaggeration,Minimisation Flag-Waving Appeal to Fear/Prejudice Causal Oversimplification Slogans Count Accuracy 299 163 124 71 63 35 42 24 24 71% 69% 44% 40% 67% 74% 52% 58% 54% Table 4: SLC accuracy on frequent propaganda tech- niques in the local development set elaborate study of performance of different models should follow in future work. The best model is a BiLSTM-CRF with flair and urban glove embed- dings with one hot encoded features as mentioned in Section 3.2. Discussion of Propaganda Types: As we can see in Table 5, we can divide the propa- ganda techniques into three groups according to the model's performance on the development and test sets. The first group includes tech- niques with non-zero F1 scores on both datasets: Flag-Waving, Loaded Language, Name Calling,Labeling and Slogans. This group has techniques that appear frequently in the data and/or techniques with strong lexical signals (e.g. "American People" in Flag-Waving) or punctuation signals (e.g. quotes in Slogans). The second group has the techniques with a non- zero F1 score on only one of the datasets but not the other, such as: Appeal to Authority, Appeal to Fear, Doubt, Reduction, and Exaggeration,Minimisation. Two out of these five techniques (Appeal to Fear and Doubt) have very small non-zero F1 on the de- velopment set which indicates that they are gen- erally challenging on our model and were only tagged due to minor differences between the two datasets. However, the remaining three types show significant drops from development to test sets or vice-versa. This requires further analysis to un- derstand why the model was able to do well on one dataset but get zero on the other dataset, which we leave for future work. The third group has the remaining nine techniques were our sequence tag- ger fails to correctly tag any text span on either dataset. This group has the most infrequent types as well as types beyond the ability for our tag- ger to spot by looking at the sentence only such as Repetition. Propaganda Technique Appeal to Authority Appeal to Fear/Prejudice Bandwagon Black-and-White Fallacy Causal Oversimplification Doubt Exaggeration,Minimisation Flag-Waving Loaded Language Name Calling,Labeling O,IV,C Red Herring Reductio ad hitlerum Repetition Slogans Straw Men Thought-terminating Cliches Whataboutism Overall Development P 0 R 0 F 0 Test F 0.212 0.285 0.006 0.011 0 0 0 0.007 0.833 0.534 0.471 0.270 0 0 0 0 0 0.001 0.085 0.102 0.160 0.112 0 0 0 0 0 0.002 0.154 0.171 0.237 0.158 0 0 0.318 0.069 0.113 0 0 0 0 0 0 0 0 0 0.195 0.130 0.150 0 0 0 0 0.221 0.034 0.059 0.003 0 0 0 0 0 0 0 0 0 0 0 0 0.365 0.073 0.122 0.131∗ *Test set overall precision is 0.323 and recall is 0.082. Precision and recall per technique were not provided for the test set by the task organizers. Table 5: Precision, recall and F1 scores of the FLC task on the development and test sets of the shared task. Precision and Recall: Overall, our model has the highest precision among all teams on both datasets, which could be due to adding the UBY one-hot encoded features that highlighted some strong signals for some propaganda types. This also could be the reason for our model to have the lowest recall among the top 7 teams on both datasets as having explicit handcrafted signals suf- fers from the usual sparseness that accompanies these kinds of representations which could have made the model more conservative in tagging text spans. 4.3 Remarks from Both Tasks In light of our results on both sub-tasks, we notice that the BERT-based sentence classification model is performing well on some propaganda types such as Loaded Language and Flag-Waving. It would be interesting to test in future work if using BERT as a sequence tagger (and not BERT em- beddings in a BiLSTM-CRF tagger like we tested) would help in improving the sequence tagging re- sults on those particular types. Finally, we noticed two types of noise in the data; there were some du- plicate articles, and in some articles the ads were crawled as part of the article and tagged as non- propaganda. These could have caused some errors in predictions and therefore investigating ways to further clean the data might be helpful. Chang, Toutanova. Ken- 2019. Devlin, Lee, Ming-Wei and Kristina Jacob ton BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computa- tional Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171 -- 4186, Minneapolis, Minnesota. Association for Computational Linguistics. Iryna Gurevych, Judith Eckle-Kohler, Silvana Hart- mann, Michael Matuschek, Christian M Meyer, and Christian Wirth. 2012. Uby: A large-scale unified lexical-semantic resource based on lmf. In Proceed- ings of the 13th Conference of the European Chap- ter of the Association for Computational Linguistics, pages 580 -- 590. Association for Computational Lin- guistics. Guillaume Lample, Miguel Ballesteros, Sandeep Sub- ramanian, Kazuya Kawakami, and Chris Dyer. 2016. Neural architectures for named entity recognition. arXiv preprint arXiv:1603.01360. Xuezhe Ma and Eduard Hovy. 2016. End-to-end se- quence labeling via bi-directional lstm-cnns-crf. In Proceedings of the 54th Annual Meeting of the As- sociation for Computational Linguistics (Volume 1: Long Papers), pages 1064 -- 1074. Clyde R. Miller. 1939. The Techniques of Propaganda. From How to Detect and Analyze Propaganda, an address given at Town Hall. The Center for learning. James W Pennebaker, Martha E Francis, and Roger J Booth. 2001. Linguistic inquiry and word count: Liwc 2001. Mahway: Lawrence Erlbaum Asso- ciates, 71(2001):2001. 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. Hannah Rashkin, Eunsol Choi, Jin Yea Jang, Svitlana Volkova, and Yejin Choi. 2017. Truth of varying shades: Analyzing language in fake news and polit- ical fact-checking. In Proceedings of the 2017 Con- ference on Empirical Methods in Natural Language Processing, pages 2931 -- 2937. 5 Conclusion Propaganda still remains challenging to detect with high precision at a fine-grained level. This task provided an opportunity to develop compu- tational models that can detect propaganda tech- niques at sentence and fragment level. We pre- sented our models for each sub-task and discussed challenges and limitations. For some propaganda techniques, it is not enough to only look at one sentence to make an accurate prediction (e.g. Repetition) and therefore including the whole article as context is needed. For future work, we want to experiment with using a BERT-based se- quence tagger for the FLC task. In addition, we want to analyze the relationships between pro- paganda techniques to understand whether some techniques share common traits, which could be helpful for the classification and tagging tasks. References Alan Akbik, Tanja Bergmann, Duncan Blythe, Kashif Rasul, Stefan Schweter, and Roland Vollgraf. 2019. Flair: An easy-to-use framework for state-of-the- art nlp. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics (Demonstrations), pages 54 -- 59. Alan Akbik, Duncan Blythe, and Roland Vollgraf. 2018. Contextual string embeddings for sequence labeling. In COLING 2018, 27th International Con- ference on Computational Linguistics, pages 1638 -- 1649. Alberto Barr´on-Cedeno, Giovanni Da San Martino, Is- raa Jaradat, and Preslav Nakov. 2019. Proppy: A system to unmask propaganda in online news. In Proceedings of the AAAI Conference on Artificial In- telligence, volume 33, pages 9847 -- 9848. Giovanni Da San Martino, Alberto Barron-Cedeno, and Preslav Nakov. 2019a. Findings of the nlp4if-2019 shared task on fine-grained propaganda detection. In Proceedings of the 2nd Workshop on NLP for In- ternet Freedom (NLP4IF): Censorship, Disinforma- tion, and Propaganda, NLP4IFEMNLP '19, Hong Kong, China. Giovanni Da San Martino, Seunghak Yu, Alberto Barr´on-Cedeno, Rostislav Petrov, and Preslav Nakov. 2019b. Fine-grained analysis of propaganda in news articles. In Proceedings of the 2019 Con- ference on Empirical Methods in Natural Language Processing and 9th International Joint Conference on Natural Language Processing, EMNLP-IJCNLP 2019, Hong Kong, China, November 3-7, 2019, EMNLP-IJCNLP 2019, Hong Kong, China.
1911.08117
1
1911
2019-11-19T06:50:59
A Hybrid Morpheme-Word Representation for Machine Translation of Morphologically Rich Languages
[ "cs.CL", "cs.LG" ]
We propose a language-independent approach for improving statistical machine translation for morphologically rich languages using a hybrid morpheme-word representation where the basic unit of translation is the morpheme, but word boundaries are respected at all stages of the translation process. Our model extends the classic phrase-based model by means of (1) word boundary-aware morpheme-level phrase extraction, (2) minimum error-rate training for a morpheme-level translation model using word-level BLEU, and (3) joint scoring with morpheme- and word-level language models. Further improvements are achieved by combining our model with the classic one. The evaluation on English to Finnish using Europarl (714K sentence pairs; 15.5M English words) shows statistically significant improvements over the classic model based on BLEU and human judgments.
cs.CL
cs
A Hybrid Morpheme-Word Representation for Machine Translation of Morphologically Rich Languages∗ Minh-Thang Luong Preslav Nakov Min-Yen Kan Department of Computer Science National University of Singapore 13 Computing Drive Singapore 117417 {luongmin,nakov,kanmy}@comp.nus.edu.sg Abstract We propose a language-independent approach for improving statistical machine translation for morphologically rich languages using a hybrid morpheme-word representation where the basic unit of translation is the morpheme, but word boundaries are respected at all stages of the translation process. Our model extends the classic phrase-based model by means of (1) word boundary-aware morpheme-level (2) minimum error-rate phrase extraction, training for a morpheme-level translation model using word-level BLEU, and (3) joint scoring with morpheme- and word-level lan- guage models. Further improvements are achieved by combining our model with the classic one. The evaluation on English to Finnish using Europarl (714K sentence pairs; 15.5M English words) shows statistically sig- nificant improvements over the classic model based on BLEU and human judgments. 1 Introduction The fast progress of statistical machine translation (SMT) has boosted translation quality significantly. While research keeps diversifying, the word re- mains the atomic token-unit of translation. This is fine for languages with limited morphology like English and French, or no morphology at all like Chinese, but it is inadequate for morphologically rich languages like Arabic, Czech or Finnish ∗This research was sponsored in part by CSIDM (grant # 200805) and by a National Research Foundation grant entitled "Interactive Media Search" (grant # R-252-000-325-279). (Lee, 2004; Yang and Kirchhoff, 2006). Goldwater and McClosky, 2005; There has been a line of recent SMT research that incorporates morphological analysis as part of the translation process, thus providing access to the information within the individual words. Unfortu- nately, most of this work either relies on language- specific tools, or only works for very small datasets. Below we propose a language-independent ap- proach to SMT of morphologically rich lan- guages using a hybrid morpheme-word representa- tion where the basic unit of translation is the mor- pheme, but word boundaries are respected at all stages of the translation process. We use unsuper- vised morphological analysis and we incorporate its output into the process of translation, as opposed to relying on pre-processing and post-processing only as has been done in previous work. The remainder of the paper is organized as fol- lows. Section 2 reviews related work. Sections 3 and 4 present our morphological and phrase merging enhancements. Section 5 describes our experiments, and Section 6 analyzes the results. Finally, Section 7 concludes and suggests directions for future work. 2 Related Work relies on e.g., the TreeTagger heavily Most previous work on morphology-aware ap- proaches language-specific tools, (Schmid, 1994) or the Buckwalter Arabic Morphological Analyzer (Buckwalter, 2004), which hampers their portability to other languages. Moreover, the prevalent method for information is by heuristically-driven pre- or post-processing. incorporating morphological for Arabic-English For example, Sadat and Habash (2006) use dif- combinations of Arabic pre-processing ferent SMT, whereas schemes Oflazer and El-Kahlout (2007) post-processes Turkish morpheme-level translations by re-scoring n-best lists with a word-based language model. These systems, however, do not attempt to incorpo- rate their analysis as part of the decoding process, but rather rely on models designed for word-token translation. We should also note the importance of the translation direction: it is much harder to translate from a morphologically poor to a morphologically rich language, where morphological distinctions not present in the source need to be generated in the target language. Research in translating into morphologically rich languages, has attracted in- terest for languages like Arabic (Badr et al., 2008), Greek Hungar- Koehn and Haddow, 2009), ian and Turkish Russian (Oflazer and El-Kahlout, 2007). These approaches, however, either only succeed in enhancing the performance for small bi-texts (Badr et al., 2008; Oflazer and El-Kahlout, 2007), or improve only modestly for large bi-texts1. (Avramidis and Koehn, 2008), (Nov´ak, 2009; (Toutanova et al., 2008), 3 Morphological Enhancements a morphologically-enhanced ver- We present the classic phrase-based SMT model sion of (Koehn et al., 2003). We use a hybrid morpheme- word representation where the basic unit of translation is the morpheme, but word boundaries are respected at all stages of the translation process. This is in contrast with previous work, where mor- phological enhancements are typically performed as pre-/post-processing steps only. In addition to changing the basic translation token unit from a word to a morpheme, our model extends the phrase-based SMT model with the following: 1. word boundary-aware morpheme-level phrase extraction; 2. minimum error-rate training for a morpheme- level model using word-level BLEU; 1Avramidis and Koehn (2008) improved by 0.15 BLEU over a 18.05 English-Greek baseline; Toutanova et al. (2008) improved by 0.72 BLEU over a 36.00 English-Russian base- line. 3. joint scoring with morpheme- and word-level language models. We first introduce our morpheme-level represen- tation, and then describe our enhancements. 3.1 Morphological Representation Our morphological representation is based on the output of an unsupervised morphological ana- lyzer. Following Virpioja et al. (2007), we use Mor- fessor, which is trained on raw tokenized text (Creutz and Lagus, 2007). The tool segments words into morphemes annotated with the following labels: PRE (prefix), STM (stem), SUF (suffix). Multiple prefixes and suffixes can be proposed for each word; word compounding is allowed as well. The output can be described by the following regular expres- sion: WORD = ( PRE* STM SUF* )+ For example, uncarefully is analyzed as un/PRE+ care/STM+ ful/SUF+ ly/SUF The above token sequence forms the input to our system. We keep the PRE/STM/SUF tags as part of the tokens, and distinguish between care/STM+ and care/STM. Note also that the "+" sign is ap- pended to each nonfinal tag so that we can distin- guish word-internal from word-final morphemes. 3.2 Word Boundary-aware Phrase Extraction The core translation structure of a phrase-based SMT model is the phrase table, which is learned from a bilingual parallel sentence-aligned corpus, typically using the alignment template approach (Och and Ney, 2004). It contains a set of bilingual phrase pairs, each associated with five scores: for- ward and backward phrase translation probabilities, forward and backward lexicalized translation proba- bilities, and a constant phrase penalty. The maximum phrase length n is normally limited to seven words; higher values of n increase the table size exponentially without actually yielding perfor- mance benefit (Koehn et al., 2003). However, things are different when translating with morphemes, for two reasons: (1) morpheme-token phrases of length n can span less than n words; and (2) morpheme- token phrases may only partially span words. The first point means that morpheme-token phrase pairs span fewer word tokens, and thus cover SRC = theSTM newSTM , unPRE+ democraticSTM immigrationSTM policySTM TGT = uusiSTM , epäPRE+ demokraatSTM+ tSUF+ iSUF+ sSUF+ enSUF maahanmuuttoPRE+ politiikanSTM (uusi=new , epädemokraattisen=undemocratic maahanmuuttopolitiikan=immigration policy) Figure 1: Example of English-Finnish bilingual fragments morphologically segmented by Morfessor. Solid links represent IBM Model 4 alignments at the morpheme-token level. Translation glosses for Finnish are given below. a smaller context, which may result in fewer total extracted pairs compared to a word-level approach. Figure 1 shows a case where three Finnish words consist of nine morphemes. Previously, this issue was addressed by simply increasing the value of n when using morphemes, which is of limited help. The second point is more interesting: morpheme- level phrases may span words partially, making them potentially usable in translating unknown inflected forms of known source language words, but also creates the danger of generating sequences of mor- phemes that are not legal target language words. For example, let us consider the phrase in Fig- ure 1: unPRE+ democraticSTM. The original algorithm will extract the spurious phrase epaPRE+ demokraatSTM+ tSUF+ iSUF+ sSUF+, beside the correct one that has enSUF appended at the end. Such a spurious phrase does not generally help in translating unknown inflected forms, especially for morphologically-rich languages that feature mul- tiple affixes, but negatively affects the translation model in terms of complexity and quality. We solve both problems by modifying the phrase- pair extraction algorithm so that morpheme-token phrases can extend longer than n, as long as they span n words or less. We further require that word boundaries be respected2, i.e., morpheme- token phrases span a sequence of whole words. This is a fair extension of the morpheme-token system with respect to a word-token one since both are re- stricted to span up to n word-tokens. 3.3 Morpheme-Token MERT Optimizing Word-Token BLEU Modern phrase-based SMT systems use a log-linear model with the following typical feature functions: language model probabilities, word penalty, distor- 2This means that we miss the opportunity to generate new wordforms for known baseforms, but removes the problem of proposing nonwords in the target language. tion cost, and the five parameters from the phrase ta- ble. Their weights are set by optimizing BLEU score (Papineni et al., 2001) directly using minimum error rate training (MERT), as suggested by Och (2003). In previous work, phrase-based SMT systems using morpheme-token input/output naturally per- formed MERT at the morpheme-token level as well. This is not optimal since the final expected system output is a sequence of words, not morphemes. The main danger is that optimizing a morpheme-token BLEU score could lead to a suboptimal weight for the word penalty feature function: this is because the brevity penalty of BLEU is calculated with re- spect to the number of morphemes, which may vary for sentences with an identical number of words. This motivates us to perform MERT at the word- token level, although our input consists of mor- phemes. In particular, for each iteration of MERT, as soon as the decoder generates a morpheme-token translation for a sentence, we convert it into a word- token sequence, which is used to calculate BLEU. We thus achieve MERT optimization at the word- token level while translating a morpheme-token in- put and generating a morpheme-token output. 3.4 Scoring with Twin Language Models An SMT system that takes morpheme-token input and generates morpheme-token output should natu- rally use a morpheme-token language model (LM). This has the advantage of alleviating the problem of data sparseness, especially when translating into a morphologically rich language, since the LM would be able to handle some new unseen inflected forms of known words. On the negative side, a morpheme- token LM spans fewer word-tokens and thus has a more limited word "horizon" compared to one op- erating at the word level. As with the maximum phrase length, mechanically increasing the order of the morpheme-token LM has a limited impact. In order to address the issue in a more princi- Previous hypotheses Current hypothesis uusiSTM , epäPRE+ demokraatSTM+ tSUF+ iSUF+ sSUF+ enSUF maahanmuuttoPRE+ politiikanSTM • Score: "sSUF+ enSUF maahanmuuttoPRE+" ; "enSUF maahanmuuttoPRE+ politiikanSTM " • Concatenate: uusi , epädemokraattisen maahanmuuttopolitiikan • Score: ", epädemokraattisen maahanmuuttopolitiikan" (i) (ii) (iii) Figure 2: Scoring with twin LMs. Shown are: (i) The current state of the decoding process with the target phrases covered by the current partial hypotheses. (ii, iii) Scoring with 3-gram morpheme-token and 3-gram word-token LMs, respectively. For the word-token LM, the morpheme-token sequence is concatenated into word-tokens before scoring. pled manner, we enhance our model with a second LM that works at the word-token level. This LM is used together with the morpheme-token LM, which is achieved by using two separate feature functions in the log-linear SMT model: one for each LM. We further had to modify the Moses decoder so that it can be enhanced with an appropriate word-token "view" on the partial morpheme-level hypotheses3. The interaction of the twin LMs is illustrated in Figure 2. The word-token LM can capture much longer phrases and more complete contexts such as ", epademokraattisen maahanmuuttopolitiikan" compared to the morpheme-token LM. Note that scoring with two LMs that see the output sequence as different numbers of tokens is not readily offered by the existing SMT de- coders. For example, the phrase-based model in Moses (Koehn et al., 2007) allows scoring with mul- tiple LMs, but assumes they use the same to- ken granularity, which is useful for LMs trained on different monolingual corpora, but cannot han- dle our case. While the factored translation model (Koehn and Hoang, 2007) in Moses does al- low scoring with models of different granularity, e.g., lemma-token and word-token LMs, it requires a 1:1 correspondence between the tokens in the dif- ferent factors, which clearly is not our case. Note that scoring with twin LMs is conceptu- ally superior to n-best re-scoring with a word-token LM, e.g., (Oflazer and El-Kahlout, 2007), since it is tightly integrated into decoding: it scores partial hy- potheses and influenced the search process directly. 3We use the term "hypothesis" to collectively refer to the following (Koehn, 2003): the source phrase covered, the corre- sponding target phrase, and most importantly, a reference to the previous hypothesis that it extends. 4 Enriching the Translation Model Another general strategy for combining evidence from the word-token and the morpheme-token rep- resentations is to build two separate SMT sys- tems and then combine them. This can be done as a post-processing system combination step; see (Chen et al., 2009a) for an overview of such ap- proaches. However, for phrase-based SMT systems, it is theoretically more appealing to combine their phrase tables since this allows the translation models of both systems to influence the hypothesis search directly. We now describe our phrase table combination approach. Note that it is orthogonal to the work pre- sented in the previous section, which suggests com- bining the two (which we will do in Section 5). 4.1 Building a Twin Translation Model Figure 3 shows a general scheme of our twin trans- lation model. First, we tokenize the input at differ- ent granularities: (1) morpheme-token and (2) word- token. We then build separate phrase tables (PT) for the two inputs: a word-token P Tw and a morpheme- token P Tm. Second, we re-tokenize P Tw at the morpheme level, thus obtaining a new phrase table P Tw→m, which is of the same granularity as P Tm. Finally, we merge P Tw→m and P Tm, and we input the resulting phrase table to the decoder. 4.2 Merging and Normalizing Phrase Tables Below we first describe the two general phrase ta- ble combination strategies used in previous work: (1) direct merging using additional feature func- tions, and (2) phrase table interpolation. We then introduce our approach. Add-feature methods. line of research on phrase table merging is exempli- The first Word Morpheme GIZA++ GIZA++ Word alignment Morpheme alignment Phrase ExtracƟon Phrase ExtracƟon PTw PTm Morphological segmentaƟon PTw→m PT merging Decoding Figure 3: Building a twin phrase table (PT). First, sep- arate PTs are generated for different input granularities: word-token and morpheme-token. Second, the word- token PT is retokenized at the morpheme-token level. Fi- nally, the two PTs are merged and used by the decoder. fied by (Niehues et al., 2009; Chen et al., 2009b; Do et al., 2009; Nakov and Ng, 2009). The idea is to select one of the phrase tables as primary and to add to it all non-duplicating phrase pairs from the second table together with their associated scores. For each entry, features can be added to indicate its origin (whether from the primary or from the sec- ondary table). Later in our experiments, we will refer to these baseline methods as add-1 and add- 2, depending on how many additional features have been added. The values we used for these features in the baseline are given in Section 5.4; their weights in the log-linear model were set in the standard way using MERT. Interpolation-based methods. A problem with the above method is that the scores in the merged phrase table that correspond to forward and back- ward phrase translation probabilities, and forward and backward lexicalized translation probabilities can no longer be interpreted as probabilities since they are not normalized any more. Theoretically, this is not necessarily a problem since the log-linear model used by the decoder does not assume that the scores for the feature functions come from a normal- ized probability distribution. While it is possible to re-normalize the scores to convert them into proba- bilities, this is rarely done; it also does not solve the problem with the dropped scores for the duplicated phrases. Instead, the conditional probabilities in the two phrase tables are often interpolated directly, e.g., using linear interpolation. Representative work adopting this approach is (Wu and Wang, 2007). We refer to this method as interpolation. Our method. The above phrase merging ap- proaches have been proposed for phrase tables de- rived from different sources. This is in contrast with our twin translation scenario, where the morpheme- token phrase tables are built from the same training dataset; the main difference being that word align- ments and phrase extraction were performed at the word-token level for P Tw→m and at the morpheme- token level for P Tm. Thus, we propose different merging approaches for the phrase translation prob- abilities and for the lexicalized probabilities. P ¯f #( ¯f ,¯e) In phrase-based SMT, phrase translation probabil- ities are computed using maximum likelihood (ML) estimation φ( ¯f ¯e) = #( ¯f ,¯e) , where #( ¯f , ¯e) is the number of times the pair ( ¯f , ¯e) is extracted from the training dataset (Koehn et al., 2003). In order to preserve the normalized ML estimations as much as possible, we refrain from interpolation. Instead, we use the raw counts for the two models #m( ¯f , ¯e) and #w→m( ¯f , ¯e) directly as follows: φ( ¯f , ¯e) = #m( ¯f , ¯e) + #w→m( ¯f , ¯e) P ¯f #m( ¯f , ¯e) + P ¯f #w→m( ¯f , ¯e) For lexicalized translation probabilities, we would like to use simple interpolation. However, we notice that when a phrase pair belongs to only one of the phrase tables, the corresponding lexicalized score for the other table would be zero. This might cause some good phrases to be penalized just because they were not extracted in both tables, which we want to prevent. We thus perform interpolation from P Tm and P Tw according to the following formula: lex( ¯f ¯e) = α × lexm( ¯fm¯em) + (1 − α) × lexw( ¯fw¯ew) where the concatenation of ¯fm and ¯em into word- token sequences yields ¯fw and ¯ew, respectively. If both ( ¯fm, ¯em) and ( ¯fw, ¯ew) are present in P Tm and P Tw, respectively, we have a simple interpola- tion of their corresponding lexicalized scores lexm and lexw. However, if one of them is missing, we do not use a zero for its corresponding lexicalized score, but use an estimate as follows. For example, if only the entry ( ¯fm, ¯em) is present in P Tm, we first convert ( ¯fm,¯em) into a word-token pair ( ¯fm→w,¯em→w), and then induce a correspond- ing word alignment from the morpheme-token align- ment of ( ¯fm,¯em). We then estimate a lexicalized phrase score using the original formula given in (Koehn et al., 2003), where we plug this induced word alignment and word-token lexical translation probabilities estimated from the word-token dataset The case when ( ¯fw, ¯ew) is present in P Tw, but ( ¯fm, ¯em) is not, is solved similarly. LM. None of the enhancements described previ- ously is applied yet. After decoding, morphemes are concatenated back to words using the "+" markers. w-system m-system BLEU m-BLEU BLEU m-BLEU T1 T2 T3 T4 Full 11.56 12.95 13.64 14.20 14.58 45.57 48.63 50.30 50.85 53.05 11.07 12.68 13.32 13.57 14.08 49.15 53.78 54.40 54.70 55.26 5 Experiments and Evaluation 5.1 Datasets Table 2: Baseline system performance (on the test dataset). Shown are word BLEU and morpheme m- BLEU scores for the w-system and m-system. In our experiments, we use the English-Finnish data from the 2005 shared task (Koehn and Monz, 2005), which is split into training, development, and test portions; see Table 1 for details. We further split the training dataset into four subsets T1, T2, T3, and T4 of sizes 40K, 80K, 160K, and 320K parallel sen- tence pairs, which we use for studying the impact of training data size on translation performance. Sent. Avg. words en fi Avg. morph. en fi Train Dev Test 714K 21.62 29.33 28.98 2K 2K 15.80 20.99 20.72 24.68 33.40 33.10 26.15 34.94 34.47 Table 1: Dataset statistics. Shown are the number of parallel sentences, and the average number of words and Morfessor morphemes on the English and Finnish sides of the training, development and test datasets. 5.2 Baseline Systems We build two phrase-based baseline SMT systems, both using Moses (Koehn et al., 2007): w-system: works at the word-token level, extracts phrases of up to seven words, and uses a 4-gram word-token LM (as typical for phrase-based SMT); m-system: works at the morpheme level, tok- enized using Morfessor4 and augmented with "+" as described in Section 3.1. Following Oflazer and El-Kahlout (2007) and Virpioja et al. (2007), we use phrases of up to 10 morpheme-tokens and a 5-gram morpheme-token To evaluate the translation quality, we com- pute BLEU (Papineni et al., 2001) at the word-token level. We further introduce a morpheme-token ver- sion of BLEU, which we call m-BLEU: it first seg- ments the system output and the reference trans- lation into morpheme-tokens and then calculates a BLEU score as usual. Table 2 shows the baseline re- sults. We can see that the m-system achieves much higher m-BLEU scores, indicating that it may have better morpheme coverage5. However, the m-system is outperformed by the w-system on the classic word- token BLEU, which means that it either does not perform as well as the w-system or that word-token BLEU is not capable of measuring the morpheme- level improvements. We return to this question later. 5.3 Adding Morphological Enhancements We now add our three morphological enhancements from Section 3 to the baseline m-system: phr (training) allow morpheme-token phrases to get potentially longer than seven morpheme-tokens as long as they cover no more than seven words; tune (tuning) MERT for morpheme-token trans- lations while optimizing word-token BLEU; lm (decoding) scoring morpheme-token transla- tion hypotheses with a 5-gram morpheme-token and a 4-gram word-token LM. The results are shown in Table 3 (ii). As we can see, each of the three enhancements yields improve- ments in BLEU score over the m-system, both for 4We retrained Morfessor for Finnish/English on the 5Note that these morphemes were generated automatically Finnish/English side of the training dataset. and thus many of them are erroneous. small and for large training corpora. In terms of per- formance ranking, tune achieves the best absolute improvement of 0.66 BLEU points on T1 and of 0.47 points on the full dataset, followed by lm and phr. System T1 (40K) Full (714K) (i) (ii) (iii) w-system (w) m-system (m) m+phr m+tune m+lm m+phr+lm m+phr+lm+tune 11.56 11.07 11.44+0.37 11.73+0.66 11.58+0.51 11.77+0.70 11.90+0.83 14.58 14.08 14.43+0.35 14.55+0.47 14.53+0.45 14.58+0.50 14.39+0.31 Table 3: Impact of the morphological enhancements (on test dataset). Shown are BLEU scores (in %) for training on T1 and on the full dataset for (i) baselines, (ii) enhancements individually, and (iii) combined. Su- perscripts indicate absolute improvements w.r.t m-system. Table 3 (iii) further shows that using phr and lm together yields absolute improvements of 0.70 BLEU points on T1 and 0.50 points on the full train- ing dataset. Further incorporating tune, however, only helps when training on T1. Overall, the morphological enhancements are on par with the w-system baseline, and yield sizable im- provements over the m-system baseline: 0.83 BLEU points on T1 and 0.50 on the full training dataset. 5.4 Combining Translation Tables Finally, we investigate the effect of combining phrase tables derived from a word-token and a morpheme-token input, as described in Section 4. We experiment with the following merging methods: add-1: phrase table merging using one table as primary and adding one extra feature6; add-2: phrase table merging using one table as primary and adding two extra features7; interpolation: simple linear interpolation with one parameter α; ourMethod: our interpolation-like merging method described in Section 4.2. 6The feature values are e 1/3 (e=2.71828...); when the phrase pair comes from both tables, from the primary table only, and from the secondary table only, respectively. 2/3 or e 1, e 7The feature values are (e 1) when the phrase pair comes from both tables, from the primary table only, and from the secondary table only, respectively. 0) or (e , e , e 0 1 1), (e 1 , e Parameter tuning. We tune the parameters of the above methods on the development dataset. T1 (40K) Full (714K) P Tm is primary P Tw→m is primary 11.99 12.26 13.45 14.19 Table 4: Effect of selection of primary phrase table for add-1 (on dev dataset): P Tw→m, derived from a word- token input, vs. P Tm, from a morpheme-token input. Shown is BLEU (in %) on T1 and the full training dataset. For add-1 and add-2, we need to decide which (P Tw→m or P Tm) phrase table should be consid- ered the primary table. Table 4 shows the results when trying both strategies on add-1. As we can see, using P Tw→m as primary performs better on T1 and on the full training dataset; thus, we will use it as primary on the test dataset for add-1 and add-2. For interpolation-based methods, we need to choose a value for the interpolation parameters. Due to time constraints, we use the same value for the phrase translation probabilities and for the lexical- ized probabilities, and we perform grid search for α ∈ {0.3, 0.4, 0.5, 0.6, 0.7} using interpolate on the full training dataset. As Table 5 shows, α = 0.6 turns out to work best on the development dataset; we will use this value in our experiments on the test dataset both for interpolate and for ourMethod8. α BLEU 14.17 0.3 0.4 14.49 0.5 14.6 0.6 0.7 14.73 14.52 Table 5: Trying different values for interpolate (on dev dataset). BLEU (in %) is for the full training dataset. Evaluation on the test dataset. We integrate the morphologically enhanced system m+phr+lm and the word-token based w-system using the four merg- ing methods above. The results for the full train- ing dataset are shown in Table 6. As we can see, add-1 and add-2 make little difference compared to the m-system baseline. In contrast, interpolation and ourMethod yield sizable absolute improvements of 0.55 and 0.74 BLEU points, respectively, over the m-system; moreover, they outperform the w-system. 8Note that this might put ourMethod at disadvantage. Merging methods Full (714K) m-system w-system add-1 add-2 interpolation ourMethod 14.08 14.58 14.25+0.17 13.89−0.19 14.63+0.55 14.82+0.74 (i) (ii) (iii) Table 6: Merging m+phr+lm and w-system (on test dataset). BLEU (in %) is for the full training dataset. Su- perscripts indicate performance gain/loss w.r.t m-system. 6 Discussion Below we assess the significance of our results based on micro-analysis and human judgments. 6.1 Translation Model Comparison We first compare the following three phrase ta- bles: P Tm of m-system, maximum phrase length of 10 morpheme-tokens; P Tw→m of w-system, maxi- mum phrase length of 7 word-tokens, re-segmented into morpheme-tokens; and P Tm+phr -- morpheme- token input using word boundary-aware phrase ex- traction, maximum phrase length of 7 word-tokens. Full (714K) (i) (ii) P Tm P Tw→m P Tm+phr P Tm+phr T P Tm P Tm+phr T P Tw→m 43.5M 28.9M 22.5M 21.4M 10.7M Table 7: Phrase table statistics. The number of phrase pairs in (i) individual PTs and (ii) PT overlap, is shown. P Tm+phr versus P Tm. Table 7 shows that P Tm+phr is about half the size of P Tm. Still, as Table 3 shows, m+phr outperforms the m-system. Moreover, 95.07% (21.4M/22.5M) of the phrase pairs in P Tm+phr are also in P Tm, which confirms that boundary-aware phrase extraction selects good phrase pairs from P Tm to be retained in P Tm+phr. P Tm+phr versus P Tw→m. These two tables are comparable in size: 22.5M and 28.9M pairs, but their overlap is only 47.67% (10.7M/22.5M) of P Tm+phr. Thus, enriching the translation model with P Tw→m helps improve coverage. 6.2 Significance of the Results Table 8 shows the performance of our system com- pared to the two baselines: m-system and w-system. We achieve an absolute improvement of 0.74 BLEU points over the m-system, from which our system evolved. This might look modest, but note that the baseline BLEU is only 14.08, and thus the rel- ative improvement is 5.6%, which is not trivial. Furthermore, we outperform the w-system by 0.24 points (1.56% relative). Both improvements are sta- tistically significant with p < 0.01, according to Collins' sign test (Collins et al., 2005). BLEU m-BLEU ourSystem 14.82 14.08 m-system 14.58 w-system 55.64 55.26 53.05 Table 8: Our system vs. the two baselines (on the test dataset): BLEU and m-BLEU scores (in %). In terms of m-BLEU, we achieve an improvement of 2.59 points over the w-system, which suggest our system might be performing better than what stan- dard BLEU suggests. Below we test this hypothesis by means of micro-analysis and human evaluation. Translation Proximity Match. We performed automatic comparison based on corresponding phrases between the translation output (out) and the reference (ref), using the source (src) test dataset as a pivot. The decoding log gave us the phrases used to translate src to out, and we only needed to find correspondences between src and ref, which we ac- complished by appending the test dataset to training and performing IBM Model 4 word alignments. We then looked for phrase triples (src, out, ref ), where there was a high character-level similarity be- tween out and ref, measured using longest common subsequence ratio with a threshold of 0.7, set ex- perimentally. We extracted 16,262 triples: for 6,758 of them, the translations matched the references ex- actly, while in the remaining triples, they were close wordforms9. These numbers support the hypothesis that our approach yields translations close to the ref- erence wordforms but unjustly penalized by BLEU, 9Examples of such triples are (constitutional structure, perustuslaillinen rakenne, perustuslaillisempi rakenne) and (economic and social, taloudellisia ja sosiaalisia, taloudellisten ja sosiaalisten) which only gives credit for exact word matches10. Human Evaluation. We asked four native Finnish speakers to evaluate 50 random test sen- tences. Following (Callison-Burch et al., 2009), we provided them with the source sentence, its refer- ence translation, and the outputs of three SMT sys- tems (m-system, w-system, and ourSystem), which were shown in different order for each example and were named sys1, sys2 and sys3 (by order of ap- pearance). We asked for three pairwise judgments: (i) sys1 vs. sys2, (ii) sys1 vs. sys3, and (iii) sys2 vs. sys3. For each pair, a winner had to be designated; ties were allowed. The results are shown in Table 10. We can see that the judges consistently preferred (1) ourSystem to the m-system, (2) ourSystem to the w-system, (3) w-system to the m-system. These pref- erences are statistically significant, as found by the sign test. Comparing to Table 8, we can see that BLEU correlates with human judgments better than m-BLEU; we plan to investigate this in future work. Finally, Table 9 shows some examples demon- strating how our system improves over the w-system and the m-system. 7 Conclusion and Future Work In the quest towards a morphology-aware SMT that only uses unannotated data, there are two key chal- lenges: (1) to bring the performance of morpheme- token systems to a level rivaling the standard word- token ones, and (2) to incorporate morphological analysis directly into the translation process. This work satisfies the first challenge: we have achieved statistically significant improvements in BLEU for a large training dataset of 714K sentence pairs and this was confirmed by human evaluation. We think we have built a solid framework for the second challenge, and we plan to extend it further. Acknowledgements We thank Joanna Bergstrom-Lehtovirta (Helsinki Institute for Information Technology), Katri Haveri- nen (University of Turku and Turku Centre for Com- puter Science), Veronika Laippala (University of 10As a reference, the w-system yielded 15,673 triples, and 6,392 of them were exact matches. Compared to our system, this means 589 triples and 366 exact matches less. Turku), and Sampo Pyysalo (University of Tokyo) for judging the Finnish translations. References [Avramidis and Koehn2008] Eleftherios Avramidis and Philipp Koehn. 2008. Enriching morphologically poor languages for statistical machine translation. In ACL-HLT. [Badr et al.2008] Ibrahim Badr, Rabih Zbib, and James Glass. 2008. Segmentation for English-to-Arabic sta- tistical machine translation. In ACL-HLT. [Buckwalter2004] Tim Buckwalter. 2004. Buckwalter Arabic Morphological Analyzer Version 2.0. Linguis- tic Data Consortium, Philadelphia". [Callison-Burch et al.2009] Chris Callison-Burch, Philipp Koehn, Christof Monz, and Josh Schroeder. 2009. Findings of the 2009 Workshop on Statistical Machine Translation. In EACL. [Chen et al.2009a] Boxing Chen, Min Zhang, Haizhou Li, and Aiti Aw. 2009a. A comparative study of hypoth- esis alignment and its improvement for machine trans- lation system combination. In ACL-IJCNLP. [Chen et al.2009b] Yu Chen, Michael Jellinghaus, An- dreas Eisele, Yi Zhang, Sabine Hunsicker, Silke Theison, Christian Federmann, and Hans Uszkoreit. 2009b. Combining multi-engine translations with Moses. In EACL. [Collins et al.2005] Michael Collins, Philipp Koehn, and Ivona Kucerov´a. 2005. Clause restructuring for statis- tical machine translation. In ACL. [Creutz and Lagus2007] Mathias Creutz and Krista La- gus. 2007. Unsupervised models for morpheme seg- mentation and morphology learning. ACM Trans. Speech Lang. Process., 4(1):3. [Do et al.2009] Thi Ngoc Diep Do, Viet Bac Le, Brigitte Bigi, Laurent Besacier, and Eric Castelli. 2009. Min- ing a comparable text corpus for a Vietnamese-French statistical machine translation system. In EACL. [Goldwater and McClosky2005] Sharon Goldwater and Improving statistical MT David McClosky. 2005. through morphological analysis. In HLT. [Koehn and Haddow2009] Philipp Koehn and Barry Had- dow. 2009. Edinburgh's submission to all tracks of the WMT2009 shared task with reordering and speed improvements to Moses. In EACL. [Koehn and Hoang2007] Philipp Koehn and Hieu Hoang. In EMNLP- Factored translation models. 2007. CoNLL. [Koehn and Monz2005] Philipp Koehn and Christof Shared task: Statistical machine Monz. translation between European languages. In WPT. 2005. src: as a conservative , i am incredibly thrifty with taxpayers ' money . ref: maltillisen kokoomuspuolueen edustajana suhtaudun erittain saastavaisesti veronmaksajien rahoihin . our: konservatiivinen , olen erittain saastavaisesti veronmaksajien rahoja . w : konservatiivinen , olen aarettoman tarkeaa kanssa veronmaksajien rahoja . m : kuten konservatiivinen , olen erittain saastavaisesti veronmaksajien rahoja . Comment: our ≻ m ≻ w. our uses better paraphrases, from which the correct meaning could be inferred. The part "aarettoman tarkeaa kanssa" in w does not mention the "thriftiness" and replaces it with "important" (tarkeaa), which is wrong. m introduces "kuten", which slightly alters the meaning towards "like a conservative, ...". src: we were very constructive and we negotiated until the last minute of these talks in the hague . ref: olimme erittain rakentavia ja neuvottelimme haagissa viime hetkeen saakka . our: olemme olleet hyvin rakentavia ja olemme neuvotelleet viime hetkeen saakka naiden neuvottelujen haagissa . w : olemme olleet hyvin rakentavia ja olemme neuvotelleet viime tippaan niin naiden neuvottelujen haagissa . m : olimme erittain rakentavan ja neuvottelimme viime hetkeen saakka naiden neuvotteluiden haagissa . Comment: our ≻ m (cid:23) w. In our, the meaning is very close to ref with only a minor difference in tense at the beginning. m only gets the case wrong in "rakentavan", and the correct case is easily guessable. For w, the "viime tippaan" is in principle correct but somewhat colloquial, and the "niin" is extra and somewhat confusing. src: it would be a very dangerous situation if the europeans were to become logistically reliant on russia . ref: olisi erittain vaarallinen tilanne , jos eurooppalaiset tulisivat logistisesti riippuvaisiksi venajasta . our: olisi erittain vaarallinen tilanne , jos eurooppalaiset tulee logistisesti riippuvaisia venajan . w : se olisi erittain vaarallinen tilanne , jos eurooppalaisten tulisi logistically riippuvaisia venajan . m : se olisi hyvin vaarallinen tilanne , jos eurooppalaiset haluavat tulla logistisesti riippuvaisia venajan . Comment: our ≻ w (cid:23) m. our is almost correct except for the wrong inflections at the end. w is inferior since it failed to translate "logistically". "haluavat tulla" in m suggests that the Europeans would "want to become logistically dependent", which is not the case. The "se" (it), and "hyvin" (a synonym of "erittain") are minor mistakes/differences. Table 9: English-Finnish translation examples. Shown are the source (src), the reference (ref), and the transla- tions of three systems (our, w, m). Text in bold indicates matches with respect to the ref, while italic shows where we think a system seems to be inferior compared to the rest. The comments are garnered from the Finnish judges. our vs. m our vs. w w vs. m Judge 1 Judge 2 Judge 3 Judge 4 Total 25 24 27† 25 101‡ 18 16 12 20 66 19 19 17 26† 81‡ 12 15 11 12 50 21 25 27† 22 95† 19 14 15 22 70 Table 10: Human judgments: ourSystem (our) vs. m- system (m) vs. w-system (w). For each pair, we show the number of times each system was judged better than the other one, ignoring ties. Statistically significant dif- ferences are marked with † (p < 0.05) and ‡ (p < 0.01). [Koehn et al.2003] Philipp Koehn, Franz Josef Och, and Daniel Marcu. 2003. Statistical phrase-based transla- tion. In NAACL. [Koehn et al.2007] Philipp Koehn, Hieu Hoang, Alexan- dra Birch Mayne, Christopher Callison-Burch, Mar- cello Federico, Nicola Bertoldi, Brooke Cowan, Wade Shen, Christine Moran, Richard Zens, Chris Dyer, On- drej Bojar, Alexandra Constantin, and Evan Herbst. 2007. Moses: Open source toolkit for statistical ma- chine translation. In ACL, Demonstration Session. [Koehn2003] Philipp Koehn. 2003. Noun phrase transla- tion. Ph.D. thesis, University of Southern California, Los Angeles, CA, USA. [Lee2004] Young-Suk Lee. 2004. Morphological analy- sis for statistical machine translation. In HLT-NAACL. [Nakov and Ng2009] Preslav Nakov and Hwee Tou Ng. 2009. Improved statistical machine translation for resource-poor languages using related resource-rich languages. In EMNLP. [Niehues et al.2009] Jan Niehues, Teresa Herrmann, Muntsin Kolss, and Alex Waibel. 2009. The Univer- sitat Karlsruhe translation system for the EACL-WMT 2009. In EACL. [Nov´ak2009] Attila Nov´ak. 2009. MorphoLogic's sub- mission for the WMT 2009 shared task. In EACL. [Och and Ney2004] Franz Josef Och and Hermann Ney. 2004. The alignment template approach to statisti- cal machine translation. Computational Linguistics, 30(4):417 -- 449. [Och2003] Franz Josef Och. 2003. Minimum error rate training in statistical machine translation. In ACL. [Oflazer and El-Kahlout2007] Kemal Oflazer and Ilknur El-Kahlout. 2007. Exploring different representa- tional units in English-to-Turkish statistical machine translation. In StatMT. [Papineni et al.2001] Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2001. Bleu: a method for automatic evaluation of machine translation. In ACL. [Sadat and Habash2006] Fatiha Sadat and Nizar Habash. 2006. Combination of Arabic preprocessing schemes for statistical machine translation. In ACL. [Schmid1994] Helmut Schmid. 1994. Probabilistic part- In Interna- of-speech tagging using decision trees. tional Conference on New Methods in Language Pro- cessing. [Toutanova et al.2008] Kristina Hisami Suzuki, and Achim Ruopp. 2008. Applying mor- phology generation models to machine translation. In ACL-HLT. Toutanova, [Virpioja et al.2007] Sami Virpioja, Jaakko J. Vyrynen, Mathias Creutz, and Markus Sadeniemi. 2007. Morphology-aware statistical machine translation based on morphs induced in an unsupervised manner. In Machine Translation Summit XI. [Wu and Wang2007] Hua Wu and Haifeng Wang. 2007. Pivot language approach for phrase-based statistical machine translation. Machine Translation, 21(3):165 -- 181. [Yang and Kirchhoff2006] Mei Yang and Katrin Kirch- hoff. 2006. Phrase-based backoff models for machine translation of highly inflected languages. In EACL.
1706.03148
1
1706
2017-06-09T22:44:31
Trimming and Improving Skip-thought Vectors
[ "cs.CL" ]
The skip-thought model has been proven to be effective at learning sentence representations and capturing sentence semantics. In this paper, we propose a suite of techniques to trim and improve it. First, we validate a hypothesis that, given a current sentence, inferring the previous and inferring the next sentence provide similar supervision power, therefore only one decoder for predicting the next sentence is preserved in our trimmed skip-thought model. Second, we present a connection layer between encoder and decoder to help the model to generalize better on semantic relatedness tasks. Third, we found that a good word embedding initialization is also essential for learning better sentence representations. We train our model unsupervised on a large corpus with contiguous sentences, and then evaluate the trained model on 7 supervised tasks, which includes semantic relatedness, paraphrase detection, and text classification benchmarks. We empirically show that, our proposed model is a faster, lighter-weight and equally powerful alternative to the original skip-thought model.
cs.CL
cs
Trimming and Improving Skip-thought Vectors Shuai Tang1 Hailin Jin2 Chen Fang2 Zhaowen Wang2 Virginia R. de Sa1 Department of Cognitive Science, UC San Diego 1 Adobe Research 2 {shuaitang93,desa}@ucsd.edu, {hljin, cfang, zhawang}@adobe.com 7 1 0 2 n u J 9 ] L C . s c [ 1 v 8 4 1 3 0 . 6 0 7 1 : v i X r a Abstract The skip-thought model has been proven to be effective at learning sentence rep- resentations and capturing sentence semantics. In this paper, we propose a suite of techniques to trim and improve it. First, we validate a hypothesis that, given a current sentence, inferring the previous and inferring the next sentence provide similar supervision power, therefore only one decoder for predicting the next sentence is preserved in our trimmed skip-thought model. Second, we present a connection layer between encoder and decoder to help the model to generalize better on semantic relatedness tasks. Third, we found that a good word embedding initialization is also essential for learning better sentence representations. We train our model unsupervised on a large corpus with contiguous sentences, and then eval- uate the trained model on 7 supervised tasks, which includes semantic relatedness, paraphrase detection, and text classification benchmarks. We empirically show that, our proposed model is a faster, lighter-weight and equally powerful alternative to the original skip-thought model. 1 Introduction Learning distributed sentence representations is an important and hard topic in both the deep learning and natural language processing communities, since it requires machines to encode a sentence with potential unlimited language content into a fixed-dimension vector filled with continuous values. We are interested in learning to build a distributed sentence encoder in an unsupervised fashion by exploring the structure and relationship in a large unlabelled corpus. Since humans understand sentences by composing from the meanings of the words, we define that learning a sentence encoder should be composed of two essential components, which are learning distributed word representations, and learning how to compose a sentence representation from the representations of words in the given sentence. With the development of deep learning techniques, recurrent neural networks (RNNs) [1, 2, 3] have shown encouraging results on natural language processing (NLP) tasks, and become the dominant methods in processing sequential data. [4] proposed LSTM-based sequence to sequence learning (seq2seq) model for machine translation. Later [5] applied the seq2seq model for unsupervised representation learning on language, and then finetuned the model for supervised tasks. The seq2seq model can be jointly trained to learn the word representation and the composition function on word representations, also it shows encouraging idea that knowledge learned from unsupervised training could be transferred to help other related supervised tasks. [6] proposed the skip-thought model, which is an encoder-decoder model for unsupervised distributed sentence representation learning. The paper exploits the semantic similarity within a tuple of adjacent sentences as a supervision, and successfully built a generic, distributed sentence encoder. Rather than applying the conventional autoencoder model, the skip-thought model tries to reconstruct the surrounding 2 sentences instead of itself. The learned sentence representation encoder outperforms previous unsupervised pretrained models on the evaluation tasks with no finetuning, and the results are comparable to the models which were trained directly on the datasets in a supervised fashion. In this paper, We aim to trim and improve the original skip-thought model by three techniques. First, given the neighborhood hypothesis first proposed in [7], we directly abandon one of the decoders in the skip-thought model, and leave only one encoder and one decoder for learning from inferring the next sentence given the current one. Second, we replace the plain connection used between the encoder and decoder with the Average+Max Connection, which is a non-linear non-parametric feature engineering method proposed by [8] for Stanford Natural Language Inference (SNLI) [9] challenge, and enhances the model to capture more complex interactions among the hidden states. Third, a good initialization for word embeddings boosts the transferability of the model trained in unsupervised fashion, which may raise the importance of the word embeddings in unsupervised learning algorithms. In addition, we show that increasing the dimension of the encoder improves the performance of our proposed model, but still keeps the number of parameters much smaller than the original skip-thought model. Detailed description of our model is described in Section 2. (a) Skip-thought (b) Neighborhood Hypothesis (c) Trimmed Skip-thought Figure 1: The comparison of the previously proposed skip-thought model [6], and our proposed trimmed skip-thought model. Compared to the skip-thought model, our model only needs to recon- struct the next sentence per sample during training, which accelerates the training, and results in fewer parameters. Better view in color. 2 Approach In this section, we present the trimmed skip-thought model. It includes a few simple yet effective modifications from the previously proposed skip-thought model [6]. We first briefly introduce the skip-thought model, and then discuss how to explicitly modify it by incorporating our proposed 3 techniques. 2.1 Skip-thought Model In skip-thought model, given a sentence tuple (si−1, si, si+1), the encoder computes a fixed- dimension vector as the representation zi for the sentence si, which learns a distribution p(zisi; θe), where θe refers to the set of parameters in the encoder. Then, conditioned on the representation zi, two separated decoders are applied to reconstruct the previous sentence si−1, and the next sentence si+1, respectively. We call them previous decoder p(si−1zi; θp) and next decoder p(si+1zi; θn), where θ· denotes the set of parameters in each decoder. An illustration is shown in Figure 1a. Since the two conditional distributions learned from the decoders are parameterized independently, they implicitly utilize the sentence order information within the sentence tuple. Intuitively, given the current sentence si, inferring the previous sentence si−1 is considered to be different from inferring the next sentence si+1. Encoder: The encoder is a recurrent neural network, which is composed of bi-directional gated recurrent unit (GRU) [10], or uni-directional GRU. Suppose sentence si contains N words, which are i, and we regard it w1 as the representation for the previous subsequence through time t. At time N, the hidden state hN i represents the given sentence si, which is zi. Decoder: The decoder is a single-layer recurrent network with conditional GRU. Specifically, compared to GRU, it takes the sentence representation zi as an additional input at each time step. The decoder needs to reconstruct the previous sentence si−1 and the next sentence si+1 given the representation zi. The computation flows for the GRU and the conditional GRU are presented in Table 1. i . At an arbitrary time step t, the encoder produces a hidden state ht i , w2 i , ..., wN 2 (cid:35) GRU (cid:34) = σ(cid:0)Whht−1 + Wxxt(cid:1) ht = tanh(cid:0)Wxt + U(cid:0)rt (cid:12) ht−1(cid:1)(cid:1) mt rt ht = (1 − mt) (cid:12) ht−1 + mt (cid:12) ht (cid:35) Conditional GRU (cid:34) (cid:1) = σ(cid:0)Whht−1 + Wxxt + Wzzi ht = tanh(cid:0)Wxt + U(cid:0)rt (cid:12) ht−1(cid:1) + Uzzi mt rt ht = (1 − mt) (cid:12) ht−1 + mt (cid:12) ht (cid:1) Table 1: Here presents the Gated Recurrent Unit (GRU) [3] and Conditional GRU, omitting the subscript i. xt is the embedding for the word wt i, and zi is the vector representation for sentence si. W· and U· are the parameter matrices, and (cid:12) is the element-wise product. 2.2 Trimming Skip-thought Model by Neighborhood Hypothesis The neighborhood hypothesis was first introduced in [7], and it pointed out that given the current sen- tence, inferring the previous sentence and inferring the next sentence both provide same supervision power. To incorporate the neighborhood hypothesis into the model, we need to modify the skip-thought model. Given si, we assume that inferring si−1 is the same as inferring si+1. If we define si−1, si+1 are two neighbors of si, then the inferring process can be denoted as sj ∼ p(szi; θd), for any j in the neighborhood of si. The conditional distribution learned from the decoder is parameterized by θd. Figure 1b illustrates the neighborhood hypothesis. Furthermore, in our trimmed skip-thought model, for a given sentence si, the decoder needs to reconstruct the sentences in its neighborhood {si−1, si+1}, which are two targets. We denote the inference process as si → {si−1, si+1}. For the next sentence si+1, the inference process is si+1 → {si, si+2}. In other words, for a given sentence pair {si, si+1}, the inference process includes si → si+1 and si+1 → si. In the neighborhood hypothesis [7], the model doesn't distinguish between the sentences in a neighborhood. As a result, an inference process that includes both si → si+1 and si+1 → si is equivalent to an inference process with only one of them. Thus, we define a trimmed skip-thought model with only one target, presented in Figure 1c, and the target is always the next sentence. The objective at each time step is defined as the log-likelihood of the predicted word given the previous words, which is (1) where θe is the set of parameters in the encoder, and θd is the set of parameters in the decoder. The objective function is summed across the whole training corpus, then the objective during training is (cid:96)t i,j(θe, θd) = log p(wt , zi; θe, θd) j jw<t (cid:88) (cid:88) max θe,θd 2.3 Average+Max Connection i t (cid:96)t i,i+1(θe, θd) (2) In skip-thought models [6], only the hidden state at the last time step produced from the RNN encoder is regarded as the vector representation for a given sentence, and serves as the conditional information for the decoder to reconstruct the adjacent 2 sentences. Recently, [9] collected a large corpus, which is SNLI, for textual entailment recognition. Given a sentence pair including premise and hypothesis, the task is to classify the relationship of the sentence pair, entailment, contradiction or neutral. [11] proposed to summarize the hidden states from all time steps computed from a RNN encoder as a sentence representation. While [8] proposed to concatenate the outputs from an average pooling function and a max pooling function, which both run over all time steps, to serve as a sentence representation, and showed a performance boost on the SNLI dataset. The concatenation of an average pooling and a max pooling function is actually a non-parametric composition function, and the computation load is negligible compare to heavy matrix multiplication. Also, the non-linearity of the max pooling function augments the average pooling function for building a representation that captures more complex composition of the context information. Given 3 a sentence si, the encoder produces a set of hidden states [h1 could be represented as zi = i ; maxN n=1 hn i n=1 hn . i ; h2 i ; ...; hN i ], the composition function (cid:104) 1 N (cid:80)N (cid:105) Here, since our goal is to simplify and accelerate the skip-thought model, and also get comparable results on the evaluation tasks, we consider comparing the 2 different composition functions, which are the original one used in the skip-thought model [6], denoted as Plain Connection, and the function proposed by [8], denoted as Average+Max Connection. We hypothesize that the composition function by concatenating two pooling functions will help the model perform better on tasks that involve judging the relationship of a sentence pair, while it is hard to say if the model would benefit from it on the classification benchmark. We will discuss the results in Section 4. 2.4 Word Embeddings Initialization Distributed word embedding matters in the deep learning models that deal with NLP-related tasks. The proposed training methods, such as continuous bag-of-words and skip-gram [12], always serves as strong baseline models for the supervised tasks in NLP. The pretrained word embeddings, including word2vec [13] and GloVe [14], also boosts the model performance on the supervised tasks. We hypothesize that initializing the deep models with pretrained word embeddings is useful for transferring the knowledge from unsupervised learning to the supervised tasks. We choose to initialize the word embedding matrix in the model with word2vec [13], GloVe [14], and the original method of [6] that uses random samples from a uniform distribution, respectively. 3 Experiment Settings The large corpus that we used for unsupervised training is the BookCorpus dataset [15], which contains 74 million sentences from 7000 books in total. All of our experiments were conducted in Torch7 [16]. To make the comparison fair, we follow the encoder design by [6]. Since the comparison among different recurrent units is not our main focus, we decide to work with GRU, which is fast and stable. In addition, [3] shows that, on language modeling tasks, GRU performs as well as the long short-term memory (LSTM) [2]. We also reimplemented the skip-thought model under the same settings, according to [6], and the publicly available theano code 1. We adopted the multi-GPU training scheme from the Facebook's implementation of ResNet2. The experiments with bi-directional encoder and unidirectional encoder were both conducted in [6], and we follow the design of these experiments. For training efficiency, we didn't follow the exact same dimensionality used. In [6], for bi-skip model, the encoder contains a bi-directional GRU with 1200 dimension of each, for uni-skip model, the encoder contains a uni-directional GRU with 2400 dimension, and the decoder is a one-layer with 2400 dimension. In our experiments, except for Section 4.4, the bi-directional encoder contains a forward and a backward GRU of 300 dimension each, and the uni-directional encoder contains a forward GRU of 600 dimension. After training the 2 models with 2 different encoders separately, we concatenate the vectors produced from 2 encoders to form a sentence representation, and evaluate the performance on evaluation tasks. The decoder is a one-layer unidirectional RNN with GRU, and the dimension is 600. The dimension of word embedding is 300. For stable training, we use ADAM [17] algorithm for optimization. The gradient will be cut off to make it within [−1, 1]. For the purpose of fast training, all the sentences were zero-padded or clipped to have the same length. The vocabulary for unsupervised training is set to contain the top 20k most frequent words in BookCorpus. In order to generalize the model trained with relatively small, fixed vocabulary to a large amount of English words, [6] proposed a word expansion method that learns a linear projection from the pretrained word embeddings word2vec [13] to the learned RNN word embeddings. Thus, the model benefits from the generalization ability of the pretrained word embeddings. 1https://github.com/ryankiros/skip-thoughts 2https://github.com/facebook/fb.resnet.torch 4 SICK ρ 0.7649 0.7629 0.7808 0.7618 0.7586 0.7738 r 0.8408 0.8349 0.8518 0.8385 0.8344 0.8492 Model WE bi-T-skip uni-T-skip C-T-skip bi-skip uni-skip C-skip bi-T-skip uni-T-skip C-T-skip bi-T-skip uni-T-skip C-T-skip bi-T-skip uni-T-skip C-T-skip bi-T-skip uni-T-skip C-T-skip bi-skip [6] uni-skip [6] C-skip [6] word2vec word2vec random GloVe word2vec word2vec random 0.8336 0.8293 0.8458 0.8444 0.8485 0.8596 0.8463 0.8466 0.8598 0.8503 0.8486 0.8611 0.8405 0.8477 0.8584 76.1 75.7 76.8 75.7 76.2 77.0 80.3 82.1 83.2 81.4 81.8 83.0 0.2994 0.3084 0.2802 0.3028 0.3098 0.2844 75.3 / 83.0 73.7 / 81.9 75.7 / 83.0 73.9 / 82.0 73.6 / 81.6 74.6 / 82.3 Average+Max Connection 73.2 / 81.3 72.5 / 81.0 74.7 / 82.1 75.1 / 82.4 73.7 / 81.8 75.4 / 82.6 73.3 / 81.6 74.0 / 81.7 75.0 / 82.2 0.3112 0.3180 0.2902 0.2922 0.2854 0.2665 0.2894 0.2884 0.2654 0.7612 0.7555 0.7755 0.7739 0.7711 0.7903 0.7744 0.7705 0.7892 76.0 74.9 76.7 79.5 78.8 80.4 78.6 78.6 80.0 Doubled Encoder's Dimension vs. Results reported by [6] 80.3 78.0 80.3 77.9 79.3 80.1 74.4 / 82.2 74.3 / 82.4 74.5 / 82.2 71.2 / 81.2 73.0 / 81.9 73.0 / 82.0 0.2823 0.2857 0.2634 0.2995 0.2872 0.2687 0.7796 0.7784 0.7946 0.7696 0.7780 0.7916 69.7 67.3 70.4 74.4 74.6 75.6 74.4 73.0 75.1 74.8 72.9 75.4 73.9 75.5 76.5 MSRP (Acc/F1) MR CR SUBJ MPQA TREC MSE Plain Connection 92.3 91.3 92.8 92.1 92.2 92.7 89.6 89.0 90.4 90.9 91.1 91.9 91.3 91.3 92.2 91.8 90.7 92.2 92.5 92.1 93.6 87.5 87.4 88.4 87.2 87.6 87.9 83.5 81.1 83.8 85.3 86.2 87.0 86.2 85.2 87.2 87.0 85.7 87.4 83.3 86.9 87.1 86.6 86.4 87.5 88.4 87.0 89.2 86.6 83.6 84.8 87.6 87.0 89.0 88.8 88.4 90.0 88.2 86.4 88.4 89.4 91.4 92.2 Table 2: The model name is given by encoder type - model type. Bold numbers indicate the best results among the models in each section. Our trimmed skip-thought models slightly outperform the skip-thought models. The model with doubled-sized encoder has average+max connection. 4 Quantitative Evaluation We compared our proposed trimmed skip-thought model with the skip-thought model on 7 evaluation tasks, which include semantic relatedness (SICK) [18], paraphrase detection (MSRP) [19], question- type classification (TREC) [20], and 4 benchmark sentiment and subjective datasets, which includes movie review sentiment (MR) [21], customer product reviews (CR) [22], subjectivity/objectivity classification (SUBJ) [23], and opinion polarity (MPQA) [24]. After unsupervised training on the BookCorpus dataset, we fix the parameters in the encoder, and apply it as a sentence representation extractor on the 7 tasks. For SICK and MSRP tasks, we adopt the feature engineering idea proposed by [25]. For a given sentence pair, the encoder computes a pair of representations, denoted as u and v, and the concate- nation of the component-wise product u · v and the absolute difference u − v is regarded as the feature vector for the given sentence pair. Then we train logistic regression on the feature vector to predict the semantic relatedness score. The evaluation metrics for SICK are Pearson's r, Spearman's ρ, and mean squared error M SE, and the performance is reported as accuracy and F1-score (Acc/F1) for MSRP. The performance on TREC is presented as test accuracy, and 10-fold cross validation is applied to evaluate the model on the MR, CR, SUBJ, and MPQA classification benchmarks. Table 2 presents the models and results, where the model name is given by encoder type - model type. Three types of encoder are denoted as uni-, bi-, and C- in Table 2, and the C- refers to the concatenation of 2 vector representations computed from uni-encoder model and bi-encoder model. -T-skip refers to our trimmed skip-thought model, and -skip refers to the skip-thought model. 5 4.1 Trimmed skip-thought vs. Skip-thought We first compare our trimmed skip-thought model with our implemented skip-thought model, to check the neighborhood hypothesis. In this comparison, all the models use the plain connection, which means that, the sentence representation is the hidden state at the last time step. Table 2 presents the results of 3 trimmed skip-thought models, and 3 of our implemented skip-thought models. From the table, we can tell that our trimmed skip-thought models perform slightly better than the skip-thought models overall, yet not significantly, but the performance on the TREC dataset is worse than the skip-thought models. The general performance comparison between our trimmed skip-thought model and the skip-thought model proves that the neighborhood hypothesis is reasonable, which means that the neighborhood information is effective for distributed sentence representation learning. In addition, our trimmed skip-thought model runs faster in training, since our model only needs to reconstruct its next sentence while the skip-thought model needs to reconstruct its two surrounding sentences. Unlike the results in [7], these models presented in this paper contain word embeddings with lower dimension, which is half of that in [7], and GRUs with much smaller size. Also, our models presented here use word2vec [13] as word embeddings initialization, which is different from random initialization applied in [7]. The results of our implemented skip-thought model differ from those presented in [6], (also presented here in the last section in Table 2), since our implementation contains much fewer parameters than the original skip-thought model, and it has word2vec [13] initialization. Overall, our implementation reaches similar performance on all tasks except Sick. The comparison with the original skip-thought model shows that our implementation of skip-thought model is reasonable. 4.2 Plain Connection vs. Average+Max Connection We further compare the effect of two different connections between the encoder and the decoder. The results are presented in Table 2. As we expected, our proposed trimmed skip-thought model benefits from the Average+Max Connection on judging the relationship of a sentence pair. The performance on SICK task get improved. However, the performance on 2 classification benchmarks, MR and CR, slightly drops, compared to our model with plain connection. The overall performance on the evaluation tasks reaches the results reported in [6] except TREC, which shows that our model with Average+Max Connection could be a fast, lighter-weight alternative to the skip-thought model. See Table 3 for detailed parameter counts. Model uni-T-skip (ours) bi-T-skip (ours) uni-T-skip-double (ours) bi-T-skip-double (ours) uni-skip [6] bi-skip [6] RNNs 4.32M 3.24M 10.8M 6.48M 69.12M 51.84M Embedding Prediction 6M 12M 12.4M 48M Table 3: The table presents the number of parameters in each part of model. RNNs, Embedding and Prediction refer to the recurrent parts, the word embedding, and the linear prediction layer in model. -double means the encoder with GRU with doubled dimension. Our models have much fewer parameters than the skip-thought models, even with the double-sized encoder. 4.3 Word Embedding Initialization The second section in Table 2 presents the comparison among 3 different initializations. After training, we learn a linear mapping from the word2vec 3 embedding space to RNN word embedding space, regardless of what initialization was applied in the model as in [6]. 3https://code.google.com/archive/p/word2vec/ 6 i wish i had a better answer to that question . i had no good answer to that question . i had n't really wanted an answer to that particular question . do you want me to meet you ? alright , where do you want me to meet you ? where can i meet you ? my phone buzzed and i awoke from my trance . my cell phone ringing woke me up with a jolt . my cell phone buzzed in my lap , and i looked down at my text message . my heart was racing so fast that it might explode right out of my chest . my heart was pounding so hard it felt as if it might jump out of my chest . my heart felt like it was going to explode out of my chest . i threw my bag on my bed and took off my shoes . i sat down on my own bed and kicked off my shoes . i fell in bed without bothering to remove my shoes . Table 4: In each section, the first sentence is the query, the second one is the nearest neighbor retrieved from the database, and the third one is the 2nd nearest neighbor. The similarity between every sentence pair is measure by the cosine similarity in the representation space. Generally, the models with pretrained word embeddings as initialization perform better on the evaluation tasks than those with random initialization, which shows that a good initialization for word embeddings helps the model to better transfer knowledge from unsupervised training. One thing worth mentioning here, for the models initialized with GloVe 4, we also trained a linear projection from GloVe word embeddings to the RNN word embeddings. The performance on SICK and MSRP is as good as other models presented in Table 2, but the word expansion from GloVe embeddings gave bad performance on 5 classification benchmarks, so we didn't include the results. 4.4 Doubling Encoder's Dimension In our experiments above, the encoder is either a bi-directional GRU with 300 dimension each or a uni-directional GRU with 600 dimension. With the average+max connection, the dimension of a sentence representation is 1200. We hypothesized that a model with larger encoder size could also improve the performance on evaluation tasks. Hence, we double the dimension of the encoder, which is now either a bi-GRU with 600 dimension each or a uni-GRU with 1200 dimension. As a result, the sentence representation is a 2400-dimension vector, which matches the dimensionality of the representation reported in [6]. Table 2 represents the results. Our trimmed skip-thought models with doubled encoder performs better than the skip-thought models report in [6] on SICK and MSRP, and have comparable results on 4 classification benchmarks. The performance is worse than the original skip-thought model on TREC. The training time and inference time are significantly less than that for the original skip-thought model. The cut down on the training time comes from the neighborhood hypothesis[7] and many fewer parameters in the model. 5 Qualitative Investigation We conduct investigation on our trimmed skip-thought model qualitatively. The model being studied here contains bi-GRU as encoder with 300 dimension of each, one-layer GRU as decoder with 600 dimension, and average+max connection. 5.1 Sentence Retrieval For this task, 1000 sentences were selected as the query set, and 1 million sentences were picked up as the database. All the sentences come from the training corpus. Cosine distance is applied to 4https://nlp.stanford.edu/projects/GloVe/ 7 measure the distance in the representation space. See Table 4 for several samples. Most of retrieved sentences look semantically related and can be viewed as the sentential contextual extension to the query sentences. 5.2 Conditional Sentence Generation i 'm not going to let you go . i 'm not sure if i should be mad at him or not . i did n't want to hear it . i 'm not sure i would ever be able to get her to agree with me . " i 'm not going to be a little girl , " i said . i 'm not sure i could ever be with him . i was n't sure if i was going to be a part of the night or the next day . Table 5: Samples of the generated sentences. The decoder in our trimmed skip-thought model was trained in language modeling fashion, it is reasonable to analyze the sentences generated from the decoder after training. Since the sentence generation process is conditional on the representations produced from the encoder, we first randomly pick up sentences from the training corpus, and forward the model to get the output from the decoder for each of them. Greedy decoding is applied for sentence generation. Table 5 presents the generated sentences. We observe that, the generated sentences tend to start with i 'm not, and i do n't. It might be caused the corpus bias, since there exists a large amount of sentences that start with i 'm not, i do n't, etc. In addition, the decoder is trained to reconstruct the next sentence in the model, which could be think of as a sentential contextual extension of the input sentence, while the generated sentences rarely are related to the associated input sentences, which is same for the skip-thought models. More investigations are needed for the conditional sentence generation. 6 Related Work Previously, [12] proposed the continuous bag-of-words (CBOW) model and the skip-gram model for distributed word representation learning. The main idea is learn a word representation by discovering the context information from the surrounding words. [13] improved the skip-gram model, and empirically showed that additive composition of the learned word representations successfully captures contextual information of phrases and sentences, which is a strong baseline model for NLP tasks. Similarly, [26] proposed a method to learn a fixed-dimension vector for each sentence by predicting the words within the given sentence. However, after training, the representation for a new sentence is hard to derive, since it requires optimizing the sentence representation towards an objective. Recent research in deep learning shows that, the word representation and the their composition could be done at the same time in an end-to-end machine learning system. LSTM-based autoencoder model for language representation learning was proposed by [5]. For a specific dataset, the model first was trained in an unsupervised fashion and then finetuned for the supervised task. The model didn't outperform previous CBOW models significantly, but it shows that knowledge learned through unsupervised pretraining could be transfered to augment the performance on the supervised tasks. The skip-thought model was proposed by [6] for learning a generic, distributed sentence encoder, and its key idea was inspired by the skip-gram model [12]. The results on 8 evaluation tasks are promising with no finetuning on the encoder, and some of the results reach other supervised trained models. In [27], they finetuned the skip-thought models on the SNLI corpus [9], which shows that the skip-thought pretraining scheme is generalizable to other specific NLP tasks. [28] pointed out that the skip-thought model made use of the sentence-level distributional hypothesis [29, 30]. Following the same hypothesis, [28] proposed FastSent model. It takes summation of the word embeddings in a sentence as the sentence representation, and predicts the words in both the previous sentence and the next sentence. It is an simplification of the skip-thought model, which 8 assume the composition function of the words is summation. The results on SICK is comparable with the skip-thought model, while the skip-thought model still outperforms the FastSent model on the other six evaluation tasks. Later, Siamese CBOW [31] aimed to learn the word representations to make the cosine similarity of adjacent sentences in the representation space larger than that of sentences which are not adjacent. The reported comparison with the skip-thought and FastSent models on SICK dataset was convincing that the Siamese CBOW captures better sentence semantics, while no other comparisons on evaluation tasks were reported. Instead of learning to reconstruct the sentences which are adjacent to the current sentence, [32] proposed a model that learns to categorize the manually defined relationships of two input sentences. The model encodes two sentences in two representations, respectively, and the classifier on top of the representations judges 1) whether the two sentences are adjacent to each other, 2) whether the two sentences are in the correct order, and 3) whether the second sentence starts with a conjunction phrase. The proposed model runs faster than the skip-thought model, since it only contains an encoder and no decoder is required. However, only the result on microsoft paraphrase detection task is similar to that of the skip-thought model, and the results on other tasks are not as good. 7 Conclusion We proposed 3 techniques for trimming and also improving the skip-thought model[6], which includes dropping off one decoder, incorporating non-linear non-parametric connection, and initializing with pretrained word vectors. We empirically showed the effectiveness of our proposed techniques. In addition, our proposed trimmed skip-thought model contains much fewer parameters, which runs much faster than skip-thought model. Furthermore, our model could be facilitated by various connection methods between the encoder and the decoder, and benefit from a larger model size. Future research could make use of proposed techniques on unsupervised representation learning, and generalize to more sophisticated model types. Acknowledgments We gratefully thank Jeffrey L. Elman, Benjamin K. Bergen, and Seana Coulson for insightful discussion, and thank Thomas Donoghue, and Reina Mizrahi for suggestive chatting. We also thank Adobe Research Lab for GPUs support, and thank NVIDIA for DGX-1 trial as well as support from NSF IIS 1528214 and NSF SMA 1041755. References [1] J. L. Elman, "Finding structure in time," Cognitive Science, vol. 14, pp. 179–211, 1990. [2] S. Hochreiter and J. Schmidhuber, "Long short-term memory," Neural Computation, vol. 9, pp. 1735–1780, 1997. [3] J. Chung, C. Gulcehre, K. Cho, and Y. Bengio, "Empirical evaluation of gated recurrent neural networks on sequence modeling," arXiv preprint arXiv:1412.3555, 2014. [4] I. Sutskever, O. Vinyals, and Q. V. Le, "Sequence to sequence learning with neural networks," in NIPS, 2014. [5] A. M. Dai and Q. V. Le, "Semi-supervised sequence learning," in NIPS, 2015. [6] J. R. Kiros, Y. Zhu, R. Salakhutdinov, R. S. Zemel, R. Urtasun, A. Torralba, and S. Fidler, "Skip-thought vectors," in NIPS, 2015. [7] S. Tang, H. Jin, C. Fang, Z. Wang, and V. R. de Sa, "Rethinking skip-thought: A neighborhood based approach," in RepL4NLP, ACL Workshop, 2017. [8] Q. Chen, X. Zhu, Z. Ling, S. Wei, and H. Jiang, "Enhancing and combining sequential and tree lstm for natural language inference," arXiv preprint arXiv:1609.06038, 2016. [9] S. R. Bowman, G. Angeli, C. Potts, and C. D. Manning, "A large annotated corpus for learning natural language inference," in EMNLP, 2015. [10] K. Cho, B. van Merrienboer, C. Gulcehre, D. Bahdanau, F. Bougares, H. Schwenk, and Y. Bengio, "Learning phrase representations using rnn encoder-decoder for statistical machine translation," in EMNLP, 2014. 9 [11] A. P. Parikh, O. Tackstrom, D. Das, and J. Uszkoreit, "A decomposable attention model for natural language inference," in EMNLP, 2016. [12] T. Mikolov, K. Chen, G. Corrado, and J. Dean, "Efficient estimation of word representations in vector space," arXiv preprint arXiv:1301.3781, 2013. [13] T. Mikolov, I. Sutskever, K. Chen, G. S. Corrado, and J. Dean, "Distributed representations of words and phrases and their compositionality," in NIPS, 2013. [14] J. Pennington, R. Socher, and C. D. Manning, "Glove: Global vectors for word representation," in EMNLP, 2014. [15] Y. Zhu, R. Kiros, R. S. Zemel, R. Salakhutdinov, R. Urtasun, A. Torralba, and S. Fidler, "Aligning books and movies: Towards story-like visual explanations by watching movies and reading books," ICCV, pp. 19–27, 2015. [16] R. Collobert, K. Kavukcuoglu, and C. Farabet, "Torch7: A matlab-like environment for machine learning," in BigLearn, NIPS Workshop, 2011. [17] D. Kingma and J. Ba, "Adam: A method for stochastic optimization," arXiv preprint arXiv:1412.6980, 2014. [18] M. Marelli, S. Menini, M. Baroni, L. Bentivogli, R. Bernardi, and R. Zamparelli, "A sick cure for the evaluation of compositional distributional semantic models," in LREC, 2014. [19] W. B. Dolan, C. Quirk, and C. Brockett, "Unsupervised construction of large paraphrase corpora: Exploiting massively parallel news sources," in COLING, 2004. [20] X. Li and D. Roth, "Learning question classifiers," in COLING, 2002. [21] B. Pang and L. Lee, "Seeing stars: Exploiting class relationships for sentiment categorization with respect to rating scales," in ACL, 2005. [22] M. Hu and B. Liu, "Mining and summarizing customer reviews," in KDD, 2004. [23] B. Pang and L. Lee, "A sentimental education: Sentiment analysis using subjectivity summa- rization based on minimum cuts," in ACL, 2004. [24] J. Wiebe, T. Wilson, and C. Cardie, "Annotating expressions of opinions and emotions in language," Language Resources and Evaluation, vol. 39, pp. 165–210, 2005. [25] K. S. Tai, R. Socher, and C. D. Manning, "Improved semantic representations from tree- structured long short-term memory networks," in ACL, 2015. [26] Q. V. Le and T. Mikolov, "Distributed representations of sentences and documents," in ICML, 2014. [27] E. Triantafillou, J. R. Kiros, R. Urtasun, and R. Zemel, "Towards generalizable sentence embeddings," in RepL4NLP, ACL Workshop, 2016. [28] F. Hill, K. Cho, and A. Korhonen, "Learning distributed representations of sentences from unlabelled data," in HLT-NAACL, 2016. [29] Z. S. Harris, "Distributional structure," Word, vol. 10, no. 2-3, pp. 146–162, 1954. [30] T. Polajnar, L. Rimell, and S. Clark, "An exploration of discourse-based sentence spaces for compositional distributional semantics," in Workshop on LSDSem, p. 1, 2015. [31] T. Kenter, A. Borisov, and M. de Rijke, "Siamese cbow: Optimizing word embeddings for sentence representations," in ACL, 2016. [32] Y. Jernite, S. R. Bowman, and D. Sontag, "Discourse-based objectives for fast unsupervised sentence representation learning," arXiv preprint arXiv:1705.00557, 2017. 10
1904.01608
2
1904
2019-09-30T16:37:20
Structural Scaffolds for Citation Intent Classification in Scientific Publications
[ "cs.CL" ]
Identifying the intent of a citation in scientific papers (e.g., background information, use of methods, comparing results) is critical for machine reading of individual publications and automated analysis of the scientific literature. We propose structural scaffolds, a multitask model to incorporate structural information of scientific papers into citations for effective classification of citation intents. Our model achieves a new state-of-the-art on an existing ACL anthology dataset (ACL-ARC) with a 13.3% absolute increase in F1 score, without relying on external linguistic resources or hand-engineered features as done in existing methods. In addition, we introduce a new dataset of citation intents (SciCite) which is more than five times larger and covers multiple scientific domains compared with existing datasets. Our code and data are available at: https://github.com/allenai/scicite.
cs.CL
cs
Structural Scaffolds for Citation Intent Classification in Scientific Publications Arman Cohan Waleed Ammar Allen Institute for Artificial Intelligence Madeleine van Zuylen {armanc,waleeda,madeleinev,fieldc}@allenai.org Field Cady 9 1 0 2 p e S 0 3 ] L C . s c [ 2 v 8 0 6 1 0 . 4 0 9 1 : v i X r a Abstract Identifying the intent of a citation in sci- entific papers (e.g., background information, use of methods, comparing results) is criti- cal for machine reading of individual publi- cations and automated analysis of the scien- tific literature. We propose structural scaf- folds, a multitask model to incorporate struc- tural information of scientific papers into ci- tations for effective classification of citation intents. Our model achieves a new state-of- the-art on an existing ACL anthology dataset (ACL-ARC) with a 13.3% absolute increase in F1 score, without relying on external lin- guistic resources or hand-engineered features as done in existing methods. In addition, we introduce a new dataset of citation intents (Sci- Cite) which is more than five times larger and covers multiple scientific domains compared with existing datasets. Our code and data are available at: https://github.com/ allenai/scicite. 1 Introduction Citations play a unique role in scientific discourse and are crucial for understanding and analyzing scientific work (Luukkonen, 1992; Leydesdorff, 1998). They are also typically used as the main measure for assessing impact of scientific pub- lications, venues, and researchers (Li and Ho, 2008). The nature of citations can be different. Some citations indicate direct use of a method while some others merely serve as acknowledg- ing a prior work. Therefore, identifying the in- tent of citations (Figure 1) is critical in improving automated analysis of academic literature and sci- entific impact measurement (Leydesdorff, 1998; Small, 2018). Other applications of citation in- tent classification are enhanced research experi- ence (Moravcsik and Murugesan, 1975), informa- tion retrieval (Ritchie, 2009), summarization (Co- Figure 1: Example of citations with different (BACKGROUND and METHOD). intents han and Goharian, 2015), and studying evolution of scientific fields (Jurgens et al., 2018). In this work, we approach the problem of ci- tation intent classification by modeling the lan- guage expressed in the citation context. A ci- tation context includes text spans in a citing pa- per describing a referenced work and has been shown to be the primary signal in intent classifi- cation (Teufel et al., 2006; Abu-Jbara et al., 2013; Jurgens et al., 2018). Existing models for this problem are feature-based, modeling the citation context with respect to a set of predefined hand- engineered features (such as linguistic patterns or cue phrases) and ignoring other signals that could improve prediction. In this paper we argue that better representa- tions can be obtained directly from data, sidestep- ping problems associated with external features. To this end, we propose a neural multitask learn- ing framework to incorporate knowledge into ci- tations from the structure of scientific papers. In particular, we propose two auxiliary tasks as struc- tural scaffolds to improve citation intent predic- tion:1 (1) predicting the section title in which the citation occurs and (2) predicting whether a sen- tence needs a citation. Unlike the primary task of citation intent prediction, it is easy to collect large 1We borrow the scaffold terminology from Swayamdipta et al. (2018) in the context of multitask learning. ….A previously described comp-uterizedforce sensitive system was used to quantify gait cycle timing, specifically the swing time and the stride-to-stride variability of swing time (Bazneret al. 2000). ….Title: Gait asymmetry in patients with Parkinson's disease and elderly fallers ...Citing papermethodbackgroundBazneret al. 2000 Springer et al. 2006Citedpapers… Further details are included in the earlier reports (Springer et al. 2006). …. tation context relevant to C. We encode the to- kens in the citation context of size n as x = {x1, ..., xn}, where xi ∈ Rd1 is a word vector of size d1 which concatenates non-contextualized word representations (GloVe, Pennington et al., 2014) and contextualized embeddings (ELMo, Pe- ters et al., 2018), i.e.: xi =(cid:2)xGloVe i ; xELMo i (cid:3) We then use a bidirectional long short-term mem- ory (Hochreiter and Schmidhuber, 1997) (BiL- STM) network with hidden size of d2 to obtain a contextual representation of each token vector with respect to the entire sequence:2 ←−−−− LSTM(x, i)(cid:3), hi =(cid:2)−−−−→ LSTM(x, i); −−−−→ where h ∈ R(n,2d2) and LSTM(x, i) processes x from left to write and returns the LSTM hidden state at position i (and vice versa for the backward ←−−−− direction LSTM). We then use an attention mech- anism to get a single vector representing the whole input sequence: n(cid:88) z = αihi, αi = softmax(w(cid:62)hi), i=1 where w is a parameter served as the query vec- tor for dot-product attention.3 So far we have ob- tained the citation representation as a vector z. Next, we describe our two proposed structural scaffolds for citation intent prediction. 2.1 Structural scaffolds In scientific writing there is a connection between the structure of scientific papers and the intent of citations. To leverage this connection for more ef- fective classification of citation intents, we pro- pose a multitask framework with two structural scaffolds (auxiliary tasks) related to the structure of scientific documents. A key point for our pro- posed scaffolds is that they do not need any addi- tional manual annotation as labels for these tasks occur naturally in scientific writing. The structural scaffolds in our model are the following: 2In our experiments BiGRUs resulted in similar perfor- mance. 3We also experimented BiLSTMs without attention; we found that BiLSTMs/BiGRUs along with attention provided best results. Other types of attention such as additive atten- tion result in similar performance. Figure 2: Our proposed scaffold model for identifying ci- tation intents. The main task is predicting the citation intent (top left) and two scaffolds are predicting the section title and predicting if a sentence needs a citation (citation worthiness). amounts of training data for scaffold tasks since the labels naturally occur in the process of writ- ing a paper and thus, there is no need for manual annotation. On two datasets, we show that the pro- posed neural scaffold model outperforms existing methods by large margins. Our contributions are: (i) we propose a neu- ral scaffold framework for citation intent classi- fication to incorporate into citations knowledge from structure of scientific papers; (ii) we achieve a new state-of-the-art of 67.9% F1 on the ACL- ARC citations benchmark, an absolute 13.3% in- crease over the previous state-of-the-art (Jurgens et al., 2018); and (iii) we introduce SciCite, a new dataset of citation intents which is at least five times as large as existing datasets and covers a va- riety of scientific domains. 2 Model We propose a neural multitask learning framework for classification of citation intents. In particu- lar, we introduce and use two structural scaffolds, auxiliary tasks related to the structure of scientific papers. The auxiliary tasks may not be of inter- est by themselves but are used to inform the main task. Our model uses a large auxiliary dataset to incorporate this structural information available in scientific documents into the citation intents. The overview of our model is illustrated in Figure 2. Let C denote the citation and x denote the ci- Input citationMLPMLPMLPCitation intentSection titleCitation worthinessshared parametersWord representationGloVe-ELMoMain taskTask specific parametersBiLSTMBiLSTMBiLSTMBiLSTMz𝑥"𝑥#𝑥$𝑥%ℒ"ℒ#ℒ$ℒAttentionwScaffolds Citation worthiness. The first scaffold task that we consider is "citation worthiness" of a sentence, indicating whether a sentence needs a citation. The language expressed in citation sentences is likely distinctive from regular sentences in scien- tific writing, and such information could also be useful for better language modeling of the citation contexts. To this end, using citation markers such as "[12]" or "Lee et al (2010)", we identify sen- tences in a paper that include citations and the neg- ative samples are sentences without citation mark- ers. The goal of the model for this task is to predict whether a particular sentence needs a citation.4 Section title. The second scaffold task relates to predicting the section title in which a citation appears. Scientific documents follow a standard structure where the authors typically first intro- duce the problem, describe methodology, share re- sults, discuss findings and conclude the paper. The intent of a citation could be relevant to the section of the paper in which the citation appears. For ex- ample, method-related citations are more likely to appear in the methods section. Therefore, we use the section title prediction as a scaffold for pre- dicting citation intents. Note that this scaffold task is different than simply adding section title as an additional feature in the input. We are using the section titles from a larger set of data than training data for the main task as a proxy to learn linguis- tic patterns that are helpful for citation intents. In particular, we leverage a large number of scientific papers for which the section information is known for each citation to automatically generate large amounts of training data for this scaffold task.5 Multitask formulation. Multitask learning as defined by Caruana (1997) is an approach to in- ductive transfer learning that improves generaliza- tion by using the domain information contained in the training signals of related tasks as an induc- tive bias. It requires the model to have at least some sharable parameters between the tasks. In a general setting in our model, we have a main task T ask(1) and n − 1 auxiliary tasks T ask(i). As shown in Figure 2, each scaffold task will have its task-specific parameters for effective classifica- 4We note that this task may also be useful for helping au- thors improve their paper drafts. However, this is not the fo- cus of this work. 5We also experimented with adding section titles as addi- tional feature to the input, however, it did not result in any improvements. tion and the parameters for the lower layers of the network are shared across tasks. We use a Multi Layer Perceptron (MLP) for each task and then a softmax layer to obtain prediction probabilites. In particular, given the vector z we pass it to n MLPs and obtain n output vectors y(i): y(i) = softmax(MLP(i)(z)) We are only interested in the output y(1) and the rest of outputs (y(2), ..., y(n)) are regarding the scaffold tasks and only used in training to inform the model of knowledge in the structure of the sci- entific documents. For each task, we output the class with the highest probability in y. An alterna- tive inference method is to sample from the output distribution. 2.2 Training Let D1 be the labeled dataset for the main task T ask(1), and Di denote the labeled datasets cor- responding to the scaffold task T ask(i) where i ∈ {2, ..., n}. Similarly, let L1 and Li be the main loss and the loss of the auxiliary task i, respec- tively. The final loss of the model is: L = L1(x, y) + λi Li(x, y), (1) (cid:88) (x,y)∈D1 n(cid:88) i=2 (cid:88) (x,y)∈Di where λi is a hyper-parameter specifying the sen- sitivity of the parameters of the model to each spe- cific task. Here we have two scaffold tasks and hence n=3. λi could be tuned based on perfor- mance on validation set (see §4 for details). We train this model jointly across tasks and in an end-to-end fashion. In each training epoch, we construct mini-batches with the same number of instances from each of the n tasks. We compute the total loss for each mini-batch as described in Equation 1, where Li=0 for all instances of other tasks j(cid:54)=i. We compute the gradient of the loss for each mini-batch and tune model parameters using the AdaDelta optimizer (Zeiler, 2012) with gradi- ent clipping threshold of 5.0. We stop training the model when the development macro F1 score does not improve for five consecutive epochs. 3 Data We compare our results on two datasets from dif- ferent scientific domains. While there has been a long history of studying citation intents, there are only a few existing publicly available datasets on Intent cateogry Definition Example Background information The citation states, mentions, or points to the background information giving more context about a problem, concept, approach, topic, or importance of the problem in the field. Method Making use of a method, tool, approach or dataset Result comparison Comparison of the paper's results/findings with the results/findings of other work Recent evidence suggests that co-occurring alexithymia may explain deficits [12]. Locally high-temperature melting regions can act as permanent termination sites [6-9]. One line of work is focused on changing the objective function (Mao et al., 2016). Fold differences were calculated by a mathematical model described in [4]. We use Orthogonal Initialization (Saxe et al., 2014) Weighted measurements were superior to T2-weighted contrast imaging which was in accordance with former studies [25-27] Similar results to our study were reported in the study of Lee et al (2010). Table 1: The definition and examples of citation intent categories in our SciCite. Source #papers #instances 3.2 SciCite dataset Most existing datasets contain citation categories that are too fine-grained. Some of these intent cat- egories are very rare or not useful in meta analy- sis of scientific publications. Since some of these fine-grained categories only cover a minimal per- centage of all citations, it is difficult to use them to gain insights or draw conclusions on impacts of papers. Furthermore, these datasets are usually domain-specific and are relatively small (less than 2,000 annotated citations). To address these limitations, we introduce Sci- Cite, a new dataset of citation intents that is sig- nificantly larger, more coarse-grained and general- domain compared with existing datasets. Through examination of citation intents, we found out many of the categories defined in previous work such as motivation, extension or future work, can be considered as background information providing more context for the current research topic. More interesting intent categories are a direct use of a method or comparison of results. Therefore, our dataset provides a concise annotation scheme that is useful for navigating research topics and ma- chine reading of scientific papers. We consider three intent categories outlined in Table 1: BACK- GROUND, METHOD and RESULTCOMPARISON. Below we describe data collection and annotation details. 3.2.1 Data collection and annotation Citation intent of sentence extractions was la- beled through the crowdsourcing platform Figure Eight.6 We selected a sample of papers from the Semantic Scholar corpus,7 consisting of papers in general computer science and medicine domains. Citation contexts were extracted using science- 6https://www.figure-eight.com/ platform/ 7https://semanticscholar.org/ Dataset Categories (distribution) ACL-ARC Background (0.51) Extends (0.04) Uses (0.19) Motivation (0.05) Compare/Contrast (0.18) Future work (0.04) Background (0.58) Method (0.29) Result comparison (0.13) SciCite Computational Linguistics 186 1,941 6,627 11,020 Computer Science & Medicine Table 2: Characteristics of SciCite compared with ACL-ARC dataset by Jurgens et al. (2018) the task of citation intent classification. We use the most recent and comprehensive (ACL-ARC cita- tions dataset) by Jurgens et al. (2018) as a bench- mark dataset to compare the performance of our model to previous work. In addition, to address the limited scope and size of this dataset, we intro- duce SciCite, a new dataset of citation intents that addresses multiple scientific domains and is more than five times larger than ACL-ARC. Below is a description of both datasets. 3.1 ACL-ARC citations dataset ACL-ARC is a dataset of citation intents released by Jurgens et al. (2018). The dataset is based on a sample of papers from the ACL Anthology Refer- ence Corpus (Bird et al., 2008) and includes 1,941 citation instances from 186 papers and is anno- tated by domain experts in the NLP field. The data was split into three standard stratified sets of train, validation, and test with 85% of data used for training and remaining 15% divided equally for validation and test. Each citation unit includes information about the immediate citation context, surrounding context, as well as information about the citing and cited paper. The data includes six intent categories outlined in Table 2. parse.8 The annotators were asked to identify the intent of a citation, and were directed to select among three citation intent options: METHOD, RESULTCOMPARISON and BACKGROUND. The annotation interface also included a dummy op- tion OTHER which helps improve the quality of annotations of other categories. We later removed instances annotated with the OTHER option from our dataset (less than 1% of the annotated data), many of which were due to citation contexts which are incomplete or too short for the annotator to in- fer the citation intent. We used 50 test questions annotated by a do- main expert to ensure crowdsource workers were following directions and disqualify annotators with accuracy less than 75%. Furthermore, crowd- source workers were required to remain on the an- notation page (five annotations) for at least ten sec- onds before proceeding to the next page. Annota- tions were dynamically collected. The annotations were aggregated along with a confidence score de- scribing the level of agreement between multiple crowdsource workers. The confidence score is the agreement on a single instance weighted by a trust score (accuracy of the annotator on the initial 50 test questions). To only collect high quality annotations, in- stances with confidence score of ≤0.7 were dis- carded. In addition, a subset of the dataset with 100 samples was re-annotated by a trained, expert annotator to check for quality, and the agreement rate with crowdsource workers was 86%. Cita- tion contexts were annotated by 850 crowdsource workers who made a total of 29,926 annotations and individually made between 4 and 240 annota- tions. Each sentence was annotated, on average, 3.74 times. This resulted in a total 9,159 crowd- sourced instances which were divided to training and validation sets with 90% of the data used for the training set. In addition to the crowdsourced data, a separate test set of size 1,861 was anno- tated by a trained, expert annotator to ensure high quality of the dataset. 3.3 Data for scaffold tasks For the first scaffold (citation worthiness), we sample sentences from papers and consider the sentences with citations as positive labels. We also remove the citation markers from those sentences 8https://github.com/allenai/ science-parse such as numbered citations (e.g., [1]) or name-year combinations (e.g, Lee et al (2012)) to not make the second task artificially easy by only detecting citation markers. For the second scaffold (cita- tion section title), respective to each test dataset, we sample citations from the ACL-ARC corpus and Semantic Scholar corpus9 and extract the ci- tation context as well as their corresponding sec- tions. We manually define regular expression pat- terns mappings to normalized section titles: "in- troduction", "related work", "method", "experi- ments", "conclusion". Section titles which did not map to any of the aforementioned titles were ex- cluded from the dataset. Overall, the size of the data for scaffold tasks on the ACL-ARC dataset is about 47K (section title scaffold) and 50K (ci- tation worthiness) while on SciCite is about 91K and 73K for section title and citation worthiness scaffolds, respectively. 4 Experiments 4.1 Implementation We implement our proposed scaffold framework using the AllenNLP library (Gardner et al., 2018). For word representations, we use 100-dimensional GloVe vectors (Pennington et al., 2014) trained on a corpus of 6B tokens from Wikipedia and Gi- gaword. For contextual representations, we use ELMo vectors released by Peters et al. (2018)10 with output dimension size of 1,024 which have been trained on a dataset of 5.5B tokens. We use a single-layer BiLSTM with a hidden dimen- sion size of 50 for each direction11. For each of scaffold tasks, we use a single-layer MLP with 20 hidden nodes , ReLU (Nair and Hinton, 2010) activation and a Dropout rate (Srivastava et al., 2014) of 0.2 between the hidden and input lay- ers. The hyperparameters λi are tuned for best performance on the validation set of the respective datasets using a 0.0 to 0.3 grid search. For exam- ple, the following hyperparameters are used for the ACL-ARC. Citation worthiness saffold: λ2=0.08, λ3=0, section title scaffold: λ3=0.09, λ2=0; both scaffolds: λ2=0.1, λ3=0.05. Batch size is 8 for ACL-ARC dataset and 32 for SciCite dataset (re- call that SciCite is larger than ACL-ARC). We 9https://semanticscholar.org/ 10https://allennlp.org/elmo 11Experiments with other types of RNNs such as BiGRUs and more layers showed similar or slightly worst performance use Beaker12 for running the experiments. On the smaller dataset, our best model takes approxi- mately 30 minutes per epoch to train (training time without ELMo is significantly faster). It is known that multiple runs of probabilistic deep learn- ing models can have variance in overall scores (Reimers and Gurevych, 2017)13. We control this by setting random-number generator seeds; the re- ported overall results are average of multiple runs with different random seeds. To facilitate repro- ducibility, we release our code, data, and trained models.14 4.2 Baselines We compare our results to several baselines in- cluding the model with state-of-the-art perfor- mance on the ACL-ARC dataset. • BiLSTM Attention (with and without ELMo). This baseline uses a similar architecture to our proposed neural multitask learning framework, except that it only optimizes the network for the main loss regarding the citation intent classifi- cation (L1) and does not include the structural scaffolds. We experiment with two variants of this model: with and without using the contex- tualized word vector representations (ELMo) of Peters et al. (2018). This baseline is useful for evaluating the effect of adding scaffolds in con- trolled experiments. • Jurgens et al. (2018). To make sure our results are competitive with state-of-the-art results on this task, we also compare our model to Jur- gens et al. (2018) which has the best reported results on the ACL-ARC dataset. Jurgens et al. (2018) incorporate a variety of features, ranging from pattern-based features to topic-modeling features, to citation graph features. They also incorporate section titles and relative section po- sition in the paper as features. Our implemen- tation of this model achieves a macro-averaged F1 score of 0.526 using 10-fold cross-validation, which is in line with the highest reported results in Jurgens et al. (2018): 0.53 using leave-one- out cross validation. We were not able to use 12Beaker is a collaborative platform for reproducible re- search (https://github.com/allenai/beaker) 14https://github.com/allenai/scicite 13Some CuDNN methods are and the rest are only deterministic under underlying nvidia.com/deeplearning/sdk/pdf/ cuDNN-Developer-Guide.pdf hardware. See non-deterministic the same https://docs. Model macro F1 s BiLSTM-Attn e n i l e s a B BiLSTM-Attn w/ ELMo Previous SOTA (Jurgens et al., 2018) k BiLSTM-Attn + section title scaffold r o w s i h T BiLSTM-Attn + citation worthiness scaffold BiLSTM-Attn + both scaffolds BiLSTM-Attn w/ ELMo + both scaffolds 51.8 54.3 54.6 56.9 56.3 63.1 67.9 Table 3: Results on the ACL-ARC citations dataset. leave-one-out cross validation in our experiments since it is impractical to re-train each variant of our deep learning models thousands of times. Therefore, we opted for a standard setup of strati- fied train/validation/test data splits with 85% data used for training and the rest equally split be- tween validation and test. 4.3 Results Our main results for the ACL-ARC dataset (Jur- gens et al., 2018) is shown in Table 3. We observe that our scaffold-enhanced models achieve clear improvements over the state-of-the-art approach on this task. Starting with the 'BiLSTM-Attn' baseline with a macro F1 score of 51.8, adding the first scaffold task in 'BiLSTM-Attn + section title scaffold' improves the F1 score to 56.9 (∆=5.1). Adding the second scaffold in 'BiLSTM-Attn + ci- tation worthiness scaffold' also results in similar improvements: 56.3 (∆=4.5). When both scaf- folds are used simultaneously in 'BiLSTM-Attn + both scaffolds', the F1 score further improves to 63.1 (∆=11.3), suggesting that the two tasks pro- vide complementary signal that is useful for cita- tion intent prediction. The best result is achieved when we also add ELMo vectors (Peters et al., 2018) to the input rep- resentations in 'BiLSTM-Attn w/ ELMo + both scaffolds', achieving an F1 of 67.9, a major im- provement from the previous state-of-the-art re- sults of Jurgens et al. (2018) 54.6 (∆=13.3). We note that the scaffold tasks provide major con- tributions on top of the ELMo-enabled baseline (∆=13.6), demonstrating the efficacy of using structural scaffolds for citation intent prediction. We note that these results were obtained without using hand-curated features or additional linguis- tic resources as used in Jurgens et al. (2018). We also experimented with adding features used in Ju- rgens et al. (2018) to our best model and not only we did not see any improvements, but we observed Model macro F1 s BiLSTM-Attn e n i l e s a B BiLSTM-Attn w/ ELMo Previous SOTA (Jurgens et al., 2018) k BiLSTM-Attn + section title scaffold r o w s i h T BiLSTM-Attn + citation worthiness scaffold BiLSTM-Attn + both scaffolds BiLSTM-Attn w/ ELMo + both scaffolds Table 4: Results on the SciCite dataset. 77.2 82.6 79.6 77.8 78.1 79.1 84.0 at least 1.7% decline in performance. This sug- gests that these additional manual features do not provide the model with any additional useful sig- nals beyond what the model already learns from the data. Table 4 shows the main results on SciCite dataset, where we see similar patterns. Each scaf- fold task improves model performance. Adding both scaffolds results in further improvements. And the best results are obtained by using ELMo representation in addition to both scaffolds. Note that this dataset is more than five times larger in size than the ACL-ARC, therefore the perfor- mance numbers are generally higher and the F1 gains are generally smaller since it is easier for the models to learn optimal parameters utilizing the larger annotated data. On this dataset, the best baseline is the neural baseline with addition of ELMo contextual vectors achieving an F1 score of 82.6 followed by Jurgens et al. (2018), which is expected because neural models generally achieve higher gains when more training data is available and because Jurgens et al. (2018) was not designed with the SciCite dataset in mind. The breakdown of results by intent on ACL- ARC and SciCite datasets is respectively shown in Tables 5 and 6. Generally we observe that results on categories with more number of instances are higher. For example on ACL-ARC, the results on the BACKGROUND category are the highest as this category is the most common. Conversely, the re- sults on the FUTUREWORK category are the low- est. This category has the fewest data points (see distribution of the categories in Table 2) and thus it is harder for the model to learn the optimal pa- rameters for correct classification in this category. 4.4 Analysis To gain more insight into why the scaffolds are helping the model in improved citation intent clas- sification, we examine the attention weights as- signed to inputs for our best proposed model (a) Example from ACL-ARC: Correct label is FUTUREWORK. Our model correctly predicts it while baseline predicts COMPARE. (b) Example from SciCite: Correct label is RESULTCOMPARISON; our model correctly predicts it, while baseline considers it as BACKGROUND. Figure 3: Visualization of attention weights corresponding to our best scaffold model compared with the best baseline neural baseline model without scaffolds. ('BiLSTM-Attn w/ ELMo + both scaffolds') com- pared with the best neural baseline ('BiLSTM- Attn w/ ELMO'). We conduct this analysis for examples from both datasets. Figure 3 shows an example input citation along with the horizontal line and the heatmap of attention weights for this input resulting from our model versus the base- line. For first example (3a) the true label is FU- TUREWORK. We observe that our model puts more weight on words surrounding the word "fu- ture" which is plausible given the true label. On the other hand, the baseline model attends most to the words "compare" and consequently incor- rectly predicts a COMPARE label. In second exam- ple (3b) the true label is RESULTCOMPARISON. The baseline incorrectly classifies it as a BACK- GROUND, likely due to attending to another part of the sentence ("analyzed seprately"). Our model correctly classifies this instance by putting more attention weights on words that relate to compari- son of the results. This suggests that the our model is more successful in learning optimal parameters for representing the citation text and classifying its respective intent compared with the baseline. Note that the only difference between our model and the neural baseline is inclusion of the structural scaf- folds. Therefore, suggesting the effectiveness the scaffolds in informing the main task of relevant signals for citation intent classification. Error analysis. We next investigate errors made by our best model (Figure 4 plots classification er- rors). One general error pattern is that the model has more tendency to make false positive errors in the BACKGROUND category likely due to this category dominating both datasets. It's interest- ing that for the ACL-ARC dataset some prediction this workApossiblefuturedirectionwouldbetocomparethequerystringtoretrievedresultsusingamethodsimilartothatofTsuruokaandTsujii(2003).baselinethis workMoreover,inouranalyses,theantibodyresponsestovaccinationwerealsoanalyzedseparatelyandour12-weekfollow-uptorecordtheimmuneresponsetovaccinationwasmuchlongerthanthosereportedfrompreviousstudieswherereductioninbaseline Category (# instances) Background (71) Compare (25) Extension (5) Future (5) Motivation (7) Use (26) Average (Macro) P R F1 P R F1 P R F1 P R F1 P R F1 P R F1 P R F1 50.0 40.0 44.4 33.3 40.0 36.4 78.6 77.5 78.0 44.8 52.0 48.1 BiLSTM-Attn 66.7 40.0 50.0 33.3 40.0 36.4 76.5 87.3 81.6 59.1 52.0 55.3 BiLSTM-Attn w/ ELMo 75.6 87.3 81.1 70.6 48.0 57.1 66.7 40.0 50.0 50.0 20.0 28.6 Previous SOTA (Jurgens et al., 2018) 77.2 85.9 81.3 53.8 56.0 54.9 100.0 40.0 57.1 33.3 40.0 36.4 BiLSTM-Attn+section title scaffold BiLSTM-Attn+citation worthiness scaffold 77.1 90.1 83.1 59.1 52.0 55.3 100.0 40.0 57.1 28.6 40.0 33.3 77.6 93.0 84.6 65.0 52.0 57.8 100.0 60.0 75.0 40.0 40.0 40.0 BiLSTM-Attn+both scaffolds 75.9 93.0 83.5 80.0 64.0 71.1 BiLSTM-Attn+both scaffolds /w ELMo 50.0 28.6 36.4 65.4 65.4 65.4 53.7 50.6 50.0 28.6 36.4 69.6 61.5 65.3 59.2 51.6 75.0 42.9 54.6 51.6 61.5 56.1 64.9 49.9 50.0 28.6 36.4 81.8 69.2 75.0 66.0 53.3 50.0 28.6 36.4 81.0 65.4 72.3 66.0 52.7 75.0 42.9 54.5 72.7 61.5 66.7 71.7 58.2 75.0 60.0 66.7 75.0 60.0 66.7 100.0 28.6 44.4 81.8 69.2 75.0 81.3 62.5 51.5 54.2 54.6 56.9 56.3 63.1 67.9 Table 5: Detailed per category classification results on ACL-ARC dataset. Category (# instances) Background (1,014) Method (613) Result (260) Average (Macro) BiLSTM-Attn BiLSTM-Attn w/ ELMo Previous SOTA (Jurgens et al., 2018) BiLSTM-Attn + section title scaffold BiLSTM-Attn + citation worthiness scaffold BiLSTM-Attn + both scaffolds BiLSTM-Attn w/ ELMo + both scaffolds P 82.2 86.6 77.9 81.3 82.9 85.4 85.4 R 83.2 87 92.9 86.0 84.8 80.8 90.3 F1 82.7 86.8 84.7 83.6 83.8 83.0 87.8 P 80.7 87.2 91.5 85.3 84.6 78.6 89.5 R 74.4 79.1 63.1 68.8 73.2 80.4 80.8 F1 77.4 83.0 74.7 76.2 78.5 79.5 84.9 P 67.1 71.5 79.1 66.8 65.4 69.8 79.3 R 76.2 85.8 77.3 81.9 80.0 80.8 79.6 F1 71.4 78.0 78.2 73.6 72.0 74.9 79.5 P 76.7 81.8 82.8 77.8 77.6 77.9 84.7 R 77.9 84.0 77.8 78.9 79.3 80.7 83.6 F1 77.2 82.6 79.2 77.8 78.1 79.1 84.0 Table 6: Detailed per category classification results on the SciCite dataset. Example True Prediction Our work is inspired by the latent left-linking model in (CITATION) and the ILP formulation from (CITATION). MOTIVATION USE ASARES is presented in detail in (CITATION) . USE BACKGROUND The advantage of tuning similarity to the application of interest has been shown previously by (CITATION). COMPARE BACKGROUND One possible direction is to consider linguistically mo- tivated approaches , such as the extraction of syntactic phrase tables as proposed by (CITATION). FUTUREWORK BACKGROUND After the extraction, pruning techniques (CITATION) can be applied to increase the precision of the extraction. BACKGROUND USE Table 7: A sample of model's classification errors on ACL-ARC dataset errors are due to the model failing to properly dif- ferentiate the USE category with BACKGROUND. We found out that some of these errors would have been possibly prevented by using additional con- text. Table 7 shows a sample of such classifica- tion errors. For the citation in the first row of the table, the model is likely distracted by "model in (citation)" and "ILP formulation from (citation)" deeming the sentence is referring to the use of an- other method from a cited paper and it misses the first part of the sentence describing the motivation. This is likely due to the small number of training instances in the MOTIVATION category, prevent- ing the model to learn such nuances. For the exam- ples in the second and third row, it is not clear if it is possible to make the correct prediction without additional context. And similarly in the last row the instance seems ambiguous without accessing to additional context. Similarly as shown in Fig- ure 4a two of FUTUREWORK labels are wrongly classified. One of them is illustrated in the forth row of Table 7 where perhaps additional context could have helped the model in identifying the cor- rect label. One possible way to prevent this type of errors, is to provide the model with an additional input, modeling the extended surrounding context. We experimented with encoding the extended sur- rounding context using a BiLSTM and concatenat- ing it with the main citation context vector (z), but it resulted in a large decline in overall performance likely due to the overall noise introduced by the additional context. A possible future work is to investigate alternative effective approaches for in- corporating the surrounding extended context. 5 Related Work There is a large body of work studying the intent of citations and devising categorization systems (Stevens and Giuliano, 1965; Moravcsik and Mu- rugesan, 1975; Garzone and Mercer, 2000; White, 2004; Ahmed et al., 2004; Teufel et al., 2006; Agarwal et al., 2010; Dong and Schafer, 2011). Most of these efforts provide citation categories that are too fine-grained, some of which rarely oc- cur in papers. Therefore, they are hardly useful for automated analysis of scientific publications. To address these problems and to unify previous model for citation intent classification to incorpo- rate structural information of scientific discourse into citations, borrowing the "scaffold" terminol- ogy from Swayamdipta et al. (2018) who use aux- iliary syntactic tasks for semantic problems. 6 Conclusions and future work In this work, we show that structural properties related to scientific discourse can be effectively used to inform citation intent classification. We propose a multitask learning framework with two auxiliary tasks (predicting section titles and cita- tion worthiness) as two scaffolds related to the main task of citation intent prediction. Our model achieves state-of-the-art result (F1 score of 67.9%) on the ACL-ARC dataset with 13.3 absolute in- crease over the best previous results. We addition- ally introduce SciCite, a new large dataset of cita- tion intents and also show the effectiveness of our model on this dataset. Our dataset, unlike exist- ing datasets that are designed based on a specific domain, is more general and fits in scientific dis- course from multiple scientific domains. We demonstrate that carefully chosen auxiliary tasks that are inherently relevant to a main task can be leveraged to improve the performance on the main task. An interesting line of future work is to explore the design of such tasks or explore the properties or similarities between the auxiliary and the main tasks. Another relevant line of work is adapting our model to other domains containing documents with similar linked structured such as Wikipedia articles. Future work may benefit from replacing ELMo with other types of contextual- ized representations such as BERT in our scaffold model. For example, at the time of finalizing the camera ready version of this paper, Beltagy et al. (2019) showed that a BERT contextualized repre- sentation model (Devlin et al., 2018) trained on scientific text can achieve promising results on the SciCite dataset. Acknowledgments We thank Kyle Lo, Dan Weld, and Iz Beltagy for helpful discussions, Oren Etzioni for feed- back on the paper, David Jurgens for helping us with their ACL-ARC dataset and reproducing their results, and the three anonymous reviewers for their comments and suggestions. Computations on beaker.org were supported in part by credits from Google Cloud. (a) ACL-ARC (test size: 139) (b) SciCite (test size: 1,861) Figure 4: Confusion matrix showing classification er- rors of our best model on two datasets. The diagonal is masked to bring focus only on errors. efforts, in a recent work, Jurgens et al. (2018) proposed a six category system for citation in- tents. In this work, we focus on two schemes: (1) the scheme proposed by Jurgens et al. (2018) and (2) an additional, more coarse-grained general- purpose category system that we propose (details in §3). Unlike other schemes that are domain- specific, our scheme is general and naturally fits in scientific discourse in multiple domains. Early works in automated citation intent clas- sification were based on rule-based systems (e.g., (Garzone and Mercer, 2000; Pham and Hoffmann, 2003)). Later, machine learning methods based on linguistic patterns and other hand-engineered features from citation context were found to be effective. For example, Teufel et al. (2006) pro- posed use of "cue phrases", a set of expressions that talk about the act of presenting research in a paper. Abu-Jbara et al. (2013) relied on lexical, structural, and syntactic features and a linear SVM for classification. Researchers have also investi- gated methods of finding cited spans in the cited papers. Examples include feature-based methods (Cohan et al., 2015), domain-specific knowledge (Cohan and Goharian, 2017), and a recent CNN- based model for joint prediction of cited spans and citation function (Su et al., 2018). We also exper- imented with CNNs but found the attention BiL- STM model to work significantly better. Jurgens et al. (2018) expanded all pre-existing feature- based efforts on citation intent classification by proposing a comprehensive set of engineered fea- tures, including boostrapped patterns, topic mod- eling, dependency-based, and metadata features for the task. We argue that we can capture nec- essary information from the citation context using a data driven method, without the need for hand- engineered domain-dependent features or external resources. We propose a novel scaffold neural usefutrbckgextncompmotvPredicted labelusefutrbckgextncompmotvTrue label170000101020021101000051120300bckgmthdcompPredicted labelbckgmthdcompTrue label644410915415 References Amjad Abu-Jbara, Jefferson Ezra, and Dragomir Radev. 2013. Purpose and polarity of citation: To- wards nlp-based bibliometrics. In NAACL-HLT. Shashank Agarwal, Lisha Choubey, and Hong Yu. 2010. Automatically classifying the role of cita- tions in biomedical articles. In AMIA Annual Sym- posium Proceedings, volume 2010, page 11. Ameri- can Medical Informatics Association. Tanzila Ahmed, Ben Johnson, Charles Oppenheim, and Catherine Peck. 2004. Highly cited old papers and the reasons why they continue to be cited. part ii., the 1953 watson and crick article on the structure of dna. Scientometrics, 61(2):147 -- 156. Sepp Hochreiter and Jurgen Schmidhuber. 1997. Long short-term memory. Neural Computation. David Jurgens, Srijan Kumar, Raine Hoover, Dan Mc- Farland, and Dan Jurafsky. 2018. Measuring the evolution of a scientific field through citation frames. TACL, 6:391 -- 406. Loet Leydesdorff. 1998. Theories of citation? Scien- tometrics. Zhi Li and Yuh-Shan Ho. 2008. Use of citation per publication as an indicator to evaluate contingent valuation research. Scientometrics. Terttu Luukkonen. 1992. Is scientists' publishing be- haviour rewardseeking? Scientometrics. Iz Beltagy, Arman Cohan, and Kyle Lo. 2019. Scibert: Pretrained contextualized embeddings for scientific text. CoRR, abs/1903.10676. Michael J Moravcsik and Poovanalingam Murugesan. 1975. Some results on the function and quality of citations. Social studies of science, 5(1):86 -- 92. Steven Bird, Robert Dale, Bonnie J. Dorr, Bryan R. Gibson, Mark Thomas Joseph, Min-Yen Kan, Dong- won Lee, Brett Powley, Dragomir R. Radev, and Yee Fan Tan. 2008. The acl anthology reference cor- pus: A reference dataset for bibliographic research in computational linguistics. In LREC. Rich Caruana. 1997. Multitask learning. Machine Learning, 28:41 -- 75. Arman Cohan and Nazli Goharian. 2015. Scientific ar- ticle summarization using citation-context and arti- cle's discourse structure. In EMNLP. Arman Cohan and Nazli Goharian. 2017. Contextu- alizing citations for scientific summarization using In SI- word embeddings and domain knowledge. GIR. Arman Cohan, Luca Soldaini, and Nazli Goharian. 2015. Matching citation text and cited spans in biomedical literature: a search-oriented approach. In HLT-NAACL. 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. Cailing Dong and Ulrich Schafer. 2011. Ensemble- style self-training on citation classification. In IJC- NLP. Matt Gardner, Joel Grus, Mark Neumann, Oyvind Tafjord, Pradeep Dasigi, Nelson F. Liu, Matthew E. Peters, Michael Schmitz, and Luke S. Zettlemoyer. 2018. Allennlp: A deep semantic natural language processing platform. CoRR, abs/1803.07640. Mark Garzone and Robert E Mercer. 2000. Towards In Conference of an automated citation classifier. the Canadian Society for Computational Studies of Intelligence, pages 337 -- 346. Springer. 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. Jeffrey Pennington, Richard Socher, and Christopher Manning. 2014. Glove: Global vectors for word representation. In EMNLP, pages 1532 -- 1543. Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke S. Zettlemoyer. 2018. Deep contextualized word representations. In NAACL-HLT. Son Bao Pham and Achim Hoffmann. 2003. A new approach for scientific citation classification using In Australasian Joint Conference on cue phrases. Artificial Intelligence, pages 759 -- 771. Springer. Nils Reimers and Iryna Gurevych. 2017. Reporting score distributions makes a difference: Performance study of lstm-networks for sequence tagging. In EMNLP. Anna Ritchie. 2009. Citation context analysis for in- formation retrieval. Technical report, University of Cambridge, Computer Laboratory. Henry Small. 2018. Characterizing highly cited method and non-method papers using citation con- texts: The role of uncertainty. Journal of Informet- rics, 12(2):461 -- 480. 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. Mary Elizabeth Stevens and Vincent Edward Giuliano. 1965. Statistical Association Methods for Mech- anized Documentation: Symposium Proceedings, Washington, 1964, volume 269. US Government Printing Office. Xuan Su, Animesh Prasad, Min-Yen Kan, and Kazu- nari Sugiyama. 2018. Neural multi-task learn- ing for citation function and provenance. CoRR, abs/1811.07351. Swabha Swayamdipta, Sam Thomson, Kenton Lee, Luke S. Zettlemoyer, Chris Dyer, and Noah A. Smith. 2018. Syntactic scaffolds for semantic struc- tures. In EMNLP. Simone Teufel, Advaith Siddharthan, and Dan Tidhar. 2006. Automatic classification of citation function. In EMNLP, EMNLP '06, pages 103 -- 110, Strouds- burg, PA, USA. Association for Computational Lin- guistics. Howard D White. 2004. Citation analysis and discourse analysis revisited. Applied linguistics, 25(1):89 -- 116. Matthew D Zeiler. 2012. Adadelta: an adaptive learn- ing rate method. arXiv preprint arXiv:1212.5701.
1908.06435
1
1908
2019-08-18T12:50:47
TDAM: a Topic-Dependent Attention Model for Sentiment Analysis
[ "cs.CL", "cs.LG" ]
We propose a topic-dependent attention model for sentiment classification and topic extraction. Our model assumes that a global topic embedding is shared across documents and employs an attention mechanism to derive local topic embedding for words and sentences. These are subsequently incorporated in a modified Gated Recurrent Unit (GRU) for sentiment classification and extraction of topics bearing different sentiment polarities. Those topics emerge from the words' local topic embeddings learned by the internal attention of the GRU cells in the context of a multi-task learning framework. In this paper, we present the hierarchical architecture, the new GRU unit and the experiments conducted on users' reviews which demonstrate classification performance on a par with the state-of-the-art methodologies for sentiment classification and topic coherence outperforming the current approaches for supervised topic extraction. In addition, our model is able to extract coherent aspect-sentiment clusters despite using no aspect-level annotations for training.
cs.CL
cs
TDAM: a Topic-Dependent Attention Model for Sentiment Analysis Gabriele Pergola∗, Lin Gui, Yulan He∗ University of Warwick, Coventry, UK Abstract We propose a topic-dependent attention model for sentiment classification and topic extraction. Our model assumes that a global topic embedding is shared across documents and employs an attention mechanism to derive local topic embedding for words and sentences. These are subsequently incorporated in a modified Gated Recurrent Unit (GRU) for sentiment classification and extrac- tion of topics bearing different sentiment polarities. Those topics emerge from the words' local topic embeddings learned by the internal attention of the GRU cells in the context of a multi-task learning framework. In this paper, we present the hierarchical architecture, the new GRU unit and the experiments conducted on users' reviews which demonstrate classification performance on a par with the state-of-the-art methodologies for sentiment classification and topic coher- ence outperforming the current approaches for supervised topic extraction. In addition, our model is able to extract coherent aspect-sentiment clusters despite using no aspect-level annotations for training. Keywords: sentiment analysis, neural attention, topic modeling 1. Introduction In recent years, attention mechanisms in neural networks have been widely used in various tasks in Natural Language Processing (NLP), including machine ∗Corresponding authors. Email addresses: [email protected] (Gabriele Pergola), [email protected] (Yulan He) Figure 1: Attention weights from the Topic-Dependent Attention Model (TDAM) and Hi- erarchical Attention Network (HAN) (Yang et al., 2016). TDAM highlights and gives more relevance to both sentiment and topical words. translation (Bahdanau et al., 2015; Luong et al., 2015; Vaswani et al., 2017), image captioning (Xu et al., 2015), text classification (Yang et al., 2016; Chen et al., 2016; Ma et al., 2017) and reading comprehension (Hermann et al., 2015; Wang et al., 2017). Attention mechanisms are commonly used in models for processing sequence data that instead of encoding the full input sequence into a fixed-length vector learn to "attend" to different parts of the input sequence, based on the task at hand. This is equivalent to giving the model the access to its internal memory which consists of the hidden states of the sequence encoder. Typically soft attention is used which allows the model to retrieve a weighted combination of all memory locations. One advantage of using attention mechanisms is that the learned attention weights can be visualized to enable intuitive understanding of what contributes the most to the model's decision. For example, in sentiment classification, the visualization of word-level attention weights can often give us a clue as to why a given sentence is classified as positive or negative. Words with higher attention weights can be sometimes indicative of the overall sentence-level polarity (for example, see Figure 1). This inspires us the development of a model for the extraction of polarity-bearing topics based on the attention weights learned by a model. However, simply using the attention weights learned by the traditional atten- tion networks such as the Hierarchical Attention Network (HAN) (Yang et al., 2 The assistant RebeccawhohelpedmewasthenicestIhaveevercomeacross!IveryhappyIchangeddentist'mHANTADM 2016) would not give good results for the extraction of polarity-bearing topics, since in these models the attention weight of each word is calculated as the similarity between the word's hidden state representation with a context vector shared across all the documents. There is no mechanism to separate words into multiple clusters representing polarity-bearing topics. Therefore, in this paper, we propose a novel Topic-Dependent Attention Model (TDAM)1 in which a global topic embedding (i.e., a matrix with K topic vectors) is shared across all the documents in a corpus and captures the global semantics in multiple topical dimensions. When processing each word in an input sequence, we can calculate the similarity of the hidden state of the word with each topic vector to get the attention weight along a certain topical di- mension. By doing so, we can subsequently derive the local topical embedding for the word by the weighted combination of the global topic embeddings, indi- cating the varying strength of the association of the word with different topical dimensions. We use Bidirectional Gated Recurrent Unit (BiGRU) to model the input word sequence; we modify the GRU cells to derive a hidden state for the current word which simultaneously takes into account the current input word, the previous hidden state and local topic embedding. Our proposed formulation of topical attention is somewhat related to the consciousness prior proposed in Bengio (2017) in which the conscious state value corresponds to the content of a thought and can be derived by a form of atten- tion selecting a "small subset of all the information available" from the hidden states of the model. Analogously, we first assume the corpus is characterized by a global topic embedding. Then, we learn how to infer the local topic mix- ture for each analyzed word/sentence combining hidden states and global topic embedding with attention. In this paper, we describe TDAM and present its application to sentiment classification in reviews by a hierarchical and multi-task learning architecture. The aim is to evaluate a review's polarity by predicting both the rating and the 1https://github.com/gabrer/topic_dependent_attention_model 3 Figure 2: An example of topics bearing polarities. domain category of the review (e.g. restaurant, service, health, etc.). Often these reviews contain statements that can be fully specified only by the contextual topic. To illustrate, in Figure 2 we show two review extracts, one for a restaurant and another for a dishwasher. Interestingly, the same expression "not to clean the plates" can be regarded as positive for food while it bears a negative polarity for kitchen equipment. Thus, it is important to jointly consider both topic and sentiment shared over words for better sentiment analysis. In particular, we make the following contributions: • We design a neural architecture and a novel neural unit to analyze users' reviews while jointly taking into account topics and sentiments. The hier- archical architecture makes use of a global topic embedding which encodes the shared topics among words and sentences; while the neural unit em- ploys a new internal attention mechanism which leverages the global topic embeddings to derive a local topic representation for words and sentences. • We assess the benefit of multi-task learning to induce representations which are based on documents' polarities and domains. Our experiments show that combining the proposed architecture with the modified GRU unit is an effective approach to exploit the polarity and domain supervision for accurate sentiment classification and topic extraction. • As a side task to evaluate the sentence representations encoded by TDAM, we extract aspect-sentiment clusters using no aspect-level annotations dur- ing the training; then, we evaluate the coherence of those clusters. Exper- iments demonstrate that TDAM achieves state-of-the-art performance in extracting clusters whose sentences share coherent polarities and belong 4 After one cycle the crockery is still dirty, it doesn't clean the plates even at full power.Our children didn't manage to clean their plates! Plenty of food!R1R2 to common domains. To evaluate the performance of our model, we conduct experiments on both Yelp and Amazon review datasets (see §4.1). We compare the sentiment clas- sification performance with state-of-the-art models (§5). Then, visualization of topical attention weights highlights the advantages of the proposed framework (§5.2). We also evaluate how meaningful are the inferred representations in term of topic coherence (§5.3) and based on their capability to cluster sentences conveying a shared sentiment about a common aspect (§5.4). 2. Related Work Our work is related to three lines of research. Hierarchical structure for text classification. Many works have re- cently proposed to incorporate prior knowledge about the document structure directly into the model architecture to enhance the model's discriminative power in sentiment analysis. A hierarchical model incorporating user and product in- formation was first proposed by Tang et al. (2015) for rating prediction of re- views. Similarly, Chen et al. (2016) combined user and product information in a hierarchical model using attention (Bahdanau et al., 2015); here, attention is employed to generate hidden representations for both products and users. Yang et al. (2016) used a simple and effective two-level hierarchical architecture to generate document representations for text classification; words are combined in sentences and in turn, sentences into documents by two levels of attention. Liu & Lapata (2018) further empowered the structural bias of neural architectures by embedding a differentiable parsing algorithm. This induces dependency tree structures used as additional discourse information; an attention mechanism in- corporates these structural biases into the final document representation. Yang et al. (2019) introduced Coattention-LSTM for aspect-based sentiment analysis which designs a co-attention encoder alternating and combining the context and target attention vectors of reviews. 5 Combining topics with sequence modeling. There has been research incorporating topical information into the sequence modeling of text or use variational neural inference for supervised topic learning. Dieng et al. (2017) developed a language model combining the generative story of Latent Dirichlet Allocation (LDA) (Blei et al., 2003) with the word representations generated by a recurrent neural network (RNN). Stab et al. (2018) proposed incorporating topic information into some gates in Contextual-LSTM, improving generaliza- tion accuracy on argument mining. Abdi et al. (2019) proposed to directly incorporate word and sentence level features about contextual polarity, type of sentence and sentiment shifts by encoding prior knowledge about part-of-speech (POS) tagging and sentiment lexicons. Kastrati et al. (2019) enhanced docu- ment representations with knowledge from an external ontology and encoded documents by topic modeling approaches. Jin et al. (2018) proposed to perform topic matrix factorization by integrating both LSTM and LDA, where LSTM can improve the quality of the matrix factorization by taking into account the local context of words. Card et al. (2018) proposed a general neural topic model- ing framework which allows incorporating metadata information with a flexible variational inference algorithm. The metadata information can be labels driv- ing the topic inference and used for the classification task, analogous to what proposed in a Bayesian framework by Mcauliffe & Blei (2008) with supervised Latent Dirichlet Allocation (S-LDA). Multi-task learning. Several variants of multi-task learning with neural networks have been recently used for sentiment analysis. Wu & Huang (2016) proposed a multi-task learning framework for microblog sentiment classification which combines common sentiment knowledge with user- specific preferences. Liu et al. (2016) employed an external memory to allow different tasks to share information. Liu et al. (2017) proposed an adversarial approach to induce orthogonal features for each task. Chen & Cardie (2018) applied a different training scheme to the adversarial approach to minimize the distance between feature distributions across different domains. Zhang et al. (2018) proposed to use an embedded representation of labels to ease the gener- 6 Figure 3: Topic-Dependent Attention Model (TDAM). ation of cross-domain features. Zheng et al. (2018) proposed to share the same sentence representation for each task which in turn can select the task-specific information from the shared representation using an ad-hoc attention mecha- nism. Wang et al. (2018) applied multi-task learning for microblog sentiment classification by characterizing users across multiple languages. 3. Topic-Dependent Attention Model We illustrate the architecture of our proposed Topic-Dependent Attention Model (TDAM) in Figure 3, which is a hierarchical and multi-level attention framework trained with multi-task learning. Concretely, at the word sequence level (the bottom part of Figure 3), we add a word-level topic attention layer which computes the local topic embedding of 7 𝑥𝑖1𝑥𝑖𝑇𝑥𝑖𝑡Bi-GRUℎ𝑖1ℎ𝑖𝑡ℎ𝑖𝑇𝑒1𝑒2𝑒𝐾..𝛼(cid:3036)(cid:2869)(cid:2869)(cid:2879)(cid:3012)𝛽𝑖1𝛽𝑖𝑡𝛽𝑖𝑇𝑞𝑖1𝛽1𝛽𝑖𝛽𝑇𝑑softmaxsoftmaxSentiment classDomain categoryword-leveltopicattentionwordattentionsent-leveltopicattentionsentenceattention..Bi-GRU..𝛼(cid:3036)(cid:3047)(cid:2869)(cid:2879)(cid:3012)𝑞𝑖𝑡..Bi-GRU𝛼(cid:3036)(cid:3021)(cid:2869)(cid:2879)(cid:3012)𝑞𝑖1𝑠1Bi-GRUℎ1..𝛼(cid:2869)(cid:2869)(cid:2879)(cid:3012)𝑞1..𝑠𝑖ℎ𝑖..𝛼(cid:3036)(cid:2869)(cid:2879)(cid:3012)𝑞𝑖..Bi-GRU𝑠𝐼ℎ𝐼𝛼(cid:3010)(cid:2869)(cid:2879)(cid:3012)𝑞𝐼Bi-GRU⊗⊗⊗⊗⊗⊗ each word based on the global topic embedding and the current hidden state. Such word-level local topic embedding indicates how strongly each word is as- sociated with every topic dimension, which is fed into the Bi-GRU cell in the next time step for the derivation of the hidden state representation of the next word. Bi-GRU is used to capture the topical contextual information in both the forward and backward directions. We then have a word attention layer which decides how to combine the hidden state representations of all the constituent words in order to generate the sentence representation. At the sentence-level, a similar two-level attention mechanism is used to derive the document represen- tation, which is fed into two separate softmax layers for predicting the sentiment class and the domain category. Each of the key components of TDAM is detailed below. 3.1. Topic-Dependent Word Encoder Given a word sequence xi = (xi1, . . . , xiT ), where xit ∈ Rd is a word embed- ding vector with d dimensions, we use Bi-GRU to encode the word sequence. The hidden state at each word position, hit, is represented by the concatenation of both forward and backward hidden states, hit = [ −→ hit, ←− hit], which captures the contextual information of the whole sentence centred at xit. We assume there are K global topic embeddings shared across all documents, where each topic has a dense and distributed representation, ek ∈ Rn, with k = {1, ..., K}, which is initialized randomly and will be updated during model learning. At each word position, we can calculate the word-level topic weight by mea- suring the distance between the word vector and each global topic vector. We first project hit using a one-layer MLP and then compute the dot products be- tween the projected hit and global topic vectors ek, k = {1, ..., K} to generate 8 the weight of local topic embedding for the corresponding word position2: uit = tanh(Wwhit) (cid:124) it = softmax(u itek) αk where Ww ∈ Rn×n and k ∈ {1, ..., K}. The local topic embedding is then: K(cid:88) qit = it ⊗ ek αk (1) (2) (3) with qit ∈ Rn, αit ∈ RK. Here, ⊗ denotes multiplication of a vector by a scalar. We add the local topic embedding into the GRU cell to rewrite the formulae k=1 as follows: rt = σ(Wrxt + Urht−1 + Vrqt−1) zt = σ(Wzxt + Uzht−1 + Vzqt−1) ht = tanh(Whxt + rt (cid:12) (Uhht−1 + Vhqt−1)) ht = (1 − zt) (cid:12) ht−1 + zt (cid:12) ht (4) (5) (6) (7) where σ(·) is the sigmoid function, all the W , U and V s are weight matrices which are learned in the training process, (cid:12) denotes the element-wise product. The reset gate rt controls how much past state information is to be ignored in the current state update. The update gate zt controls how much information from the previous hidden state will be kept. The hidden state ht is computed as the interpolation between the previous state ht−1 and the current candidate state ht. In the above formulation, the hidden state in the current word position not only depends on the current input and the previous hidden state, but also takes into account the local topic embedding of the previous word. Since some of those words may be more informative than others in constituting the overall sentence 2We drop the bias terms in all the equations in our paper for simplicity. 9 meaning, we aggregate these representations with a final attention mechanism: vit = tanh(Wvhit) (cid:124) itvw) t(cid:88) βit = softmax(v βit ⊗ hit si = (8) (9) (10) where βit is the attention weight for the hidden state hit and si ∈ Rn is the sentence representation for the ith sentence. t=1 3.2. Sentence Encoder Given each sentence representation si in document d where i = {1, ..., dL} and dL denotes the document length, we can form the document representation using the proposed topical GRU in a similar way. For each sentence i, its context ←− hi], which captures the contextual information of the whole vector is hi = [ −→ hi, document centred at si. We follow an approach analogous to the topic-dependent word encoder and generate the local topic embedding for ith sentence: αk ui = tanh(Wshi) (cid:124) i = softmax(u i ek) i ⊗ ek αk K(cid:88) qi = Ws ∈ Rn×n k ∈ {1, ..., K} qi ∈ Rn (11) (12) (13) k=1 where qi is local topic embedding for sentence i. We add the local topic embed- ding into the GRU cell as in Eq. 4-7. Analogously to the word encoder, those sentences contribute differently to the overall document meaning; thus, we aggregate these representations with an attention mechanism similar to the final attention mechanism described in Section 3.1. 10 3.3. Multi-Task Learning Finally, for each document d, we feed its representation md into the task- specific softmax layers, each one defined as follows: pd = softmax(Wdmd) Wd ∈ RC×n (14) where C denotes the total number of classes. The training loss is defined as the total cross-entropy of all documents computed for each task: Ltask = − D(cid:88) C(cid:88) yd,c log pd,c (15) where yd,c is the binary indicator (0 or 1) if class label c is the correct classifi- d=1 c=1 cation for document d. We compute the overall loss as a weighted sum over the task-specific losses: Ltotal = J(cid:88) ωjL(y(j), y(j)) (16) j=1 where J is the number of tasks, ωj is the weight for each task, y(j) are the ground-truth labels in task j and y(j) are the predicted labels in task j. 3.4. Topic Extraction Once our model is trained, we can feed the test set and collect the local topic embedding qit associated to each word (Eq. 3), collecting a set of n- dimensional vectors for each occurrence of words in text. This mechanism can be interpreted analogously to models generating deep contextualised word repre- sentations based on language model, where each word occurrence has a unique representation based on the context in which it appears (Peters et al., 2018; Devlin et al., 2019). The local representation qit in our model results from the interaction with the global topic embeddings, which encode the word co-occurrence patterns char- acterizing the corpus. We posit that these vectors can give us an insight about the topic and polarity relations among words. Therefore, we first project these representations into a two-dimensional space by applying the t-SNE (Van der 11 Maaten & Hinton, 2008); then, the resulting word vectors are clustered by ap- plying the K-means algorithm. We create a fixed number of clusters k, whose value is tuned by maximizing the topic coherence for k ∈ [50, 100, 200]. We use the distance of each word to the centroid of a topic cluster to rank words within a cluster. Similarly, we cluster sentences based on the representation resulting from the sentence-level topical attention layer. This encoding synthesises both the main topic and polarity characterizing the sentence. 4. Experimental Setup Dataset Yelp18 Amazon Sentiment classes Domain categories Documents Average #s Average #w Vocabulary Tokens 3 5 75,000 9.7 3 5 75,000 6.7 15.9 16.7 ∼ 85 × 103 ∼ 100 × 103 ∼ 11.7 × 106 ∼ 8.5 × 103 Table 1: Dataset statistics with #s number of sentences per document and and #w of words per sentence. 4.1. Datasets We gathered two balanced datasets of reviews from the publicly available Yelp Dataset Challenge dataset in 2018 and the Amazon Review Dataset3 (McAuley et al., 2015), preserving the meta-information needed for a multi-task learning scenario. Each review is accompanied with one of the three ratings, positive, negative or neutral and comes from five of the most frequent domains4. 3http://jmcauley.ucsd.edu/data/amazon/ 4For Yelp: restaurants, shopping, home services, health & medical and automotive. For Amazon: Pet supplies, electronics, health personal care, clothes shoes and home and kitchen. 12 Those ratings are the human labeled review scores regarded as gold standard sentiment labels during the experimentation. For each pair of domain and rat- ing, we randomly sample 3,000 reviews, collecting a total of 75,000 reviews. To make it possible for others to replicate our results, we make both the dataset and our source code publicly available5. Table 1 summarizes the statistics of the datasets. 4.2. Baselines We train our proposed TDAM with multi-task learning to perform senti- ment and domain classification simultaneously. We compare the performance of TDAM with the following baselines on both sentiment classification and topic extraction: • BiLSTM (Hochreiter & Schmidhuber, 1997) or BiGRU (Cho et al., 2014): Both models consider a whole document as a single text sequence. The average of the hidden states is used as features for classification. • Hierarchical Attention Network (HAN) (Yang et al., 2016): The hierarchical structure of this attention model learns word and sentence representations through two additive attention levels. • Supervised-LDA (S-LDA) (Mcauliffe & Blei, 2008): It builds on top of the latent Dirichlet allocation (LDA) (Blei et al., 2003) adding a response variable associated with each document (e.g. review's rating or category). • Scholar (Card et al., 2018): A neural framework for topic models with metadata incorporation without the need of deriving model-specific infer- ence. When metadata are labels, the model infers topics that are relevant to those labels. The baselines, such as BiLSTM, BiGRU and HAN, are additionally trained with multi-task learning, similar to the setup of our model. 5https://github.com/gabrer/topic_dependent_attention_model 13 4.3. Parameter Settings For our experiments, we split the dataset into training, development and test set in the proportion of 80/10/10 and average all the results over 5-fold cross- validation. We perform tokenization and sentence splitting with SpaCy6. We do not filter any words from the dataset during the training phase; although we use the default preprocessing for models like S-LDA and Scholar. Word em- beddings are initialized with 200-dimensional GloVe vectors (Pennington et al., 2014). We tune the models' hyperparameters on the development set via a grid search over combinations of learning rate λ ∈ [0.01, 0.1], dropout δ ∈ [0, 0.6] and topic vector's size γt ∈ [50, 200]. Matrices are randomly initialized to be semi-orthogonal matrix (Saxe et al., 2014); all the remaining parameters are randomly sampled from a uniform distribution in [−0.1, 0.1]. We adopt Adam optimizer (Kingma & Ba, 2015) and use batch size of 64, sorting documents by length (i.e. number of sentences) to accelerate training convergence; we also apply batch normalization as additional regulariser (Cooijmans et al., 2017). Once the model is trained, we extract the local topic embedding for each word occurrence in text as its contextualized word representation. These vectors are then projected to a lower-dimensional space by means of a multi-core imple- mentation of a Tree-Based algorithm for accelerating t-SNE7 (Van Der Maaten, 2014). Then, we cluster these words with K-means8. 5. Evaluation and results We report and discuss the experimental results obtained on three evaluation tasks, sentiment classification topic extraction and sentence cluster extraction. 5.1. Sentiment Classification We train the models under two different settings: a single and a multi-task learning scenario, where we optimize over the only review polarity or over the 6https://spacy.io/ 7https://github.com/DmitryUlyanov/Multicore-TSNE 8http://scikit-learn.org/stable/modules/clustering.html 14 Methods BiLSTM BiLSTM - Mtl BiGRU BiGRU - Mtl HAN HAN - Mtl S-LDA Scholar TDAM TDAM - Mtl Yelp 18 74.5 ± 0.2 74.2 ± 0.2 75.5 ± 0.1 75.4 ± 0.2 83.7 ± 0.2 83.6 ± 0.3 70.8 ± 0.2 77.3 ± 0.2 84.2 ± 0.2 84.5 ± 0.3 Amazon 72.1 ± 0.2 71.8 ± 0.1 72.5 ± 0.3 72.1 ± 0.3 78.4 ± 0.2 78.2 ± 0.3 64.6 ± 0.1 71.4 ± 0.2 78.9 ± 0.2 79.1 ± 0.2 Table 2: Sentiment classification accuracy and standard deviation over the 5-fold cross vali- dation. combination of polarity and domain, respectively. For the latter, we denote the results with '-Mtl' in Table 2. It can be observed from the table that BiLSTM and BiGRU perform sim- ilarly. With hierarchical attention mechanism at both the word level and the sentence level, HAN boosts the performance by nearly 10% on Yelp and 6% on Amazon compared to BiLSTM and BiGRU. For the neural topic modeling approaches, Scholar outperforms traditional S-LDA by a large margin. How- ever, Scholar is still inferior to HAN. With our proposed topical attentions incorporated into the hierarchical network structure, TDAM further improves on HAN. Multi-task learning does not seem to bring any benefit to sentiment classification for baseline models, though it further improves the performance of TDAM slightly. 5.2. Effectiveness of Topical Attention If we remove the topical attention and substitute our modified GRU with standard GRU, then the resulting architecture is similar to HAN (Yang et al., 2016) for a multi-task learning setting. In this section, we visualize the attention 15 Yelp18 Amazon T opics = 50 100 200 50 100 200 -7.08 -13.21 -13.15 -13.14 -6.93 -12.72 -12.20 -12.29 HAN HAN - Mtl -7.22 -7.04 -6.26 S-LDA Scholar -6.24 Scholar-R -6.19 TDAM -6.41 -7.05 -6.94 -6.13 -6.08 -6.11 -6.12 -6.15 -6.11 -6.08 -6.09 -9.57 -9.52 -9.34 -9.62 -9.41 -9.46 -9.09 -9.50 -9.12 -9.28 -9.48 -9.17 -9.46 -9.01 TDAM - Mtl -6.22 -6.05 -5.93 -9.23 Table 3: Topic coherence for different number of topics. The higher the better. weights learned by HAN and TDAM to compare their results. Examples are shown in Figure 1. In TDAM, topical words such as dentist or the dentist's name, Rebecca, are regarded as relevant by the model. Along with them, it focuses on words bearing a strong sentiment, such as nicest or happy. These weights are compared with the attention weights learned by the HAN, showing that it primarily focuses sentiment words and overlooks other topical words, such as dentist. 5.3. Topic Coherence Evaluation Among the baselines, S-LDA and Scholar are topic modeling methods and therefore the can directly output topics from text. In addition, we can follow the topic extraction procedure described in Section 3.4 to extract topics from HAN to gain an insight into the learned representations. We thus compare the topic extraction results of TDAM with these three models. Also, as previously shown in (Card et al., 2018), higher regularisation on Scholar produced better topics. Therefore, we also report the results using Scholar with higher regularization, named as Scholar-R. To evaluate the quality of topics, we use the topic coherence measure9 pro- posed in (Roder et al., 2015) which has been shown outperforming all the other 9https://github.com/dice-group/Palmetto 16 existing topic coherence measures. We can observe from Table 3 that HAN gives the worse topic coherence results, showing that simply extracting topics using the attention weights is not feasible. With the incorporation of domain cat- egory information through multi-task learning, HAN-Mtl gives slightly better coherence results. Among topic modeling approaches, Scholar-R with higher regularization generates more coherence topics compared to Scholar, which outperforms S-LDA. TDAM gives similar topic coherence results as Scholar- R on some topic numbers. TDAM-Mtl improves over TDAM and generates the best coherence results on 2 out of 3 topic settings for both Yelp18 and Amazon, showing higher coherence scores overall. 5.4. Aspect-Polarity Coherence Evaluation To assess the effectiveness of our proposed TDAM in extracting polarity- bearing topics, we use the annotated dataset provided in the SemEval 2016 Task 5 for aspect-based sentiment analysis10; this provides sentence-level annotations about different aspects (e.g. FOOD#QUALITY) and polarities (pos, neut, neg) in restaurant and laptop reviews. We join the training set of restaurant and laptop reviews with the Yelp18 and Amazon dataset, respectively. With the same approach adopted for topic extraction, we use the test sets to generate sentence clusters and evaluate their aspect-polarity coherence, defined as the ratio of sentences sharing a common aspect and sentiment in a cluster. For the two topic modeling approaches, S-LDA and Scholar, we generate sentence clusters based on the generative probabilities of sentences conditional on topics. Note that although the SemEval dataset provides the sentence-level annotations of aspects and polarities, these were NOT used for the training of the models here. We only use the gold standard annotations of aspects and polarities in the test set to evaluate the quality of the extracted polarity-bearing topics. We generate multiple clusters, i.e. (50,100,150), representing polarity-bearing 10http://alt.qcri.org/semeval2016/task5/ 17 aspects and report the results in Table 4, which shows the ratio of sentence clusters with more than threshold sentences sharing a common aspect (values in brackets) or a common aspect-polarity. We can observe that the topic mod- eling approaches struggle in generating coherent aspect-polarity clusters with at least 50% of common aspect-polarities. The two hierarchical models, HAN and TDAM, have significantly more coherent aspect-polarity clusters compared to S-LDA and Scholar, and both benefit from multi-task learning. For all the models, results on SemEval-Restaurant are better than those obtained on SemEval-Laptop. This might be partly attributed to the abundant restaurant reviews on Yelp18 compared to the laptop-related reviews on Amazon. Overall, TDAM-Mtl gives the best results. We also show some example sentence clusters produced by HAN and TDAM under multi-task learning in Table 5. HAN discriminates rather effectively posi- tive sentences (the majority in the cluster) from negative and neutral ones. How- ever, despite several sentences sharing the same polarity, their topics/aspects are quite heterogeneous. TADM phrases are rather coherent overall, both in terms of topics and expressed sentiment. These results are encouraging. Our TDAM is able to detect coherent aspects and also polarity-bearing aspects despite using no aspect-level annotations at all. Considering it is very time consuming to provide aspect-level annotations, TDAM could be used to bootstrap the training of aspect-based sentiment de- tectors. 6. Conclusion We have presented a new topic-dependent attention model for sentiment clas- sification and topic extraction. The conjunction of topical recurrent unit and multi-task learning framework has been shown to be an effective combination to generate representations for more accurate sentiment classification, meaningful topics and for side task of polarity-bearing aspects detection. In future, we will extend the model to deal with discourse-level sentiments (Feng & Hirst, 2012). 18 % 0 9 ≥ % 0 8 ≥ % 0 7 ≥ % 0 6 ≥ % 0 5 ≥ % 0 9 ≥ % 0 8 ≥ % 0 7 ≥ % 0 6 ≥ % 0 5 ≥ d l o h s e r h t p o t p a L - l a v E m e S t n a r u a t s e R - l a v E m e S s c i p o T s d o h t e M 0 0 . 0 ) 0 0 . 0 ( 1 0 . 0 ) 3 0 . 0 ( 3 0 . 0 ) 8 0 . 0 ( 2 1 . 0 ) 5 1 . 0 ( 5 1 . 0 ) 8 1 . 0 ( 0 0 . 0 ) 0 0 . 0 ( 2 0 . 0 ) 4 0 . 0 ( 0 1 . 0 ) 4 1 . 0 ( 4 2 . 0 ) 8 2 . 0 ( 0 4 . 0 ) 2 5 . 0 ( 1 0 . 0 ) 1 0 . 0 ( 4 0 . 0 ) 5 0 . 0 ( 8 0 . 0 ) 2 1 . 0 ( 0 2 . 0 ) 1 2 . 0 ( 6 2 . 0 ) 8 2 . 0 ( 3 0 . 0 ) 3 0 . 0 ( 7 0 . 0 ) 9 0 . 0 ( 1 1 . 0 ) 4 1 . 0 ( 7 2 . 0 ) 6 3 . 0 ( 7 4 . 0 ) 4 6 . 0 ( 3 0 . 0 ) 4 0 . 0 ( 7 0 . 0 ) 8 . 0 ( 0 1 . 0 ) 4 1 . 0 ( 3 2 . 0 ) 8 2 . 0 ( 4 3 . 0 ) 7 3 . 0 ( 8 0 . 0 ) 2 1 . 0 ( 2 1 . 0 ) 4 1 . 0 ( 6 1 . 0 ) 1 2 . 0 ( 2 3 . 0 ) 9 3 . 0 ( 9 5 . 0 ) 0 7 . 0 ( 1 0 . 0 ) 3 0 . 0 ( 2 0 . 0 ) 4 0 . 0 ( 4 0 . 0 ) 2 1 . 0 ( 5 1 . 0 ) 8 1 . 0 ( 9 1 . 0 ) 4 2 . 0 ( 2 0 . 0 ) 6 0 . 0 ( 0 1 . 0 ) 2 1 . 0 ( 8 1 . 0 ) 6 2 . 0 ( 8 2 . 0 ) 6 3 . 0 ( 0 4 . 0 ) 6 5 . 0 ( 3 0 . 0 ) 4 0 . 0 ( 4 0 . 0 ) 8 0 . 0 ( 9 0 . 0 ) 6 1 . 0 ( 9 1 . 0 ) 6 2 . 0 ( 7 2 . 0 ) 1 3 . 0 ( 6 0 . 0 ) 0 1 . 0 ( 3 1 . 0 ) 7 1 . 0 ( 2 2 . 0 ) 6 2 . 0 ( 0 4 . 0 ) 1 5 . 0 ( 2 5 . 0 ) 4 6 . 0 ( 3 0 . 0 ) 5 0 . 0 ( 8 0 . 0 ) 2 1 . 0 ( 2 1 . 0 ) 7 1 . 0 ( 4 2 . 0 ) 5 3 . 0 ( 8 3 . 0 ) 1 4 . 0 ( 8 0 . 0 ) 4 1 . 0 ( 2 1 . 0 ) 1 2 . 0 ( 2 2 . 0 ) 0 3 . 0 ( 3 4 . 0 ) 1 5 . 0 ( 3 6 . 0 ) 2 7 . 0 ( 0 0 . 0 ) 0 0 . 0 ( 0 0 . 0 ) 2 0 . 0 ( 1 0 . 0 ) 3 0 . 0 ( 5 0 . 0 ) 8 0 . 0 ( 7 0 . 0 ) 9 0 . 0 ( 0 0 . 0 ) 0 0 . 0 ( 0 0 . 0 ) 0 0 . 0 ( 1 0 . 0 ) 2 0 . 0 ( 3 0 . 0 ) 8 0 . 0 ( 2 1 . 0 ) 8 1 . 0 ( 0 0 . 0 ) 0 0 . 0 ( 0 0 . 0 ) 1 0 . 0 ( 1 0 . 0 ) 4 0 . 0 ( 6 0 . 0 ) 0 1 . 0 ( 4 1 . 0 ) 5 1 . 0 ( 0 0 . 0 ) 0 0 . 0 ( 0 0 . 0 ) 0 0 . 0 ( 2 0 . 0 ) 3 0 . 0 ( 0 1 . 0 ) 1 1 . 0 ( 1 2 . 0 ) 4 2 . 0 ( 0 0 . 0 ) 0 0 . 0 ( 2 0 . 0 ) 2 . 0 ( 4 0 . 0 ) 8 0 . 0 ( 1 1 . 0 ) 4 1 . 0 ( 4 2 . 0 ) 7 2 . 0 ( 1 0 . 0 ) 1 0 . 0 ( 1 0 . 0 ) 1 0 . 0 ( 4 0 . 0 ) 5 0 . 0 ( 6 1 . 0 ) 9 1 . 0 ( 5 3 . 0 ) 9 3 . 0 ( 0 0 . 0 ) 0 0 . 0 ( 1 0 . 0 ) 3 0 . 0 ( 2 0 . 0 ) 6 0 . 0 ( 4 0 . 0 ) 8 0 . 0 ( 0 1 . 0 ) 4 1 . 0 ( 0 0 . 0 ) 0 0 . 0 ( 1 0 . 0 ) 1 0 . 0 ( 3 0 . 0 ) 4 0 . 0 ( 0 1 . 0 ) 2 2 . 0 ( 8 1 . 0 ) 1 3 . 0 ( 1 0 . 0 ) 1 0 . 0 ( 1 0 . 0 ) 3 0 . 0 ( 5 0 . 0 ) 9 0 . 0 ( 8 0 . 0 ) 6 1 . 0 ( 5 1 . 0 ) 1 2 . 0 ( 1 0 . 0 ) 1 0 . 0 ( 1 0 . 0 ) 3 0 . 0 ( 4 0 . 0 ) 8 0 . 0 ( 3 1 . 0 ) 4 2 . 0 ( 4 2 . 0 ) 9 3 . 0 ( 1 0 . 0 ) 2 0 . 0 ( 2 0 . 0 ) 5 0 . 0 ( 6 0 . 0 ) 2 1 . 0 ( 3 1 . 0 ) 1 2 . 0 ( 6 2 . 0 ) 4 3 . 0 ( 1 0 . 0 ) 1 0 . 0 ( 3 0 . 0 ) 4 0 . 0 ( 0 1 . 0 ) 1 1 . 0 ( 9 1 . 0 ) 8 2 . 0 ( 6 3 . 0 ) 3 4 . 0 ( 0 0 . 0 ) 0 0 . 0 ( 2 0 . 0 ) 3 0 . 0 ( 6 0 . 0 ) 9 0 . 0 ( 4 1 . 0 ) 5 1 . 0 ( 7 1 . 0 ) 9 1 . 0 ( 0 0 . 0 ) 2 0 . 0 ( 4 0 . 0 ) 6 0 . 0 ( 8 0 . 0 ) 2 1 . 0 ( 4 2 . 0 ) 0 3 . 0 ( 2 4 . 0 ) 4 5 . 0 ( 2 0 . 0 ) 2 0 . 0 ( 4 0 . 0 ) 5 0 . 0 ( 0 1 . 0 ) 2 1 . 0 ( 8 1 . 0 ) 4 2 . 0 ( 9 2 . 0 ) 8 3 . 0 ( 6 0 . 0 ) 0 1 . 0 ( 0 1 . 0 ) 4 1 . 0 ( 6 1 . 0 ) 1 2 . 0 ( 1 3 . 0 ) 0 4 . 0 ( 5 5 . 0 ) 3 6 . 0 ( 3 0 . 0 ) 5 0 . 0 ( 8 0 . 0 ) 8 0 . 0 ( 3 1 . 0 ) 6 1 . 0 ( 5 2 . 0 ) 8 2 . 0 ( 7 3 . 0 ) 9 3 . 0 ( 3 1 . 0 ) 6 1 . 0 ( 5 1 . 0 ) 9 1 . 0 ( 6 2 . 0 ) 8 2 . 0 ( 6 3 . 0 ) 3 4 . 0 ( 5 6 . 0 ) 3 7 . 0 ( 2 0 . 0 ) 4 0 . 0 ( 7 0 . 0 ) 3 1 . 0 ( 3 1 . 0 ) 2 2 . 0 ( 7 1 . 0 ) 6 2 . 0 ( 5 2 . 0 ) 1 3 . 0 ( 4 0 . 0 ) 6 0 . 0 ( 2 1 . 0 ) 4 1 . 0 ( 0 2 . 0 ) 4 2 . 0 ( 8 3 . 0 ) 2 5 . 0 ( 1 5 . 0 ) 8 6 . 0 ( 0 . 0 ) 2 0 . 0 ( 9 0 . 0 ) 2 1 . 0 ( 5 1 . 0 ) 6 2 . 0 ( 4 2 . 0 ) 8 3 . 0 ( 2 3 . 0 ) 9 3 . 0 ( 2 1 . 0 ) 3 1 . 0 ( 6 1 . 0 ) 9 1 . 0 ( 4 2 . 0 ) 1 3 . 0 ( 9 3 . 0 ) 7 4 . 0 ( 8 5 . 0 ) 2 7 . 0 ( 5 0 . 0 ) 9 0 . 0 ( 1 1 . 0 ) 7 1 . 0 ( 8 1 . 0 ) 6 2 . 0 ( 1 3 . 0 ) 2 4 . 0 ( 3 4 . 0 ) 8 4 . 0 ( 4 1 . 0 ) 6 1 . 0 ( 6 1 . 0 ) 0 2 . 0 ( 5 2 . 0 ) 2 3 . 0 ( 0 4 . 0 ) 0 5 . 0 ( 8 6 . 0 ) 0 8 . 0 ( 0 5 0 0 1 0 5 1 0 5 0 0 1 0 5 1 0 5 0 0 1 0 5 1 0 5 0 0 1 0 5 1 0 5 0 0 1 0 5 1 0 5 0 0 1 0 5 1 N A H l t - M N A H A D L - S M A D T l t - M M A D T R - r a l o h c S 19 h t o b . e . i ( y t i r a l o p - t c e p s a e m a s e h t g n i r a h s d n a ) s t e k c a r b n i s e u l a v ( t c e p s a e m a s e h t g n i r a h s s e c n e t n e s % x t s a e l t a e r e h w s r e t s u l c f o o i t a R : 4 e l b a T . ) t c e r r o c e r a y t i r a l o p d n a t c e p s a g e n Y T I L A U Q # D O O F o o t y a w s a w t i t u b d o o g l l a s a w d o o f e h t ) 1 s o p Y T I L A U Q # D O O F M A D T y t i l a u Q # d o o F - y t i r a l o p e v i t i s o P . t s a f k a e r b e g a r e v a r u o y n a h t e r o m y o j n e d n a , e o j f o p u c a h t i w r u o h f l a h e h t t i a w ) 1 N A H s o p S N O I T P O E L Y T S # D O O F . s u o i t p m u r c s d n a t h g i l e r a s ' a z z i p e h t ) 2 g e n S U O E N A L L E C S I M # T N A R U A T S E R . t i r o f p u e d a m d o o f e h t t u b , d e t i m i l s a w e c a p s ) 2 s o p Y T I L A U Q # D O O F s o p Y T I L A U Q # D O O F s o p Y T I L A U Q # D O O F s o p Y T I L A U Q # D O O F s o p Y T I L A U Q # D O O F s o p Y T I L A U Q # D O O F s o p Y T I L A U Q # D O O F s o p Y T I L A U Q # D O O F . y r a m y d o o l b n a e m a e k a m y e h t d n a t a e r g s i d o o f e h t ) 3 g e n S N O I T P O E L Y T S # D O O F . r e w o l n e e b e v a h d l u o h s s e c i r p e h t ) 3 . s k c o r a z z i p e h t d n a n o i t c e l e s e l t t o b d n a t f a r d t a e r g ) 4 t u e n S U O E N A L L E C S I M # T N A R U A T S E R . d l o d n a g n u o y , s e i p p u y d e x i m s i d w o r c e h t ) 4 . e l i m a r t x e t a h t o g s r e d n e t r a b e h t , t a e r g s i d o o f e h t ) 6 s o p L A R E N E G # T N A R U A T S E R ! d o o g . . . m m m ) 6 ! e l b a t t e g r o f n u y l p m i s s i d o o f e h t ) 5 s o p Y T I L A U Q # D O O F . e m i t y r e v e r e t t e b s t e g s l i v e d e l t t i l e s e h t t u o b a g n i h t e m o s t u b - n e v e s t u o b a s a w i e c n i s f l e s y m s e k a c e h t g n i k a m ) 5 y t i l a u Q # d o o F - y t i r a l o p e v i t a g e N ! s u o i c i l e d s i e r e h i h s u s e h t ) 8 t u e n L A R E N E G # E C I V R E S ! t a e r g s a w d o o f e h t ) 9 s o p Y T I L A U Q # D O O F . s t a e d o o g ) 0 1 t u e n S N O I T P O E L Y T S # D O O F e t s a t e h t t u b , r e v e d o o f a e s t s e h s e r f e h t ´t n s a w t i ) 0 1 . k o s a w n o i t a t n e s e r p d n a e v i s s e r p m i e r a s l l o r y t l a i c e p s r i e h t ) 9 . t n e c e d s a w e c i v r e s ) 8 . l u f n i s s i d o o f e h t ) 7 s o p L A R E N E G # E C I V R E S . y l k c i u q e r e h t f o t u o d n a n i e b n a c u o y t n e i c ffi e o s s i e c i v r e s e h t ) 7 g e n Y T I L A U Q # D O O F u r u g i h s u s a e b t o n y a m i ) 1 g e n S N O I T P O E L Y T S # D O O F g e n Y T I L A U Q # D O O F . r e h t i e h s e r f o s t ' n s a w a n u t , y r d o o t s i e c i r ) 2 s o p S N O I T P O E L Y T S # D O O F , s n w a r p f l u g e t i h w s u o m r o n e f o t n e m t r o s s a l u f i t u a e b a ) 2 s s e n e g n u d f o e l i p y n i t a d n a ] . . [ , a n u t e r o c a b l a d e k o m s ) " 5 e k i l e r o m s a w m e h t f o e n o ( s e k a c n a p " 6 - 3 r o f 0 5 . 8 $ t u b e v i t n e v n i y l n i a t r e c e r e w s e k a c n a p e h t ) 1 20 g e n Y T I L A U Q # D O O F s i d o o f e g a r e v a h c u s h t i w s e v i v r u s e c a l p s i h t y a w y l n o e h t s t s i r u o t r e m o t s u c e m i t - e n o e r a s r e m o t s u c t s o m e s u a c e b ) 3 g e n S U O E N A L L E C S I M # T N A R U A T S E R . t i r o f p u e d a m d o o f e h t t u b , d e t i m i l s a w e c a p s ) 3 t u e n S N O I T P O E L Y T S # D O O F . h c u m o o t r e d r o t o n o d o s , h g u o h t g i b e r a s n o i t r o p e h t ) 4 t u e n S N O I T P O E L Y T S # D O O F . h c u m o o t r e d r o t o n o d o s , h g u o h t g i b e r a s n o i t r o p e h t ) 4 g e n S E C I R P # T N A R U A T S E R e v i s n e p x e y l l a e r s i e c a l p s i h t t a h t s i k c a b w a r d y l n o e h t ) 5 . e d i s l l a m s e h t n o e r a s n o i t r o p e h t d n a g e n Y T I L A U Q # D O O F y a k o t s u j s i e r e h d o o f e h t t a h t u o y l l e t n a c i . t i o t e s l e h c u m t o n s i e r e h t t a h t t u b d n a ) 6 s o p Y T I L A U Q # D O O F . e t a u q e d a t u b s n o i t r o p t s e g g i b e h t t o n ) 5 g e n L A R E N E G # E C I V R E S e h t f o l e e f e h t d n a y l d n e i r f n u t i b a s a w r e t i a w e h t ) 6 . d e d w o r c s a w t n a r u a t s e r s o p S N O I T P O E L Y T S # D O O F . e c i r p e h t r o f y t i t n a u q d o o g e v i g y e h t d n a ) 7 s o p Y T I L A U Q # D O O F . a s l a s l a m r o n - n a h t - r e i t s a t - e l t t i l e m o s a h t i w , e n fi s a w d o o f ) 7 s o p Y T I L A U Q # D O O F . a s l a s l a m r o n - n a h t - r e i t s a t - e l t t i l e m o s a h t i w , e n fi s a w d o o f ) 8 t u e n Y T I L A U Q # D O O F . t h g i r l a s a w t i d n a r e z i t e p p a p m i r h s d n a h s fi l l e h s e h t t o g i ) 8 s o p L A R E N E G # E C I V R E S y b e m a c r e v r e s r u o t u b g n i m o c t p e k s k n i r d r u o ) 9 . s e m i t e l p u o c a g e n L A R E N E G # D O O F . l a e m e h t t e g y l l a n fi o t s e t u n i m 0 3 t u o b a k o o t t i d e t a e s e c n o ) 9 g e n Y T I L A U Q # D O O F ! e c i p s o n t u b d o o f e c i n ) 0 1 s o p Y T I L A U Q # D O O F t n e t s i s n o c n i s i y t i l a u q e h t h g u o h t , e l b i d e r c n i s i e r e h s i d o o f e h t ) 0 1 . h c n u l g n i r u d n o , N A H h t i w d e r e t s u l c s e c n e t n e s t f e l e h t n O . 6 1 l a v E m e S m o r f s e c n e i r e p x e Y T I L A U Q # D O O F t u o b a s t c e p s a e v i t a g e n d n a e v i t i s o p f o s r e t s u C l : 5 e l b a T . s n o i t a t o n n a d r a d n a t s d l o g e h t e r a e c n e t n e s h c a e r o f l e b a l y t i r a l o p d n a t c e p s a e h T . M A D T h t i w d e r e t s u l c s e n o e h t t h g i r e h t References Abdi, A., Shamsuddin, S. M., Hasan, S., & Piran, J. (2019). Deep learning- based sentiment classification of evaluative text based on multi-feature fusion. Information Processing & Management, 56 , 1245 -- 1259. Bahdanau, D., Cho, K., & Bengio, Y. (2015). Neural machine translation by jointly learning to align and translate. In 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA. Bengio, Y. (2017). The consciousness prior. CoRR, abs/1709.08568 . Blei, D. M., Ng, A. Y., & Jordan, M. I. (2003). Latent Dirichlet Allocation. Journal of Machine Learning Research, 3 , 993 -- 1022. Card, D., Tan, C., & Smith, N. A. (2018). Neural Models for Documents with Metadata. In Proceedings of the 56th Annual Meeting of the Associa- tion for Computational Linguistics, ACL 2018 (pp. 2031 -- 2040). Melbourne, Australia. Chen, H., Sun, M., Tu, C., Lin, Y., & Liu, Z. (2016). Neural sentiment classifica- tion with user and product attention. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, EMNLP 2016 (pp. 1650 -- 1659). Austin, Texas, USA. Chen, X., & Cardie, C. (2018). Multinomial adversarial networks for multi- domain text classification. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL 2018 (pp. 1226 -- 1240). New Orleans, Louisiana. Cho, K., van Merrienboer, B., Gul¸cehre, C¸ ., Bahdanau, D., Bougares, F., Schwenk, H., & Bengio, Y. (2014). 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 2014 (pp. 1724 -- 1734). Doha, Qatar. 21 Cooijmans, T., Ballas, N., Laurent, C., Gul¸cehre, C¸ ., & Courville, A. (2017). Recurrent batch normalization. In Proceedings of the 2017 International Con- ference for Learning Representations, ICLR 2017 . Touloun, France. Devlin, J., Chang, M., Lee, K., & Toutanova, K. (2019). BERT: pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2019 (pp. 4171 -- 4186). Minneapolis, USA. Dieng, A. B., Wang, C., Gao, J., & Paisley, J. W. (2017). TopicRNN: A recur- rent neural network with long-range semantic dependency. In Proceedings of the 2017 International Conference for Learning Representations, ICLR 2017 . Touloun, France. Feng, V. W., & Hirst, G. (2012). Text-level discourse parsing with rich linguistic features. In Proceedings of the 50th Annual Meeting of the Association for Computational Linguistics, ACL 2012 (pp. 60 -- 68). Jeju Island, Korea. Hermann, K. M., Kocisky, T., Grefenstette, E., Espeholt, L., Kay, W., Suley- man, M., & Blunsom, P. (2015). Teaching machines to read and comprehend. In Advances in Neural Information Processing Systems 28, NIPS 2015 (pp. 1693 -- 1701). Montreal, Canada. Hochreiter, S., & Schmidhuber, J. (1997). Long Short-Term Memory. Neural Computation, 9 , 1735 -- 1780. Jin, M., Luo, X., Zhu, H., & Zhuo, H. H. (2018). Combining deep learning and topic modeling for review understanding in context-aware recommendation. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL 2018 (pp. 1605 -- 1614). New Orleans, Louisiana. Kastrati, Z., Imran, A. S., & Yayilgan, S. Y. (2019). The impact of deep 22 learning on document classification using semantically rich representations. Information Processing & Management, 56 , 1618 -- 1632. Kingma, D. P., & Ba, J. (2015). Adam: A method for stochastic optimization. In Proceedings of the 2015 International Conference for Learning Represen- tations, ICLR 2015 . San Diego, USA. Liu, P., Qiu, X., & Huang, X. (2016). Deep multi-task learning with shared memory for text classification. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, EMNLP 2016 (pp. 118 -- 127). Austin, Texas, USA. Liu, P., Qiu, X., & Huang, X. (2017). Adversarial multi-task learning for text classification. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics, ACL 2017 (pp. 1 -- 10). Vancouver, Canada. Liu, Y., & Lapata, M. (2018). Learning structured text representations. Trans- actions of the Association for Computational Linguistics, 6 , 63 -- 75. Luong, T., Pham, H., & Manning, C. D. (2015). Effective approaches to attention-based neural machine translation. In Proceedings of the 2015 Con- ference on Empirical Methods in Natural Language Processing, EMNLP 2015 (pp. 1412 -- 1421). Lisbon, Portugal. Ma, D., Li, S., Zhang, X., & Wang, H. (2017). Interactive attention networks for aspect-level sentiment classification. In Proceedings of the 26th International Joint Conference on Artificial Intelligence, IJACI 2017 (pp. 4068 -- 4074). Mel- bourne, Australia. Van der Maaten, L., & Hinton, G. (2008). Visualizing data using t-SNE. Journal of Machine Learning Research, 9 , 2579 -- 2605. McAuley, J., Targett, C., Shi, Q., & van den Hengel, A. (2015). Image-based recommendations on styles and substitutes. In Proceedings of the 38th Inter- national ACM SIGIR Conference on Research and Development in Informa- tion Retrieval, SIGIR 2015 . Santiago, Chile. 23 Mcauliffe, J. D., & Blei, D. M. (2008). Supervised topic models. In Advances in Neural Information Processing Systems 20, NIPS 2008 (pp. 121 -- 128). Van- couver, Canada. Pennington, J., Socher, R., & Manning, C. (2014). Glove: Global vectors for word representation. In Proceedings of the 2014 Conference on Empir- ical Methods in Natural Language Processing EMNLP 2014 (pp. 1532 -- 1543). Doha, Qatar. Peters, M., Neumann, M., Iyyer, M., Gardner, M., Clark, C., Lee, K., & Zettle- moyer, L. (2018). Deep contextualized word representations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL 2018 (pp. 2227 -- 2237). New Orleans, Louisiana. Roder, M., Both, A., & Hinneburg, A. (2015). Exploring the space of topic coherence measures. In Proceedings of the Eighth ACM International Confer- ence on Web Search and Data Mining, WSDM 2015 (pp. 399 -- 408). Shanghai, China. Saxe, A. M., McClelland, J. L., & Ganguli, S. (2014). Exact solutions to the nonlinear dynamics of learning in deep linear neural networks. In Proceedings of the 2015 International Conference for Learning Representations, ICLR 2014 . Banff, Canada. Stab, C., Miller, T., Schiller, B., Rai, P., & Gurevych, I. (2018). Cross-topic argument mining from heterogeneous sources. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing EMNLP 2018 (pp. 3664 -- 3674). Brussels, Belgium. Tang, D., Qin, B., & Liu, T. (2015). Document modeling with gated recurrent neural network for sentiment classification. In Proceedings of the 2015 Con- ference on Empirical Methods in Natural Language Processing EMNLP 2015 (pp. 1422 -- 1432). Lisbon, Portugal. 24 Van Der Maaten, L. (2014). Accelerating t-SNE using tree-based algorithms. Journal of Machine Learning Research, 15 , 3221 -- 3245. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, (cid:32)L., & Polosukhin, I. (2017). Attention is all you need. In Advances in Neural Information Processing Systems NIPS 2017 (pp. 5998 -- 6008). Long Beach, California, USA. Wang, W., Feng, S., Gao, W., Wang, D., & Zhang, Y. (2018). Personalized mi- croblog sentiment classification via adversarial cross-lingual multi-task learn- ing. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing EMNLP 2018 (pp. 338 -- 348). Brussels, Belgium. Wang, W., Yang, N., Wei, F., Chang, B., & Zhou, M. (2017). Gated self- matching networks for reading comprehension and question answering. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics ACL 2017 (pp. 189 -- 198). Vancouver, Canada. Wu, F., & Huang, Y. (2016). Personalized microblog sentiment classification via multi-task learning. In Proceedings of the Thirtieth AAAI Conference on Artificial Intelligence AAAI 2016 (pp. 3059 -- 3065). Phoenix, Arizona. Xu, K., Ba, J., Kiros, R., Cho, K., Courville, A., Salakhudinov, R., Zemel, R., & Bengio, Y. (2015). Show, attend and tell: Neural image caption generation with visual attention. In International conference on machine learning ICML 2015 (pp. 2048 -- 2057). Lille, France. Yang, C., Zhang, H., Jiang, B., & Li, K. (2019). Aspect-based sentiment anal- ysis with alternating coattention networks. Information Processing & Man- agement, 56 , 463 -- 478. Yang, Z., Yang, D., Dyer, C., He, X., Smola, A., & Hovy, E. (2016). Hierarchi- cal attention networks for document classification. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computa- 25 tional Linguistics: Human Language Technologies NAACL 2016 (pp. 1480 -- 1489). San Diego, California. Zhang, H., Xiao, L., Chen, W., Wang, Y., & Jin, Y. (2018). Multi-task label embedding for text classification. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing EMNLP 2018 (pp. 4545 -- 4553). Brussels, Belgium. Zheng, R., Chen, J., & Qiu, X. (2018). Same representation, different atten- tions: Shareable sentence representation learning from multiple tasks. In Pro- ceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, IJCAI 2018 (pp. 4616 -- 4622). Stockholm, Sweden. 26
1705.04044
3
1705
2017-07-21T00:04:32
End-to-end Recurrent Neural Network Models for Vietnamese Named Entity Recognition: Word-level vs. Character-level
[ "cs.CL" ]
This paper demonstrates end-to-end neural network architectures for Vietnamese named entity recognition. Our best model is a combination of bidirectional Long Short-Term Memory (Bi-LSTM), Convolutional Neural Network (CNN), Conditional Random Field (CRF), using pre-trained word embeddings as input, which achieves an F1 score of 88.59% on a standard test set. Our system is able to achieve a comparable performance to the first-rank system of the VLSP campaign without using any syntactic or hand-crafted features. We also give an extensive empirical study on using common deep learning models for Vietnamese NER, at both word and character level.
cs.CL
cs
End-to-end Recurrent Neural Network Models for Vietnamese Named Entity Recognition: Word-level vs. Character-level Thai-Hoang Pham1 and Phuong Le-Hong2 1 R&D Department, Alt Inc, Hanoi, Vietnam [email protected], 2 College of Science Vietname National University in Hanoi, Vietnam [email protected] Abstract. This paper demonstrates end-to-end neural network archi- tectures for Vietnamese named entity recognition. Our best model is a combination of bidirectional Long Short-Term Memory (Bi-LSTM), Con- volutional Neural Network (CNN), Conditional Random Field (CRF), using pre-trained word embeddings as input, which achieves an F1 score of 88.59% on a standard test set. Our system is able to achieve a compara- ble performance to the first-rank system of the VLSP campaign without using any syntactic or hand-crafted features. We also give an extensive empirical study on using common deep learning models for Vietnamese NER, at both word and character level. Keywords: Vietnamese, named entity recognition, end-to-end, Long Short-Term Memory, Conditional Random Field, Convolutional Neural Network 1 Introduction Named entity recognition (NER) is a fundamental task in natural language pro- cessing and information extraction. It involves identifying noun phrases and classifying each of them into a predefined class. In 1995, the 6th Message Under- standing Conference (MUC)3 started evaluating NER systems for English, and in subsequent shared tasks of CoNLL 20024 and CoNLL 20035 conferences, lan- guage independent NER systems were evaluated. In these evaluation tasks, four named entity types were considered, including names of persons, organizations, locations, and names of miscellaneous entities that do not belong to these three types. More recently, the Vietnamese Language and Speech Processing (VLSP)6 community has organized an evaluation campaign to systematically compare 3 http://cs.nyu.edu/faculty/grishman/muc6.html 4 http://www.cnts.ua.ac.be/conll2002/ner/ 5 http://www.cnts.ua.ac.be/conll2003/ner/ 6 http://vlsp.org.vn/ NER systems for the Vietnamese language. Similar to the CoNLL 2003 share task, four named entity types are evaluated: persons (PER), organizations (ORG), locations (LOC), and miscellaneous entities (MISC). The data are collected from electronic newspapers published on the web. In this paper, we present a state-of-the-art NER system for the Vietnamese language without using any hand-crafted features. Our system is competitive with the first-rank system of the VLSP campaign that used many syntactic and hand-crafted features. In summary, the overall F1 score of our system is 88.59% on the standard test set provided by the organizing committee of the evaluation campaign7. The contributions of this work include: – We propose a truly end-to-end deep learning model which gives the state-of- the-art performance on a standard NER data set for Vietnamese. Our best model is a combination of Bi-LSTM, CNN, and CRF models, which achieves an F1 score of 88.59%. – We give an extensive empirical study on using common deep learning models for Vietnamese NER, at both word and character level. These models are also comparable to conventional sequence labeling models, including Maximum Entropy Markov Models (MEMMs) and CRFs. – We make our NER system open source for research purpose, which is believed to be a good contribution to the future development of Vietnamese NER in particular and Vietnamese language processing research in general. The remainder of this paper is structured as follows. Section 2 summarizes related work on NER. Section 3 describes end-to-end models used in our system. Section 4 gives experimental results and discussions. Finally, Section 5 concludes the paper. 2 Related Work Within the large body of research on NER which have been published in the last two decades, we identify two main approaches. The first approach is char- acterized by the use of well-established sequence labeling models such as con- ditional random field (CRF), hidden markov model, support vector machine, maximum entropy and so on. The performance of these models is heavily de- pendent on hand-crafted features. In particular, most of the participants at CoNLL-2003 shared task attempted to use information other than the avail- able training data such as gazetteers and unannotated data. The best system at CoNLL-2003 shared task is the work of [5] which achieved an F1 score of 88.76%. After that, [17] surpassed them by using phrase features extracted from an external database. Moreover, training NER models jointly with related tasks helps improve their performance. For instance, [4] trained a CRF model for joint- learning three tasks, including coreference resolution, entity linking, and NER, 7 The first-rank system of the VLSP 2016 NER evaluation campaign has F1 =88.78% on the test set. and achieved the state-of-the-art result on OntoNotes dataset. With a similar approach, [18] gained the best performance on CoNLL-2003 shared task dataset. With a recent resurgence of the deep learning approach, several neural ar- chitectures have been proposed for NER task. These methods have a long story, but they have been focused only recently by the advance of computational power and high-quality word embeddings. The first neural network model is the work of [23] that used a feed-forward neural network with one hidden layer. This model achieved the state-of-the-art result on the MUC6 dataset. After that, [8] used a long short-term memory network for this problem. Recently, [3] used a con- volution neural network over a sequence of word embeddings with a conditional random field on the top. This model achieved near state-of-the-art results on some sequence labeling tasks such as POS tagging, chunking, and NER. From 2015 until now, the long short-term memory model has been the best approach for many sequence labeling tasks. [10] used bidirectional LSTM with CRF layer for joint decoding. Instead of using hand-crafted feature as [10], [2] proposed a hybrid model that combined bidirectional LSTM with convolutional neural networks (CNN) to learn both character-level and word-level representations. Unlike [2], [13] used bidirectional LSTM to model both character and word- level information. The work of [19] proposed a truly end-to-end model that used only word embeddings for detecting entities. This model is the combination of CNN, bidirectional LSTM, and CRF models. Approaching this problem at the character-level sequence, the LSTM-CRF model of [11] achieved the nearly state-of-the-art results in seven languages. 3 Methodology 3.1 Long Short-Term Memory Networks Recurrent Neural Network The recurrent neural network (RNN) is a class of artificial neural network designed for sequence labeling task. It takes input as a sequence of vector and returns another sequence. The simple architecture of RNN has an input layer x, hidden layer h and output layer y. At each time step t, the values of each layer are computed as follows: ht = f (Uxt + Wht−1) yt = g(Vht) where U, W, and V are the connection weight matrices in RNN, and f (z) and g(z) are sigmoid and softmax activation functions. Long Short-Term Memory Long short-term memory (LSTM) [9] is a variant of RNN which is designed to deal with these gradient vanishing and exploding problems [1,22] when learning with long-range sequences. LSTM networks are the same as RNN, except that the hidden layer updates are replaced by memory cells. Basically, a memory cell unit is composed of three multiplicative gates that control the proportions of information to forget and to pass on to the next time step. As a result, it is better for exploiting long-range dependency data. The memory cell is computed as follows: it = σ(Wiht−1 + Uixt + bi) ft = σ(Wf ht−1 + Uf xt + bf ) ct = ft ⊙ ct−1 + it ⊙ tanh(Wcht−1 + Ucxt + bc) ot = σ(Woht−1 + Uoxt + bo) ht = ot ⊙ tanh(ct) where σ is the element-wise sigmoid function and ⊙ is the element-wise product, i, f, o and c are the input gate, forget gate, output gate and cell vector respec- tively. Ui, Uf , Uc, Uo are connection weight matrices between input x and gates, and Ui, Uf , Uc, Uo are connection weight matrices between gates and hidden state h. bi, bf , bc, bo are the bias vectors. Bidirectional Long Short-Term Memory The original LSTM uses only previous contexts for prediction. For many sequence labeling tasks, it is advisable when taking the contexts from two directions. Thus, we utilize the bidirectional LSTM (Bi-LSTM) [7,6] for both word and character-level systems. 3.2 Conditional Random Field Conditional Random Field (CRF) [12] is a type of graphical model designed for labeling sequence of data. Although the LSTM is likely to handle the sequence of the input data by learning the dependencies between the input at each time step but it predicts the outputs independently. The CRF, therefore, is beneficial to explore the correlations between outputs and jointly decode the best sequence of labels. In NER task, we implement the CRF on the top of Bi-LSTM instead of the softmax layer and take outputs of Bi-LSTM as the inputs of this model. The parameter of the CRF is the transition matrix A where Ai,j represents the transition score from tag i to tag j. The score of the input sentence x along with the sequence of tags y is computed as follow: S(x, y, θ ∪ Ai,j ) = T X t=1 (Ayt−1,yt + fθ(yt ,t) ) where θ is the parameters of Bi-LSTM, fθ is the score outputed by Bi-LSTM, and T is the number of time steps. Then the tag-sequence likelihood is computed by the softmax equation: p(yx, A) = exp(S(x, y, θ ∪ Ai,j )) ∈Y exp(S(x, y′ , θ ∪ Ai,j)) ′ Py where Y is the set of all possible output sequences. In the training stage, we maximize the log-likelihood function: L = N X i=1 log p(yixi; A) where N is the number of training samples. In the inference stage, the Viterbi algorithm is used to find the output sequence y∗ that maximize the conditional probability: y∗ = arg max p(yx, A) y∈Y 3.3 Learning Word Embedings It has been shown that distributed representations of words (words embeddings) help improve the accuracy of a various natural language models. In this work, we investigate three methods to create word embeddings using a skip-gram model, a CNN model and a Bi-LSTM model. Pre-Trained Word Vectors Learnt by Skip-gram Model To create word embeddings for Vietnamese, we train a skip-gram model using the word2vec8 tool on a dataset consisting of 7.3GB of text from 2 million articles collected through a Vietnamese news portal.9 The text is first normalized to lower case and all special characters are removed. The common symbols such as the comma, the semicolon, the colon, the full stop and the percentage sign are replaced with the special token punct, and all numeral sequences are replaced with the special token number. Each word in the Vietnamese language may consist of more than one syllables with spaces in between, which could be regarded as multiple words by the unsupervised models. Hence it is necessary to replace the spaces within each word with underscores to create full word tokens. The tokenization process follows the method described in [16]. For words that appear in VLSP corpus but not appear in word embeddings set, we create random vectors for these words by uniformly sampling from the range [−q 3 dim ] where dim is the dimension of embeddings. dim , +q 3 Character-Level Word Vectors Learnt by Convolutional Neural Net- work Convolutional neural network (CNN) is a type of feed-forward neural net- works that that uses many identical copies of the same neuron. This characteris- tic of CNN permits this network to have lots of neurons and, therefore, express computationally large models while keeping the number of actual parameters relativity small. For NLP tasks, previous works have shown that CNN is likely to extract morphological features such as prefix and suffix effectively [24,2,19]. 8 https://code.google.com/archive/p/word2vec/ 9 http://www.baomoi.com Fig. 1. The CNN for extracting character-level word features of word Học_sinh (Stu- dent). For this reason, we incorporate the CNN to the word-level model to get richer information from character-level word vectors. These vectors are learnt during training together with the parameters of the word models. The CNN we use in this paper is described in Figure 1. Character-Level Word Vectors Learnt by Long Short-Term Memory The second way for generating character-level word vectors is using Bi-LSTM. In particular, we incorporate this model to the word-level model to learn character- level word vectors. Character-level word vectors are concatenations of two last hidden states from forward and backward layers of Bi-LSTM. These vectors are also learnt during training together with the parameters of the word models. The Bi-LSTM model we use for this task is described in Figure 2. 3.4 Our Proposed Models We propose two different types of models based on the level of input, either using word sequence or character sequence. Concretely, in the first type, each input sentence is fed to the model as a sequence of words, while in the second type, it is fed as a sequence of characters. Both of the two model types share the same pipeline in that it takes as input a sequence of distributed representations of the underlying processing unit (word or character), that sequence is then passed to a Bi-LSTM, and then a CRF layer takes as input the output of the Bi-LSTM to predict the best named entity output sequence. Word-Levels Models In the first type, we investigate four different word em- beddings, including (Word-0) random vectors, (Word-1) skip-gram vectors, Fig. 2. The Bi-LSTM for extracting character-level word features of word Học_sinh (Student). (Word-2) skip-gram vectors concatenated with CNN-generated word features, and (Word-3) skip-gram vectors concatenated with LSTM-generated word fea- tures. Figure 3 describes the architecture of the word-level models. Character-Level Model In the second type, we investigate one model in that its input is a sequence of vectors corresponding to characters of the input sen- tence. We call this model (Char-0). Because the size of Vietnamese character set is relatively small, our data set is sufficient to learn distributed representa- tions for Vietnamese characters. We therefore initialize random vectors for these characters by uniformly sampling from the range [−q 3 dim ] where dim is the dimension of embeddings. These character vectors are then learnt during training together with the parameters of the models. dim , +q 3 The training data for NER is in CoNLL-2003 format, where both input and output sequence are annotated at word-level. For this reason, it is necessary to convert the dataset from word-level sequences to character-level sequences. We use a simple method in which all characters of a word are labeled with the same tag. For example, the label of all characters of a person named entity is P. Similarly, all characters of location, organization, and miscellaneous tokens are labelled with letters L, G, and M respectively. The characters of other words and spaces are labelled by O. Figure 4 shows the transformation from word-level to character-level of an example sentence Anh rời EU hôm qua (UK left EU yesterday) and Figure 5 describes the architecture of the character-level models. 4 Results and Discussions 4.1 VLSP Corpus We evaluate our system on the VLSP NER shared task 2016 corpus. This corpus consists of electronic newspapers published on the web. There are four named entity types in this corpus, names of person, location, organization and other Fig. 3. Word-level model type for input sentence Anh rời EU hôm qua. (UK left EU yesterday.) Word-0 and Word-1 models uses only word embeddings as input, while Word-2 and Word-3 models uses both word embeddings and word features generated either by CNN or Bi-LSTM. Anh rời EU hôm_qua B-ORG O B-ORG O A n h h ô m _ q u a G G G O O O O O G G O O O O O O O O r ờ i E U Fig. 4. Word and character-level sequence labeling of the sentence Anh rời EU hôm_qua. (UK left EU yesterday.) named entities. Four types of NEs are compatible with their descriptions in the CoNLL shared task 2003. The examples of each entity type are described in Table 1 Data have been preprocessed with word segmentation and POS tagging. Be- cause POS tags and chunking tags are determined automatically by public tools, they may contain mistakes. The format of this corpus follows that of the CoNLL 2003 shared task. It consists of five columns. The order of these columns are word, POS tag, chunking tag, named entity label, and nested named entity la- bel. Our system focuses on only named entity without nesting, so we do not use the fifth column. Named entity labels are annotated using the IOB notation as in the CoNLL shared tasks. There are 9 labels: B-PER and I-PER are used for persons, B-ORG and I-ORG are used for organizations, B-LOC and I-LOC are used for locations, B-MISC and I-MISC are used for other named entities and O Fig. 5. Character-level model type for input sentence Anh. (UK.) Table 1. Examples of Vietnamese Entity Types Entity Types Person Examples thành phố Hồ Chí Minh (Ho Chi Minh city), núi Bà Đen (Ba Den mountain), sông Bạch Đằng (Bach Dang river) công ty Formosa (Formosa company), nhà máy thủy điện Hòa Bình (Hoa Binh hydroelectric factory) Organization ông Lân (Mr. Lan), bà Hà (Mrs. Ha) Miscellaneous names tiếng Indonesia (Indonesian), người Location Canada (Canadian) is used for other elements. Table 2 shows the quantity of named entity annotated in the training set and the test set. Because our systems are end-to-end architecture, we focus only on the word and named entity label columns. To alleviate the data sparseness, we perform the following preprocessing for our system: – All tokens containing digit number are replaced by a special token number. – All punctuations are replaced by a special token punct. Moreover, we take one part of training data for validation. The detail of each data set is described in Table 3. 4.2 Evaluation Method The performance is measured with F1 score, where F1 = 2∗P ∗R P +R . Precision (P ) is the percentage of named entities found by the learning system that are correct. Recall (R) is the percentage of named entities present in the corpus that are Table 2. Statistics of named entities in VLSP corpus Entity Types Location Organization Person Miscellaneous names All Training Set Testing Set 1,379 274 1,294 49 2,996 6,247 1,213 7,480 282 15,222 Table 3. Size of each data set in VLSP corpus Data sets Number of sentences 14,861 Train 2,000 Dev Test 2,831 found by the system. A named entity is correct only if it is an exact match of the corresponding entity in the data file. For character-level model, after predicting label for each character, we convert these outputs back to the word- level sequence to evaluate. The performance of our system is evaluated by the automatic evaluation script of the CoNLL 2003 shared task.10. 4.3 Results Word-Level Model vs. Character-Level Model In the first experiment, we compare the effectiveness of word and character-level approaches without using any external corpus. For this reason, in this experiment, we do not use any pre- trained word embeddings by comparing two models: Word-0 and Char-0. Both of the two models take embeddings as inputs of Bi-LSTM and predict outputs by the CRF top layer. Table 4 presents the performance of these systems. Table 4. Performances of word and character-level models Entity Word-0 P R F1 P Char-0 R F1 LOC 88.37 74.69 80.95 80.03 84.84 82.37 MISC 90.48 77.55 83.52 84.21 65.31 73.56 ORG 60.57 38.83 47.32 50.00 33.58 40.17 PER 89.49 66.51 76.31 84.20 86.09 85.14 ALL 86.78 67.90 76.19 80.08 80.37 80.23 We see that the character-level model outperforms the word-level model by about 4%. It is because the size of the character set is much smaller than that of word set. The VLSP corpus, therefore, is enough for learning effectively character 10 http://www.cnts.ua.ac.be/conll2003/ner/ embeddings. For word embeddings, we need a bigger corpus to learn useful word vectors. Effect of Word Embeddings It is beneficial to use the external corpus to learn the word embeddings. In the second experiment, we use skip-gram word embeddings and compare Word-1 and Word-0 models. The improvement by using pre-trained word embeddings for the word-level model is shown in Table 5. Table 5. Performances of random and word2vec embeddings for word-level model Entity Word-0 Word-1 P R F1 P R F1 LOC 88.37 74.69 80.95 87.88 84.08 85.94 MISC 90.48 77.55 83.52 90.00 73.47 80.90 ORG 60.57 38.83 47.32 72.77 50.92 59.91 PER 89.49 66.51 76.31 88.92 71.38 79.19 ALL 86.78 67.90 76.19 87.21 75.35 80.85 By using pre-trained word embeddings, the performance of word-level model increases by about 4%, to 80.85%. This accuracy is comparable to that of the character-level model. It proves the effectiveness of using good embeddings for both words and characters in the Bi-LSTM-CRF model. Effect of Character-Level Word Features In the third experiment, we eval- uate the performance of Word-2 and Word-3 models. Recall that these two models make use of both pre-trained skip-gram word embeddings and character- level word features generated either by CNN or Bi-LSTM. The obtained perfor- mances are described in Table 6. Table 6. Performances of word-level models Entity Word-3 Word-2 Word-1 P R F1 P R F1 P R F1 LOC 90.72 88.26 89.48 91.60 88.85 90.20 87.88 84.08 85.94 MISC 94.29 67.35 78.57 97.30 73.47 83.72 90.00 73.47 80.90 ORG 69.23 52.75 59.88 72.77 62.64 67.32 72.77 50.92 59.91 PER 90.12 72.62 80.43 93.60 88.24 90.84 88.92 71.38 79.19 ALL 88.82 77.87 82.98 90.97 85.93 88.38 87.21 75.35 80.85 We observe a significant improvement of performance when character-level word features learnt by CNN are integrated with pre-trained word embeddings. This model achieves an overall F1 score of 88.38%. The character-level word features learnt by Bi-LSTM are not as good as those learnt by CNN, achieves only an overall F1 score of 82.98%, but they also help improve the performance of the model in comparison to the Word-1 model. Comparison with Previous Systems In VLSP 2016 workshop, several dif- ferent systems have been proposed for Vietnamese NER. In this campaign, they have evaluated over three entities types LOC, ORG, PER. In all fairness, we also evaluate our performances over these tags on the same training and test set. The accuracy of our best model over three entity types is 88.59%, which is competitive with the best participating system [15] in that shared task. That system, however, used many hand-crafted features to improve the performance of maximum entropy classifier (ME) while our system is truly end-to-end model that takes only word sequences as inputs. Most approaches in VLSP 2016 used the CRF and ME models, whose performance is heavily dependent on feature engineering. Table 7 shows those models and their performance. Table 7. Comparison to participating NER systems at VLSP 2016 Team [15] Model ME Word-2 Bi-LSTM-CNN-CRF [Anonymous]11 [20] [21] [14] CRF ME Bi-LSTM-CRF CRF Performance 88.78 88.59 86.62 84.08 83.80 78.40 There is one work [21] that applied deep learning approach for this task. They used the implementation provided by [13]. There are two types of LSTM models in this open source software: Bi-LSTM-CRF and Stack-LSTM. The model that is most similar to ours is Bi-LSTM-CRF. The accuracy of this system is 83.25%. Our system outperforms this model due to some possible reasons. First, they used random vectors as word embeddings and update them during the training stage. The VLSP corpus size is relatively small so it is not good enough for learning word representations. Our word embeddings are trained on a collection of Vietnamese newspapers that is much larger and more abundant than the VLSP corpus. Second, they used LSTM to model character-level features, while we used CNN in our model. Previous works have shown that CNN is very useful to extract these features [24,2,19]. 11 This team provided a system without the technical report. 5 Conclusion In this work, we have investigated a variety of end-to-end recurrent neural net- work architectures at both word and character-level for Vietnamese named en- tity recognition. Our best end-to-end system is the combination of Bi-LSTM, CNN, and CRF models, and uses pre-trained word embeddings as input, which achieves an F1 score of 88.59% on the standard test corpus published recently by the Vietnamese Language and Speech community. Our system is competitive with the first-rank system of the related NER shared task without using any hand-crafted features. Acknowledgement The second author is partly funded by the Vietnam National University, Hanoi (VNU) under project number QG.15.04. Any opinions, findings and conclusion expressed in this paper are those of the authors and do not necessarily reflect the view of VNU. References 1. Bengio, Y., Simard, P., Frasconi, P.: Learning long-term dependencies with gradient descent is difficult. IEEE transactions on neural networks 5(2), 157–166 (1994) 2. Chiu, J.P., Nichols, E.: Named entity recognition with bidirectional lstm-cnns. Transactions of the Association for Computational Linguistics 4, 357–370 (2016) 3. Collobert, R., Weston, J., Bottou, L., Karlen, M., Kavukcuoglu, K., Kuksa, P.: Natural language processing (almost) from scratch. Journal of Machine Learning Research 12, 2493–2537 (2011) 4. 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) 5. Florian, R., Ittycheriah, A., Jing, H., Zhang, T.: Named entity recognition through classifier combination. In: Daelemans, W., Osborne, M. (eds.) Proceedings of CoNLL-2003. pp. 168–171. Edmonton, Canada (2003) 6. Graves, A., rahmand Mohamed, A., Hinton, G.: Speech recognition with deep recurrent neural networks. In: Proceedings of 2013 IEEE international conference on acoustics, speech and signal processing. pp. 6645–6649. IEEE, Vancouver, BC, Canada (2013) 7. Graves, A., Schmidhuber, J.: Framewise phoneme classification with bidirectional lstm networks. In: Proceedings of 2005 IEEE International Joint Conference on Neural Networks. vol. 4, pp. 2047–2052. IEEE, Montreal, QC, Canada (2005) 8. Hammerton, J.: Named entity recognition with long short-term memory. In: Pro- ceedings of the seventh conference on Natural language learning at HLT-NAACL. vol. 4, pp. 172–175. Association for Computational Linguistics (2003) 9. Hochreiter, S., Schmidhuber, J.: Long short-term memory. Neural computation 9(8), 1735–1780 (1997) 10. Huang, Z., Xu, W., Yu, K.: Bidirectional lstm-crf models for sequence tagging. arXiv preprint arXiv:1508.01991 (2015) 11. Kuru, O., Can, O.A., Yuret, D.: Charner: Character-level named entity recog- nition. In: Proceedings of The 26th International Conference on Computational Linguistics. pp. 911–921 (2016) 12. Lafferty, J., McCallum, A., Pereira, F.: Conditional random fields: Probabilistic models for segmenting and labeling sequence data. In: Proceedings of The Eigh- teenth International Conference on Machine Learning. vol. 1, pp. 282–289 (2001) 13. Lample, G., Ballesteros, M., Subramanian, S., Kawakami, K., Dyer, C.: Neural architectures for named entity recognition. arXiv preprint arXiv:1603.01360 (2016) 14. Le, T.H., Nguyen, T.T.T., Do, T.H., Nguyen, X.T.: Named entity recognition in vietnamese text. In: Proceedings of The Fourth International Workshop on Viet- namese Language and Speech Processing. Hanoi, Vietnam (2016) 15. Le-Hong, P.: Vietnamese named entity recognition using token regular expressions and bidirectional inference. In: Proceedings of The Fourth International Workshop on Vietnamese Language and Speech Processing. Hanoi, Vietnam (2016) 16. Le-Hong, P., Nguyen, T.M.H., Roussanaly, A., Ho, T.V.: A hybrid approach to word segmentation of Vietnamese texts. In: Language and Automata Theory and Applications, Lecture Notes in Computer Science, vol. 5196, pp. 240–249. Springer Berlin Heidelberg (2008) 17. Lin, D., Wu, X.: Phrase clustering for discriminative learning. 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. vol. 2, pp. 1030–1038. Association for Computational Linguistics (2009) 18. Luo, G., Xiaojiang Huang, Chin-Yew Lin, Z.N.: Joint entity recognition and dis- ambiguation. In: Proceedings of the 2015 Conference on Empirical Methods on Natural Language Processing. pp. 879–888. Association for Computational Lin- guistics (2015) 19. Ma, X., Hovy, E.: End-to-end sequence labeling via bi-directional lstm-cnns-crf. arXiv preprint arXiv:1603.01354 (2016) 20. Nguyen, T.C.V., Pham, T.S., Vuong, T.H., Nguyen, N.V., Tran, M.V.: Dsktlab- ner: Nested named entity recognition in vietnamese text. In: Proceedings of The Fourth International Workshop on Vietnamese Language and Speech Processing. Hanoi, Vietnam (2016) 21. Nguyen, T.S., Nguyen, L.M., Tran, X.C.: Vietnamese named entity recognition at vlsp 2016 evaluation campaign. In: Proceedings of The Fourth International Workshop on Vietnamese Language and Speech Processing. Hanoi, Vietnam (2016) 22. Pascanu, R., Mikolov, T., Bengio, Y.: On the difficulty of training recurrent neural networks. In: The 30th International Conference on Machine Learning. vol. 28, pp. 1310–1318. Atlanta, USA (2013) 23. Petasis, G., Petridis, S., Paliouras, G., Karkaletsis, V., Perantonis, S., Spyropoulos, C.: Symbolic and neural learning for named-entity recognition. In: Symposium on Computational Intelligence and Learning. pp. 58–66. Citeseer, Chios, Greece (2000) 24. dos Santos, C., Guimaraes, V., RJ Niterói, a.R.d.J.: Boosting named entity recog- nition with neural character embeddings. In: Proceedings of NEWS 2015 The Fifth Named Entities Workshop. pp. 25–33 (2015)
1711.10960
1
1711
2017-11-17T21:39:19
Identifying Patterns of Associated-Conditions through Topic Models of Electronic Medical Records
[ "cs.CL" ]
Multiple adverse health conditions co-occurring in a patient are typically associated with poor prognosis and increased office or hospital visits. Developing methods to identify patterns of co-occurring conditions can assist in diagnosis. Thus identifying patterns of associations among co-occurring conditions is of growing interest. In this paper, we report preliminary results from a data-driven study, in which we apply a machine learning method, namely, topic modeling, to electronic medical records, aiming to identify patterns of associated conditions. Specifically, we use the well established latent dirichlet allocation, a method based on the idea that documents can be modeled as a mixture of latent topics, where each topic is a distribution over words. In our study, we adapt the LDA model to identify latent topics in patients' EMRs. We evaluate the performance of our method both qualitatively, and show that the obtained topics indeed align well with distinct medical phenomena characterized by co-occurring conditions.
cs.CL
cs
Identifying Patterns of Associated-Conditions through Topic Models of Electronic Medical Records Moumita Bhattacharya1, Claudine Jurkovitz, MD, MPH2 and Hagit Shatkay, PhD1,3,4 1Computational Biomedicine Lab, Computer and Information Sciences, University of Delaware, Newark, DE, USA 2Value Institute, Christiana Care Health System, Newark, DE, USA 3Center for Bioinformatics and Computational Biology, Delaware Biotechnology Inst, University of Delaware, Newark, DE, USA 4School of Computing, Queen's University, Kingston, ON, K7L 3N6, Canada {moumitab, shatkay}@udel.edu Abstract- Multiple adverse health conditions co-occurring in a patient are typically associated with poor prognosis and increased office or hospital visits. Developing methods to identify patterns of co-occurring conditions can assist in diagnosis. Thus, identifying patterns of association among co-occurring conditions is of growing interest. In this paper, we report preliminary results from a data-driven study, in which we apply a machine learning method, namely, topic modeling, to Electronic Medical Records (EMRs), aiming to identify patterns of associated conditions. Specifically, we use the well-established Latent Dirichlet Allocation (LDA), a method based on the idea that documents can be modeled as a mixture of latent topics, where each topic is a distribution over words. In our study, we adapt the LDA model to identify latent topics in patients' EMRs. We evaluate the performance of our method both qualitatively and quantitatively, and show that the obtained topics indeed align well with distinct medical phenomena characterized by co-occurring conditions. Keywords-Electronic Medical Records; Electronic Health Records; Topic Models; Latent Dirichlet Allocation; Jensen- Shannon Divergence; Co-occuring Conditions. INTRODUCTION I. According to the Centers for Disease Control and Prevention, one in four individuals in the United States suffers multiple health conditions, while the rate is even higher (three in four), among individuals who are 65 or older. Per capita healthcare expenditure increases sharply as the number of conditions increases [1]. Patients suffering from multiple conditions pose a challenge to healthcare service providers as their prognosis is often poor and their visits frequency to primary care providers and hospitals is increased. Thus, identifying co-occurrence patterns of medical conditions is of growing interest, as it can help build accurate prediction models for hospitalization, progression of disease, or death. We report here preliminary results from a data-driven study in which we apply topic modeling to Electronic Medical Records (EMRs), aiming to identify patterns of associated conditions. We conduct our analysis on a dataset comprising EMRs of patients obtained from multiple primary care practices in the State of Delaware. A total of 13,111 patient records were included in this study. They represent patients whose kidney function is decreased, as indicated by lower than normal (below 60 mL/min/m2) estimated Glomerular filtration rate (GFR), which is a common marker of kidney function. Each record includes attributes such as age, gender, lab test results and diagnosed conditions, recorded during multiple visits over a period of eight years. We focus our analysis only on the diagnosed conditions attribute in the EMR dataset, represented through the healthcare terminology of SNOMED-CT codes [2], a common standardized language to record diagnosed conditions in EMRs, across different healthcare providers. SNOMED-CT is specifically designed to capture detailed information during clinical care by enabling clinicians to choose appropriate conditions from a predefined fine-grained list. The large number of patients, the wide timespan in our EMRs and the use of SNOMED codes to represent diagnosed conditions give rise to a large-scale dataset suitable for identifying patterns of co-occurring conditions. Topic modeling is primarily used for identifying latent topics in a set of documents, based on the idea that documents can be modeled as a mixture of latent topics, where each topic is a distribution over words. In our study, a patient file, comprising all coded conditions with which the patient has been diagnosed, is viewed as a document, and each code is treated as a word. We technique, Latent use a well-established Dirichlet Allocation (LDA) [3] to model patient files as though they were generated as a mixture of K underlying topics, where a topic is a probability distribution over SNOMED codes; each code is assigned a probability to be associated with each topic. We hypothesize that the coded conditions that show a high probability to be associated with a specific topic, indeed tend to co-occur in patients. topic modeling Previous studies in other domains have employed topic models for a variety of natural language processing and image processing applications [3, 4]. Recently, topic models have also been applied in the biomedical domain for case-based retrieval [5], characterization of clinical concepts over time [6], and prediction of patient satisfaction and mortality [7, 8], among others. Topic models have also been employed to analyze differences in language use between depressed and non- depressed individuals [9], as well as to rank gene-drug relationships in the biomedical literature [10]. The majority of previous applications have centered around text data. To our knowledge, only a handful of studies have applied topic models to non-text data [11, 12]. However, compared to these studies, we analyze a much larger dataset and take a more rigorous approach to assess the clinical relevance of our results and to quantitatively evaluate the performance of our method. 1 We evaluate the performance of our method using two approaches. First, we assess the medical validity of our results by examining whether the conditions that show a high probability to be associated with a topic are known to co-occur according to the medical literature. Second, we quantitatively assess the topics obtained from our model by measuring how distinct they are from one another (distinctiveness) and whether a topic can be specified by a small number of conditions (tightness). We measure distinctiveness by calculating inter- topic distance using Jensen-Shannon divergence [13] – a symmetric measure of similarity between two probability distributions. Tightness is measured by inspecting, for each topic, the number of associated codes whose probability is greater than a threshold value; a low number of associated codes indicates that a topic can be characterized by a handful of codes, and is thus tight. Our results show that the topics are indeed distinct and tight, while aligning well with sets of conditions that are known to co-occur according to the medical literature. The rest of the paper is organized as follows: Section II describes the experimental setting, including the dataset used, the data preprocessing steps, the LDA algorithm and the Jensen- Shannon divergence measure; Section III presents and discusses the results; Section IV summarizes our findings and proposes directions for future work. II. EXPERIMENTAL SETTING Our dataset consists of information gathered from EMRs of patients in the state of Delaware, showing evidence of decrease in kidney function, recorded during office visits to physicians. Specifically, patients were included in the dataset if at least one estimated GFR value in their records was below 60 mL/min/m2. The EMRs contain several attributes such as age, ethnicity, gender, lab test results and diagnosed conditions collected between August 2007 and July 2015 for 13,111 patients. The average number of visits per patient, over the 8-year period, is 6. The age range of patients in our dataset is 18-107, where 70% of the patients are 58-82 and the mean age is 70 (σ =12.4). Our dataset consists of 60% female and 40% male patients. In this study, we focus solely on the diagnosed conditions attribute, represented via SNOMED codes. Table I lists the ten most frequent SNOMED codes in our dataset, along with their description and occurrence frequency. We preprocess and organize the data to form records that can be used to fit a topic model. Typically in topic modeling, a word is the basic unit of discrete data while the set of unique words is referred to as the vocabulary. In contrast, in our study, we use diagnosed conditions, represented as SNOMED codes, rather than words, such that the set of unique codes forms our vocabulary. To determine the set of codes included, we create a list in which each code is associated with the number of times it occurs within the dataset, and note that 180 of the 5,000 codes present in the dataset account for 80% of the cumulative frequency. To avoid sparsity in the dataset, we limit our vocabulary to these 180 most frequent SNOMED codes. Based on this vocabulary, we create a data matrix where rows correspond to patient-IDs and columns correspond to SNOMED codes, such that each cell <p, c> in the matrix contains the number of times a patient p was diagnosed with condition c. 2 Thus, each patient is associated with a 180-dimensional vector, in which each entry represents the occurrence frequency of a diagnosed condition within the patient's record. We refer to each such vector as a patient-conditions record and to the collection of all such vectors as the patient-conditions corpus, represented by a matrix of dimension 13,111 by 180. TABLE I. THE TEN MOST FREQUENT SNOMED CODES IN OUR EMR DATASET SNOMED Code 1201005 55822004 Number of Occurrences 148,424 82,890 Benign Essential Hypertension Hyperlipidemia SNOMED Description 44054006 235595009 267432004 414916001 61582004 40930008 53741008 Type 2 Diabetes Mellitus Gastroesophageal Reflux Pure Hypercholesterolemia Obesity Allergic Rhinitis Hypothyroidism Coronary Arteriosclerosis 271795006 Malaise and Fatigue 59,156 48,731 47,022 40,499 40,066 39,534 36,795 27,581 Latent Dirichlet Allocation: LDA is a generative probabilistic model based on the idea that documents can be modeled as a mixture over latent topics, where each topic is a distribution over words [3]. We employ LDA to model patient records as though they were generated by sampling from a mixture of K underlying topics, where a topic is a multinomial distribution over all SNOMED codes in our vocabulary. Each code is thus viewed as a sample from a multinomial distribution over codes, and each such multinomial is selected from a distribution over K topics. By inferring the probability distributions associated with the K topics, we can characterize patient records as multinomial distributions over codes. The number of patients in our corpus is 13,111. The number of unique codes that form our vocabulary is denoted by V; in the experiments reported here V=180. We represent a patient's record as a V-dimensional vector of SNOMED codes, referred to as a patient-conditions record. The patient-conditions records are obtained by preprocessing the original patient file in the EMR; a patient file comprises all coded conditions with which the patient had been diagnosed during the 8-years period reflected in our dataset. of codes (cid:1832)(cid:3036)=(cid:3435)(cid:1855)(cid:2869)(cid:3036),…,(cid:1855)(cid:3015)(cid:3284)(cid:3036)(cid:3439), where Ni is the total number of code occurrences in the ith patient file. Each code, (cid:1855)(cid:3037)(cid:3036), in the vector is We represent each patient file, Fi (1 ≤ i ≤ 13,111), as a vector one of the V SNOMED codes in our vocabulary, viewed as a value taken by a respective random variable, Cj (1≤ j ≤ Ni), denoting the code value occurring in the jth position of the ith patient file. We note that any of the V codes in our vocabulary can appear at any position in a patient file. The generative process for each patient file consists of the following steps: First, a multinomial distribution over V codes for the tth topic, To learn the model parameters based on our data, we use the denoted Φt (1≤ t ≤ K), is obtained by sampling from a Dirichlet distribution with parameter α; Φt represents the conditional probability of a code to occur in the tth topic. Next, for each θi, is sampled from a Dirichlet distribution with parameter β; θi represents the conditional probability of the file to be associated with each of the K topics. Subsequently, for each code-position, j, in the file, Fi : (1) A topic is drawn by sampling from θi; the patient file, (cid:1832)(cid:3036), a multinomial distribution over K topics, denoted selected topic at position j in the file Fi is denoted (cid:1878)(cid:3037)(cid:3036) ∈{1,…,K}; (2) Given the topic (cid:1878)(cid:3037)(cid:3036) a code, (cid:1855)(cid:3037)(cid:3036), is drawn by sampling from the topic-code distribution, (cid:3053)(cid:3285)(cid:3284). between two probability distributions. Let (cid:1850)(cid:1318) = <x1,..., xN> and (cid:1851) (cid:4652)(cid:4652)(cid:4652)(cid:1318) = <y1,..., yN> be Jensen-Shannon divergence between (cid:1850)(cid:1318) and (cid:1851)(cid:4652)(cid:1318) is defined as: (cid:1836)(cid:1845)(cid:1830)((cid:1850)(cid:1318)(cid:1851)(cid:4652)(cid:1318))= (cid:2869)(cid:2870)∑ (cid:1876)(cid:3036)(cid:1864)(cid:1867)(cid:1859)(cid:4672)(cid:3051)(cid:3284)(cid:3040)(cid:3284)(cid:4673) (cid:3015)(cid:3036)(cid:2880)(cid:2869) the vector (cid:1865)(cid:4652)(cid:4652)(cid:1318) = <m1,..., mN> is a N-dimensional vector representing the mean distribution of (cid:1850)(cid:1318) and (cid:1851)(cid:4652)(cid:1318), calculated as: (cid:1865)(cid:3036)=(cid:2869)(cid:2870)((cid:1876)(cid:3036)+(cid:1877)(cid:3036)). The JSD values range between 0 and ln(2) (~0.693), where 0 indicates identical distributions, and ln(2) indicates non- R topicmodels library [14]. Jensen-Shannon Divergence: The Jensen-Shannon divergence (JSD) [13] is a symmetric measure of similarity that represent two discrete probability distributions. The two N-dimensional vectors + (cid:2869)(cid:2870)∑ (cid:1877)(cid:3036)(cid:1864)(cid:1867)(cid:1859)(cid:4672)(cid:3052)(cid:3284)(cid:3040)(cid:3284)(cid:4673) (cid:3015)(cid:3036)(cid:2880)(cid:2869) , where topic distance between each pair of topics, where the distribution dimension N is 180 (the number of codes in our vocabulary). III. EXPERIMENTS AND RESULTS Experiments: We applied LDA to the patient-conditions corpus to obtain topics, where each topic is a distribution over SNOMED codes. We ran multiple experiments varying the number of topics, and focus here on results obtained when using 20 topics. To ensure an appropriate burn-in period, which is the initial stage of the sampling process when the Gibbs samples are poor estimates of the posterior, we discarded the first 4,000 samples, after which we saved 4,000 Gibbs samples at regular intervals of 100 [15]. We used the default values, set in the topicmodels library, for the parameter β (0.1) and for the initial value of the parameter α (50/M) [14]. Table II shows examples of six characteristic topics from the 20 identified by our model. For each of the six topics, we list the ten diagnosed conditions that have the highest probability to occur in the topic, along with their respective probabilities. We display only ten diagnosed conditions, since for most topics, the cummulative probability mass associated with these conditions accounts for over 0.9 of the total probability mass, as shown at the bottom row of the table. Moreover, the remaining diagnosed conditions have probability lower than 0.01. Similar results were obtained for the other 14 topics. Medical Relevance: To evaluate whether topic modeling indeed identifies patterns of association among patients' conditions, we verify that the most probable conditions within each topic are indeed known to co-occur according to the medical literature. overlapping distributions. We use the JSD to calculate the inter- TABLE II. EXAMPLES OF SIX CHARACTERISTIC TOPICS FROM THE TWENTY IDENTIFIED BY OUR MODEL; EACH COLUMN LISTS TEN DIAGNOSED CONDITIONS THAT HAVE THE HIGHEST PROBABILITIES TO BE ASSOCIATED WITH THE RESPECTIVE TOPIC, ALONG WITH THEIR PROBABILITIES 3 As seen from the leftmost column in Table II, many of the diagnosed conditions grouped together in Topic A are clearly related to Diabetes, which is one of the most frequent causes of decrease in kidney function in the US [16]. It is well established medically that Type 2 Diabetes and Hyperlipidemia are closely associated conditions [17]. Similarly, Type 2 Diabetes Mellitus, Benign Essential Hypertension and Morbid Obesity are known to co-occur [18]. Moreover, Vitamin D deficiency is a common phenomenon in Chronic Kidney disease and hence frequently co-occurs with Diabetes. Likewise, most of the conditions grouped together in Topic B are related to Limb or Joint pain, conditions frequently occuring in patients suffering from advanced kidney disease, which explains the high probability of Chronic Renal failure, Limb- and Joint-pain to all be associated with the same topic [19]. We similarly assess the medical validity of each of the other topics identified by our model [16-19]. Quantitative Evaluation: We next measure the quality of the resulting topics in terms of tightness and distinctiveness. We assess the tightness of the topics by examining whether each can be specified by a small number of coded conditions. Thus for each topic we inspect the number of codes assigned a probability greater than a threshold value, set to 0.01. The observation that for each topic, only 10 or fewer of the 180 codes have a probability above 0.01, and that the cumulative probability of these 10 codes adds up to more than 0.9, indicates that the 10 conditions are sufficient for characterizing a topic, illustrating the tightness of the topics. We assess the distinctiveness of the topics by calculating the inter-topic distance between all distinct pairs of 20 topics using the JSD [13] to measure how well-separated each topic is from another. The mean, median, and minimum values of the inter- topic distances obtained are 0.666, 0.692 and 0.483 respectively. As mentioned earlier, JSD values range between 0 and ln(2) (~0.693), where 0 indicates identical distributions, and ln(2) bound of ln(2)) of the inter-topic distances indicate that the indicates non-overlapping distributions. The higher the JSD value between two topics, the more distinct they are from one another. The high mean and median values (close to the upper majority of topic pairs obtained by our model are distinct. IV. CONCLUSION AND FUTURE WORK We reported preliminary results obtained from our data- driven approach, using LDA to identify patterns of co-occurring medical conditions within an EMR dataset. Our results indicate that most of the coded conditions grouped together as topics are indeed known to co-occur according to the medical literature. We also quantitatively evaluate the performance of our method and demonstrate that the topics identified by our method are tight and distinct. Tightness is established by showing that each topic can be defined by ten or fewer conditions. Distinctiveness is established by illustrating that the large majority of the topic pairs are separated by a high Jensen-Shannon divergence. We believe that our approach can be used to support clinical decision making. The data driven approach for identifying associated conditions can be used as a basis for a system that facilitates diagnosis and data entry in clinical settings by suggesting conditions that may co-occur with the patient's current diagnosed conditions. 4 ACKNOWLEDGMENT This research was supported by the National Institute of General Medical Sciences, NIGMS IDeA grants U54- GM104941 and P20 GM103446. We thank James T. Laughery and Sarahfaye Heckler for their major role in building the dataset. REFERENCES therapy dialogue analysis. In Proc. of [1] Centers for Disease Control and Prevention (2014). Multiple Chronic Conditions. http://www.cdc.gov/chronicdisease/about/multiple-chronic.htm, last accessed 06/01/16. [2] NIH U.S. National Library of Medicine (2016). SNOMED CT. https://www.nlm.nih.gov/healthit/snomedct/, last accessed 06/01/16. [3] Blei, D. M., Ng, A. Y., & Jordan, M. I. (2003). Latent Dirichlet allocation. Journal of Machine Learning Research, Vol. 3, pp. 993-1022. [4] Feng, Y., & Lapata, M. (2010). Topic models for image annotation and text illustration. In Human Language Technologies: Proc. of the Annual Conference of the North American Chapter of the Association for Computational Linguistics (ACL'10), pp. 831-839. [5] Arnold, C. W., El-Saden, S. M., Bui, A. A. & Taira, R. (2010). Clinical case-based retrieval using latent topic analysis. In Proc. of the AMIA Annual Symposium, pp. 26 -30. [6] Howes, C., Purver, M., & McCabe, R. (2013). Investigating topic modelling for the IWCS Workshop on Computational Semantics in Clinical Text (CSCT), pp. 7-16. [7] Lehman, L. W., Saeed, M., Long, W., Lee, J., & Mark, R. (2012). Risk stratification of ICU patients using topic models inferred from unstructured progress notes. In Proc. of the AMIA Annual Symposium, pp. 505-511. [8] Ghassemi, M., Naumann, T., Doshi-Velez, F., Brimmer, N., Joshi, R., Rumshisky, A., & Szolovits, P. (2014). Unfolding physiological state: mortality modelling in intensive care units. In Proc. of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 75-84. [9] Resnik, P., Armstrong, W., Claudino, L., Nguyen, T., Nguyen, V. A., & Boyd-Graber, J. (2015). Beyond LDA: exploring supervised topic modeling for depression-related language in Twitter. In Proc. of the 2nd Workshop on Computational Linguistics and Clinical Psychology, pp. 99-107. [10] Wu, Y., Liu, M., Zheng, W. J., Zhao, Z., & Xu, H. (2012). Ranking gene- drug relationships in biomedical literature using latent Dirichlet allocation. In Proc. of the Pacific Symposium on Biocomputing, pp. 422-433. [11] Wang, J., Liu, P., She, M. F., Nahavandi, S., & Kouzani, A. (2013). Biomedical time series clustering based on non-negative sparse coding and probabilistic in Biomedicine, Vol. 111, No. 3, pp. 629-641. [12] Li, D. C., Thermeau, T., Chute, C., & Liu, H. (2014). Discovering associations among diagnosis groups using topic modeling. In Proc. of the AMIA Joint Summits on Translational Science Proceedings AMIA Summit on Translational Science, pp. 43-49. [13] Lin, J. (1991). Divergence measures based on the Shannon entropy. IEEE Transactions on Information Theory, Vol. 37, No. 1, pp. 145-151. [14] R library: Topic Models (2016). https://cran.rproject.org/-web/pack- ages/topicmodels/index.html, last accessed 04/25/16. [15] Gilks, W. R., Richardson, S., & Spiegelhalter, D. J. (1996). Introducing Markov chain monte Carlo. Markov Chain Monte Carlo in Practice, Vol. 1, pp. 1-19. [16] Collins, A. J., Kasiske, B., Herzog, C. et al. (2007). United States renal data system 2006 annual data report abstract. American Journal of Kidney Diseases, Vol. 49, pp. A6-A7. [17] O'Brien, T., Nguyen, T. T., & Zimmerman, B. R. (1998). Hyperlipidemia and diabetes mellitus. In Mayo Clinic Proceedings, Vol. 73, No. 10, pp. 969- 976. [18] Modan, M., Halkin, H., Almog, S. et al. (1985). Hyperinsulinemia. A link between hypertension obesity and glucose intolerance. Journal of Clinical Investigation, Vol. 75, No. 3, pp. 809-817. [19] Margolis, D. J., Hofstad, O., & Feldman, H. I. (2008). Association between Renal failure and foot ulcer or lower-extremity amputation in patients with Diabetes. Diabetes Care, Vol. 31, No. 7, pp. 1331-1336. topic model. Computer Methods and Programs
1708.00416
1
1708
2017-08-01T17:05:32
Deriving Verb Predicates By Clustering Verbs with Arguments
[ "cs.CL" ]
Hand-built verb clusters such as the widely used Levin classes (Levin, 1993) have proved useful, but have limited coverage. Verb classes automatically induced from corpus data such as those from VerbKB (Wijaya, 2016), on the other hand, can give clusters with much larger coverage, and can be adapted to specific corpora such as Twitter. We present a method for clustering the outputs of VerbKB: verbs with their multiple argument types, e.g. "marry(person, person)", "feel(person, emotion)." We make use of a novel low-dimensional embedding of verbs and their arguments to produce high quality clusters in which the same verb can be in different clusters depending on its argument type. The resulting verb clusters do a better job than hand-built clusters of predicting sarcasm, sentiment, and locus of control in tweets.
cs.CL
cs
Deriving Verb Predicates By Clustering Verbs with Arguments Joao Sedoc† Derry Wijaya† Masoud Rouhizadeh† Andy Schwartz∗ †University of Pennsylvania ∗Stony Brook University Lyle Ungar† 7 1 0 2 g u A 1 ] L C . s c [ 1 v 6 1 4 0 0 . 8 0 7 1 : v i X r a Abstract Hand-built verb clusters such as the widely used Levin classes (Levin, 1993) have proved useful, but have limited coverage. Verb classes automatically induced from corpus data such as those from VerbKB (Wijaya, 2016), on the other hand, can give clusters with much larger coverage, and can be adapted to specific corpora such as Twitter. We present a method for clustering the outputs of VerbKB: verbs with their multiple argument types, e.g."marry(person, person)", "feel(person, emotion)." We make use of a novel low- dimensional embedding of verbs and their arguments to produce high quality clusters in which the same verb can be in different clusters depending on its argument type. The resulting verb clusters do a better job than hand-built clusters of predicting sar- casm, sentiment, and locus of control in tweets. Introduction 1 English verbs are limited in number (Levin's classes, for instance, include almost 3,100 verbs) and highly polysemous. Depending on its argu- ment realization, a verb may have different seman- tics or senses (Rappaport Hovav and Levin, 1998). Therefore, including the verb arguments and their semantic types in the semantic analysis should help with sense disambiguation of verbs and their arguments, especially the subject and object. In- deed, verb selectional preferences: the tendencies of verbs to selectively co-occur with specific types of arguments e.g., the verb "eat" usually takes a type of food as an object argument – have been shown to be strong indicators of verb diathesis al- ternations (McCarthy, 2001). Furthermore, these selectional preferences can be assigned to the ma- jority of Levin verb classes in VerbNet (Schuler, 2005). In this paper we show that clustering verbs along with their subject and object types yields better verb clusters. Verbs are 'disambiguated', such that the same verb ends up in different clus- ters based on its argument types. Our verb clusters reflect the distribution of verb arguments in social media language, and provide useful features for modeling this language. We propose a method of clustering the govern- ing verbs and their arguments, including the sub- ject, object, and the prepositional phrase. We use as a baseline, Levin's verb classes and propose new methods for distributional categorization of verbs and their arguments. Unlike Levin's verb classes, our categorization is not limited to verbs; we generate semantic categorization of verbs and their arguments. A wealth of studies have explored the relation between linguistic features in social media and hu- man traits. However, most studies have used open- vocabulary or bag-of-word approach and few have focused on taking the role of syntactic/semantic contexts and verb argument structure into account. In this study, we show that the verb predicates that we derive improve performance when used as fea- tures in models predicting attributes of Facebook messages and Tweets. Specifically, we look at predicting sarcasm, sentiment, and locus of con- trol: whether the author feels in control or being controlled by the other people. While sarcasm and sentiment are more widely studied, locus of control is a relatively novel task. Our clustering method in effect disambiguates verbs (a highly ambiguous part of speech), and groups together similar verbs by making using of their argument structure. We show that our automatically derived verb clusters help more in these three prediction tasks than alternatives such as the Levin's classes. In summary, our main contributions are: • we present a novel method for learning the low-dimensional embeddings of verbs and their arguments that takes into account the verb selectional preferences and distribution (section 5.3) • we present an algorithm for clustering verbs and their arguments based on the embeddings (section 3) • we show that our verb clusters outperform hand-built verb classes when used as features for predicting control, sarcasm, and senti- ment in tweets (section 6) 2 Related Work Our approach draws on two different strands of prior work: verb clustering and verb embedding. Verb Clustering Verb clusters have proved use- ful for a variety of NLP tasks and applications in- cluding e.g., metaphor detection (Shutova et al., 2010), semantic role labeling (Palmer et al., 2010), language acquisition (Hartshorne et al., 2016), and information extraction (Nakashole and Mitchell, 2016). Verb classes are useful because they support generalization and abstraction. VerbNet (Schuler, 2005) is a widely-used hand-built verb classification which lists over 6,00 verbs that are categorized into 280 classes. The classification is based on Levin's verb classification (Levin, 1993), which is motivated by the hypothesis that verbs taking similar diathesis alternations tend to share the same meaning and are organized into seman- tically coherent classes. Hand-crafted verb classi- fications however, suffer from low coverage. This problem has been addressed by various methods to automatically induce verb clusters from corpus data (Sun and Korhonen, 2009; Nakashole et al., 2012; Kawahara et al., 2014; Fader et al., 2011). Most recent release is VerbKB (Wijaya, 2016; Wi- jaya and Mitchell, 2016), which contains large- scale verb clusters automatically induced from ClueWeb (Callan et al., 2009). Unlike previous ap- proaches, VerbKB induces clusters of typed verbs: verbs (+ prepositions) whose subjects and objects are semantically typed with categories in NELL knowledge base (Carlson et al., 2010) e.g., "marry on(person, date)", "marry(person, person)". VerbKB clusters 65,000 verbs (+prepositions) and outperforms other large-scale verb clustering methods in terms of how well its clusters align to hand-built verb classes. Unlike these previ- ous works which evaluate the quality of the verb clusters based on their similarities to hand-built verb classes, we evaluate our verb clusters directly against hand-built verb classes (Levin, VerbNet) on their utility in building predictive models for assessing control, sarcasm, and sentiment. Verb Embeddings Word embeddings are vec- tor space models that represent words as real- valued vectors in a low-dimensional semantic space based on their contexts in large corpora. Re- cent approaches for learning these vectors such as word2vec (Mikolov et al., 2013) and Glove (Pennington et al., 2014) are widely used. How- ever, these models represent each word with a sin- gle unique vector. Since verbs are highly poly- semous, individual verb senses should potentially each have their own embeddings. Sense-aware word embeddings such as (Reisinger and Mooney, 2010; Huang et al., 2012; Neelakantan et al., 2014; Li and Jurafsky, 2015) can be useful. However, they base their representations solely on distribu- tional statistics obtained from corpora, ignoring semantic roles or types of the verb arguments. Re- cent study by Schwartz et al. (2016) has observed that verbs are different than other parts of speech in that their distributional representation can ben- efit from taking verb argument role into accounts. These argument roles or types can be provided by existing semantic resources. However, learn- ing sense-aware embeddings that take into account information from existing semantic resources (Ia- cobacci et al., 2015) requires large amounts of sense-annotated corpora. Since we have only data in the form of (subject, verb, object) triples ex- tracted from ClueWeb, the limited context1 also means that traditional word embedding models or word sense disambiguation systems may not learn well on the data (Melamud et al., 2016). Motivated by previous works that have shown verb selectional preferences to be useful for verb clustering (Sun and Korhonen, 2009; Wijaya, 2016) and that verb distributional representation can benefit from taking into account the verb ar- gument roles (Schwartz et al., 2016), we cluster VerbKB typed verbs by first learning novel, low- dimensional representations of the typed verbs, thus encoding information about the verb selec- tional preferences and distribution in the data. We learn embeddings of typed verbs (verbs plus 1window size of 1, limited syntactic information, and no sentence or whole document context the type of their subjects and objects) in Ver- bKB. Unlike traditional one-word-one-vector em- bedding, we learn embeddings for each typed verb e.g., the embedding for "abandon(person, per- son)" is separate from the embedding for "aban- don(person, religion)". Using only triples in the form of (subject, verb, object) extracted from ClueWeb, we learn verb embeddings by treating each verb as a relation between its subject and ob- ject (Bordes et al., 2013). Since verbs are predi- cates that express relations between the arguments and adjuncts in sentences, we believe this is a nat- ural way for representing verbs. We cluster typed verbs based on their embed- dings. Then, at run time, given any text con- taining a verb and its arguments, we straightfor- wardly map the text to the verb clusters by as- signing types to the verb arguments using NELL's noun phrase to category mapping2 to obtain the typed verb and hence, its corresponding verb clus- ters. This differs from sense-aware embedding ap- proaches that require the text at run time to be sense-disambiguated with the learned senses, a difficult problem by itself. 3 Method Given the embeddings of the typed verbs, the main goal of our clustering is to create representations of verbs using their argument structure similar in concept to the hand curated Levin classes, but with higher coverage and precision. Our method com- prises four steps: • shallow parsing the sentence into subject, verb (+ preposition), and object • labeling the subject and object into their • identifying the clustering within each verb (+ • indexing into the cluster of between verb preposition) as in figure 1 NELL categories cluster embeddings as shown in figure 2. We use algorithm 1 for creating verbal argument clusters for each verb, and algorithm 2 to cluster between the verbal argument clusters. This pro- cess results in verb predicate clusters with are con- ceptually similar to Levin class, but which include prepositions as well as arguments and are in prac- tice closer to VerbNet and FrameNet classes. Step 1: Parsing and lemmatization The first step in our pipeline for labeling the verb predi- 2publicly available at http://rtw.ml.cmu.edu/ rtw/nps cate is to parse the sentence or tweet (detailed in section 5.2). Then, we extracted the words in in the nominal subject, direct object position, and the prepositional phrases and reduced morphological variations by lemmatizing the verbs and their argu- ments. This whole process captured the sentence kernel. Step 2: Subject and object NELL categoriza- tion Subsequently, the subject and object noun phrases are mapped to NELL categories. This cat- egorization creates an abstract view of the verbal arguments into types. Step 3: Verb-specific verb argument clusters In order to create verb (+ preposition) argument clusters for each verb, all typed embeddings for the verb are clustered using spectral clustering method of Yu and Shi (2003) for multiclass nor- malized cuts. The number of clusters is limited to the WordNet 3.1 (Miller, 1995) senses for each verb. The centers of the clusters are the repre- sentative embedding for the cluster. One can in- terpret these clusters as "synsets" of verbal argu- ments which are similar in embedding space. This created a mapping f from the verb with its prepo- sition v, the subject NELL category s, and the ob- ject category o to the verb arguments cluster and the cluster's representative embedding. Algorithm 1 Verb-Specific Argument Clustering Algorithm 1: Input: Embeddings, emb(v, ts, to), for a set of typed verbs containing the verb (+ preposi- tion) v, its subject type ts and object type to ments, emb(v,∗,∗) do 2: for Each verb (+ preposition) v over all argu- 3: 4: 5: 6: Set kv to the number of word senses from WordNet 3.1 (Miller, 1995) with a default of 2 for missing verbs. Calculate the affinity matrix W sim using a cosine similarity between each embedding from emb(v,∗,∗). Find kv clusters (Cv Keep a map from f from verb v, subject type ts, and object type to to the cluster number Cv i . Calculate the mean of the embeddings eCv i ) from W sim. . i 7: 8: end for 9: Output: The verb sense embeddings [eCv all verbs, the mapping function f. ] for i The main output from algorithm 1 are verb argu- ment clusters and embeddings ef (v,ts,to). These clusters can be considered as verb "sense" clus- ters. In figure 1 we showed the eCsimulate plotted with respect to the first and second principle com- ponents in the verb sense embedding space. "stim- ulate.0" is further from the rest of the verb sense embeddings for "stimulate". Step 4: Clustering between verb argument clusters The final component in the procedure is to cluster across verb argument clusters i.e., "verb senses" using the clusters' representative embed- dings. Here we also include side thesaurus in- formation in order to maintain semantic similar- ity particularly by including antonym information. We follow the procedure of Sedoc et al. (2016) which extends spectral clustering to account for negative edges. Algorithm 2 Verb Predicate Clustering Algorithm 1: Input: Cluster embeddings from Algorithm 1 ], the thesaurus, T , and the number of [eCv clusters k. i 2: Calculate the verb senses affinity matrix W using the radial basis function of the Eu- clidean distance between eCv 3: Find k clusters C using signed spectral clus- and eCv(cid:48) . j i 4: Keep a function g from Cv tering of W and T . ber Cj i to the cluster num- 5: Output: The verb sense embeddings [eCv ], i the mapping function f, and g. The main result having run algorithm 2 are verb predicate clusters of typed verbs (v, ts, to) from g(f (v, ts, to)). Figure 2 corresponds to a verb predicate clus- ter which includes "stimulate.0" but not other senses of "stimulate". Furthermore, "stimulate.0" is grouped with various senses of "move". This shows how the two step clustering algorithm is effective in creating clusters which are similar in purpose to Levin classes. 4 Prediction tasks We use the verb predicate clusters as features in three prediction tasks: estimating locus of control, sarcasm, and sentiment from social media lan- guage. We now briefly describe these three tasks and the data set we use for them. 4.1 Locus of control Locus of control, or "control," is defined as the de- gree to which a person is in control of others or sit- uation or being controlled by them. A large num- ber of studies explored the role of control (or locus of control, LoC) on the physical and mental health. They have found that a person's perceived LoC can influence their health (Lachman and Weaver, 1998), well-being (Krause and Stryker, 1984), and career prospects (Judge et al., 2002). All of these studies are limited to small populations (mainly based on questionnaires) and none of them pro- pose automated large-scale methods We deployed a survey on Qualtrics, compris- ing several demographic questions as well as a set of 128 items, and invited users to share ac- cess to their Facebook status updates. 2465 sub- jects reported their age, gender and items indica- tive of their general health and well-being. We split each Facebook status update into multiple sentences and asked three trained annotators to de- termine for each sentences if the author is in con- trol (internal control) or being controlled by oth- ers or circumstances (external control). The inter- annotator agreement between the three annotators was around %76. We took the majority vote of the annotator for each message and assigned binary la- bels for internal and external control. 4.2 Sarcasm Several number of studies have used surface lin- guistic features (Carvalho et al., 2009; Davidov et al., 2010), language patterns (Davidov et al., 2010), lexical features and emotions (Gonz´alez- Ib´anez et al., 2011), counter-factuals, unexpected- ness, emotions, and n-grams (Reyes et al., 2013). Other works have explored the role of social con- text in detecting sarcasm as well (Rajadesingan et al., 2015; Bamman and Smith, 2015). Schi- fanella et al. (2016) worked on multimodal sar- casm analysis and detection. Our method ad- vances on predicting sarcasm using word embed- dings (Ghosh et al., 2015; Joshi et al., 2016) to verb predicates. Here we use the dataset from Bamman and Smith (2015) including 17,000 tweets. The tweets are semi-automaticaly annotated for sarcasm (e.g. using #sarcasm). The dataset contains 51% sar- castic and 49% non-sarcastic manually annotated tweets (not likely to reflect of real-world rates of sarcastic tweets). Figure 1: After algorithm 1 of the clustering algorithm, the different argument types of each verb are clustered. For example, the verb "stimulate" here has 6 clusters (The number of clusters came from the number of WordNet senses for the verb "stimulate".) tion task to compare verb predicate clusters with hand-curated verb classes on this task. 5 Data preprocessing 5.1 Social media text corpus Our corpus for verb clustering consists of the sta- tus updates of 15,000 Facebook users, a subset of the ones who volunteered to share their posts in the "MyPersonality" application (Kosinski et al., 2013), between January 2009 and October 2011. The users had English as a primary language and were less than 65 years old (due to data sparsity beyond this age). 5.2 Data processing and extracting verb arguments We first perform a text normalization pipeline that cleans each tweet or Facebook status update (re- moves emoticon, URLs, email addresses, handles, hashtags, etc.), does spelling correction and par- tial abbreviation expansion, and reduces the num- ber of repeated characters. Then, we tokenize and split Facebook status updates into sentences (we keep tweets as single sentences). We tokenize the tweets using CMU ARK Twitter Twokenize script (Owoputi et al., 2013; O'Connor et al., 2010). Next, we obtained dependency parses of our cor- pus using SyntaxNet with Parsey McParseface Figure 2: The final output of the clustering algo- rithm 2 is the clusters of verb senses. This ex- ample cluster shows one sense of the verb "stimu- late": "stimulate.0" which is clustered with differ- ent senses of "move". The small points represent additional words groups in the cluster which are not displayed. 4.3 Sentiment Sentiment has been extremely widely stud- ied (Pang et al., 2008; Liu and Zhang, 2012). Both surface level as well as lexical structure have been shown to be useful in the task of sentiment predic- tion (Neviarouskaya et al., 2009). Large corpora are available, both at the document level as well as the tweet level where sentiment has been as- sessed. In our work, we used the sentiment predic- model3 that provides universal dependencies in (relation, head, dependent) triples4. We extracted subject, verb, object, preposition and the object of preposition from the dependency trees, lemmatiz- ing each word using NLTK wordNet lemmatizer (Bird et al., 2009). Given the nature of twitter data the parses of the tweets are very noisy and created errors, such as, "rying('t.t', None)" from "I've planted my ca t.t rying to grow cat tails for Halloween ." Nonetheless, parsing twitter is out of scope for this paper and we used the same parse for all methods. 5.3 Typed verb embeddings Typed verbs in VerbKB (Wijaya, 2016) are cre- ated by extracting subject, verb (lemmatized), ob- ject, preposition and the object of preposition from the dependency trees in the ClueWeb cor- pus(Callan et al., 2009). Triples in the form of (subject, verb (+preposition), object) are ex- tracted, and the subjects and objects are typed us- ing the NELL knowledge base categories (Carl- son et al., 2010). The type signatures of verbs e.g., (person, person) for "marry" are then se- lected based on their frequencies of occurrence in the corpus using Resnik's selectional associa- tion scores (Resnik, 1997). The result is a col- lection of triples of typed verbs with their sub- ject and object noun phrases (NPs) in ClueWeb (Barack Obama, marry(person, person), e.g., Michelle Obama), (Tom Hanks, marry(person, person), Rita Wilson). Inspired by Bordes et al. (2013), who model relationships by interpreting them as translations operating on the low-dimensional embeddings of the entities, we learn low-dimensional representa- tions of the typed verbs by interpreting them as translations operating on the low-dimensional em- beddings of their subject and object noun phrases. Specifically, given a set of triples: (ns, vt, no) composed of the subject and object NP ns, no ∈ N (the set of NPs) and the typed verb vt, we want the embedding of the object NP no to be a nearest neighbor of ns + vt i.e., ns + vt ≈ no when (ns, vt, no) is observed in ClueWeb and far away other- wise. Using L2 distance d, following Bordes et al. 3https://github.com/tensorflow/models/ tree/master/syntaxnet 4In our in-house evaluation SyntaxNet with Parsey Mc- Parseface model outperformed Stanford Parser (Socher et al., 2013) on social media domain and it is essentially better than the Tweebo Parser (Kong et al., 2014) that does not provide dependency relations (2013), to learn the embeddings we minimize over the set S of triples observed in ClueWeb: (cid:88) L = (cid:88) (ns,vt,no)∈S (n(cid:48) s,vt,n(cid:48) o)∈S(cid:48) [γ + d(ns + vt, no) − d(n (cid:48) s + vt, n (cid:48) o)]+ where [x]+ denotes the positive part of x, γ > 0 is a hyperparameter and S(cid:48) is the set of corrupted triples constructed as in Bordes et al. (2013). For typed intransitives (e.g., "sleep(person)"), since they do not have object NPs, we learn their embeddings by making use of their preposi- tions and objects e.g., "sleep in(person, location)" whose triples are observed in ClueWeb. Specif- ically, given triples in the form of (vi, p, no) composed of the intransitive verb vi, the prepo- sition p and the preposition object NP no e.g., (sleep(person), in, adjacent room), we want the embeddings to be vi + p ≈ no when (vi, p, no) is observed in ClueWeb and far away otherwise. We use a fast implementation (Lin et al., 2015) of Bordes et al. (2013) to learn 300 dimensional embeddings for transitive and intransitive typed verbs using this approach with 100 epochs. We use the implementation's default setting for other parameters. 5.4 GloVe Embedding As a baseline, we used the 200 dimensional word embeddings from Pennington et al. (2014) 5. trained using Wikipedia 2014 + Gigaword 5 (6B tokens). GloVe has been shown to have better correlation with semantic relations than Word2Vec Skip-Gram embeddings from Mikolov et al. (2013) (Pennington et al., 2014). 6 Clustering Results Baselines We used several baselines for cluster- ing. Levin classes are split into several forms. We used the most fine-grained classes, which clusters verbs into 199 categories. GloVe clusters were created using K-means clustering. The clustering was done by averaging the subject, verb, and ob- ject vectors Verb Predicate Clusters We took a subset of VerbKB typed verb embeddings from the ex- tracted vocabulary of 15,000 parsed Facebook 5http://nlp.stanford.edu/projects/ glove/ verb clarify erode lose deny lament exploit fidget prove raise make subject jobposition event personcanada writer athlete jobposition person celebrity filmfestival militaryconflict object emotion emotion emotion emotion emotion emotion emotion emotion emotion emotion Table 1: This is a subset of the verb predicate clus- ter that has emotion as object. posts as well as our control, sarcasm, and senti- ment data. From the vocabulary of Levin verbs, verbs from Facebook status updates with sub- ject, verb, object that occur more than twice, and verbs from Twitter sentiment and control data, we obtain 6,747 verbs. This is subsequently inter- sected with the VerbKB typed verbs vocabulary of 46,960 verbs with prepositions attached, which re- sults in 3791 verbs (+prepositions) Finally, once arguments are added the vocabulary expands to 322,564 typed verbs which are clustered accord- ing to algorithm 1 and algorithm 2 to yield the final verb predicate clusters. Table 1 shows an example of different verb senses that have the same object type, which are clustered in the same verb predicate cluster. Table 2 shows various verb predicate clusters of the verb "beat", which is particularly interesting for predicting control. For example, "The Patri- ots beat the Falcons.", "I beat John with a stick.", and "My father beat me.", will all have different measures of control. verb beat beat beat beat beat beat subject personus personasia personmexico personus personcanada object person person person athlete athlete coach organization cluster # 138 138 138 195 195 195 Table 2: There are multiple senses of "beat" which are shown to be in different clusters. Cluster num- ber 138 includes "hit" and "crash". Whereas, "block", "run", and "win" are members of cluster 195. 7 Results and Discussion We perform a set of experiments to extrinsically evaluate verb predicate clusters. As baselines we use Levin classes, VerbNet, as well as clusters of subject, verb, object GloVe embeddings. In order to evaluate the verb predicate clusters, we used the clustering method to make various clusters using both transitive as well as intransitive verb clusters. The results from table 3 show that our verb predicate clusters outperform Levin classes, Verb- Net categories, as well as clusters of GloVe vec- tor averaging the subject, verb and object (S-V-O clusters). We also tried other baselines, includ- ing logistic regression of GloVe embeddings in- stead of clustering and the results where F-score of 0.657, 0.612, and 0.798 for control, sarcasm, and sentiment respectively. We also tried to change the number of clusters to 200 to match the fine grained Levin classes. Levin VerbNet S-V-O clusters Verb Predicate control 0.660 0.679 0.685 0.721 sarcasm sentiment 0.619 0.628 0.621 0.637 0.804 0.796 0.795 0.807 Table 3: Comparison of the F-score of the Levin classes, VerbNet, GloVe embedding clusters and our verb predicate clusters for predicting control, sentiment, and sarcasm of tweets. Ten fold cross- validation was used on the datasets. One shortfall of typed verb embeddings is due to the poor coverage for common nouns in NELL KB. In order to alleviate this issue we tried cre- ating a manual list of the most frequent common nouns in our dataset to NELL categories. Unfortu- nately, this problem is systemic and only a union with something akin to WordNet would suffice to solve this issue. For instance, the sense of "root" is categorized with "poke", "forage", "snoop", "rummage" and others in this sense; however, the sense as well as all of the afore mentioned words aside from "root" are not covered by type verb em- bedding. This is definitely an avenue of improve- ment which should be explored in the future. 8 Conclusion Verb predicates are empirically driven clusters which disambiguate both verb sense as well as synonym set. Verbal predicates were shown to outperform Levin classes, in predicting control, sarcasm, and sentiment. These verbal predicates are similar to Levin classes in spirit while having increased precision and coverage. For future work, we intend to integrate social media data in to build better verb arguments clus- ters, i.e. clusters that help with better prediction. References David Bamman and Noah A Smith. 2015. Contextual- ized sarcasm detection on twitter. In ICWSM. Cite- seer, pages 574–577. 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.". Antoine Bordes, Nicolas Usunier, Alberto Garcia- Duran, Jason Weston, and Oksana Yakhnenko. 2013. Translating embeddings for modeling multi- relational data. In Advances in neural information processing systems. pages 2787–2795. Jamie Callan, Mark Hoy, Changkuk Yoo, and Le Zhao. 2009. Clueweb09 data set. Andrew Carlson, Justin Betteridge, Bryan Kisiel, Burr Settles, Estevam R Hruschka Jr, and Tom M Mitchell. 2010. Toward an architecture for never- In AAAI. volume 5, ending language learning. page 3. Paula Carvalho, Lu´ıs Sarmento, M´ario J Silva, and Eug´enio De Oliveira. 2009. Clues for detecting irony in user-generated contents: oh...!! it's so In Proceedings of the 1st international easy;-. CIKM workshop on Topic-sentiment analysis for mass opinion. ACM, pages 53–56. Dmitry Davidov, Oren Tsur, and Ari Rappoport. 2010. Semi-supervised recognition of sarcastic sentences in twitter and amazon. In Proceedings of the four- teenth conference on computational natural lan- guage learning. Association for Computational Lin- guistics, pages 107–116. Anthony Fader, Stephen Soderland, and Oren Etzioni. 2011. Identifying relations for open information ex- traction. In Proceedings of the Conference on Em- pirical Methods in Natural Language Processing. Association for Computational Linguistics, pages 1535–1545. Debanjan Ghosh, Weiwei Guo, and Smaranda Mure- san. 2015. Sarcastic or not: Word embeddings to predict the literal or sarcastic meaning of words. In EMNLP. pages 1003–1012. Roberto Gonz´alez-Ib´anez, Smaranda Muresan, and Nina Wacholder. 2011. Identifying sarcasm in twit- In Proceedings of the 49th ter: a closer look. Annual Meeting of the Association for Computa- tional Linguistics: Human Language Technologies: Short Papers-Volume 2. Association for Computa- tional Linguistics, pages 581–586. Joshua K Hartshorne, Timothy J ODonnell, Yasu- tada Sudo, Miki Uruwashi, Miseon Lee, and Jesse Snedeker. 2016. Psych verbs, the linking prob- lem, and the acquisition of language. Cognition 157:268–288. Eric H Huang, Richard Socher, Christopher D Man- Improving word ning, and Andrew Y Ng. 2012. representations 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. Association for Com- putational Linguistics, pages 873–882. Ignacio Iacobacci, Mohammad Taher Pilehvar, and Roberto Navigli. 2015. Sensembed: Learning sense embeddings for word and relational similarity. In Proceedings of the 53th Annual Meeting of the Asso- ciation for Computational Linguistics. Association for Computational Linguistics, pages 95–105. Aditya Joshi, Pushpak Bhattacharyya, and Mark James Carman. 2016. Automatic sarcasm detection: A sur- vey. arXiv preprint arXiv:1602.03426 . Timothy A Judge, Amir Erez, Joyce E Bono, and Carl J Thoresen. 2002. Are measures of self-esteem, neuroticism, locus of control, and generalized self- efficacy indicators of a common core construct? Daisuke Kawahara, Daniel Peterson, and Martha Palmer. 2014. A step-wise usage-based method for inducing polysemy-aware verb classes. In ACL (1). pages 1030–1040. Lingpeng Kong, Nathan Swabha Swayamdipta, Archna Bhatia, Chris Dyer, and Noah A Smith. 2014. A dependency parser for tweets . Schneider, Michal Kosinski, David Stillwell, and Thore Grae- pel. 2013. Private traits and attributes are pre- dictable from digital records of human behavior. Proceedings of the National Academy of Sciences 110(15):5802–5805. Neal Krause and Sheldon Stryker. 1984. Stress and well-being: The buffering role of locus of control beliefs. Social Science & Medicine 18(9):783–790. Margie E Lachman and Suzanne L Weaver. 1998. The sense of control as a moderator of social class differ- ences in health and well-being. Journal of personal- ity and social psychology 74(3):763. Beth Levin. 1993. English verb classes and alterna- tions: A preliminary investigation. University of Chicago press. Jiwei Li and Dan Jurafsky. 2015. Do multi-sense em- beddings improve natural language understanding? In Proceedings of the 2015 Conference on Empiri- cal Methods in Natural Language Processing. Asso- ciation for Computational Linguistics, pages 1722– 1732. Yankai Lin, Zhiyuan Liu, Maosong Sun, Yang Liu, and Xuan Zhu. 2015. Learning entity and relation embeddings for knowledge graph completion. In Twenty-Ninth AAAI Conference on Artificial Intelli- gence. Bing Liu and Lei Zhang. 2012. A survey of opinion mining and sentiment analysis. In Mining text data, Springer, pages 415–463. Diana McCarthy. 2001. Lexical acquisition at the syntax-semantics interface: diathesis alternations, subcategorization frames and selectional prefer- ences.. Ph.D. thesis, University of Sussex. Oren Melamud, David McClosky, Siddharth Patward- han, and Mohit Bansal. 2016. The role of context types and dimensionality in learning word embed- dings. In Proceedings of NAACL-HLT 2016. Asso- ciation for Computational Linguistics, pages 1030– 1040. 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. George A Miller. 1995. Wordnet: a lexical database for english. Communications of the ACM 38(11):39– 41. Ndapandula Nakashole and Tom M Mitchell. 2016. Machine reading with background knowledge. arXiv preprint arXiv:1612.05348 . Ndapandula Nakashole, Gerhard Weikum, and Fabian Suchanek. 2012. Patty: a taxonomy of relational In Proceedings of patterns with semantic types. the 2012 Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning. Association for Com- putational Linguistics, pages 1135–1145. Arvind Neelakantan, Jeevan Shankar, Alexandre Pas- sos, and Andrew McCallum. 2014. Efficient non- parametric estimation of multiple embeddings per In Proceedings of the 2014 word in vector space. Conference on Empirical Methods in Natural Lan- guage Processing (EMNLP). Association for Com- putational Linguistics, pages 1059–1069. Olutobi Owoputi, Brendan O'Connor, Chris Dyer, Kevin Gimpel, Nathan Schneider, and Noah A Smith. 2013. Improved part-of-speech tagging for online conversational text with word clusters. Asso- ciation for Computational Linguistics. Martha Palmer, Daniel Gildea, and Nianwen Xue. 2010. Semantic role labeling. Synthesis Lectures on Human Language Technologies 3(1):1–103. Bo Pang, Lillian Lee, et al. 2008. Opinion mining and sentiment analysis. Foundations and Trends R(cid:13) in In- formation Retrieval 2(1–2):1–135. Jeffrey Pennington, Richard Socher, and Christopher D Manning. 2014. Glove: Global vectors for word representation. In EMNLP. volume 14, pages 1532– 1543. Ashwin Rajadesingan, Reza Zafarani, and Huan Liu. 2015. Sarcasm detection on twitter: A behavioral In Proceedings of the Eighth modeling approach. ACM International Conference on Web Search and Data Mining. ACM, pages 97–106. Malka Rappaport Hovav and Beth Levin. 1998. Build- ing verb meanings. The projection of arguments: Lexical and compositional factors pages 97–134. Joseph Reisinger and Raymond J Mooney. 2010. Multi-prototype vector-space models of word mean- ing. In Human Language Technologies: The 2010 Annual Conference of the North American Chap- ter of the Association for Computational Linguistics. Association for Computational Linguistics, pages 109–117. Philip Resnik. 1997. Selectional preference and sense disambiguation. In Proceedings of the ACL SIGLEX Workshop on Tagging Text with Lexical Semantics: Why, What, and How. Washington, DC, pages 52– 57. Antonio Reyes, Paolo Rosso, and Tony Veale. 2013. A multidimensional approach for detecting irony Language resources and evaluation in twitter. 47(1):239–268. Rossano Schifanella, Paloma de Juan, Joel Tetreault, and Liangliang Cao. 2016. Detecting sarcasm in multimodal social platforms. In Proceedings of the 2016 ACM on Multimedia Conference. ACM, pages 1136–1145. Karin Kipper Schuler. 2005. Verbnet: A broad- coverage, comprehensive verb lexicon . Alena Neviarouskaya, Helmut Prendinger, and Mitsuru Ishizuka. 2009. Semantically distinct verb classes In IADIS AC (1). involved in sentiment analysis. pages 27–35. Roy Schwartz, Roi Reichart, and Ari Rappoport. 2016. Symmetric patterns and coordinations: Fast and en- hanced representations of verbs and adjectives. In Proceedings of NAACL-HLT. pages 499–505. Brendan O'Connor, Michel Krieger, and David Ahn. 2010. Tweetmotif: Exploratory search and topic summarization for twitter. In ICWSM. pages 384– 385. Joao Sedoc, Jean Gallier, Lyle Ungar, and Dean Semantic Word Clusters Using arXiv preprint Foster. 2016. Signed Normalized Graph Cuts. arXiv:1601.05403 . Ekaterina Shutova, Lin Sun, and Anna Korhonen. 2010. Metaphor identification using verb and noun clustering. In Proceedings of the 23rd International Conference on Computational Linguistics. Associ- ation for Computational Linguistics, pages 1002– 1010. Richard Socher, John Bauer, Christopher D Manning, and Andrew Y Ng. 2013. Parsing with composi- tional vector grammars. In ACL (1). pages 455–465. Lin Sun and Anna Korhonen. 2009. Improving verb clustering with automatically acquired selectional preferences. In Proceedings of the 2009 Conference on Empirical Methods in Natural Language Pro- cessing: Volume 2-Volume 2. Association for Com- putational Linguistics, pages 638–647. Derry Tanti Wijaya. 2016. VerbKB: A Knowledge Base of Verbs for Natural Language Understanding. Ph.D. thesis, Carnegie Mellon University. Derry Tanti Wijaya and Tom M Mitchell. 2016. Map- ping verbs in different languages to knowledge base relations using web text as interlingua. In Proceed- ings of NAACL-HLT. pages 818–827. Stella X Yu and Jianbo Shi. 2003. Multiclass spec- In Computer Vision, 2003. Pro- tral clustering. ceedings. Ninth IEEE International Conference on. IEEE, pages 313–319.
1610.09704
1
1610
2016-10-30T20:09:46
Feature-Augmented Neural Networks for Patient Note De-identification
[ "cs.CL", "cs.NE", "stat.ML" ]
Patient notes contain a wealth of information of potentially great interest to medical investigators. However, to protect patients' privacy, Protected Health Information (PHI) must be removed from the patient notes before they can be legally released, a process known as patient note de-identification. The main objective for a de-identification system is to have the highest possible recall. Recently, the first neural-network-based de-identification system has been proposed, yielding state-of-the-art results. Unlike other systems, it does not rely on human-engineered features, which allows it to be quickly deployed, but does not leverage knowledge from human experts or from electronic health records (EHRs). In this work, we explore a method to incorporate human-engineered features as well as features derived from EHRs to a neural-network-based de-identification system. Our results show that the addition of features, especially the EHR-derived features, further improves the state-of-the-art in patient note de-identification, including for some of the most sensitive PHI types such as patient names. Since in a real-life setting patient notes typically come with EHRs, we recommend developers of de-identification systems to leverage the information EHRs contain.
cs.CL
cs
Feature-Augmented Neural Networks for Patient Note De-identification Ji Young Lee1∗, Franck Dernoncourt1∗, Ozlem Uzuner2, Peter Szolovits1 1MIT, 2SUNY Albany {jjylee,francky}@mit.edu, [email protected], [email protected] ∗ These authors contributed equally to this work. 6 1 0 2 t c O 0 3 ] L C . s c [ 1 v 4 0 7 9 0 . 0 1 6 1 : v i X r a Abstract Patient notes contain a wealth of information of potentially great interest to medical investigators. However, to protect patients' privacy, Protected Health Information (PHI) must be removed from the patient notes before they can be legally released, a process known as patient note de-identification. The main objective for a de-identification system is to have the highest possible recall. Recently, the first neural-network-based de-identification system has been proposed, yielding state-of-the-art results. Unlike other systems, it does not rely on human-engineered features, which allows it to be quickly deployed, but does not leverage knowledge from human experts or from electronic health records (EHRs). In this work, we explore a method to incorporate human-engineered features as well as features derived from EHRs to a neural-network-based de-identification system. Our results show that the addition of features, especially the EHR-derived features, further improves the state-of-the-art in patient note de-identification, including for some of the most sensitive PHI types such as patient names. Since in a real-life setting patient notes typically come with EHRs, we recommend developers of de-identification systems to leverage the information EHRs contain. 1 Introduction and related work Medical practitioners increasingly store patient data in Electronic Health Records (EHRs) (Hsiao et al., 2011), which represents a considerable opportunity for medical investigators to construct novel models and experiments to improve patient care. Some governments even subsidize the adoption of EHRs, such as the Centers for Medicare & Medicaid Services in the United States who have spent over $30 billion in EHR incentive payments to hospitals and medical providers (McCann, 2015). A legal prerequisite for a patient note to be shared with a medical investigator is that it must be de- identified. The objective of the de-identification process is to remove all Protected Health Information (PHI). Not appropriately removing PHI may result in financial penalties (DesRoches et al., 2013; Wright et al., 2013). In the United States, the Health Insurance Portability and Accountability Act (HIPAA) (Of- fice for Civil Rights, 2002) defines PHI types that must be removed, ranging from phone numbers to patient names. Failure to accurately de-identify a patient note would jeopardize the patient's privacy: the performance of a de-identification system is therefore critical. A naive approach to de-identification is to manually identify PHI. However, this is costly (Douglass et al., 2005; Douglas et al., 2004) and unreliable (Neamatullah et al., 2008). Consequently, there has been much work developing automated de-identification systems. These systems are either based on rules or machine-learning models. Rule-based systems typically rely on patterns, expressed as regular expressions and gazetteers, defined and tuned by humans (Berman, 2003; Beckwith et al., 2006; Fielstein et al., 2004; Friedlin and McDonald, 2008; Gupta et al., 2004; Morrison et al., 2009; Neamatullah et al., 2008; Ruch et al., 2000; Sweeney, 1996; Thomas et al., 2002). Machine-learning-based systems train a classifier to label each token as PHI or not PHI. Some systems are more fine-grained by detecting which PHI type a token belongs to. Different statistical methods have been explored for patient note de-identification, including decision trees (Szarvas et al., 2006), log-linear models, support vector machines (SVMs) (Guo et al., 2006; Uzuner et al., 2008; Hara, 2006), and conditional random field (CRFs) (Aberdeen et al., 2010). A thorough review of existing systems can be found in (Meystre et al., 2010; Stubbs et al., 2015). This work is licenced under a Creative Commons Attribution 4.0 International License. License details: http://creativecommons.org/licenses/by/4.0/ A more recent system has introduced the use of artificial neural networks (ANNs) for de- identification (Dernoncourt et al., 2016), and obtained state-of-the-art results. The system does not use any manually-curated features. Instead, it solely relies on character and token embeddings. While this allows the system to be developed and deployed faster, it fails to give users the possibility to add fea- tures engineered by human experts. Additionally, in practical settings of de-identification, patient notes typically come from a hospital EHR database, which contains metadata such as which patient each note pertains to, and other information such as the names of all doctors who work at the hospital where the patient was treated. The features derived from EHR databases may be useful for boosting the perfor- mance of de-identification systems. In this work, we present a method to incorporate features to this ANN-based system, and show that it further improves the state-of-the-art. 2 Method The first model based on ANNs for patient note de-identification was introduced in (Dernoncourt et al., 2016): we extend upon their model. They utilized both token and character embeddings to learn effective features from data by fine-tuning the parameters. The main components of the ANN model are Long Short Term Memories (LSTMs) (Hochreiter and Schmidhuber, 1997), which are a type of recurrent neural networks (RNNs). The model is composed of three layers: a character-enhanced token embedding layer, a label predic- tion layer, and a label sequence optimization layer. The character-enhanced token embedding layer maps each token into a vector representation. The sequence of vector representations corresponding to a se- quence of tokens are input to the label prediction layer, which outputs the sequence of vectors containing the probability of each label for each corresponding token. Lastly, the sequence optimization layer out- puts the most likely sequence of predicted labels based on the sequence of probability vectors from the previous layer. All layers are learned jointly. For more details on the basic ANN model, see (Dernoncourt et al., 2016). We augment this ANN model by adding features that are human-engineered or derived from EHR database, as presented in Table 1. The majority of human-engineered features are taken from (Filan- nino and Nenadic, 2015), a few more features come from (Yang and Garibaldi, 2015), and additional gazetteers are collected using online resources. All features are binary and computed for each token. The binary feature vector comprising all features for a given token is fed into a feedforward neural net- work, the output vector of which is concatenated to the corresponding token embeddings, at the output of the character-enhanced token embedding layer, as Figure 1 illustrates. Figure 1: Feature-augmented token embeddings. Each token is mapped to a token embedding that is the concatenation of three elements: the output of a feedforward neural network that takes the features as input, a pre-trained token embedding, and the output of a bidirectional-LSTM (bi-LSTM) that takes the character embeddings as input. bi-LSTMPre-trained token embeddingsFeaturesCharactersCharacter embeddingsconcatanate01100…TokenFeedforward neural networkFeature-augmented token embeddings……… Feature types Note metadata Hospital data Morphological Semantic/Wordnet Temporal Gazetteers Regular expressions (cid:41) EHR features Features Patient's first name, patient's last name Doctor's first names, doctor's last names Ends with s, is the first letter capitalized, contains a digit, is numeric, is alphabetic, is alphanu- meric, is title case, is all lower case, is all upper case, is a stop word Hypernyms, senses, lemma names Seasons, months, weekdays, times of the day, years, years followed by apostrophe, festivity dates, holidays, cardinal numbers, decades, fuzzy quantifier (e.g., "approximately", "few"), future trigger (e.g., "next", "tomorrow") Honorifics for doctors, honorifics, medical specialists, medical specialties, first names, last names, last name prefixes, street suffixes, US cities, US states (including abbreviations), coun- tries, nationalities, organizations, professions Email, age, date, phone, zip code, id number, medical record number Table 1: Feature list. Note metadata and hospital data are derived from the EHR database. Morphologi- cal, semantic/wordnet, and temporal features are commonly used features for NLP tasks. Gazetteers and regular expressions are specifically engineered for the task. 3 Experiments We evaluate our model on the de-identification dataset introduced in (Dernoncourt et al., 2016), which is a subset of the MIMIC-III dataset (Goldberger et al., 2000; Saeed et al., 2011; Johnson et al., 2016), using the same train/validation/test split (70%/10%/20%). We chose this dataset as each note comes with metadata, such as the patient's name, and it is the largest de-identification dataset available to us. It contains 1,635 discharge summaries, 2,945,228 tokens, 69,525 unique tokens, and 78,633 PHI tokens. The model is trained using stochastic gradient descent, updating all parameters, i.e., token embed- dings, character embeddings, parameters of bidirectional LSTMs, and transition probabilities, at each gradient step. For regularization, dropout is applied to the character-enhanced token embeddings before the label prediction layer. We set the character embedding dimension to 25, the character-based token embedding LSTM dimension to 25, the token embedding dimension to 100, the label prediction LSTM dimension to 100, the dropout probability to 0.5, and we use GloVe embeddings (Pennington et al., 2014) trained on Wikipedia and Gigaword 5 (Parker et al., 2011) articles as pre-trained token embeddings. The hyperparameters were optimized based on the performance on the validation set. 4 Results Table 2 presents the main results. The epochs for which the results are reported are optimized based on either the highest F1-score or the highest recall on the validation set. As expected, choosing the epoch based on the recall improves the recall on the test set, while lowering the precision. Overall, adding features consistently improves the results. Table 3 details the results for each PHI type. The system using only the EHR features yields the highest recall for 6 out of 12 PHI types. Most importantly, the recall for patient and doctor names are higher when using features than when using no feature: this is expected as the patient name of the note and the doctor names are used as features. In fact, the two remaining false negatives for patient names are annotation errors. For example, in the sentence "The patient responded well to Natrecor in the past, but the improvement disappeared soon", the drug name Natrecor was incorrectly marked as a patient name by the human annotator. This result is highly remarkable as patient names are the most sensitive information in a patient note (South et al., 2014). Adding all features often lowers the recall compared to using EHR features only, although the F1- score remains virtually unchanged. This is somewhat surprising, as we had expected that the features would help, as using the same feature set with a CRF to perform de-identification yields state-of-the- art results next to the ANN models (Dernoncourt et al., 2016). This could be explained as follows. Human-engineered features tend to have higher precision than recall, as it is often hard to design regular expressions or gazetteers that can detect all possible instances or variations of the desired entities. We Binary HIPAA (optimized by F1-score) Precision F1-score 99.150 99.103 99.202 99.100 99.213 99.259 Recall 99.197 99.304 99.306 Binary HIPAA (optimized by recall) Precision F1-score 98.965 98.557 99.105 98.771 98.880 99.149 Recall 99.376 99.441 99.420 No feature EHR features All features Table 2: Binary HIPAA token-based results (%) for the ANN model, averaged over 5 runs. The metric refers to the detection of PHI tokens versus non-PHI tokens, amongst PHI types that are defined by HIPAA. "No feature" is the model utilizing only character and word embeddings, without any feature. "EHR features" uses only 4 features derived from EHR database: patient first name, patient last name, doctor first name, and doctor last name. "All features" makes use of all features, including the EHR features as well as other engineered features listed in Table 1. "Optimized by F1-score" and "optimized by recall" means that the epochs for which the results are reported are optimized based on the highest F1-score or the highest recall on the validation set, respectively. No feature EHR features All features P 100.0 98.90 98.31 96.89 99.57 97.47 96.02 75.12 94.78 99.36 96.77 87.51 98.41 R 100.0 99.77 99.58 98.34 98.24 98.17 95.71 94.29 95.39 94.33 85.25 85.00 99.19 F1 100.0 99.33 98.94 97.61 98.90 97.82 95.86 83.60 95.08 96.76 90.54 86.11 98.80 P 100.0 98.95 98.98 98.62 99.31 97.27 96.41 77.04 94.77 99.68 97.63 89.29 98.48 R 100.0 99.79 99.46 99.14 98.82 98.48 96.49 95.72 95.52 94.03 85.25 82.50 99.27 F1 100.0 99.36 99.22 98.88 99.07 97.87 96.45 85.35 95.14 96.73 90.96 85.67 98.87 P 100.0 98.99 99.42 99.21 99.77 97.56 96.65 78.93 95.53 99.39 93.91 86.87 98.61 R 100.0 99.69 99.32 99.27 97.97 98.20 96.32 93.57 95.50 91.94 86.56 95.00 99.15 F1 100.0 99.34 99.37 99.24 98.86 97.88 96.46 84.80 95.51 95.49 89.81 90.56 98.88 Support 24 20627 1438 302 612 3676 462 28 1259 67 61 16 28572 Zip Date Phone Patient ID Doctor1 Location Age ≥ 90 Hospital1 State1 Street Country1 Binary Table 3: Binary token-based results (%) . The reported results are optimized by recall, and averaged over 5 runs. The symbol 1 indicates that the PHI type is not required by HIPAA. The PHI type "location" designates any location that is not a street name, zip code, state or country. P stands for precision, R for recall, and F1 for F1-score. conjecture that as the ANN model learn to rely more on such features, it might lose the ability to learn to pick up tokens that deviate from engineered features, resulting in a lower recall. For example, we notice that the phone PHI tokens that are not detected by the model using all features but are detected by the other two models, are ill-formed phone numbers such as "617-554-2395", or phone extensions such as "617-690-4031 ext 6599". Since the phone regular expressions do not capture these two examples, they are more likely to be false negatives in the model that uses the phone regular expression features. 5 Conclusion In this paper we presented an extension of the ANN-based model for patient note de-identification that can incorporate features. We showed that adding features results in an increase of the recall, in particular features leveraging information from the associated EHRs, namely patient names and doctor names. Our results suggest that constructing patient note de-identification systems should be performed us- ing structured information from the EHRs, the latter being available in a typical, real-life setting. We restricted our EHR-derived features to patient and doctor names, but it could be extended to the many other structured fields that EHR contain, such as patients' addresses, phone numbers, email addresses, professions, and ages. Acknowledgements The project was supported by Philips Research. The content is solely the responsibility of the authors and does not necessarily represent the official views of Philips Research. We warmly thank Michele Filannino, Alistair Johnson, Li-wei Lehman, Roger Mark, and Tom Pollard for their helpful suggestions and technical assistance. References [Aberdeen et al.2010] John Aberdeen, Samuel Bayer, Reyyan Yeniterzi, Ben Wellner, Cheryl Clark, David Hanauer, Bradley Malin, and Lynette Hirschman. 2010. The MITRE Identification Scrubber Toolkit: design, training, and assessment. International journal of medical informatics, 79(12):849–859. [Beckwith et al.2006] Bruce A Beckwith, Rajeshwarri Mahaadevan, Ulysses J Balis, and Frank Kuo. 2006. Devel- opment and evaluation of an open source software tool for deidentification of pathology reports. BMC medical informatics and decision making, 6(1):1. [Berman2003] Jules J Berman. 2003. Concept-match medical data scrubbing: how pathology text can be used in research. Archives of pathology & laboratory medicine, 127(6):680–686. [Dernoncourt et al.2016] Franck Dernoncourt, Ji Young Lee, Ozlem Uzuner, and Peter Szolovits. 2016. De- identification of patient notes with recurrent neural networks. arXiv preprint arXiv:1606.03475. [DesRoches et al.2013] Catherine M DesRoches, Chantal Worzala, and Scott Bates. 2013. Some hospitals are falling behind in meeting meaningful use criteria and could be vulnerable to penalties in 2015. Health Affairs, 32(8):1355–1360. [Douglas et al.2004] Margaret Douglas, Gari Clifford, Andrew Reisner, George Moody, and Roger Mark. 2004. Computer-assisted de-identification of free text in the mimic ii database. In Computers in Cardiology, 2004, pages 341–344. IEEE. [Douglass et al.2005] Margaret Douglass, Gari Cliffford, Andrew Reisner, William Long, George Moody, and Roger Mark. 2005. De-identification algorithm for free-text nursing notes. In Computers in Cardiology, 2005, pages 331–334. IEEE. [Fielstein et al.2004] Elliot M. Fielstein, Steven H. Brown, and Theodore Speroff. 2004. Algorithmic de- identification of VA medical exam text for HIPAA privacy compliance: Preliminary findings. Medinfo, 1590. [Filannino and Nenadic2015] Michele Filannino and Goran Nenadic. 2015. Temporal expression extraction with extensive feature type selection and a posteriori label adjustment. Data & Knowledge Engineering, 100:19–33. [Friedlin and McDonald2008] Jeff Friedlin and Clement J McDonald. 2008. A software tool for removing patient identifying information from clinical documents. Journal of the American Medical Informatics Association, 15(5):601–610. [Goldberger et al.2000] Ary L Goldberger, Luis AN Amaral, Leon Glass, Jeffrey M Hausdorff, Plamen Ch Ivanov, Roger G Mark, Joseph E Mietus, George B Moody, Chung-Kang Peng, and H Eugene Stanley. 2000. Phys- iobank, physiotoolkit, and physionet components of a new research resource for complex physiologic signals. Circulation, 101(23):e215–e220. [Guo et al.2006] Yikun Guo, Robert Gaizauskas, Ian Roberts, George Demetriou, and Mark Hepple. 2006. Iden- tifying personal health information using support vector machines. In i2b2 workshop on challenges in natural language processing for clinical data, pages 10–11. [Gupta et al.2004] Dilip Gupta, Melissa Saul, and John Gilbertson. 2004. Evaluation of a deidentification (De-Id) software engine to share pathology reports and clinical documents for research. American journal of clinical pathology, 121(2):176–186. [Hara2006] Kazuo Hara. 2006. Applying a SVM based chunker and a text classifier to the deid challenge. In i2b2 Workshop on challenges in natural language processing for clinical data, pages 10–11. Am Med Inform Assoc. [Hochreiter and Schmidhuber1997] Sepp Hochreiter and Jurgen Schmidhuber. 1997. Long short-term memory. Neural computation, 9(8):1735–1780. [Hsiao et al.2011] Chun-Ju Hsiao, Esther Hing, Thomas C Socey, and Bill Cai. 2011. Electronic health record systems and intent to apply for meaningful use incentives among office-based physician practices: United states, 2001–2011. system, 18(17.3):17–3. [Johnson et al.2016] Alistair EW Johnson, Tom J Pollard, Lu Shen, Li-wei H Lehman, Mengling Feng, Mohammad Ghassemi, Benjamin Moody, Peter Szolovits, Leo Anthony Celi, and Roger G Mark. 2016. Mimic-iii, a freely accessible critical care database. Scientific data, 3. [McCann2015] Erin McCann. 2015. EHR vendor marketshare and MU attestations by vendor. Healthcare IT News. [Meystre et al.2010] Stephane M Meystre, F Jeffrey Friedlin, Brett R South, Shuying Shen, and Matthew H Samore. 2010. Automatic de-identification of textual documents in the electronic health record: a review of recent research. BMC medical research methodology, 10(1):1. [Morrison et al.2009] Frances P Morrison, Li Li, Albert M Lai, and George Hripcsak. 2009. Repurposing the clinical record: can an existing natural language processing system de-identify clinical notes? Journal of the American Medical Informatics Association, 16(1):37–39. [Neamatullah et al.2008] Ishna Neamatullah, Margaret Douglass, H Lehman Li-wei, Andrew Reisner, Mauricio Villarroel, William J Long, Peter Szolovits, George B Moody, Roger G Mark, and Gari D Clifford. 2008. Au- tomated de-identification of free-text medical records. BMC medical informatics and decision making, 8(1):1. [Office for Civil Rights2002] HHS Office for Civil Rights. 2002. Standards for privacy of individually identifiable health information. final rule. Federal Register, 67(157):53181. [Parker et al.2011] Robert Parker, David Graff, Junbo Kong, Ke Chen, and Kazuaki Maeda. 2011. English giga- word fifth edition, linguistic data consortium. Technical report, Technical Report. Linguistic Data Consortium, Philadelphia. [Pennington et al.2014] Jeffrey Pennington, Richard Socher, and Christopher D Manning. 2014. GloVe: global vectors for word representation. Proceedings of the Empiricial Methods in Natural Language Processing (EMNLP 2014), 12:1532–1543. [Ruch et al.2000] Patrick Ruch, Robert H Baud, Anne-Marie Rassinoux, Pierrette Bouillon, and Gilbert Robert. 2000. Medical document anonymization with a semantic lexicon. In Proceedings of the AMIA Symposium, page 729. American Medical Informatics Association. [Saeed et al.2011] Mohammed Saeed, Mauricio Villarroel, Andrew T Reisner, Gari Clifford, Li-Wei Lehman, George Moody, Thomas Heldt, Tin H Kyaw, Benjamin Moody, and Roger G Mark. 2011. Multiparameter intelligent monitoring in intensive care II (MIMIC-II): a public-access intensive care unit database. Critical care medicine, 39(5):952. [South et al.2014] Brett R South, Danielle Mowery, Ying Suo, Jianwei Leng, ´Oscar Ferr´andez, Stephane M Meystre, and Wendy W Chapman. 2014. Evaluating the effects of machine pre-annotation and an interactive annotation interface on manual de-identification of clinical text. Journal of biomedical informatics, 50:162–172. [Stubbs et al.2015] Amber Stubbs, Christopher Kotfila, and Ozlem Uzuner. 2015. Automated systems for the de- identification of longitudinal clinical narratives: Overview of 2014 i2b2/UTHealth shared task track 1. Journal of biomedical informatics, 58:S11–S19. [Sweeney1996] Latanya Sweeney. 1996. Replacing personally-identifying information in medical records, the Scrub system. In Proceedings of the AMIA annual fall symposium, page 333. American Medical Informatics Association. [Szarvas et al.2006] Gyorgy Szarvas, Rich´ard Farkas, and Andr´as Kocsor. 2006. A multilingual named entity In Discovery Science, pages recognition system using boosting and c4.5 decision tree learning algorithms. 267–278. Springer. [Thomas et al.2002] Sean M Thomas, Burke Mamlin, Gunther Schadow, and Clement McDonald. 2002. A suc- cessful technique for removing names in pathology reports using an augmented search and replace method. In Proceedings of the AMIA Symposium, page 777. American Medical Informatics Association. [Uzuner et al.2008] Ozlem Uzuner, Tawanda C Sibanda, Yuan Luo, and Peter Szolovits. 2008. A de-identifier for medical discharge summaries. Artificial intelligence in medicine, 42(1):13–35. [Wright et al.2013] Adam Wright, Stanislav Henkin, Joshua Feblowitz, Allison B McCoy, David W Bates, and Dean F Sittig. 2013. Early results of the meaningful use program for electronic health records. New England Journal of Medicine, 368(8):779–780. [Yang and Garibaldi2015] Hui Yang and Jonathan M Garibaldi. 2015. Automatic detection of protected health information from clinic narratives. Journal of biomedical informatics, 58:S30–S38.
1902.10118
1
1902
2019-02-26T18:53:22
Multi-Task Learning with Contextualized Word Representations for Extented Named Entity Recognition
[ "cs.CL" ]
Fine-Grained Named Entity Recognition (FG-NER) is critical for many NLP applications. While classical named entity recognition (NER) has attracted a substantial amount of research, FG-NER is still an open research domain. The current state-of-the-art (SOTA) model for FG-NER relies heavily on manual efforts for building a dictionary and designing hand-crafted features. The end-to-end framework which achieved the SOTA result for NER did not get the competitive result compared to SOTA model for FG-NER. In this paper, we investigate how effective multi-task learning approaches are in an end-to-end framework for FG-NER in different aspects. Our experiments show that using multi-task learning approaches with contextualized word representation can help an end-to-end neural network model achieve SOTA results without using any additional manual effort for creating data and designing features.
cs.CL
cs
Multi-Task Learning with Contextualized Word Representations for Extented Named Entity Recognition Thai-Hoang Pham1,2 , Khai Mai2 , Nguyen Minh Trung2 , Nguyen Tuan Duc2 , Danushka Bolegala3 , Ryohei Sasano4 and Satoshi Sekine5 1Ohio State University 2Alt Inc 3University of Liverpool 4Nagoya University 5Riken AIP [email protected], {mai.tien.khai, nguyen.minh.trung, nguyen.tuan.duc}@alt.ai, [email protected], [email protected], [email protected] Abstract Fine-Grained Named Entity Recognition (FG- NER) is critical for many NLP applications. While classical named entity recognition (NER) has at- tracted a substantial amount of research, FG-NER is still an open research domain. The current state- of-the-art (SOTA) model for FG-NER relies heav- ily on manual efforts for building a dictionary and designing hand-crafted features. The end-to-end framework which achieved the SOTA result for NER did not get the competitive result compared to SOTA model for FG-NER. In this paper, we inves- tigate how effective multi-task learning approaches are in an end-to-end framework for FG-NER at dif- ferent aspects. Our experiments show that using multi-task learning approaches with contextualized word representations can help an end-to-end neural network model achieve SOTA results without us- ing any additional manual effort for creating data and designing features. 1 Introduction Fine-grained named entity recognition (FG-NER) is a spe- cial kind of named entity recognition (NER) that focuses on identifying and classifying a large number of entity cat- egories. In traditional NER task, often less than eleven named entity (NE) categories are defined. For example, in two shared tasks, CoNLL 2002 and CoNLL 2003 [Tjong Kim Sang, 2002; Tjong Kim Sang and De Meulder, 2003], there were only four NE types considered: Person, Location, Organization, and Miscellaneous. From these shared tasks, ten NE categories were defined for Twitter texts [Ritter et al., 2011]. The FG-NER, on the other hand, handles hundreds NE categories which are the fine-grained classification of coarse-grained categories. In particular, [Sekine et al., 2002; Sekine, 2008] proposed the entity hierarchy which contains 200 NE categories designed manually. Meanwhile, [Ling and Weld, 2012; Yosef et al., 2012; Gillick et al., 2014] used unsupervised methods for creating FG-NER category from (a) NER result (b) FG-NER result Figure 1: Example of NER and FG-NER. knowledge bases such as Freebase [Bollacker et al., 2008] and YAGO [Suchanek et al., 2007]. Figure 1 shows an exam- ple when identifying and classifying NE by traditional NER and FG-NER systems. While there have been many methods proposed for clas- sical NER [Zhou and Su, 2002; McCallum and Li, 2003; Ma and Hovy, 2016; Pham and Le-Hong, 2017], FG-NER is still an open research domain. Unlike NER, the current SOTA model for FG-NER [Mai et al., 2018] requires signif- icant manual effort for building a dictionary and designing features. The end-to-end neural network architectures have not achieved competitive results for this task. It is because the data sparseness problem of some NE categories when the size of FG-NER dataset are comparable with NER dataset while the number of NE categories is much larger. Moreover, iden- tifying NE for FG-NER is more difficult compared to NER because these NE types are more complex and longer. Recently, multi-task learning approaches have been pro- posed for improving the performances of NER systems [Yang et al., 2017; Lin and Lu, 2018; Lin et al., 2018; Changpinyo et al., 2018]. It can be seen as a form of inductive trans- fer that introduces an auxiliary task as an inductive bias to help a model prefer some hypotheses over the others. An- other way to improve NER systems is using contextualized word representations to learn the dependencies among words in a sentence [Peters et al., 2018]. From these motivations, we investigate the effectiveness of multi-task learning for the end-to-end neural network architecture in both cases uncon- textualized and contextualized word representations for FG- NER task. We have novel contributions in two folds. First, to the best of our knowledge, our work is the first study that concen- trates on multi-task learning approach for sequence labeling problem in general and for FG-NER task in particular at dif- ferent aspects including different parameter sharing schemes for multi-task sequence labeling, learning with neural lan- guage model, and learning at different word representation settings. We also give empirical analysis to understand the effectiveness of contextualized word representations for FG- NER task. Second, we propose an end-to-end neural network architecture which achieves SOTA result compared to the pre- vious systems that require significant manual effort for build- ing a dictionary and designing features. This neural network system, despite focusing on FG-NER task, can still be applied to any other sequence labeling problems. The remainder of this paper is structured as follows. Sec- tion 2 describes multi-task learning architectures and contex- tualized word representations used in our system. Section 3 gives experimental results and discussions. Finally, Section 4 concludes the paper. 2 Approach 2.1 Single-Task Sequence Labeling Model With a recent resurgence of the deep learning approaches, there have been several neural network models proposed for sequence labeling problem. Most of these models shared the same abstract architecture. In particular, each input sen- tence is fed to these models as a sequence of words and is transformed into a sequence of distributed representations by the word embedding layer. These distributed representations can be improved by incorporating character-level information from Convolutional Neural Network (CNN) or Long Short- Term Memory (LSTM) layer into word embedding layer. That distributed representation sequence is then passed to the recurrent neural network layer (LSTM or a Gated Recurrent Unit (GRU)), and then a Conditional Random Field (CRF) layer takes as input the output of the recurrent neural network layer to predict the best output sequence [Huang et al., 2015; Lample et al., 2016; Ma and Hovy, 2016]. In our work, we re-implement the neural network archi- tecture in [Ma and Hovy, 2016] which is the combination of CNN, bi-directional LSTM (BLSTM), and CRF models as our base model. For training, we minimize the negative log- likelihood function: E = − T(cid:88) log(P (ytht)) (1) t=1 where ht is the output of BLSTM and yt is the label at time step t. Decoding can be solved effectively by Viterbi algo- rithm to find the sequence with the highest conditional prob- ability. 2.2 Multi-Task Learning with Sequence Labeling Model Recently, multi-task sequence learning approach has been used successfully in sequence labeling problem [Yang et al., 2017; Ruder, 2017; Peng and Dredze, 2017; Hashimoto et al., 2017; Changpinyo et al., 2018; Clark et al., 2018]. In particular, the main sequence labeling task is learned with auxiliary sequence labeling tasks during training to improve the performance of the main task. These multi-task sequence labeling models are extensions to the base model discussed above with different parameter sharing schemes. In our work, we investigate two kinds of multi-task se- quence labeling models for FG-NER task including same- level-shared model and hierarchical-shared model. To train multi-task sequence labeling models, we minimize both of auxiliary and main objective function. In particular, for an input sequence x = (x1, x2, ..., xT ), we minimize: hauxiliary log(P (yauxiliary (2) )) t t Eauxiliary = − T(cid:88) Emain = − T(cid:88) t=1 if x belongs to auxiliary data, or log(P (ymain t hmain t )) (3) t=1 t t t t , ymain , hmain if x belongs to main data. hauxiliary are the outputs of BLSTM and yauxiliary are the labels at time step t. Same-level-Shared Model For same-level-shared model, both main and auxiliary tasks are trained and predicted at the same-level layer. Specificially, we experiment with two kinds of same-level-shared model including embedding- shared model (Figure 2b) which uses the same embedding layer for both main and auxiliary tasks, and separate LSTM and CRF layers for each task, and RNN-shared model (Fig- ure 2c) which uses the same embedding and LSTM layers for both main and auxiliary task, and separate CRF layers for each task. In RNN-shared model, hauxiliary, hmain are the same and are computed from one BLSTM layer: hauxiliary = hmain = BLSTM(x) (4) while in embedding-shared model, hauxiliary, hmain are computed from separate BLSTM layers: hauxiliary = BLSTMauxiliary(x) (5) hmain = BLSTMmain(x) (6) Hierarchical-Shared Model For hierarchical-shared model, we train and predict different supervised tasks at different-level layers. The auxiliary and main tasks are pre- dict by the low-level and high-level layers respectively. To avoid catastrophic interference between main and auxiliary tasks, the word representations are fed into both both low- level and high-level layers. In particular, hauxiliary, hmain are computed as follows: hauxiliary = BLSTMauxiliary(x) hmain = BLSTMmain([x; hauxiliary]) (7) (8) (a) Single Model (+LM) (b) Embedding-Shared Model (+Shared LM) (c) RNN-Shared Model (+Shared LM) (d) Hierarchical-Shared Model (+Shared LM) (e) Hierarchical-Shared Model (+Unshared LM) Figure 2: Single-Task and Multi-Task Sequence Labeling Models (+LM). 2.3 Multi-Task Learning with Neural Language Model Learning with auxiliary sequence labeling task requires additional data which may not be available for some lan- guages. For this reason, several models have been pro- posed for training sequence labeling task with other unsu- In particular, [Cheng et al., 2015; pervised learning tasks. Rei, 2017] trained single-task sequence labeling models with neural language model simultaneously. In our work, we incorporate a word-level neural language model into both single and multi-task sequence labeling mod- els to improve the performances. Specifically, we put the hid- den state from BLSTM at each time step into softmax layer to predict the next and previous words. Note that we use two separate language models for each forward and backward passes of BLSTM. The objective function now is the com- bination of sequence labeling and language model objective functions and is computed as follows: ←− E LM + −→ E LM ) Ejoint = E + λ( (9) where λ is a parameter controlled the impact of the language −→ modeling task to the sequence labeling task and E LM are the objective functions of forward and backward language models. These objective functions are computed as follows: ←− E LM , ←− E LM = − T(cid:88) E LM = − T(cid:88) −→ t=1 log(P (wt−1←− ht)) log(P (wt+1−→ ht)) (10) (11) t=1 −→ ht, ←− where ht are hidden states of forward and backward LSTM and w0, wT +1 are special tokens START, END. We in- vestigate two kinds of incorporating neural language model into our multi-task sequence labeling model: shared-LM which shares neural language model for both auxiliary and main sequence labeling task and unshared-LM which uses separate neural language model for each task. Figure 2d and Figure 2e show the difference between these two kinds of in- corporating neural language model. 2.4 Deep Contextualized Word Representations Datasets FG-NER POS Chunk NER (CoNLL) NER (OntoNotes) #Sentence Train 14176 58891 8000 14987 58891 Dev 1573 8254 936 3466 8254 Test 3942 6457 2012 3684 6457 #Word #Label 32052 68241 21589 30290 68241 208 51 23 8 30 embeddings such word Uncontextualized as Word2Vec [Mikolov et al., 2013], GloVe [Pennington et al., 2014] have been used widely in neural natural language processing models and have improved their per- formances. However, these word embeddings still have some drawbacks. In particular, it is difficult for them to represent the complex characteristics of a word and its meaning at different contexts. Recently, deep contextualized word representations have been proposed to solve these problems. [Peters et al., 2018] introduces the word represen- tations which are computed from multi-layer bidirectional language model with character convolutions. Unlike [Peters et al., 2018], [Radford et al., ] use Transformer instead of BLSTM to calculate the language model. [Devlin et al., 2018] improves [Radford et al., ] work by jointly learning both left and right context in Transformer. Our proposed multi-task models can be trained with any kind of these contextualized word representations but in the scope of this paper, we only experiment with contextualized word representations described in [Peters et al., 2018] which are called Embeddings from Language Models (ELMo) and leave other contextualized word representations in our future works. ELMo are functions of the entire input sentence and are computed as follows: L(cid:88) ELMot = γ slhLM t,l (12) l=1 is the input representation and hLM t,l where hLM is the out- t,0 put at lth layer of L-layer bidirectional language model at time step t, s = (s1, s2, ..., sL) are the softmax-normalized weights and γ are the scalar parameter which allows the model to scale the ELMo vector. In our work, we incorpo- rate a 2-layer bidirectional language model pre-trained on 1 Billion Word Language Model Benchmark dataset to our sys- tem. We set s1 = 0 and s2 = 1 which means we only use the output of 2nd layer of the bidirectional language model as an input for the next layer in our system. 3 Experiments 3.1 Datasets We conduct our experiments with FG-NER as our main task and POS tagging, chunking, NER, and language model as our auxiliary tasks. For FG-NER task, we use the En- glish part of the dataset described in [Nguyen et al., 2017; Mai et al., 2018]. For chunking task, we use CoNLL 2000 dataset [Tjong Kim Sang and Buchholz, 2000]. This dataset has only training and testing sets so we used one part of the training set for validation. For NER task, we use CoNLL 2003 and OntoNotes 5.0 datasets [Tjong Kim Sang and Table 1: Statistics of datasets used in our experiments. LSTM CNN Dropout Embedding Language Model Training Hyper-parameter hidden size window size #filter input dropout BLSTM dropout GloVe dimension ELMo dimension γ λ batch size initial learning rate decay rate Value 256 3 30 0.33 0.5 300 1024 1 0.05 16 0.01 0.05 Table 2: Hyper-parameters used in our systems. De Meulder, 2003; Pradhan et al., 2012]. OntoNotes 5.0 dataset is also used for POS tagging task. The details of each dataset are described in Table 1. 3.2 Training and Evaluation Method The training procedure for multi-task sequence labeling models is as follows. For same-level-shared models, at each iteration, we first sample a task (main or auxiliary tasks) by Bernoulli trial based on sizes of datasets. Next, we sam- ple a batch of training examples from the given task and then update gradients for both the shared parameters and the task-specific parameters according to the loss function of the given task. For hierarchical-shared models, at each iteration, we train the auxiliary (low-level) task first and then move to the main (high-level) task because selecting the task ran- domly hampers the effectiveness of hierarchical-shared mod- els [Hashimoto et al., 2017]. We use stochastic gradient descent algorithm with decay rate 0.05. Table 2 shows the hyper-parameters we used in our models. We evaluate the performance of our system with F1 score: F1 = 2 ∗ precision ∗ recall precision + recall Precision and recall are the percentage of correct named enti- ties identified by the system and the percentage of identified named entities present in the corpus respectively. To compare fairly with previous systems, we use an available evaluation script provided by the CoNLL 2003 shared task1 to calculate F1 score of our FG-NER system. Model FG-NER +Chunk Base Model (GloVe) RNN-Shared Model (GloVe) Embedding-Shared Model (GloVe) Hierarchical-Shared Model (GloVe) Base Model (ELMo) RNN-Shared Model (ELMo) Embedding-Shared Model (ELMo) Hierarchical-Shared Model (ELMo) Base Model (GloVe) + LM [Rei, 2017] RNN-Shared Model (GloVe) + Shared-LM Embedding-Shared Model (GloVe) + Shared-LM Hierarchical-Shared Model (GloVe) + Shared-LM Base Model (ELMo) + LM RNN-Shared Model (ELMo) + Shared-LM Embedding-Shared Model (ELMo) + Shared-LM Hierarchical-Shared Model (ELMo) + Shared-LM Hierarchical-Shared Model (GloVe) + Unshared-LM Hierarchical-Shared Model (ELMo) + Unshared-LM [Mai et al., 2018] 81.51 - - - 82.74 - - - 81.77 - - - 82.91 - - - - - 83.14 - 80.53 81.49 81.65 - 82.60 82.75 83.04 - 80.83 81.54 81.69 - 82.68 82.61 82.87 81.77 83.35 - +NER (CoNLL) - 81.38 81.21 82.14 - 82.09 82.45 82.72 - 81.34 81.95 81.96 - 82.64 82.32 82.82 81.80 83.14 - +POS - 80.55 81.59 81.27 - 81.77 82.34 82.76 - 80.69 81.86 81.42 - 81.61 82.46 82.85 81.72 83.06 - +NER (Ontonotes) - 81.13 81.24 81.67 - 82.12 81.94 82.96 - 81.45 81.34 81.78 - 82.36 82.45 82.99 81.88 82.82 - Table 3: Results in F1 scores for FG-NER (We run each setting five times and report the average F1 scores.) 3.3 Results Base Model Our base model is similar to LSTM + CNN + CRF model in [Mai et al., 2018], but in contrast to their model, we implement by PyTorch instead of Theano and train sentences with same length at each batch to make the training process faster. It achieves F1 score of 81.51% compared to 80.93% reported in their paper. Deep Contextualized Word Representations In the first experiment, we investigate the effectiveness of contextual- ized word representations (ELMo) compared to uncontextu- alized word representations (GloVe) when incorporating in our FG-NER systems (Base Model (GloVe) vs. Base Model (ELMo)). From Table 3, we see that using ELMo signifi- cantly improves the F1 score of our system compared to using GloVe (from 81.51% to 82.74%). To further investigate this phenomenon, we give an analy- sis to see which NE types are improved when using ELMo. Table 4 shows F1 scores of 5 NE types which are most im- proved and their average token lengths. While the average token length of NEs in our dataset is 1.9, the average to- ken lengths of these NE types are much longer. It shows that ELMo helps to improve the performance of our system when identifying NEs which are long sequences. This result is understandable because Base Model (GloVe) relies on only BLSTM layer to learn the dependencies among words in se- quence to predict NE labels while Base Model (ELMo) learns these dependencies by both embedding and BLSTM layers. Unlike NER, NE types in FG-NER are often more complex and longer so using only BLSTM layer is not sufficient to capture these dependencies. 1http://www.cnts.ua.ac.be/conll2003/ner/ Named Entity Book Printing Other Spaceship Earthquake Public Institution GloVe ELMo Token Length 3.2 48.65 3.5 60.38 61.90 2.7 3.8 75.00 80.00 4.2 76.92 83.33 80.00 90.20 95.00 Table 4: 5 most improved NE types when using ELMo. Parameter Sharing Schemes In the second experiment, we investigate the impact of training FG-NER with other aux- iliary sequence labeling tasks including POS tagging, chunk- ing, and NER by our multi-task sequence labeling models at different parameter sharing schemes. In particular, we com- pare three kinds of multi-task sequence labeling architectures including embedding-shared, RNN-shared, and hierarchical- shared models. The size of the original OntoNotes dataset is much larger than FG-NER dataset so it is difficult for our system to focus on learning FG-NER task. Thus, we sample 10,000 sentences from OntoNotes for training POS tagging and NER. Table 3 shows the performances of our multi-task sequence labeling models with GloVe and ELMo representations. In both cases, hierarchical-shared model gives the best perfor- mances. In particular, it achieves an F1 score of 82.14% when learning with NER (CoNLL) and an F1 score of 83.04% when learning with NER (Ontonotes) compared to F1 scores of 81.51% and 82.74% of base model in GloVe and ELMo settings respectively. For same-level-shared models, they also achieve better results compared to base model but the differ- ences are not very large. These results indicate that learning FG-NER with other sequence labeling tasks at different pa- rameter sharing schemes helps to improve the performances of FG-NER system. Also, in most cases, it is more beneficial when learning the auxiliary and the main tasks at different levels (hierarchical-shared model) compared to learning at the same level (RNN-shared and embedding-shared mod- els). For same-level sharing scheme, we also see that embedding-shared model achieves better performances than RNN-shared model in most cases. The gap between these two models is larger when the auxiliary task is more different from the main task (POS tagging, chunking are more different from FG-NER compared to NER). Neural Language Model In the third experiment, we in- corporate our systems including both single and multi-task sequence labeling models with neural language model. We experiment with two kinds of incorporating neural language model: shared-LM which shares neural language model for both auxiliary and main sequence labeling tasks and unshared-LM which uses separate neural language model for each task. For single-task model, incorporating neural lan- guage model helps to improve performance from 81.51% to 81.77% and from 82.74% to 82.91% in GloVe and ELMo settings respectively. For multi-task models, with shared- LM, our best result is an F1 score of 82.99% when learning hierarchical-shared FG-NER model with NER (Ontonotes), and with unshared-LM, our best result is an F1 score of 83.35% when learning hierarchical-shared FG-NER model with chunking. We also see that using unshared-LM helps our multi-task models achieves better performances compared to using shared-LM in most cases. Comparison with SOTA System Our best system achieves the SOTA result for FG-NER. In particular, our hierarchical- shared model with chunking as an auxiliary sequence label- ing task and unshared-LM achieves an F1 score of 83.35% compared to 83.14% of the previous SOTA model for FG- NER [Mai et al., 2018]. While that model requires significant manual effort for building a dictionary and designing hand- crafted features, our best model is truly end-to-end frame- work without using any additional information. 4 Conclusion We present an experimental study on the effectiveness of us- ing multi-task learning with contextualized word representa- tions in FG-NER task. In particular, we examine the multi- task approach at different aspects including different parame- ter sharing schemes for multi-task sequence labeling, learning with neural language model, and learning at different word representation settings. Our best model, while does not use any additional manual effort for creating data and designing features, achieves an F1 score of 83.35% which is the SOTA result compared to the previous FG-NER model. References [Bollacker et al., 2008] Kurt Bollacker, Colin Evans, Praveen Paritosh, Tim Sturge, and Jamie Taylor. Freebase: A collaboratively created graph database for structuring In Proceedings of the 2008 ACM human knowledge. SIGMOD International Conference on Management of Data, pages 1247 -- 1250. ACM, 2008. [Changpinyo et al., 2018] Soravit Changpinyo, Hexiang Hu, and Fei Sha. Multi-task learning for sequence tagging: In Proceedings of the 27th Inter- An empirical study. national Conference on Computational Linguistics, pages 2965 -- 2977, 2018. [Cheng et al., 2015] Hao Cheng, Hao Fang, and Mari Osten- dorf. Open-domain name error detection using a multi- task rnn. In Proceedings of the 2015 Conference on Em- pirical Methods in Natural Language Processing, pages 737 -- 746, 2015. [Clark et al., 2018] Kevin Clark, Minh-Thang Luong, Christopher D Manning, and Quoc Le. Semi-supervised sequence modeling with cross-view training. In Proceed- ings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1914 -- 1925, 2018. [Devlin et al., 2018] Jacob Devlin, Ming-Wei Chang, Ken- ton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understand- ing. arXiv preprint arXiv:1810.04805, 2018. [Gillick et al., 2014] Dan Gillick, Nevena Lazic, Kuzman Ganchev, Jesse Kirchner, and David Huynh. Context- dependent fine-grained entity type tagging. arXiv preprint arXiv:1412.1820, 2014. [Hashimoto et al., 2017] Kazuma Hashimoto, Caiming Xiong, Yoshimasa Tsuruoka, and Richard Socher. A joint many-task model: Growing a neural network for multiple nlp tasks. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 1923 -- 1933, 2017. [Huang et al., 2015] Zhiheng Huang, Wei Xu, and Kai Yu. Bidirectional lstm-crf models for sequence tagging. arXiv preprint arXiv:1508.01991, 2015. [Lample et al., 2016] Guillaume Lample, Miguel Balles- teros, Sandeep Subramanian, Kazuya Kawakami, and Chris Dyer. Neural architectures for named entity recogni- tion. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 260 -- 270, 2016. [Lin and Lu, 2018] Bill Yuchen Lin and Wei Lu. Neural adaptation layers for cross-domain named entity recogni- tion. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2012 -- 2022, 2018. [Lin et al., 2018] Ying Lin, Shengqi Yang, Veselin Stoyanov, and Heng Ji. A multi-lingual multi-task architecture for In Proceedings of the low-resource sequence labeling. 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), volume 1, pages 799 -- 809, 2018. [Ling and Weld, 2012] Xiao Ling and Daniel S Weld. Fine- grained entity recognition. In n Proceedings of the Twenty- Sixth AAAI Conference on Artificial Intelligence, vol- ume 12, pages 94 -- 100, 2012. [Ma and Hovy, 2016] Xuezhe Ma and Eduard Hovy. End-to- end sequence labeling via bi-directional lstm-cnns-crf. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), volume 1, pages 1064 -- 1074, 2016. [Mai et al., 2018] Khai Mai, Thai-Hoang Pham, Minh Trung Nguyen, Nguyen Tuan Duc, Danushka Bollegala, Ryohei Sasano, and Satoshi Sekine. An empirical study on fine- grained named entity recognition. In Proceedings of the 27th International Conference on Computational Linguis- tics, pages 711 -- 722, 2018. [McCallum and Li, 2003] Andrew McCallum and Wei Li. Early results for named entity recognition with conditional random fields, feature induction and web-enhanced lexi- cons. In Proceedings of the Seventh Conference on Natu- ral Language Learning, pages 188 -- 191, 2003. [Mikolov et al., 2013] Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed rep- resentations of words and phrases and their composition- ality. In Advances in Neural Information Processing Sys- tems, pages 3111 -- 3119, 2013. [Nguyen et al., 2017] Tuan Duc Nguyen, Khai Mai, Thai- Hoang Pham, Minh Trung Nguyen, Truc-Vien T Nguyen, Takashi Eguchi, Ryohei Sasano, and Satoshi Sekine. Ex- tended named entity recognition api and its applications in language education. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics, System Demonstrations, pages 37 -- 42, 2017. [Peng and Dredze, 2017] Nanyun Peng and Mark Dredze. In the 2nd Workshop on Representation Multi-task domain adaptation for sequence tagging. Proceedings of Learning for NLP, pages 91 -- 100, 2017. [Pennington et al., 2014] Jeffrey Richard Socher, and Christopher Manning. Glove: Global vectors In Proceedings of the 2014 for word representation. Conference on Empirical Methods in Natural Language Processing, pages 1532 -- 1543, 2014. Pennington, [Peters et al., 2018] Matthew Peters, Mark Neumann, Mo- hit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word repre- sentations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Compu- tational Linguistics: Human Language Technologies, Vol- ume 1 (Long Papers), volume 1, pages 2227 -- 2237, 2018. [Pham and Le-Hong, 2017] Thai-Hoang Pham and Phuong Le-Hong. End-to-end recurrent neural network models for vietnamese named entity recognition: Word-level vs. character-level. In Proceedings of the 15th International Conference of the Pacific Association for Computational Linguistics, pages 219 -- 232. Springer, 2017. [Pradhan et al., 2012] Sameer Pradhan, Alessandro Mos- chitti, Nianwen Xue, Olga Uryupina, and Yuchen Zhang. Conll-2012 shared task: Modeling multilingual unre- stricted coreference in ontonotes. In Joint Conference on EMNLP and CoNLL-Shared Task, pages 1 -- 40. Associa- tion for Computational Linguistics, 2012. [Radford et al., ] Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language under- standing by generative pre-training. [Rei, 2017] Marek Rei. Semi-supervised multitask learning for sequence labeling. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), volume 1, pages 2121 -- 2130, 2017. [Ritter et al., 2011] Alan Ritter, Sam Clark, Oren Etzioni, et al. Named entity recognition in tweets: An experimen- tal study. In Proceedings of the 2011 Conference on Em- pirical Methods in Natural Language Processing, pages 1524 -- 1534, 2011. [Ruder, 2017] Sebastian Ruder. An overview of multi- arXiv preprint task learning in deep neural networks. arXiv:1706.05098, 2017. [Sekine et al., 2002] Satoshi Sekine, Kiyoshi Sudo, and Chikashi Nobata. Extended named entity hierarchy. In Proceedings of the third Language Resources and Evalua- tion Conference, pages 1818 -- 1824, 2002. [Sekine, 2008] Satoshi Sekine. Extended named entity on- In Proceedings of the tology with attribute information. sixth Language Resources and Evaluation Conference, pages 52 -- 57, 2008. [Tjong Kim Sang and Buchholz, 2000] Erik [Suchanek et al., 2007] Fabian M Suchanek, Gjergji Kas- neci, and Gerhard Weikum. Yago: A core of semantic knowledge. In Proceedings of the 16th International Con- ference on World Wide Web, pages 697 -- 706. ACM, 2007. Tjong Introduction to the Kim Sang and Sabine Buchholz. In Proceedings of conll-2000 shared task: Chunking. the 2nd Workshop on Learning Language in Logic and the 4th Conference on Computational Natural Language Learning-Volume 7, pages 127 -- 132. Association for Computational Linguistics, 2000. F [Tjong Kim Sang and De Meulder, 2003] Erik Tjong Kim Sang and Fien De Meulder. Introduction to the conll- 2003 shared task: Language-independent named entity In Proceedings of the seventh conference recognition. on Natural language learning at HLT-NAACL 2003- Volume 4, pages 142 -- 147. Association for Computational Linguistics, 2003. F [Tjong Kim Sang, 2002] Erik F. Tjong Kim Sang. Introduc- tion to the conll-2002 shared task: Language-independent named entity recognition. In Proceedings of CoNLL-2002, pages 155 -- 158. Taipei, Taiwan, 2002. [Yang et al., 2017] Zhilin Yang, Ruslan Salakhutdinov, and William W Cohen. Transfer learning for sequence tagging In Proceedings of with hierarchical recurrent networks. the fifth International Conference on Learning Represen- tations, 2017. [Yosef et al., 2012] Mohamed Amir Yosef, Sandro Bauer, Johannes Hoffart, Marc Spaniol, and Gerhard Weikum. Hyena: Hierarchical type classification for entity names. Proceedings of of the 24th International Conference on Computational Linguistics, pages 1361 -- 1370, 2012. [Zhou and Su, 2002] GuoDong Zhou and Jian Su. Named entity recognition using an hmm-based chunk tagger. In Proceedings of the 40th Annual Meeting on Association for Computational Linguistics, pages 473 -- 480. Associa- tion for Computational Linguistics, 2002.
1612.07411
2
1612
2017-09-03T21:41:07
A Context-aware Attention Network for Interactive Question Answering
[ "cs.CL", "cs.LG" ]
Neural network based sequence-to-sequence models in an encoder-decoder framework have been successfully applied to solve Question Answering (QA) problems, predicting answers from statements and questions. However, almost all previous models have failed to consider detailed context information and unknown states under which systems do not have enough information to answer given questions. These scenarios with incomplete or ambiguous information are very common in the setting of Interactive Question Answering (IQA). To address this challenge, we develop a novel model, employing context-dependent word-level attention for more accurate statement representations and question-guided sentence-level attention for better context modeling. We also generate unique IQA datasets to test our model, which will be made publicly available. Employing these attention mechanisms, our model accurately understands when it can output an answer or when it requires generating a supplementary question for additional input depending on different contexts. When available, user's feedback is encoded and directly applied to update sentence-level attention to infer an answer. Extensive experiments on QA and IQA datasets quantitatively demonstrate the effectiveness of our model with significant improvement over state-of-the-art conventional QA models.
cs.CL
cs
A Context-aware A(cid:130)ention Network for Interactive (cid:131)estion Answering∗ Huayu Li1, Martin Renqiang Min2, Yong Ge3, Asim Kadav2 1Department of Computer Science, UNC Charlo(cid:138)e 2Machine Learning Group, NEC Laboratories America 3Management Information Systems, University of Arizona [email protected],{renqiang,asim}@nec-labs.com,[email protected]. 7 1 0 2 p e S 3 ] L C . s c [ 2 v 1 1 4 7 0 . 2 1 6 1 : v i X r a ABSTRACT Neural network based sequence-to-sequence models in an encoder- decoder framework have been successfully applied to solve (cid:139)es- tion Answering (QA) problems, predicting answers from statements and questions. However, almost all previous models have failed to consider detailed context information and unknown states under which systems do not have enough information to answer given questions. (cid:140)ese scenarios with incomplete or ambiguous infor- mation are very common in the se(cid:138)ing of Interactive (cid:139)estion Answering (IQA). To address this challenge, we develop a novel model, employing context-dependent word-level a(cid:138)ention for more accurate statement representations and question-guided sentence- level a(cid:138)ention for be(cid:138)er context modeling. We also generate unique IQA datasets to test our model, which will be made publicly avail- able. Employing these a(cid:138)ention mechanisms, our model accurately understands when it can output an answer or when it requires gen- erating a supplementary question for additional input depending on di(cid:130)erent contexts. When available, user's feedback is encoded and directly applied to update sentence-level a(cid:138)ention to infer an answer. Extensive experiments on QA and IQA datasets quantita- tively demonstrate the e(cid:130)ectiveness of our model with signi(cid:128)cant improvement over state-of-the-art conventional QA models. KEYWORDS (cid:139)estion Answering; Interactive (cid:139)estion Answering; A(cid:138)ention; Recurrent Neural Network 1 INTRODUCTION With the availability of large-scale QA datasets, high-capacity ma- chine learning/data mining models, and powerful computational devices, research on QA has become active and fruitful. Commer- cial QA products such as Google Assistant, Apple Siri, Amazon Alexa, Facebook M, Microso(cid:137) Cortana, Xiaobing in Chinese, Rinna in Japanese, and MedWhat have been released in the past several years. (cid:140)e ultimate goal of QA research is to build intelligent sys- tems capable of naturally communicating with humans, which ∗Most of this work was done when the (cid:128)rst author was an intern at NEC Labs America. 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 pro(cid:128)t or commercial advantage and that copies bear this notice and the full citation on the (cid:128)rst page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permi(cid:138)ed. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior speci(cid:128)c permission and/or a fee. Request permissions from [email protected]. KDD'17, August 13–17, 2017, Halifax, NS, Canada. © 2017 ACM. 978-1-4503-4887-4/17/08...$15.00 DOI: h(cid:138)p://dx.doi.org/10.1145/3097983.3098115 poses a major challenge for natural language processing and ma- chine learning. Inspired by recent success of sequence-to-sequence models with an encoder-decoder framework [5, 21], researchers have a(cid:138)empted to apply variants of such models with explicit mem- ory and a(cid:138)ention to QA tasks, aiming to move a step further from machine learning to machine reasoning [12, 17, 26]. Similarly, all these models employ encoders to map statements and questions to (cid:128)xed-length feature vectors, and a decoder to generate outputs. Empowered by the adoption of memory and a(cid:138)ention, they have achieved remarkable success on several challenging public datasets, including the recently acclaimed Facebook bAbI dataset [24]. However, previous models su(cid:130)er from the following impor- tant limitations [12, 17, 25, 26]. First, they fail to model context- dependent meaning of words. Di(cid:130)erent words may have di(cid:130)erent meanings in di(cid:130)erent contexts, which increases the di(cid:129)culty of extracting the essential semantic logic (cid:131)ow of each sentence in di(cid:130)erent paragraphs. Second, many existing models only work in ideal QA se(cid:138)ings and fail to address the uncertain situations under which models require additional user input to gather com- plete information to answer a given question. As shown in Table 1, the example on the top is an ideal QA problem. We can clearly understand what the question is and then locate the relevant in- put sentences to generate the answer. But it is hard to answer the question in the bo(cid:138)om example, because there are two types of bed- rooms mentioned in all input sentences (i.e., the story) and we do not know which bedroom the user refers to. (cid:140)ese scenarios with incomplete information naturally appear in human conversations, and thus, e(cid:130)ectively handling them is a key capability of intelligent QA models. To address the challenges presented above, we propose a Context- aware A(cid:138)ention Network (CAN) to learn (cid:128)ne-grained represen- tations for input sentences, and develop a mechanism to interact with user to comprehensively understand a given question. Specif- ically, we employ two-level a(cid:138)ention applied at word level and sentence level to compute representations of all input sentences. (cid:140)e context information extracted from an input story is allowed to in(cid:131)uence the a(cid:138)ention over each word, and governs the word semantic meaning contributing to a sentence representation. In addition, an interactive mechanism is created to generate a supple- mentary question for the user when the model feels that it does not have enough information to answer a given question. User's feed- back for the supplementary question is then encoded and exploited to a(cid:138)end over all input sentences to infer an answer. Our proposed model CAN can be viewed as an encoder-decoder approach aug- mented with two-level a(cid:138)ention and an interactive mechanism, rendering our model self-adaptive, as illustrated in Figure 1. (cid:140)e o(cid:129)ce is north of the kitchen. (cid:140)e garden is south of the kitchen. Q: What is north of the kitchen? A: O(cid:129)ce (cid:140)e master bedroom is east of the garden. (cid:140)e guest bedroom is east of the o(cid:129)ce. Q: What is the bedroom east of? A: Unknown Table 1: Two examples of QA problem (there are two input sentences before each question). Top is an ideal QA example, where question is very clear. Bottom is an example with in- complete information, where question is ambiguous and it is di(cid:129)cult to provide an answer only using input sentences. Figure 1: An example of QA problem using CAN. Our contributions in this paper are summarized as follows: • We develop a new encoder-decoder model called CAN for QA with two-level a(cid:138)ention. Owing to the new a(cid:138)ention mecha- nism, our model avoids the necessity of tuning-sensitive multiple- hop a(cid:138)ention that is required by previous QA models such as MemN2N [17] and DMN+ [26], and knows when it can readily output an answer and when it needs additional information from user depending on di(cid:130)erent contexts. • We augment the encoder-decoder framework for QA with an interactive mechanism for handling user's feedback, which im- mediately changes sentence-level a(cid:138)ention to infer a (cid:128)nal answer without additional model training. To the best of our knowledge, our work is the (cid:128)rst to augment the encoder-decoder framework to explicitly model unknown states with incomplete or ambigu- ous information for IQA and the (cid:128)rst to propose the IQA concept to improve QA accuracy. • We generate a new dataset based on the Facebook bAbI dataset, namely ibAbI, covering several representative IQA tasks. We make this dataset publicly available to the community, which could provide a useful resource for others to continue studying IQA problems. • We conduct extensive experiments to show that our approach outperforms state-of-the-art models on both QA and IQA datasets. Speci(cid:128)cally, our approach achieves 40% improvement over con- ventional QA models without an interactive procedure (e.g., MemN2N and DMN+) on IQA datasets. 2 RELATED WORK Recent work on QA has been heavily in(cid:131)uenced by research on various neural network models with a(cid:138)ention and/or memory in an encoder-decoder framework. (cid:140)ese models have been success- fully applied to image classi(cid:128)cation [20], image captioning [15], machine translation [1, 5, 14], document classi(cid:128)cation [28], and textual/visual QA [12, 13, 17, 26, 27]. For textual QA in the form of statements-question-answer triplets, MemN2N [17] maps each in- put sentence to an input representation space regarded as a memory component. (cid:140)e output representation is calculated by summariz- ing over input representations with di(cid:130)erent a(cid:138)ention weights. (cid:140)is single-layer memory is extended to multi-layer memory by reason- ing the statements and the question with multiple hops. Instead of simply stacking the memory layers, Dynamic Memory Network (DMN) updates memory vectors through a modi(cid:128)ed GRU [12], in which the gate weight is trained in a supervised fashion. To improve DMN by training without supervision, DMN+ [26] en- codes input sentences with a bidirectional GRU and then utilizes an a(cid:138)ention-based GRU to summarize these input sentences. Neural Turing Machine (NTM) [8], a model with content and location- based memory addressing mechanisms, has also been used for QA tasks recently. (cid:140)ere is other recent work about QA using external resources [6, 7, 9, 18, 19, 29], and exploring dialog tasks [4, 22, 23]. Both MemN2N and DMN+ do not model context-aware word at- tention, instead, they use multi-hop memory. However, the QA performance produced by MemN2N and DMN+ is very sensitive to the number of hops. In contrast, our proposed model is context-aware and self-adaptive. It avoids multiple-hop a(cid:138)ention and knows when to output an an- swer and when to request additional information from a user. In addition, our IQA model works on conventional textual statement- question-answer triplets and e(cid:130)ectively solves conventional QA problems with incomplete or ambiguous information. (cid:140)ese IQA tasks are di(cid:130)erent from the human-computer dialog task proposed in [4, 22, 23]. 3 GATED RECURRENT UNIT NETWORKS Gated Recurrent Unit (GRU) [5] is the basic building block of our model for IQA. GRU has been widely adopted for many NLP tasks, such as machine translation [1] and language modeling [30]. GRU improves computational e(cid:129)ciency over Long Short-term Memory (LSTM) [10] by removing the cell component and making each hidden state adaptively capture the dependencies over di(cid:130)erent time steps using reset and update gates. For each time step t with input xt and previous hidden state ht−1, we compute the updated hidden state ht = GRU(ht−1 , xt) by, rt = σ(Ur xt + Wr ht−1 + br), zt = σ(Uzxt + Wzht−1 + bz), (cid:101)ht = tanh(Uhxt + Wh(rt (cid:12) ht−1) + bh), ht = zt (cid:12) ht−1 + (1 − zt) (cid:12)(cid:101)ht , where σ is the sigmoid activation function, (cid:12) is an element-wise product, Ur , Uz , Uh ∈ RK×D, Wr , Wz , Wh ∈ RK×K , br , bz , bh ∈ RK×1, K is the hidden size and D is the input dimension size. 4 CONTEXT-AWARE ATTENTION NETWORK In this section, we (cid:128)rst illustrate the framework of our model CAN (Section 4.1), including a question module (Section 4.2), an input module (Section 4.3), and an answer module (Section 4.4). We then describe each of these modules in detail. Finally, we elaborate the training procedure of CAN (Section 4.5). Themasterbedroomiseastofthegarden.Theguestbedroomiseastoftheoffice.Theguestbedroomiswestofthehallway.Thebathroomiseastofthemasterbedroom.InputModuleSentenceAttentionMechnismWordAttentionMechanismQuestionModuleWhatisthebedroomeastof?DecoderAnswerSupplemetaryQuestionWhichbedroom,masteroneorguestone?GardenInteractiveMechanismMasterbedroomEncoderContextRepresentationQuestionRepresentationAnswerModule hidden state gq Figure 2: (cid:135)e illustration of the proposed model, consisting of a question module, an input module and an answer module. 4.1 Framework Problem Statement and Notation. Given a story represented by N input sentences (or statements), i.e., (l1, · · · , lN ), and a question q, our goal is to generate an answer a. Each sentence lt includes a sequence of Nt words, denoted as (wt1, · · · , wt ), and a question Nt with Nq words is represented as (w ). Let V denote the q Nq size of vocabulary, including the words from each lt , q and a, and end-of-sentence (EOS) symbols. In this paper, scalars, vectors and matrices are denoted by lower-case le(cid:138)ers, boldface lower-case le(cid:138)ers and boldface capital le(cid:138)ers, respectively. where the subscript of GRU is used to distinguish from other GRUs used in the following sections. (cid:140)e hidden state gq can be regarded j as the annotation vector of word wj by incorporating the word order information. We also explored a variety of encoding schema, such as LSTM and traditional Recurrent Neural Networks (RNN). However, LSTM is prone to over-(cid:128)(cid:138)ing due to a large number of parameters, and traditional RNN has a poor performance because of exploding and vanishing gradients [3]. j ∈ RKh×1 as follows: = GRUw(gq (cid:140)e whole framework of our model is shown in Figure 2, con- sisting of the following three key parts: j ), j−1, xq q 1 , · · · , w gq j (1) into a vector representation. tion into a vector representation. • (cid:134)estion Module: (cid:140)e question module encodes a target ques- • Input Module: (cid:140)e input module encodes a set of input sentences • Answer Module: (cid:140)e answer module generates an answer based on the outputs of question and input modules. Unlike conven- tional QA models, it has two choices, either to output an answer immediately or to interact with the user for further information. Hence, if the model lacks su(cid:129)cient evidence for answer predic- tion based on existing knowledge, an interactive mechanism is enabled. Speci(cid:128)cally, the model generates a supplementary ques- tion, and the user needs to provide a feedback, which is utilized to estimate an answer. 4.2 (cid:134)estion Module Suppose a question is a sequence of Nq words, we encode each using a learned embedding word wj as a Kw -dimensional vector xq j matrix Ww ∈ RKw×V , i.e., xq = Ww[wj], where [wj] is a one- hot vector associated with word wj. (cid:140)e word sequence within a sentence signi(cid:128)cantly a(cid:130)ects each word's semantic meaning due to its dependence on previous words. (cid:140)us, a GRU is employed by taking each word vector xq as input and updating the corresponding j j In addition, each word contributes di(cid:130)erently to the represen- tation of a question. For example, in a question 'Where is the football?', 'where' and 'football' play a critical role in summarizing this sentence. (cid:140)erefore, an a(cid:138)ention mechanism is introduced to generate a question representation by focusing on important words with informative semantic meanings. A positive weight γj is placed on each word to indicate the relative importance of con- tribution to the question representation. Speci(cid:128)cally, this weight is measured as the similarity of corresponding word annotation and a word-level latent vector v ∈ RKh×1 for questions vector gq j which is jointly learned during the training process. (cid:140)e question representation u ∈ RKc×1 is then generated by a sum of the word annotation vectors weighted by their corresponding importance weights, where we also use a linear projection to transform the aggregated representation vector from a sentence-level space to a context-level space as follows: Nq γj = so f tmax(vT gq j ), (q) + b c γj gq j , u = Wch j=1 (2) (3) where so f tmax is taken to normalize the weights and de(cid:128)ned as so f tmax(xi) = (q) exp(xi) j(cid:48) exp(xj(cid:48)), Wch ∈ RKc×Kh , and b c ∈ RKc×1.  (cid:1875)(cid:883)(cid:1872) (cid:1875)(cid:884)(cid:1872) (cid:1875)(cid:1840)(cid:1872)(cid:1872) (cid:1875)(cid:883)(cid:1869) (cid:1875)(cid:884)(cid:1869) (cid:1875)(cid:1840)(cid:1869)(cid:1869) (cid:1876)(cid:883)(cid:1869) (cid:1876)(cid:884)(cid:1869) (cid:1876)(cid:1840)(cid:1869)(cid:1869) (cid:1876)(cid:883)(cid:1872) (cid:1876)(cid:884)(cid:1872) (cid:1874) (cid:1873)(cid:1865) ........................(cid:2011)(cid:883) (cid:2011)(cid:884) (cid:2011)(cid:1840)(cid:1869) (cid:2009)(cid:1840)(cid:1872)(cid:1872) (cid:2009)(cid:883)(cid:1872) (cid:2009)(cid:884)(cid:1872) (cid:2010)(cid:1872) (cid:2010)(cid:1872)(cid:3398)(cid:883) (cid:2010)(cid:1872)(cid:3397)(cid:883) Question ModuleInput Module(cid:1876)(cid:1840)(cid:1872)(cid:1872) (cid:1877)(cid:1872) (cid:1877)(cid:1872)(cid:3398)(cid:883)(cid:1877)(cid:1872)(cid:3397)(cid:883) ............∑ Period SymbolOutput AnswerOutput QuestionUser's Feedback(cid:1865) (cid:1873) Question Mask(cid:1876)(cid:883)(cid:1858) (cid:1876)(cid:884)(cid:1858) (cid:1876)(cid:1840)(cid:1858)(cid:1858) (cid:1875)(cid:1840)(cid:1858)(cid:1858) (cid:1875)(cid:883)(cid:1858) (cid:1875)(cid:884)(cid:1858) (cid:1858) (cid:1876)(cid:3548)(cid:883) (cid:1876)(cid:3548)(cid:884) (cid:1876)(cid:3548)(cid:1840)(cid:1853) Answer ModuleInteractive MechanismSentenceEncoderContext EncoderGRUGRUGRUGRUGRUGRUGRUGRUGRUGRUGRUGRUGRUGRUGRU<EOS> 4.3 Input Module Input module aims at generating representations for input sen- tences, including a sentence encoder and a context encoder. Sen- tence encoder computes the representation of a single sentence, and context encoder calculates an aggregated representation of a sequence of input sentences. 4.3.1 Sentence Encoder. For each input sentence lt , contain- ing a sequence of Nt words (w1, · · · , wNt ), similar to the question i ∈ RKw×1 module, each word wi is embedded into a word space xt through the shared learned embedding matrix Ww , and a recurrent neural network is used to capture the context information from i ∈ RKh×1 denote the hid- the words in the same sentence. Let ht den state which can be interpreted as the word annotation in the input space. A GRU computes each word annotation by taking the embedding vector as input and relying on previous hidden state, i = GRUw(ht ht i ). i−1, xt (4) In Eq. 4, each word annotation vector takes its word order into consideration to learn its semantic meaning based on previous information within the current sentence through a recurrent neural network. A QA system is usually given multiple input sentences which o(cid:137)en form a story together. A single word has di(cid:130)erent meaning in di(cid:130)erent stories. Learning a single sentence context at which a word is located is insu(cid:129)cient to understand the meaning of this word, especially when the sentence is placed in a story context. In other words, only modeling a sequence of words prior to the current word within the current sentence may lose some important information and result in the generation of inaccurate sentence representation. Hence, we take the whole context into account as well to appropriately characterize each word and well understand the current sentence's meaning. Suppose st−1 ∈ RKc×1 is the annotation vector of previous sentence lt−1, which will be introduced in the next section. To incorporate context information generated by previous sentences, we feed word annotation vector and previous sentence annotation vector st−1 into a two-layer ht i i ∈ RKc×1 is MLP, through which a context-aware word vector et obtained as follows: i = σ(Weetanh(Wes st−1 + Wehht et i + b (2) (1) e ) + b e ), (5) (1) e , b where Wee , Wes ∈ RKc×Kc and Weh ∈ RKc×Kh are weight matri- (2) e ∈ RKc×1 are the bias terms. It is worth noting ces, and b that st−1 is dependent on its previous sentence. Recursively, this sentence relies on its previous one as well. Hence, our model is able to encode the previous context. In addition, the sentence represen- tation should emphasize those words which are able to address the question. Inspired by this intuition, another word level a(cid:138)ention mechanism is introduced to a(cid:138)end informative words about the question for generating a sentence's representation. As the question representation is utilized to guide the word a(cid:138)ention, a positive weight αt associated with each word is computed as the similarity i of the question vector u and the corresponding context-aware word . (cid:140)en the sentence representation yt ∈ RKh×1 is gen- vector et i erated by aggregating the word annotation vectors with di(cid:130)erent weights, and shown as follows, i = so f tmax(uT et i ), αt i ht αt i . yt = Nt i =1 (6) (7) 4.3.2 Context Encoder. Suppose a story is comprised of a se- quence of sentences, i.e., (l1, · · · , lN ), each of which is encoded as a Kh-dimensional vector yt through a sentence encoder. As input sentences have a sequence order, simply using their sentence vectors for context generation cannot e(cid:130)ectively capture the en- tire context of the sequence of sentences. To address this issue, a sentence annotation vector is introduced to capture the previous context and this sentence's own meaning using a GRU. Given the sentence vector yt and the state st−1 of previous sentence, we get annotation vector st ∈ RKc×1 as follows: st = GRUs(st−1, yt). (8) A GRU can learn a sentence's meaning based on previous context information. However, just relying on GRU at sentence level us- ing simple word embedding vectors makes it di(cid:129)cult to learn the precise semantic meaning of each word in the story. Hence, we introduce a context-aware a(cid:138)ention mechanism shown in Eq. 5 to properly encode each word for the generation of sentence repre- sentation, which guarantees that each word is reasoned under an appropriate context. Once the sentence annotation vectors (s1, · · · , sN ) are obtained as described above, a sentence level a(cid:138)ention mechanism is en- abled to emphasize those sentences that are highly relevant to the question. We estimate each a(cid:138)ention weight βt by the similarity be- tween the question representation vector u and the corresponding sentence annotation vector st . Hence, the overall context represen- tation vector m is calculated by summing over all sentence annota- tion vectors weighted by their corresponding a(cid:138)ention weights as follows, βt = so f tmax(uT st), m = βt st . N t =1 (9) (10) Similar to bidirectional RNN, our model can be extended to use another sentence-level GRU that moves backward through time beginning from the end of the sequence, but it does not have sig- ni(cid:128)cant improvements in our experiments. 4.4 Answer Module (cid:140)e answer module utilizes a decoder to generate an answer, and has two output cases depending on both the question and the context. One case is to generate an answer immediately a(cid:137)er receiving the context and question information. (cid:140)e other one is to generate a supplementary question and then uses the user's feedback to predict an answer. (cid:140)e second case requires an interactive mechanism. 4.4.1 Answer Generation. Given the question representation u and the context representation m, another GRU is used as the decoder to generate a sentence as the answer. To use u and m together, we sum these vectors rather than concatenating them to reduce the total number of parameters. Suppose xk−1 ∈ RKw×1 is the predicted word vector in last step, GRU updates the hidden state zk ∈ RKo×1 as follows, Ww= so f tmax(Wod zk + bo), xk zk = GRUd(zk−1,[m + u; xk−1]), (11) (12) where Wod ∈ RV ×Ko , bo ∈ RV ×1, [·; ·] indicates the concatenation operation of two vectors, and Ww= denotes the predicted word vector through the embedding matrix Ww . Note that we require that each sentence ends with a special EOS symbol, including question mask and period symbol, which enables the model to de(cid:128)ne a distribution over sentences of all possible lengths. Output Choices. In practice, the system is not always able to answer a question immediately based on its current knowledge due to the lack of some crucial information bridging the gap be- tween the question and the context knowledge, i.e., incomplete information. (cid:140)erefore, we allow the decoder to make a binary choice, either to generate an answer immediately, or to enable an interactive mechanism. Speci(cid:128)cally, if the model has su(cid:129)ciently strong evidence for a successful answer prediction based on the well-learned context representation and question representation, the decoder will directly output the answer. Otherwise, the system generates a supplementary question for the user, where an example is shown in Table 2. At this time, this user needs to o(cid:130)er a feedback which is then encoded to update the sentence-level a(cid:138)entions for answer generation. (cid:140)is procedure is our interactive mechanism. Problem (cid:140)e master bedroom is east of the garden. (cid:140)e guest bedroom is east of the o(cid:129)ce. Target (cid:139)estion: What is the bedroom east of? System: Which bedroom, master one or guest one? Interactive Mechanism User: Master bedroom (User's Feedback) (Supplementary (cid:137)estion) System: Garden (Predicted Answer) Table 2: An example of interactive mechanism. (cid:140)e sentence generated by the decoder ends with a special sym- bol, either a question mask or a period symbol. Hence, this special symbol is utilized to make a decision. In other words, if EOS sym- bol is a question mask, the generated sentence is regarded as a supplementary question and an interactive mechanism is enabled; otherwise the generated sentence is the estimated answer and the prediction task is done. In the next section, we will present the details of the interactive mechanism. 4.4.2 Interactive Mechanism. (cid:140)e interactive process is sum- marized as follows: 1) (cid:140)e decoder generates a supplementary ques- tion; 2) (cid:140)e user provides a feedback; 3) (cid:140)e feedback is used for answer prediction for the target question. Suppose the feedback contains a sequence of words, denoted as (w ). Similar to the input module, each word w is embedded to a vector xf d through the shared embedding matrix Ww . (cid:140)en the correspond- d ∈ RKh×1 is computed via a GRU by taking ing annotation vector gf the embedding vector as input, and shown as follows: = GRUw(gf 1 , · · · , w (13) f Nf f d f gf d d). d−1, xf Nf d =1 f = 1 Nf gf d . (14) Based on the annotation vectors, a representation f ∈ RKh×1 can be obtained by a simple a(cid:138)ention mechanism where each word is considered to contribute equally, and given by: Our goal is to utilize the feedback representation f to generate an answer for the target question. (cid:140)e provided feedback improves the ability to answer the question by distinguishing the relevance of each input sentence to the question. In other words, the similarity of speci(cid:128)c input sentences in the provided feedback make these sentences more likely to address the question. Hence, we re(cid:128)ne the a(cid:138)ention weight of each sentence shown in Eq. 10 a(cid:137)er receiving the user's feedback, given by, r = tanh(Wr f f + b (f ) ), r βt = so f tmax(uT st + rT st) (15) (16) (f ) where Wr f ∈ RKc×Kh and b ∈ RKc×1 are the weight matrix and r bias vector, respectively. Eq. 15 is a one-layer neural network to transform the feedback representation to the context space. Af- ter obtaining the newly learned a(cid:138)ention weights, we update the context representation using the so(cid:137)-a(cid:138)ention operation shown in Eq. 10. (cid:140)is updated context representation and question rep- resentation will be used as the input for the decoder to generate an answer. Note that for simplifying the problem, we allow the decoder to only generate at most one supplementary question. In addition, one advantage of using the user's feedback to update the a(cid:138)ention weights of input sentences is that we do not need to re-train the encoder once a feedback enters the system. 4.5 Training Procedure During training, all three modules share an embedding matrix. (cid:140)ere are three di(cid:130)erent GRUs employed for sentence encoding, context encoding and answer/supplementary question decoding. In other words, the same GRU for sentence encoding is used to encode the question, input sentences and the user's feedback. (cid:140)e second GRU is applied to generate context representation and the third one is used as the decoder. Training is treated as a supervised sequence prediction problem by minimizing the cross-entropy between the answer sequence/the supplementary question sequence and the predictions. 5 EXPERIMENTS In this section, we evaluate our approach with multiple datasets and make comparisons with state-of-the-art QA models. 5.1 Experimental Setup Datasets. In this paper, we use two types of datasets to evaluate the performance of our approach. One is a traditional QA dataset, where we use Facebook bAbI English 10k dataset [24] which is widely adopted in recent QA research [12, 17, 25, 26]. It contains 20 di(cid:130)erent types of tasks with emphasis on di(cid:130)erent forms of reason- ing and induction. (cid:140)e second is our designed IQA dataset 1, where 1h(cid:138)p://www.cs.toronto.edu/pub/cuty/IQAKDD2017 IQA task 1: John journeyed to the garden. (cid:140)e master bedroom is east of the garden. Daniel moved to the kitchen. (cid:140)e guest bedroom is east of the o(cid:129)ce. IQA task 4: Q: Where is he? SQ: Who is he? FB: Daniel A: Kitchen (cid:140)e guest bedroom is west of the hallway. (cid:140)e bathroom is east of the master bedroom. Q: What is the bedroom east of? SQ: Which bedroom, master one or guest one? FB: Master bedroom A: Garden IQA task 7: John grabbed the bread. John grabbed the milk. John grabbed the apple. Sandra went to the bedroom. Q: How many special objects is John holding? SQ: What objects are you referring to? FB: Milk, bread A: Two Table 3: Examples of three di(cid:130)erent tasks on the generated ibAbI datasets. "Q" indicates the target question. "SQ" is the supplementary question. "FB" refers to user's feedback. "A" is the answer. we extend bAbI by adding interactive QA and denote it as ibAbI. (cid:140)e reason for developing the ibAbI dataset is the absence of such IQA datasets with incomplete or ambiguous information in the QA research (cid:128)eld. (cid:140)e se(cid:138)ings of the ibAbI dataset follow the standard ones of bAbI datasets. Overall, we generate three ibAbI datasets based on task 1 (single supporting fact), task 4 (two argument re- lations), and task 7 (counting). (cid:140)e generated three ibAbI tasks simulate three di(cid:130)erent representative scenarios of incomplete or ambiguous information. Speci(cid:128)cally, ibAbI task 1 focuses on am- biguous actor problem. ibAbI task 4 represents ambiguous object problem. ibAbI task 7 is to ask further information that assists answer prediction. Most of other IQA problems can be classi(cid:128)ed as one of these three tasks 2. Table 3 shows three examples for our generated three ibAbI tasks, where the examples of supplementary question templates in di(cid:130)erent tasks are also provided. To simulate real-world application scenarios, we mix IQA data and corresponding QA data together with di(cid:130)erent IQA ratios, where the IQA ratio is ranging from 0.3 to 1 (with step as 0.1) and denoted as RIQA. For example, in task 1, we randomly pick RIQA × 100 percent data from ibAbI task 1, and then randomly select the remaining data from bAbI task 1. RIQA = 1 indicates that the whole dataset only consists of IQA problems; otherwise (i.e., ranging from 0.3 to 0.9) it consists of both types of QA problems. Overall, we have three tasks for the ibAbI dataset, and eight sub- datasets with di(cid:130)erent mixing ratios RIQA for each task. (cid:140)erefore, we have 24 experiments in total for IQA. In addition, 10k examples are used as training and another 1k examples are used as testing. Experiment Settings. We train our models using the Adam optimizer [11]. Xavier initialization is used for all parameters except for word embeddings, which utilize random uniform initialization ranging from −√3 to √3. (cid:140)e learning rate is set as 0.001. (cid:140)e grid search method is utilized to (cid:128)nd optimal parameters, such as batch size and hidden dimension size and etc. 5.2 Baseline Methods To demonstrate the e(cid:130)ectiveness of our approach CAN, we compare it with the following four state-of-the-art models: • DMN+: It improves Dynamic Memory Networks [12] by using • MemN2N: (cid:140)is is an extension of Memory Network with weak stronger input and memory modules [26]. supervision as proposed in [17]. 2We do not need to modify each of the 20 bAbI task to make it interactive, because other extensions are either unnatural or redundant. • EncDec: We extend the encoder-decoder framework [5] to solve QA tasks as a baseline method. EncDec uses the concatenation of statements and questions as input sentence to a GRU encoder, where the last hidden state is used as context representation, and employs another GRU as decoder. • EncDec+IQA: We extend EncDec to use our proposed interac- tive mechanism shown in Section 4.4 to evaluate the performance of our IQA concept in solving IQA problems. (cid:140)e di(cid:130)erence is that a(cid:137)er generating supplementary question, the provided feed- back by user is appended to the input sequence which is then encoded by the encoder again. (cid:140)e second output generated by the decoder is regarded as the prediction answer. DMN+, MemN2N and EncDec are conventional QA models, while EncDec+IQA is purposely designed within our proposed IQA frame- work which can be viewed as an IQA base model. CAN+QA DMN+ MemN2N EncDec Task 1 - Single Supporting Fact 2 - Two Supporting Facts 3 - (cid:140)ree Supporting Facts 4 - Two Arg. Relations 5 - (cid:140)ree Arg. Relations 6 - Yes/No (cid:139)estions 7 - Counting 8 - Lists/Sets 9 - Simple Negation 10 - Inde(cid:128)nite Knowledge 11 - Basic Coreference 12 - Conjunction 13 - Compound Coref. 14 - Time Reasoning 15 - Basic Deduction 16 - Basic Induction 17 - Positional Reasoning 18 - Size Reasoning 19 - Path Finding 20 - Agent(cid:128)s Motivations No. of failed tasks Table 4: Performance comparison of various models in terms of test error rate (%) and the number of failed tasks on a conventional QA dataset. 0.0 0.1 0.2 0.0 0.4 0.0 0.3 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 43.0 0.2 0.5 0.0 0.0 1 52.0 66.1 71.9 29.2 14.3 31.0 21.8 27.6 36.4 36.4 31.7 35.0 6.80 67.2 62.2 54.0 43.1 6.60 89.6 2.30 20 0.0 0.3 2.1 0.0 0.8 0.1 2.0 0.9 0.3 0.0 0.1 0.0 0.0 0.1 0.0 51.8 18.6 5.3 2.3 0.0 6 0.0 0.3 1.1 0.0 0.5 0.0 2.4 0.0 0.0 0.0 0.0 0.0 0.0 0.2 0.0 45.3 4.2 2.1 0.0 0.0 5 5.3 Performance of (cid:134)estion Answering In this section, we evaluate di(cid:130)erent models' performance for an- swer prediction based on the traditional QA dataset (i.e., bAbI-10k). For this task, our model (denoted as CAN+QA) does not use the Support Weight Story Line 1: Mary journeyed to the o(cid:129)ce. · · · · · · Line 48: Sandra grabbed the apple there. Line 49: Sandra dropped the apple. Line 50: · · · What is Sandra carrying? Answer: nothing Prediction: nothing What is Sandra carrying? Answer: nothing Prediction: nothing Story Line 1: John went back to the kitchen. · · · Line 13 : Sandra grabbed the apple there. · · · Line 29: Sandra le(cid:137) the apple. Line 30: · · · Support Weight 0.13 0.85 yes yes 0.14 0.79 yes yes 0.00 (cid:140)e red square is below the triangle. (cid:140)e pink rectangle is to the le(cid:137) of the red square. Q: Is the triangle above the pink rectangle? A: yes (cid:140)e box is bigger than the suitcase. (cid:140)e suitcase (cid:128)ts inside the container. (cid:140)e box of chocolates (cid:128)ts inside the container. (cid:140)e container (cid:128)ts inside the chest. (cid:140)e chocolate (cid:128)ts inside the suitcase. Q: Is the chest bigger than the suitcase? A: yes Table 5: Examples of our model's results on QA tasks. Supporting facts are shown, but our model does not use them during training. "Weight" indicates attention weight of a sentence. Our model can locate correct supporting sentences in long stories. • EncDec performs the worst amongst all models over all tasks. EncDec concatenates the statements and questions as a single input, resulting in the di(cid:129)culty of training the GRU. For example, EncDec performs terribly on task 2 and 3 because these two tasks have longer inputs than other tasks. • (cid:140)e results of DMN+ and MemN2N are much be(cid:138)er than EncDec. It is not surprising that they outperform EncDec, because they are speci(cid:128)cally designed for QA and do not su(cid:130)er from the problem mentioned above by treating input sentences separately. • All models perform poorly on task 16. Xiong et al. [26] points out that MemN2N with a simple update for memory could achieve a near perfect error rate of 0.4 while a more complex method will lead to a much worse result. (cid:140)is shows that a sophisticated mod- eling method makes it di(cid:129)cult to achieve a good performance in certain simple tasks with such limited data. (cid:140)is could be a possible reason explaining the poor performance of our model on this speci(cid:128)c task as well. Table 6: Examples of bAbI task 17 (top) and 18 (bottom), where our model predicts correct answers while MemN2N makes wrong predictions. CAN+IQA EncDec+IQA DMN+ MemN2N EncDec In addition, di(cid:130)erent from MemN2N, we use a GRU to capture the semantic logic (cid:131)ow of input sentences, where the sentence-level a(cid:138)ention on relevant sentences could be weakened by the in(cid:131)uence of unrelated sentences in a long story. Table 5 shows two examples of our results with long stories. From the a(cid:138)ention weights, we can see that our approach can correctly identify relevant sentences in long stories owing to our powerful context modeling. 5.4 Performance of Interactive (cid:134)estion Answering In this section, we evaluate the performance of various models based on IQA datasets (as described in Section 5.1). For testing, we simulate the interactive procedure by randomly providing a feed- back according to the generated supplementary question as user's input, and then predicting an answer. For example, when asking "who is he?", we randomly select a male's name mentioned in the story as feedback. Conventional QA baseline methods, i.e., DMN+, MemN2N, and EncDec, do not have interactive part, so they cannot use feedback for answer prediction. Our approach (CAN+IQA) and EncDec+IQA adopt the proposed interactive mechanism to predict answer. We compare our approach with baseline methods in terms of accuracy shown in Figure 3. Using 2% error rate as cut o(cid:130), the number of failed datasets for each task is also reported in Table 7. From the results, we can achieve the following conclusions: • Our method outperforms all baseline methods and has signi(cid:128)cant improvements over conventional QA models. Speci(cid:128)cally, we can nearly achieve 0% test error rate with RIQA = 1.0 ; while the best result of conventional QA methods can only get 40.5% test error Task Task 1 Task 4 Task 7 0 0 2 6 8 7 8 8 8 8 8 8 8 8 8 Table 7: Performance comparison of various models from the number of failed datasets for each task in the IQA setting. Each task has eight datasets with di(cid:130)erent RIQA. interactive mechanism. As the output answers for this dataset only contain a single word, we adopt test error rate as evaluation metric. For DMN+ and MemN2N methods, we select the best performance over bAbI dataset reported in [26]. (cid:140)e results of various models are reported in Table 4. We summarize the following observations: • Our approach is be(cid:138)er than all baseline methods on each individ- ual task. For example, it reduces the error rate by 4% compared to DMN+ in task 17, and compared to MemN2N, it reduces the error rate by, 18.4% and 4.8%, respectively, on task 17 and 18. If using 1% error rate as cuto(cid:130), our model only fails on 1 task while DMN+ fails on 5 tasks and MemN2N fails on 6 tasks. Our model can achieve be(cid:138)er performance mainly because our context-aware approach can model the semantic logic (cid:131)ow of statements. Ta- ble 6 shows two examples in task 17 and 18, where MemN2N predicts incorrectly while CAN+QA can make correct predic- tions. In these two examples, the semantic logic determines the relationship between two objects mentioned in the question, such as chest and suitcase. In addition, [12] has shown that mem- ory networks with multiple hops are be(cid:138)er than the one with a single hop. However, our strong results demonstrate that our approach even without multiple hops has more accurate context modeling than previous models. (a) IQA Task 1 (b) IQA Task 4 (c) IQA Task 7 Figure 3: Performance comparison of various models in terms of accuracy on IQA datasets with di(cid:130)erent IQA ratios. Input Sentences Mary journeyed to the kitchen. Sandra journeyed to the kitchen. Mary journeyed to the bedroom. Sandra moved to the bathroom. Sandra travelled to the o(cid:129)ce. Mary journeyed to the garden. Daniel travelled to the bathroom. Mary journeyed to the kitchen. John journeyed to the o(cid:129)ce. Mary moved to the bathroom. Support QA Data yes 0.00 0.00 0.00 0.00 0.99 0.00 0.00 0.00 0.00 0.00 Q: Where is Sandra? A: O(cid:129)ce IQA Data A(cid:137)er IM 0.00 0.00 0.00 0.00 0.99 0.00 0.00 0.00 0.00 0.00 Before IM 0.99 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Q: Where is she? SQ: Who is she? FB: Sandra A: O(cid:129)ce Table 8: Examples of sentence attention weights obtained by our model in both QA and IQA data. "Before IM" indicates the sentence attention weights over input sentences before the user provides a feedback. "A(cid:133)er IM" indicates the sentence attention weights updated by user's feedback. (cid:135)e attention weights with value as 0.00 are very small. (cid:135)e results show that our approach can attend the key relevant sentences for both QA and IQA problems. rate. CAN+IQA bene(cid:128)ts from more accurate context modeling, which allows it to correctly understand when to output an answer or require additional information. For those QA problems with incomplete information, it is necessary to gather the additional information from users. Randomly guessing may harm model's performance, which makes conventional QA models di(cid:129)cult to converge. But our approach uses an interactive procedure to obtain user's feedback for assisting answer estimation. • EncDec+IQA can achieve a relatively be(cid:138)er result than conven- tional QA models in the datasets with high IQA ratios, especially in task 7. It happens due to our proposed interactive mechanism, where feedback helps to locate correct answers. However, it does not separate sentences, so the long inputs make its performance dramatically decreases as RIQA decreases. (cid:140)is explains its poor performance in most datasets with low IQA ratios, where there exists a large number of regular QA problems. • For the conventional QA methods, DMN+ and MemN2N perform similarly and do be(cid:138)er than EncDec. (cid:140)eir similar performance is due to the limitation that they could not learn the accurate meaning of statements and questions with limited resource and then have trouble in training the models. But they are superior over EncDec as they treat each input sentence separately instead of modeling very long inputs. In addition, we also quantitatively evaluate the quality of sup- plementary question generated by our approach where the details can be found in Appendix A. 5.5 (cid:134)alitative Analysis of Interactive Mechanism In this section, we qualitatively show the a(cid:138)ention weights over input sentences generated by our model on both QA and IQA data. We train our model (CAN+IQA) on task 1 of ibAbI dataset with QIQA = 0.9, and randomly select one IQA example from the testing data. (cid:140)en we do the prediction on this IQA problem. In addition, we change this instance to a QA problem by replacing the question "Where is she?" with "Where is Sandra?", and then do the prediction as well. (cid:140)e prediction results on both QA and IQA problems are shown in Table 8. From the results, we observe the following: 1) (cid:140)e a(cid:138)ention that uses user's feedback focuses on the key relevant sentence while the a(cid:138)ention without feedback only focuses on an unrelated sentence. (cid:140)is happens because utilizing user's feedback allows the model to understand a question be(cid:138)er and locate the relevant input sentences. (cid:140)is illustrates the e(cid:130)ectiveness of an interactive mechanism on addressing questions that require ad- ditional information. 2) (cid:140)e a(cid:138)ention on both two problems can 0.30.40.50.60.70.80.91IQA Ratio0.40.50.60.70.80.91AccuracyCAN+IQAEncDec+IQADMN+MemN2NEncDec0.30.40.50.60.70.80.91IQA Ratio0.40.50.60.70.80.91AccuracyCAN+IQAEncDec+IQADMN+MemN2NEncDec0.30.40.50.60.70.80.91IQA Ratio0.50.60.70.80.91AccuracyCAN+IQAEncDec+IQADMN+MemN2NEncDec (cid:128)nally focus on the relevant sentences, showing the usefulness of our model for solving di(cid:130)erent types of QA problems. 6 CONCLUSION In this paper, we presented a self-adaptive context-aware ques- tion answering model, CAN, which learns more accurate context- dependent representations of words, sentences, and stories. More importantly, our model is aware of what it knows and what it does not know within the context of a story, and takes an interactive mechanism to answer a question. Our developed CAN model and generated new IQA datasets will open a new avenue to explore for researchers in the QA community. In the future, we plan to employ more powerful a(cid:138)ention mechanisms with explicit unknown state modeling and multi-round feedback-guided (cid:128)ne-tuning to make the model fully self-aware, self-adaptive, and self-taught. We also plan to extend our framework to harder co-reference problems such as the Winograd Schema Challenge and interactive visual QA tasks with uncertainty modeling. ACKNOWLEDGMENTS (cid:140)is work is partially supported by the NIH (1R21AA023975-01) and NSFC (61602234, 61572032, 91646204, 61502077). REFERENCES [1] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. 2015. Neural machine [7] David Golub and Xiaodong He. 2016. Character-Level (cid:139)estion Answering with [6] Anthony Fader, Luke Ze(cid:138)lemoyer, and Oren Etzioni. 2014. Open question [4] Antoine Bordes and Jason Weston. 2016. Learning End-to-End Goal-Oriented [8] Alex Graves, Greg Wayne, and Ivo Danihelka. 2014. Neural Turing Machines. translation by jointly learning to align and translate. In ICLR. [2] Satanjeev Banerjee and Alon Lavie. 2005. METEOR: An Automatic Metric for MT Evaluation with Improved Correlation with Human Judgments. In ACL workshop. [3] Y. Bengio, P. Simard, and P. Frasconi. 1994. Learning Long-term Dependencies with Gradient Descent is Di(cid:129)cult. Trans. Neur. Netw. 5, 2 (1994), 157–166. Dialog. CoRR abs/1605.07683 (2016). [5] Kyunghyun Cho, Bart van Merrienboer, C¸aglar Gulc¸ehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. 2014. Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation. In EMNLP. 1724–1734. answering over curated and extracted knowledge bases. In KDD. 1156–1165. A(cid:138)ention. CoRR abs/1604.00727 (2016). CoRR abs/1410.5401 (2014). [9] Karl Moritz Hermann, Tom´as Kocisk´y, Edward Grefenste(cid:138)e, Lasse Espeholt, Will Kay, Mustafa Suleyman, and Phil Blunsom. 2015. Teaching Machines to Read and Comprehend. In NIPS. 1693–1701. Neural Computation 9, 8 (1997), 1735–1780. Optimization. CoRR abs/1412.6980 (2014). [12] Ankit Kumar, Ozan Irsoy, Peter Ondruska, Mohit Iyyer, James Bradbury, Ishaan Gulrajani, Victor Zhong, Romain Paulus, and Richard Socher. 2016. Ask Me Anything: Dynamic Memory Networks for Natural Language Processing. In ICML. 1378–1387. Jiasen Lu, Jianwei Yang, Dhruv Batra, and Devi Parikh. 2016. Hierarchi- cal (cid:139)estion-Image Co-A(cid:138)ention for Visual (cid:139)estion Answering. CoRR abs/1606.00061 (2016). [14] Minh-(cid:140)ang Luong, Hieu Pham, and Christopher D. Manning. 2015. E(cid:130)ective Ap- proaches to A(cid:138)ention-based Neural Machine Translation. CoRR abs/1508.04025 (2015). [15] Volodymyr Mnih, Nicolas Heess, Alex Graves, and Koray Kavukcuoglu. 2014. [10] Sepp Hochreiter and Jurgen Schmidhuber. 1997. Long Short-Term Memory. [11] Diederik P. Kingma and Jimmy Ba. 2014. Adam: A Method for Stochastic Recurrent Models of Visual A(cid:138)ention. In NIPS. 2204–2212. [16] Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002. BLEU: A Method for Automatic Evaluation of Machine Translation. In Association for Computational Linguistics. 311–318. [17] Sukhbaatar Sainbayar, Szlam Arthur, Weston Jason, and Fergus Rob. 2015. End- To-End Memory Networks. In NIPS. 2440–2448. [18] Denis Savenkov and Eugene Agichtein. 2016. When a Knowledge Base Is Not Enough: (cid:139)estion Answering over Knowledge Bases with External Text Data. In SIGIR. 235–244. [13] [21] [25] [20] Paul Hongsuck Seo, Zhe Lin, Sco(cid:138) Cohen, Xiaohui Shen, and Bohyung Han. [22] Oriol Vinyals and (cid:139)oc V. Le. 2015. A Neural Conversational Model. CoRR [23] [24] [19] Denis Savenkov and Eugene Agichtein Emory. 2016. When a Knowledge Base Is Not Enough: (cid:139)estion Answering over Knowledge Bases with External Text Data. In SIGIR. 235–244. 2016. Hierarchical A(cid:138)ention Networks. CoRR abs/1606.02393 (2016). Ilya Sutskever, Oriol Vinyals, and (cid:139)oc V Le. 2014. Sequence to Sequence Learning with Neural Networks. In NIPS. 3104–3112. abs/1506.05869 (2015). Jason Weston. 2016. Dialog-based Language Learning. NIPS (2016). Jason Weston, Antoine Bordes, Sumit Chopra, and Tomas Mikolov. 2015. Towards AI-Complete (cid:139)estion Answering: A Set of Prerequisite Toy Tasks. CoRR abs/1502.05698 (2015). Jason Weston, Sumit Chopra, and Antoine Bordes. 2014. Memory Networks. CoRR abs/1410.3916 (2014). Networks for Visual and Textual (cid:139)estion Answering. In ICML. 2397–2406. [27] Zichao Yang, Xiaodong He, Jianfeng Gao, Li Deng, and Alexander J. Smola. 2015. Stacked A(cid:138)ention Networks for Image (cid:139)estion Answering. CoRR abs/1511.02274 (2015). [28] Zichao Yang, Diyi Yang, Chris Dyer, Xiaodong He, Alexander J. Smola, and Eduard H. Hovy. 2016. Hierarchical A(cid:138)ention Networks for Document Classi(cid:128)- cation. In HLT. 1480–1489. [29] Pengcheng Yin, Nan Duan, Ben Kao, Junwei Bao, and Ming Zhou. 2015. Answer- ing (cid:139)estions with Complex Semantic Constraints on Open Knowledge Bases. In CIKM. 1301–1310. Network Regularization. CoRR abs/1409.2329 (2014). [26] Caiming Xiong, Stephen Merity, and Richard Socher. 2016. Dynamic Memory [30] Wojciech Zaremba, Ilya Sutskever, and Oriol Vinyals. 2014. Recurrent Neural Ns Ns Na Na A SUPPLEMENTARY QUESTION ANALYSIS We quantitatively evaluate the quality of supplementary ques- tion generated by IQA models on IQA dataset, i.e., CAN+IQA and EncDec+IQA. To test model's performance, we de(cid:128)ne some following metrics. Suppose the number of problems is N , and the number of problems having supplementary question is Ns. (cid:140)en Na = N − Ns is the number of remaining problems. Let is the fraction of IQA problems which can be SQueAcc = correctly estimated, and AnsAcc = is the fraction of remain- ing problems which can be correctly estimated as QA problem. (cid:140)us, SQueAnsAcc = is the overall accuracy. In addition, the widely used BLEU [16] and METEROR [2] are also adopted to evaluate the quality of generated supplementary question. (cid:140)e results of CAN+IQA and EncDec+IQA are presented in Table 9. From the results, we can observe that 1) Two models can almost correctly determine whether it is time to output a question or not; 2) Two models are able to generate the correct supplementary ques- tions whose contents exactly match with the ground truth. (cid:140)ere is no surprise that EncDec+IQA also performs well in generating ques- tion, because it is speci(cid:128)cally designed for handling IQA problems. However, its ability to predict answer is not as good as CAN+IQA (See in Section 5.4) because it models very long inputs instead of carefully separating input sentences. Ns + Na N S(cid:139)eAcc AnsAcc S(cid:139)eAnsAcc BLEU-1 BLEU-4 METEOR CAN+IQA 100% 100% 100% 100% 100% 100% EncDec+IQA 100% 100% 100% 100% 100% 100% Table 9: Performance comparison of the generated supple- mentary question quality with RIQA as 0.8 in task 1. Both two methods achieve 100% under all metrics in all tasks with other di(cid:130)erent RIQA values.
1910.03747
2
1910
2019-10-10T00:33:34
The Daunting Task of Real-World Textual Style Transfer Auto-Evaluation
[ "cs.CL" ]
The difficulty of textual style transfer lies in the lack of parallel corpora. Numerous advances have been proposed for the unsupervised generation. However, significant problems remain with the auto-evaluation of style transfer tasks. Based on the summary of Pang and Gimpel (2018) and Mir et al. (2019), style transfer evaluations rely on three criteria: style accuracy of transferred sentences, content similarity between original and transferred sentences, and fluency of transferred sentences. We elucidate the problematic current state of style transfer research. Given that current tasks do not represent real use cases of style transfer, current auto-evaluation approach is flawed. This discussion aims to bring researchers to think about the future of style transfer and style transfer evaluation research.
cs.CL
cs
The Daunting Task of Real-World Textual Style Transfer Auto-Evaluation Richard Yuanzhe Pang § New York University, New York, NY 10011, USA [email protected] 9 1 0 2 t c O 0 1 ] L C . s c [ 2 v 7 4 7 3 0 . 0 1 9 1 : v i X r a Abstract The difficulty of textual style transfer lies in the lack of parallel corpora. Numerous ad- vances have been proposed for the unsuper- vised generation. However, significant prob- lems remain with the auto-evaluation of style transfer tasks. Based on the summary of Pang and Gimpel (2018) and Mir et al. (2019), style transfer evaluations rely on three crite- ria: style accuracy of transferred sentences, content similarity between original and trans- ferred sentences, and fluency of transferred sentences. We elucidate the problematic cur- rent state of style transfer research. Given that current tasks do not represent real use cases of style transfer, current auto-evaluation ap- proach is flawed. This discussion aims to bring researchers to think about the future of style transfer and style transfer evaluation research. 1 Introduction There are numerous recent works on textual style transfer, the task of changing the style of an input sentence while preserving the content (Hu et al., 2017; Shen et al., 2017; Fu et al., 2018). One factor that makes textual transfer difficult is the lack of parallel corpora. There are abundant ad- vances on developing methods that do not re- quire parallel corpora (Li et al., 2018; Zhang et al., 2018; Logeswaran et al., 2018; Yang et al., 2018), but significant issues remain with automatic eval- uation metrics. Researchers started by using post-transfer style classification accuracy as the only automatic metric (Hu et al., 2017; Shen et al., 2017). Researchers have then realized the impor- tance of targeting content preservation and fluency in style transfer models, and they have developed starting from Fu et al. corresponding metrics, (2018) and Shetty et al. (2017). Pang and Gimpel (2018) and Mir et al. (2019) have summarized the § Work done at the University of Chicago. three evaluation aspects (style accuracy of trans- ferred sentences, content preservation between original and transferred sentences, fluency of transferred sentences) and developed metrics that are well-correlated with human judgments. How- ever, given that current tasks do not represent real use cases of style transfer (Section 2), we discuss the potential problems of existing metrics when facing real-world style transfer tasks (Section 3). Moreover, Fu et al. (2018) and Pang and Gimpel (2018) have shown that if we obtain different mod- els at different intermediate points in the same training instance, we will get different tradeoffs of style accuracy, content preservation, and fluency. Therefore, more discussions on tradeoff and met- ric aggregation are needed (Section 4), for better model comparison and selection. 1.1 Background: Evaluation based on Human-Written "Gold Standards" is inadequate: First, we show that one intuitive way of eval- uating style transfer comput- ing BLEU scores (Papineni et al., 2002) between generated/transferred outputs and human-written gold-standard outputs. In fact, Li et al. (2018) crowdsourced 1000 Yelp human-written refer- ences as test data (500 positive-sentiment sen- tences transferred from negative sentiment, and 500 negative-sentiment sentences transferred from From Table 1, we see positive sentiment). the striking phenomenon that untransferred sen- tences, compared to transferred sentences gener- ated by the best-performing models, have the high- est BLEU score1 by a large margin. This phenomenon either suggests that prior work for this task has not surpassed the baseline of copying the input sentence, or suggests that BLEU is not a good style transfer metric by itself (as it 1We use the multi-bleu.perl script to compute BLEU. Model BLEU Accuracy Shen et al. (2017) CAE† CAE Fu et al. (2018) Multi-decoder Multi-decoder Style embedding Li et al. (2018) Template Delete/Retrieve Yang et al. (2018) LM LM + classifier Pang and Gimpel (2018) CAE+losses (model 6) CAE+losses (model 6) Untransferred 4.9 6.8 7.6 11.2 15.4 18.0 12.6 13.4 22.3 22.5 16.3 31.4 0.818 0.765 0.792 0.525 0.095 0.867 0.909 0.854 0.900 0.843 0.897 0.024 Table 1: Results on Yelp "style" (sentiment) trans- fer. BLEU is between 1000 transferred sentences and human references, and accuracy is restricted to the same 1000 sentences. Accuracy: post-transfer style classification accuracy (by a classifier pretrained on the two corpora). CAE†: cross-aligned autoen- coder as in Shen et al. (2017). BLEU scores reported for Li et al. (2018) are copied from evaluations by Yang et al. (2018). Note that if a model name appears twice, the models are from different stopping points during training. varies by transfer accuracy, as shown in the ta- ble). However, it may be a good metric on content preservation, one particular aspect of style transfer evaluation. In fact, Li et al. (2018) used BLEU to measure content preservation. Obtaining human references is costly, and us- ing human references may only solve one aspect of evaluation (i.e., content preservation). We thus complement this aspect and reduce cost by focus- ing our discussion on automatic evaluation metrics that do not require a large number of references. 1.2 Background: Existing Auto-Evaluation Metrics Researchers have agreed on the following three as- pects to evaluate style transfer (Mir et al., 2019; Pang and Gimpel, 2018). Style accuracy. Style accuracy is the percent- age of sentences transferred onto the correct/target style. Automatic evaluation of post-transfer style classification accuracy is computed by using a classifier pretrained on the original corpora. Ini- tially, this was the only auto-evaluation approach used in the style transfer works (Hu et al., 2017; Shen et al., 2017). Content similarity. Researchers have realized that when the accuracy is large, the content of the transferred sentence does not necessarily cor- respond to the content of the original sentence. In particular, Pang and Gimpel (2018) computed sentence-level content similarity by first averag- ing GloVe word embeddings (Pennington et al., 2014) weighted by idf scores and by comput- ing cosine similarity between the embedding of original sentence and the embedding of the trans- ferred sentence. Next, they averaged the cosine similarities over all original-transferred sentence pairs. The metric has high correlation with human judgments. Mir et al. (2019) first removed style words from the original sentence and the trans- ferred sentence using a style lexicon, and then replaced those words with a hcustomstylei placeholder. Next, Mir et al. (2019) used ME- TEOR (Denkowski and Lavie, 2014) and Earth Mover's Distance (Pele and Werman, 2009) to compute the content similarity. Other works have used similar approaches (Xu et al., 2018; Li et al., 2018; Prabhumoye et al., 2018), mostly involv- ing BLEU and METEOR (Papineni et al., 2002; Denkowski and Lavie, 2014). Fluency. Researchers realized that style accu- racy and content similarity do not guarantee a nat- ural or fluent sentence. Pang and Gimpel (2018) trained a language model on the concatenation of the original two corpora (of two styles), and used perplexity of resulting transferred sentence to measure fluency. Mir et al. (2019) named the metric "naturalness," and they followed the simi- lar logic with one critical difference. They trained a language model on target style to measure per- plexity of transferred sentences. Santos et al. (2018) and Yang et al. (2018) also used perplexity as a measure for naturalness or fluency. 2 Problem 1: Style Transfer Tasks Before diving into problems of unsupervised auto- evaluation metrics, we first discuss the style trans- fer tasks in relevant research. The big idea is that we need to move forward from the current opera- tional definition of style, to the real-world and use- ful definition of style, to be explained below. This transition will create problems for existing style transfer metrics. What are the practical use cases of style trans- fer? Here are some possibilities. to have programs that (i) Writing assistance and dialogue (Heidorn, 2000; Ritter et al., 2011). For example, it is helpful transfer a formal sentence to an informal sentence (Rao and Tetreault, 2018). It is helpful to have programs that make emails more polite (Sennrich et al., 2016). (ii) Author and obfuscation anonymity 2017; Reddy and Knight, (Shetty et al., 2016) so that authors can stay relatively anonymous in, for example, heated political discussions. (iii) For artistic purposes: As an example, we may transfer a modern article to old litera- ture styles. (iv) Adjusting reading difficulty in education (Campbell, 1987): Programs may be helpful in generating passages of the same content, but of different difficulty levels appropriate to different age groups. (Maas et al., 2011), (v) Data augmentation to fix dataset bias In sentiment clas- (Anonymous, 2020): sification using the IMDb movie review for example, dataset the appearance of the word "romantic" is highly correlated with positive sentiment, and the appearance of the word "horror" is highly correlated with negative senti- ment. Anonymous (2020) thus asked work- ers to write sentences (where words like "ro- mantic" and "horror" stay unchanged) with flipped sentiment to reduce spurious corre- lations. This counterfactual data augmen- tation approach may also be used to ad- dress social bias issues in NLP such as gender, race, and nationality (Zhao et al., 2017; Kiritchenko and Mohammad, 2018; Costa-juss`a et al., 2019). Style transfer is a good way to replace most of all of the ex- pensive crowdsourcing procedure. This di- rection is in line with current NLP commu- nity's interest in bias and fairness. What do the collected datasets (from the above use cases) look like? The two datasets may have very different vocabularies, and it is hard to train a classifier to differentiate style-related words from content-related words. As elaborated in Section 3, certain words need to stay constant despite the fact that the two corpora have drastically differ- ent vocabularies. A quick example is that in case (v) above, words like "romantic" need to stay un- changed, even if "romantic" may not appear in the negative-style vocabulary often. Here is another example. In the task of transferring Dickens' style literature to mod- ern style literature but keeping the content (Pang and Gimpel, 2018) or in similar literature- related tasks (Kabbara and Cheung, 2016; Xu, 2017), the former may contain words like "En- glish farm", "horses", etc; the latter may con- tain words like "vampire", "pop music." How- ever, these words should stay the same, as they are content-related but not style-related. On the other hand, Dickens' literature may contain words like "devil-may-care" and "flummox" numerous times, but these words are style related and should be changed. Compared to the Yelp sentiment datasets, it is very difficult to automatically dif- ferentiate content-related words from style-related words in the Literature dataset. Similar situations may occur frequently in author obfuscation and other practical applications. Current research focuses on the operational definition of style. Those tasks as well as the Yelp sentiment transfer does NOT represent style transfer. Therefore, according to the previ- ous paragraph, Yelp sentiment transfer is very ide- alized, as we can use a simple classifier to classify which words are content-related and which words are style-related. Therefore, changing a word can often change the style (sentiment in this case) suc- cessfully. However, to make style transfer use- ful, we need to go beyond the Yelp sentiment task which most researches focus on. In fact, if we generalize the phenomenon, we would find that the current research mostly deals with an operational definition of style where the corpus-specific content words are changed. In the Dickens vs. modern literature example, if the sen- tence contains the word "Oliver," then it is most likely Dickens style (according to the operational definition), because the word "Oliver" has ap- peared so many times in the novel Oliver Twist but the word may have rarely appeared in the modern literature corpus. However, this is not the practical or useful definition of style. The vast majority of datasets and use cases are not as idealized as the Yelp dataset. We need to recognize the real-world definition of style (e.g., keeping "Oliver" as it is in style transfer), so that style transfer research can show promise of be- ing integrated to application interfaces. This cre- ates problems for the existing automatic evalua- tion metrics. 3 Problem 2: The Issue of Metrics 3.1 Content Similarity In the task of author obfuscation or writing style transfer, the idea of content similarity becomes rather complicated. In the task of Literature style transfer, what are the style keywords? Take the example where the two unparalleled corpora are Dickens-written sentences and modern litera- ture sentences. Consider the following sentence: Oliver deemed the gathering in York a great suc- cess. The expected transfer (if we train human an- notators/specialists to transfer it) from the Dick- ens style to the modern literature style should be similar to "Oliver thought the gathering was suc- cessful" (which is the real-world style transfer). However, the most likely transfer (if we use sim- ple autoencoder framework directly) will be "Karl enjoyed the party in LA" (which is the operational style transfer). Consider the following types of words: • Corpus-specific proper content nouns: Names may be different in the transferred sentences, as names in two corpora are dif- ferent. Similarly for locations, organizations, etc. To transfer correctly, a simple baseline could be using a NER labeller. We can replace words with the corresponding labels, and after transferring the sentence (where some words are represented by labels), we can replace the labels with the original words. In short, these proper nouns need to be consistent. • Other corpus-specific content words: "En- glish farms" should be transferred to "En- glish farms" instead of "baseball fields"; "horses" should be transferred to "horses" in- stead of "vampires." In this case, the human- expected rules do not correspond with the machine-identified differences between two corpora. When evaluating, these words are not style keywords, and we should use se- mantic similarity to make sure that the words stay consistent. • Style words: "Deemed" and "gathering" may belong to the Dickens style. They should be changed. Mir et al. (2019) removed and masked the style keywords by using a classifier. In this case, all of the aforementioned itemized types of words will be masked, and content similarity evaluation will fail. We can address this problem by manually cre- ating the list of style keywords, or by retrieving the style keywords by relying on outside knowl- edge. Another possibility is to keep the words as they are, without removing and masking the style keywords, as the style keywords are likely the mi- nority. 3.2 Fluency and Style Accuracy Pang and Gimpel (2018) and Mir et al. (2019) both used perplexity. However, one issue is that lower perplexity may reflect unnatural sentences with common words. We can punish abnormally small perplexity as in Section 4.1. Moreover, flu- ency and style accuracy may have similar problem with Section 3.1. Perplexity will be large for sen- tences of the same content but different styles, if the content-words have appeared only rarely in the target corpus. Accuracy has a similar problem. Therefore, to address this problem, we can mask out corpus-specific content words, before pretraining the language model to evaluate fluency and before pretraining the classifier to evaluate ac- curacy. 4 Problem 3: Trade-off and Aggregation of Scores Once we have three numbers: style accuracy, con- tent similarity, and fluency, how do practitioners decide which combination to select? According to Pang and Gimpel (2018) and Mir et al. (2019), style accuracy is inversely correlated to content similarity, fluency is inversely correlated with con- tent similarity, and fluency is inversely correlated with style accuracy. So how do practitioners de- termine the degree of trade-off for selection? It is often useful to summarize multiple metrics into one number, for ease of tuning and model se- lection. One natural approach is to use aggrega- tion. Suppose we use A, B, C to represent style accuracy, content similarity, and fluency, respec- tively. Note that different papers may have differ- ent variations of defining A, B, and C. Xu et al. (2018) simply took the geometric mean of A and B. However, this choice is arbitrary. In the style transfer models using different datasets, each of A, B, C corresponds to different range, mini- mum, and maximum.2 Geometric mean is de- signed so that same percentage change results in same effects of geometric mean. But the percent- age change ceases to be meaningful in our case. 4.1 Potential Solutions for Aggregation If we still decide to design an aggregation method based on geometric mean, one possible simple remedy similar to Pang and Gimpel (2018) is to learn a threshold t1, such that A − t1 represents a similar percentage change across many datasets. We define that for sentence s, Gt1,t2,t3,t4(s) = (cid:0)[A(s) − t1]+ · [B(s) − t2]+· min{[t3 − C(s)]+, [C(s) − t4]+}(cid:1) 1 3 (1) where t1, t2, t3, t4 are the parameters to be learned as described later. Note that the metric is also de- signed to punish abnormally small perplexity, as discussed previously. One question arises: Is a universal G necessary or helpful (i.e., do we need G that work across many datasets)? The current research strives for a universal metric that work across datasets. If we also strive to do so, we obtain the following result. If we need a universal evaluator that works across many datasets. We can randomly sam- ple a few hundred pairs of transferred sentences from a range of style transfer outputs (from dif- ferent models -- good ones and bad ones) from a range of style transfer tasks, and ask annotators which of the two transferred sentences is better.3 (Note that the two transferred sentence correspond to the same original sentence). We denote a pair of sentences by (y+, y−) where y+ is preferred by the annotator. We train the parameters t using the loss L(t) = 2That is, A may fluctuate between 0.4 and 0.6 for mod- els for dataset 1, but A may fluctuate between 0.8 to 0.9 for models for dataset 2. The method of geometric mean does not hold. 3For each annotation, annotators will be given an original sentence, model-1-transferred sentence, model-2-transferred sentence, and they will be asked to judge which transferred sentence is better if they take all three evaluation aspects into account (style accuracy, content similarity, and fluency). max(0, −Gt(y+) + Gt(y−) + δ) where t = {t1, t2, t3, t4} and δ = 1 as commonly used mar- gin.4 1 To even make the metric G more convincing, we may design more complicated functions G = f (A, B, C). Here is a possibility: Gt,α(s) = (cid:0)([A(s) − t1]+)α1 · ([B(s) − t2]+)α2 · min{([t3 − C(s)]+)α3 , ([C(s) − t4]+)α4 }(cid:1) 3 . We can also de- sign f to be a very small neural network (with non- linear activation), especially if we have lots of an- notations. We can provide a set of possible func- tion forms f1, f2, . . . , fp, and we can train param- eters for each individual fi and select the best fi. We can estimate the quality of fi by computing the percentage of machine preferences ("which trans- ferred sentence in a pair is better" according to G- scores) that match the human preferences ("which transferred sentence in a pair is better" according to human judgment). If we do not need a universal evaluator. Then we can repeat the above procedure by only sam- pling pairs of transferred sentences from the dataset of interest. We suggest this approach, as it will be more accurate for the particular task. 5 Conclusion We discussed existing auto-evaluation metrics for style transfer with non-parallel corpora. We also emphasized that we need to move on from op- erational style transfer and pay more attention to the real-world style transfer research, so that we can put style transfer systems into practical appli- cations. This shift will create problems for style transfer evaluation metrics. Finally, for ease of model selection of comparison, we discussed pos- sible ways of aggregating the metrics. We hope that this discussion will accelerate the research in real-world style transfer. Acknowledgements The author would like to thank He He and Kevin Gimpel for helpful discussions. 4As an example, trained on Yelp dataset and Dickens- modern Literature dataset only, we obtained t1 = 63, t2 = 71, t3 = 97, t4 = −37 following the metrics of Pang and Gimpel (2018). Please note that this is an extended abstract, so we do not conduct detailed evaluations. To fur- ther the quality of the metrics, we propose adding more pairs of transferred sentences from other style transfer tasks to train the parameters t1, t2, t3, t4. References Anonymous. 2020. Learning the difference that makes a difference with counterfactually-augmented data. In Submitted to International Conference on Learn- ing Representations. Under review. Nancy Campbell. 1987. Adapted literary texts and the efl reading programme. ELT Journal, 41(2):132 -- 135. Marta R. Costa-juss`a, Christian Hardmeier, Will Rad- ford, and Kellie Webster. 2019. Proceedings of the first workshop on gender bias in natural language processing. Florence, Italy. Association for Com- putational Linguistics. Michael Denkowski and Alon Lavie. 2014. Meteor universal: Language specific translation evaluation for any target language. In Proceedings of the EACL 2014 Workshop on Statistical Machine Translation. Zhenxin Fu, Xiaoye Tan, Nanyun Peng, Dongyan Zhao, and Rui Yan. 2018. Style transfer in text: ex- ploration and evaluation. In 32nd AAAI Conference on Artificial Intelligence (AAAI-18). George Heidorn. 2000. Intelligent writing assistance. Handbook of natural language processing, pages 181 -- 207. Zhiting Hu, Zichao Yang, Xiaodan Liang, Ruslan Salakhutdinov, and Eric P. Xing. 2017. Toward con- trolled generation of text. In Proceedings of the 34th International Conference on Machine Learn- ing, volume 70 of Proceedings of Machine Learning Research, pages 1587 -- 1596. Jad Kabbara and Jackie Chi Kit Cheung. 2016. Stylis- tic transfer in natural language generation systems using recurrent neural networks. In Proceedings of the Workshop on Uphill Battles in Language Processing: Scaling Early Achievements to Robust Methods, pages 43 -- 47. Svetlana Kiritchenko and Saif Mohammad. 2018. Ex- amining gender and race bias in two hundred sen- timent analysis systems. In Proceedings of the Seventh Joint Conference on Lexical and Com- putational Semantics, pages 43 -- 53, New Orleans, Louisiana. Association for Computational Linguis- tics. Juncen Li, Robin Jia, He He, and Percy Liang. 2018. Delete, retrieve, generate: a simple approach to sen- timent and style transfer. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Hu- man Language Technologies, Volume 1 (Long Pa- pers), pages 1865 -- 1874. Association for Computa- tional Linguistics. Lajanugen Logeswaran, Honglak Lee, and Samy Ben- gio. 2018. Content preserving text generation with attribute controls. In Advances in Neural Informa- tion Processing Systems, pages 5103 -- 5113. Andrew L. Maas, Raymond E. Daly, Peter T. Pham, Dan Huang, Andrew Y. Ng, and Christopher Potts. 2011. Learning word vectors for sentiment analy- sis. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Hu- man Language Technologies - Volume 1, HLT '11, pages 142 -- 150, Stroudsburg, PA, USA. Association for Computational Linguistics. Remi Mir, Bjarke Felbo, Nick Obradovich, and Iyad Rahwan. 2019. Evaluating style transfer for text. arXiv preprint arXiv:1904.02295. Yuanzhe Pang and Kevin Gimpel. 2018. Learning criteria and evaluation metrics for textual trans- fer between non-parallel corpora. arXiv preprint arXiv:1810.11878. Kishore Papineni, Salim Roukos, Todd Ward, and Wei- Jing Zhu. 2002. Bleu: a method for automatic eval- uation of machine translation. In Proceedings of the 40th Annual Meeting of the Association for Compu- tational Linguistics. Ofir Pele and Michael Werman. 2009. Fast and robust earth mover's distances. In 2009 IEEE 12th Interna- tional Conference on Computer Vision, pages 460 -- 467. IEEE. Jeffrey Pennington, Richard Socher, and Christopher Manning. 2014. Glove: Global vectors for word representation. In Proceedings of the 2014 Con- ference on Empirical Methods in Natural Language Processing. Association for Computational Linguis- tics. Shrimai Prabhumoye, Yulia Tsvetkov, Ruslan Salakhutdinov, and Alan W. Black. 2018. Style transfer through back-translation. arXiv preprint arXiv:1804.09000. Sudha Rao and Joel Tetreault. 2018. Dear sir or madam, may i introduce the gyafc dataset: Corpus, benchmarks and metrics for formality style transfer. arXiv preprint arXiv:1803.06535. Sravana Reddy and Kevin Knight. 2016. Obfuscating In Proceedings of gender in social media writing. the First Workshop on NLP and Computational So- cial Science, pages 17 -- 26. Alan Ritter, Colin Cherry, and William B Dolan. 2011. Data-driven response generation in social media. In Proceedings of the conference on empirical methods in natural language processing, pages 583 -- 593. As- sociation for Computational Linguistics. Cicero Nogueira dos Santos, Igor Melnyk, and Inkit Padhi. 2018. Fighting offensive language on social media with unsupervised text style transfer. arXiv preprint arXiv:1805.07685. Rico Sennrich, Barry Haddow, and Alexandra Birch. 2016. Controlling politeness in neural machine translation via side constraints. In Proceedings of the 2016 Conference of the North American Chap- ter of the Association for Computational Linguistics: Human Language Technologies, pages 35 -- 40. Asso- ciation for Computational Linguistics. 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 30, pages 6833 -- 6844. Cur- ran Associates, Inc. Rakshith Shetty, Bernt Schiele, and Mario Fritz. 2017. Author attribute anonymity by adversarial train- ing of neural machine translation. arXiv preprint arXiv:1711.01921. Jingjing Xu, Xu Sun, Qi Zeng, Xuancheng Ren, Xi- aodong Zhang, Houfeng Wang, and Wenjie Li. 2018. Unpaired sentiment-to-sentiment translation: A cycled reinforcement learning approach. arXiv preprint arXiv:1805.05181. Wei Xu. 2017. From shakespeare to twitter: What are In Proceedings of the language styles all about? Workshop on Stylistic Variation, pages 1 -- 9. Zichao Yang, Zhiting Hu, Chris Dyer, Eric P Xing, and Taylor Berg-Kirkpatrick. 2018. Unsupervised text style transfer using language models as discrimina- tors. arXiv preprint arXiv:1805.11749. Yi Zhang, Jingjing Xu, Pengcheng Yang, and Xu Sun. 2018. Learning sentiment memories for sentiment modification without parallel data. arXiv preprint arXiv:1808.07311. Jieyu Zhao, Tianlu Wang, Mark Yatskar, Vicente Or- donez, and Kai-Wei Chang. 2017. Men also like shopping: Reducing gender bias amplification using corpus-level constraints. In Proceedings of the 2017 Conference on Empirical Methods in Natural Lan- guage Processing, pages 2979 -- 2989, Copenhagen, Denmark. Association for Computational Linguis- tics.
1908.06151
2
1908
2019-08-26T15:57:02
The Transference Architecture for Automatic Post-Editing
[ "cs.CL" ]
In automatic post-editing (APE) it makes sense to condition post-editing (pe) decisions on both the source (src) and the machine translated text (mt) as input. This has led to multi-source encoder based APE approaches. A research challenge now is the search for architectures that best support the capture, preparation and provision of src and mt information and its integration with pe decisions. In this paper we present a new multi-source APE model, called transference. Unlike previous approaches, it (i) uses a transformer encoder block for src, (ii) followed by a decoder block, but without masking for self-attention on mt, which effectively acts as second encoder combining src -> mt, and (iii) feeds this representation into a final decoder block generating pe. Our model outperforms the state-of-the-art by 1 BLEU point on the WMT 2016, 2017, and 2018 English--German APE shared tasks (PBSMT and NMT). We further investigate the importance of our newly introduced second encoder and find that a too small amount of layers does hurt the performance, while reducing the number of layers of the decoder does not matter much.
cs.CL
cs
The Transference Architecture for Automatic Post-Editing Santanu Pal1,2, Hongfei Xu1,2, Nico Herbig2, Sudip Kumar Naskar3, Antonio Kruger2, Josef van Genabith1,2 1Department of Language Science and Technology, Saarland University, Germany 2German Research Center for Artificial Intelligence (DFKI), Saarland Informatics Campus, Germany 3Jadavpur University, Kolkata, India {santanu.pal, josef.vangenabith}@uni-saarland.de {hongfei.xu, nico.herbig, krueger}@dfki.de, [email protected] 9 1 0 2 g u A 6 2 ] L C . s c [ 2 v 1 5 1 6 0 . 8 0 9 1 : v i X r a Abstract In automatic post-editing (APE) it makes sense to condition post-editing (pe) decisions on both the source (src) and the machine translated text (mt) as input. This has led to multi-source encoder based APE approaches. A research challenge now is the search for architectures that best support the capture, preparation and provision of src and mt infor- mation and its integration with pe decisions. In this paper we present a new multi-source APE model, called transference. Unlike pre- vious approaches, it (i) uses a transformer en- coder block for src, (ii) followed by a decoder block, but without masking for self-attention on mt, which effectively acts as second en- coder combining src → mt, and (iii) feeds this representation into a final decoder block generating pe. Our model outperforms the state-of-the-art by 1 BLEU point on the WMT 2016, 2017, and 2018 English -- German APE shared tasks (PBSMT and NMT). We further investigate the importance of our newly intro- duced second encoder and find that a too small amount of layers does hurt the performance, while reducing the number of layers of the de- coder does not matter much. 1 Introduction The performance of state-of-the-art MT systems is not perfect, thus, human interventions are still required to correct machine translated texts into publishable quality translations (TAUS/CNGL Re- port, 2010). Automatic post-editing (APE) is a method that aims to automatically correct errors made by MT systems before performing actual human post-editing (PE) (Knight and Chander, 1994), thereby reducing the translators' workload and increasing productivity (Pal et al., 2016a). APE systems trained on human PE data serve as MT post-processing modules to improve the over- all performance. APE can therefore be viewed as a 2nd-stage MT system, translating predictable er- ror patterns in MT output to their corresponding corrections. APE training data minimally involves MT output (mt) and the human post-edited (pe) version of mt, but additionally using the source (src) has been shown to provide further bene- fits (Bojar et al., 2015, 2016, 2017). To provide awareness of errors in mt originat- ing from src, attention mechanisms (Bahdanau et al., 2015) allow modeling of non-local depen- dencies in the input or output sequences, and im- portantly also global dependencies between them (in our case src, mt and pe). The transformer architecture (Vaswani et al., 2017) is built solely upon such attention mechanisms completely re- placing recurrence and convolutions. The trans- former uses positional encoding to encode the in- put and output sequences, and computes both self- and cross-attention through so-called multi-head attentions, which are facilitated by parallelization. Such multi-head attention allows to jointly attend to information at different positions from different representation subspaces, e.g. utilizing and com- bining information from src, mt, and pe. In this paper, we present a multi-source neural APE architecture called transference. Our model contains a source encoder which encodes src in- formation, a second encoder (encsrc→mt) which takes the encoded representation from the source encoder (encsrc), combines this with the self- attention-based encoding of mt (encmt), and pre- pares a representation for the decoder (decpe) via cross-attention. Our second encoder (encsrc→mt) can also be viewed as a standard transformer de- coding block, however, without masking, which acts as an encoder. We thus recombine the differ- ent blocks of the transformer architecture and re- purpose them for the APE task in a simple yet ef- fective way. The suggested architecture is inspired by the two-step approach professional translators tend to use during post-editing: first, the source segment is compared to the corresponding transla- tion suggestion (similar to what our encsrc→mt is doing), then corrections to the MT output are ap- plied based on the encountered errors (in the same way that our decpe uses the encoded representation of encsrc→mt to produce the final translation). The paper makes the following contributions: (i) we propose a new multi-encoder model for APE that consists only of standard transformer en- coding and decoding blocks, (ii) by using a mix of self- and cross-attention we provide a repre- sentation of both src and mt for the decoder, al- lowing it to better capture errors in mt originat- ing from src; this advances the state-of-the-art in APE in terms of BLEU and TER, and (iii), we analyze the effect of varying the number of en- coder and decoder layers (Domhan, 2018), indi- cating that the encoders contribute more than de- coders in transformer-based neural APE. 2 Related Research Recent advances in APE research are directed towards neural APE, which was first proposed by Pal et al. (2016b) and Junczys-Dowmunt and Grundkiewicz (2016) for the single-source APE scenario which does not consider src, i.e. mt → pe. In their work, Junczys-Dowmunt and Grund- kiewicz (2016) also generated a large synthetic training dataset through back translation, which we also use as additional training data. Exploiting source information as an additional input can help neural APE to disambiguate cor- rections applied at each time step; this naturally leads to multi-source APE ({src, mt} → pe). A multi-source neural APE system can be config- ured either by using a single encoder that encodes the concatenation of src and mt (Niehues et al., 2016) or by using two separate encoders for src and mt and passing the concatenation of both en- coders' final states to the decoder (Libovick´y et al., 2016). A few approaches to multi-source neural APE were proposed in the WMT 2017 APE shared task. Junczys-Dowmunt and Grundkiewicz (2017) combine both mt and src in a single neural archi- tecture, exploring different combinations of atten- tion mechanisms including soft attention and hard monotonic attention. Chatterjee et al. (2017) built upon the two-encoder architecture of multi-source models (Libovick´y et al., 2016) by means of con- catenating both weighted contexts of encoded src and mt. Varis and Bojar (2017) compared two multi-source models, one using a single encoder with concatenation of src and mt sentences, and a second one using two character-level encoders for mt and src along with a character-level decoder. Recently, in the WMT 2018 APE shared task, several adaptations of the transformer architec- ture have been presented for multi-source APE. Pal et al. (2018) proposed an APE model that uses three self-attention-based encoders. They introduce an additional joint encoder that at- tends over a combination of the two encoded se- quences from mt and src. Tebbifakhr et al. (2018), the NMT-subtask winner of WMT 2018 (wmt18nmt best ), employ sequence-level loss func- tions in order to avoid exposure bias during train- ing and to be consistent with the automatic eval- uation metrics. Shin and Lee (2018) propose that each encoder has its own self-attention and feed-forward layer to process each input sepa- rately. On the decoder side, they add two addi- tional multi-head attention layers, one for src → mt and another for src → pe. Thereafter another multi-head attention between the output of those attention layers helps the decoder to capture common words in mt which should re- main in pe. The APE PBSMT-subtask winner of WMT 2018 (wmt18smt best) (Junczys-Dowmunt and Grundkiewicz, 2018) also presented another transformer-based multi-source APE which uses two encoders and stacks an additional cross- attention component for src → pe above the pre- vious cross-attention for mt → pe. Comparing Shin and Lee (2018)'s approach with the winner system, there are only two differences in the archi- tecture: (i) the cross-attention order of src → mt and src → pe in the decoder, and (ii) wmt18smt best additionally shares parameters between two en- coders. 3 Transference Model for APE We propose a multi-source transformer model called transference ({src, mt}tr → pe, Figure 1), which takes advantage of both the encodings of src and mt and attends over a combination of both sequences while generating the post-edited sentence. The second encoder, encsrc→mt, makes use of the first encoder encsrc and a sub-encoder encmt for considering src and mt. Here, the encsrc encoder and the decpe decoder are equiva- lent to the original transformer for neural MT. Our encsrc→mt follows an architecture similar to the transformer's decoder, the difference being that no masked multi-head self-attention is used to pro- cess mt. ment section will show. for src, One self-attended encoder s = (s1, s2, . . . , sk), returns a sequence of continuous representations, encsrc, and a second self-attended sub-encoder for mt, m = (m1, m2, . . . , ml), re- turns another sequence of continuous represen- tations, encmt. Self-attention at this point pro- vides the advantage of aggregating information from all of the words, including src and mt, and successively generates a new representation per word informed by the entire src and mt context. The internal encmt representation performs cross- attention over encsrc and prepares a final rep- resentation (encsrc→mt) for the decoder (decpe). The decoder then generates the pe output in se- quence, p = (p1, p2, . . . , pn), one word at a time from left to right by attending to previously gen- erated words as well as the final representations (encsrc→mt) generated by the encoder. To summarize, our multi-source APE imple- mentation extends Vaswani et al. (2017) by intro- ducing an additional encoding block by which src and mt communicate with the decoder. Our proposed approach differs from the WMT 2018 PBSMT winner system in several ways: (i) we use the original transformer's decoder with- out modifications; (ii) one of our encoder blocks (encsrc→mt) is identical to the transformer's de- coder block but uses no masking in the self- attention layer, thus having one self-attention layer and an additional cross-attention for src → mt; and (iii) in the decoder layer, the cross-attention is performed between the encoded representation from encsrc→mt and pe. Our approach also differs from the WMT 2018 NMT winner system: (i) wmt18nmt best concatenates the encoded representation of two encoders and passes it as the key to the attention layer of the decoder, and (ii), the system additionally employs sequence-level loss functions based on maximum likelihood estimation and minimum risk training in order to avoid exposure bias during training. The main intuition is that our encsrc→mt attends over the src and mt and informs the pe to better capture, process, and share information between src-mt-pe, which efficiently models error patterns and the corresponding corrections. Our model per- forms better than past approaches, as the experi- Figure 1: The transference model architecture for APE ({src, mt}tr → pe). 4 Experiments We explore our approach on both APE sub-tasks of WMT 2018, where the 1st-stage MT system to which APE is applied is either a phrase-based sta- tistical machine translation (PBSMT) or a neural machine translation (NMT) model. For the PBSMT task, we compare against four the raw SMT output provided by baselines: the 1st-stage PBSMT system, the best-performing systems from WMT APE 2018 (wmt18smt best), which are a single model and an ensemble model by Junczys-Dowmunt and Grundkiewicz (2018), as well as a transformer trying to directly translate from src to pe (Transformer (src → pe)), thus performing translation instead of APE. We evalu- ate the systems using BLEU (Papineni et al., 2002) and TER (Snover et al., 2006). For the NMT task, we consider two baselines: the raw NMT output provided by the 1st-stage NMT system and the best-performing system from the WMT 2018 NMT APE task (wmt18nmt best) (Tebbifakhr et al., 2018). Apart from the multi-encoder transference ar- chitecture described above ({src, mt}tr → pe) and ensembling of this architecture, two simpler versions are also analyzed: first, a 'mono-lingual' (mt → pe) APE model using only parallel mt -- pe data and therefore only a single encoder, and sec- ond, an identical single-encoder architecture, how- ever, using the concatenated src and mt text as input ({src + mt} → pe) (Niehues et al., 2016). 4.1 Data For our experiments, we use the English -- German WMT 2016 (Bojar et al., 2016), 2017 (Bojar et al., 2017) and 2018 (Chatterjee et al., 2018) APE task data. All these released APE datasets con- sist of English -- German triplets containing source English text (src) from the IT domain, the cor- responding German translations (mt) from a 1st- stage MT system, and the corresponding human- post-edited version (pe). The sizes of the datasets (train; dev; test), in terms of number of sentences, are (12,000; 1,000; 2,000), (11,000; 0; 2,000), and (13,442; 1,000; 1,023), for the 2016 PBSMT, the 2017 PBSMT, and the 2018 NMT data, respec- tively. One should note that for WMT 2018, we carried out experiments only for the NMT sub-task and ignored the data for the PBSMT task. Since the WMT APE datasets are small in size, we use 'artificial training data' (Junczys- Dowmunt and Grundkiewicz, 2016) containing 4.5M sentences as additional resources, 4M of which are weakly similar to the WMT 2016 train- ing data, while 500K are very similar according to TER statistics. For experimenting on the NMT data, we ad- ditionally use the synthetic eScape APE corpus (Negri et al., 2018), consisting of ∼7M triples. For cleaning this noisy eScape dataset contain- ing many unrelated language words (e.g. Chinese), we perform the following two steps: (i) we use the cleaning process described in Tebbifakhr et al. (2018), and (ii) we use the Moses (Koehn et al., 2007) corpus cleaning scripts with minimum and maximum number of tokens set to 1 and 100, re- spectively. After cleaning, we perform punctua- tion normalization, and then use the Moses tok- enizer (Koehn et al., 2007) to tokenize the eScape corpus with 'no-escape' option. Finally, we ap- ply true-casing. The cleaned version of the eScape corpus contains ∼6.5M triplets. 4.2 Experiment Setup To build models for the PBSMT tasks from 2016 and 2017, we first train a generic APE model us- ing all the training data (4M + 500K + 12K + 11K) described in Section 4.1. Afterwards, we fine-tune the trained model using the 500K artificial and 23K (12K + 11K) real PE training data. We use the WMT 2016 development data (dev2016) con- taining 1,000 triplets to validate the models dur- ing training. To test our system performance, we use the WMT 2016 and 2017 test data (test2016, test2017) as two sub-experiments, each contain- ing 2,000 triplets (src, mt and pe). We compare the performance of our system with the four dif- ferent baseline systems described above: raw MT, best single and ensemble, as well as Trans- wmt18smt former (src → pe). Additionally, we check the performance of our model on the WMT 2018 NMT APE task (where unlike in previous tasks, the 1st-stage MT sys- tem is provided by NMT): for this, we explore two experimental setups: (i) we use the PBSMT task's APE model as a generic model which is then fine-tuned to a subset (12k) of the NMT tr → pegeneric,smt). One should data ({src, mt}nmt note that it has been argued that the inclusion of SMT-specific data could be harmful when train- ing NMT APE models (Junczys-Dowmunt and Grundkiewicz, 2018). (ii), we train a completely new generic model on the cleaned eScape data (∼6.5M) along with a subset (12K) of the orig- inal training data released for the NMT task ({src, mt}nmt tr → pegeneric,nmt). The aforemen- tioned 12K NMT data are the first 12K of the overall 13.4K NMT data. The remaining 1.4K are used as validation data. The released devel- opment set (dev2018) is used as test data for our experiment, alongside the test2018, for which we could only obtain results for a few models by the WMT 2019 task organizers. We also explore an additional fine-tuning step of {src, mt}nmt tr → pegeneric,nmt towards the 12K NMT data (called {src, mt}nmt tr → pef t), and a model averaging the 8 best checkpoints of {src, mt}nmt tr → pef t, tr → pef t which we call {src, mt}nmt avg. Last, we analyze the importance of our second encoder (encsrc→mt), compared to the source en- coder (encsrc) and the decoder (decpe), by reduc- ing and expanding the amount of layers in the encoders and the decoder. Our standard setup, which we use for fine-tuning, ensembling etc., is fixed to 6-6-6 for Nsrc-Nmt-Npe (cf. Figure 1), where 6 is the value that was proposed by Vaswani et al. (2017) for the base model. We investigate what happens in terms of APE performance if we change this setting to 6-6-4 and 6-4-6. To handle out-of-vocabulary words and reduce the vocabulary size, instead of considering words, we consider subword units (Sennrich et al., 2016) by using byte-pair encoding (BPE). In the prepro- cessing step, instead of learning an explicit map- ping between BPEs in the src, mt and pe, we de- fine BPE tokens by jointly processing all triplets. Thus, src, mt and pe derive a single BPE vocab- ulary. Since mt and pe belong to the same lan- guage (German) and src is a close language (En- glish), they naturally share a good fraction of BPE tokens, which reduces the vocabulary size to 28k. 4.3 Hyper-parameter Setup We follow a similar hyper-parameter setup for all reported systems. All encoders (for {src, mt}tr → pe), and the decoder, are com- posed of a stack of Nsrc = Nmt = Npe = 6 identical layers followed by layer normalization. The learning rate is varied throughout the training process, and increasing for the first training steps warmupsteps = 8000 and afterwards decreasing as described in (Vaswani et al., 2017). All remain- ing hyper-parameters are set analogously to those of the transformer's base model, except that we do not perform checkpoint averaging. At training time, the batch size is set to 25K tokens, with a maximum sentence length of 256 subwords. After each epoch, the training data is shuffled. During decoding, we perform beam search with a beam size of 4. We use shared embeddings between mt and pe in all our experiments. 5 Results ensemble, (Junczys-Dowmunt four models, multi-source results of our (mt → pe), ({src + pe} → pe), tr → pe), and single- The single source transference encoder ({src, mt}smt in comparison to the four baselines, raw SMT, and Grund- wmt18smt best kiewicz, 2018) single and ensemble, as well as Transformer (src → pe), are presented in Table 1 for test2016 and test2017. Table 2 reports the results obtained by our transference model ({src, mt}nmt tr → pe) on the WMT 2018 NMT data for dev2018 (which we use as a test set) and test2018, compared to the baselines raw NMT and wmt18nmt best. 5.1 Baselines The raw SMT output in Table 1 is a strong black- box PBSMT system (i.e., 1st-stage MT). We re- port its performance observed with respect to the ground truth (pe), i.e., the post-edited version of mt. The original PBSMT system scores over 62 BLEU points and below 25 TER on test2016 and test2017. Using a Transformer (src → pe), we test if APE is really useful, or if potential gains are only achieved due to the good performance of the trans- former architecture. While we cannot do a full training of the transformer on the data that the raw MT engine was trained on due to the unavailability of the data, we use our PE datasets in an equivalent experimental setup as for all other models. The results of this system (Exp. 1.2 in Table 1) show that the performance is actually lower across both test sets, -5.52/-9.43 absolute points in BLEU and +5.21/+7.72 absolute in TER, compared to the raw SMT baseline. We report four results from wmt18smt best, (i) best (single), which is the core multi- wmt18smt encoder implementation without ensembling but with checkpoint averaging, (ii) wmt18smt best (x4) which is an ensemble of four identical 'single' models trained with different random initializa- tions. The results of wmt18smt best (single) and best (x4) (Exp. 1.3 and 1.4) reported in wmt18smt Table 1 are from Junczys-Dowmunt and Grund- kiewicz (2018). Since their training procedure slightly differs from ours, we also trained the best system using exactly our experimen- wmt18smt tal setup in order to make a fair comparison. This yields the baselines (iii) wmt18smt,generic (single) (Exp. 1.5), which is similar to wmt18smt best (single), however, the training parameters and data are kept in line with our transference general model (Exp. 2.3) and (iv) wmt18smt,f t (single) (Exp. 1.6), which is also trained maintaining the equivalent experimental setup compared to the fine tuned version of the transference general model (Exp. 3.3). Compared to both raw SMT and Transformer (src → pe) we see strong improve- ments for this state-of-the-art model, with BLEU scores of at least 68.14 and TER scores of at most 20.98 across the PBSMT testsets. wmt18smt best, however, performs better in its original setup (Exp. 1.3 and 1.4) compared to our experimental setup (Exp. 1.5 and 1.6). best best 62.11 56.59 (-5.52) 70.86 (+8.75) 71.04 (+8.93) 24.76 29.97 (+5.21) 18.92 (-5.84) 18.86 (-5.9) best with our experimental setup 20.41 (-4.35) 19.84 (-4.92) 69.14 (+7.03) 70.12 (+8.01) best best (single) (single) best (single) best (x4) Raw SMT Transformer (src → pe) wmt18smt wmt18smt Baselines: Retrained wmt18smt wmt18smt,generic wmt18smt,f t mt → pe {src + mt} → pe {src, mt}smt tr → pe mt → pe {src + mt} → pe {src, mt}smt tr → pe Exp3.3smt ensemblesmt(x3) {src, mt}smt {src, mt}smt 1.5 1.6 General models trained on 23K+4.5M data 2.1 2.2 2.3 Fine-tuning Exp. 2 models with 23K+500K data 3.1 3.2 3.3 4.1 4.2 {src, mt}smt 5.1 5.2 tr → pe with different layer size tr → pe (6-6-4) tr → pe (6-4-6) ens4ckpt 67.70 (+5.59) 69.32 (+7.21) 70.46 (+8.35) 68.43 (+6.32) 69.87 (+7.76) 71.05 (+8.94) 71.59 (+9.48) 72.19 (+10.08) 21.90 (-2.86) 20.27 (-4.49) 19.21 (-5.55) 21.29 (-3.47) 19.94 (-4.82) 19.05 (-5.71) 18.78 (-5.98) 18.39 (-6.37) 62.49 53.06 (-9.43) 69.72 (+7.23) 70.46 (+7.97) 24.48 32.20 (+7.72) 19.49 (-4.99) 19.03 (-5.45) 68.14 (+5.65) 69.16 (+6.67) 20.98 (-3.5) 20.34 (-4.14) 66.91 (+4.42) 68.26 (+5.77) 70.05 (+7.56) 22.32 (-2.16) 20.90 (-3.58) 19.46 (-5.02) 67.78 (+5.29) 68.57 (+6.08) 70.33 (+7.84) 70.89 (+8.4) 71.58 (+9.09) 21.63 (-2.85) 20.68 (-3.8) 19.23 (-5.25) 18.91 (-5.57) 18.58 (-5.9) BLEU ↑ test2016 TER ↓ BLEU ↑ test2017 TER ↓ Models Exp. no. Baselines 1.1 1.2 1.3 1.4 70.85 (+8.74) 69.93 (+7.82) 19.00 (-5.76) 19.70 (-5.06) 69.82 (+7.33) 69.61 (+7.12) 19.67 (-4.81) 19.68 (-4.8) Table 1: Evaluation results on the WMT APE test set 2016, and test set 2017 for the PBSMT task; (±X) value is best (x4). The last section of the table shows the impact of increasing and decreasing the improvement over wmt18smt the depth of the encoders and the decoder. 5.2 Single-Encoder Transformer for APE The two transformer architectures mt → pe and {src + mt} → pe use only a single encoder. Table 1 shows that mt → pe (Exp. 2.1) pro- vides better performance (+4.42 absolute BLEU on test2017) compared to the original SMT, while {src + mt} → pe (Exp. 2.2) provides further improvements by additionally using the src in- {src + mt} → pe improves over formation. mt → pe by +1.62/+1.35 absolute BLEU points on test2016/test2017. After fine-tuning, both sin- gle encoder transformers (Exp. 3.1 and 3.2 in Table 1) show further improvements, +0.87 and +0.31 absolute BLEU points, respectively, for test2017 and a similar improvement for test2016. 5.3 Transference Transformer for APE In contrast to the two models above, our transfer- ence architecture uses multiple encoders. To fairly compare to wmt18smt best, we retrain the wmt18smt best system with our experimental setup (cf. Exp. 1.5 and 1.6 in Table 1). wmt18smt,generic (single) is a generic model trained on all the training data; which is afterwards fine-tuned with 500K arti- ficial and 23K real PE data (wmt18smt,f t (sin- gle)). It is to be noted that in terms of perfor- mance the data processing method described in Junczys-Dowmunt and Grundkiewicz (2018) re- ported in Exp. 1.3 is better than ours (Exp. 1.6). best best The fine-tuned version of the {src, mt}smt tr → pe model (Exp. 3.3 in Table 1) outperforms best (single) (Exp. 1.3) in BLEU on both wmt18smt test sets, however, the TER score for test2016 in- creases. One should note that wmt18smt best (sin- gle) follows the transformer base model, which is an average of five checkpoints, while our Exp. 3.3 is not. When ensembling the 4 best tr → pe model checkpoints of our {src, mt}smt best (x4) (Exp. 4.1), the result beats the wmt18smt system, which is an ensemble of four differ- ent randomly initialized wmt18smt best (single) sys- tems. Our ensemblesmt(x3) combines two {src, mt}smt tr → pe (Exp. 2.3) models ini- tialized with different random weights with the ensemble of the fine-tuned transference model Exp3.3smt ens4ckpt(Exp. 4.1). This ensemble provides the best results for all datasets, providing roughly +1 BLEU point and -0.5 TER when comparing against wmt18smt best (x4). The results on the WMT 2018 NMT datasets (dev2018 and test2018) are presented in Table 2. The raw NMT system serves as one baseline against which we compare the performance of the different models. We evaluate the system hypothe- ses with respect to the ground truth (pe), i.e., the post-edited version of mt. The baseline origi- nal NMT system scores 76.76 BLEU points and 15.08 TER on dev2018, and 74.73 BLEU points dev2018 TER ↓ 15.08 14.78 (-0.30) test2018 BLEU ↑ 74.73 75.53 (+0.80) TER ↓ 16.80 16.46 (-0.30) BLEU ↑ 76.76 77.74 (+0.98) Exp. no. 6.1 6.2 Fine-tuning Exp. 3.3 on 12k NMT data tr → pegeneric,smt 7 77.09 (+0.33) Transference model trained on eScape+ 12k NMT data tr → pegeneric,nmt 8 77.25 (+0.49) Fine-tuning model 8 on 12k NMT data tr → pef t 9 Averaging 8 checkpoints of Exp. 9 tr → pef t 10 Models Raw NMT wmt18nmt best {src, mt}nmt {src, mt}nmt {src, mt}nmt {src, mt}nmt 77.39 (+0.63) avg 77.67 (+0.91) 14.94 (-0.14) 14.87 (-0.21) 14.71 (-0.37) - - - - - - 14.52 (-0.56) 75.75 (+1.02) 16.15 (-0.69) Table 2: Evaluation results on the WMT APE 2018 development set for the NMT task (Exp. 10 results were obtained by the WMT 2019 task organizers). and 16.84 TER on test2018. For the WMT 2018 NMT data we first test our {src, mt}nmt tr → pegeneric,smt model, which is the model from Exp. 3.3 fine-tuned towards NMT data as described in Section 4.2. Table 2 shows that our PBSMT APE model fine-tuned towards NMT (Exp. 7) can even slightly improve over the already very strong NMT system by about +0.3 BLEU and -0.1 TER, although these improve- ments are not statistically significant. tr → pef t tr → pef t). The overall results improve when we train our model on eScape and NMT data instead of using the PBSMT model as a basis. Our proposed generic transference model (Exp. 8, {src, mt}nmt tr → pegeneric,nmt shows statisti- cally significant improvements in terms of BLEU and TER compared to the baseline even before fine-tuning, and further improvements after fine- tuning (Exp. 9, {src, mt}nmt Fi- nally, after averaging the 8 best checkpoints, our {src, mt}nmt avg model (Exp. 10) also shows consistent improvements in comparison to the baseline and other experimental setups. Over- all our fine-tuned model averaging the 8 best checkpoints achieves +1.02 absolute BLEU points and -0.69 absolute TER improvements over the baseline on test2018. Table 2 also shows the performance of our model compared to the win- ner system of WMT 2018 (wmt18nmt best ) for the NMT task (Tebbifakhr et al., 2018). wmt18nmt best scores 14.78 in TER and 77.74 in BLEU on the dev2018 and 16.46 in TER and 75.53 in BLEU best , our on the test2018. In comparison to wmt18nmt model (Exp. 10) achieves better scores in TER on both the dev2018 and test2018, however, in terms of BLEU our model scores slightly lower for dev2018, while some improvements are achieved on test2018. The number of layers (Nsrc-Nmt-Npe) in all en- coders and the decoder for these results is fixed to 6-6-6. In Exp. 5.1, and 5.2 in Table 1, we see the results of changing this setting to 6-6-4 and 6-4-6. This can be compared to the results of Exp. 2.3, since no fine-tuning or ensembling was performed for these three experiments. Exp. 5.1 shows that decreasing the number of layers on the decoder side does not hurt the performance. In fact, in the case of test2016, we got some improve- ment, while for test2017, the scores got slightly worse. In contrast, reducing the encsrc→mt en- coder block's depth (Exp. 5.2) does indeed reduce the performance for all four scores, showing the importance of this second encoder. tr → pef t 5.4 Analysis of Error Patterns In Table 3, we analyze and compare the best performing SMT (ensemblesmt(x3)) and NMT ({src, mt}nmt avg) model outputs with the original MT outputs on the WMT 2017 (SMT) APE test set and on the WMT 2018 (NMT) de- velopment set. Improvements are measured in terms of number of words which need to be (i) in- serted (In), (ii) deleted (De), (iii) substituted (Su), and (iv) shifted (Sh), as per TER (Snover et al., 2006), in order to turn the MT outputs into ref- erence translations. Our model provides promis- ing results by significantly reducing the required number of edits (24% overall for PBSMT task and 3.6% for NMT task) across all edit operations, thereby leading to reduced post-editing effort and hence improving human post-editing productivity. When comparing PBSMT to NMT, we see that stronger improvements are achieved for PBSMT, probably because the raw SMT is worse than the raw NMT. For PBSMT, similar results are achieved for In, De, and Sh, while less gains are ensemblesmt(x3) vs. raw SMT {src, mt}nmt vs. raw NMT tr → pef t avg %In %De %Su %Sh +31 +32 +29 +15 +6 +2 +4 -2 Table 3: % of error reduction in terms of different edit operations achieved by our best systems compared to the raw MT baselines. obtained in terms of Su. For NMT, In is improved most, followed by Su, De, and last Sh. For shifts in NMT, the APE system even creates further errors, instead of reducing them, which is an issue we aim to prevent in the future. transference 5.5 Discussion architecture The proposed tr → pe, Exp. 2.3) shows slightly ({src, mt}smt worse results than wmt18smt best (single) (Exp. 1.3) before fine-tuning, and roughly similar results after fine-tuning (Exp. 3.3). After ensembling, however, our transference model (Exp. 4.2) shows consistent improvements when comparing against the best baseline ensemble wmt18smt best (x4) (Exp. 1.4). Due to the unavailability of the sentence- level scores of wmt18smt best (x4), we could not test if the improvements (roughly +1 BLEU, -0.5 TER) are statistically significant. Interestingly, our approach of taking the model optimized for PBSMT and fine-tuning it to the NMT task (Exp. 7) does not hurt the performance as was reported in the previous literature (Junczys-Dowmunt and In contrast, some small, Grundkiewicz, 2018). albeit improvements over the raw NMT baseline were achieved. When we train the transference architecture directly for the NMT task (Exp. 8), we get slightly better and statistically significant improvements compared to raw NMT. Fine-tuning this NMT model further towards the actual NMT data (Exp. 9), as well as performing checkpoint averaging using the 8 best checkpoints improves the results even further. statistically insignificant The reasons for the effectiveness of our ap- proach can be summarized as follows. (1) Our encsrc→mt contains two attention mechanisms: one is self-attention and another is cross-attention. The self-attention layer is not masked here; therefore, the cross-attention layer in encsrc→mt is informed by both previous and future time- steps from the self-attended representation of mt (encmt) and additionally from encsrc. As a re- sult, each state representation of encsrc→mt is learned from the context of src and mt. This might produce better representations for decpe which can access the combined context. In con- trast, in wmt18smt best, the decpe accesses represen- tations from src and mt independently, first using the representation from mt and then using that of src. (2) The position-wise feed-forward layer in our encsrc→mt of the transference model requires processing information from two attention mod- ules, while in the case of wmt18smt best, the position- wise feed-forward layer in decpe needs to process information from three attention modules, which may increase the learning difficulty of the feed- forward layer. (3) Since pe is a post-edited ver- sion of mt, sharing the same language, mt and pe are quite similar compared to src. Therefore, at- tending over a fine-tuned representation from mt along with src, which is what we have done in this work, might be a reason for the better results than those achieved by attending over src directly. Evaluating the influence of the depth of our en- coders and decoder show that while the decoder depth appears to have limited importance, reduc- ing the encoder depth indeed hurts performance which is in line with Domhan (2018). 6 Conclusions In this paper, we presented a multi-encoder transformer-based APE model that repurposes the standard transformer blocks in a simple and effec- tive way for the APE task: first, our transference architecture uses a transformer encoder block for src, followed by a decoder block without mask- ing on mt that effectively acts as a second encoder combining src → mt, and feeds this representa- tion into a final decoder block generating pe. The proposed model outperforms the best-performing system of WMT 2018 on the test2016, test2017, dev2018, and test2018 data and provides a new state-of-the-art in APE. Taking a departure from traditional transformer- based encoders, which perform self-attention only, our second encoder also performs cross-attention to produce representations for the decoder based on both src and mt. We also show that the en- coder plays a more pivotal role than the decoder in transformer-based APE, which could also be the case for transformer-based generation tasks in general. Our architecture is generic and can be used for any multi-source task, e.g., multi-source translation or summarization, etc. References Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Ben- gio. 2015. Neural Machine Translation by Jointly In International Learning to Align and Translate. Conference on Learning Representations (ICLR), San Diego, CA, USA. Ondrej Bojar, Rajen Chatterjee, Christian Federmann, Yvette Graham, Barry Haddow, Shujian Huang, Matthias Huck, Philipp Koehn, Qun Liu, Varvara Logacheva, Christof Monz, Matteo Negri, Matt Post, Raphael Rubino, Lucia Specia, and Marco Turchi. 2017. Findings of the 2017 Conference In Proceed- on Machine Translation (WMT17). ings of the Second Conference on Machine Trans- lation, Volume 2: Shared Task Papers, pages 169 -- 214, Copenhagen, Denmark. Association for Com- putational Linguistics. Ondrej Bojar, Rajen Chatterjee, Christian Federmann, Yvette Graham, Barry Haddow, Matthias Huck, Antonio Jimeno Yepes, Philipp Koehn, Varvara Logacheva, Christof Monz, Matteo Negri, Aure- lie Neveol, Mariana Neves, Martin Popel, Matt Post, Raphael Rubino, Carolina Scarton, Lucia Spe- cia, Marco Turchi, Karin Verspoor, and Marcos Zampieri. 2016. Findings of the 2016 Conference on Machine Translation. In Proceedings of the First Conference on Machine Translation, pages 131 -- 198, Berlin, Germany. Association for Computa- tional Linguistics. Ondrej Bojar, Rajen Chatterjee, Christian Federmann, Barry Haddow, Matthias Huck, Chris Hokamp, Philipp Koehn, Varvara Logacheva, Christof Monz, Matteo Negri, Matt Post, Carolina Scarton, Lucia Specia, and Marco Turchi. 2015. Findings of the 2015 Workshop on Statistical Machine Translation. In Proceedings of the Tenth Workshop on Statistical Machine Translation, pages 1 -- 46, Lisbon, Portugal. Association for Computational Linguistics. Rajen Chatterjee, M. Amin Farajian, Matteo Negri, Marco Turchi, Ankit Srivastava, and Santanu Pal. 2017. Multi-Source Neural Automatic Post-Editing: FBK's participation in the WMT 2017 APE shared task. In Proceedings of the Second Conference on Machine Translation, Volume 2: Shared Task Pa- pers, pages 630 -- 638, Copenhagen, Denmark. Asso- ciation for Computational Linguistics. Rajen Chatterjee, Matteo Negri, Raphael Rubino, and Marco Turchi. 2018. Findings of the WMT 2018 In Pro- Shared Task on Automatic Post-Editing. ceedings of the Third Conference on Machine Trans- lation, Volume 2: Shared Task Papers, Brussels, Bel- gium. Association for Computational Linguistics. Marcin Junczys-Dowmunt and Roman Grundkiewicz. 2016. Log-linear Combinations of Monolingual and Bilingual Neural Machine Translation Models for Automatic Post-Editing. In Proceedings of the First Conference on Machine Translation, pages 751 -- 758, Berlin, Germany. Marcin Junczys-Dowmunt and Roman Grundkiewicz. 2017. The AMU-UEdin Submission to the WMT 2017 Shared Task on Automatic Post-Editing. In Proceedings of the Second Conference on Machine Translation, Volume 2: Shared Task Papers, pages 639 -- 646, Copenhagen, Denmark. Association for Computational Linguistics. Marcin Junczys-Dowmunt and Roman Grundkiewicz. 2018. MS-UEdin Submission to the WMT2018 APE Shared Task: Dual-Source Transformer for In Proceedings of the Automatic Post-Editing. Third Conference on Machine Translation, Volume 2: Shared Task Papers, pages 835 -- 839, Belgium, Brussels. Association for Computational Linguis- tics. Kevin Knight and Ishwar Chander. 1994. Automated In Proceedings of the Postediting of Documents. Twelfth National Conference on Artificial Intelli- gence (Vol. 1), AAAI '94, pages 779 -- 784, Seattle, Washington, USA. 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 Annual Meeting of the ACL on Interactive Poster and Demonstration Ses- sions, pages 177 -- 180, Prague, Czech Republic. Jindrich Libovick´y, Jindrich Helcl, Marek Tlust´y, Ondrej Bojar, and Pavel Pecina. 2016. CUNI Sys- tem for WMT16 Automatic Post-Editing and Multi- modal Translation Tasks. In Proceedings of the First Conference on Machine Translation, pages 646 -- 654, Berlin, Germany. Association for Computa- tional Linguistics. Matteo Negri, Marco Turchi, Rajen Chatterjee, and Nicola Bertoldi. 2018. ESCAPE: a Large-scale Synthetic Corpus for Automatic Post-Editing. In Proceedings of the Eleventh International Confer- ence on Language Resources and Evaluation (LREC 2018), Miyazaki, Japan. European Language Re- sources Association (ELRA). Tobias Domhan. 2018. How much attention do you need? a granular analysis of neural machine trans- lation architectures. In Proceedings of the 56th An- nual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1799 -- 1808, Melbourne, Australia. Association for Com- putational Linguistics. Jan Niehues, Eunah Cho, Thanh-Le Ha, and Alex Waibel. 2016. Pre-Translation for Neural Machine Translation. In Proceedings of COLING 2016, the 26th International Conference on Computational Linguistics: Technical Papers, pages 1828 -- 1836, Osaka, Japan. The COLING 2016 Organizing Com- mittee. Dusan Varis and Ondrej Bojar. 2017. CUNI System for WMT17 Automatic Post-Editing Task. In Proceed- ings of the Second Conference on Machine Trans- lation, Volume 2: Shared Task Papers, pages 661 -- 666, Copenhagen, Denmark. Association for Com- putational Linguistics. 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 I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Gar- nett, editors, Advances in Neural Information Pro- cessing Systems 30, pages 5998 -- 6008. Curran As- sociates, Inc. Santanu Pal, Nico Herbig, Antonio Krger, and Josef van Genabith. 2018. A Transformer-Based Multi- Source Automatic Post-Editing System. In Proceed- ings of the Third Conference on Machine Transla- tion, Volume 2: Shared Task Papers, pages 840 -- 848, Belgium, Brussels. Association for Computational Linguistics. Santanu Pal, Sudip Kumar Naskar, and Josef van Gen- abith. 2016a. Multi-Engine and Multi-Alignment Based Automatic Post-Editing and Its Impact on In Proceedings of COL- Translation Productivity. ING 2016, the 26th International Conference on Computational Linguistics: Technical Papers, pages 2559 -- 2570, Osaka, Japan. Santanu Pal, Sudip Kumar Naskar, Mihaela Vela, and Josef van Genabith. 2016b. A Neural Network Based Approach to Automatic Post-Editing. In Pro- ceedings of the 54th Annual Meeting of the Associa- tion for Computational Linguistics (Volume 2: Short Papers), pages 281 -- 286, Berlin, Germany. Associa- tion for Computational Linguistics. Kishore Papineni, Salim Roukos, Todd Ward, and Wei- Jing Zhu. 2002. BLEU: A Method for Automatic Evaluation of Machine Translation. In Proceedings of the 40th Annual Meeting on Association for Com- putational Linguistics, ACL '02, pages 311 -- 318, Philadelphia, Pennsylvania. Rico Sennrich, Barry Haddow, and Alexandra Birch. 2016. Neural Machine Translation of Rare Words with Subword Units. In Proceedings of the 54th An- nual Meeting of the Association for Computational Linguistics, ACL 2016, August 7-12, 2016, Berlin, Germany, Volume 1: Long Papers. Jaehun Shin and Jong-Hyeok Lee. 2018. Multi- encoder Transformer Network for Automatic Post- Editing. In Proceedings of the Third Conference on Machine Translation, Volume 2: Shared Task Pa- pers, pages 853 -- 858, Belgium, Brussels. Associa- tion for Computational Linguistics. Matthew Snover, Bonnie Dorr, Richard Schwartz, Lin- nea Micciulla, and John Makhoul. 2006. A study of Translation Edit Rate with Targeted Human Anno- In Proceedings of Association for Machine tation. Translation in the Americas, pages 223 -- 231, Cam- bridge, Massachusetts, USA. TAUS/CNGL Report. 2010. Machine Translation Post- Technical report, Editing Guidelines Published. TAUS. Amirhossein Tebbifakhr, Ruchit Agrawal, Rajen Chat- terjee, Matteo Negri, and Marco Turchi. 2018. Multi-Source Transformer with Combined Losses for Automatic Post Editing. In Proceedings of the Third Conference on Machine Translation, Volume 2: Shared Task Papers, pages 859 -- 865, Belgium, Brussels. Association for Computational Linguis- tics.
1712.01719
2
1712
2019-06-24T22:24:47
Phylogenetics of Indo-European Language families via an Algebro-Geometric Analysis of their Syntactic Structures
[ "cs.CL" ]
Using Phylogenetic Algebraic Geometry, we analyze computationally the phylogenetic tree of subfamilies of the Indo-European language family, using data of syntactic structures. The two main sources of syntactic data are the SSWL database and Longobardi's recent data of syntactic parameters. We compute phylogenetic invariants and likelihood functions for two sets of Germanic languages, a set of Romance languages, a set of Slavic languages and a set of early Indo-European languages, and we compare the results with what is known through historical linguistics.
cs.CL
cs
PHYLOGENETICS OF INDO-EUROPEAN LANGUAGE FAMILIES VIA AN ALGEBRO-GEOMETRIC ANALYSIS OF THEIR SYNTACTIC STRUCTURES KEVIN SHU, ANDREW ORTEGARAY, ROBERT C. BERWICK AND MATILDE MARCOLLI 9 1 0 2 n u J 4 2 ] L C . s c [ 2 v 9 1 7 1 0 . 2 1 7 1 : v i X r a Abstract. Using Phylogenetic Algebraic Geometry, we analyze computationally the phyloge- netic tree of subfamilies of the Indo-European language family, using data of syntactic structures. The two main sources of syntactic data are the SSWL database and Longobardi's recent data of syntactic parameters. We compute phylogenetic invariants and estimates of the Euclidean dis- tance functions for two sets of Germanic languages, a set of Romance languages, a set of Slavic languages and a set of early Indo-European languages, and we compare the results with what is known through historical linguistics. 1. Introduction The use of commutative algebra and algebraic geometry in the study of phylogenetic trees and networks was developed in recent years in the context of biological applications, see [34], [35]. We argue in this paper that these methods have advantages over the other methods of phylogenetic reconstruction, such as Hamming distance and neighborhood joining, when applied to the computational study of phylogenetic trees of world languages based on syntactic data. Computational studies of phylogenetics in Linguistics have been carried out recently in [4], [49], using lexical and morphological data and in [26], [27] using syntactic data. The main advantages of the algebro-geometric approach presented here can be summarized as follows. (1) The use of Phylogenetic Algebraic Geometry to select a best candidate tree avoids some of the well known possible problems (see Chapter 5 of [48]) that can occur in phylogenetic reconstructions based on Hamming distance and neighborhood-joining methods. While such methods were used successfully in phylogenetic inference using syntactic data in [26] and [27], we argue that the geometric methods provide additional useful information, as explained below. (2) Phylogenetic Algebraic Geometry associates an actual geometric object to a best candidate phylogenetic tree T , together with a boundary probability distribution at the leaves P = (pi1...in) derived from the data. This geometric object consists of a pair (VT , xT,P ) of an algebraic variety VT , which depends on the tree topology, and a point xT,P ∈ VT on it, which depends on both the tree T and the boundary distribution P . Unlike what happens with other phylogenetic methods that only provide a best candidate tree T , the geometry (VT , xT,P ) contains more information: the position of the point P on the variety VT encodes information about the distribution of the binary syntactic features across the language family. For example, one can have different language families with topologically equivalent phylogenetic trees. In this case one obtains two different points on the same variety VT whose relative positions encode in a quantitative geometric way the difference between how the evolution of syntactic feature happened historically in the two families. (3) The point xT,P is constrained to lie on the locus of real points VT (R) of the complex alge- braic variety VT , and in particular on the sublocus VT (R+) of nonnegative real coordinates, since it is defined by a probability distribution. In several cases, especially when analyzing 1 2 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI sufficiently small trees, VT turns out to be a classical and well studied algebraic variety, as in the case of the Secant varieties of Segre embeddings of products of projective spaces that we encounter in this paper. In such cases, there are usually well understood and interesting geometric subvarieties of VT and one can gain further insight by understanding when the point xT,P lies on some of these subvarieties, in addition to being contained in the real locus. For example, this may suggest compatibility of the boundary distribution P with respect to certain splitting of the tree into subfamilies and subtrees, which may provide additional information on the underlying historical linguistics. (4) The algebro-geometric method is compatible with admixtures and with phylogenetic net- works that are not necessarily trees. The algebraic varieties involved in this setting are different from the phylogenetic varieties of trees VT discussed here, but they are analyzed with a similar method. Results on topological analysis of data of syntactic structures (see [39]) indicate the presence of nontrivial first homology in certain language families. This can be seen as supporting evidence for the use of networks that are not trees for phy- logenetic analysis. The algebro-geometric formalism necessary to the discussion of more general phylogenetic networks is discussed in [36] and [9]. 1.1. Binary variables and syntactic structure. The idea that the possible syntactic struc- ture of human languages is governed by certain basic binary variables, or syntactic parameters, is one of the fundamental ideas underlying the Principles and Parameters model in linguistics, originally introduced by Chomsky [10], [12]. The notion of syntactic parameter underwent succes- sive theoretical reformulation in the context of more recent minimalist models [11], but the main underlying conceptual idea remains unchanged. A recent detailed overview of the state of ongoing research in comparative generative grammar on the topic of syntactic parameters can be found in the collection of papers in the volume [21]. An introduction to syntactic parameters aimed at a general audience with no prior linguistics background is given in [3]. Interesting questions regarding syntactic parameters include identifying a minimal set of in- dependent variable completely determining a language's syntax and obtaining an explicit and complete description of the dependencies that exist among the known parameters. A rough anal- ogy is that the set of syntactic parameters forms a kind of "basis set" spanning the space of possible human languages (alternatively, grammars, since were are attempting to describe lan- guage structure). Each choice of values for the parameters in this basis set fixes a distinct possible (presumably learnable) human language. Typically, it is assumed that the parameter values can be learned from data available from positive example sentences presented to a language learner (i.e., a child). From a more precise mathematical perspective one can view this as the question of identifying the correct "manifold of syntax" inside a large ambient space of binary variables. These binary variables describing syntactic structures can roughly be thought of as yes/no answers to questions about whether certain constructions are possible in a given language or not. For a more precise description of parameters as instructions for triggering syntactic operations see [42]. There are two existing databases of syntactic structures of world languages that we use in this paper: the SSWL database [51] and the data of syntactic parameters collected by Giuseppe Lon- gobardi and the LanGeLin collaboration. The binary variables recorded in the SSWL database should not be regarded, from the linguistics perspective as genuine syntactic parameters, although they still provide a very useful collection of binary variables describing different features of syntac- tic structures of world languages. The variables recorded in the SSWL database include a set of 22 binary variables describing word order properties, 01 -- Subject Verb,. . ., 22 -- Noun Pronomial Pos- sessor, a set of 4 binary variables A01 -- A04 describing relations of adjectives to nouns and degree ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 3 words, a variable AuxSel01 about the selection of auxiliary verbs, variables C01 -- C04 still related to word order properties on complementarizer and clause and adverbial subordinator and clause, N201 -- N211 variables on properties of numerals, Neg01 -- Neg14 variables on negation, OrderN301 -- OrderN312 on word order properties involving demostratives, adjectives, nouns, and numerals, Q01 -- Q15 regarding the structure of questions, Q16Nega -- Q18Nega and Q19NegQ -- Q22NegQ on answers to negative questions, V201-V202 on declarative and interrogative Verb-Second, w01a -- w01c indefinite mass nouns in object position, w02a -- w02c definite mass nouns in object position, w03a -- w03d indefinite singular count nouns in object position, w04a -- w04c definite singular count nouns in object position, w05a -- w05c indefinite plural count nouns in object position, w06a -- w06c definite plural count nouns in object position, w07a -- w07d nouns with (intrinsically) unique refer- ents in object position, w08a -- w08d proper names in object position, w09a -- w09b order of article and proper names in object position, w10a -- w10c proper names modified by an adjective in object position, w11a -- w11b order of proper names and adjectives in object position, w12a -- w12f order of definite articles and nouns in object position, w20a -- w20e singular count nouns in vocative phrases, w21a -- w21e proper nouns in vocative phrases, w22a -- w22e plural nouns in vocative phrases. A de- tailed description of each of these binary variables can be found on the online site of the SSWL database, [51]. While these are certainly not considered to be an exhaustive list of binary vari- ables associated to syntax, they contain a considerable amount of information on the variability of syntactic structures across languages. The LanGeLin data of Longobardi record a different set of syntactic features, which are indepen- dent of the SSWL data. These variables should be regarded as genuine syntactic parameters and are based on the general Modularized Global Parameterization approach developed by Longobardi [23], [25], that considers reasonably large sets of parameters within a single module of grammar, and their expression across a large number of languages. The LanGeLin data presented in [23] that we use here include 91 parameters affecting the Determiner Phrases structure. The full list of the LanGeLin syntactic parameters used in this paper is reported in Appendix D, reproduced from Appendix A of [20]. Unlike the SSWL data, which do not record any explicit relations between the variables, many explicit relations between the Longobardi syntactic parameters are recorded in the LanGeLin data. A more detailed analysis of the relations in the LanGeLin data is given in [20] and in [33]. In our analysis here we have removed those parameters in the LanGeLin data that are explicitly dependent upon the configuration of other parameters. 1.2. Related Work. A long-standing, familiar approach to linguistic phylogenetics is grounded on the use of lexical (including phonemic) features; see, e.g., [49] for a survey of phylogenetic methods applying such features on a carefully analyzed Indo-European dataset. More recently, other researchers have suggested alternatives to bypass issues with lexical items, such as the non- treelike behavior of lexical diffusion, sometimes rapid and different time scales for lexical change, and the like. For example, Murawaki [31] used linguistic typological dependencies such as word order (OV vs. VO, in the Greenbergian sense) or grammar type (synthetic vs. analytic), in order to build phylogenies over longer time scales and across widely different languages. Murawaki's approach computes latent components from linguistic typological features in the World Atlas of Languages, (WALS) and then feeds these into phylogenetic analysis. Longobardi and colleagues have pursued a detailed linguistically-based analysis of, e.g., Noun Phrases (so-called Determiner structure) across many different Western European languages to develop a fine-grained explicit parametric analysis of what distinguishes each of these languages from the others, see [26] and subsequent work including the more recent [28]. In effect, this is a "hand-tooled" version of a statistical, principal-components like approach. They have used Jacquard distance metrics as the 4 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI measure to feed into conventional distance-based phylogenetic programs. The approach presented in the current work differs from either of these and from other more familiar phylogenetic methods applied to linguistic datasets (such as maximum likelihood or Bayesian approaches) in that it adopts a different approach to the structure of the phylogenetic space itself, rather than relying on conventional methods, while retaining the non-lexical, typological information as the basis for describing the differences among languages. 1.3. Comments on the data sets. The two databases used in our analysis, namely the SSWL database [51] and the recent set of data published by Longobardi and collaborators [23], are cur- rently the only existing extensive databases of syntactic structures of world languages. Therefore any computational analysis of syntax necessarily has to consider these data. In the process of evaluating phylogenetic trees via the algebro-geometric method, we also perform a comparative analysis of the two databases of syntactic variables that we use. As the extended version of the Longobardi dataset has only recently become available [23], a comparative analysis of this dataset has not been previously considered, so the one reported here is novel. Other methods of comparative analysis of these two databases of syntactic structures will be discussed elsewhere. In the cases analyzed here we see specific examples (such as the second set of Germanic languages we discuss) where Longobardi's database appears to be more reliable for phylogenetic reconstructions than the SSWL data, even though the latter dataset is larger. 1.4. Phylogenetics and syntactic data. The use of syntactic data for phylogenetic reconstruc- tion of language families was developed in previous work of Longobardi and collaborators, [26], [27], see also [24], [25]. Computational phylogenetic reconstructions of language family trees based on lexical and morphological data were also obtained in [4], [49]. It is well known that the use of lexical data, in the form of Swadesh lists, is subject to issues related to synonyms, loan words, and false positives, that may affect the measure of proximity between languages. Morphological information is much more robust, but its encoding into binary data is not always straightforward. Syntactic data, on the other hand, are usually classified in terms of binary variables (syntactic parameters), and provide a robust information about language structure. Thus, we believe that syntactic data should be especially suitable for the use of computational methods in historical linguistics. In [45] it was shown that, when using syntactic data of the SSWL database [51] with Hamming distances and neighborhood joining methods to construct linguistic phylogenetic trees, several kinds of errors typically occur. These are mostly due to a combination of two main factors: • the fact that at present the SSWL data are very non-uniformly mapped across languages; • errors propagated by the use of neighborhood-joining algorithms based on the Hamming distance between the strings of syntactic variables recorded in the SSWL data. An additional source of problems is linguistic in nature, namely the existence of languages lying in historically unrelated families that can have greater similarity than expected at the level of their syntactic structures. Another possible source of problems is due to the structure of the SSWL database itself, where the syntactic binary variable recorded are not what linguists would consider to be actual syntactic parameter in the sense of the Principles and Parameters model [10], [12], see also [42]: there are conflations of deep and surface structures that make certain subsets of the syntactic variables of the SSWL data potentially problematic from the linguistic perspective. However, it was also shown in [45] that several of these problems that occur in a naive use of computational phylogenetic methods can be avoided by a more careful analysis. Namely, some preliminary evidence is given in [45] that, when a naive phylogenetic reconstruction applied simultaneously to the entire SSWL database is replaced by a more careful analysis applied to ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 5 smaller groups of languages that are more uniformly mapped in the database, the phylogenetic invariants of Phylogenetic Algebraic Geometry can identify the correct phylogenetic tree, despite the imperfect nature of the SSWL data. The method of Phylogenetic Algebraic Geometry that we refer to here was developed in [34], [35] for applications to mathematical biology, see also a short survey in [5]. In the present paper we focus on certain subfamilies of the Indo-European language family, in particular the Germanic languages, the Romance languages, and the Slavic languages. We apply the Phylogenetic Algebraic Geometry method, by computing the phylogenetic invariants for candidate trees, and the Euclidean distance function. We compare the results obtained by applying this method to the SSWL data and to a more recent set of data of syntactic parameters collected by Longobardi [23], which are a largely extended version of the data previously available in [26]. We list here the specific historical linguistics settings that we analyze in this paper. 1.5. The Germanic family tree. We consider the following two sets of Germanic languages: (1) S1(G) = { Dutch, German, English, Faroese, Icelandic, Swedish } (2) S2(G) = { Norwegian, Danish, Icelandic, German, English, Gothic, Old English }. The first one only consists of modern languages, while in the second one we have included the data of the two ancient languages Gothic and Old English. We analyze the first set S1(G) with the SSWL data, and we analyze the second set first using the new Longobardi data and then using the SSWL data. In both cases we first generate candidate trees using the software package PHYLIP [50], then using the Phylogenetic Algebraic Geometry method we compute the phyloge- netic invariants and an estimate of the Euclidean distance function for these candidate trees and we select the best candidate. For sufficiently small trees one can expect that other methods, including more conventional Bayesian analysis, would be able to identify the correct candidate tree. However, we see here in specific examples that the algebro-geometric method performs at least better than standard phylogenetic packages like PHYLIP when applied to the same data. Given the large number of alternative phylogenetic methods, why use PHYLIP as a baseline? There are two main reasons. First of all, PHYLIP is selected here as an example of a well known and widely used phylogenetic package, hence it is an easy baseline for comparison. Moreover, we use PHYLIP to preselect a set of candidate trees because likewise parsimony method is a standard starting point for Bayesian analysis. Maximum likelihood inference is generally regarded as a more reliable method. However, it is worth pointing out here that a form of likelihood evaluation is already built into the algebro-geometric method. Indeed, the Euclidean distance function is a maximum likelihood estimation, as shown in [13]. A maximum likelihood degree, which counts the critical points of the likelihood function on determinantal varieties, can also be computed, see [22], but only in sufficiently small cases. In this sense then, the method already encompasses a wide variety of the current classes of phylogenetic approaches. We show that, for the set S1(G), the phylogenetic invariants suggest the correct tree among the six candidates generated by PHYLIP, which is confirmed by a form of likelihood computation achieved via the computation of the Euclidean distance. The topology of this tree correctly corresponds to the known historical subdivision of the Germanic languages into West Germanic and North Germanic and the relative proximity of the given languages within these subtrees. In this sense the algebro-geometric method applied to a baseline dataset can be confirmed, always a key step in advancing a novel phylogenetic approach as [49] note. 6 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI For the other set S2(G) of seven languages, which are common to both databases, we also find that the phylogenetic invariants computed on a subset of the Longobardi syntactic data point to the correct best candidate tree, which is confirmed by a lower bound estimate of the Euclidean distance. With the SSWL data the phylogenetic invariants computed with respect to the (cid:96)1 norm still identify the historically correct tree as the best candidate, but not when computed with respect to the (cid:96)∞ norm. This confirms in our setting a general observation of [6] on te better reliability of the (cid:96)1 norm in the computation of phylogenetic invariants. We see here an example where the lower bound on the Euclidean distance correctly excludes some of the candidates, but fails to assign the smallest lower bound to the best tree. This different behavior of the Longobardi and the SSWL data on this set of languages presumably reflects the presence of a large number of dependencies in the SSWL variables. In the last section of the paper we discuss a possible issue of the direct application of this algebraic phylogenetic method to syntax, which is caused by neglecting relations between syntactic parameters and treating them, in this model, like independent random variables. We suggest possible ways to correct for these discrepancies, which will be analyzed in future work. We expect that such discrepancies may be resolved by a better approach taking syntactic relations into account. 1.6. The Romance family tree. The case of the Romance languages is an interesting example of the limitations of these methods of phylogenetic reconstructions. We considered as set of languages Latin, Romanian, Italian, French, Spanish, and Portugues, and we used a combination of the SSWL and the Longobardi data, which are independent sets of data. We find that PHYLIP produces a unique candidate tree, which is however not the one that is considered historically correct. We compute the phylogenetic invariants and the Euclidean distance for both the PHYLIP tree and the historically correct tree. The phylogenetic invariants computed with respect to the (cid:96)1 norm identify the historically correct tree as the favorite candidate, while they do not give useful information when computed in the (cid:96)∞ norm. The estimate of the Euclidean distance also favors the historically correct tree over the PHYLIP candidate tree. 1.7. The Slavic family tree. We also analyze with the same method the phylogenetic tree of a group of Slavic languages for which we use a combination of SSWL data and the data of [26]: Russian, Polish, Slovenian, Serb-Croatian, Bulgarian. For this set of languages, PHYLIP applied to the combined syntactic data produces five candidate trees with inequivalent topologies. Using the phylogenetic invariants computed with the (cid:96)1 norm we identify the historically correct tree as the best candidate, while the computation in the (cid:96)∞ norm does not select a unique best candidate. The lower bound estimate of the Euclidean distance also correctly selects the linguistically accurate tree. 1.8. The early Indo-European branchings and the Indo-European controversy. The use of computational methods in historical linguistics has been the focus of considerable attention, and controversy, in recent years, due to claims made in the papers [17], [7] regarding the phylogenetic tree of the Indo-European languages, based on a computational analysis of trees obtained from distances between binary data based on lexical lists and cognate words. While this method of computational analysis of language families has been considered in various contexts (see [16] for a collection of contributions), the result announced in [17], [7] appeared to contradict several results obtained by historical linguists by other methods, hence the ensuing controversy, see [38]. For comparison, a different reconstruction of the Indo-European tree, carried out by computational methods that incorporate lexical, phonological, and morphological data, was obtained by Ringe, ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 7 Warnow, and Taylor [41]. Neither of these computational analysis makes any use of syntactic data about the Indo-European languages. We focus here on some specific issues that occur in the phylogenetic tree of [7] compared with that of [41]: • The relative positions of the Greco-Armenian subtrees; • The position of Albanian in the tree; • The relative positions of these languages with respect to the Anatolian-Tocharian subtrees. This means that we neglect several other branches of the Indo-European tree analyzed in [7] and in [41] and we focus on a five-leaf binary tree with leaves corresponding to the languages: Hittite, Tocharian, Albanian, Armenian, and Greek. We will consider the tree topologies for this subset of languages resulting from the trees of [7] and [41] and we will select between them on the basis of Phylogenetic Algebraic Geometry. The set of languages considered here (Hittite, Tocharian, Albanian, Armenian, Greek) are listed in the SSWL database [51], while not all of them are present in the Longobardi data [23]. Thus, in this case we have to base our analysis on the SSWL data. With the exception of Armenian and Greek, which are extensively mapped in the database, the remaining languages (especially Tocharian and Hittite) are very poorly mapped, and the set of parameters that are completely mapped for all of them is very small, hence the resulting analysis should not be considered very reliable, due to this significant problem. Nonetheless, we compute the phylogenetic invariants for the Gray-Atkins tree and for the Ringe -- Warnow -- Taylor tree and we also compute the Euclidean distance function to the relevant phylo- genetic algebraic variety. We find that, while the evaluation of the phylogenetic invariants with the (cid:96)∞ norm does not give useful information, the evaluation in the (cid:96)1 norm favors the linguisti- cally more accurate Ringe -- Warnow -- Taylor tree. Similarly the estiimate of the Euclidean distance selects the same Ringe -- Warnow -- Taylor tree. The Gray-Atkins tree is not the one generally agreed upon by linguists, while the Ringe -- Warnow -- Taylor tree is considered linguistically more reliable. A more recent discussion of the early Indo-European tree, which is also considered linguistically very reliable, can be found in [2]. However, the part of the tree of [2] that we focus on here agrees with the one of [49] (though the position of Albanian is not explicitly discussed in [2]), hence we refer to [49] in our analysis. 2. Phylogenetic Algebraic Varieties and Invariants Before we proceed to the analysis of the two sets of languages listed above, we recall briefly the notation and the results we will be using from Phylogenetic Algebraic Geometry, see [1], [34], [35]. We also discuss the limits of the applicability of this method to syntactic data of languages and some approaches to improve the method accordingly. In order to apply the algebro-geometric approach, we think of each binary syntactic variable as a dynamical variable governed by a Markov process on a binary tree. These binary Markov processes on trees generalize the Jukes -- Cantor model, in the sense that they do not necessarily assume a uniform distribution at the root of the tree. The model parameters (π, M e) consist of a probability distribution (π, 1 − π) at the root vertex (the frequency of expression of the 0 and 1 values of the syntactic binary variables at the root) and bistochastic transition matrices along the edges. M e = (cid:18)1 − pe pe (cid:19) pe 1 − pe 8 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI For a binary tree with n leaves, the boundary distribution P = (pi1,...,in) counts the frequencies of the occurrences of binary vectors (i1, . . . , in) ∈ {0, 1}n of values of the binary syntactic variables for the languages {(cid:96)1, . . . , (cid:96)n} at the leaves of the tree. If N is the total number of syntactic binary variables available in the database (counting only those that are completely mapped for all the n languages consdiered) and ni1,...,in is the number of occurrences of the binary vector (i1, . . . , in) in the list of values of the N syntactic variables for these n languages, then the frequencies in P are given by The boundary distribution is a polynomial function of the model parameters (2.1) pi1,...,in = Φ(π, M e) = πwvr M e ws(e),wt(e) , pi1,...,in = ni1,...,in . N (cid:88) wv∈{0,1} (cid:89) e with a sum over "histories", that is, paths in the tree. This determines a polynomial map of affine spaces (2.2) where 4n − 5 is the number of model parameters for a binary tree T with n-leaves and binary variables. Dually, the kernel of the map of polynomial rings ΦT : A4n−5 → A2n, (2.3) defines the phylogenetic ideal IT . This corresponds geometrically to the phylogenetic algebraic variety VT . ΨT : C[zi1,...,in] → C[x1, . . . , x4n−5] It is proved in [1] that, for these Markov models on trees with binary variables that generalize the Jukes -- Cantor model, the phylogenetic ideal IT is generated by all the 3 × 3-minors of all the flattenings of the tensor P = (pi1,...,in). There is one such flattening for each internal edge of the binary tree, where each internal edge corresponds to a subdivision of the leaves into a disjoint union of two sets of cardinality r and n− r. The flattening is a 2r × 2n−r matrix defined by setting (2.4) Flate,T (P )(u, v) = P (u1, . . . , ur, v1, . . . , vn−r), where P is the boundary distribution. The terminology corresponds to the fact that an n-tensor P is "flattened" into a collection of 2-tensors (matrices). These generators of the phylogenetic ideal can then be used as a test for the validity of a candidate phylogenetic tree. If the tree is a valid phylogenetic reconstruction, then the boundary distribution P = (pi1,...,in) should be a zero of all the polynomials in the phylogenetic ideal (or very close to being a zero, allowing for a small error margin). In the case of the binary Jukes -- Cantor model, where one assumes a uniform root distribution, there are additional invariants, as shown in [47]. For the purpose of linguistic applications it is more natural to work with the general binary Markov models described above, where the root distribution (π, 1 − π) is not assumed to be uniform, than with the more restrictive Jukes -- Cantor model. Indeed, there is no reason to assume that parameters at the root of a language phylogenetic tree would have equal frequency of expression of 0 and 1: the overall data on all languages, ancient and modern, contained in the available database show a clear prevalence of parameters that are expressed (value 1) rather than not. (This point was discussed in some detail in [46].) ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 9 2.1. Phylogenetic Invariants. The generators φT of the phylogenetic ideal IT are given by the Allman -- Rhodes theorem [1] by all the 3 × 3-minors det(M ) of the flattening matrices Flate,T . To every candidate tree, one can also associate a computation of a discrepancy that measures how much the polynomials φT fail to vanish at the point P . This can be done using different kinds of norms. Generally, one can use either the (cid:96)∞ norm and obtain an expression of the form (cid:107)φT (P )(cid:107)(cid:96)∞ = max e∈E(T ), M (P )⊂Flate,T (P ),3×3−minor det(M (P )), which we write equivalently in the following as (cid:107)φT (P )(cid:107)(cid:96)∞ = φ∈3×3−minors of Flate,T (P ) max φ(P ), where the expression φ(P ) stands for the absolute value of the determinant of the 3 × 3-minor. It is also natural to use the (cid:96)1 norm and compute (cid:88) (cid:88) (cid:107)φT (P )(cid:107)(cid:96)1 = det(M (P )), e∈E(T ), M (P )⊂Flate,T (P ),3×3−minor (cid:107)φT (P )(cid:107)(cid:96)1 = φ(P ). φ∈3×3−minors of Flate,T (P ) equivalently written in the rest of the paper as One can expect that the (cid:96)∞ norm will be a very weak invariant, because taking the maximum loses a lot of information contained in the phylogenetic invariants φT (P ). Indeed, this turns out to be the case. As analyzed in detail in [6], the (cid:96)1 norm is a more refined and reliable way to identify best phylogenetic trees on the basis of the computation of phylogenetic invariants than the (cid:96)∞ norm. We will see several explicit examples in the following sections where the (cid:96)∞ norm does not provide useful information to identify the correct candidate tree, while the (cid:96)1 norm of the phylogenetic invariants correctly identifies the unique best candidate tree. Once the best candidate tree is identifies, the value of these discrepancy measures (cid:107)φT (P )(cid:107)(cid:96)∞ and (cid:107)φT (P )(cid:107)(cid:96)1 for that tree (which is in general small but non-zero) can be regarded as a possible quantitative measure of how much the observed distribution P of the syntactic parameters for the languages at the leaves of the candidate tree T differ from a distribution obtained by the evolution of identically distributed independent random variables evolving according to a Markov model on the tree. Since one of the important points we wish to investigate is how relations between syntactic parameters affect their behavior as random variables in dynamical models of language change and evolution, we will regard these quantities as one of the numerical indicators of the discrepancy from the standard independent identically distributed (i.i.d.) Markov model assumption. The presence of dependencies between syntactic parameters is expected to cause deviations from the dynamics of an actual i.i.d. Markov model While we do not analyze in the present paper how possible models of parameter dependencies affect the dynamics and may be reflected in the value of such invariants, we intend to return to this investigation in future work. 2.2. Likelihood estimate: Euclidean distance. As a way to compare different candidate trees and select the best possible candidate, one can use the Euclidean distance, in an ambient affine space, between the point P given by the boundary distribution and the variety VT associated to the candidate tree T . The tree realizing the smallest distance will be the favorite candidate. As we discuss explicitly in §§3.6, 3.11, the computation of the distance to VT can be estimated in terms of distances of some of the flattening matrices of T to certain Segre and Secant varieties, namely determinantal varieties of rank one and two. In some particular case, like the first set of 10 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI Germanic languages we analyze, the lower bound estimate obtained in this way is sharp, under a conditional assumption, which we discuss more in detail in §2.3 below. We compute the Euclidean distances of the flattening matrices from the corresponding deter- minantal varieties using the Eckart -- Young theorem, as shown in Example 2.3 of [13], see also [34]. The Eckart -- Young theorem describes a low-rank approximation problem, namely minimizing the Euclidean distance (cid:107)M − M(cid:48)(cid:107) between a given n × m matrix M , seen as a vector in Rnm, and an n × m matrix M(cid:48) with rank(M(cid:48)) ≤ k, for a given k ≤ n ≤ m. One considers the singular decomposition M = U ΣV where Σ is an n × m diagonal matrix Σ = diag(σ1, . . . , σn) and σ1 ≥ σ2 ≥ ··· ≥ σn ≥ 0, and where U and V are, respectively n × n and m × m orthogonal matrices. Then the minimum of the distance (cid:107)M − M(cid:48)(cid:107) is realized by M(cid:48) = U Σ(cid:48)V where Σ(cid:48) = diag(σ1, . . . , σk, 0, . . . , 0) with the distance given by M(cid:48) (cid:107)M − M(cid:48)(cid:107) = ( min σ2 i )1/2. n(cid:88) i=k+1 This can equivalently be stated as the fact that the minimum distance between a given n × m matrix M and the determinantal variety Dk(n, m) of n × m matrices of rank ≤ k is given by (2.5) where the σi are the singular values of M . The point M(cid:48) realizing the minimum is unique iff σk+1 (cid:54)= σk, with k the rank, [30]. dist(M,Dk(n, m)) = (cid:107)(σk+1, . . . , σn)(cid:107), 2.3. Conditional cases and distance estimates. In the specific examples we discuss below, we usually consider a list of pre-selected candidate trees, obtained via the use of the PHYLIP package and among them we test for the most reliable candidate using the algebro-geometric methods discussed here. Unlike the case where the search happens over all possible interpolating binary trees, in these cases the pre-selected tree tend to all agree on certain proximity assignments of some of the leaves. For example, in the first set of Germanic languages that we discuss below, all the candidate trees agree on the proximity of Dutch and German and on the proximity of Icelandic and Faroese, though they disagree in the relative placements of these subtrees with respect to the other languages in the set. This agreement among the candidate trees results in two of the flattening matrices being common to all of the candidates. In a situation like this one it is reasonable to consider a "conditional case" where we assume that the incidence condition that these common flattenings lie on the respective determinantal varieties already holds. We then aim at identifying the best candidate tree among those with these constraints already assumed. In our implementation this means that, instead of estimating the Euclidean distance of the point P from certain intersections Vk ∩ W of subvarieties of the ambient projective space, and searching for a minimum among the distances mink dist(P, Vk ∩ W ), we assume that it is established that the point already lies on a certain subvariety, P ∈ W , as the effect of the agreement of all the candidate trees on certain proximity conditions, and we estimate the minimum mink dist(P, Vk). While in general an estimate dist(P, V1) < dist(P, V2) would obviously not imply that one also has dist(P, V1 ∩ W ) < dist(P, V2 ∩ W ), if the incidence P ∈ W is known, then evaluating and minimizing dist(P, Vk) suffices. We will see that this method provides reliable results in the cases we analyze. This method provides an evaluation of the Euclidean distance dist(P, VT ) in the case of the first set of Germanic languages that we analyze, since in that case two out of three flattenings are common to all trees. In the other cases we consider, where there isn't so much common ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 11 agreement between the candidate trees, we can use a similar method, but this will only provide us with a rough lower bound on the Euclidean distance dist(P, VT ). Indeed, we simply obtain an estimate using the fact that the lower bound dist(P, V ∩ W ) ≥ max{dist(P, V ), dist(P, W )}, for two subvarieties V, W in the same ambient space. Since this is only a lower bound, which is in general not expected to be sharp, one can at best hope to use this estimate to exclude candidates for which the computed max{dist(P, V ), dist(P, W )} is large (within the set of given candidates), while a small value of this maximum will not necessarily imply that the corresponding candidate is optimal as dist(P, V ∩ W ) could easily be significantly larger. We see however that in many cases this lower bound suffices to exclude most candidates hence it provides a useful estimate. A more general theoretical discussion of these estimation methods and their range of validity, compared to other phylogenetic invariants and tree reconstruction algorithms (such as discussed in [6], [14], [43]) will be discussed elsewhere, separately from the present application, since they are not restricted to the specific linguistic setting considered here. 2.4. Limits of applicability to Syntax. One of the purposes of this paper is also to better understand the limits of the applicability of these phylogenetic models to syntactic data. One of the main assumptions that need to be more carefully questioned is treating syntactic parameters as i.i.d. random variables evolving under the same Markov model on the tree. We know that there are relations between syntactic parameters. While the complete structure of the relations is not known, and is in fact one of the crucial questions in the field, one can detect the presence of relations through various computational methods applied to the available syntactic data. In [29] and [44], a quantitative test was devised, aimed at measuring how the distribution of syntactic parameters over a group of languages differs from the result of i.i.d. random variables. Using coding theory, one associates a binary code to the set of syntactic parameters of a given group of languages and computes the position of the resulting code in the space of code param- eters (the relative rate of the code and its relative minimum distance). If the distribution of the syntactic features across languages were the effect of an evolution of identically distributed inde- pendent random variables, one would expect to find the code points in the region of the space of code parameters populated by random codes in the Shannon random code ensembles, that is, in the region below the Gilbert -- Varshamov curve. However, what one finds (see [44]) is the pres- ence of many outliers that are not only above the Gilbert -- Varshamov curve, but even above the symptotic bound and the Plotkin bound. This provides quantitative evidence for the fact that the evolutionary process that leads to the boundary distribution P of code parameters may differ significantly from the hypothesis of the phylogenetic model. In [37] it was shown, using Kanerva networks, that different syntactic parameters in the SSWL database have different degrees of recoverability, which can be seen as another numerical indicator of the presence of relations, with parameters with lower recoverability counting as closer to being truly independent variables and those with higher recoverability seen as dependent variables. One possible modification of the evolutionary model on the phylogenetic tree may then be obtained by computing the observed distribution P at the leaves, by introducing different weights for the different parameters, which depend on the recoverability factor, so that parameters that are more likely to be independent variables would weight more in determining the boundary distribution and parameters that have higher recoverability, and are therefore considered dependent variables, would contribute less to determining P . A further issue worth mentioning, though we will not discuss it in this paper, is whether the hypothesis that the evolutionary dynamics happens on a tree is the best model. There are more general phylogenetic reconstruction techniques based on graphs that are not trees, see [18] and the algebro-geometric models in [9]. It was shown in [39] that the persistent topology of the SSWL 12 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI data of some language families (the Indo-European) contain non-trivial persistent generators of the H1 homology group. While the persistent generators of H0 appear to be related to the structure of a candidate phylogenetic tree, the presence of a persistent H1 points to the presence of loops, hence to graphs that are not trees. Persistent generators of the H1 are also visible in the Longobardi data. This will be further discussed in [40]. We discuss some possible modifications of the evolutionary Markov model on the tree in the last section of the paper. 3. Phylogenetic Algebraic Varieties of the Germanic language family As discussed in the Introduction, we first analyze the phylogenetic tree for the set of Germanic languages S1(G): Dutch, German, English, Faroese, Icelandic, and Swedish. These six languages are mapped with different levels of accuracy in the SSWL database: we have Dutch (100%), German (75%), English (75%), Faroese (62%), Icelandic (62%), Swedish (75%). There are 90 syntactic variables that are completely mapped for all of these six languages: the list is reported in Appendix A. We will use only these 90 variables for the analysis carried out here. We then consider the set S2(G) consisting of seven Germanic languages: Norwegian, Danish, Icelandic, German, English, Gothic, Old English. These are chosen so that they are covered by both the SSWL database [51] and the new data of Longobardi [23], and so that they contain some ancient languages, in addition to modern languages situated on both the West and the North Germanic branches. In this way we can test both the effect of using different syntactic data and the effect of including ancient languages and their relation to problem of the location of the root vertex mentioned above. The Germanic languages in the set S2(G) have a total of 68 SSWL variables that are completely mapped for all the seven languages in the set. This is significantly smaller than the 90 variables used for the set S1(G). This does not depend on the languages being poorly mapped: the levels of accuracy are comparable with the previous set with Danish (76%), Norwegian (75%), German (75%), English (75%), Old English (75%) Icelandic (62%), Gothic (62%). However, the regions of the overall 115 SSWL variables that are mapped is less uniform across this set of languages creating a smaller overlap. The set of completely mapped SSWL variables for this set of languages is reported in Appendix B. 3.1. Candidate PHYLIP trees. When using the full but incomplete data for the six Germanic languages in S1(G), we obtain with PHYLIP a list of six candidate phylogenetic trees, respectively given (in bracket notation) by pars1 = (((cid:96)1, (cid:96)2), ((cid:96)3, ((cid:96)4, (cid:96)5)), (cid:96)6) pars2 = (((cid:96)3, ((cid:96)1, (cid:96)2)), ((cid:96)4, (cid:96)5), (cid:96)6) pars3 = ((cid:96)3, (((cid:96)1, (cid:96)2), ((cid:96)4, (cid:96)5)), (cid:96)6) bnb1 = ((cid:96)6, (((cid:96)5, (cid:96)4), ((cid:96)3, ((cid:96)2, (cid:96)1)))) bnb2 = ((cid:96)6, ((((cid:96)5, (cid:96)4), (cid:96)3), ((cid:96)1, (cid:96)2))) bnb3 = ((cid:96)6, ((((cid:96)5, (cid:96)4), ((cid:96)1, (cid:96)2)), (cid:96)3)) where (cid:96)1 =Dutch, (cid:96)2 =German, (cid:96)3 =English, (cid:96)4 =Faroese, (cid:96)5 =Icelandic, (cid:96)6 =Swedish. The Newick representation of binary trees used by PHYLIP lists the leaves in the order specified by the choice of a planar embedding of the tree, with brackets and commas indicating the joining together of branches. In the rest of the paper, for convenience, we will spell out explicitly the form ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 13 of the tree graphically, rather than writing them in the Newick bracket notation. In the case of the trees listed here we obtain the following. The trees pars1, pars2, and pars3 given above in the Newick representation have the form (cid:96)1 (cid:96)2 (cid:96)3 (cid:96)4 (cid:96)5 (cid:96)6 (cid:96)3 (cid:96)1 (cid:96)2 (cid:96)4 (cid:96)5 (cid:96)6 (cid:96)3 (cid:96)6 (cid:96)1 (cid:96)2 (cid:96)4 (cid:96)5 Note that pars1 is a binary tree, while pars2 and pars3 are not binary trees. We will discuss how to resolve the non-binary structure. The remaining trees bnb1, bnb2, and bnb3 are binary trees of the form (cid:96)6 (cid:96)5 (cid:96)4 (cid:96)3 (cid:96)2 (cid:96)1 (cid:96)6 (cid:96)5 (cid:96)4 (cid:96)3 (cid:96)1 (cid:96)2 (cid:96)6 (cid:96)3 (cid:96)5 (cid:96)4 (cid:96)1 (cid:96)2 Note how all of these candidate trees agree on the proximity of Dutch and German ((cid:96)1 and (cid:96)2) and of Faroese and Icelandic ((cid:96)4 and (cid:96)5), while they differ in the relative placement of these two pairs with respect to one another and with respect to the two remaining languages, English and Swedish. In phylogenetic linguistics the presence of a non-binary tree denotes an ambiguity, which should eventually be resolved into one of its possible binary splittings. As shown in [15], the phylogenetic algebraic variety of a non-binary tree can be seen as the intersection of the phylogenetic algebraic varieties of all of its possible binary splittings. Thus, the phylogenetic ideal (for the binary Jukes- Cantor model) is generated by all the 3 × 3 minors of all the flattening matrices of all the binary splittings of the given non-binary tree. Being the intersection of the varieties defined by each of the binary splittings corresponds exactly to the notion of ambiguity mentioned above. The resolution of a non-binary structure of the type shown in pars2 and pars3 is obtained by replacing the first tree below with the different possibilities given by its three possible binary splittings that follow: A B C A B C A B C A C B Thus, for the tree pars2 we obtain the three binary trees (cid:96)3 (cid:96)1 (cid:96)2 (cid:96)4 (cid:96)5 (cid:96)6 (cid:96)6 (cid:96)3 (cid:96)1 (cid:96)2 (cid:96)4 (cid:96)5 (cid:96)4 (cid:96)5 (cid:96)6 (cid:96)3 (cid:96)1 (cid:96)2 Note, however, that these three binary trees are equivalent up to a shift in the position of the root, which however does not affect the phylogenetic invariants, see [1] and Proposition 2.16 in [5]. Thus, we need only consider one of them for the purpose of computing the generators of the phylogenetic ideal. For the tree pars3 we obtain the three binary trees (cid:96)3 (cid:96)6 (cid:96)3 (cid:96)1 (cid:96)2 (cid:96)4 (cid:96)5 (cid:96)1 (cid:96)2 (cid:96)4 (cid:96)5 (cid:96)6 (cid:96)3 (cid:96)6 (cid:96)1 (cid:96)2 (cid:96)4 (cid:96)5 Again these three binary trees only differ by a shift of the position of the root, which does not affect the computation of the phylogenetic invariants, hence we need only consider one of them for that purpose. Notice, moreover, that the binary tree bnb1 is the same as the second binary 14 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI tree for pars2. Also the tree bnb2 has the same topology as the tree pars1, up to a shift in the position of the root, which does not affect the phylogenetic invariants. Similarly, the tree bnb3 is the same as the second binary tree of pars3. All of the binary trees considered here have three internal edges, hence all of them have three flattenings Flate(P ) of the boundary distribution P = (pi1,...,i6). • The flattenings for pars1 are given by a 4× 16 matrix Flate1(P ), an 8× 8 matrix Flate2(P ) and a 16 × 4 matrix Flate3(P ). These correspond to the separating the leaves into two components when deleting the internal edge ei according to • The flattenings for any of the three binary trees for pars2 are also given by a 4× 16 matrix Flate1(P ), an 8 × 8 matrix Flate2(P ) and a 16 × 4 matrix Flate3(P ), which in this case correspond to the subdivisions e1 : {(cid:96)1, (cid:96)2} ∪ {(cid:96)3, (cid:96)4, (cid:96)5, (cid:96)6} e2 : {(cid:96)1, (cid:96)2, (cid:96)6} ∪ {(cid:96)3, (cid:96)4, (cid:96)5} e3 : {(cid:96)1, (cid:96)2, (cid:96)3, (cid:96)6} ∪ {(cid:96)4, (cid:96)5}. e1 : {(cid:96)1, (cid:96)2} ∪ {(cid:96)3, (cid:96)4, (cid:96)5, (cid:96)6} e2 : {(cid:96)1, (cid:96)2, (cid:96)3} ∪ {(cid:96)4, (cid:96)5, (cid:96)6} e3 : {(cid:96)1, (cid:96)2, (cid:96)3, (cid:96)6} ∪ {(cid:96)4, (cid:96)5}, which only differ from the previous case in the e2 flattening. • The flattenings for any of the three binary trees for pars3 are given by a 4 × 16 matrix Flate1(P ), a 16 × 4 matrix Flate2(P ) and a 16 × 4 matrix Flate3(P ), which correspond to the subdivisions e1 : {(cid:96)1, (cid:96)2} ∪ {(cid:96)3, (cid:96)4, (cid:96)5, (cid:96)6} e2 : {(cid:96)1, (cid:96)2, (cid:96)3, (cid:96)6} ∪ {(cid:96)4, (cid:96)5} e3 : {(cid:96)1, (cid:96)2, (cid:96)4, (cid:96)5} ∪ {(cid:96)3, (cid:96)6}. the same. • The bnb1 tree is the same as one of binary trees for pars2, hence their flattenings are also • The flattenings for bnb2 are the same as the flattening of pars1, since the two tree differ • The bnb3 tree is the same as one of binary trees for pars3, hence their flattenings are also only by a shift in the position of the root vertex. the same. Thus, in order to compare the phylogenetic invariants of these various trees, we need to compute the 3 × 3 minors of the matrices Flate(P ) for the splittings {(cid:96)1, (cid:96)2} ∪ {(cid:96)3, (cid:96)4, (cid:96)5, (cid:96)6}, {(cid:96)1, (cid:96)2, (cid:96)6} ∪ {(cid:96)3, (cid:96)4, (cid:96)5}, {(cid:96)1, (cid:96)2, (cid:96)3, (cid:96)6}∪{(cid:96)4, (cid:96)5}, {(cid:96)1, (cid:96)2, (cid:96)3}∪{(cid:96)4, (cid:96)5, (cid:96)6}, {(cid:96)1, (cid:96)2, (cid:96)4, (cid:96)5}∪{(cid:96)3, (cid:96)6}. We will compute these in the next subsection. 3.2. Flattenings. As discussed above, there are five matrices Flate(P ) that occur in the com- putation of the phylogenetic ideals of the candidate phylogenetic trees listed above. In fact, we do not need to compute all of them, as some occur in all the trees, hence do not contribute to distinguishing between them. This corresponds to the observation we already made above, that all the candidate trees agree on the proximity of (cid:96)1 and (cid:96)2 and of (cid:96)4 and (cid:96)5. • The 4× 16 matrix Flat{(cid:96)1,(cid:96)2}∪{(cid:96)3,(cid:96)4,(cid:96)5,(cid:96)6}(P ), contributes to the phylogenetic ideals of all the trees, hence it will not help discriminate between them. • The same is true about the 16 × 4 matrix Flat{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)6}∪{(cid:96)4,(cid:96)5}(P ). ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 15 • The 8×8 matrix Flat{(cid:96)1,(cid:96)2,(cid:96)6}∪{(cid:96)3,(cid:96)4,(cid:96)5}(P ) contributes to the phylogenetic invariants of pars1 and bnb2. It is given by • The 8×8 matrix Flat{(cid:96)1,(cid:96)2,(cid:96)3}∪{(cid:96)4,(cid:96)5,(cid:96)6}(P ) contributes to the phylogenetic invariants of pars2 and bnb1 and it is given by • The 16 × 4 matrix Flat{(cid:96)1,(cid:96)2,(cid:96)4,(cid:96)5}∪{(cid:96)3,(cid:96)6}(P ) contributes to the phylogenetic invariants of pars3 and bnb3 and is given by   p000000 p000100 p001000 p001100 p000010 p000110 p001010 p001110 p010000 p010100 p011000 p011100 p010010 p010110 p011010 p011110 p100000 p100100 p101000 p101100 p100010 p100110 p101010 p101110 p110000 p110100 p111000 p111100 p110010 p110110 p111010 p111110 p000001 p000101 p001001 p001101 p000011 p000111 p001011 p001111 p010001 p010101 p011001 p011101 p010011 p010111 p011011 p011111 p100001 p100101 p101001 p101101 p100011 p100111 p101011 p101111 p110001 p110101 p111001 p111101 p110011 p110111 p111011 p111111 p000000 p000010 p000100 p000110 p000001 p000011 p000101 p000111 p010000 p010010 p010100 p010110 p010001 p010011 p010101 p010111 p100000 p100010 p100100 p100110 p100001 p100011 p100101 p100111 p110000 p110010 p110100 p110110 p110001 p110011 p110101 p110111 p001000 p001010 p001100 p001110 p001001 p001011 p001101 p001111 p011000 p011010 p011100 p011110 p011001 p011011 p011101 p011111 p101000 p101010 p101100 p101110 p101001 p101011 p101101 p101111 p111000 p111010 p111100 p111110 p111001 p111011 p111101 p111111    p000000 p000001 p001000 p001001 p010000 p010001 p011000 p011001 p100000 p100001 p101000 p101001 p110000 p110001 p111000 p111001 p000010 p000011 p001010 p001011 p010010 p010011 p011010 p011011 p100010 p100011 p101010 p101011 p110010 p110011 p111010 p111011 p000100 p000101 p001100 p001101 p010100 p010101 p011100 p011101 p100100 p100101 p101100 p101101 p110100 p110101 p111100 p111101 p000110 p000111 p001110 p001111 p010110 p010111 p011110 p011111 p100110 p100111 p101110 p101111 p110110 p110111 p111110 p111111  3.3. Boundary distribution and phylogenetic invariants. Next we compute the boundary distribution P = (pi1,...,i6) of the syntactic variables. We use only the 90 completely mapped syntactic variables, for which we find occurrences n110111 = 3 n000011 = 1 n000010 = 4 n000000 = 40 n110000 = 2 n001110 = 1 n000100 = 2 n111111 = 22 n111110 = 1 n000110 = 1 n111101 = 3 n100000 = 2 n010000 = 1 n111001 = 2 n110110 = 1 n010111 = 1 n001000 = 2 n000111 = 1 while all the remaining cases do not occur, ni1,...,i6 = 0 for (i1, . . . , in) not in the above list.   4 9 1 90 1 45 1 45 0 0 0 0 4 9 1 90 1 45 1 45 1 45 0 0 0 F1 = F2 = F3 = 16 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI With the boundary distribution determined by the occurrences above the three matrices of F 1 = Flat{(cid:96)1,(cid:96)2,(cid:96)6}∪{(cid:96)3,(cid:96)4,(cid:96)5}(P ), F2 = Flat{(cid:96)1,(cid:96)2,(cid:96)3}∪{(cid:96)4,(cid:96)5,(cid:96)6}(P ), and F3 = Flat{(cid:96)1,(cid:96)2,(cid:96)4,(cid:96)5}∪{(cid:96)3,(cid:96)6}(P ) are, respectively, given by   1 45 0 0 0 0 0 0 0 2 45 0 0 0 0 0 0 0  1 90 0 0 1 90 0 0 0 11 45 1 90 1 90 0 1 30 0 0 0 11 45 1 45 0 0 0 0 0 0 1 45 1 45 0 0 0 0 0 0 0 4 9 1 90 1 45 1 45 2 45 0 0 0 1 45 0 0 0 1 90 0 0 1 90 0 0 0 0 0 0 0 1 30 1 90 0 0 1 90 1 90 0 0 1 90 0 0 0 0 1 90 0 0 0 0 0 0 0 1 90 1 90 0 1 30 2 45 0 0 0 1 90 0 0 0 0 0 0 0 0 0 0 1 45 1 45 0 0 0 0 0 0 0 0 0 0 0 1 90 0 0 1 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 30  1 90 0 0 1 90 1 90 1 90 0 1 30 1 90 0 0 0 0 0 0 0 0 0 0 1 45 0 0 0 0 0 0 0 1 30 0 0 0 11 45 3.4. Phylogenetic invariants. As we discussed above, the flattening matrices Flat{(cid:96)1,(cid:96)2}∪{(cid:96)3,(cid:96)4,(cid:96)5,(cid:96)6}(P ) and Flat{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)6}∪{(cid:96)4,(cid:96)5}(P ) occur in all the candidate trees, hence they do not discriminate between the given candidates (pre- selected by PHYLIP). Thus it is reasonable to proceed by assuming that the condition that these two flattenings lie on the corresponding determinantal varieties is satisfied and only discriminate between the candidate trees on the basis of the position of the remaining flattenings. There is only one additional flattening involved in each tree, once these common ones are excluded. Thus, we estimate the phylogenetic invariants by evaluating the 3× 3 minors of the remaining flattening matrix for each of the trees, using both the (cid:96)∞ and the (cid:96)1 norm. We obtain the following: (1) For the tree pars1 (and equivalently bnb2) we have (cid:107)φT1(P )(cid:107)(cid:96)∞ = max φ∈3×3 minors of F1 φ(P ) = 22 18225 (cid:88) (cid:107)φT1(P )(cid:107)(cid:96)1 = φ(P ) = 3707 364500 ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 17 φ∈3×3 minors of F1 (2) For the tree pars2 (equivalently bnb1) we have (cid:107)φT2(P )(cid:107)(cid:96)∞ = (cid:107)φT2(P )(cid:107)(cid:96)1 = φ∈3×3 minors of F2 max (cid:88) φ∈3×3 minors of F2 φ(P ) = φ(P ) = 419 364500 2719 364500 (3) For the tree pars3 (and equivalently bnb3) we have (cid:107)φT3(P )(cid:107)(cid:96)∞ = (cid:107)φT3(P )(cid:107)(cid:96)1 = φ∈3×3 minors of F3 max (cid:88) φ∈3×3 minors of F3 φ(P ) = φ(P ) = 22 18225 949 91125 Thus, in terms of the evaluation of the phylogenetic invariants, the binary trees of pars2 and the binary tree bnb1 are favorite over the other possibilities. (We discuss the position of the root vertex below.) Note that the (cid:96)∞ norm does not distinguish between the other two remaining candidates and only singles out the preferred candidate pars2. We compute the Euclidean distance function in §3.7. 3.5. The problem with the root vertex. As we have seen above, the computation of the phylogenetic invariants helps selecting between different candidate tree topologies. However, the phylogenetic invariants by themselves are insensitive to changing the position of the root in binary trees with the same topology. In terms of phylogenetic inference about Linguistics, however, it is important to locate more precisely where the root vertex should be. In the case of languages belonging to a subfamily of the Indo-European languages this can be done, as in the example we discussed in [45], by introducing the data of some of the ancient languages in the same subfamily as a new leaf of the tree, that will help locating more precisely the root vertex of the original tree based on the modern languages. For language families for which there are no data of ancient languages available, however, this kind of phylogenetic analysis will only identify a tree topology as an unrooted binary tree. We will return to this point in the following section, where we analyze the set S2(G) which includes two ancient languages. Note that when one or more ancient languages are included in the data (as in the second case of the Germanic languages, or the Romance languages discussed here) that suffices to constrain the position of the root vertex, while in other cases like the example discussed here, additional independent information is needed. 3.6. Varieties. In the discussion above we reduced the question of distinguishing between the candidate trees to an evaluation of the phylogenetic invariants coming from the 3×3 minors of one of the three matrices Flat{(cid:96)1,(cid:96)2,(cid:96)6}∪{(cid:96)3,(cid:96)4,(cid:96)5}(P ), Flat{(cid:96)1,(cid:96)2,(cid:96)3}∪{(cid:96)4,(cid:96)5,(cid:96)6}(P ), and Flat{(cid:96)1,(cid:96)2,(cid:96)4,(cid:96)5}∪{(cid:96)3,(cid:96)6}(P ). In the first two cases, the phylogenetic ideal defines the 28-dimensional determinantal variety of all 8 × 8 matrices of rank at most two, while in the third case the phylogenetic ideal defines the 36-dimensional determinantal variety of all 16× 4 matrices of rank at most two, [8]. These are not the actual phylogenetic varieties associated to the candidate trees, which are further cut out by the remaining equations coming from the 3× 3 minors of the other flattenings Flat{(cid:96)1,(cid:96)2}∪{(cid:96)3,(cid:96)4,(cid:96)5,(cid:96)6}(P ), and Flat{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)6}∪{(cid:96)4,(cid:96)5}(P ). The varieties associated to each individual tree are intersections of three different determinantal varieties inside a common ambient space A26, or when considered projectively (all the polynomials defining the phylogenetic ideals are homogeneous) in P26−1. 18 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI In the case of the trees considered here, two of the three determinantal varieties stay the same, since the flattenings Flat{(cid:96)1,(cid:96)2}∪{(cid:96)3,(cid:96)4,(cid:96)5,(cid:96)6}(P ), and Flat{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)6}∪{(cid:96)4,(cid:96)5}(P ) are common to all candi- date trees, while the third component varies among the three choices determined by the flattenings Flat{(cid:96)1,(cid:96)2,(cid:96)6}∪{(cid:96)3,(cid:96)4,(cid:96)5}(P ), Flat{(cid:96)1,(cid:96)2,(cid:96)3}∪{(cid:96)4,(cid:96)5,(cid:96)6}(P ), and Flat{(cid:96)1,(cid:96)2,(cid:96)4,(cid:96)5}∪{(cid:96)3,(cid:96)6}(P ). In general, let Dr(n, m) denote the determinantal variety of n × m matrices of rank ≤ r. As an affine subvariety in Anm it has dimension r(n + m− r). It will be convenient to consider Dr(n, m) as a projective subvariety of Pnm−1, though we will maintain the same notation. In the case r = 1, the determinantal variety D1(n, m) is the Segre variety S(n, m) given by the embedding Pn−1 × Pm−1 (cid:44)→ Pnm−1 realized by the Segre map (xi, yj) (cid:55)→ (uij = xiyj). In the case r = 2 the determinantal variety D2(n, m) is the secant variety of lines (chord variety) Sec(S(n, m)) of the Segre variety S(n, m), see §9 of [19]. Thus, we obtain the following simple geometric description of the three cases considered above: • Flat{(cid:96)1,(cid:96)2,(cid:96)6}∪{(cid:96)3,(cid:96)4,(cid:96)5}(P ) (tree topology of pars1 and bnb2): the relevant variety is the secant variety Sec(S(8, 8)) of the Segre variety S(8, 8) = P7 × P7, embedded in P63 via the Segre embedding ui1,...,i6 = xi1,i2,i6yi3,i4,i5. • Flat{(cid:96)1,(cid:96)2,(cid:96)3}∪{(cid:96)4,(cid:96)5,(cid:96)6}(P ) (tree topology of pars2 and bnb1): the relevant variety is again Sec(S(8, 8)), where S(8, 8) is embedded in P63 via ui1,...,i6 = xi1,i2,i3yi4,i5,i6. • Flat{(cid:96)1,(cid:96)2,(cid:96)4,(cid:96)5}∪{(cid:96)3,(cid:96)6}(P ) (tree topology of pars3 and bnb3): the relevant variety is the secant variety Sec(S(16, 4)) of the Segre variety S(16, 4) = P15 × P3, embedded in P63 via the Segre embedding ui1,...,i6 = xi1,i2,i4,i5yi3,i6. The evaluation of the phylogenetic invariants at the boundary distribution determined by the SSWL data selects the second choice, Sec(S(8, 8)) with the Segre embedding ui1,...,i6 = xi1,i2,i3yi4,i5,i6. As a general procedure, given a subfamily of languages, {(cid:96)1, . . . , (cid:96)n} and a set of candidate phylogenetic trees T1, . . . , Tm produced by computational methods from the syntactic variables of these n languages, one can construct with the method above a collection Y1, . . . , Ym of algebraic varieties, where each Yk associated to the tree Tk is obtained by considering the determinantal varieties associated to all those flattenings Flate(P ) of Tk that are not common to all the other trees Tj. The test for selecting one of the candidate trees, given the boundary distribution P = (pi1,...,in) of the syntactic variables, is then to estimate which of the varieties Yk the point P is closest to, where a suitable test of closeness is used, for instance through the Euclidean distance function. Assuming that this procedure does not result in ambiguities (that is, that there is a unique closest Yk to the given distribution P ), then this method selects a best candidate T among the m trees Tk. It also selects an associated algebraic variety Y = Y (T ), which is larger than the usual phylogenetic algebraic variety XT of T , since we have neglected flattenings that occur simultaneously in all the m candidate trees Tk. 3.7. The Euclidean distance. According to the discussion of the previous subsection, on the geometry of the varieties involved in distinguishing between the candidate trees, we compute here • the Euclidean distance of the point Flat{(cid:96)1,(cid:96)2,(cid:96)6}∪{(cid:96)3,(cid:96)4,(cid:96)5}(P ) and the determinantal variety D2(8, 8) = Sec(S(8, 8)), • the Euclidean distance of the point Flat{(cid:96)1,(cid:96)2,(cid:96)3}∪{(cid:96)4,(cid:96)5,(cid:96)6}(P ) from the same determinantal variety D2(8, 8) = Sec(S(8, 8)), • the Euclidean distance of the point Flat{(cid:96)1,(cid:96)2,(cid:96)4,(cid:96)5}∪{(cid:96)3,(cid:96)6}(P ) from the determinantal variety D2(16, 4) = Sec(S(16, 4)). ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 19 Using the Eckart-Young theorem, we compute these distances using the singular values of these three matrices. These are given by Σ(Flat{(cid:96)1,(cid:96)2,(cid:96)6}∪{(cid:96)3,(cid:96)4,(cid:96)5}(P )) ∼ diag(0.44940, 0.25001, 0.19237×10−1, 0.96007×10−2, 0.21595×10−2, 0.88079×10−3, 4.6239×10−19, 0) diag(0.44956, 0.25018, 0.14729 × 10−1, 0.44229 × 10−2, 0.27802 × 10−2, 0.24881 × 10−17, 0) Σ(Flat{(cid:96)1,(cid:96)2,(cid:96)3}∪{(cid:96)4,(cid:96)5,(cid:96)6}(P )) ∼ Σ(Flat{(cid:96)1,(cid:96)2,(cid:96)4,(cid:96)5}∪{(cid:96)3,(cid:96)6}(P )) ∼ diag(0.44939, 0.24994, 0.20625 × 10−1, 0.94442 × 10−2). Using (2.5) we then obtain dist(Flat{(cid:96)1,(cid:96)2,(cid:96)6}∪{(cid:96)3,(cid:96)4,(cid:96)5}(P ), Sec(S(8, 8)))2 = σ2 dist(Flat{(cid:96)1,(cid:96)2,(cid:96)3}∪{(cid:96)4,(cid:96)5,(cid:96)6}(P ), Sec(S(8, 8)))2 = σ2 dist(Flat{(cid:96)1,(cid:96)2,(cid:96)4,(cid:96)5}∪{(cid:96)3,(cid:96)6}(P ), Sec(S(16, 4)))2 = σ2 3 + ··· + σ2 3 + ··· + σ2 3 + σ2 8 = 0.46768 × 10−3 8 = 0.24424 × 10−3 4 = 0.51457 × 10−3 The second Euclidean distance is the smallest, hence this more reliable distance test again favors the binary trees of pars2 and the binary tree bnb1. The computation of these Euclidean distances provides a selection between the candidate trees in the following way. The first distance measures how far the point determined by the data (in the form of the boundary distribution P and the flattening matrix F1(P )) is from the determinantal variety D2(8, 8) determined by the tree pars1. The second distance measures how far the point determined by the data, through the flattening F2(P ), is from the determinantal variety determined by the tree pars2, and the third distance measures how far the point, through the flattening F3(P ) is from the determinantal variety D2(16, 4) determined by the tree pars3. Since as observed above the remaining flattenings of P occur in all trees and do not help distinguishing between them, it suffices to find the best matching condition between the three possibilities listed here, for which we select the one realizing the smallest Euclidean distance. Unlike the other exmples that we discuss in the rest of the paper, where we will only obtain a lower bound estimate for the Euclidean distance, in this case, under the conditional assumption that the incidence of the two common flattenings Flat{(cid:96)1,(cid:96)2}∪{(cid:96)3,(cid:96)4,(cid:96)5,(cid:96)6}(P ) and Flat{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)6}∪{(cid:96)4,(cid:96)5}(P ) to the corresponding determinantal variety is realized, the computation described above provides the actual value of the Euclidean distance of the point P to the phylogenetic algebraic variety VT , see the discussion in §2.3 above. 3.8. The West/North Germanic split from SSWL data. Note that the tree topology se- lected in this way, which (up to the position of the root vertex) is equivalent to the tree Swedish Icelandic Faroese English Dutch German 20 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI is also the generally acknowledged correct subdivision of the Germanic languages into the North Germanic and the West Germanic sub-branches. The North Germanic in turn splits into a sub- brach that contains Swedish (but also Danish which we have not included here) and another that contains Icelandic and Faroese (and also Norwegian, which we have not included, in order to keep the number of leaves more manageable). The West Germanic branch is split into the Anglo-Frisian sub-branch (of which here we are only considering English, but which should also contain Frisian) and the Netherlandic-Germanic branch that contains Dutch and German. Thus, the analysis through phylogenetic invariants and Euclidean distance has selected the correct tree topology among the candidates produced by the computational analysis of the SSWL data obtained with PHYLIP. 3.9. Longobardi data and phylogenetic invariants of Germanic Languages. Now we an- alyze the set S2(G) consisting of Norwegian, Danish, Icelandic, German, English, Gothic, and Old English, using the syntactic parameters collected in the new data of Longobardi [23]. The DNA parsimony algorithm of PHYLIP based solely on the new Longobardi data produces a single candidate phylogenetic tree for the set S2(G) of Germanic languages, shown in Figure 1. Figure 1. PHYLIP output trees of Germanic languages for the set S2(G) based on the Longobardi data. In fact, because of the presence of vertices of higher valence in this tree, one should resolve it into the possible binary trees and compare the resulting candidates. Moreover, the placement of the ancient languages as "leaves" of the tree is an artifact, and needs to be resolved into the appropriate placement of the root of the binary trees. We see here that the fact that ancient languages are treated as leaves in the tree although they really are intermediate nodes creates some problems in the reconstruction provided by PHYLIP. In the tree of Figure 1 Gothic and Old English are grouped as nearby leaves in the tree, since the reconstruction correctly identifies the closer proximity of the two ancient languages with respect to the modern ones. However, this causes an error in the proposed tree topology when these are placed as two nearby leaves. The standard way of resolving the higher valence vertex in Figure 1, as discussed in the previous section, would maintain this problem. We propose here a simple method for avoiding this problem, via a simple topological move in the resulting trees that restores the role of these two languages as intermediate nodes of the tree (and suggests a position of the root vertex) while maintaining their relation to the rest of the tree. ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 21 In particular, this means that we are going to consider possible candidate trees of the following form, where we set (cid:96)1 = Norwegian, (cid:96)2 = Danish, (cid:96)3 = Gothic, (cid:96)4 = Old English, (cid:96)5 = Icelandic, (cid:96)6 = English, (cid:96)7 = German. We first visualize the trees obtained by resolving the vertex of Figure 1. To simplify the picture, let us write A = {(cid:96)1, (cid:96)2} for the end of the tree containing this pair of adjacent leaves, and similarly for B = {(cid:96)3, (cid:96)4}, C = {(cid:96)5}, D = {(cid:96)6, (cid:96)7}, so that we can visualize the the three possible binary splittings of the vertex in Figure 1 as the trees B A C D B A C D B A D C We then want to input the extra piece of information concerning the fact that the leaves in the set B = {(cid:96)3, (cid:96)4} are not really leaves but inner vertices of the tree, whose proximity is describing the fact that they are in closer proximity to the root of the tree than the other leaves, rather than their proximity as leaves. We argue that this can be done effectively by introducing a simple topological move on these trees that achieves exactly this effect, while preserving the relation to the rest of the tree, namely the following operation: Applying this operation produces the following list of candidate trees, with (1) and (2) derived from the first binary tree above, (3) and (4) from the second binary tree above and (5) and (6) from the third one. (1) The first candidate tree T1(G) has Icelandic (incorrectly) grouped together with the West Germanic (German, English) instead of the North Germanic (Norwegian, Danish) lan- guages. The labels (cid:96)3 and (cid:96)4 should be thought of not as leaves but as intermediate vertices placed, respectively, above the {(cid:96)1, (cid:96)2} subtree and above the {(cid:96)5, (cid:96)6, (cid:96)7} subtree. (cid:96)1 (cid:96)2 (cid:96)3 (cid:96)4 (cid:96)5 (cid:96)6 (cid:96)7 (2) The second candidate tree T2(G) has the same structure as the previous list (with the incorrect placement of Icelandic), but with the reversed placement of the two ancient languages (cid:96)3 and (cid:96)4, this time with Old English placed at the top of the North Germanic instead of the West Germanic subtree: (3) The third candidate tree T3(G) has the correct placement of Icelandic in the North Ger- manic subtree, with Gothic above the North Germanic and Old English above the West Germanic subtrees: (cid:96)4 (cid:96)1 (cid:96)2 (cid:96)3 (cid:96)5 (cid:96)6 (cid:96)7 (cid:96)3 (cid:96)5 (cid:96)1 (cid:96)2 (cid:96)4 (cid:96)6 (cid:96)7 22 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI (4) The fourth candidate tree T4(G) also has the correct placement of Icelandic in the North Germanic subtree, now with Old English above the North Germanic and Gothic above the West Germanic subtrees: (5) The fifth candidate incorrectly places the sets {(cid:96)1, (cid:96)2} and {(cid:96)6, (cid:96)7} in closer proximity and (cid:96)5 in a separate branch away from the ancient languages {(cid:96)3, (cid:96)4}, placing (cid:96)4 as the ancient language in closer proximity to (cid:96)5: (cid:96)4 (cid:96)5 (cid:96)1 (cid:96)2 (cid:96)3 (cid:96)6 (cid:96)7 (cid:96)5 (cid:96)4 (cid:96)3 (6) The sixth candidate tree also incorrectly places (cid:96)5 as a separate branch and {(cid:96)1, (cid:96)2} and {(cid:96)6, (cid:96)7} in the same branch, while placing (cid:96)3 as the ancient language in closer proximity to (cid:96)5: (cid:96)6 (cid:96)7 (cid:96)1 (cid:96)2 (cid:96)5 (cid:96)3 (cid:96)4 (cid:96)6 (cid:96)7 (cid:96)1 (cid:96)2 3.9.1. Comparison of the first four trees. We first discuss the candidate trees (1) -- (4) as these have a lot of common structure that simplifies a common analysis. We then show what changes for the last two cases. When considering the new Longobardi data for the purpose of computing phylogenetic invari- ants, we need to eliminate from the list all those parameters that have value either 0 (undefined in the terminology of Longobardi's data table) or ? (unknown). The reason for eliminating not just the unknown parameters but also those rendered undefined by entailment relations lies in the fact that the result of [1] that we use for the computation of the phylogenetic invariants holds for a binary Jukes-Cantor model but not for a ternary one. Thus, we stick to only those parameters that are defined with binary values ±1 in Longobardi's table, for all the languages (cid:96)1, . . . , (cid:96)7 in our list of Germanic languages. After the change of notation to binary form, obtained by replacing 1 (cid:55)→ 1 and −1 (cid:55)→ 0, we obtain the following list of parameters (cid:96)1 = [1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0] (cid:96)2 = [1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0] (cid:96)3 = [1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0] (cid:96)4 = [1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0] (cid:96)5 = [1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0] (cid:96)6 = [1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0] (cid:96)7 = [1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0] Notice how one is left with a shorter list of only 42 parameters, where most of them have the same value for all the languages in this group. The only non-zero frequencies for binary vectors (a1, . . . , a7) ∈ F7 2 that arise in the boundary distribution at the leaves of the trees are n1111111 = 12 n0000000 = 24 n1101111 = 1 n1111101 = 1 n1111100 = 1 n1111011 = 1 n1100111 = 1 n0011111 = 1 ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 23 with probabilities p1111111 = 2 7 p1111100 = 1 p0000000 = 4 7 42 p1111011 = 1 42 p1101111 = 1 42 p1100111 = 1 42 p1111101 = 1 42 p0011111 = 1 42 and all other pa1···a7 = 0. We need to consider Flattenings of the boundary tensor P = (pa1···a7) of the form (1) Flat{(cid:96)5,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)4} (2) Flat{(cid:96)1,(cid:96)2,(cid:96)3}∪{(cid:96)4,(cid:96)5,(cid:96)6,(cid:96)7} (3) Flat{(cid:96)1,(cid:96)2,(cid:96)4}∪{(cid:96)3,(cid:96)5,(cid:96)6,(cid:96)7} (4) Flat{(cid:96)1,(cid:96)2,(cid:96)5}∪{(cid:96)3,(cid:96)4,(cid:96)6,(cid:96)7} (5) Flat{(cid:96)4,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)5} (6) Flat{(cid:96)3,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)4,(cid:96)5} Note that we do not need to consider the flattenings Flat{(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)4,(cid:96)5} and Flat{(cid:96)1,(cid:96)2}∪{(cid:96)3,(cid:96)4,(cid:96)5,(cid:96)6,(cid:96)6}, as these are common to all the candidate trees and would not help discriminating between them. All the flattenings above correspond to 8× 16 matrices as in Figure 2, where in each of the cases listed above the matrix indices (abcdef g) correspond, respectively, to (1) (abcdef g) = (a5a6a7a1a2a3a4) (2) (abcdef g) = (a1a2a3a4a5a6a7) (3) (abcdef g) = (a1a2a4a3a5a6a7) (4) (abcdef g) = (a1a2a5a3a4a6a7) (5) (abcdef g) = (a4a6a7a1a2a3a5) (6) (abcdef g) = (a3a6a7a1a2a4a5) Figure 2. Flattenings 8 × 16 matrices. The probability distributions corresponding to the permutations listed above are respectively given by (1) n1111101 = 1, n1011111 = 1, n1001111 = 1, n0111111 = 1, n1111100 = 1, n1110011 = 1 (2) n1101111 = 1, n1111101 = 1, n1111100 = 1, n1111011 = 1, n1100111 = 1, n0011111 = 1 (3) n1110111 = 1, n1111101 = 1, n1111100 = 1, n1111011 = 1, n1100111 = 1, n0011111 = 1 (4) n1110111 = 1, n1111101 = 1, n1111100 = 1, n1101111 = 1, n1110011 = 1, n0011111 = 1 (5) n1111101 = 1, n1011111 = 1, n1001111 = 1, n1111110 = 1, n0111101 = 1, n1110011 = 1 (6) n0111111 = 1, n1011111 = 1, n1001111 = 1, n1111110 = 1, n0111101 = 1, n1110011 = 1 while all six cases have the common values n1111111 = 12 and n0000000 = 24. 24 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI The corresponding flattening matrices are given by      Flat{(cid:96)5,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)4}(P ) = Flat{(cid:96)1,(cid:96)2,(cid:96)3}∪{(cid:96)4,(cid:96)5,(cid:96)6,(cid:96)7}(P ) = Flat{(cid:96)1,(cid:96)2,(cid:96)4}∪{(cid:96)3,(cid:96)5,(cid:96)6,(cid:96)7}(P ) = Flat{(cid:96)1,(cid:96)2,(cid:96)5}∪{(cid:96)3,(cid:96)4,(cid:96)6,(cid:96)7}(P ) = Flat{(cid:96)4,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)5}(P ) = 4 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 42 0 0 0 1 42 0 0 1 42 1 42 0 2 7 4 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 42 0 0 0 0 0 0 4 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 42 0 0 0 0 0 0 0 0 0 0 0 0 0 1 42 0 0 0 0 0 0 0 1 42 0 0 0 0 0 0 0 1 42 0 0 0 0 0 0 0 1 42 4 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 42 0 0 0 0 0 0 0 0 0 0 0 1 42 0 0 0 0 0 0 0 1 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 42 0 0      0 0 0 1 42 0 0 1 42 2 7 0 0 0 1 42 0 0 0 2 7 0 0 0 1 42 0 0 1 42 2 7 0 1 42 0 0 0 1 42 0 2 7 0 0 0 0 0 0 1 42 0 0 0 0 0 0 0 1 42 1 42 0 0 0 0 0 0 0 1 42 ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 4 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 42 0 0 0 0 0 0 0 1 42 0 0 0 0 0 0 0 0 0 0 0 0 1 42 0 0 0 0 0 0 0 0 0 0 0 25  0 1 42 0 0 1 42 1 42 0 2 7 Flat{(cid:96)3,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)4,(cid:96)5}(P ) =   3.9.2. Comparison of the remaining two trees. The trees T5(G) and T6(G) have a slightly dif- ferent structure, since in addition to placing in closest proximity the pairs {(cid:96)1, (cid:96)2} and {(cid:96)6, (cid:96)7} like all other trees they also identify pairs {(cid:96)4, (cid:96)5} in the case of T5(G) and {(cid:96)3, (cid:96)5} in the case of T6(G). Thus, while these two trees also have the flattenings Flat{(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)4,(cid:96)5} and Flat{(cid:96)1,(cid:96)2}∪{(cid:96)3,(cid:96)4,(cid:96)5,(cid:96)6,(cid:96)6} common to all the other trees, they also have a flattening common to both trees T5(G) and T6(G) and Flat{(cid:96)3,(cid:96)4,(cid:96)5}∪{(cid:96)1,(cid:96)2,(cid:96)6,(cid:96)7} F5 := Flat{(cid:96)4,(cid:96)5}∪{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)6,(cid:96)7} F6 := Flat{(cid:96)3,(cid:96)5}∪{(cid:96)1,(cid:96)2,(cid:96)4,(cid:96)6,(cid:96)7} for T5(G) for T6(G). We have as corresponding matrices 4 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 42  0 0 0 1 42 1 42 1 42 0 2 7 Flat{(cid:96)3,(cid:96)4,(cid:96)5}∪{(cid:96)1,(cid:96)2,(cid:96)6,(cid:96)7}(P ) = while the matrices (written in transpose form) for F5 and F6 are given in Appendix C. 3.10. Computation of the phylogenetic invariants. We compute the phylogenetic invariants using the (cid:96)∞ and the (cid:96)1 norm. (1) T1(G) with flattenings M1 = Flat{(cid:96)5,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)4} and M2 = Flat{(cid:96)1,(cid:96)2,(cid:96)3}∪{(cid:96)4,(cid:96)5,(cid:96)6,(cid:96)7} gives: (cid:107)φT1(P )(cid:107)(cid:96)∞ = max{ max (cid:88) (cid:107)φT1(P )(cid:107)(cid:96)1 = of M1 φ∈∈3×3minors φ(P ) + φ(P ) , max φ∈∈3×3minors of M2 (cid:88) φ∈∈3×3minors of M1 φ∈∈3×3minors of M2 φ(P )} = 4 1029 φ(P ) = 83 8232 (2) T2(G) with flattenings M1 = Flat{(cid:96)5,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)4} and M3 = Flat{(cid:96)1,(cid:96)2,(cid:96)4}∪{(cid:96)3,(cid:96)5,(cid:96)6,(cid:96)7} gives (cid:107)φT2(P )(cid:107)(cid:96)∞ = max{ max (cid:88) (cid:107)φT2(P )(cid:107)(cid:96)1 = of M1 φ∈∈3×3minors φ(P ) + φ(P ) , max φ∈∈3×3minors of M3 (cid:88) φ∈∈3×3minors of M1 φ∈∈3×3minors of M3 φ(P )} = 4 1029 φ(P ) = 233 24696 26 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI (3) T3(G) with flattenings M4 = Flat{(cid:96)1,(cid:96)2,(cid:96)5}∪{(cid:96)3,(cid:96)4,(cid:96)6,(cid:96)7} and M5 = Flat{(cid:96)4,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)5} gives (cid:107)φT3(P )(cid:107)(cid:96)∞ = max{ max (cid:88) (cid:107)φT3(P )(cid:107)(cid:96)1 = of M4 φ∈∈3×3minors φ(P ) + φ(P ) , max φ∈∈3×3minors of M5 (cid:88) φ∈∈3×3minors of M4 φ∈∈3×3minors of M5 φ(P )} = 1 3087 φ(P ) = 16 3087 (4) T4(G) with flattenings M4 = Flat{(cid:96)1,(cid:96)2,(cid:96)5}∪{(cid:96)3,(cid:96)4,(cid:96)6,(cid:96)7} and M6 = Flat{(cid:96)3,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)4,(cid:96)5} gives (cid:107)φT4(P )(cid:107)(cid:96)∞ = max{ max (cid:88) (cid:107)φT4(P )(cid:107)(cid:96)1 = of M4 φ∈∈3×3minors φ(P ) + φ(P ) , max φ∈∈3×3minors of M6 (cid:88) φ∈∈3×3minors of M4 φ∈∈3×3minors of M6 φ(P )} = 4 1029 φ(P ) = 181 18522 (5) T5(G) with flattenings F5 of Appendix C and M7 = Flat{(cid:96)3,(cid:96)4,(cid:96)5}∪{(cid:96)1,(cid:96)2,(cid:96)6,(cid:96)7} gives (cid:107)φT5(P )(cid:107)(cid:96)∞ = max{ max (cid:88) (cid:107)φT5(P )(cid:107)(cid:96)1 = of F5 φ∈∈3×3minors φ(P ) + φ(P ) , max φ∈∈3×3minors of M7 (cid:88) φ∈∈3×3minors of F5 φ∈∈3×3minors of M7 φ(P )} = 4 1029 φ(P ) = 233 24696 (6) T6(G) with flattenings F6 of Appendix C and M7 = Flat{(cid:96)3,(cid:96)4,(cid:96)5}∪{(cid:96)1,(cid:96)2,(cid:96)6,(cid:96)7} gives (cid:107)φT6(P )(cid:107)(cid:96)∞ = max{ max (cid:88) (cid:107)φT6(P )(cid:107)(cid:96)1 = of F6 φ∈∈3×3minors φ(P ) + φ(P ) , max φ∈∈3×3minors of M7 (cid:88) φ∈∈3×3minors of F6 φ∈∈3×3minors of M7 φ(P )} = 4 1029 φ(P ) = 83 8232 In this case we see that both the (cid:96)∞ and the (cid:96)1 norm provide a good test that selects the historically correct tree T3(G). Note that the (cid:96)∞ has the same value 4/1029 on all the other candidates and the lower value 1/3087 only for the correct tree T3(G). 3.11. Estimates of Euclidean distance for the S2(G) Germanic languages. We obtain an estimate of the likelihood of the candidate trees based on computing a lower bound for the Euclidean distance in terms of distances between the flattening matrices Flate(P ) of the boundary distribution P and the determinantal varieties they are expected to lie on. More concretely, we have the following: (1) The Euclidean distance estimate for the tree T1(G) is given by dist(P, VT1) ≥ L1 L1 = max{d(Flat{(cid:96)1,(cid:96)2,(cid:96)3}∪{(cid:96)4,(cid:96)5,(cid:96)6,(cid:96)7}(P ),D2(8, 16)), d(Flat{(cid:96)5,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)4}(P ),D2(8, 16))} (2) The Euclidean distance estimate of T2(G) is given by dist(P, VT2) ≥ L2 L2 = max{d(Flat{(cid:96)1,(cid:96)2,(cid:96)4}∪{(cid:96)3,(cid:96)5,(cid:96)6,(cid:96)7}(P ),D2(8, 16)), d(Flat{(cid:96)5,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)4}(P ),D2(8, 16))} (3) The Euclidean distance estimate of T3(G) is given by dist(P, VT3) ≥ L3 L3 = max{d(Flat{(cid:96)1,(cid:96)2,(cid:96)5}∪{(cid:96)3,(cid:96)4,(cid:96)6,(cid:96)7}(P ),D2(8, 16)), d(Flat{(cid:96)4,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)5}(P ),D2(8, 16))} (4) The Euclidean distance estimate of T4(G) is given by dist(P, VT4) ≥ L4 L4 = max{d(Flat{(cid:96)1,(cid:96)2,(cid:96)5}∪{(cid:96)3,(cid:96)4,(cid:96)6,(cid:96)7}(P ),D2(8, 16)), d(Flat{(cid:96)3,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)4,(cid:96)5}(P ),D2(8, 16))} ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 27 The singular value decomposition of the flattening matrices gives Σ = diag(σ1, . . . , σ8) with Σ(Flat{(cid:96)5,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)4}(P )) ∼ diag(0.57143, 0.291548, 0.58333×10−2, 0.12240×10−17, 0.10572×10−34, 0.16149×10−51, 0.63652×10−68, 0) Σ(Flat{(cid:96)1,(cid:96)2,(cid:96)3}∪{(cid:96)4,(cid:96)5,(cid:96)6,(cid:96)7})(P )) ∼ diag(0.57143, 0.29059, 0.23973 × 10−1, 0.33558 × 10−2, 0.64145 × 10−19, 0.60260 × 10−31, 0, 0) Σ(Flat{(cid:96)1,(cid:96)2,(cid:96)4}∪{(cid:96)3,(cid:96)5,(cid:96)6,(cid:96)7}(P )) ∼ diag(0.57143, 0.29061, 0.23809 × 10−1, 0.33787 × 10−2, 0, 0, 0, 0) Σ(Flat{(cid:96)1,(cid:96)2,(cid:96)5}∪{(cid:96)3,(cid:96)4,(cid:96)6,(cid:96)7}(P )) ∼ diag(0.57143, 0.29155, 0.54996 × 10−2, 0, 0, 0, 0, 0) Σ(Flat{(cid:96)4,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)5}(P )) ∼ diag(0.57143, 0.29155, 0.54996 × 10−2, 0, 0, 0, 0, 0) Σ(Flat{(cid:96)3,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)4,(cid:96)5}(P )) ∼ diag(0.57143, 0.29059, 0.23892×10−1, 0.38881×10−2, 0.12435×10−17, 0.73417×10−19, 0.32257×10−34, 0). By the Eckart-Young theorem we then have d(Flat{(cid:96)5,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)4}(P ),D2(8, 16))2 = σ2 d(Flat{(cid:96)1,(cid:96)2,(cid:96)3}∪{(cid:96)4,(cid:96)5,(cid:96)6,(cid:96)7})(P ),D2(8, 16))2 = σ2 d(Flat{(cid:96)1,(cid:96)2,(cid:96)4}∪{(cid:96)3,(cid:96)5,(cid:96)6,(cid:96)7}(P ),D2(8, 16))2 = σ2 d(Flat{(cid:96)1,(cid:96)2,(cid:96)5}∪{(cid:96)3,(cid:96)4,(cid:96)6,(cid:96)7}(P ),D2(8, 16))2 = σ2 d(Flat{(cid:96)4,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)5}(P ),D2(8, 16))2 = σ2 d(Flat{(cid:96)3,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)4,(cid:96)5}(P ),D2(8, 16))2 = σ2 3 + ··· + σ2 3 + ··· + σ2 3 + ··· + σ2 3 + ··· + σ2 3 + ··· + σ2 3 + ··· + σ2 8 = 0.34027 × 10−4 8 = 0.58597 × 10−3 8 = 0.57831 × 10−3 8 = 0.30245 × 10−4 8 = 0.30245 × 10−4 8 = 0.58595 × 10−3. Thus, we obtain L1 = 0.58597 × 10−3, L2 = 0.57831 × 10−3, L3 = 0.30245 × 10−4, L4 = 0.58595 × 10−3. Thus, both the computation of the phylogenetic invariants and the Euclidean distance estimate select the tree T3 as the preferred candidate phylogenetic tree, which is indeed the closest to what is regarded as the correct linguistic phylogenetic tree. 28 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI 3.11.1. Euclidean distance for T5 and T6. We discuss the Euclidean distance estimate for the two remaining trees. To this purpose, we compute the Euclidean distance of the flattening Flat{(cid:96)3,(cid:96)4,(cid:96)5}∪{(cid:96)1,(cid:96)2,(cid:96)6,(cid:96)7}(P ) from the determinantal variety D(8, 16), with P given by the distri- bution at the leaves based on the Longobardi data. We find Σ(Flat{(cid:96)3,(cid:96)4,(cid:96)5}∪{(cid:96)1,(cid:96)2,(cid:96)6,(cid:96)7}(P )) ∼ diag(0.57143, 0.29155, 0.58333 × 10−2, 0.18608 × 10−17, 0.32093 × 10−33, 0, 0, 0) d(Flat{(cid:96)3,(cid:96)4,(cid:96)5}∪{(cid:96)1,(cid:96)2,(cid:96)6,(cid:96)7}(P ),D2(8, 16))2 = σ2 8 = 0.34027 × 10−4. 3 + ··· + σ2 We then compute the distances between the flattenings F5 and F6 and the determinantal variety D2(4, 32). The singular values of F5 are given by Σ(F5(P )) = (0.57143, 0.29061, 0.23809 × 10−1, 0.33787 × 10−2) which give the distance d(F5(P ),D2(4, 32))2 = σ2 3 + σ2 4 = 0.57831 × 10−3. The singular values for F6 are Σ(F5(P )) = (0.57143, 0.29060, 0.23973 × 10−1, 0.33558 × 10−2) which gives the distance d(F6(P ),D2(4, 32))2 = σ2 3 + σ2 4 = 0.58597 × 10−3 Thus, the lower bound for the Euclidean distance for the tree T5(G) is given by max{d(Flat{(cid:96)3,(cid:96)4,(cid:96)5}∪{(cid:96)1,(cid:96)2,(cid:96)6,(cid:96)7}(P ),D2(8, 16))2, d(F5(P ),D2(4, 32))2} = 0.57831 × 10−3 and similarly the lower bound for the Euclidean distance for the tree T6(G) is given by max{d(Flat{(cid:96)3,(cid:96)4,(cid:96)5}∪{(cid:96)1,(cid:96)2,(cid:96)6,(cid:96)7}(P ),D2(8, 16))2, d(F6(P ),D2(4, 32))2} = 0.58597 × 10−3. When we compare the estimates for the trees T5(G) and T6(G) with the ones obtained for the previous trees T1(G), . . . , T4(G) we see that these lower bounds are comparable to those of T1(G), T2(G), T4(G) and only T3(G) has a significantly smaller estimate. Thus, this criterion also suggests T3(G) as the most favorable candidate. 3.12. Comparison with SSWL data. The DNA parsimony algorithm of PHYLIP produced two candidate phylogenetic trees for the set S2(G) of Germanic languages based on the combination of the Longobardi data and the SSWL data. They are shown in Figure 3. In this case, the inclusion of the additional SSWL data resolves the ambiguity of the tree of Figure 1. In terms of our treatment of the positioning of the ancient languages, the trees shown in Figure 3 should be regarded as corresponding to the possible trees in cases (3) and (4) discussed above in §3.9, for the first tree and cases (5) and (6) for the second one. Thus, the set of possible binary trees we should consider for a comparison between the phyloge- netic invariants evaluated on the Longobardi and on the SSWL data, consists of the trees T3(G) and T4(G) and T5(G) and T6(G) of the previous section. We will evaluate here the phylogenetic invariants and estimate the Euclidean distance function of these candidate trees (including for completeness also T1(G) and T2(G) of the previous section) using the boundary distribution based on the SSWL data. ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 29 Figure 3. PHYLIP output trees of Germanic languages for the set S2(G) based on combined Longobardi and SSWL data. 3.13. Boundary distribution for S2(G) based on SSWL data. The Germanic languages in the set S2(G) have a total of 68 SSWL variables that are completely mapped for all the seven languages in the set. This is significantly smaller than the 90 variables used for the set S1(G). This does not depend on the languages being poorly mapped: the levels of accuracy are comparable with the previous set with Danish (76%), Norwegian (75%), German (75%), English (75%), Old English (75%) Icelandic (62%), Gothic (62%). However, the regions of the overall 115 SSWL variables that are mapped is less uniform across this set of languages creating a smaller overlap. The set of completely mapped SSWL variables for this set of languages is reported in Appendix B. The occurrences of binary vectors at the leaves is given by n0,0,0,0,0,0,0 = 26 n1,1,1,1,1,1,1 = 16 n0,0,1,1,0,0,1 = 2 n0,0,1,1,1,1,0 = 1 n0,0,1,0,0,0,0 = 3 n1,1,0,1,0,1,1 = 2 n0,0,1,1,1,0,0 = 1 n1,0,1,1,1,0,0 = 1 n1,1,1,1,1,0,0 = 1 n0,0,0,0,1,0,0 = 1 n1,1,1,1,0,1,1 = 3 n0,0,0,1,0,0,0 = 2 n1,1,0,0,1,1,1 = 1 n0,0,0,0,0,0,1 = 1 n1,1,0,1,1,1,1 = 1 n1,1,0,1,0,0,0 = 1 n0,0,1,0,1,0,0 = 1 n1,1,1,1,1,0,1 = 1 n1,1,0,1,1,0,1 = 1 n0,0,0,0,0,1,0 = 1 n0,0,1,1,0,0,0 = 1 Thus, the boundary probability distribution for the SSWL data for these seven Germanic languages is given by p0,0,0,0,0,0,0 = 13 p0,0,1,0,0,0,0 = 3 p0,0,1,1,1,0,0 = 1 p1,0,1,1,1,0,0 = 1 p1,1,1,1,0,1,1 = 3 p1,1,0,0,1,1,1 = 1 p0,0,0,0,0,0,1 = 1 34 p1,1,1,1,1,1,1 = 4 68 p1,1,0,1,0,0,0 = 1 68 p0,0,1,0,1,0,0 = 1 68 p1,1,1,1,1,0,1 = 1 68 p1,1,0,1,1,0,1 = 1 68 p0,0,0,0,0,1,0 = 1 68 p0,0,1,1,0,0,0 = 1 17 p0,0,1,1,0,0,1 = 1 68 p0,0,1,1,1,1,0 = 1 68 p1,1,0,1,0,1,1 = 1 68 p1,1,1,1,1,0,0 = 1 68 p0,0,0,0,1,0,0 = 1 68 p0,0,0,1,0,0,0 = 1 68 p1,1,0,1,1,1,1 = 1 68 34 68 68 34 68 34 The six flattening matrices corresponding to the different trees of the previous section are in this case of the following form. 30 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI Flat{(cid:96)5,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)4}(P ) =     1 34 0 13 34 0 1 68 0 0 0 13 34 0 0 3 68 0 0 0 0 13 34 0 0 1 68 0 0 0 0 13 34 0 0 1 68 0 0 1 68 0 0 1 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 34 0 0 1 68 0 0 1 68 0 3 68 0 0 1 68 0 0 0 0 3 68 0 0 1 68 0 0 0 0 1 68 0 0 1 68 0 0 0 0 1 68 0 0 0 0 0 0 0 1 34 0 0 0 0 0 1 68 0 3 68 1 68 0 0 0 0 0 0 1 68 0 0 0 0 0 0 0 1 68 0 0 0 0 0 0 0 1 68 0 0 0 0 0 0 0 1 34 0 0 0 0 0 0 0 1 68 0 0 0 0 0 0 0 1 68 0 0 0 0 0 0 0 1 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 68 0 1 68 0 0 0 1 34 0 0 0 0 0 0 0 0 0 0 0 0 0 1 68 0 0 0 0 1 68 0 0 0 1 68 0 0 0 1 34 1 68 0 1 68 0 0 1 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 68 0 0 3 68 1 68 0 4 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 68 0 0 0 1 68 0 0 0 1 68 0 1 34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 68 0 0 0 0 1 68 0 0 0 0 0 1 68 0 0 0 1 68 0 0 0 1 68 0 0 0 0 0 0 0 1 34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 68 1 34 1 68 0 0 0 0 0 0 0 0 0 0 0 1 68 0 0 0 0 0 0 0 1 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 68 0 0 0 1 68 1 68 0 0 0 1 68 0 0 0 0 0 0 0 1 68 0 0 0 0 0 0 0 0 0 0 1 68 1 68 0 0 0 0 0 0 0 0 0 0 0 0 0 1 34 3 68 0 0 0 0 0 0 0 1 68 3 68 1 34 0 0 0 0 0 0 0 0 0 0 0 0 0 1 68 0 0 0 0 0 0 0 1 68 0 0 0 0 0 0 0 1 68 1 68 0 0 0 0 0 0 1 34 1 68     4 17 0 0 0 0 0 0 0 0 0 0 0 0 0 1 68 4 17 0 0 0 0 0 0 3 68 4 17 Flat{(cid:96)1,(cid:96)2,(cid:96)3}∪{(cid:96)4,(cid:96)5,(cid:96)6,(cid:96)7}(P ) = Flat{(cid:96)1,(cid:96)2,(cid:96)4}∪{(cid:96)3,(cid:96)5,(cid:96)6,(cid:96)7}(P ) = Flat{(cid:96)1,(cid:96)2,(cid:96)5}∪{(cid:96)3,(cid:96)4,(cid:96)6,(cid:96)7}(P ) = ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES Flat{(cid:96)4,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)5}(P ) = Flat{(cid:96)3,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)4,(cid:96)5}(P ) =   13 34 0 0 1 34 0 0 1 68 0 0 1 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 34 0 0 3 68 0 0 1 68 0 0 1 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 68 1 68 0 0 0 1 34 0 0 1 34 1 68 0 0 0 1 34 0 0 1 68 0 0 0 0 0 0 0 0 0 0 0 0 1 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 34 0 0 0 0 1 68 0 0 0 0 0 1 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 68 1 68 0 0 0 0 1 68 0 0 1 68 0 0 0 0 1 68 0 0 0 0 0 0 0 0 3 68 1 68 0 0 0 1 34 0 0 3 68 0 0 0 0 1 68 1 68 0 1 68 0 0 0 0 1 68 0 0 0 0 0 1 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 68 0 0 0 0 0 0 0 0 0 0 0 0 0 31   0 1 68 0 0 0 1 68 0 4 17 0 1 68 0 1 68 1 68 1 68 0 4 17  13 34 1 34 3 68 1 68 1 68 0 1 68 1 68 0 0 0 0 0 0 0 0 3.13.1. The trees T5 and T6. For the two remaining trees we have the flattening matrix Flat{(cid:96)3,(cid:96)4,(cid:96)5}∪{(cid:96)1,(cid:96)2,(cid:96)6,(cid:96)7}(P ) = 0 0 0 0 0 0 0 0 0 0 0 0 0 1 68 0 1 68 and the matrices for the flattenings F5 and F6 given in the Appendix C. 3.14. Phylogenetic invariants. We compute the phylogenetic invariants, using either the (cid:96)∞ or the (cid:96)1 norm. This case shows, as observed already in [6], that the (cid:96)1 norm gives more reliable results than the (cid:96)∞ norm. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 68 0 0 0 0 0 1 68 0 0 0 0 0 0 0 0  0 0 0 0 0 0 0 0 0 1 34 0 3 68 1 68 1 68 0 4 17 1 68 0 0 0 0 0 0 1 68 0 0 0 0 0 0 0 0 1 68 0 0 1 34 0 0 0 0 0 0 0 0 0 0 0 0 32 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI • For the first tree T1(G) we consider all 3 × 3 minors of the flattenings M1 = Flat{(cid:96)5,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)4}(P ) and M2 = Flat{(cid:96)1,(cid:96)2,(cid:96)3}∪{(cid:96)4,(cid:96)5,(cid:96)6,(cid:96)7}(P ) and we obtain (cid:107)φT1(P )(cid:107)(cid:96)∞ = (cid:107)φT1(P )(cid:107)(cid:96)1 = max 3×3minors of M1,M2 (cid:88) φ(P ) = φ(P ) = 13 4913 8811 157216 3×3minors of M1,M2 • For the second tree T2(G) we consider all 3 × 3 minors of the flattenings M1 = Flat{(cid:96)5,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)4}(P ) and M3 = Flat{(cid:96)1,(cid:96)2,(cid:96)4}∪{(cid:96)3,(cid:96)5,(cid:96)6,(cid:96)7}(P ) and we obtain (cid:107)φT2(P )(cid:107)(cid:96)∞ = (cid:107)φT2(P )(cid:107)(cid:96)1 = max 3×3minors of M1,M3 (cid:88) φ(P ) = φ(P ) = 13 4913 7103 157216 • For the third tree T3(G) we consider all 3 × 3 minors of the flattenings 3×3minors of M1,M3 M4 = Flat{(cid:96)1,(cid:96)2,(cid:96)5}∪{(cid:96)3,(cid:96)4,(cid:96)6,(cid:96)7}(P ) and M5 = Flat{(cid:96)4,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)3,(cid:96)5}(P ) and we obtain (cid:107)φT3(P )(cid:107)(cid:96)∞ = (cid:107)φT3(P )(cid:107)(cid:96)1 = max 3×3minors of M4,M5 (cid:88) φ(P ) = φ(P ) = 13 4913 5439 157216 3×3minors of M4,M5 • For the fourth tree T4(G) we consider all 3 × 3 minors of the flattenings M4 = Flat{(cid:96)1,(cid:96)2,(cid:96)5}∪{(cid:96)3,(cid:96)4,(cid:96)6,(cid:96)7}(P ) and M6 = Flat{(cid:96)3,(cid:96)6,(cid:96)7}∪{(cid:96)1,(cid:96)2,(cid:96)4,(cid:96)5}(P ) and we obtain (cid:107)φT4(P )(cid:107)(cid:96)∞ = (cid:107)φT4(P )(cid:107)(cid:96)1 = max 3×3minors of M4,M6 (cid:88) φ(P ) = φ(P ) = 13 4913 5739 157216 3×3minors of M4,M6 • For the fifth tree T5(G) we consider all 3 × 3 minors of the flattenings M7 = Flat{(cid:96)3,(cid:96)4,(cid:96)5}∪{(cid:96)1,(cid:96)2,(cid:96)6,(cid:96)7}(P ) and F5 (as in Appendix C) and we obtain (cid:107)φT5(P )(cid:107)(cid:96)∞ = (cid:107)φT5(P )(cid:107)(cid:96)1 = 3×3minors of M7,F5 max (cid:88) 3×3minors of M7,F5 φ(P ) = φ(P ) = 13 4913 25 578 • For the sixth tree T6(G) we consider all 3 × 3 minors of the flattenings M7 = Flat{(cid:96)3,(cid:96)4,(cid:96)5}∪{(cid:96)1,(cid:96)2,(cid:96)6,(cid:96)7}(P ) and F6 (as in Appendix C) and we obtain (cid:107)φT6(P )(cid:107)(cid:96)∞ = max 3×3minors of M7,F6 φ(P ) = 207 78608 ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 33 (cid:88) (cid:107)φT6(P )(cid:107)(cid:96)1 = 3×3minors of M7,F6 φ(P ) = 11795 314432 When we evaluate the minimum among these candidate trees we see that using the (cid:96)∞ norm in this case would incorrectly select the tree T6(G) as the best candidate, while using the (cid:96)1 norm correctly selects T3(G) (cid:107)φT (P )(cid:107)(cid:96)∞ = (cid:107)φT (P )(cid:107)(cid:96)1 = 207 78608 5439 157216 min T min T = (cid:107)φT6(P )(cid:107)(cid:96)∞ = (cid:107)φT3(P )(cid:107)(cid:96)1. The (cid:96)∞ norm also does not distinguish at all between the trees T1(G), . . . , T5(G). 3.15. Euclidean distance function. The Euclidean distance lower bound estimate can be ob- tained as in §3.11 by replacing the boundary probability based on the Longobardi data with the one based on SSWL data. We obtain the following. The singular value decompositions Σ = diag(σk) are now of the form Σ(M1) = (0.38754, 0.24162, 0.36255 × 10−1, 0.29457 × 10−1, 0.17913 × 10−1, 0.18822 × 10−2, 0.44554 × 10−3, 0.81454 × 10−18) Σ(M2) = (0.38705, 0.24121, 0.40755 × 10−1, 0.35206 × 10−1, 0.13458 × 10−1, 0.25922 × 10−17, 0.30537 × 10−18, 0.12727 × 10−32) Σ(M3) = (0.38779, 0.24265, 0.37646 × 10−1, 0.14679 × 10−1, 0.13520 × 10−1, 0.72298 × 10−17, 0.10019 × 10−18, 0.15015 × 10−30) Σ(M4) = (0.38833, 0.23760, 0.54943 × 10−1, 0.25989 × 10−1, 0.11091 × 10−1, 0.37355 × 10−17, 0.11876 × 10−18, 0.41814 × 10−32) Σ(M5) = (0.38730, 0.24267, 0.35401 × 10−1, 0.25107 × 10−1, 0.13409 × 10−1, 0.10671 × 10−1, 0.83305 × 10−3, 0.63417 × 10−18) Σ(M6) = (0.38735, 0.24147, 0.34918 × 10−1, 0.29212 × 10−1, 0.23098 × 10−1, 0.10765 × 10−1, 0.17668 × 10−2, 0.31311 × 10−3) Σ(M7) = (0.38775, 0.24257, 0.29048 × 10−1, 0.26515 × 10−1, 0.14181 × 10−1, 0.11708 × 10−1, 0.13047 × 10−2, 0.60234 × 10−18) Σ(F5) = (0.38710, 0.24296, 0.44347 × 10−1, 0.15179 × 10−1) Σ(F6) = (0.39170, 0.23723, 0.30854 × 10−1, 0.20237 × 10−1) One obtains from these the Euclidean distances d(M1,D2(8, 16))2 = σ2 d(M2,D2(8, 16))2 = σ2 d(M3,D2(8, 16))2 = σ2 d(M4,D2(8, 16))2 = σ2 d(M5,D2(8, 16))2 = σ2 d(M6,D2(8, 16))2 = σ2 d(M7,D2(8, 16))2 = σ2 3 + ··· + σ2 3 + ··· + σ2 3 + ··· + σ2 3 + ··· + σ2 3 + ··· + σ2 3 + ··· + σ2 3 + ··· + σ2 8 = 0.25068 × 10−2 8 = 0.30816 × 10−2 8 = 0.18155 × 10−2 8 = 0.38172 × 10−2 8 = 0.21780 × 10−2 8 = 0.27252 × 10−2 8 = 0.18867 × 10−2 d(F5,D2(4, 32))2 = σ2 d(F6,D2(4, 32))2 = σ2 3 + σ2 3 + σ2 4 = 0.21971 × 10−2 4 = 0.13615 × 10−2. 34 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI Thus, we find that, in the case of the SSWL data for these Germanic languages, the lower bound on the Euclidean distance gives a less reliable answer. While it correctly excludes the candidates T1(G), T2(G), T4(G), T5(G), it assigns the lowest value to the tree T6(G) rather than to the correct tree T3(G) selected by the phylogenetic invariants (computed with the (cid:96)1-norm). Thus, we see here an example where the lower bound is an unreliable predictor of the actual Euclidean distance. This example confirms the expectation that Longobardi's LanGeLin data behave better for phylogenetic reconstruction than the SSWL data. A possible explanation for this phenomenon lies in the fact that, although the list of SSWL variables for this set of languages is longer than the list of variables in the Longobardi data, there is a high degree of dependency between the SSWL data. This was also observed in [37] where the dependencies between SSWL variables were studied using Kanerva networks. Thus, the actual number of independent variables that contribute to the boundary distribution may be smaller in the use of the SSWL data. The fact that the languages in the set S2(G) have a smaller overlap in the regions of the SSWL variables that are uniformly mapped for all languages, compared to those in the set S1(G) further explains why the (cid:96)∞-phylogenetic invariants and the Euclidean distance evaluated on the boundary distribution of SSWL data correctly identify the best tree in the S1(G) case but not in the S2(G) case and the (cid:96)1-phylogenetic invariant identifies the correct tree in the case of S2(G) only by a small margin. We will return to discuss this point in §8 below. 4. Phylogenetic Algebraic Varieties of the Romance Languages We consider here the case of the Romance subfamily of the Indo-European language family. In particular, we focus of the relative position of the languages (cid:96)1 = Latin, (cid:96)2 = Romanian, (cid:96)3 = French, (cid:96)4 = Italian, (cid:96)5 = Spanish, and (cid:96)6 = Portuguese. We use the combined data of the SSWL and the Longobardi databases for this phylogenetic analysis, where we retain only those features of the SSWL database that are completely mapped for all of these languages. When run on this set of syntactic data, the PHYLIP phylogenetic program produces a unique most parsimonious tree candidate, which is given by the tree T1 (cid:96)1 (cid:96)2 (cid:96)5 (cid:96)6 (cid:96)3 (cid:96)4 with the additional linguistic information that (cid:96)1 (Latin) should be considered as the root vertex, since the tree produced by PHYLIP is unrooted. There is clearly a problem with this tree, since the topology one expects based on historical linguistics is instead given by the tree T2 (cid:96)1 (cid:96)2 (cid:96)4 (cid:96)3 (cid:96)5 (cid:96)6 4.1. Flattening matrices of the PHYLIP tree. There are three flattening matrices associated to the tree T1, given by the three possible splittings e1 = {(cid:96)1, (cid:96)2}∪{(cid:96)3, (cid:96)4, (cid:96)5, (cid:96)6}, e2 = {(cid:96)1, (cid:96)2, (cid:96)5}∪ {(cid:96)3, (cid:96)4, (cid:96)6} and e3 = {(cid:96)1, (cid:96)2, (cid:96)5, (cid:96)6} ∪ {(cid:96)3, (cid:96)4}. With the boundary probability distribution given by ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 35 the combined SSWL and Longobardi data, these are given by  0.2 0 0 0 0 0 0 0 0.0242 0 0 0 0.0061 0 0.0121 0.0606 0.0121 0.0061 0 0.0061 0.0061 0 0 0 0 0 0 0.0061 0 0 0.0182 0.0182 0 0 0.0061 0 0 0 0 0.0061 0 0.0061 0.0061 0.0364 0.1091 0.0364 0.4121 FlatT1,e1 = 0.0061 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  0.0121 0.0061 0 0.0061 0 0 0.0182 0 0 0   FlatT1,e2 = 0.2 0 0 0 0.0242 0 0 0 0 0 0 0 0 0.0121 0 0 0 0 0 0 0 0.0061 0.0061 0.0364 0.0606 0.0061 0.0061 0 0.0061 0.0182 0 0 0.1091 0 0 0 0 0 0 0.0061 0 0 0 0 0.0061 0.0364 0.0061 0.4121 while the third flattening FlatT1,e3 is given by  0.2 0 0.0242 0.0061 0 0 0 0 0.0121 0 0 0 0 0 0.0061 0 0 0 0 0 0 0 0.0061 0.0364 0 0 0 0 0 0 0 0.0606 0 0.0182 0.1091 0 0 0 0 0 0.0121 0.0061 0 0.0061 0.0061 0.0061 0.0061 0 0 0 0 0 0 0 0.0061 0.0364 0 0 0 0 0.0182 0 0.0061 0.4121  4.2. Flattening matrices of the historically correct tree. When we consider the linguisti- cally correct tree T2, instead of the tree T1 computed by PHYLIP, using the same syntactic data 36 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI for the boundary distribution, we find the flattening matrices  0.2 0 0 0 0.0121 0.0606 0.0121 0.0061 0 0 0 0.0061 0.0242 0 0 0 0 0 0 0.0061 0.0182 0 0.0061 0 0 0.0061 0 0 0 0 0 0 0 0 0 0  0 0 0 0 0.0061 0.0061 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0182 0.0061 0.0061 0.0364 0.1091 0.0364 0.0061 0.4121 0 0 0.0242 0 0 0.0061 0.0061 0.0061 0.0182 0 0 0 0 0 0 0 0 0 0 0.0061 0 0 0.0182 0.0061 0 0 0 0 0 0  0 0 0 0 0 0 0 0.0061 0.0061 0.0364 0.1091 0.0364 0.0061 0.4121 0 0 FlatT2,e1 =  FlatT2,e2 = 0.2 0 0 0 0.0121 0.0606 0.0121 0.0061 0 0 0 0.0061 0 0 0 0 and with the third flattening matrix FlatT2,e3 given by 0 0 0 0 0 0 0 0.0061 0.0061 0 0 0 0.0061 0 0 0.0061 0 0 0 0 0 0 0 0 0 0 0 0.0242 0 0 0.0061 0.0182 0 0 0.0182 0  0.2 0.0121 0.0606 0.0121 0 0 0 0 0 0 0.0061 0.0061 0 0 0 0.0061 0 0 0 0 0.0061 0 0 0.0061 0.0364 0.1091 0.0364 0.4121  4.3. Phylogenetic invariants. We compare the phylogenetic invariants of these two trees com- puted with respect to the (cid:96)∞ and the (cid:96)1 norm. (1) from the PHYLIP tree T1 we obtain: (cid:107)ΦT1(P )(cid:107)(cid:96)∞ = max{ max φ(P ), φ(P ), max (cid:107)ΦT1(P )(cid:107)(cid:96)1 = φ∈3×3 minors of FlatT1,e1 (cid:88) φ(P ) + max φ∈3×3 minors of FlatT1,e2 (cid:88) φ(P ) + φ∈3×3 minors of FlatT1,e1 φ∈3×3 minors of FlatT1,e2 (2) for the historically correct tree T2 we find: (cid:107)ΦT2(P )(cid:107)(cid:96)∞ = max{ max φ(P ), max φ(P ), max (cid:107)ΦT2(P )(cid:107)(cid:96)1 = φ∈3×3 minors of FlatT2,e1 (cid:88) φ(P ) + φ∈3×3 minors of FlatT2,e2 (cid:88) φ(P ) + φ∈3×3 minors of FlatT2,e1 φ∈3×3 minors of FlatT2,e2 φ(P )} = 0.89579 × 10−3 φ(P ) = 0.24790 × 10−1 φ(P )} = 0.89579 × 10−3 φ(P ) = 0.22681 × 10−1 φ∈3×3 minors of FlatT1,e3 (cid:88) φ∈3×3 minors of FlatT1,e3 φ∈3×3 minors of FlatT2,e3 (cid:88) φ∈3×3 minors of FlatT2,e3 ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 37 Once again we see that the (cid:96)1 norm reliably distinguishes the historically correct tree T2 over the incorrect PHYLIP candidate, while the (cid:96)∞ norm gives the same result for both candidate trees and does not help distinguishing them. 4.4. Estimate of the Euclidean distance. We also compute a lower bound estimate on the In the case of the first tree T1 The Euclidean distances of the flattening Euclidean distance. matrices from the respective determinantal varieties are given by D1,1 = dist(FlatT1,e1,D2(4, 16)), D1,2 = dist(FlatT1,e2,D2(8, 8)), D1,3 = dist(FlatT1,e3,D2(16, 4)). The singular values of the flattening matrices are given, respectively, by Σ(FlatT1,e1) = (0.4320, 0.2075, 0.14766 × 10−1, 0.8211 × 10−2) while the singular values of FlatT1,e2 are given by (0.4299, 0.2115, 0.1390×10−1, 0.8586×10−2, 0.7806×10−2, 0.4896×10−2, 0.8464×10−3, 0.1867×10−3) and Σ(FlatT1,e3) = (0.4299, 0.2118, 0.1332 × 10−1, 0.7593 × 10−2). Thus, the Euclidean distances are given, respectively, by 1,1 = 0.2854 × 10−3 D2 1,2 = 0.3525 × 10−3 D2 1,3 = 0.2351 × 10−3 D2 For the second tree T2 the Euclidean distances of the flattening matrices to the corresponding determinantal varieties are given by 2,1 = 0.1390 × 10−3, D2 which is computed using the singular values Σ(FlatT2,e1) = (0.4300, 0.2119, 0.8567 × 10−2, 0.8102 × 10−2), 2,2 = 0.3390 × 10−3 D2 computed using the singular values Σ(FlatT2,e2) given by (0.4299, 0.2115, 0.14218× 10−1, 0.6889× 10−2, 0.6061× 10−2, 0.6007× 10−2, 0.4070× 10−2, 0.7823× 10−19) and 2,3 = 0.2854 × 10−3 D2 with singular values Σ(FlatT2,e3) = (0.4320, 0.2075, 0.1477 × 10−1, 0.8211 × 10−2). Thus if we compare the likelihood of the two models T1 and T2 using the maximum between the distances as a lower bound for the Euclidean distance to the phylogenetic variety we find L1 = max{D2 L2 = max{D2 1,1, D2 1,2, D2 1,3} = 0.3525 × 10−3 2,3} = 0.3390 × 10−3, 2,1, D2 2,2, D2 hence L2 < L1, which also favors the historically correct tree T2: 38 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI Latin Romanian Italian French Spanish Portuguese 5. Phylogenetic Algebraic Varieties of the Slavic Languages We then consider a set of Slavic languages: (cid:96)1 = Russian, (cid:96)2 = Polish, (cid:96)3 = Bulgarian, (cid:96)4 = Serb-Croatian, (cid:96)5 = Slovenian, for which we again use a combination of SSWL and Longobardi data. The PHYLIP most parsimonious trees algorithm produces in this case five candidate trees when run on this combination of syntactic data. We use additional linguistic information on where the root vertex should be placed, separating the West-Slavic branch where Polish resides from the part of the tree that contains both the East-Slavic branch and the South-Slavic branch. We see then that the candidate trees are respectively given by T1 = (cid:96)2 (cid:96)1 (cid:96)3 (cid:96)5 (cid:96)4 T4 = T2 = (cid:96)2 (cid:96)1 (cid:96)2 (cid:96)3 (cid:96)1 (cid:96)4 (cid:96)5 (cid:96)4 (cid:96)5 T5 = (cid:96)3 (cid:96)2 T3 = (cid:96)2 (cid:96)1 (cid:96)3 (cid:96)4 (cid:96)5 (cid:96)1 (cid:96)3 (cid:96)4 (cid:96)5 (1) The first tree T1 incorrectly places Bulgarian in closer proximity to Serb-Croatian than Slovenian. (2) The second tree T2 has a similar misplacement, with Bulgarian appearing to be in greater proximity to Slovenian than Serb-Croatian. (3) The third tree T3 correctly places Slovenian and Serb-Croatian in closest proximity, and it also correctly places Bulgarian in the same South-Slavic subbranch with the pair of Slovenian and Serb-Croatian, so it corresponds to the correct tree topology that matches what is known from historical linguistics. (4) The fourth tree T4 misplaces Bulgarian in the West-Slavic branch with Polish instead of placing it in the South-Slavic branch. (5) The fifth tree T5 misplaces Bulgarian in the East-Slavic branch with Russian instead of placing it in the South-Slavic branch. 5.1. Flattening matrices. The flattening matrices for these trees are given by the following (1) For the tree T1 the flattening matrices are 0.5122 0.0 0.0122  0.0 0.0 0.0 0.0 0.0122 0.0 0.0854 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0  0.0 0.0 0.0 0.0610 0.0 0.0122 0.0 0.3049 FlatT1,e1 = ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 39 0.5122 0.0854 0.0 0.0 FlatT1,e2 = 0.0 0.0 0.0 0.0122 0.0 0.0 0.0 0.0122 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0610 0.0 0.0 0.0122 0.0 0.0 0.3049  (2) For the tree T2 the flattening matrices are FlatT3,e2 = 0.0 0.0 0.0 0.0610 0.0854 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0122 0.0 0.0 0.0 0.0 0.3049 0.0 (4) For the tree T4 the flattening matrices are 0.5122 0.0122 0.0854 FlatT4,e2 = 0.0854 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0122 0.0 0.0 0.0 0.0 0.3049 0.0   (3) For the tree T3 the flattening matrices are 0.5122 0.0122 0.0 0.0 0.0 0.0 0.0 0.0 FlatT2,e2 = FlatT2,e1 =    0.5122 0.0 0.0122  0.5122 0.0 0.0122 0.0 0.0 0.0122 0.0 0.0 0.0 0.0122 0.0 0.0 0.0 0.0 0.0 FlatT3,e1 = FlatT4,e1 = 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0122 0.5122 0.0 0.0122 0.0 0.0 0.0 0.0 0.0122 0.0 0.0854 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0610 0.0122 0.3049 0.0 0.0854 0.0122 0.0 0.0 0.0 0.0 0.0 0.0610 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0122 0.3049 0.5122 0.0 0.0122 0.0 0.0 0.0 0.0 0.0122 0.0 0.0854 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0610 0.0122 0.3049     0.0 0.0 0.0 0.0 0.0 0.0 0.0122 0.3049 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0610 0.0 0.0 0.0 0.0610 40 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI (5) For the tree T5 the flattening matrices are  0.0854 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0122 0.3049 0.5122 0.0 0.0 FlatT5,e1 = 0.0122 0.0122  0.5122 0.0 0.0122 0.0 0.0 0.0122 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0610 0.0 0.0 0.0 0.0610  0.0854 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0122 0.0 0.0 0.0 0.0 0.3049 0.0 FlatT5,e2 = 5.2. Phylogenetic invariants. When evaluating the phylogenetic invariant for the boundary probability distribution given by the combination of the SSWL and Longobardi data we have the following result (1) For the tree T1: (2) For the tree T2: (3) For the tree T3: (4) For the tree T4: (cid:107)ΦT1(P )(cid:107)(cid:96)∞ = max{ max (cid:88) φ∈3×3 minors of FlatT1,e1 (cid:107)ΦT1(P )(cid:107)(cid:96)1 = φ(P ) + φ(P ), φ∈3×3 minors of FlatT1,e1 (cid:107)ΦT2(P )(cid:107)(cid:96)∞ = max{ max (cid:88) φ∈3×3 minors of FlatT2,e1 (cid:107)ΦT2(P )(cid:107)(cid:96)1 = φ(P ) + φ(P ), φ∈3×3 minors of FlatT2,e1 (cid:107)ΦT3(P )(cid:107)(cid:96)∞ = max{ max (cid:88) φ∈3×3 minors of FlatT3,e1 (cid:107)ΦT3(P )(cid:107)(cid:96)1 = φ(P ) + φ(P ), φ∈3×3 minors of FlatT3,e1 (cid:107)ΦT4(P )(cid:107)(cid:96)∞ = max{ max (cid:88) φ∈3×3 minors of FlatT4,e1 (cid:107)ΦT4(P )(cid:107)(cid:96)1 = φ(P ) + φ(P ), φ∈3×3 minors of FlatT4,e1 max φ∈3×3 minors of FlatT1,e2 (cid:88) φ∈3×3 minors of FlatT1,e2 max φ∈3×3 minors of FlatT2,e2 (cid:88) φ∈3×3 minors of FlatT2,e2 max φ∈3×3 minors of FlatT3,e2 (cid:88) φ∈3×3 minors of FlatT3,e2 max φ∈3×3 minors of FlatT4,e2 (cid:88) φ∈3×3 minors of FlatT4,e2 φ(P )} = 0.19043 × 10−2 φ(P ) = 0.31794 × 10−2 φ(P )} = 0.19043 × 10−2 φ(P ) = 0.36582 × 10−2 φ(P )} = 0.38087 × 10−3 φ(P ) = 0.90864 × 10−3 φ(P )} = 0.38087 × 10−3 φ(P ) = 0.13621 × 10−2 ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 41 (5) For the tree T5: (cid:107)ΦT5(P )(cid:107)(cid:96)∞ = max{ max (cid:88) φ∈3×3 minors of FlatT5,e1 (cid:107)ΦT5(P )(cid:107)(cid:96)1 = φ(P ) + φ(P ), φ∈3×3 minors of FlatT5,e1 max φ∈3×3 minors of FlatT5,e2 (cid:88) φ∈3×3 minors of FlatT5,e2 φ(P )} = 0.38087 × 10−3 φ(P ) = 0.17175 × 10−2 For this set of languages we see again, as observed in [6], that the (cid:96)1 norm is a better test than the (cid:96)∞ norm for the evaluation of the phylogenetic invariants. While the (cid:96)∞ norm does not distinguish between the trees T3, T4, T5, the (cid:96)1 norm correctly singles out T3 as the preferred candidate. 5.3. Estimates of Euclidean distance. The matrix A = FlatT1,e1 = FlatT2,e1 = FlatT3,e1 has singular values Σ(A) = (0.5195, 0.3111, 0.2023 × 10−2, 0.2577 × 10−17, 0, 0, 0, 0). The matrix B = FlatT3,e2 = FlatT4,e2 = FlatT5,e2 has singular values Σ(B) = (0.5196, 0.3110, 0.2391 × 10−2, 0). The remaining matrices have Σ(FlatT1,e2) = (0.5194, 0.3112, 0.1196 × 10−1, 0.2003 × 10−2), Σ(FlatT2,e2) = (0.5194, 0.3112, 0.1220 × 10−1, 0.2004 × 10−2, 0, 0, 0, 0), Σ(FlatT4,e1) = (0.5195, 0.3111, 0.2438 × 10−2, 0.1964 × 10−2, 0, 0, 0, 0), Σ(FlatT5,e1) = (0.5195, 0.3111, 0.2834 × 10−2, 0.2390 × 10−2, 0, 0, 0, 0). The computation of the Euclidean distances then gives (1) For the tree T1 dist(FlatT1,e1,D2(4, 8))2 = σ2 dist(FlatT1,e2,D2(8, 4))2 = σ2 3 + ··· σ2 3 + σ2 8 = 0.4094 × 10−5 4 = 0.1470 × 10−3 (2) For the tree T2 dist(FlatT2,e1,D2(4, 8))2 = σ2 dist(FlatT2,e2,D2(4, 8))2 = σ2 3 + ··· σ2 3 + ··· σ2 8 = 0.4094 × 10−5 8 = 0.1527 × 10−3 (3) For the tree T3 dist(FlatT3,e1,D2(4, 8))2 = σ2 dist(FlatT3,e2,D2(4, 8))2 = σ2 3 + ··· σ2 3 + ··· σ2 8 = 0.4094 × 10−5 8 = 0.5718 × 10−5 (4) For the tree T4 dist(FlatT4,e1,D2(4, 8))2 = σ2 dist(FlatT4,e2,D2(4, 8))2 = σ2 3 + ··· σ2 3 + ··· σ2 8 = 0.9803 × 10−5 8 = 0.5718 × 10−5 (5) For the tree T5 dist(FlatT5,e1,D2(4, 8))2 = σ2 dist(FlatT5,e2,D2(4, 8))2 = σ2 3 + ··· σ2 3 + ··· σ2 8 = 0.1374 × 10−4 8 = 0.5718 × 10−5 The lower bounds on the Euclidean distance function obtained above indicate as preferred candidate the tree T3, which is the correct linguistic tree: 42 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI Polish Russian Bulgarian Serb-Croatian Slovenian 6. Phylogenetic Algebraic Varieties of the early Indo-European tree We now discuss the last phylogenetic problem listed in the Introduction, namely the early branchings of the Indo-European tree involving the set of languages Hittite, Tocharian, Albanian, Armenian, and Greek. We analyze here the difference between the trees of [7] and [41], when seen from the point of view of Phylogenetic Algebraic Geometry. 6.1. Trees and phylogenetic invariants. Once we restrict our attention to the five languages listed above, the trees of [7] and [41] that we wish to compare result in the smaller five-leaf trees Hittite for the case computed by [7], and the tree Tocharian Armenian Albanian Greek Hittite Tocharian Albanian Armenian Greek for the case computed by [41]. Forgetting momentarily the position of the root vertex (which is in both trees adjacent to the Anatolian branch), we are comparing two trees of the form where we have (cid:96)1 = Tocharian, (cid:96)2 = Armenian, (cid:96)3 = Hittite, (cid:96)4 = Albanian, (cid:96)5 = Greek. In both cases the flattenings of the tree are given by the matrices ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 43 and the phylogenetic ideal of the tree is generated by all the 3 × 3 minors of these two matrices. In order to compare the two possibilities then, we evaluate the phylogenetic invariants (the generators of the phylogenetic ideal obtained in this way) on the boundary distribution obtained from the data of SSWL variables for the five languages, distributed in the leaves of the tree in one of the two ways described above, and we compute the Euclidean distance function. 6.2. Syntactic structures and boundary distributions. One of the main problems with the SSWL database is that the binary variables of syntactic structures are very non-uniformly mapped across languages. In order to use the data for phylogenetic reconstruction, it is necessary to restrict to only those variables that are completely mapped for all the languages considered. In our present case, some of the languages are very poorly mapped in the SSWL database: Tocharian A is only 19% mapped, Tocharian B 18%, Hittite is 32% mapped, Albanian 69%, Armenian 89% and (Ancient) Greek is also 89% mapped. Moreover, not all the 29 binary syntactic variables that are mapped for Tocharian A are also among the variables mapped for Hittite. This reduces the list of syntactic variables that are completely mapped for all five of these languages to a total of only 22 variables. The variables (listed with the name used in the SSWL database) and the resulting values are given in the table below. Based on these data, the boundary distribution for the two cases considered above is given by the following. In the first case the frequencies are given by p00000 = 4/11, p11111 = 3/11, p11101 = 2/11, p11011 = 1/22, p10111 = 1/11, p01000 = 1/22 with pi1,...,i5 = 0 for all the remaining binary vectors in {0, 1}5. frequencies In the second case we have p00000 = 4/11, p11111 = 3/11, p11011 = 2/11, p10111 = 1/22, p11101 = 1/11, p00010 = 1/22 with pi1,...,i5 = 0 for all the remaining binary vectors in {0, 1}5. 44 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI [Tocharian A, Hittite, Albanian, Armenian, A.Greek] P 01 06 11 12 13 15 17 19 21 A01 A02 Neg 01 Neg 03 Neg 04 Neg 07 Neg 08 Neg 09 Neg 10 Neg 12 Neg 13 Neg 14 Order N3 01 [1,1,1,1,1] [1,1,0,1,1] [1,0,1,1,1] [1,1,1,1,1] [1,1,0,1,1] [1,1,1,1,1] [1,1,1,1,1] [1,1,0,1,1] [1,1,0,1,1] [1,1,1,0,1] [1,1,1,0,1] [1,1,1,1,1] [0,0,0,1,0] [0,0,0,0,0] [0,0,0,0,0] [0,0,0,0,0] [0,0,0,0,0] [0,0,0,0,0] [0,0,0,0,0] [0,0,0,0,0] [0,0,0,0,0] [1,1,1,1,1] For the first case, the flattening matrices evaluated at the boundary distribution P give the matrices    0 0 1 11 3 11 4 11 0 0 1 22 0 0 0 0 0 0 0 0  4 11 0 1 22 0 0 0 0 0 0 0 0 0 0 0 1 22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 11 0 2 11 0 0 0 0 0  0 0 0 0 0 0 0 1 11 1 22 3 11  4 11 0 0 0 0 0 0 0 1 22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 11 0 1 11 0 0 0 1 22 3 11 For the second case, on the other hand, we obtain the matrices ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 45   4 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 11 1 22 0 0 0 0 0 0 0 0 0 0 0 0 1 22 2 11 3 11 6.3. Phylogenetic invariants. The evaluation of the phylogenetic invariants on these two bound- ary distributions by evaluating the 3 × 3 minors of the matrices above gives (1) For the Gray-Atkins tree T1: (cid:107)ΦT1(P )(cid:107)(cid:96)∞ = (cid:107)ΦT1(P )(cid:107)(cid:96)1 = max φ∈3×3minors of flattenings of T1 (cid:88) φ∈3×3minors of flattenings of T1 (2) For the Ringe -- Warnow -- Taylor tree T2: (cid:107)ΦT1(P )(cid:107)(cid:96)∞ = (cid:107)ΦT1(P )(cid:107)(cid:96)1 = max φ∈3×3minors of flattenings of T1 (cid:88) φ∈3×3minors φ(P ) = φ(P ) = φ(P ) = φ(P ) = 8 1331 61 2662 8 1331 18 1331 On the basis of this naive test of evaluation of the phylogenetic invariants, the (cid:96)∞ norm does not distinguish the two trees while the (cid:96)1 norm prefers the Ringe -- Warnow -- Taylor tree T2. We show below that this preference is also confirmed by an estimation of the Euclidean distance. of flattenings of T1 6.4. Estimate of the Euclidean distance function. In this case, in order to obtain a lower bound estimate of the Euclidean distance as an estimate of likelihood of the two trees T1 and T2, we compute the distances D1,1 = dist(Flate1,T1(P ),D2(4, 8)), D1,2 = dist(Flate2,T2(P ),D2(8, 4)) with the Euclidean distance estimate of T1 given by L1 = max{D1,1, D1,2} and D2,1 = dist(Flate1,T2(P ),D2(4, 8)), D2,1 = dist(Flate2,T2(P ),D2(8, 4)) with the Euclidean distance estimate of T2 given by L2 = max{D2,1, D2,2}. The computation of the singular values Σ = (σ1, . . . , σ4) of the flattening matrices Flatei,Tj (P ) gives Σ(Flate1,T1(P )) = diag(0.3664662612, 0.3394847389, 0.5018672314 × 10−1, 0) Σ(Flate2,T1(P )) = diag(0.3664662612, 0.3388120907, 0.5454321492 × 10−1, 0) Σ(Flate1,T2(P )) = diag(0.3664662613, 0.3421098124, 0.2700872640 × 10−1, 0) Σ(Flate2,T2(P )) = diag(0.3664662613, 0.3394847388, 0.5018672301 × 10−1, 0). 46 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI Since the last singular value is always zero, the Euclidean distances are given by the σ3 value D1,1 = 0.5018672314 × 10−1, D1,2 = 0.5454321492 × 10−1, D2,1 = 0.2700872640 × 10−1, D2,1 = 0.5018672301 × 10−1 This gives L1 = 0.5454321492 × 10−1 and L2 = 0.5018672301 × 10−1. Thus, the Euclidean distance estimate also favors the Ringe -- Warnow -- Taylor tree T2 over the Gray-Atkins tree T1. The fact that there are very few parameters that are mapped (at present time) for all of these languages in the SSWL database, and that these parameters largely agree on this set of languages, however make this analysis not fully reliable. A more extensive set of syntactic data for these languages would be needed to confirm whether the phylogenetic reconstruction based on syntactic data and the algebro-geometric method is reliable. 7. Towards larger phylogenetic trees: grafting As we have seen in the previous sections, Phylogenetic Algebraic Geometry is a procedure that associates to a given language family L = {(cid:96)1, . . . , (cid:96)n} an algebraic variety Y = Y (L, P ) constructed on the basis of the syntactic variables (listed in the distribution P ). A possible geometric viewpoint on comparative historical linguistics can then be developed, by considering the geometry of the varieties Y (L, P ) for different language families. This contains more information than the topology of the tree by itself, in the sense that one can, for example, look more specifically for the position of the point P on the variety. The point P contains precise information on how the binary syntactic variables change across the languages in the family. For example, in the case of the six Germanic languages in the set S1(G), we see from our table of occurrences that only very few possibilities for the binary vector (i1, . . . , i6) occur for these six languages. We also see that, apart from the cases where the value of a syntactic variable agrees in all six languages (40 occurrences where the feature is not expressed, and 22 where it is), we find that it is more likely for Icelandic to have a feature that differs from the other languages in the group (4 occurrences of (0, 0, 0, 0, 1, 0) of lacking a features the others have and 3 occurrences of (1, 1, 1, 1, 0, 1) for having a feature that the others lack). Thus, the location of the point P on the variety contains information that is related to the spreading of syntactic features across the language family considered. This geometric way of thinking may be compared with the coding theory approach of [29], [44] to measuring the spread of syntactic features across a language family. As we have seen in the example discussed above of a small set of Germanic languages, as well as in the examples with Romance and Slavic languages, the use of SSWL data is suitable for phylogenetic reconstruction, provided only the subset of the completely mapped syntactic variables (for the given set of languages) is used and the candidate phylogenetic trees are selected through the computation of phylogenetic invariants, and their evaluation at the boundary distribution determined by the syntactic variables. This method works very well for small trees and for a set of languages that is well mapped in the available databases (with enough binary syntactic variables that are mapped for all the languages in the given set). However, one then needs a way to combine phylogenetic trees of smaller subfamilies into those of larger families. In terms of Phylogenetic Algebraic Geometry, this procedure can be articulated as follows, see §5 -- 8 of [1]. Given two binary trees T (cid:48) and T (cid:48)(cid:48), respectively with n and m leaves, the grafting T = T (cid:48) (cid:63)(cid:96) T (cid:48)(cid:48) at a leaf (cid:96) is the binary tree obtained by gluing together a leaf of T (cid:48) with marking (cid:96) to a leaf of T (cid:48)(cid:48) with the same marking. The resulting tree T has n + m − 2 leaves. It is shown in [1] how the phylogenetic invariants of T depend on the invariants of T (cid:48) and T (cid:48)(cid:48). Consider the maps ΦT (cid:48) and ΦT (cid:48)(cid:48), defined as in (2.2) using (2.1), with values in C2n and C2m, respectively. We ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 47 identify C2n = C2n−1 ⊗ C2, where the last binary variable corresponds to the leaf (cid:96). We then identify the affine space C2n−1 ⊗ C2 (cid:39) Hom(C2n−1∨ , C2) with the space of matrices M2n−1×2(C), and similarly with C2m (cid:39) M2×2m−1(C). One then defines ΦT = ΦT (cid:48) (cid:63) ΦT (cid:48)(cid:48) as the matrix product of the elements in the range of ΦT (cid:48), seen as matrices in M2n−1×2(C) with the elements in the range of ΦT (cid:48)(cid:48), seen as matrices in M2×2m−1(C). This results in a matrix in M2n−1×2m−1(C)), which gives a map ΨT with values in Cn+m−2. The domain variables of ΨT are obtained as follows. For those edges of T not involved in the grafting operation, we define the 2 × 2 matrices M e to be the same as those originally associated to the edges of T (cid:48) or T (cid:48)(cid:48), respectively. For the edge of T (cid:48) and the edge of T (cid:48)(cid:48) that are glued together in the grafting, we replace the respective matrices M e(cid:48) and M e(cid:48)(cid:48) by their product M e = M e(cid:48) . Dually, as in (2.3), this determines the map ΨT of polynomial rings, whose kernel is the phylogenetic ideal of T . The closure in Cn+m−2 of the image of ΨT is the phylogenetic algebraic variety of the grafted tree T = T (cid:48) (cid:63)(cid:96) T (cid:48)(cid:48). M e(cid:48)(cid:48) Suppose we are interested in the phylogenetic tree of a language family L, for which we assume that we already know (from other linguistic input) a subdivision into several subfamilies L = L1 ∪ ··· ∪ LN . Suppose also that for the language families taken into consideration there are sufficient data available about the ancient languages. (This requirement will limit the applicability of the algorithm discussed here to families like the Indo-European, where significant amount of data about ancient languages is available.) We can then follow the following procedure to graft phylogenetic trees of the subfamilies Lk into a larger phylogenetic tree for the family L. (1) For each subfamily Lk = {(cid:96)k,1, . . . , (cid:96)k,nk}, consider the list of SSWL data that are com- pletely mapped for all the languages (cid:96)k,j in the subfamily Lk. (2) On the basis of that set of binary syntactic variables, a preferred candidate phylogenetic tree Tk is constructed based on the method illustrated above in the example of the Germanic languages. (3) Us the procedure discussed in §3.5 above to identify the best location of the root vertex for each tree Tk, and regard each tree Tk as a tree with nk + 1 leaves, including one leaf attached to the root vertex. (4) Let {λ1, . . . , λN} be the ancient languages located at the root vertex of each tree T1, . . . , TN . Consider the list of SSWL parameters that are completely mapped for all the ancient languages λk. (5) On the basis of that set of binary syntactic variables, select preferred candidate phylogenetic tree T with N leaves, by evaluating the phylogenetic invariants of these trees on the boundary distribution given by this set of binary syntactic variables. (6) Graft the best candidate tree T to the trees Tk by gluing the leaf λk of T to the root of Tk. (7) The phylogenetic invariants of the resulting grafted tree T (cid:48) = T (cid:63)N k=1 Tk can be computed with the grafting procedure of [1] described above and evaluation at the boundary dis- tribution given by the leaves {(cid:96)k,j j = 1, . . . , nk, k = 1, . . . , N} of T (cid:48) (coming from the smaller set of syntactic variables that are completely mapped for all the (cid:96)k,j) can confirm the selected tree topology T (cid:48). The advantage of this procedure is that it is going to work even in the absence of a sufficient number of binary syntactic variables in the SSWL database that are completely mapped for all of the languages (cid:96)k,j at the same time, provided there are enough for each subset Lk and for In cases where the number of variables that are completely mapped for all the (cid:96)k,j is the λk. significantly smaller compared to those that are mapped within each group, the last test on the tree T (cid:48) becomes less significant. This method also has the advantage that one works with the smaller subtrees Tk and T , rather than with the bigger tree given by their grafting, so that the computations of phylogenetic invariants is more tractable. 48 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI In the case of language families where one does not have syntactic data of ancient languages available, one can still adapt the procedure described above, provided there is a reasonable number of SSWL variables that are completely mapped for all the languages (cid:96)k,j in L. One can proceed as follows. (1) For each subfamily Lk = {(cid:96)k,1, . . . , (cid:96)k,nk}, consider the list of data that are completely mapped for all the languages (cid:96)k,j in the subfamily Lk. (2) On the basis of that set of binary syntactic variables, a preferred candidate phylogenetic tree Tk is constructed based on the method illustrated above in the example of the Germanic languages. (3) Consider all possible choices of a root vertex for each Tk (there are as many choices as the number of internal edges of Tk). above. k=1 Tk. Tk to obtain a candidate tree T (cid:48) = T (cid:63)N (4) Consider all the possible candidate tree topologies T with N leaves. (5) For each choice of a root vertex in each Tk graft a choice of T to the give roots of the trees (6) Compute the phylogenetic invariants of T (cid:48) = T (cid:63)N k=1 Tk using the procedure of [1] recalled (7) Evaluate the phylogenetic invariants of each candidate T (cid:48) on the boundary distribution de- termined by the binary syntactic variables that are completely mapped for all the languages {(cid:96)k,j j = 1, . . . , nk, k = 1, . . . , N}, to select the best candidate among the T (cid:48). There are serious computational limitations to this procedure, however, because of how fast the number of trees on N leaves grows. While the grafting procedure discussed above makes it possible to work with smaller trees and then consider the problem of grafting them into a larger tree, this would still only work computationally for small size trees, and cannot be expected to handle, for example, the entire set of languages recorded in the SSWL database. 8. Modifying the setting to account for syntactic relations In a followup to this paper, based on the ongoing analysis of [33], we will discuss how to adjust these phylogenetic models to incorporate deviations from the assumption that the syntactic parameters are i.i.d. random variables evolving according to the same Markov model on a tree. Indeed, we know from various data analysis of the syntactic variables, including topological data analysis [39], [40], methods of coding theory [44], and recoverability in Kanerva networks [37], that the syntactic parameters are certainly not i.i.d. variables. Thus, it is likely that some discrepancies we observed in this paper, in the application of the Phylogenetic Algebraic Geometry method (for example in the case of the Romance languages or the early Indo-European languages where the tree selected by the Euclidean distance is not the same as the tree favored by the phylogenetic invariants) may be an effect of the use of this overly simplified assumption. The approach we plan to follow to at least partially correct for this problem, is to modify the boundary distribution on the tree by attaching to the different syntactic parameters a weight that comes from some measure of its dependence from other parameters, in such a way that parameters that are more likely to be dependent variables according to one of these tests will weight less in the boundary distribution than parameters that are more likely to be truly statistically independent variables. The main idea on how to achieve this gola is to modify the boundary distribution P by counting occurrences ni1,...,in of parameter values (i1, . . . , in) at the n leaves of the tree by introducing weights for different parameters that measure their degree of independence. An example of such a weight would be the degree of recoverability in a Kanerva network, as in [37], or a computation of clustering coefficients as in [33]. ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 49 This means that, instead of assigning to a given binary vector (i1, . . . , in) the frequency pi1,...,in = ni1,...,in N with N total number of parameters and ni1,...,in number of parameters that have values (i1, . . . , in) on the n languages at the leaves of the tree, we replace this by a new distribution ni1,...,in(cid:88) i1,...,in = Z−1 p(cid:48) w(πr) r=1 where for a syntactic parameter π the weight w(π) measures the degree of independence of π, for example with w(π) close to 1 the more π can be regarded as an independent variable and close to 0 the more π is recoverable from the other variables, with Z a normalization factor so that p(cid:48) is again a probability distribution. With this new boundary distribution P (cid:48) we will recompute the Euclidean distances of the flat- tening matrices Flate(P (cid:48)) from the varieties D2(a, b) by computing the singular values (σ1, . . . , σa) of Flate(P (cid:48)) and computing the square-distance as σ2 a, and compare the new distances obtained in this way with those of the original boundary distribution P . 3 + ··· + σ2 i1,...,in Results on this approach will be presented in forthcoming work. 50 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI Appendix A: SSWL syntactic variables of the set S1(G) of Germanic languages We list here the 90 binary syntactic variables of the SSWL database that are completely mapped for the six Germanic languages (cid:96)1 =Dutch, (cid:96)2 =German, (cid:96)3 =English, (cid:96)4 =Faroese, (cid:96)5 =Icelandic, (cid:96)6 =Swedish. The column on the left in the tables lists the SSWL parameters P as labeled in the database. ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 51 Appendix B: SSWL syntactic variables of the set S2(G) of Germanic languages We list here the 90 binary syntactic variables of the SSWL database that are completely mapped for the seven Germanic languages (cid:96)1 =Norwegian, (cid:96)2 =Danish, (cid:96)3 =Gothic, (cid:96)4 =Old English, (cid:96)5 =Icelandic, (cid:96)6 =English, (cid:96)7 =German. The column on the left in the tables lists the SSWL parameters P as labeled in the database. 52 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI Appendix C: Flattening matrices F5 and F6 The remaining flattening matrices (written in transpose form for convenience) for the T5 and T6 trees, in the case of the Longobardi data are given by the following: F t 5 = F t 6 =  4 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 42 0 0 0 0 0 0 0 1 42 0 0 0 0 0 0 0 1 42 0 0 0 0 0 0 0 0 0 0 0 1 42 1 42 0 0 2 7   4 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 42 0 0 0 1 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 42 0 0 0 0 0 0 0 1 42 0 0 0 0 0 0 0 1 42 0 0 0 0 0 0 0 0 0 0 0 0 1 42 0 0 2 7  ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 53 The same flattening matrices for the SSWL data are given by the following. F t 5 = F t 6 =   13 34 0 0 0 3 68 0 0 0 1 68 0 0 0 0 0 0 0 1 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 68 0 0 0 1 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 68 0 0 0 0 1 34 0 0 1 68 1 68 0 0 0 0 0 0 0 1 34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 34 0 0 0 3 68 0 0 0 0 1 68 0 1 68 1 68 0 0 0 1 68 0 0 0 1 68 0 0 0 0 1 68 0 0 0 0 0 0 1 68 0 0 0 4 17   13 34 0 0 0 1 34 0 0 1 68 1 68 0 0 0 0 0 0 0 1 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 34 1 68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 68 0 0 0 0 0 0 0 0 0 0 0 1 68 0 0 0 1 68 3 68 0 0 0 1 68 0 0 0 0 0 0 0 1 34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 68 1 68 0 0 0 1 68 0 1 68 1 68 0 0 0 0 0 0 0 1 68 0 0 0 0 1 68 0 0 0 0 0 0 0 0 0 0 4 17 54 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI Appendix D: list of LanGeLin syntactic parameters ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 55 Acknowledgment. The first and second author were partially supported by a Summer Un- dergraduate Research Fellowship at Caltech. The last author is partially supported by NSF grant DMS-1707882, NSERC Discovery Grant RGPIN-2018-04937, Accelerator Supplement grant RGPAS-2018-522593, and by the Perimeter Institute for Theoretical Physics. We are very grateful to the two anonymous referees for many very useful comments, corrections, and suggestions that greatly improved the paper. References [1] E. Allman, J. Rhodes, Phylogenetic ideals and varieties for general Markov models, Adv. Appl. Math. Vol.40 (2008) 127 -- 148. [2] D.W. Anthony, D. Ringe, The indo-european homeland from linguistic and archaeological perspectives, Annual Review of Linguistics 1 (2015) 199 -- 219. [3] M. Baker, The Atoms of Language, Basic Books, 2001. [4] F. Barban¸con, S.N. Evans, L. Nakhleh, D. Ringe, T. Warnow, An experimental study comparing linguistic phylogenetic reconstruction methods, Diachronica, Vol.30 (2013) N.2, 143 -- 170. [5] C. Bocci, Topics in phylogenetic algebraic geometry, Expo. Math. 25 (2007) 235 -- 259. [6] M. Casanellas, J. Fern´andez -- S´anchez, Performance of a new invariants method on homogeneous and nonho- mogeneous quartet trees, Mol. Biol. Evol. 24 (2007) N.1, 288 -- 293. [7] R. Bouckaert, P. Lemey, M. Dunn, S.J. Greenhill, A.V. Alekseyenko, A.J. Drummond, R.D. Gray, M.A. Suchard, Q.D. Atkinson, Mapping the origins and expansion of the Indo-European language family, Science, Vol.337 (2012) 957 -- 960. [8] W. Bruns, U. Vetter, Determinantal rings, Lecture Notes in Mathematics, Vol.1327, Springer, 1988. [9] D. Cartwright, M. Habich, B. Sturmfels, A. Werner, Mustafin varieties, Selecta Math. (N.S.) 17 (2011), no. 4, 757 -- 793. [10] N. Chomsky, Lectures on Government and Binding, Dordrecht: Foris Publications, 1982. [11] N. Chomsky, The Minimalist Program, 20th Anniversary Edition, MIT Press, 2015. [12] N. Chomsky, H. Lasnik, The theory of Principles and Parameters, in "Syntax: An international handbook of contemporary research", pp.506 -- 569, de Gruyter, 1993. [13] J. Draisma, E. Horobet¸, G. Ottaviani, B. Sturmfels, R. Thomas, The Euclidean distance degree of an algebraic variety, Found. Comput. Math. 16 (2016), no. 1, 99 -- 149. [14] N. Eriksson, Using invariants for phylogenetic tree construction, in "Emerging applications of algebraic geom- etry", pp. 89 -- 108, IMA Vol. Math. Appl., 149, Springer, 2009. [15] N. Eriksson, K. Ranestad, B. Sturmfels, S. Sullivant, Phylogenetic Algebraic Geometry, in "Projective varieties with unexpected properties", pp.237 -- 255, Walter de Gruyter, 2005. [16] P. Forster, C. Renfrew, Phylogenetic methods and the prehistory of language, McDonald Institute Monographs, 2006. [17] R.D. Gray, Q.D. Atkinson, Language-tree Divergence Times Support the Anatolian Theory of Indo-European Origin, Nature, vol.426 (2003) 6965, 435 -- 439 [18] D. Gusfield, Recombinatorics, MIT Press, 2014. [19] J. Harris, Algebraic Geometry, Springer, 2013. [20] D. Kazakov, G. Cordoni, E. Algahtani, A. Ceolin, M. Irimia, S.S. Kim, D. Michelioudakis, N. Radkevich, C. Guardiano, G. Longobardi, Learning Implicational Models of Universal Grammar Parameters, EVOLANG XII: 16 -- 19 April 2018, Torun, Poland. [21] S. Karimi, M. Piattelli-Palmarini (Eds.), Special Issue on Parameters, Linguistic Analysis, Vol.41 (2017) N. 3-4. [22] J. Hauenstein, J.I. Rodriguez, B. Sturmfels, Maximum likelihood for matrices with rank constraints, Journal of Algebraic Statistics 5 (2014) N.1, 18 -- 38 [23] G. Longobardi, Principles, Parameters, and Schemata. A constructivist UG, Linguistic Analysis, 41 (2017) N.3-4, 517 -- 556. [24] G. Longobardi, A minimalist program for parametric linguistics? in H. Broekhuis, N. Corver, M. Huybregts, U. Kleinhenz, J. Koster, (Eds.), "Organizing Grammar: Linguistic Studies for Henk van Riemsdijk", Mouton de Gruyter, 2005, pp. 407 -- 414. [25] G. Longobardi, Methods in parametric linguistics and cognitive history, Linguistic Variation Yearbook 3 (2003) 101 -- 138. [26] G. Longobardi, C. Guardiano, Evidence for syntax as a signal of historical relatedness, Lingua, 119 (2009) 1679 -- 1706. 56 K.SHU, A.ORTEGARAY, R.C.BERWICK, M.MARCOLLI [27] G. Longobardi, C. Guardiano, G. Silvestri, A. Boattini, A. Ceolin, Towards a syntactic phylogeny of modern Indo-European languages, Journal of Historical Linguistics, Vol.3 (2013) N.1, 122 -- 152. [28] G. Longobardi, A. Buch, A. Ceolin, A. Ecay, C. Guardiano, M. Irimia, D. Michelioudakis, N. Radkevich, G. Jaeger. 2016. Correlated evolution or not? phylogenetic linguistics with syntactic, cognacy, and phonetic data, in (S.G. Roberts, et al., Eds.) "The Evolution of Language: Proceedings of the 11th International Conference (EVOLANGX11)", 2016 Online at http://evolang.org/neworleans/papers/162.html. [29] M. Marcolli, Syntactic Parameters and a Coding Theory Perspective on Entropy and Complexity of Language Families, Entropy, vol.18 (2016), N.4 110 [17pages]. [30] L. Mirsky, Symmetric gauge functions and unitarily invariant norms, Quart. J. Math. Oxford (1966) 1156 -- 1159. [31] Y. Murawaki, Continuous space representations of linguistic typology and their application to phylogenetic inference, in "Human Language Technologies: The 2015 Annual Conference of the North American Chapter of the ACL" (2015) 324 -- 334. [32] L. Nakhleh, D. Ringe, T. Warnow, Perfect phylogenetic networks: a new methodology for reconstructing the evolutionary history of natural languages, Language Vol. 81 (2005) N.2, 382 -- 420. [33] A. Ortegaray, R.C. Berwick, M. Marcolli, Heat Kernel Analysis of Syntactic Structures, arXiv:1803.09832. [34] L. Pachter, B. Sturmfels, The Mathematics of Phylogenomics, SIAM Review, Vol.49 (2007) N.1, 3 -- 31. [35] L. Pachter, B. Sturmfels, Tropical geometry of statistical models, Proceedings of the National Academy of Sciences (PNAS) vol.101 (2004) N.46, 16132 -- 16137. [36] L. Pachter, B. Sturmfels, Algebraic Statistics for Computational Biology, Cambridge University Press, 2005. [37] J.J.Park, R.Boettcher, A.Zhao, A.Mun, K.Yuh, V.Kumar, M.Marcolli, Prevalence and recoverability of syn- tactic parameters in sparse distributed memories, in "Geometric Science of Information. Third International Conference GSI 2017", pp.265 -- 272, Lecture Notes in Computer Science, Vol.10589, Springer 2017. [38] A. Perelysvaig, M.W. Lewis, The Indo-European controversy: facts and fallacies in Historical Linguistics, Cambridge University Press, 2015. [39] A. Port, I. Gheorghita, D. Guth, J.M. Clark, C. Liang, S. Dasu, M. Marcolli, Persistent Topology of Syntax, Mathematics in Computer Science, 12 (2018) no. 1, 33 -- 50. [40] A. Port, M. Marcolli, Persistent topology and syntactic parameters of Indo-European languages, in preparation. [41] D. Ringe, T. Warnow, A. Taylor, Indo-European and computational cladistics, Transactions of the Philological Society, Vol.100 (2002) 59 -- 129. [42] L. Rizzi, On the format and locus of parameters: the role of morphosyntactic features, Linguistic Analysis, Vol.41 (2017) 159 -- 191. [43] J.P. Rusinko, B. Hipp, Invariant based quartet puzzling, Algorithms for Molecular Biology (2012) 7:35 [9 pages] [44] K. Shu, M. Marcolli, Syntactic structures and code parameters, Mathematics in Computer Science, 11 (2017), no. 1, 79 -- 90. [45] K.Shu, S.Aziz, V.L.Huynh, D.Warrick, M.Marcolli, Syntactic Phylogenetic Trees, arXiv:1607.02791, to appear in "Foundations of Mathematics and Physics one Century after Hilbert" (Joseph Kouneiher, Ed.) Springer Verlag. [46] K. Siva, J. Tao, M. Marcolli, Spin Glass Models of Syntax and Language Evolution, Linguistic Analysis, Vol.41 (2017) N.3-4, 559 -- 608. [47] B. Sturmfels, S. Sullivant, Toric Ideals of Phylogenetic Invariants, Journal of Computational Biology, Vol. 12 (2005) No. 2, 204 -- 228. [48] T. Warnow, Computational Phylogenetics, book to appear, manuscript available at http://tandy.cs.illinois.edu/textbook.pdf [49] T. Warnow, S.N. Evans, D. Ringe, L. Nakhleh, Stochastic models of language evolution and an application to the Indo-European family of languages, available at http://www.stat.berkeley.edu/users/evans/659.pdf [50] PHYLIP: http://evolution.genetics.washington.edu/phylip.html [51] SSWL Database of Syntactic Parameters: http://sswl.railsplayground.net/ ALGEBRAIC GEOMETRY OF INDO-EUROPEAN LANGUAGES 57 California Institute of Technology, USA E-mail address: [email protected] E-mail address: [email protected] Massachusetts Institute of Technology, USA E-mail address: [email protected] California Institute of Technology, USA Perimeter Institute for Theoretical Physics, Canada University of Toronto, Canada E-mail address: [email protected] E-mail address: [email protected]
1910.11450
1
1910
2019-10-24T23:00:12
An Empirical Study of Efficient ASR Rescoring with Transformers
[ "cs.CL", "eess.AS" ]
Neural language models (LMs) have been proved to significantly outperform classical n-gram LMs for language modeling due to their superior abilities to model long-range dependencies in text and handle data sparsity problems. And recently, well configured deep Transformers have exhibited superior performance over shallow stack of recurrent neural network layers for language modeling. However, these state-of-the-art deep Transformer models were mostly engineered to be deep with high model capacity, which makes it computationally inefficient and challenging to be deployed into large-scale real-world applications. Therefore, it is important to develop Transformer LMs that have relatively small model sizes, while still retaining good performance of those much larger models. In this paper, we aim to conduct empirical study on training Transformers with small parameter sizes in the context of ASR rescoring. By combining techniques including subword units, adaptive softmax, large-scale model pre-training, and knowledge distillation, we show that we are able to successfully train small Transformer LMs with significant relative word error rate reductions (WERR) through n-best rescoring. In particular, our experiments on a video speech recognition dataset show that we are able to achieve WERRs ranging from 6.46% to 7.17% while only with 5.5% to 11.9% parameter sizes of the well-known large GPT model [1], whose WERR with rescoring on the same dataset is 7.58%.
cs.CL
cs
AN EMPIRICAL STUDY OF EFFICIENT ASR RESCORING WITH TRANSFORMERS Hongzhao Huang, Fuchun Peng Facebook AI, Menlo Park, CA, USA 9 1 0 2 t c O 4 2 ] L C . s c [ 1 v 0 5 4 1 1 . 0 1 9 1 : v i X r a ABSTRACT Neural language models (LMs) have been proved to significantly outperform classical n-gram LMs for language modeling due to their superior abilities to model long-range dependencies in text and handle data sparsity problems. And recently, well config- ured deep Transformers have exhibited superior performance over shallow stack of recurrent neural network layers for language mod- eling. However, these state-of-the-art deep Transformer models were mostly engineered to be deep with high model capacity, which makes it computationally inefficient and challenging to be deployed into large-scale real-world applications. Therefore, it is important to develop Transformer LMs that have relatively small model sizes, while still retaining good performance of those much larger models. In this paper, we aim to conduct empirical study on training Trans- formers with small parameter sizes in the context of ASR rescoring. By combining techniques including subword units, adaptive soft- max, large-scale model pre-training, and knowledge distillation, we show that we are able to successfully train small Transformer LMs with significant relative word error rate reductions (WERR) through n-best rescoring. In particular, our experiments on a video speech recognition dataset show that we are able to achieve WERRs ranging from 6.46% to 7.17% while only with 5.5% to 11.9% parameter sizes of the well-known large GPT model [1], whose WERR with rescoring on the same dataset is 7.58%. Index Terms -- neural language modeling, transformer, pre- training, knowledge distillation, adaptive softmax 1. INTRODUCTION Neural networks have been proven to outperform traditional n-gram language models (LMs) and have achieved state-of-the-art (SOTA) performance in language modeling [2, 3, 4, 5]. This is mainly be- cause n-gram LMs suffer from data sparsity problems, which makes it difficult to capture large contexts and model long-range dependen- cies in text. In contrast, neural models overcome these issues with distributed representation learning in a latent semantic space, thus with superior abilities in modeling long-range dependencies and bet- ter model performance. However, compared to n-gram LMs, neural models are computationally expensive and slow, which makes it dif- ficult to be used in first-pass automatic speech recognition (ASR) systems, where search space could be very large. Thus, neural LMs have been mostly used in second-pass rescoring, either through the n-best lists or lattices generated by the first-pass systems with n- gram LMs [6, 7, 8, 9, 10]. Transformer, which was originally invented in an encoder- decoder framework for machine translation [11], has been popular in natural language processing (NLP). With the usage of self-attention mechanism and residual connections, it allows for successful train- ing of very deep and high capacity networks, resulting in SOTA performance in many NLP tasks [1, 12, 13, 14]. A number of recent works [15, 13, 16, 17] on language modeling also demonstrate the superior ability of deep Transformers over shallow stack of recurrent neural networks such as LSTM [18]. However, these SOTA Trans- former models were mostly engineered to have very high capacity with great depth. For example, even the smallest model of OpenAI GPT2 [13] has 24 decoder layers with 345M model parameters. And Irie et al. [17] uses up to 42 and 96 decoder layers for ASR rescoring. Such a large model size makes it unrealistic to directly deploy these models into large-scale applications due to latency and computation resource restrictions, even for second-pass ASR rescor- ing where the scoring space has been greatly pruned. In addition, smaller model size is important for on-device applications where machine capacity such as memory is usually limited. In this work, we aim to conduct empirical study on efficient ASR rescoring with Transformers, which is important to put these su- perior Transformer models into large-scale real-world applications. First of all, we know that a neural LM trained with the standard cross entropy loss contains a softmax layer that involves a summa- tion over the entire output vocabulary. Thus the model size of the softmax layer is proportional to the size of output vocabulary, and larger vocabulary could significantly increase the model size. In or- der to handle this issue, we propose to combine subword unit mod- els with adaptive softmax. Subword units such as byte pair encod- ing (BPE) [19] can represent an open vocabulary through a fixed- size vocabulary of character sequences, which is an effective way to reduce model sizes and handle out-of-vocabulary issues. Adaptive softmax [20] is a technique to speed up the softmax layer by assign- ing larger capacity to more frequent vocabulary units, while smaller capacity to less frequent ones. Thus it can further reduce model sizes from the softmax layer. For language modeling, it has been observed that higher capac- ity and depth tends to lead to better metrics with regarding to per- plexity (PPL) [17]. Thus existing work mostly focused on training very large models to achieve SOTA performance. In contrast, in this work we switch our focus to train Transformers with small parame- ter sizes to make them applicable to large-scale applications. In our empirical study, we observe that small Transformer LMs also per- form reasonably well with n-best rescoring. We further propose to leverage a simple yet effective strategy with large-scale model pre- training and fine-tuning to first train powerful teacher models. We then adopt knowledge distillation [21] to transfer knowledge from these teacher models into small student models to further improve their performance. The main contributions of this paper are summarized as follows: • We show that subword unit models with different vocabulary sizes can achieve similar performance for ASR rescoring. By combining with adaptive softmax, we can significantly reduce model sizes of Transformer LMs. • We experiment Transformer LMs with small parameter sizes, and achieve significant word error rate reductions with second-pass n-best rescoring. Compared to those much larger models, only slight performance degradation is ob- served. • We propose to improve small Transformer LMs with large- scale model pre-training and knowledge distillation, which further reduce PPLs and WERs over models that are trained without using these techniques. • By combining all of these techniques, we successfully train small Transformer LMs that achieve relative WERRs ranging from 6.46% to 7.17% while only with 5.5% to 11.9% pa- rameter sizes of the well-known large GPT model [1], whose WERR with rescoring on the same dataset is 7.58%. 2. OUR APPROACH In this section, we introduce the details of our explored techniques to train small Transformer LMs with the goal of retraining performance of those large models. 2.1. Preliminaries Given a text corpus D = {S1, . . . , SN } with vocabulary V, where each Si is a sequence of text with k word or subword units Si = {w(i) k }, we can train a standard left-to-right neural lan- guage model Θ by maximizing the following objective function: 1 , . . . , w(i) NLP tasks. This approach chooses to divide words into a limited set of subword units, and it can effectively interpolate between word- level inputs for frequent words and character-level inputs for rare words. Thus it is able to achieve a good balance between character- level and word-level models. In this work, we adopt BPE1 for input representations. Different from previous work that normally used a relatively large BPE vocabulary, we also conduct empirical study on the choice of BPE unit sizes and their impact on ASR rescoring. 2.3. Adaptive Softmax Even though with subword units, it is still computationally ineffi- cient to obtain normalized model predictions through the softmax layer. Extensive study has been conducted to reduce the computa- tional costs from the softmax layer. Existing approaches can roughly be grouped into two categories: (i) modifying the softmax architec- ture such as through hierarchical softmax [23] to make it more effi- cient, and (ii) completely removing the softmax layer and utilizing other auxiliary loss such as self-normalization [24, 25] and noise contrastive estimation (NCE) [26, 27]. In this work, we choose to exploit adaptive softmax [20], an improved approach over hierarchi- cal softmax. It assigns larger capacity to more frequent vocab units and smaller capacity to less frequent ones. Thus it can reduce model size and speed up both model training and inference. By combing with subword unit models, we find that it works effectively to reduce parameter sizes while maintaining model performance. LCE (Θ) = X X i j logP (w(i) j h(i) j ; Θ) (1) 2.4. Knowledge Distillation where the conditional probability P of w(i) j given its context history h(i) j and the unnormalized logit z(i) j is computed as: P (w(i) j h(i) j ; Θ) = exp(z(i) j ) PV v exp(zv) (2) From Equation 2, we can see that computation of the normalized probability for each w(i) j needs to go through a softmax layer that in- volves a summation over all units in the vocabulary. This could be very computationally inefficient and is a major performance bottle- neck for neural LMs with large output vocabularies. In this work, we choose to train neural LMs based on the standard deep Trans- former decoder [11], which consists of a stack of N transformer blocks. Each block contains a self-attention layer for modeling con- textual information, and a position-wise feed-forward layer for fea- ture transformation. Residual connection and layer normalization are added between each layer so that lower layer information can be passed to upper layers, which allows for successful training of very deep Transformer networks. 2.2. Subword Unit Models Large word-level vocabularies are often used in large-scale neural language model training, resulting in significant increase of model size from the softmax layer. Thus an effective way to reduce model size is to directly reduce the size of the output vocabulary. A straight- forward method to reduce vocabulary size is to simply group those words with low frequencies into one cluster and replace them by a specific symbol. However, this approach has shown poor perfor- mance in handling rare and unknown words [19, 22]. In order to better handle this challenge, subword unit repre- sentations such as byte pair encoding (BPE) [19] and wordpiece model [22] have been proposed with improved performance in many Knowledge distillation (KD) is a model compression technique that is also known as teacher student training, where a small model (stu- dent) is trained to match the output of larger models (teachers) [21]. More specifically, the student model is learned to minimize a new loss function based on the weighted linear combination of cross- entropy loss with hard labels from training data and Kullback- Leibler (KL) divergence to predicted distributions (soft labels) of teacher models. Formally, we need to modify the objective function as defined in Equation 1 as follows: L(Θ) = αLCE (Θ) + (1 − α)LKLD(Θ) (3) where LKLD(Θ) is KL divergence loss computed from student and teacher model outputs, α is used to control the balance of the two loss. We optimize the values of alpha and temperature on the development set and find that the optimal values for alpha and tem- perature is 0.1 and 1.0, respectively. We also completely remove dropouts for student models following the existing study on KD for language modeling [28] as it gives the best performance. 2.5. Pre-training and Fine-tuning In order to fully leverage the power of knowledge distillation, we need to first successfully train teacher models with superior perfor- mance. And existence of high-quality in-domain data is important for this step. However, in many cases it is challenging to obtain adequate in-domain data in a timely fashion due to emergence of new domains or extra annotation costs. Fortunately, there exists abundant general domain text data from diverse sources, including News articles, Wikipedia, and social media posts etc. These gen- eral corpuses have played an important role in the successful ap- plications of pre-trained models in natural language understanding 1https://github.com/glample/fastBPE (NLU) tasks [1, 12, 29]. But different from these existing work on improving NLU with pre-trained Transformers, we study the effec- tiveness of the pre-training strategy with deep Transformers for ASR rescoring, together with knowledge distillation. In this work, we first construct a large pre-training corpus that is not domain specific, then we pre-train deep Transformer LMs with high capacity on this corpus. These pre-trained models are then fur- ther optimized on the target domain data, and used to guide the learn- ing of small student models. 3. EXPERIMENTAL SETUP In all experiments of this work, we target to build a strong ASR system for automatic video transcription, which has many down- streaming applications such as auto-captioning of videos. To eval- uate the effectiveness of our proposed approaches, we first gather n-best candidates from the fist-pass decoding with our in-house hy- brid ASR system, which has achieved state-of-the-art performance on multiple speech recognition datasets [30]. For acoustic model- ing, we utilize a multi-layer Latency Controlled Bidirectional LSTM (LC-BLSTM) [31] with grapheme representations. In the first-pass decoding, we use our in-house dynamic decoder [32] with a pruned 5-gram LM. For Transformer LMs, we leverage the PyTorch im- plementation of Transformer2 with Adam as optimizer. The n-best candidates are further reranked with additional evidence generated by neural LMs. We optimize all model hyper-parameters in the de- velopment set, and use word error rate as the evaluation metric. Speech Recognition Dataset. We evaluate the effectiveness of our proposed approaches on an in-house English video dataset. It is ran- domly sampled from the pool of publicly shared videos by users on Facebook platform. This data is completely anonymized, and no user-identifiable information (UII) is access to both transcribers and researchers. We use a total of 943, 346 videos as training data, 4, 309 videos as development data, and 8, 189 videos as testing data. The total duration of this dataset is 13.9K hours, and the total number of tokens in the transcriptions is 144M. It is a challenging dataset as it contains videos from diverse speakers, content topics, and acoustic conditions. Pre-training Corpus. We construct a large-scale background text corpus for neural LM pre-training from public Facebook user posts, where we randomly sample 105 million posts that users publicly shared on the Facebook platform. We do not have access to any user UII information, and we directly converted the text into BPE and machine reading format for model training. N -best Rescoring. After we obtain n-best (i.e., n = 50 is used in this work) candidates for each video from the fist-pass ASR sys- tem. Weighted linear combination is then performed to re-estimate the final ranking score of each n-best candidate ci through s(ci) = sam(ci) + αsn gram(ci) + (1 − α)snlm(ci), where sam(ci) is the acoustic score from acoustic model, sn gram(ci) is the estimated probability from the 5-gram LM, and snlm(ci) is the neural lan- guage modeling score. Finally we choose the top ranked candidates as the final ASR output and measure new word error rates on them. Approaches for Comparison. To empirically study the impact of our strategies, we compare the following approaches: • n-gram: this is the first-pass ASR system with n-gram LM. By comparing to this baseline, we can understand the impact of ASR n-best rescoring with Transformer LMs. 2https://github.com/pytorch/fairseq Table 1. The overall WER and relative WERR of each approach on the video dataset. "#BPE" denotes the size of BPE output vocabu- lary, "#Param" represents the number of model parameters of each Transformer LM. Approach #Param WER WERR #BPE n-gram Large Small one Small one Small two Small two - 25K 10K 5K 10K 5K - 16.88 123.4M 15.60 14.7M 15.67 11.8M 15.73 8.9M 15.78 15.79 6.8M - 7.58% 7.17% 6.81% 6.52% 6.46% • Large: this is a rescoring model with a high capacity Trans- former LM. Here we follow the popular GPT configura- tion [1], where the numbers of decoder layers and attention heads are both set as 12. And the dimension of input embed- dings, hidden states and feed-forward layers is set as 768, 768 and 3072, respectively. And we choose 25K BPE units as the vocabulary, which is similar to previous work on large-scale Transformer pre-training [12]. • Small one: this is a rescoring model with a small Transformer LM, where the number of decoder layers and attention heads is set as 6 and 8, respectively. The dimension of input em- beddings, hidden states and feed-forward layers set is as 352, 352 and 1408, respectively. • Small two: this is another rescoring model with a smaller Transformer LM than Small one. It uses the same numbers of decoder layers and attention heads as Small one, but the di- mension of input embeddings, hidden states and feed-forward layers is further reduced to 256, 256 and 1024. For both small Transformers, we experiment with different BPE vocabular- ies with 10K and 5K units to understand the impact of small vocabularies on ASR rescoring. 4. RESULTS AND DISCUSSION 4.1. Overall Performance Table 1 shows the overall performance of various approaches on the video dataset. Here we train Transformer Large only on in-domain video transcriptions without adaptive softmax to study the impact of various strategies we explore to train models with small param- eter sizes. And both small Transformer LMs are trained with all of our explored strategies, including smaller BPE vocabulary sizes, adaptive softmax, and knowledge distillation from high capacity pre- trained and fine-tuned models. We can see that n-best rescoring with Transformer LMs is effec- tive to improve speech recognition accuracy. Specifically, rescoring with the Large model achieves 7.58% WERR, showing the effec- tiveness of rescoring with Transformer LMs. Additionally, the first small model Small one obtains 7.17% and 6.81% WERR with 10K and 5K BPE vocabularies, while they only have 11.9% and 9.6% model sizes of the large model. Furthermore, we can see that the even smaller model Small two still achieves similar speech recogni- tion accuracy, while only with 7.2% and 5.5% parameter sizes of the large model. We further conduct latency study on a random sample of 5, 000 n-best candidates generated from the first-pass ASR system. For each Transformer LM, we run it on the sampled set for 10 times on Table 2. Effect of Sub-word Unit Models and Adaptive Softmax on Transformer Large. "AdaSoft" indicates whether we use adaptive softmax or not. #BPE AdaSoft #Param WER 25K 25K 10K 10K 5K 5K No Yes No Yes No Yes 123.4M 15.60 110.0M 15.58 100.4M 15.60 97.7M 15.60 92.7M 15.58 91.4M 15.64 Table 3. Effect of Sub-word Unit Models and Adaptive Softmax on Transformer Small two. #BPE AdaSoft #Param WER 25K 25K 10K 10K 5K 5K No Yes No Yes No Yes 17.5M 15.84 13.0M 15.85 9.9M 15.87 8.9M 15.91 7.3M 15.92 6.8M 15.97 the same CPU machine and compute the average duration of infer- ence time. Our study shows that both small models with 5K or 10K BPE vocabularies can achieve speedup from 7.6x to 8.4x over the large Transformer LM with 25K vocabulary. These results demon- strate that we can successfully train much smaller Transformer LMs that not only significantly improve speech recognition accuracy, but also greatly reduce model inference latency and computational costs. 4.2. Effect of Sub-word Unit Models and Adaptive Softmax In this section, we aim to study the effect of BPE vocabulary sizes and adaptive softmax on both large and small models. Thus we train both Transformer Large and Small two on in-domain video data, and compare the system performance after rescoring. Table 2 and 3 demonstrate the impact of these two techniques. By comparing the rows with the same BPE sizes from these two tables, we can see that adaptive softmax further reduces model sizes while retain- ing the gains from rescoring, demonstrating its effectiveness to re- duce model size from the softmax layer. In addition, by reducing the BPE vocabulary sizes from 25K to 10K or 5K, we can still see that similar speech recognition accuracy is achieved for both mod- els, showing reducing BPE vocabulary sizes is another effective way to reduce model sizes. By combining both techniques, we can re- duce the model sizes by 26% for Transformer Large, and 61% for Transformer Small two. 4.3. Effect of Model Pre-training and Knowledge Distillation To study the joint impact of model pre-training and knowledge distil- lation, we compare the rescoring performance of Small two models trained on in-domain data with and without knowledge distillation. Table 4 shows the perplexities and word error rates achieved by these models with 10K and 5K BPE vocabularies. We can see that by dis- tilling the knowledge from the pre-trained then fine-tuned teacher models, we can achieve 11.8% and 12.7% perplexity reductions for 10K and 5K vocabularies respectively, and also further reductions on WERs. Table 4. Effect of Model Pre-training and Knowledge Distillation with Transformer Small two. Teacher #BPE Perplexity WER - Large (pre-trained) - Large (pre-trained) 10K 10K 5K 5K 61.59 54.35 50.09 43.75 15.91 15.78 15.97 15.79 Table 5. Effect of Model Pre-training with Transformer Large. Pre-trained #BPE Perplexity WER No Yes No Yes 10K 10K 5K 5K 46.68 36.85 36.42 31.78 15.60 15.45 15.64 15.44 We then further compare perplexity and rescoring performance of Transformer Large with and without large-scale model pre- training to understand the impact of pre-training on ASR rescoring. The results are shown in Table 5 for both 10K and 5K vocabularies. Even though we already have a relative large in-domain dataset with 144M tokens for neural LM training, we can easily see that the simple pre-training then fine-tuning strategy is still very effective in reducing perplexities (i.e., 20.7% and 12.7% PPL reductions for both 10K and 5K vocabulary sizes, respectively). The models with pre-training also obtain better rescoring performance, demonstrating the effectiveness of large-scale model pre-training. 5. CONCLUSION AND FUTURE WORK In this paper, we have studied several techniques including subword units, adaptive softmax, knowledge distillation with large-scale model pre-training to train Transformer LMs with small parameter sizes for efficient ASR rescoring. Our empirical study shows that we can significantly reduce model parameter sizes and improve speech recognition accuracy with n-best rescoring by combining all these explored techniques together. In the future, we plan to explore knowledge distillation with bi-directional teachers models, as well as two-stage distillation in both pre-training and fine-tuning stages. 6. REFERENCES [1] Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever, "Improving language understanding by generative pre-training," Technical report, OpenAI, 2018. [2] Yoshua Bengio, R´ejean Ducharme, Pascal Vincent, and Chris- tian Jauvin, "A neural probabilistic language model," Journal of machine learning research, vol. 3, no. Feb, pp. 1137 -- 1155, 2003. [3] Tom´as Mikolov, Martin Karafi´at, Luk´as Burget, Jan Cernock`y, and Sanjeev Khudanpur, "Recurrent neural network based lan- guage model," in Eleventh annual conference of the interna- tional speech communication association, 2010. [4] Tom´as Mikolov, Stefan Kombrink, Luk´as Burget, Jan Cernock`y, and Sanjeev Khudanpur, "Extensions of recur- rent neural network language model," in 2011 IEEE Interna- tional Conference on Acoustics, Speech and Signal Processing (ICASSP). IEEE, 2011, pp. 5528 -- 5531. [18] Sepp Hochreiter and Jurgen Schmidhuber, "Long short-term memory," Neural Comput., 1997. [5] Martin Sundermeyer, Ralf Schluter, and Hermann Ney, "Lstm neural networks for language modeling," in Thirteenth annual conference of the international speech communication associ- ation, 2012. [6] Anoop Deoras, Tom´as Mikolov, and Kenneth Church, "A fast re-scoring strategy to capture long-distance dependencies," in Proceedings of the Conference on Empirical Methods in Natu- ral Language Processing. Association for Computational Lin- guistics, 2011, pp. 1116 -- 1127. [7] William Chan, Navdeep Jaitly, Quoc Le, and Oriol Vinyals, "Listen, attend and spell: A neural network for large vocabu- lary conversational speech recognition," in 2016 IEEE Interna- tional Conference on Acoustics, Speech and Signal Processing (ICASSP). IEEE, 2016, pp. 4960 -- 4964. [8] Shankar Kumar, Michael Alexander Nirschl, Dan Holtmann- Rice, Hank Liao, Ananda Theertha Suresh, and Felix Yu, "Lat- tice rescoring strategies for long short term memory language models in speech recognition," in IEEE Automatic Speech Recognition and Understanding Workshop, 2017. [9] Wayne Xiong, Lingfeng Wu, Fil Alleva, Jasha Droppo, Xue- dong Huang, and Andreas Stolcke, "The microsoft 2017 con- versational speech recognition system," in 2018 IEEE interna- tional conference on acoustics, speech and signal processing (ICASSP). IEEE, 2018, pp. 5934 -- 5938. [10] Anirudh Raju, Denis Filimonov, Gautam Tiwari, Guitang Lan, and Ariya Rastrow, "Scalable multi corpora neural language models for ASR," in Interspeech, 2019. [11] 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. [12] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova, "Bert: Pre-training of deep bidirectional transform- ers for language understanding," in Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technolo- gies, Volume 1 (Long and Short Papers), 2019, pp. 4171 -- 4186. [13] Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever, "Language models are unsuper- vised multitask learners," OpenAI Blog, vol. 1, no. 8, 2019. [14] Mandar Joshi, Danqi Chen, Yinhan Liu, Daniel S. Weld, Luke Zettlemoyer, and Omer Levy, "SpanBERT: Improving pre- training by representing and predicting spans," arXiv preprint arXiv:1907.10529, 2019. [15] Rami Al-Rfou, Dokook Choe, Noah Constant, Mandy Guo, and Llion Jones, "Character-level language modeling with deeper self-attention," arXivpreprint arXiv:1808.04444, 2018. [16] Zihang Dai, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc Le, and Ruslan Salakhutdinov, "Transformer-XL: Attentive language models beyond a fixed-length context," in Proceed- ings of the 57th Annual Meeting of the Association for Compu- tational Linguistics, 2019. [17] Kazuki Irie, Albert Zeyer, Ralf Schluter, and Hermann Ney, in INTER- "Language modeling with deep transformers," SPEECH, 2019. [19] Rico Sennrich, Barry Haddow, and Alexandra Birch, "Neu- ral 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), 2016, pp. 1715 -- 1725. ´Edouard Grave, Armand Joulin, Moustapha Ciss´e, David Grangier Facebook AI Research, and Herv´e J´egou, "Efficient softmax approximation for gpus," in Proceedings of the 34th International Conference on Machine Learning - Volume 70, 2017. [20] [21] Geoffrey Hinton, Oriol Vinyals, and Jeff Dean, ing the knowledge in a neural network," arXiv:1503.02531, 2015. "Distill- arXiv preprint [22] Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V. Le, Mo- hammad Norouzi, and Wolfgang Macherey etc, "Google's neural machine translation system: Bridging the gap be- tween human and machine translation," arXiv preprint arXiv:1609.08144, 2016. [23] Frederic Morin and Yoshua Bengio, "Hierarchical probabilistic neural network language model," in AISTATS05, 2005. [24] Jacob Devlin, Rabih Zbib, Zhongqiang Huang, Thomas Lamar, Richard Schwartz, and John Makhoul, "Fast and robust neural network joint models for statistical machine translation," in Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 2014. [25] Wenlin Chen, David Grangier, and Michael Auli, "Strategies for training large vocabulary neural language models," in Pro- ceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 2016. [26] Andriy Mnih and Yee Whye Teh, "A fast and simple algorithm for training neural probabilistic language models," in Proceed- ings of the 29th International Coference on International Con- ference on Machine Learning, 2012. [27] Xie Chen, Xunying Liu, Mark J. F. Gales, and Philip C. Wood- land, "Recurrent neural network language model training with noise contrastive estimation for speech recognition.," in ICASSP, 2015. [28] Yangyang Shi, Mei-Yuh Hwang, Xin Lei, and Haoyu Sheng, "Knowledge distillation for recurrent neural network language modeling with trust regularization.," in ICASSP, 2019. [29] Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Man- dar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke "Roberta: A robustly Zettlemoyer, and Veselin Stoyanov, optimized BERT pretraining approach," arXiv preprint arXiv:1907.11692, 2019. [30] Duc Le, Xiaohui Zhang, Weiyi Zheng, Christian Fugen, Geof- frey Zweig, and Michael Seltzer, "From senones to chenones: Tied context-dependent graphemes for hybrid speech recogni- tion," in IEEE Automatic Speech Recognition and Understand- ing Workshop, 2019. [31] Yu Zhang, Guoguo Chen, Dong Yu, Kaisheng Yao, Sanjeev Khudanpur, and James R. Glass, "Highway long short-term memory rnns for distant speech recognition.," in ICASSP, 2016. [32] Jun Liu, Jiedan Zhu, Vishal Kathuria, and Fuchun Peng, "Ef- ficient dynamic wfst decoding for personalized language mod- els," arXiv preprint arXiv:1910.10670, 2019.
1707.07806
2
1707
2017-08-31T23:35:23
Macro Grammars and Holistic Triggering for Efficient Semantic Parsing
[ "cs.CL" ]
To learn a semantic parser from denotations, a learning algorithm must search over a combinatorially large space of logical forms for ones consistent with the annotated denotations. We propose a new online learning algorithm that searches faster as training progresses. The two key ideas are using macro grammars to cache the abstract patterns of useful logical forms found thus far, and holistic triggering to efficiently retrieve the most relevant patterns based on sentence similarity. On the WikiTableQuestions dataset, we first expand the search space of an existing model to improve the state-of-the-art accuracy from 38.7% to 42.7%, and then use macro grammars and holistic triggering to achieve an 11x speedup and an accuracy of 43.7%.
cs.CL
cs
Macro Grammars and Holistic Triggering for Efficient Semantic Parsing Yuchen Zhang and Panupong Pasupat and Percy Liang {zhangyuc,ppasupat,pliang}@cs.stanford.edu Computer Science Department, Stanford University 7 1 0 2 g u A 1 3 ] L C . s c [ 2 v 6 0 8 7 0 . 7 0 7 1 : v i X r a Abstract To learn a semantic parser from denota- tions, a learning algorithm must search over a combinatorially large space of log- ical forms for ones consistent with the an- notated denotations. We propose a new online learning algorithm that searches faster as training progresses. The two key ideas are using macro grammars to cache the abstract patterns of useful log- ical forms found thus far, and holistic trig- gering to efficiently retrieve the most rele- vant patterns based on sentence similarity. On the WIKITABLEQUESTIONS dataset, we first expand the search space of an ex- isting model to improve the state-of-the- art accuracy from 38.7% to 42.7%, and then use macro grammars and holistic trig- gering to achieve an 11x speedup and an accuracy of 43.7%. Introduction 1 We consider the task of learning a semantic parser for question answering from question- answer pairs (Clarke et al., 2010; Liang et al., 2011; Berant et al., 2013; Artzi and Zettlemoyer, 2013; Pasupat and Liang, 2015). To train such a parser, the learning algorithm must somehow search for consistent logical forms (i.e., logical forms that execute to the correct answer denota- tion). Typically, the search space is defined by a compositional grammar over logical forms (e.g., a context-free grammar), which we will refer to as the base grammar. To cover logical forms that answer complex questions, the base grammar must be quite general and compositional, leading to a huge search space that contains many useless logical forms. For ex- ample, the parser of Pasupat and Liang (2015) on Rank 1 2 3 4 5 r1 : r2 : r3 : r4 : r5 : Nation Gold France Ukraine Turkey Sweden 3 2 2 2 1 Iran Silver Bronze 1 1 0 0 2 1 2 1 0 1 Table 1: A knowledge base for the question x = "Who ranked right after Turkey?". The target de- notation is y = {Sweden}. Wikipedia table questions (with beam size 100) generates and featurizes an average of 8,400 par- tial logical forms per example. Searching for con- sistent logical forms is thus a major computational bottleneck. In this paper, we propose macro grammars to bias the search towards structurally sensible logi- cal forms. To illustrate the key idea, suppose we managed to parse the utterance "Who ranked right after Turkey?" in the context of Table 1 into the following consistent logical form (in lambda DCS) (Section 2.1): R[Nation].R[Next].Nation.Turkey, which identifies the cell under the Nation column in the row after Turkey. From this logical form, we can abstract out all relations and entities to pro- duce the following macro: R[{Rel#1}].R[Next].{Rel#1}.{Ent#2}, which represents the abstract computation: "iden- tify the cell under the {Rel#1} column in the row after {Ent#2}." More generally, macros capture the overall shape of computations in a way that generalizes across different utterances and knowl- edge bases. Given the consistent logical forms of utterances parsed so far, we extract a set of macro rules. The resulting macro grammar consisting of these rules generates only logical forms conform- ing to these macros, which is a much smaller and higher precision set compared to the base gram- mar. Though the space of logical forms defined by the macro grammar is smaller, it is still expensive to parse with them as the number of macro rules grows with the number of training examples. To address this, we introduce holistic triggering: for a new utterance, we find the K most similar utter- ances and only use the macro rules induced from any of their consistent logical forms. Parsing now becomes efficient as only a small subset of macro rules are triggered for any utterance. Holistic trig- gering can be contrasted with the norm in semantic parsing, in which logical forms are either triggered by specific phrases (anchored) or can be triggered in any context (floating). Based on the two ideas above, we propose an online algorithm for jointly inducing a macro grammar and learning the parameters of a se- mantic parser. For each training example, the algorithm first attempts to find consistent logi- cal forms using holistic triggering on the current macro grammar. If it succeeds, the algorithm uses the consistent logical forms found to update model parameters. Otherwise, it applies the base gram- mar for a more exhaustive search to enrich the macro grammar. At test time, we only use the learned macro grammar. We evaluate our approach on the WIKITABLE- QUESTIONS dataset (Pasupat and Liang, 2015), which features a semantic parsing task with open- domain knowledge bases and complex questions. We first extend the model in Pasupat and Liang (2015) to achieve a new state-of-the-art test ac- curacy of 42.7%, representing a 10% relative im- provement over the best reported result (Haug et al., 2017). We then show that training with macro grammars yields an 11x speedup compared to training with only the base grammar. At test time, using the learned macro grammar achieves a slightly better accuracy of 43.7% with a 16x run time speedup over using the base grammar. 2 Background We base our exposition on the task of question an- swering on a knowledge base. Given a natural lan- guage utterance x, a semantic parser maps the ut- terance to a logical form z. The logical form is executed on a knowledge base w to produce deno- tation(cid:74)z(cid:75)w. The goal is to train a semantic parser from a training set of utterance-denotation pairs. 2.1 Knowledge base and logical forms A knowledge base refers to a collection of enti- ties and relations. For the running example "Who ranked right after Turkey?", we use Table 1 from Wikipedia as the knowledge base. Table cells (e.g., Turkey) and rows (e.g., r3 = the 3rd row) are treated as entities. Relations connect enti- ties: for example, the relation Nation maps r3 to Turkey, and a special relation Next maps r3 to r4. A logical form z is a small program that can be executed on the knowledge base. We use lambda DCS (Liang, 2013) as the language of logical forms. The smallest units of lambda DCS are en- tities (e.g., Turkey) and relations (e.g., Nation). Larger logical forms are composed from smaller ones, and the denotation of the new logical form can be computed from denotations of its con- stituents. For example, applying the join operation on Nation and Turkey gives Nation.Turkey, whose denotation is(cid:74)Nation.Turkey(cid:75)w = {r3}, which corresponds to the 3rd row of the table. The partial logical form Nation.Turkey can then be used to construct a larger logical form: (1) z = R[Nation].R[Next].Nation.Turkey, where R[·] represents the reverse of a relation. The denotation of the logical form z with respect {Sweden}. See Liang (2013) for more details about the semantics of lambda DCS. to the knowledge base w is equal to (cid:74)z(cid:75)w = 2.2 Grammar rules The space of logical forms is defined recursively by grammar rules. In this setting, each constructed logical form belongs to a category (e.g., Entity, Rel, Set), with a special category Root for com- plete logical forms. A rule specifies the categories of the arguments, category of the resulting logi- cal form, and how the logical form is constructed from the arguments. For instance, the rule Rel[z1] + Set[z2] → Set[z1.z2] (2) specifies that a partial logical form z1 of category Rel and z2 of category Set can be combined into z1.z2 of category Set. With this rule, we can construct Nation.Turkey if we have constructed Nation of type Rel and Turkey of type Set. We consider the rules used by Pasupat and Liang (2015) for their floating parser.1 The rules 1Their grammar and our implementation use more fine- grained categories (Atomic, V alues, Records) instead of Set. We use the coarser category here for simplicity. Root[z1] R[Nation].R[Next].Nation.Turkey Set[R[z1].z2] R[Nation].R[Next].Nation.Turkey ∅ → Rel[Nation] Set[R[Next].z1] Nation R[Next].Nation.Turkey Set[z1.z2] Nation.Turkey ∅ → Rel[Nation] Nation Set[z1] Turkey "Turkey" → Ent[Turkey] Turkey (a) Derivation tree (zi represents the ith child) Root[z1] Set[R[z1].z2] Root[z1] Set[R[z1].z2] Set[R[Next].z1] Set[z1.z2] Rel Set[z1] M2 Sub-macro M3 Set[z1] Ent Ent Sub-macro M1 Set[R[Next].z1] Set[z1.z2] Rel M1 Sub-macro M2 (b) Macro (c) Atomic sub-macros Figure 1: From the derivation tree (a), we extract a macro (b), which can be further decomposed into atomic sub-macros (c). Each sub-macro is con- verted into a macro rule. are divided into compositional rules and terminal rules. Rule (2) above is an example of a compo- sitional rule, which combines one or more partial logical forms together. A terminal rule has one of the following forms: T okenSpan[span] → c[f (span)] ∅ → c[f (∅)] (3) (4) where c is a category. A rule with the form (3) con- verts an utterance token span (e.g., "Turkey") into a partial logical form (e.g., Turkey). A rule with the form (4) generates a partial logical form with- out any trigger. This allows us to generate logical predicates that do not correspond to any part of the utterance (e.g., Nation). A complete logical form is generated by recur- sively applying rules. We can represent the deriva- tion process by a derivation tree such as in Fig- ure 1a. Every node of the derivation tree corre- sponds to one rule. The leaf nodes correspond to terminal rules, and the intermediate nodes corre- spond to compositional rules. 2.3 Learning a semantic parser Parameters of the semantic parser are learned from training data {(xi, wi, yi)}n i=1. Given a training example with an utterance x, a knowledge base w, and a target denotation y, the learning algo- rithm constructs a set of candidate logical forms indicated by Z. It then extracts a feature vector φ(x, w, z) for each z ∈ Z, and defines a log-linear distribution over the candidates z: pθ(z x, w) ∝ exp(θ(cid:62)φ(x, w, z)), (5) where θ is a parameter vector. The straightfor- ward way to construct Z is to enumerate all possi- ble logical forms induced by the grammar. When the search space is prohibitively large, it is a com- mon practice to use beam search. More precisely, the algorithm constructs partial logical forms re- cursively by the rules, but for each category and each search depth, it keeps only the B highest- scoring logical forms according to the model prob- ability (5). During training, the parameter θ is learned by maximizing the regularized log-likelihood of the correct denotations: J(θ) = 1 n log pθ(yi xi, wi) − λ(cid:107)θ(cid:107)1, (6) n(cid:88) i=1 where the probability pθ(yi xi, wi) marginalizes over the space of candidate logical forms: pθ(yi xi, wi) = pθ(z xi, wi). (cid:88) z∈Zi:(cid:74)z(cid:75)wi =yi The objective is optimized using AdaGrad (Duchi et al., 2010). At test time, the algorithm selects a logical form z ∈ Z with the highest model prob- ability (5), and then executes it on the knowledge base w to predict the denotation(cid:74)z(cid:75)w. 3 Learning a macro grammar The base grammar usually defines a large search space containing many irrelevant logical forms. For example, the grammar in Pasupat and Liang (2015) can generate long chains of join opera- tions (e.g., R[Silver].Rank.R[Gold].Bronze.2) that rarely express meaningful computations. Algorithm 1: Processing a training example Data: example (x, w, y), macro grammar, base grammar with terminal rules T 1 Select a set R of macro rules (Section 3.4); 2 Generate a set Z of candidate logical forms 3 if Z contains consistent logical forms then Update model parameters (Section 3.5); from rules R ∪ T (Section 2.3); 4 5 else 6 7 Apply the base grammar to search for a consistent logical form (Section 2.3); Augment the macro grammar (Section 3.6); 8 end 9 Associate utterance x with the highest- scoring consistent logical form found; The main contribution of this paper is a new al- gorithm to speed up the search based on previous searches. At a high-level, we incrementally build a macro grammar which encodes useful logical form macros discovered during training. Algo- rithm 1 describes how our learning algorithm pro- cesses each training example. It first tries to use an appropriate subset of rules in the macro grammar to search for logical forms. If the search succeeds, then the semantic parser parameters are updated as usual. Otherwise, it falls back to the base gram- mar, and then add new rules to the macro grammar based on the consistent logical form found. Only the macro grammar is used at test time. We first describe macro rules and how they are generated from a consistent logical form. Then we explain the steps of the training algorithm in detail. 3.1 Logical form macros A macro characterizes an abstract logical form structure. We define the macro for any given log- ical form z by transforming its derivation tree as illustrated in Figure 1b. First, for each terminal rule (leaf node), we substitute the rule by a place- holder, and name it with the category on the right- hand side of the rule. Then we merge leaf nodes that represent the same partial logical form. For example, the logical form (1) uses the relation Nation twice, so in Figure 1b, we merge the two leaf nodes to impose such a constraint. While the resulting macro may not be tree-like, we call each node root or leaf if it is a root node or a leaf node of the associated derivation tree. 3.2 Constructing macro rules from macros For any given macro M, we can construct a set of macro rules that, when combined with termi- nal rules from the base grammar, generates exactly the logical forms that satisfy the macro M. The straightforward approach is to associate a unique rule with each macro: assuming that its k leaf nodes contain categories c1, . . . , ck, we can define a rule: c1[z1] + ··· + ck[zk] → Root[f (z1, . . . , zk)], (7) where f substitutes z1, . . . , zk into the corre- sponding leaf nodes of macro M. For example, the rule for the macro in Figure 1b is Rel[z1]+Ent[z2] → Root[R[z1].R[Next].z1.z2]. 3.3 Decomposed macro rules Defining a unique rule for each macro is computa- tionally suboptimal since the common structures shared among macros are not being exploited. For example, while max(R[Rank].Gold.Num.2) and R[Nation].argmin(Gold.Num.2, Index) be- long to different macros, the partial logical form Gold.Num.2 is shared, and we wish to avoid gen- erating and featurizing it more than once. In order to reuse such shared parts, we de- compose macros into sub-macros and define rules based on them. A subgraph M(cid:48) of M is a sub- macro if (1) M(cid:48) contains at least one non-leaf node; and (2) M(cid:48) connects to the rest of the macro M\M(cid:48) only through one node (the root of M(cid:48)). A macro M is called atomic if the only sub-macro of M is itself. Given a non-atomic macro M, we can find an atomic sub-macro M(cid:48) of M. For example, from Figure 1b, we first find sub-macro M(cid:48) = M1. We detach M(cid:48) from M and define a macro rule: k[zk] → c(cid:48) 1[z1] + ··· + c(cid:48) c(cid:48) where c(cid:48) 1, . . . , c(cid:48) k are categories of the leaf nodes of M(cid:48), and f substitutes z1, . . . , zk into the sub- macro M(cid:48). The category c(cid:48) out is computed by serializing M(cid:48) as a string; this way, if the sub- macro M(cid:48) appears in a different macro, the cat- egory name will be shared. Next, we substitute the subgraph M(cid:48) in M by a placeholder node with name c(cid:48) out. The procedure is repeated on the new graph until the remaining macro is atomic. Finally, we define a single rule for the atomic macro. The out[f (z1, . . . , zk)], (8) macro grammar uses the decomposed macro rules in replacement of Rule (7). For example, the macro in Figure 1b is decom- posed into three macro rules: Ent[z1] → M1[z1], Rel[z1] + M1[z2] → M2[R[z1].R[Next].z1.z2], M2[z1] → Root[z1]. These correspond to the three atomic sub-macros M1, M2 and M3 in Figure 1c. The first and the second macro rules can be reused by other macros. Having defined macro rules, we now describe how Algorithm 1 uses and updates the macro grammar when processing each training example. 3.4 Triggering macro rules Throughout training, we keep track of a set S of training utterances that have been associated with a consistent logical form. (The set S is updated by Step 9 of Algorithm 1.) Then, given a train- ing utterance x, we compute its K-nearest neigh- bor utterances in S, and select all macro rules that were extracted from their associated logical forms. These macro rules are used to parse utterance x. We use token-level Levenshtein distance as the distance metric for computing nearest neigh- bors. More precisely, every utterance is writ- ten as a sequence of lemmatized tokens x = (x(1), . . . , x(m)). After removing all determiners and infrequent nouns that appear in less than 2% of the training utterances, the distance between two utterances x and x(cid:48) is defined as the Levenshtein distance between the two sequences. When com- puting the distance, we treat each word token as an atomic element. For example, the distance be- tween "highest score" and "best score" is 1. De- spite its simplicity, the Levenshtein distance does a good job in capturing the structural similarity between utterances. Table 2 shows that nearest neighbor utterances often map to consistent logi- cal forms with the same macro. In order to compute the nearest neighbors effi- ciently, we pre-compute a sorted list of Kmax = 100 nearest neighbors for every utterance before training starts. During training, calculating the in- tersection of this sorted list with the set S gives the nearest neighbors required. For our experiments, the preprocessing time is negligible compared to the overall training time (less than 3%), but if com- puting nearest neighbors is expensive, then paral- Who ranked right after Turkey? Who took office right after Uriah Forrest? How many more passengers flew to Los Angeles than to Saskatoon in 2013? How many more Hungarians live in the Serbian Banat region than Romanians in 1910? Which is deeper, Lake Tuz or Lake Palas Tuzla? Which peak is higher, Mont Blanc or Monte Rosa? Table 2: Examples of nearest neighbor utterances in the WIKITABLEQUESTIONS dataset. lelization or approximate algorithms (e.g., Indyk, 2004) could be used. 3.5 Updating model parameters Having computed the triggered macro rules R, we combine them with the terminal rules T from the base grammar (e.g., for building Ent and Rel) to create a per-example grammar R ∪ T for the ut- terance x. We use this grammar to generate logi- cal forms using standard beam search. We follow Section 2.3 to generate a set of candidate logical forms Z and update model parameters. However, we deviate from Section 2.3 in one way. Given a set Z of candidate logical forms for some training example (xi, wi, yi), we pick the logical form z+ i with the highest model probability among consistent logical forms, and pick z− i with the highest model probability among inconsistent logical forms, then perform a gradient update on the objective function: (9) (cid:18) n(cid:88) (cid:19) J(θ) = log 1 n p+ i p− i i=1 i = pθ(z+ where p+ i p− i = pθ(z− i − λ(cid:107)θ(cid:107)1, xi, wi) xi, wi). Compared to (6), this objective function only con- siders the top consistent and inconsistent logical forms for each example instead of all candidate logical forms. Empirically, we found that opti- mizing (9) gives a 2% gain in prediction accuracy compared to optimizing (6). 3.6 Updating the macro grammar If the triggered macro rules fail to find a consis- tent logical form, we fall back to performing a beam search on the base grammar. For efficiency, we stop the search either when a consistent logical form is found, or when the total number of gener- ated logical forms exceeds a threshold T . The two stopping criteria prevent the search algorithm from spending too much time on a complex example. We might miss consistent logical forms on such examples, but because the base grammar is only used for generating macro rules, not for updat- ing model parameters, we might be able to induce the same macro rules from other examples. For instance, if an example has an uttereance phrase that matches too many knowledge base entries, it would be more efficient to skip the example; the macro that would have been extracted from this example can be extracted from less ambiguous ex- amples with the same question type. Such omis- sions are not completely disastrous, and can speed up training significantly. When the algorithm succeeds in finding a con- sistent logical form z using the base grammar, we derive its macro M following Section 3.1, then construct macro rules following Section 3.3. These macro rules are added to the macro gram- mar. We also associate the utterance x with the consistent logical form z, so that the macro rules that generate z can be triggered by other examples. Parameters of the semantic parser are not updated in this case. 3.7 Prediction At test time, we follow Steps 1–2 of Algorithm 1 to generate a set Z of candidate logical forms from the triggered macro rules, and then output the highest-scoring logical form in Z. Since the base grammar is never used at test time, prediction is generally faster than training. 4 Experiments We report experiments on the WIKITABLEQUES- TIONS dataset (Pasupat and Liang, 2015). Our al- gorithm is compared with the parser trained only with the base grammar, the floating parser of Pa- supat and Liang (2015) (PL15), the Neural Pro- grammer parser (Neelakantan et al., 2016) and the Neural Multi-Step Reasoning parser (Haug et al., 2017). Our algorithm not only outperforms the others, but also achieves an order-of-magnitude speedup over the parser trained with the base grammar and the parser in PL15. 4.1 Setup The dataset contains 22,033 complex questions on 2,108 Wikipedia tables. Each question comes with a table, and the tables during evaluation are dis- "Which driver appears the most?" argmax(R[Driver].Type.Row, R[λx.count(Driver.x)]) "What language was spoken more during the Olympic oath, English or French?" argmax(English (cid:116) French, R[λx.count(Language.x)]) "Who is taller, Rose or Tim?" argmax(Rose (cid:116) Tim, R[λx.R[Num].R[Height].Name.x)]) Table 3: Several example logical forms our gram- mar can generate that are not covered by PL15. joint from the ones during training. The train- ing and test sets contain 14,152 and 4,344 exam- ples respectively.2 Following PL15, the develop- ment accuracy is averaged over the first three 80- 20 training data splits given in the dataset package. The test accuracy is reported on the train-test data split. We use the same features and logical form prun- ing strategies as PL15, but generalize their base grammar. To control the search space, the actual system in PL15 restricts the superlative operators argmax and argmin to be applied only on the set of table rows. We allow these operators to be ap- plied on the set of tables cells as well, so that the grammar captures certain logical forms that are not covered by PL15 (see Table 3). Additionally, for terminal rule (3), we allow f (span) to pro- duce entities that approximately match the token span in addition to exact matches. For example, the phrase "Greenville" can trigger both entities Greenville Ohio and Greensville. We chose hyperparameters using the first train- dev split. The beam size B of beam search is cho- sen to be B = 100. The K-nearest neighbor pa- rameter is chosen as K = 40. Like PL15, our algorithm takes 3 passes over the dataset for train- ing. The maximum number of logical forms gen- erated in step 6 of Algorithm 1 is set to T = 5,000 for the first pass. For subsequent passes, we set T = 0 (i.e., never fall back to the base grammar) so that we stop augmenting the macro grammar. During the first pass, Algorithm 1 falls back to the base grammar on roughly 30% of the training ex- amples. For training the baseline parser that only relies on the base grammar, we use the same beam size B = 100, and take 3 passes over the dataset for training. There is no maximum constraint on the 2The remaining 3,537 examples were not included in the original data split. Pasupat and Liang (2015) Neelakantan et al. (2016) Haug et al. (2017) This paper: base grammar This paper: macro grammar Dev Test 37.0% 37.1% 37.5% 37.7% 38.7% 40.6% 42.7% 40.4% 43.7% - Table 4: Results on WIKITABLEQUESTIONS. number of logical forms that can be generated for each example. 4.2 Coverage of the macro grammar With the base grammar, our parser generates 13,700 partial logical forms on average for each training example, and hits consistent logical forms on 81.0% of the training examples. With the macro rules from holistic triggering, these num- bers become 1,300 and 75.6%. The macro rules generate much fewer partial logical forms, but at the cost of slightly lower coverage. However, these coverage numbers are com- puted based on finding any logical form that ex- ecutes to the correct denotation. This includes spurious logical forms, which do not reflect the semantics of the question but are coincidentally consistent with the correct denotation. (For exam- ple, the question "Who got the same number of sil- vers as France?" on Table 1 might be spuriously parsed as R[Nation].R[Next].Nation.France, which represents the nation listed after France.) To evaluate the "true" coverage, we sample 300 training examples and manually label their logi- cal forms. We find that on 48.7% of these exam- ples, the top consistent logical form produced by the base grammar is semantically correct. For the macro grammar, this ratio is also 48.7%, meaning that the macro grammar's effective coverage is as good as the base grammar. The macro grammar extracts 123 macros in to- tal. Among the 75.6% examples that were covered by the macro grammar, the top 34 macros cover 90% of consistent logical forms. By examining the top 34 macros, we discover explicit semantic meanings for 29 of them, which are described in detail in the supplementary material. 4.3 Accuracy and speedup We report prediction accuracies in Table 4. With a more general base grammar (additional superla- tives and approximate matching), and by optimiz- PL15 Ours: base grammar Ours: macro grammar no holistic triggering no macro decomposition Time (ms/ex) Train Pred Acc. 37.0% 645 619 1,150 40.6% 1,117 70 99 40.4% 40.1% 361 369 159 177 40.3% Table 5: Comparison and ablation study: the columns report averaged prediction accuracy, training time, and prediction time (milliseconds per example) on the three train-dev splits. ing the objective function (9), our base parser out- performs PL15 (42.7% vs 37.1%). Learning a macro grammar slightly improves the accuracy to 43.7% on the test set. On the three train-dev splits, the averaged accuracy achieved by the base gram- mar and the macro grammar are close (40.6% vs 40.4%). In Table 5, we compare the training and predic- tion time of PL15 as well as our parsers. For a fair comparison, we trained all parsers using the SEMPRE toolkit (Berant et al., 2013) on a ma- chine with Xeon 2.6GHz CPU and 128GB mem- ory without parallelization. The time for con- structing the macro grammar is included as part of the training time. Table 5 shows that our parser with the base grammar is more expensive to train than PL15. However, training with the macro grammar is substantially more efficient than train- ing with only the base grammar- it achieves 11x speedup for training and 16x speedup for test time prediction. We run two ablations of our algorithm to evalu- ate the utility of holistic triggering and macro de- composition. The first ablation triggers all macro rules for parsing every utterance without holistic triggering, while the second ablation constructs Rule (7) for every macro without decomposing it into smaller rules. Table 5 shows that both vari- ants result in decreased efficiency. This is be- cause holistic triggering effectively prunes irrele- vant macro rules, while macro decomposition is important for efficient beam search and featuriza- tion. Influence of hyperparameters 4.4 Figure 2a shows that for all beam sizes, training with the macro grammar is more efficient than training with the base grammar, and the speedup rate grows with the beam size. The test time ac- (a) Varying beam size (b) Varying neighbor size (c) Varying base grammar usage count Figure 2: Prediction accuracy and training time (per example) with various hyperparameter choices, reported on the first train-dev split. curacy of the macro grammar is robust to varying beam sizes as long as B ≥ 25. Figure 2b shows the influence of the neighbor size K. A smaller neighborhood triggers fewer macro rules, leading to faster computation. The accuracy peaks at K = 40 then decreases slightly for large K. We conjecture that the smaller num- ber of neighbors acts as a regularizer. Figure 2c reports an experiment where we limit the number of fallback calls to the base grammar to m. After the limit is reached, subsequent train- ing examples that require fallback calls are simply skipped. This limit means that the macro gram- mar will get augmented at most m times during training. We find that for small m, the prediction accuracy grows with m, implying that building a richer macro grammar improves the accuracy. For larger m, however, the accuracies hardly change. According to the plot, a competitive macro gram- mar can be built by calling the base grammar on less than 15% of the training data. Based on Figure 2, we can trade accuracy for speed by choosing smaller values of (B, K, m). With B = 50, K = 40 and m = 2000, the macro grammar achieves a slightly lower averaged devel- opment accuracy (40.2% rather than 40.4%), but with an increased speedup of 15x (versus 11x) for training and 20x (versus 16x) for prediction. 5 Related work and discussion A traditional semantic parser maps natural lan- guage phrases into partial forms and logical composes these partial logical forms into com- plete logical forms. Parsers define composi- tion based on a grammar formalism such as Combinatory Categorial Grammar (CCG) (Zettle- moyer and Collins, 2007; Kwiatkowski et al., 2011, 2013; Kushman and Barzilay, 2013; Krish- namurthy and Kollar, 2013), Synchronous CFG (Wong and Mooney, 2007), and CFG (Kate and Mooney, 2006; Chen and Mooney, 2011; Berant et al., 2013; Desai et al., 2016), while others use the syntactic structure of the utterance to guide composition (Poon and Domingos, 2009; Reddy et al., 2016). Recent neural semantic parsers al- low any sequence of logical tokens to be generated (Dong and Lapata, 2016; Jia and Liang, 2016; Ko- cisk´y et al., 2016; Neelakantan et al., 2016; Liang et al., 2017; Guu et al., 2017). The flexibility of these composition methods allows arbitrary logi- cal forms to be generated, but at the cost of a vastly increased search space. Whether we have annotated logical forms or not has dramatic implications on what type of ap- proach will work. When logical forms are avail- able, one can perform grammar induction to mine grammar rules without search (Kwiatkowski et al., 2010). When only annotated denotations are avail- able, as in our setting, one must use a base gram- mar to define the output space of logical forms. Usually these base grammars come with many re- strictions to guard against combinatorial explosion (Pasupat and Liang, 2015). Previous work on higher-order unification for lexicon induction (Kwiatkowski et al., 2010) us- ing factored lexicons (Kwiatkowski et al., 2011) also learns logical form macros with an online al- gorithm. The result is a lexicon where each entry contains a logical form template and a set of possi- ble phrases for triggering the template. In contrast, we have avoided binding grammar rules to particu- lar phrases in order to handle lexical variations. In- stead, we use a more flexible mechanism-holistic triggering-to determine which rules to fire. This allows us to generate logical forms for utterances containing unseen lexical paraphrases or where the triggering is spread throughout the sentence. For example, the question "Who is X, John or Y" can still trigger the correct macro extracted from the last example in Table 3 even when X and Y are unknown words. Our macro grammars bears some resemblance to adaptor grammars (Johnson et al., 2006) and fragment grammars (O'Donnell, 2011), which are also based on the idea of caching useful chunks of outputs. These generative approaches aim to solve the modeling problem of assigning higher proba- bility mass to outputs that use reoccurring parts. In contrast, our learning algorithm uses caching as a way to constrain the search space for computa- tional efficiency; the probabilities of the candidate outputs are assigned by a separate discriminative model. That said, the use of macro grammars does have a small positive modeling contribution, as it increases test accuracy from 42.7% to 43.7%. An orthogonal approach for improving search efficiency is to adaptively choose which part of the search space to explore. For example, Berant and Liang (2015) uses imitation learning to strate- gically search for logical forms. Our holistic trig- gering method, which selects macro rules based on the similarity of input utterances, is related to the use of paraphrases (Berant and Liang, 2014; Fader et al., 2013) or string kernels (Kate and Mooney, 2006) to train semantic parsers. While the input similarity measure is critical for scoring logical forms in these previous works, we use the measure only to retrieve candidate rules, while scoring is done by a separate model. The retrieval bar means that our similarity metric can be quite crude. 6 Summary We have presented a method for speeding up se- mantic parsing via macro grammars. The main source of efficiency is the decreased size of the logical form space. By performing beam search on a few macro rules associated with the K- nearest neighbor utterances via holistic triggering, we have restricted the search space to semanti- cally relevant logical forms. At the same time, we still maintain coverage over the base logical form space by occasionally falling back to the base grammar and using the consistent logical forms found to enrich the macro grammar. The higher ef- ficiency allows us expand the base grammar with- out having to worry much about speed: our model achieves a state-of-the-art accuracy while also en- joying an order magnitude speedup. Acknowledgements. We gratefully acknowl- edge Tencent for their support on this project. Reproducibility. Code, data, and experiments for this paper are available on CodaLab platform: https://worksheets.codalab.org/worksheets/ 0x4d6dbfc5ec7f44a6a4da4ca2a9334d6e/. References Y. Artzi and L. Zettlemoyer. 2013. UW SPF: The Uni- versity of Washington semantic parsing framework. arXiv preprint arXiv:1311.3011. J. Berant, A. Chou, R. Frostig, and P. Liang. 2013. Se- mantic parsing on Freebase from question-answer In Empirical Methods in Natural Language pairs. Processing (EMNLP). J. Berant and P. Liang. 2014. Semantic parsing via In Association for Computational paraphrasing. Linguistics (ACL). J. Berant and P. Liang. 2015. Imitation learning of agenda-based semantic parsers. Transactions of the Association for Computational Linguistics (TACL), 3:545–558. D. L. Chen and R. J. Mooney. 2011. Learning to in- terpret natural language navigation instructions from observations. In Association for the Advancement of Artificial Intelligence (AAAI), pages 859–865. J. Clarke, D. Goldwasser, M. Chang, and D. Roth. 2010. Driving semantic parsing from the world's re- sponse. In Computational Natural Language Learn- ing (CoNLL), pages 18–27. A. Desai, S. Gulwani, V. Hingorani, N. Jain, A. Karkare, M. Marron, S. R, and S. Roy. 2016. Pro- gram synthesis using natural language. In Interna- tional Conference on Software Engineering (ICSE), pages 345–356. L. Dong and M. Lapata. 2016. Language to logical form with neural attention. In Association for Com- putational Linguistics (ACL). J. Duchi, E. Hazan, and Y. Singer. 2010. Adaptive sub- gradient methods for online learning and stochastic In Conference on Learning Theory optimization. (COLT). A. Fader, L. Zettlemoyer, and O. Etzioni. 2013. Paraphrase-driven learning for open question an- swering. In Association for Computational Linguis- tics (ACL). grammars from logical form with higher-order unifi- cation. In Empirical Methods in Natural Language Processing (EMNLP), pages 1223–1233. T. Kwiatkowski, L. Zettlemoyer, S. Goldwater, and M. Steedman. 2011. Lexical generalization in CCG In Em- grammar induction for semantic parsing. pirical Methods in Natural Language Processing (EMNLP), pages 1512–1523. K. Guu, P. Pasupat, E. Z. Liu, and P. Liang. 2017. From language to programs: Bridging reinforce- ment learning and maximum marginal likelihood. In Association for Computational Linguistics (ACL). C. Liang, J. Berant, Q. Le, and K. D. F. N. Lao. 2017. Neural symbolic machines: Learning seman- tic parsers on Freebase with weak supervision. In Association for Computational Linguistics (ACL). P. Liang. 2013. Lambda dependency-based composi- tional semantics. arXiv preprint arXiv:1309.4408. P. Liang, M. I. Jordan, and D. Klein. 2011. Learn- ing dependency-based compositional semantics. In Association for Computational Linguistics (ACL), pages 590–599. A. Neelakantan, Q. V. Le, and I. Sutskever. 2016. Neural programmer: Inducing latent programs with In International Conference on gradient descent. Learning Representations (ICLR). T. J. O'Donnell. 2011. Productivity and Reuse in Language. Ph.D. thesis, Massachusetts Institute of Technology. P. Pasupat and P. Liang. 2015. Compositional semantic parsing on semi-structured tables. In Association for Computational Linguistics (ACL). H. Poon and P. Domingos. 2009. Unsupervised seman- tic parsing. In Empirical Methods in Natural Lan- guage Processing (EMNLP). S. Reddy, O. Tackstrom, M. Collins, T. Kwiatkowski, D. Das, M. Steedman, and M. Lapata. 2016. Trans- forming dependency structures to logical forms for semantic parsing. In Association for Computational Linguistics (ACL), pages 127–140. Y. W. Wong and R. J. Mooney. 2007. Learning synchronous grammars for semantic parsing with lambda calculus. In Association for Computational Linguistics (ACL), pages 960–967. L. S. Zettlemoyer and M. Collins. 2007. Online learn- ing of relaxed CCG grammars for parsing to log- In Empirical Methods in Natural Lan- ical form. guage Processing and Computational Natural Lan- guage Learning (EMNLP/CoNLL), pages 678–687. T. Haug, O. Ganea, and P. Grnarova. 2017. Neu- ral multi-step reasoning for question answer- arXiv preprint ing on semi-structured tables. arXiv:1702.06589. P. Indyk. 2004. Approximate nearest neighbor under edit distance via product metrics. In Symposium on Discrete Algorithms (SODA), pages 646–650. R. Jia and P. Liang. 2016. Data recombination for neu- ral semantic parsing. In Association for Computa- tional Linguistics (ACL). M. Johnson, T. Griffiths, and S. Goldwater. 2006. Adaptor grammars: A framework for specifying compositional nonparametric Bayesian models. In Advances in Neural Information Processing Systems (NIPS), pages 641–648. R. J. Kate and R. J. Mooney. 2006. Using string- In Interna- kernels for learning semantic parsers. tional Conference on Computational Linguistics and Association for Computational Linguistics (COL- ING/ACL), pages 913–920. T. Kocisk´y, G. Melis, E. Grefenstette, C. Dyer, W. Ling, P. Blunsom, and K. M. Hermann. 2016. Semantic parsing with semi-supervised sequential In Empirical Methods in Natural autoencoders. Language Processing (EMNLP), pages 1078–1087. J. Krishnamurthy and T. Kollar. 2013. Jointly learning to parse and perceive: Connecting natural language to the physical world. Transactions of the Associa- tion for Computational Linguistics (TACL), 1:193– 206. N. Kushman and R. Barzilay. 2013. Using semantic unification to generate regular expressions from nat- ural language. In Human Language Technology and North American Association for Computational Lin- guistics (HLT/NAACL), pages 826–836. T. Kwiatkowski, E. Choi, Y. Artzi, and L. Zettlemoyer. 2013. Scaling semantic parsers with on-the-fly on- tology matching. In Empirical Methods in Natural Language Processing (EMNLP). T. Kwiatkowski, L. Zettlemoyer, S. Goldwater, and Inducing probabilistic CCG M. Steedman. 2010. Supplementary material: macro analysis The macro grammar extracts 123 macros from the WikiTableQuestions dataset, covering consistent logi- cal forms for 75.6% examples. Let the frequency of a macro be defined as the number of highest-scoring consistent logical forms that it generates. We plot the frequency of all macros, sorted in decreasing order: As demonstrated by the plot, the top 20 macros cover 80% total frequency, and the top 34 macros cover 90% total frequency. It suggests that a small fraction of macros capture most examples' consistent logical forms. By manually examining the top 34 macros, we find that 29 of them have explicit semantics. These macros correspond to abstract operations on the table, but when their slots are filled with concrete entities and relations3, they can be phrased in meaningful natural language utterances. Below, we interpret the meaning of each macro using examples from the WikiTableQuestions dataset: 1. Macro: count({Col#1}.{Ent#2}) Description: the number of rows whose column {Col#1} matches {Ent#2}. Example: how many records were set in Beijing ? 2. Macro: R[{Col#1}].{Col#2}.{Ent#3} Description: select rows whose column {Col#2} matches {Ent#3}, then return all entities in column {Col#1}. Example: what mine is in the town of Timmins? 3. Macro: R[{Prop#1}].R[{Col#2}].{Col#3}.{Ent#4} Description: select rows whose column {Col#3} matches {Ent#4}, then return property {Prop#1} for all entities in column {Col#2}. Example: what is the number of inhabitants living in Predeal? 4. Macro: count({Col#1}.{Prop#2}.{Compare#3}.{Ent#4}) Description: the number of rows satisfying some comparative constraint. Example: how many directors served more than 3 years? 5. Macro: R[{Col#1}].argmax(Type.Row, R[λx.R[{Prop#2}].R[{Col#3}].x]) Description: select the largest value in column {Col#3}, then for the associated row, return entities in column {Col#1}. Example: which team scored the most goal? 6. Macro: R[{Col#1}].R[Next].{Col#1}.{Ent#2} Description: return the entity right below {Ent#2}. Example: who ranked right after Turkey? 3A macro could have four categories of slots: • {Col#x} represents a column relation: Name, Rank, Venue, etc. • {Prop#x} represents a property relation: Number, Year, Date, etc. • {Compare#x} represents a comparative relation: >, <, >=, <=. • {Ent#x} represents an entity: Turkey, (number 2), (year 1998), etc. 7. Macro: R[{Col#1}].argmin(Type.Row, R[λx.R[{Prop#2}].R[Col#3].x]) Description: select the smallest value in column {Col#3}, then for the associated row, return entities in column {Col#1}. Example: which team scored the least goal? 8. Macro: R[{Col#1}].argmin(Type.Row, index) Description: return column {Col#1} of the first row. Example: which president is listed at the top of the chart ? 9. Macro: count({Col#1}.argmax(R[{Col#1}].Type.Row, R[λx.count({Col#1}.x)])) Description: N/A. Example: N/A 10. Macro: count({Col#1}.argmin(R[{Col#1}].Type.Row, R[λx.count({Col#1}.x)])) Description: N/A. Example: N/A 11. Macro: R[{Col#1}].argmax(Type.Row, index) Description: return column {Col#1} of the last row. Example: which president is listed at the bottom of the chart ? 12. Macro: R[{Col#1}].Next.argmin(R[{Col#1}].{Ent#2}, index) Description: return the entity right above {Ent#2}. Example: who is listed before Jon Taylor? 13. Macro: count(Type.Row) Description: the total number of rows. Example: what is the total number of teams? 14. Macro: argmax(R[{Col#1}].Type.Row, R[λx.count({Col#1}.x)])) Description: return the most frequent entity in column {Col#1}. Example: which county has the most number of representatives? 15. Macro: sub(R[{Prop#1}].R[{Col#2}].{Col#3}.{Ent#4}, R[{Prop#1}].R[{Col#2}] .{Col#3}.{Ent#5}) Description: Given two entities, calculate the difference for some property. Example: how many more passengers flew to Los Angeles than to Saskatoon? 16. Macro: argmax(or({Ent#1}, {Ent#2}), R[λx.R[{Prop#3}].R[{Col#4}].{Col#5}.x])) Description: among two entities, return the one that is greater in some property. Example: which is deeper, Lake Tuz or Lake Palas Tuzla? 17. Macro: R[{Col#1}].argmin({Col#1}.or({Ent#1}, {Ent#2}), index) Description: N/A. Example: N/A 18. Macro: R[{Col#1}].{Col#2}.{Prop#3}.{Compare#4}.{Ent#4} Description: select rows whose property satisfies a comparative constraint, then return all entities in column {Col#1}. Example: which artist have released at least 5 albums? 19. Macro: max(R[{Prop#1}].R[{Col#2}].Type.Row) Description: return the maximum value in column {Col#2}. Example: what is the top population on the chart? 20. Macro: R[{Prop#1}].R[{Col#2}].argmin(Type.Row, index) Description: return a property in the first row's column {Col#2}. Example: what is the first year listed? 21. Macro: R[{Col#1}].argmin({Col#2}.{Prop#3}.{Compare#4}.{Ent#5}, index) Description: select the first row that satisfies a comparative constraint, then return its column {Col#1}. Example: what is the first creature after page 40? 22. Macro: R[{Col#1}].argmin({Col#2}.{Ent#3}, index) Description: select the first row whose column {Col#2} matches entity {Ent#3}, then return its col- umn {Col#1}. Example: who is the top finisher from Poland? 23. Macro: R[{Col#1}].{Col#2}.{Prop#3}.{Ent#4} Description: select rows whose column {Col#2} matches some property, then return all entities in column {Col#1}. Example: who is the only one in 4th place? 24. Macro: R[{Prop#1}].R[{Col#2}].argmax(Type.Row, index) Description: return a property of column {Col#2} of the first row. Example: what is the first year listed? 25. Macro: R[{Col#1}].Next.{Col#1}.{Ent#2} Description: same as macro 12. Example: same as macro 12 26. Macro: min(R[{Prop#1}].R[{Col#2}].Type.Row) Description: return the minimum value in column {Col#2}. Example: what is the least amount of laps completed? 27. Macro: R[{Col#1}].argmax({Col#2}.{Ent#3}, index) Description: select the last row whose column {Col#2} matches entity {Ent#3}, then return its column {Col#1}. Example: what was the last game created by Spicy Horse? 28. Macro: count({Col#1}.or({Ent#2}, {Ent#3})) Description: the number of rows whose column {Col#1} matches either {Ent#2} or {Ent#3}. Example: how many total medals did switzerland and france win? 29. Macro: R[{Prop#1}].R[{Col#2}].argmax(Type.Row, R[λx.R[{Prop#3}].R[{Col#4}].x]) Description: select the largest value in column {Col#4}, then for the associated row, return a property of column {Col#2}. Example: what year had the highest unemployment rate? 30. Macro: count({Col#1}.{Prop#2}.{Ent#3}) Description: the number of rows whose column {Col#1} matches a property {Ent#3}. Example: how many people were born in 1976? 31. Macro: count(argmin(Type.Row, R[λx.R[{Prop#1}].R[Col#2].x])) Description: N/A. Example: N/A 32. Macro: sub(count({Col#1}.{Ent#2}), count({Col#1}.{Ent#3})) Description: Given two entities, calculate the difference of their frequencies in column {Col#1}. Example: how many more games were released in 2005 than 2003? 33. Macro: R[{Prop#1}].R[{Col#2}].argmax(Type.Row, R[λx.R[{Prop#1}].R[Col#3].x]) Description: same as macro 29, but with an additional constraint that the two properties in the logical form must be equal. Example: which game number has the most attendance? 34. Macro: R[{Col#1}].R[Next].argmin(Type.Row, index) Description: N/A. Example: N/A
1704.06986
1
1704
2017-04-23T21:31:22
Learning to Create and Reuse Words in Open-Vocabulary Neural Language Modeling
[ "cs.CL" ]
Fixed-vocabulary language models fail to account for one of the most characteristic statistical facts of natural language: the frequent creation and reuse of new word types. Although character-level language models offer a partial solution in that they can create word types not attested in the training corpus, they do not capture the "bursty" distribution of such words. In this paper, we augment a hierarchical LSTM language model that generates sequences of word tokens character by character with a caching mechanism that learns to reuse previously generated words. To validate our model we construct a new open-vocabulary language modeling corpus (the Multilingual Wikipedia Corpus, MWC) from comparable Wikipedia articles in 7 typologically diverse languages and demonstrate the effectiveness of our model across this range of languages.
cs.CL
cs
Learning to Create and Reuse Words in Open-Vocabulary Neural Language Modeling Kazuya Kawakami♠ Chris Dyer♣ Phil Blunsom♠♣ ♠Department of Computer Science, University of Oxford, Oxford, UK ♣DeepMind, London, UK {kazuya.kawakami,phil.blunsom}@cs.ox.ac.uk,[email protected] 7 1 0 2 r p A 3 2 ] L C . s c [ 1 v 6 8 9 6 0 . 4 0 7 1 : v i X r a Abstract Fixed-vocabulary language models fail to account for one of the most character- istic statistical facts of natural language: the frequent creation and reuse of new word types. Although character-level lan- guage models offer a partial solution in that they can create word types not at- tested in the training corpus, they do not capture the "bursty" distribution of such words. In this paper, we augment a hierar- chical LSTM language model that gener- ates sequences of word tokens character by character with a caching mechanism that learns to reuse previously generated words. To validate our model we construct a new open-vocabulary language modeling cor- pus (the Multilingual Wikipedia Corpus; MWC) from comparable Wikipedia arti- cles in 7 typologically diverse languages and demonstrate the effectiveness of our model across this range of languages. 1 Introduction Language modeling is an important problem in natural language processing with many practi- cal applications (translation, speech recognition, spelling autocorrection, etc.). Recent advances in neural networks provide strong representational power to language models with distributed repre- sentations and unbounded dependencies based on recurrent networks (RNNs). However, most lan- guage models operate by generating words by sam- pling from a closed vocabulary which is composed of the most frequent words in a corpus. Rare tokens are typically replaced by a special token, called the unknown word token, hUNKi. Although fixed-vocabulary language models have some im- portant practical applications and are appealing models for study, they fail to capture two empir- ical facts about the distribution of words in nat- ural languages. First, vocabularies keep growing as the number of documents in a corpus grows: new words are constantly being created (Heaps, 1978). Second, rare and newly created words of- ten occur in "bursts", i.e., once a new or rare word has been used once in a document, it is often re- peated (Church and Gale, 1995; Church, 2000). The open-vocabulary problem can be solved by dispensing with word-level models in favor of models that predict sentences as sequences of char- acters (Sutskever et al., 2011; Chung et al., 2017). Character-based models are quite successful at learning what (new) word forms look like (e.g., they learn a language's orthographic conventions that tell us that sustinated is a plausible English word and bzoxqir is not) and, when based on mod- els that learn long-range dependencies such as RNNs, they can also be good models of how words fit together to form sentences. However, existing character-sequence models have no explicit mechanism for modeling the fact that once a rare word is used, it is likely to be used again. In this paper, we propose an extension to character-level language models that enables them to reuse previously generated tokens (§2). Our starting point is a hierarchical LSTM that has been previously used for modeling sentences (word by word) in a conversation (Sordoni et al., 2015), ex- cept here we model words (character by character) in a sentence. To this model, we add a caching mechanism similar to recent proposals for caching that have been advocated for closed-vocabulary models (Merity et al., 2017; Grave et al., 2017). As word tokens are generated, they are placed in an LRU cache, and, at each time step the model decides whether to copy a previously generated word from the cache or to generate it from scratch, character by character. The decision of whether to use the cache or not is a latent variable that is marginalised during learning and inference. In summary, our model has three properties: it cre- ates new words, it accounts for their burstiness us- ing a cache, and, being based on LSTM s over word representations, it can model long range de- pendencies. To evaluate our model, we perform ablation ex- periments with variants of our model without the cache or hierarchical structure. In addition to stan- dard English data sets (PTB and WikiText-2), we introduce a new multilingual data set: the Multi- lingual Wikipedia Corpus (MWC), which is con- structed from comparable articles from Wikipedia in 7 typologically diverse languages (§3) and show the effectiveness of our model in all languages (§4). By looking at the posterior probabilities of the generation mechanism (language model vs. cache) on held-out data, we find that the cache is used to generate "bursty" word types such as proper names, while numbers and generic content words are generated preferentially from the lan- guage model (§5). 2 Model In this section, we describe our hierarchical char- acter language model with a word cache. As is typ- ical for RNN language models, our model uses the chain rule to decompose the problem into incre- mental predictions of the next word conditioned on the history: p(w) = w Y t=1 p(wt w<t). We make two modifications to the traditional RNN language model, which we describe in turn. First, we begin with a cache-less model we call the hierarchical character language model (HCLM; §2.1) which generates words as a sequence of characters and constructs a "word embedding" by encoding a character sequence with an LSTM (Ling et al., 2015). However, like conventional closed-vocabulary, word-based models, it is based on an LSTM that conditions on words represented by fixed-length vectors.1 1The HCLM is an adaptation of the hierarchical recurrent encoder-decoder of Sordoni et al. (2015) which was used to model dialog as a sequence of actions sentences which are themselves sequences of words. The original model was pro- posed to compose words into query sequences but we use it to compose characters into word sequences. The HCLM has no mechanism to reuse words that it has previously generated, so new forms will only be repeated with very low probability. How- ever, since the HCLM is not merely generating sentences as a sequence of characters, but also segmenting them into words, we may add a word- based cache to which we add words keyed by the hidden state being used to generate them (§2.2). This cache mechanism is similar to the model pro- posed by Merity et al. (2017). Notation. Our model assigns probabilities to se- quences of words w = w1, . . . , ww, where w is the length, and where each word wi is represented by a sequence of characters ci = ci,1, . . . , ci,ci of length ci. 2.1 Hierarchical Character-level Language Model (HCLM) This hierarchical model satisfies our linguistic in- tuition that written language has (at least) two dif- ferent units, characters and words. The HCLM consists of four components, three LSTMs (Hochreiter and Schmidhuber, 1997): a character encoder, a word-level context encoder, (denoted LSTMenc, and a character decoder LSTMctx, and LSTMdec, respectively), and a soft- max output layer over the character vocabulary. Fig. 1 illustrates an unrolled HCLM. Suppose the model reads word wt−1 and pre- dicts the next word wt. First, the model reads the character sequence representing the word wt−1 = ct−1,1, . . . , ct−1,ct−1 where ct−1 is the length of the word generated at time t − 1 in charac- ters. Each character is represented as a vector vct−1,1, . . . , vct−1,ct−1 and fed into the encoder LSTMenc . The final hidden state of the encoder LSTMenc is used as the vector representation of the previously generated word wt−1, henc t = LSTMenc(vct−1,1, . . . , vct−1,ct ). Then all the vector representations of words (vw1, . . . , vww) are processed with a context LSTMctx . Each of the hidden states of the context LSTMctx are considered representations of the his- tory of the word sequence. hctx t = LSTMctx(henc 1 , . . . , henc t ) Finally, the initial state of the decoder LSTM and the decoder LSTM reads a hSi and is set to be hctx vector representation of the start symbol v t p(Pok´emon) = λtplm(Pok´emon) + (1 − λt)pptr(Pok´emon) pptr(Pok´emon) λt plm(Pok´emon) wt P o k é m o n </s> ut Cache . . . . . . . . rt <s> P o k é m o n hctx t henc t P o k é m o n </s> C o m p a n y </s> …. ( f o r m e r l y </s> wt−1 The Pokémon Company International (formerly Pokémon USA Inc.), a subsidiary of Japan's Pokémon Co., oversees all Pokémon licensing … Figure 1: Description of Hierarchical Character Language Model with Cache. generates the next word wt+1 character by charac- ter. To predict the j-th character in wt, the decoder LSTM reads vector representations of the previ- ous characters in the word, conditioned on the con- text vector hctx t and a start symbol. t,j = LSTMdec(vct,1, . . . , vct,j−1, hctx hdec t , vhSi). The character generation probability is defined by a softmax layer for the corresponding hidden representation of the decoder LSTM . p(ct,j w<t, ct,<j) = softmax(Wdechdec t,j + bdec) Thus, a word generation probability from HCLM is defined as follows. plm(wt w<t) = ct Y j=1 p(ct,j w<t, ct,<j) 2.2 Continuous cache component The cache component is an external memory structure which store K elements of recent his- tory. Similarly to the memory structure used in Grave et al. (2017), a word is added to a key-value memory after each generation of wt. The key at position i ∈ [1, K] is ki and its value mi. The if the wt ex- memory slot is chosen as follows: ists already in the memory, its key is updated (dis- cussed below). Otherwise, if the memory is not full, an empty slot is chosen or the least recently used slot is overwritten. When writing a new word to memory, the key is the RNN representation that was used to generate the word (ht) and the value is the word itself (wt). In the case when the word al- ready exists in the cache at some position i, the ki is updated to be the arithmetic average of ht and the existing ki. To define the copy probability from the cache at time t, a distribution over copy sites is defined using the attention mechanism of Bahdanau et al. (2015). To do so, we construct a query vector (rt) from the RNN's current hidden state ht, rt = tanh(Wq ht + bq), then, for each element i of the cache, a 'copy score,' ui,t is computed, ui,t = vT tanh(Wuki + rt). Finally, the probability of generating a word via the copying mechanism is: pmem(i ht) = softmaxi(ut) pptr(wt ht) = pmem(i ht)[mi = wt], where [mi = wt] is 1 if the ith value in memory is wt and 0 otherwise. Since pmem defines a distri- bution of slots in the cache, pptr translates it into word space. 2.3 Character-level Neural Cache Language Model The word probability p(wt w<t) is defined as a mixture of the following two probabilities. The first one is a language model probability, plm(wt w<t) and the other is pointer probability , pptr(wt w<t). The final probability p(wt w<t) is λtplm(wt w<t) + (1 − λt)pptr(wt w<t), where λt is computed by a multi-layer perceptron with two non-linear transformations using ht as its input, followed by a transformation by the logistic sigmoid function: γt = MLP(ht), λt = 1 1 − e−γt . We remark that Grave et al. (2017) use a clever trick to estimate the probability, λt of drawing from the LM by augmenting their (closed) vocab- ulary with a special symbol indicating that a copy should be used. This enables word types that are highly predictive in context to compete with the probability of a copy event. However, since we are working with an open vocabulary, this strategy is unavailable in our model, so we use the MLP formulation. 2.4 Training objective The model parameters as well as the character pro- jection parameters are jointly trained by maximiz- ing the following log likelihood of the observed characters in the training corpus, L = − X log p(wt w<t). 3 Datasets We evaluate our model on a range of datasets, em- ploying preexisting benchmarks for comparison to previous published results, and a new multilingual corpus which specifically tests our model's perfor- mance across a range of typological settings. 3.1 Penn Tree Bank (PTB) We evaluate our model on the Penn Tree Bank. For fair comparison with previous works, we fol- lowed the standard preprocessing method used by Mikolov et al. (2010). In the standard prepro- cessing, tokenization is applied, words are lower- cased, and punctuation is removed. Also, less fre- quent words are replaced by unknown an token (UNK),2 constraining the word vocabulary size to be 10k. Because of this preprocessing, we do not expect this dataset to benefit from the modeling in- novations we have introduced in the paper. Fig.1 summarizes the corpus statistics. Train Dev Test Character types Word types OOV rate Word tokens Characters 50 6022 50 10000 - 48 6049 0.00% 0.00% 0.9M 0.1M 0.1M 5.1M 0.4M 0.4M Table 1: PTB Corpus Statistics. 3.2 WikiText-2 Merity et al. (2017) proposed the WikiText-2 Cor- pus as a new benchmark dataset.3 They pointed out that the preprocessed PTB is unrealistic for real language use in terms of word distribution. Since the vocabulary size is fixed to 10k, the word frequency does not exhibit a long tail. The wikiText-2 corpus is constructed from 720 articles. They provided two versions. The version for word level language modeling was preprocessed by dis- carding infrequent words. But, for character-level models, they provided raw documents without any removal of word or character types or lowercas- ing, but with tokenization. We make one change to this corpus: since Wikipedia articles make ex- tensive use of characters from other languages; we replaced character types that occur fewer than 25 times were replaced with a dummy character (this plays the role of the hUNKi token in the character vocabulary). Tab. 2 summarizes the corpus statis- tics. 3.3 Multilingual Wikipedia Corpus (MWC) Languages differ in what word formation pro- cesses they have. For character-level modeling it is therefore interesting to compare a model's performance across languages. Since there is at present no standard multilingual language model- ing dataset, we created a new dataset, the Mul- 2When the unknown token is used in character-level model, it is treated as if it were a normal word (i.e. UNK is the sequence U, N, and K). This is somewhat surprising mod- eling choice, but it has become conventional (Chung et al., 2017). 3http://metamind.io/research/the-wikitext-long-term- Train Dev Test Character types Word types OOV rate Word tokens Characters 255 76137 - 138 128 19813 21109 4.79% 5.87% 2.1M 0.2M 0.2M 10.9M 1.1M 1.3M Table 2: WikiText-2 Corpus Statistics. for dev and test respectively. Table 3 summarizes the corpus statistics. Additionally, we show in Fig. 2 the distribution of frequencies of OOV word types (relative to the training set) in the dev+test portions of the corpus, which shows a power-law distribution, which is ex- pected for the burstiness of rare words found in prior work. Curves look similar for all languages (see Appendix A). tilingual Wikipedia Corpus (MWC), a corpus of the same Wikipedia articles in 7 languages which manifest a range of morphological typologies. The MWC contains English (EN), French (FR), Span- ish (ES), German (DE), Russian (RU), Czech (CS), and Finnish (FI). To attempt to control for topic divergences across languages, every language's data consists of the same articles. Although these are only com- parable (rather than true translations), this ensures that the corpus has a stable topic profile across lan- guages.4 Construction & Preprocessing We constructed the MWC similarly to the WikiText-2 corpus. Ar- ticles were selected from Wikipedia in the 7 target languages. To keep the topic distribution to be ap- proximately the same across the corpora, we ex- tracted articles about entities which explained in all the languages. We extracted articles which ex- ist in all languages and each consist of more than 1,000 words, for a total of 797 articles. These cross-lingual articles are, of course, not usually translations, but they tend to be comparable. This filtering ensures that the topic profile in each lan- guage is similar. Each language corpus is approxi- mately the same size as the WikiText-2 corpus. Wikipedia markup was removed with WikiEx- tractor,5 to obtain plain text. We used the same thresholds to remove rare characters in the WikiText-2 corpus. No tokenization or other nor- malization (e.g., lowercasing) was done. Statistics After the preprocessing described above, we randomly sampled 360 articles. The ar- ticles are split into 300, 30, 30 sets and the first 300 articles are used for training and the rest are used 4The (MWC) download http://k-kawakami.com/research/mwc Multilingual available is Wikipedia for Corpus from 5https://github.com/attardi/wikiextractor Figure 2: Histogram of OOV word frequencies in the dev+test part of the MWC Corpus (EN). 4 Experiments We now turn to a series of experiments to show the value of our hierarchical character-level cache language model. For each dataset we trained the model with LSTM units. To compare our results with a strong baseline, we also train a model with- out the cache. Model Configuration For HCLM and HCLM with cache models, We used 600 dimensions for the character embeddings and the LSTMs have 600 hidden units for all the experiments. This keeps the model complexity to be approximately the same as previous works which used an LSTM with 1000 dimension. Our baseline LSTM have 1000 dimensions for embeddings and reccurence weights. For the cache model, we used cache size 100 in every experiment. All the parameters includ- ing character projection parameters are randomly sampled from uniform distribution from −0.08 to 0.08. The initial hidden and memory state of LSTMenc and LSTMctx are initialized with zero. Mini-batches of size 25 are used for PTB experi- ments and 10 for WikiText-2, due to memory lim- itations. The sequences were truncated with 35 Char. Types Word Types OOV rate Tokens Characters Train Valid Test Train Valid Test Valid Test Train Valid Test Train Valid Test EN FR DE ES CS FI RU 307 272 298 307 238 246 273 160 141 162 164 128 123 184 157 155 183 176 144 135 196 193808 166354 238703 160574 167886 190595 236834 38826 34991 40848 31358 23959 32899 46663 35093 38323 41962 34999 29638 31109 44772 6.60% 5.46% 2.5M 0.2M 0.2M 15.6M 1.5M 1.3M 6.70% 6.96% 2.0M 0.2M 0.2M 12.4M 1.3M 1.6M 7.07% 7.01% 1.9M 0.2M 0.2M 13.6M 1.2M 1.3M 6.61% 7.35% 1.8M 0.2M 0.2M 11.0M 1.0M 1.3M 5.06% 6.44% 0.9M 0.1M 0.1M 6.1M 0.4M 0.5M 8.33% 7.39% 0.7M 0.1M 0.1M 6.4M 0.7M 0.6M 7.76% 7.20% 1.3M 0.1M 0.1M 9.3M 1.0M 0.9M Table 3: Summary of MWC Corpus. words. Then the words are decomposed to char- acters and fed into the model. A Dropout rate of 0.5 was used for all but the recurrent connections. that our character-level models are dealing with an open vocabulary without unknown tokens, the re- sults are promising. Learning The models were trained with the Adam update rule (Kingma and Ba, 2015) with a learning rate of 0.002. The maximum norm of the gradients was clipped at 10. Evaluation We evaluated our models with bits- per-character (bpc) a standard evaluation metric for character-level language models. Following the definition in Graves (2013), bits-per-character is the average value of − log2 p(wt w<t) over the whole test set, bpc = − 1 c log2 p(w), where c is the length of the corpus in characters. 4.1 Results results on the LSTM with Zoneout PTB Tab. summarizes the 4 PTB dataset.6 Our baseline HCLM model achieved 1.276 bpc which is better performance than regulariza- tion (Krueger et al., 2017). And HCLM with cache outperformed the baseline model with 1.247 bpc and achieved competitive results with state-of-the-art models with regularization on recurrence weights, which was not used in our experiments. Expressed in terms of per-word perplexity (i.e., rather than normalizing by the length of the corpus in characters, we normalize by words and expo- nentiate), the test perplexity on HCLM with cache is 94.79. The performance of the unregularized 2-layer LSTM with 1000 hidden units on word- level PTB dataset is 114.5 and the same model with dropout achieved 87.0. Considering the fact 6Models designated with a * have more layers and more parameters. Method Dev Test - 1.46 CW-RNN (Koutnik et al., 2014) - 1.41 HF-MRNN (Mikolov et al., 2012) MI-RNN (Wu et al., 2016) - 1.39 - 1.37 ME n-gram (Mikolov et al., 2012) 1.281 1.32 RBN (Cooijmans et al., 2017) Recurrent Dropout (Semeniuta et al., 2016) 1.338 1.301 1.362 1.297 Zoneout (Krueger et al., 2017) HM-LSTM (Chung et al., 2017) - 1.27 HyperNetwork (Ha et al., 2017) 1.296 1.265 LayerNorm HyperNetwork (Ha et al., 2017) 1.281 1.250 2-LayerNorm HyperLSTM (Ha et al., 2017)* - 1.219 2-Layer with New Cell (Zoph and Le, 2016)* - 1.214 LSTM (Our Implementation) HCLM HCLM with Cache 1.369 1.331 1.308 1.276 1.266 1.247 Table 4: Results on PTB Corpus (bits-per- character). HCLM augmented with a cache ob- tains the best results among models which have approximately the same numbers of parameter as single layer LSTM with 1,000 hidden units. WikiText-2 Tab. 5 summarizes results on the WikiText-2 dataset. Our baseline, LSTM achieved 1.803 bpc and HCLM model achieved 1.670 bpc. The HCLM with cache outperformed the base- line models and achieved 1.500 bpc. The word level perplexity is 227.30, which is quite high compared to the reported word level baseline re- sult 100.9 with LSTM with ZoneOut and Varia- tional Dropout regularization (Merity et al., 2017). However, the character-level model is dealing with 76,136 types in training set and 5.87% OOV rate where the word level models only use 33,278 types without OOV in test set. The improvement rate over the HCLM baseline is 10.2% which is much higher than the improvement rate obtained in the PTB experiment. Method LSTM HCLM HCLM with Cache Dev Test 1.758 1.803 1.625 1.670 1.480 1.500 Table 5: Results on WikiText-2 Corpus . Multilingual Wikipedia Corpus (MWC) Tab. 6 summarizes results on the MWC dataset. Similarly to WikiText-2 experiments, LSTM is strong baseline. We observe that the cache mecha- nism improve performance in every languages. In English, HCLM with cache achieved 1.538 bpc where the baseline is 1.622 bpc. It is 5.2% im- provement. For other languages, the improvement rates were 2.7%, 3.2%, 3.7%, 2.5%, 4.7%, 2.7% in FR, DE, ES, CS, FI, RU respectively. The best improvement rate was obtained in Finnish. 5 Analysis In this section, we analyse the behavior of pro- posed model qualitatively. To analyse the model, we compute the following posterior probability which tell whether the model used the cache given a word and its preceding context. Let zt be a ran- dom variable that says whether to use the cache or the LM to generate the word at time t. We would like to know, given the text w, whether the cache was used at time t. This can be computed as fol- lows: p(zt w) = p(zt, wt ht, cachet) p(wt ht, cachet) = (1 − λt)pptr(wt ht, cachet) p(wt ht, cachet) , where cachet is the state of the cache at time t. We report the average posterior probability of cache generation excluding the first occurrence of w, p(z w). Tab. 7 shows the words in the WikiText-2 test set that occur more than 1 time that are most/least likely to be generated from cache and character language model (words that occur only one time cannot be cache-generated). We see that the model uses the cache for proper nouns: Lesnar, Gore, etc., as well as very frequent words which always stored somewhere in the cache such as single- token punctuation, the, and of. In contrast, the model uses the language model to generate num- bers (which tend not to be repeated): 300, 770 and basic content words: sounds, however, unable, etc. This pattern is similar to the pattern found in empirical distribution of frequencies of rare words observed in prior wors (Church and Gale, 1995; Church, 2000), which suggests our model is learn- ing to use the cache to account for bursts of rare words. To look more closely at rare words, we also in- vestigate how the model handles words that oc- curred between 2 and 100 times in the test set, but fewer than 5 times in the training set. Fig. 3 is a scatter plot of p(z w) vs the empirical frequency in the test set. As expected, more frequently re- peated words types are increasingly likely to be drawn from the cache, but less frequent words show a range of cache generation probabilities. Figure 3: Average p(z w) of OOV words in test set vs. term frequency in the test set for words not obsered in the training set. The model prefers to copy frequently reused words from cache compo- nent, which tend to names (upper right) while char- acter level generation is used for infrequent open class words (bottom left). Tab. 8 shows word types with the highest and lowest average p(z w) that occur fewer than 5 times in the training corpus. The pattern here is similar to the unfiltered list: proper nouns are extremely likely to have been cache-generated, whereas numbers and generic (albeit infrequent) content words are less likely to have been. 6 Discussion Our results show that the HCLM outperforms a ba- sic LSTM. With the addition of the caching mech- the HCLM becomes consistently more anism, powerful than both the baseline HCLM and the LSTM. This is true even on the PTB, which has no rare or OOV words in its test set (because of preprocessing), by caching repetitive common EN FR DE ES CS FI RU dev test dev test dev test dev test dev test dev test dev test LSTM HCLM HCLM with Cache 1.793 1.736 1.669 1.621 1.780 1.754 1.733 1.667 2.191 2.155 1.943 1.913 1.942 1.932 1.683 1.622 1.553 1.508 1.666 1.641 1.617 1.555 2.070 2.035 1.832 1.796 1.832 1.810 1.591 1.538 1.499 1.467 1.605 1.588 1.548 1.498 2.010 1.984 1.754 1.711 1.777 1.761 Table 6: Results on MWC Corpus (bits-per-character). Word p(z w) ↓ Word p(z w) ↑ Word p(z w) ↓ Word p(z w) ↑ . Lesnar the NY Gore Bintulu Nerva , UB Nero Osbert Kershaw Manila Boulter Stevens Rifenburg Arjona of 31B Olympics 300 act however 770 put sounds instead 440 similar 27 help few 110 Jersey even y though becoming 0.997 0.991 0.988 0.985 0.977 0.976 0.976 0.974 0.972 0.967 0.967 0.962 0.962 0.958 0.956 0.952 0.952 0.945 0.941 An 0.941 unable 0.000 0.001 0.002 0.003 0.003 0.004 0.005 0.005 0.006 0.009 0.009 0.010 0.010 0.011 0.011 0.012 0.012 0.013 0.013 0.014 Gore Nero Osbert Kershaw 31B Kirby CR SM impedance Blockbuster Superfamily Amos Steiner Bacon filters Lim Selfridge filter Lockport Germaniawerft 770 246 Lo Pitcher Poets popes 0.977 0.967 0.967 0.962 0.941 0.935 0.926 Yap 0.924 Piso consul 0.923 heavyweight 0.900 0.900 cheeks loser 0.900 0.897 amphibian squads 0.893 los 0.889 0.889 Keenan 0.875 0.875 Gen. 0.867 Kipling Tabasco 0.857 sculptors 0.003 0.037 0.074 0.142 0.143 0.143 0.143 0.143 0.143 0.143 0.154 0.164 0.167 0.167 0.167 0.167 0.167 0.167 0.167 0.167 Table 7: Word types with the highest/lowest av- erage posterior probability of having been copied from the cache while generating the test set. The probability tells whether the model used the cache given a word and its context. Left: Cache is used for frequent words (the, of ) and proper nouns (Lesnar, Gore). Right: Character level generation is used for basic words and numbers. words such as the. In true open-vocabulary set- tings (i.e., WikiText-2 and MWC), the improve- ments are much more pronounced, as expected. In complexity. Computational comparison with word-level models, our model has to read and generate each word character by character, and it also requires a softmax over the entire memory at every time step. However, the com- putation is still linear in terms of the length of the sequence, and the softmax over the memory cells and character vocabulary are much smaller than word-level vocabulary. On the other hand, since the recurrent states are updated once per character (rather than per word) in our model, the distribution of operations is quite different. Depending on the hardware support for these operations (repeated updates of recurrent states Table 8: Same as Table 7, except filtering for word types that occur fewer than 5 times in the training set. The cache component is used as expected even on rare words: proper nouns are extremely likely to have been cache-generated, whereas numbers and generic content words are less likely to have been; this indicates both the effectiveness of the prior at determining whether to use the cache and the burstiness of proper nouns. vs. softmaxes), our model may be faster or slower. However, our model will have fewer parameters than a word-based model since most of the parameters in such models live in the word projection layers, and we use LSTMs in place of these. Non-English languages. For non-English lan- guages, the pattern is largely similar for non- English languages. This is not surprising since morphological processes may generate forms that are related to existing forms, but these still have slight variations. Thus, they must be generated by the language model component (rather than from the cache). Still, the cache demonstrates consis- tent value in these languages. Finally, our analysis of the cache on English does show that it is being used to model word reuse, particularly of proper names, but also of frequent words. While empirical analysis of rare word distributions predicts that names would be reused, the fact that cache is used to model fre- quent words suggests that effective models of lan- guage should have a means to generate common words as units. Finally, our model disfavors copy- ing numbers from the cache, even when they are available. This suggests that it has learnt that numbers are not generally repeated (in contrast to names). The model proposed in this paper assumes the observation of word segmentation. the model is not directly applicable to languages, such as Chinese and Japanese, where word segments are not explicitly observable. We will investigate a model which can marginalise word segmentation as latent variables in the future work. Thus, Acknowledgements We thank the three anonymous reviewers for their valuable feedback. The third author acknowledges the support of the EPSRC and nvidia Corporation. 7 Related Work Caching language models were proposed to for burstiness by Kuhn and De Mori account (1990), and recently, this idea has been in- corporated to augment neural language models with a caching mechanism (Merity et al., 2017; Grave et al., 2017). Open vocabulary neural language models have been widely explored (Sutskever et al., 2011; Mikolov et al., 2012; Graves, 2013, inter alia). Attempts to make them more aware of word- level dynamics, using models similar to our hierarchical formulation, have also been pro- posed (Chung et al., 2017). The only models that are open vocabulary lan- guage modeling together with a caching mech- anism are the nonparametric Bayesian language models based on hierarchical Pitman–Yor pro- cesses which generate a lexicon of word types us- ing a character model, and then generate a text using these (Teh, 2006; Goldwater et al., 2009; Chahuneau et al., 2013). These, however, do not use distributed representations on RNNs to capture long-range dependencies. 8 Conclusion In this paper, we proposed a character-level lan- guage model with an adaptive cache which selec- tively assign word probability from past history or character-level decoding. And we empirically show that our model efficiently model the word sequences and achieved better perplexity in every standard dataset. To further validate the perfor- mance of our model on different languages, we collected multilingual wikipedia corpus for 7 typo- logically diverse languages. We also show that our model performs better than character-level models by modeling burstiness of words in local context. References Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Ben- gio. 2015. Neural machine translation by jointly learning to align and translate. In Proc. ICLR. Victor Chahuneau, Noah A. Smith, and Chris Dyer. 2013. Knowledge-rich morphological priors for bayesian language models. In Proc. NAACL. Junyoung Chung, Sungjin Ahn, and Yoshua Bengio. 2017. Hierarchical multiscale recurrent neural net- works. In Proc. ICLR. Kenneth W Church. 2000. Empirical estimates of adap- tation: the chance of two Noriegas is closer to p/2 than p2. In Proc. COLING. Kenneth W Church and William A Gale. 1995. Poisson mixtures. Natural Language Engineering 1(2):163– 190. Tim Cooijmans, Nicolas Ballas, César Laurent, Çaglar Gülçehre, and Aaron Courville. 2017. Recurrent batch normalization. In Proc. ICLR. Sharon Goldwater, Thomas L Griffiths, and Mark John- son. 2009. A Bayesian framework for word segmen- tation: Exploring the effects of context. Cognition 112(1):21–54. Edouard Grave, Armand Joulin, and Nicolas Usunier. 2017. Improving neural language models with a con- tinuous cache. In Proc. ICLR. Alex Graves. 2013. recurrent neural networks. arXiv:1308.0850 . Generating sequences with arXiv preprint David Ha, Andrew Dai, and Quoc V Le. 2017. Hyper- networks. In Proc. ICLR. Harold Stanley Heaps. 1978. Information retrieval: Computational and theoretical aspects. Academic Press, Inc. Sepp Hochreiter and Jürgen Schmidhuber. 1997. Long short-term memory. Neural computation 9(8):1735– 1780. Diederik Kingma and Jimmy Ba. 2015. Adam: A method for stochastic optimization. In Proc. ICLR. A Corpus Statistics Fig. 4 show distribution of frequencies of OOV word types in 6 languages. Jan Koutnik, Klaus Greff, Faustino Gomez, and Juer- In gen Schmidhuber. 2014. A clockwork RNN. Proc. ICML. David Krueger, Tegan Maharaj, János Kramár, Moham- mad Pezeshki, Nicolas Ballas, Nan Rosemary Ke, Anirudh Goyal, Yoshua Bengio, Hugo Larochelle, Aaron Courville, et al. 2017. Zoneout: Regulariz- ing rnns by randomly preserving hidden activations. In Proc. ICLR. Roland Kuhn and Renato De Mori. 1990. A cache- based natural language model for speech recogni- tion. IEEE transactions on pattern analysis and ma- chine intelligence 12(6):570–583. Wang Ling, Tiago Luís, Luís Marujo, Ramón Fernan- dez Astudillo, Silvio Amir, Chris Dyer, Alan W Black, and Isabel Trancoso. 2015. Finding function in form: Compositional character models for open vocabulary word representation. In Proc. EMNLP. Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. 2017. Pointer sentinel mixture mod- els. In Proc. ICLR. Tomas Mikolov, Martin Karafiát, Lukas Burget, Jan Cernock`y, and Sanjeev Khudanpur. 2010. Recurrent neural network based language model. In Proc. In- terspeech. Tomáš Mikolov, Ilya Sutskever, Anoop Deoras, Hai- Son Le, Stefan Kombrink, and Jan Cernocky. Subword language modeling with neu- 2012. ral networks. (http://www. fit. vutbr. cz/imikolov/rnnlm/char. pdf) . preprint Stanislau Semeniuta, Aliaksei Severyn, and Erhardt Barth. 2016. Recurrent dropout without memory loss. In Proc. COLING. Alessandro Sordoni, Yoshua Bengio, Hossein Vahabi, Christina Lioma, Jakob Grue Simonsen, and Jian- Yun Nie. 2015. A hierarchical recurrent encoder- decoder for generative context-aware query sugges- tion. In Proc. CIKM. Ilya Sutskever, James Martens, and Geoffrey E Hin- ton. 2011. Generating text with recurrent neural net- works. In Proc. ICML. Yee Whye Teh. 2006. A hierarchical Bayesian lan- In guage model based on Pitman-Yor processes. Proc. ACL. Yuhuai Wu, Saizheng Zhang, Ying Zhang, Yoshua Ben- gio, and Ruslan R Salakhutdinov. 2016. On multi- plicative integration with recurrent neural networks. In Proc. NIPS. Barret Zoph and Quoc V Le. 2016. Neural architecture search with reinforcement learning. arXiv preprint arXiv:1611.01578 . FR DE ES CS FI RU Figure 4: Histogram of OOV word frequencies in MWC Corpus in different languages.
1803.07116
2
1803
2018-04-29T18:13:17
Learning to Generate Wikipedia Summaries for Underserved Languages from Wikidata
[ "cs.CL" ]
While Wikipedia exists in 287 languages, its content is unevenly distributed among them. In this work, we investigate the generation of open domain Wikipedia summaries in underserved languages using structured data from Wikidata. To this end, we propose a neural network architecture equipped with copy actions that learns to generate single-sentence and comprehensible textual summaries from Wikidata triples. We demonstrate the effectiveness of the proposed approach by evaluating it against a set of baselines on two languages of different natures: Arabic, a morphological rich language with a larger vocabulary than English, and Esperanto, a constructed language known for its easy acquisition.
cs.CL
cs
Learning to Generate Wikipedia Summaries for Underserved Languages from Wikidata Lucie-Aim´ee Kaffee1† Hady Elsahar2† Pavlos Vougiouklis1† Christophe Gravier2 Fr´ed´erique Laforest2 Jonathon Hare1 Elena Simperl1 1 School of Electronics and Computer Science, University of Southampton, UK {kaffee, pv1e13, jsh2, e.simperl}@ecs.soton.ac.uk 2 Laboratoire Hubert Curien, CNRS, UJM-Saint- ´Etienne, Universit´e de Lyon, France {hady.elsahar, christophe.gravier, frederique.laforest}@univ-st-etienne.fr 8 1 0 2 r p A 9 2 ] L C . s c [ 2 v 6 1 1 7 0 . 3 0 8 1 : v i X r a Abstract While Wikipedia exists in 287 languages, its content is unevenly distributed among them. In this work, we investigate the generation of open domain Wikipedia summaries in under- served languages using structured data from Wikidata. To this end, we propose a neural network architecture equipped with copy ac- tions that learns to generate single-sentence and comprehensible textual summaries from Wikidata triples. We demonstrate the effec- tiveness of the proposed approach by evalu- ating it against a set of baselines on two lan- guages of different natures: Arabic, a morpho- logical rich language with a larger vocabulary than English, and Esperanto, a constructed lan- guage known for its easy acquisition. Introduction 1 Despite the fact that Wikipedia exists in 287 languages, the existing content is unevenly dis- tributed. The content of the most under-resourced Wikipedias is maintained by a limited number of editors – they cannot curate the same volume of articles as the editors of large Wikipedia language- specific communities. It is therefore of the ut- most social and cultural interests to address lan- guages for which native speakers have only access to an impoverished Wikipedia. In this paper, we propose an automatic approach to generate textual summaries that can be used as a starting point for the editors of the involved Wikipedias. We pro- pose an end-to-end trainable model that generates a textual summary given a set of KB triples as in- put. We apply our model on two languages that have a severe lack of both editors and articles on Wikipedia: Esperanto is an easily acquired artifi- cially created language which makes it less data needy and a more suitable starting point for ex- ploring the challenges of this task. Arabic is a †The authors contributed equally to this work. morphologically rich language that is much more challenging to work, mainly due to its significantly larger vocabulary. As shown in Table 1 both Ara- bic and Esperanto suffer a severe lack of con- tent and active editors compared to the English Wikipedia which is currently the biggest one in terms of number of articles. Our research is mostly related to previous work on adapting the general encoder-decoder frame- work for the generation of Wikipedia summaries (Lebret et al., 2016; Chisholm et al., 2017; Vou- giouklis et al., 2017). Nonetheless, all these ap- proaches focus on task of biographies generation, and only in English – the language with the most language resources and knowledge bases avail- able. In contrast with these works, we explore the generation of sentences in an open-domain, multilingual context. The model from (Lebret et al., 2016) takes the Wikipedia infobox as an input, while (Chisholm et al., 2017) uses a se- quence of slot-value pairs extracted from Wiki- data. Both models are only able to generate single-subject relationships. In our model the in- put triples go beyond the single-subject relation- ships of a Wikipedia infobox or a Wikidata page about a specific item (Section 2). Similarly to our approach, the model proposed by (Vougiouk- lis et al., 2017) accepts a set of triples as input, however, it leverages instance-type-related infor- mation from DBpedia in order to generate text that addresses rare or unseen entities. Our solution is much broader since it does not rely on the assump- tion that unseen triples will adopt the same pat- tern of properties and entities' instance types pairs as the ones that have been used for training. To this end, we use copy actions over the labels of entities in the input triples. This relates to pre- vious works in machine translation which deals with rare or unseen word problem for translating names and numbers in text. (Luong et al., 2015) # of Articles # of Active Users Vocab. Size Arabic 541,166 7,818 2.2M Esperanto 241,901 2,849 1.5M English 5,483,928 129,237 2.0M Table 1: Recent page statistics and total number of unique words (vocab. size) of Esperanto, Arabic and English Wikipedias. propose a model that generates positional place- holders pointing to some words in source sen- tence and copy it to target sentence (copy actions). (Gulcehre et al., 2016) introduce separate trainable modules for copy actions to adapt to highly vari- able input sequences, for text summarisation. For text generation from tables, (Lebret et al., 2016) extend positional copy actions to copy values from fields in the given table. For Question Genera- tion, (Serban et al., 2016) use a placeholder for the subject entity in the question to generalise to unseen entities. We evaluate our approach by measuring how close our synthesised summaries can be to ac- tual summaries in Wikipedia against two other baselines of different natures: a language model, and an information retrieval template-based so- lution. Our model substantially outperforms all the baselines in all evaluation metrics in both Es- peranto and Arabic. In this work we present the following contributions: i) We investigate the task of generating textual summaries from Wiki- data triples in underserved Wikipedia languages across multiple domains, and ii) We use an end-to- end model with copy actions adapted to this task. Our datasets, results, and experiments are avail- able at: https://github.com/pvougiou/ Wikidata2Wikipedia. 2 Model Our approach is inspired by similar encoder- decoder architectures that have already been em- ployed on similar text generative tasks (Serban et al., 2016; Vougiouklis et al., 2017). 2.1 Encoding the Triples The encoder part of the model is a feed-forward architecture that encodes the set of input triples into a fixed dimensionality vector, which is sub- sequently used to initialise the decoder. Given a set of un-ordered triples FE = {f1, f2, . . . , fR : fj = (sj, pj, oj)}, where sj, pj and oj are the one- hot vector representations of the respective sub- ject, property and object of the j-th triple, we com- pute an embedding hfj for the j-th triple by for- ward propagating as follows: hfj = q(Wh[Winsj; Winpj; Winoj]) , hFE = WF[hf1; . . . ; hfR−1; hfR] , (1) (2) where hfj is the embedding vector of each triple fj, hFE is a fixed-length vector representation for all the input triples FE. q is a non-linear activa- tion function, [. . . ; . . .] represents vector concate- nation. Win,Wh,WF are trainable weight matri- ces. Unlike (Chisholm et al., 2017), our encoder is agnostic with respect to the order of input triples. As a result, the order of a particular triple fj in the triples set does not change its significance towards the computation of the vector representation of the whole triples set, hFE . 2.2 Decoding the Summary The decoder part of the architecture is a multi- layer RNN (Cho et al., 2014) with Gated Recur- rent Units which generates the textual summary one token at a time. The hidden unit of the GRU at the first layer is initialised with hFE . At each timestep t, the hidden state of the GRU is calcu- lated as follows: hl t = GRU(hl t−1, hl−1 t ) (3) The conditional probability distribution over each token yt of the summary at each timestep t is com- puted as the softmax(WouthL t ) over all the possi- ble entries in the summaries dictionary, where hL t is the hidden state of the last layer and Wout is a biased trainable weight matrix. A summary consists of words and mentions of en- tity in the text. We adapt the concept of surface form tuples (Vougiouklis et al., 2017) in order to be able to learn an arbitrary number of different lexicalisations of the same entity in the summary (e.g. "aktorino", "aktoro"). Figure 1 shows the ar- chitecture of our generative model when it is pro- vided with the three triples of the idealised exam- ple of Table 2. 2.3 Copy Actions Following (Luong et al., 2015; Lebret et al., 2016) we model all the copy actions on the data level through a set of special tokens added to the basic vocabulary. Rare entities identified in text and ex- isting in the input triples are being replaced by the token of the property of the relationship to which it Triples Textual Summary Vocab. Extended Q490900 (Floridia) Q490900 (Floridia) Q30025755 (Floridia) Floridia estas komunumo de Italio. [[Q490900, Floridia]] estas komunumo de [[P17]]. P31 (estas) P17 (stato) P1376 (cefurbo de) Q747074 (komunumo de Italio) Q38 (Italio) Q490900 (Floridia) Table 2: Training example: a set of triples about Floridia. Subsequently, our system summarises the input set in the form of text. The vocabulary extended summary is the one on which we train our model. ties in the text that participate in relations in the aligned triples set with the corresponding property placeholder of the upheld relations. We include all property placeholders that occur at least 20 times in each training dataset. Subsequently, the dictio- naries of the Esperanto and Arabic summaries are expanded by 80 and 113 property placeholders re- spectively. In case the rare entity is not matched to any subject or object of the set of corresponding triples it is replaced by the special <resource> token. Each summary is augmented with the respect start-of-summary <start> and end-of- summary <end> tokens. For the decoder, we use 1 layer of GRUs. We set the dimensionality of the decoder's hidden state to 500 in Esperanto and 700 in Arabic. We ini- tialise all parameters with random uniform distri- bution between −0.001 and 0.001, and we use Batch Normalisation before each non-linear ac- tivation function and after each fully-connected layer (Ioffe and Szegedy, 2015) on the encoder side (Vougiouklis et al., 2017). During training, the model tries to learn those parameters that min- imise the sum of the negative log-likelihoods of a set of predicted summaries. The networks are trained using mini-batch of size 85. The weights are updated using Adam (Kingma and Ba, 2014) (i.e. it was found to work better than Stochastic Gradient Descent, RMSProp and AdaGrad) with a learning rate of 10−5. An l2 regularisation term of 0.1 over each network's parameters is also in- cluded in the cost function. The networks converge after the 9th epoch in the Esperanto case and after the 11th in the Ara- bic case. During evaluation and testing, we do beam search with a beam size of 20, and we re- tain only the summary with the highest probabil- ity. We found that increasing the beam size re- sulted not only in minor improvements in terms of performance but also in a greater number of fully- completed generated summaries (i.e. summaries for which the special end-of-summary <end> to- Figure 1: Model Overview was matched. We refer to those tokens as property placeholders. In Table 2, [[P17]] in the vocab- ulary extended summary is an example of prop- erty placeholder – would it be generated by our model, it is replaced with the label of the object of the triple with which they share the same prop- erty (i.e. Q490900 (Floridia) P17 (stato) Q38 (Italio)). When all the tokens of the summary are sampled, each property placeholder that is gener- ated is mapped to the triple with which it shares the same property and is subsequently replaced with the textual label of the entity. We randomly choose an entity, in case there are more than one triple with the same property in the input triples set. Implementation and Training Details 2.4 We implemented our neural network models using the Torch1 package. We included the 15,000 and 25,000 most fre- quent tokens (i.e. either words or entities) of the summaries in Esperanto and Arabic respectively for target vocabulary of the textual summaries. Using a larger size of target dictionary in Arabic is due to its greater linguistic variability – Arabic vocabulary is 47% larger than Esperanto vocab- ulary (cf. Table 1). We replaced any rare enti- 1Torch is a scientific computing package for Lua. based on the LuaJIT package. It is Avg. # of Tokens per Summary Avg. # of Triples per Summary Avg. # of Linked Named Entities Avg. # of Aligned Triples Vocabulary Size Total # of Summaries Arabic 28.1 (±28.8) 8.1 (±11.2) 2.2 (±1.0) 0.1 (±0.4) Esperanto 26.4 (±22.7) 11.0 (±13.8) 2.4 (±1.1) 0.2 (±0.5) 344, 827 255, 741 226, 447 126, 714 Table 3: Dataset statistics in Arabic and Esperanto. ken is generated). 3 Dataset In order to train our models to generate summaries from Wikidata triples, we introduce a new dataset for text generation from KB triples in a multilin- gual setting and align it with the triples of its cor- responding Wikidata Item. For each Wikipedia ar- ticle, we extract and tokenise the first introductory sentence and align it with triples where its corre- sponding item appears as a subject or an object in the Wikidata truthy dump. In order to create the surface form tuples (i.e. Section 2.3), we iden- tify occurrences of entities in the text along with their verbalisations. We rely on keyword match- ing against labels from Wikidata expanded by the global language fallback chain introduced by Wikimedia2 to overcome the lack of non-English labels in Wikidata (Kaffee et al., 2017). For the property placeholders, we use the dis- tant supervision assumption for relation extrac- tion (Mintz et al., 2009). Entities that participate in relations with the main entity of the article are being replaced with their corresponding property placeholder tag. Table 3 shows statistics on the two corpora that we used for the training of our systems. 4 Baselines To demonstrate the effectiveness of our approach, we compare it to two competitive systems. KN is a 5-gram Kneser-Ney (KN) (Heafield et al., 2013) language model. KN has been used before as a baseline for text generation from structured data (Lebret et al., 2016) and provided compet- itive results on a single domain in English. We 2https://meta.wikimedia.org/wiki/ Wikidata/Notes/Language_fallback Figure 2: A box plot showing the distribution of BLEU 4 scores of all systems for each category of generated summaries. also introduce a second KN model (KNext), which is trained on summaries with the special tokens for copy actions. During test time, we use beam search of size 10 to sample from the learned lan- guage model. IR is an Information Retrieval (IR) baseline simi- lar to those that have been used in other text gen- erative tasks (Rush et al., 2015; Du et al., 2017). First, the baseline encodes the list of input triples using TF-IDF followed by LSA (Halko et al., 2011). For each item in the test set, we perform K-nearest neighbors to retrieve the vector from the training set that is the closest to this item and out- put its corresponding summary. Similar to KN baseline, we provide two versions of this baseline IR and IRext. 5 Results and Discussion We evaluate the generated summaries from our model and each of the baselines against their orig- inal counterparts from Wikipedia. Triples sets whose generated summaries are incomplete3 (i.e. summaries for which the special end-of-summary <end> token is generated) are excluded from the evaluation. We use a set of evaluation met- rics for text generation: BLEU (Papineni et al., 2002), METEOR (Denkowski and Lavie, 2014) and ROUGEL (Lin, 2004). As displayed in Ta- ble 4, our model shows a significant enhance- ment compared to our baselines across the ma- 3Around ≤ 1% and 2% of the input validation and test triples sets in Arabic and Esperanto respectively led to the generation of summaries without the <end> token. We be- lieve that this difference is explained by the limited size of the Esperanto dataset that increases the level of difficulty that the trained models (i.e. with or without Copy Actions) to generalise on unseen data. Ours + CopyOursIR_extKN_ext0102030405060708090ArabicOurs + CopyOursIR_extKN_extEsperanto Model KN KNext IR IRext Ours + Copy KN KNext IR IRext Ours + Copy BLEU 1 BLEU 2 BLEU 3 BLEU 4 Valid. 12.84 28.93 41.39 49.87 53.61 54.10 18.12 25.17 43.01 52.75 49.34 50.22 Test 12.85 28.84 41.73 48.96 54.26 54.40 17.8 24.93 42.61 51.66 49.40 49.81 Valid. 2.28 21.21 34.18 42.44 47.38 47.96 6.91 16.44 33.67 43.57 42.83 43.57 Test 2.4 21.16 34.58 41.5 48.05 48.27 6.64 16.3 33.46 42.53 42.95 43.19 Valid. 0.95 16.78 29.36 37.29 42.65 43.27 4.18 11.99 28.16 37.53 38.28 38.93 Test 1.04 16.76 29.72 36.41 43.32 43.60 4.0 11.92 28.07 36.54 38.45 38.62 Valid. 0.54 13.42 25.68 33.27 38.52 39.17 2.9 8.77 24.35 33.35 34.66 35.27 Test 0.61 13.42 25.98 32.51 39.20 39.51 2.79 8.79 24.3 32.41 34.85 34.95 ROUGEL Test 17.09 28.52 43.58 50.57 64.64 64.69 36.9 44.77 45.92 57.62 67.02 66.61 Valid 17.08 28.57 43.26 51.66 64.27 64.60 37.48 44.93 46.75 58.15 66.43 66.73 METEOR Test 29.02 30.43 33.33 34.25 45.99 46.17 30.74 33.71 20.46 31.04 41.13 40.74 Valid. 29.04 30.47 32.99 34.39 45.89 46.09 31.05 33.77 20.71 31.21 40.62 40.80 c i b a r A o t n a r e p s E Table 4: Automatic evaluation of our model against all other baselines using BLEU 1-4, ROUGE and METEOR for both Arabic and Esperanto Validation and Test set. jority of the evaluation metrics in both languages. We achieve at least an enhancement of at least 5.25 and 1.31 BLEU 4 score in Arabic and Es- peranto respectively over the IRext, the strongest baseline. The introduction of the copy actions to our encoder-decoder architecture enhances our performance further by 0.61 − 1.10 BLEU (using BLEU 4). In general, our copy actions mecha- nism benefits the performance of all the compet- itive systems. Generalisation Across Domains. To investi- gate how well different models can generalise across multiple domains, we categorise each gen- erated summary into one of 50 categories accord- ing to its main entity instance type (e.g. village, company, football player). We examine the dis- tribution of BLEU-4 scores per category to mea- sure how well the model generalises across do- mains (Figure 2). We show that i) the high perfor- mance of our system is not skewed towards some domains at the expense of others, and that ii) our model has a good generalisation across domains – better than any other baseline. Despite the fact that the Kneser-Ney template-based baseline (KNext) has exhibited competitive performance in a single- domain context (Lebret et al., 2016), it is failing to generalise in our multi-domain text generation scenario. 6 Conclusions leveraging data from a structured knowledge base and careful data preparation in a multilingual fash- ion, which are of the utmost practical interest for our under-resourced task, that would have other- wise required a substantial additional amount of data. Our model was able to perform and gen- eralise across domains better than a set of strong baselines. Acknowledgements This research is partially supported by the An- swering Questions using Web Data (WDAqua) project, a Marie Skłodowska-Curie Innovative Training Network under grant agreement No 642795, part of the Horizon 2020 programme. References Andrew Chisholm, Will Radford, and Ben Hachey. 2017. Learning to generate one-sentence biogra- In Proceedings of the 15th phies from Wikidata. Conference of the European Chapter of the Associa- tion for Computational Linguistics: Volume 1, Long Papers. Association for Computational Linguistics, Valencia, Spain, pages 633–642. Kyunghyun Cho, Bart van Merrienboer, C¸ aglar Gulc¸ehre, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. 2014. Learning phrase representa- tions using RNN encoder-decoder for statistical ma- chine translation. CoRR abs/1406.1078. In this paper, we show that with the adaptation of the encoder-decoder neural network architec- ture for the generation of summaries we are able to overcome the challenges introduced by working with underserved languages. This is achieved by Michael J. Denkowski and Alon Lavie. 2014. Me- teor universal: Language specific translation eval- In Proceedings of uation for any target language. the Ninth Workshop on Statistical Machine Trans- lation, WMT@ACL 2014, June 26-27, 2014, Balti- more, Maryland, USA. pages 376–380. Association for Computational Linguistics and the 7th International Joint Conference on Natural Lan- guage Processing of the Asian Federation of Natural Language Processing, ACL 2015, July 26-31, 2015, Beijing, China, Volume 1: Long Papers. pages 11– 19. Mike Mintz, Steven Bills, Rion Snow, and Daniel Ju- rafsky. 2009. Distant supervision for relation extrac- tion without labeled data. In ACL 2009, Proceedings of the 47th Annual Meeting of the Association for Computational Linguistics and the 4th International Joint Conference on Natural Language Processing of the AFNLP, 2-7 August 2009, Singapore. pages 1003–1011. Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002. BLEU: A method for auto- In Pro- matic evaluation of machine translation. ceedings of the 40th Annual Meeting on Associa- tion for Computational Linguistics. Association for Computational Linguistics, Stroudsburg, PA, USA, ACL '02, pages 311–318. https://doi.org/ 10.3115/1073083.1073135. Alexander M. Rush, Sumit Chopra, and Jason Weston. 2015. A neural attention model for abstractive sen- In Proceedings of the 2015 tence summarization. Conference on Empirical Methods in Natural Lan- guage Processing, EMNLP 2015, Lisbon, Portugal, September 17-21, 2015. pages 379–389. Iulian Vlad Serban, Alberto Garc´ıa-Dur´an, C¸ aglar Gulc¸ehre, Sungjin Ahn, Sarath Chandar, Aaron C. Courville, and Yoshua Bengio. 2016. Generating factoid questions with recurrent neural networks: In Pro- The 30m factoid question-answer corpus. ceedings of the 54th Annual Meeting of the Associ- ation for Computational Linguistics, ACL 2016, Au- gust 7-12, 2016, Berlin, Germany, Volume 1: Long Papers. Pavlos Vougiouklis, Hady ElSahar, Lucie-Aim´ee Kaffee, Christophe Gravier, Fr´ed´erique Laforest, Jonathon S. Hare, and Elena Simperl. 2017. Neu- ral wikipedian: Generating textual summaries from knowledge base triples. CoRR abs/1711.00155. Xinya Du, Junru Shao, and Claire Cardie. 2017. Learn- ing to ask: Neural question generation for reading comprehension. In Proceedings of the 55th Annual Meeting of the Association for Computational Lin- guistics, ACL 2017, Vancouver, Canada, July 30 - August 4, Volume 1: Long Papers. pages 1342–1352. Caglar Gulcehre, Marcin Moczulski, Misha Denil, and Yoshua Bengio. 2016. Noisy activation functions. In International Conference on Machine Learning. pages 3059–3068. Nathan Halko, Per-Gunnar Martinsson, and Joel A. Tropp. 2011. Finding structure with random- ness: Probabilistic algorithms for constructing ap- SIAM Review proximate matrix decompositions. 53(2):217–288. Kenneth Heafield, Ivan Pouzyrevsky, Jonathan H. Clark, and Philipp Koehn. 2013. Scalable modi- fied Kneser-Ney language model estimation. In Pro- ceedings of the 51st Annual Meeting of the Associ- ation for Computational Linguistics, ACL 2013, 4-9 August 2013, Sofia, Bulgaria, Volume 2: Short Pa- pers. pages 690–696. Sergey Ioffe and Christian Szegedy. 2015. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Francis Bach and David Blei, editors, Proceedings of the 32nd International Conference on Machine Learn- ing. PMLR, Lille, France, volume 37 of Proceedings of Machine Learning Research, pages 448–456. Lucie-Aim´ee Kaffee, Alessandro Piscopo, Pavlos Vou- giouklis, Elena Simperl, Leslie Carr, and Lydia Pintscher. 2017. A Glimpse into Babel: An Anal- ysis of Multilinguality in Wikidata. In Proceedings of the 13th International Symposium on Open Col- laboration. ACM, page 14. Diederik P. Kingma and Jimmy Ba. 2014. Adam: CoRR http://arxiv.org/abs/ A method for stochastic optimization. abs/1412.6980. 1412.6980. R´emi Lebret, David Grangier, and Michael Auli. 2016. Neural text generation from structured data with ap- In Proceed- plication to the biography domain. ings of the 2016 Conference on Empirical Meth- ods in Natural Language Processing, EMNLP 2016, Austin, Texas, USA, November 1-4, 2016. pages 1203–1213. Chin-Yew Lin. 2004. ROUGE: A package for auto- matic evaluation of summaries. In Stan Szpakowicz Marie-Francine Moens, editor, Text Summarization Branches Out: Proceedings of the ACL-04 Work- shop. Association for Computational Linguistics, Barcelona, Spain, pages 74–81. Thang Luong, Ilya Sutskever, Quoc V. Le, Oriol Vinyals, and Wojciech Zaremba. 2015. Addressing the rare word problem in neural machine translation. In Proceedings of the 53rd Annual Meeting of the
1708.05148
1
1708
2017-08-17T06:42:03
Natural Language Processing: State of The Art, Current Trends and Challenges
[ "cs.CL" ]
Natural language processing (NLP) has recently gained much attention for representing and analysing human language computationally. It has spread its applications in various fields such as machine translation, email spam detection, information extraction, summarization, medical, and question answering etc. The paper distinguishes four phases by discussing different levels of NLP and components of Natural Language Generation (NLG) followed by presenting the history and evolution of NLP, state of the art presenting the various applications of NLP and current trends and challenges.
cs.CL
cs
Natural Language Processing: State of The Art, Current Trends and Challenges Diksha Khurana1, Aditya Koli1, Kiran Khatter1,2 and Sukhdev Singh1,2 1Department of Computer Science and Engineering Manav Rachna International University, Faridabad-121004, India 2Accendere Knowledge Management Services Pvt. Ltd., India Abstract Natural language processing (NLP) has recently gained much attention for representing and analysing human language computationally. It has spread its applications in various fields such as machine translation, email spam detection, information extraction, summarization, medical, and question answering etc. The paper distinguishes four phases by discussing different levels of NLP and components of Natural Language Generation (NLG) followed by presenting the history and evolution of NLP, state of the art presenting the various applications of NLP and current trends and challenges. 1. Introduction Natural Language Processing (NLP) is a tract of Artificial Intelligence and Linguistics, devoted to make computers understand the statements or words written in human languages. Natural language processing came into existence to ease the user's work and to satisfy the wish to communicate with the computer in natural language. Since all the users may not be well-versed in machine specific language, NLP caters those users who do not have enough time to learn new languages or get perfection in it. A language can be defined as a set of rules or set of symbol. Symbol are combined and used for conveying information or broadcasting the information. Symbols are tyrannized by the Rules. Natural Language Processing basically can be classified into two parts i.e. Natural Language Understanding and Natural Language Generation which evolves the task to understand and generate the text (Figure 1). Figure 1. Broad Classification of NLP Linguistics is the science of language which includes Phonology that refers to sound, Morphology word formation, Syntax sentence structure, Semantics syntax and Pragmatics which refers to understanding. Noah Chomsky, one of the first linguists of twelfth century that started syntactic theories, marked a unique position in the field of theoretical linguistics because he revolutionised the area of syntax (Chomsky, 1965) [1]. Which can be broadly categorized into two levels Higher Level which include speech recognition and Lower Level which corresponds to natural language. Few of the researched tasks of NLP are Automatic Summarization, Co-Reference Resolution, Discourse Analysis, Machine Translation, Morphological Segmentation, Named Entity Recognition, Optical Character Recognition, Part Of Speech Tagging etc. Some of these tasks have direct real world applications such as Machine translation, Named entity recognition, Optical character recognition etc. Automatic summarization produces an understandable summary of a set of text and provides summaries or detailed information of text of a known type. Co-reference resolution it refers to a sentence or larger set of text that determines which word refer to the same object. Discourse analysis refers to the task of identifying the discourse structure of connected text. Machine translation which refers to automatic translation of text from one human language to another. Morphological segmentation which refers to separate word into individual morphemes and identify the class of the morphemes. Named entity recognition (NER) it describes a stream of text, determine which items in the text relates to proper names. Optical character recognition (OCR) it gives an image representing printed text, which help in determining the corresponding or related text. Part of speech tagging it describes a sentence, determines the part of speech for each word. Though NLP tasks are obviously very closely interweaved but they are used frequently, for convenience. Some of the task such as automatic summarisation, co-reference analysis etc. act as subtask that are used in solving larger tasks. is even used language understanding and language generation. It The goal of Natural Language Processing is to accommodate one or more specialities of an algorithm or system. The metric of NLP assess on an algorithmic system allows for the integration of in multilingual event detection Rospocher et al. [2] purposed a novel modular system for cross- lingual event extraction for English, Dutch and Italian texts by using different pipelines for different languages. The system incorporates a modular set of foremost multilingual Natural Language Processing (NLP) tools. The pipeline integrates modules for basic NLP processing as well as more advanced tasks such as cross-lingual named entity linking, semantic role labelling and time normalization. Thus, the cross-lingual framework allows for the interpretation of events, participants, locations and time, as well as the relations between them. Output of these individual pipelines is intended to be used as input for a system that obtains event centric knowledge graphs. All modules behave like UNIX pipes: they all take standard input, to do some annotation, and produce standard output which in turn is the input for the next module pipelines are built as a data centric architecture so that modules can be adapted and replaced. Furthermore, modular architecture allows for different configurations and for dynamic distribution. Most of the work in Natural Language Processing is conducted by computer scientists while various other professionals have also shown interest such as linguistics, psychologist and philosophers etc. One of the most ironical aspect of NLP is that it adds up to the knowledge of human language. The field of Natural Language Processing is related with different theories and techniques that deal with the problem of natural language of communicating with the computers. Ambiguity is one of the major problem of natural language which is usually faced in syntactic level which has subtask as lexical and morphology which are concerned with the study of words and word formation. Each of these levels can produce ambiguities that can be solved by the knowledge of the complete sentence. The ambiguity can be solved by various methods such as Minimising Ambiguity, Preserving Ambiguity, Interactive Disambiguity and Weighting Ambiguity [3]. Some of the methods proposed by researchers to remove ambiguity is preserving ambiguity, e.g. (Shemtov 1997; Emele & Dorna 1998; Knight & Langkilde 2000) [3][4][5] Their objectives are closely in line with the last of these: they cover a wide range of ambiguities and there is a statistical element implicit in their approach. 2. Levels of NLP The 'levels of language' are one of the most explanatory method for representing the Natural Language processing which helps to generate the NLP text by realising Content Planning, Sentence Planning and Surface Realization phases (Figure 2). Figure 2. Phases of NLP architecture Linguistic is the science which involves meaning of language, language context and various forms of the language. The various important terminologies of Natural Language Processing are: - 1. Phonology Phonology is the part of Linguistics which refers to the systematic arrangement of sound. The term phonology comes from Ancient Greek and the term phono- which means voice or sound, and the suffix –logy refers to word or speech. In 1993 Nikolai Trubetzkoy stated that Phonology is "the study of sound pertaining to the system of language". Whereas Lass in 1998 wrote that phonology refers broadly with the sounds of language, concerned with the to lathe sub discipline of linguistics, whereas it could be explained as, "phonology proper is concerned with the function, behaviour and organization of sounds as linguistic items. Phonology include semantic use of sound to encode meaning of any Human language. (Clark et al.,2007) [6]. 2. Morphology The different parts of the word represent the smallest units of meaning known as Morphemes. Morphology which comprise of Nature of words, are initiated by morphemes. An example of Morpheme could be, the word precancellation can be morphologically scrutinized into three separate morphemes: the prefix pre, the root cancella, and the suffix -tion. The interpretation of morpheme stays same across all the words, just to understand the meaning humans can break any unknown word into morphemes. For example, adding the suffix –ed to a verb, conveys that the action of the verb took place in the past. The words that cannot be divided and have meaning by themselves are called Lexical morpheme (e.g.: table, chair) The words (e.g. -ed, -ing, -est, -ly, -ful) that are combined with the lexical morpheme are known as Grammatical morphemes (eg. Worked, Consulting, Smallest, Likely, Use). Those grammatical morphemes that occurs in combination called bound morphemes( eg. -ed, -ing) Grammatical morphemes can be divided into bound morphemes and derivational morphemes. 3. Lexical In Lexical, humans, as well as NLP systems, interpret the meaning of individual words. Sundry types of processing bestow to word-level understanding – the first of these being a part-of-speech tag to each word. In this processing, words that can act as more than one part- of-speech are assigned the most probable part-of speech tag based on the context in which they occur. At the lexical level, Semantic representations can be replaced by the words that have one meaning. In NLP system, the nature of the representation varies according to the semantic theory deployed. 4. Syntactic This level emphasis to scrutinize the words in a sentence so as to uncover the grammatical structure of the sentence. Both grammar and parser are required in this level. The output of this level of processing is representation of the sentence that divulge the structural dependency relationships between the words. There are various grammars that can be impeded, and which in twirl, whack the option of a parser. Not all NLP applications require a full parse of sentences, therefore the abide challenges in parsing of prepositional phrase attachment and conjunction audit no longer impede that plea for which phrasal and clausal dependencies are adequate [7]. Syntax conveys meaning in most languages because order and dependency contribute to connotation. For example, the two sentences: 'The cat chased the mouse.' and 'The mouse chased the cat.' differ only in terms of syntax, yet convey quite different meanings. 5. Semantic In semantic most people think that meaning is determined, however, this is not it is all the levels that bestow to meaning. Semantic processing determines the possible meanings of a sentence by pivoting on the interactions among word-level meanings in the sentence. This level of processing can incorporate the semantic disambiguation of words with multiple senses; in a cognate way to how syntactic disambiguation of words that can errand as multiple parts-of-speech is adroit at the syntactic level. For example, amongst other meanings, 'file' as a noun can mean either a binder for gathering papers, or a tool to form one's fingernails, or a line of individuals in a queue (Elizabeth D. Liddy,2001) [7]. The semantic level scrutinizes words for their dictionary elucidation, but also for the elucidation they derive from the milieu of the sentence. Semantics milieu that most words have more than one elucidation but that we can spot the appropriate one by looking at the rest of the sentence. [8] 6. Discourse While syntax and semantics travail with sentence-length units, the discourse level of NLP travail with units of text longer than a sentence i.e, it does not interpret multi sentence texts as just sequence sentences, apiece of which can be elucidated singly. Rather, discourse focuses on the properties of the text as a whole that convey meaning by making connections between component sentences (Elizabeth D. Liddy,2001) [7]. The two of the most common levels are Anaphora Resolution - Anaphora resolution is the replacing of words such as pronouns, which are semantically stranded, with the pertinent entity to which they refer. Discourse/Text Structure Recognition - Discourse/text structure recognition sway the functions of sentences in the text, which, in turn, adds to the meaningful representation of the text. 7. Pragmatic: Pragmatic is concerned with the firm use of language in situations and utilizes nub over and above the nub of the text for understanding the goal and to explain how extra meaning is read into texts without literally being encoded in them. This requisite much world knowledge, including the understanding of intentions, plans, and goals. For example, the following two sentences need aspiration of the anaphoric term 'they', but this aspiration requires pragmatic or world knowledge (Elizabeth D. Liddy,2001) [7]. 3. Natural Language Generation Natural Language Generation (NLG) is the process of producing phrases, sentences and paragraphs that are meaningful from an internal representation. It is a part of Natural Language Processing and happens in four phases: identifying the goals, planning on how goals maybe achieved by evaluating the situation and available communicative sources and realizing the plans as a text [Figure 3]. It is opposite to Understanding. Figure 3. Components of NLG Components of NLG are as follows: Speaker and Generator – To generate a text we need to have a speaker or an application and a generator or a program that renders the application's intentions into fluent phrase relevant to the situation. Components and Levels of Representation -The process of language generation involves the following interweaved tasks. Content selection: Information should be selected and included in the set. Depending on how this information is parsed into representational units, parts of the units may have to be removed while some others may be added by default. Textual Organization: The information must be textually organized according the grammar, it must be ordered both sequentially and in terms of linguistic relations like modifications. Linguistic Resources: To support the information's realization, linguistic resources must be chosen. In the end these resources will come down to choices of particular words, idioms, syntactic constructs etc. Realization: The selected and organized resources must be realized as an actual text or voice output. Application or Speaker – This is only for maintaining the model of the situation. Here the speaker just initiates the process doesn't take part in the language generation. It stores the history, structures the content that is potentially relevant and deploys a representation of what it actually knows. All these form the situation, while selecting subset of propositions that speaker has. The only requirement is the speaker has to make sense of the situation. [9] 4. History of NLP In late 1940s the term wasn't even in existence, but the work regarding machine translation (MT) had started. Research in this period was not completely localised. Russian and English were the dominant languages for MT, but others, like Chinese were used for MT (Booth ,1967) [10]. MT/NLP research was almost died in 1966 according to ALPAC report, which concluded that MT is going nowhere. But later on some MT production systems were providing output to their customers (Hutchins, 1986) [11]. By this time, work on the use of computers for literary and linguistic studies had also started. As early as 1960 signature work influenced by AI began, with the BASEBALL Q-A systems (Green et al., 1961) [12]. LUNAR (Woods ,1978) [13] and Winograd SHRDLU were natural successors of these systems but they were seen as stepped up sophistication, in terms of their linguistic and their task processing capabilities. There was a widespread belief that progress could only be made on the two sides, one is ARPA Speech Understanding Research (SUR) project (Lea, 1980) and other in some major system developments projects building database front ends. The front-end projects (Hendrix et al., 1978) [14] were intended to go beyond LUNAR in interfacing the large databases. In early 1980s computational grammar theory became a very active area of research linked with logics for meaning and knowledge's ability to deal with the user's beliefs and intentions and with functions like emphasis and themes. By the end of the decade the powerful general purpose sentence processors like SRI's Core Language Engine (Alshawi,1992) [15] and Discourse Representation Theory (Kamp and Reyle,1993) [16] offered a means of tackling more extended discourse within the grammatico-logical framework. This period was one of the growing community. Practical resources, grammars, and tools and parsers became available (e.g the Alvey Natural Language Tools (Briscoe et al., 1987) [17]. The (D)ARPA speech recognition and message understanding (information extraction) conferences were not only for the tasks they addressed but for the emphasis on heavy evaluation, starting a trend that became a major feature in 1990s (Young and Chase, 1998; Sundheim and Chinchor ,1993) [18][19]. Work on user modelling (Kobsa and Wahlster , 1989) [20] was one strand in research paper and on discourse structure serving this (Cohen et al., 1990) [21]. At the same time, as McKeown (1985) [22] showed, rhetorical schemas could be used for producing both linguistically coherent and communicatively effective text. Some researches in NLP marked important topics for future like word sense disambiguation (Small et al., 1988) [23] and probabilistic networks, statistically coloured NLP, the work on the lexicon, also pointed in this direction. Statistical language processing was a major thing in 90s (Manning and Schuetze,1999) [24], because this not only involves data analysts. Information extraction and automatic summarising (Mani and Maybury ,1999) [25] was also a point of focus. Recent researches are mainly focused on unsupervised and semi-supervised learning algorithms. 5. Related Work Many researchers worked on NLP, building tools and systems which makes NLP what it is today. Tools like Sentiment Analyser, Parts of Speech (POS)Taggers, Chunking, Named Entity Recognitions (NER), Emotion detection, Semantic Role Labelling made NLP a good topic for research. Sentiment analyser (Jeonghee etal.,2003) [26] works by extracting sentiments about given topic. Sentiment analysis consists of a topic specific feature term extraction, sentiment extraction, and association by relationship analysis. Sentiment Analysis utilizes two linguistic resources for the analysis: the sentiment lexicon and the sentiment pattern database. It analyses the documents for positive and negative words and try to give ratings on scale -5 to +5. Parts of speech taggers for the languages like European languages, research is being done on making parts of speech taggers for other languages like Arabic, Sanskrit (Namrata Tapswi , Suresh Jain ., 2012) [27], Hindi (Pradipta Ranjan Ray et al., 2003 )[28] etc. It can efficiently tag and classify words as nouns, adjectives, verbs etc. The most procedures for part of speech can work efficiently on European languages, but it won't on Asian languages or middle eastern languages. Sanskrit part of speech tagger is specifically uses treebank technique. Arabic uses Support Vector Machine (SVM) (Mona Diab etal.,2004) [29] approach to automatically tokenize, parts of speech tag and annotate base phrases in Arabic text. Chunking – it is also known as Shadow Parsing, it works by labelling segments of sentences with syntactic correlated keywords like Noun Phrase and Verb Phrase (NP or VP). Every word has a unique tag often marked as Begin Chunk (B-NP) tag or Inside Chunk (I-NP) tag. Chunking is often evaluated using the CoNLL 2000 shared task. CoNLL 2000 provides test data for Chunking. Since then, a certain number of systems arised (Sha and Pereira, 2003; McDonald et al., 2005; Sun et al., 2008) [30] [31] [32], all reporting around 94.3% F1 score. These systems use features composed of words, POS tags, and tags. Usage of Named Entity Recognition in places such as Internet is a problem as people don't use traditional or standard English. This degrades the performance of standard natural language processing tools substantially. By annotating the phrases or tweets and building tools trained on unlabelled, in domain and out domain data (Alan Ritter., 2011) [33]. It improves the performance as compared to standard natural language processing tools. Emotion Detection (Shashank Sharma, 2016) [34] is similar to sentiment analysis, but it works on social media platforms on mixing of two languages (English + Any other Indian Language). It categorizes statements into six groups based on emotions. During this process, they were able to identify the language of ambiguous words which were common in Hindi and English and tag lexical category or parts of speech in mixed script by identifying the base language of the speaker. Sematic Role Labelling – SRL works by giving a semantic role to a sentence. For example in the PropBank (Palmer et al., 2005) [35] formalism, one assigns roles to words that are arguments of a verb in the sentence. The precise arguments depend on verb frame and if there exists multiple verbs in a sentence, it might have multiple tags. State-of-the-art SRL systems comprise of several stages: creating a parse tree, identifying which parse tree nodes represent the arguments of a given verb, and finally classifying these nodes to compute the corresponding SRL tags. Event discovery in social media feeds (Edward Benson et al.,2011) [36], using a graphical model to analyse any social media feeds to determine whether it contains name of a person or name of a venue, place, time etc. The model operates on noisy feeds of data to extract records of events by aggregating multiple information across multiple messages, despite the noise of irrelevant noisy messages and very irregular message language, this model was able to extract records with high accuracy. However, there is some scope for improvement using broader array of features on factors. 6. Applications of NLP Natural Language Processing can be applied into various areas like Machine Translation, Email Spam detection, Information Extraction, Summarization, Question Answering etc. 6.1 Machine Translation As most of the world is online, the task of making data accessible and available to all is a challenge. Major challenge in making data accessible is the language barrier. There are multitude of languages with different sentence structure and grammar. Machine Translation is generally translating phrases from one language to another with the help of a statistical engine like Google Translate. The challenge with machine translation technologies is not directly translating words but keeping the meaning of sentences intact along with grammar and tenses. The statistical machine learning gathers as many data as they can find that seems to be parallel between two languages and they crunch their data to find the likelihood that something in Language A corresponds to something in Language B. As for Google, in September 2016, announced a new machine translation system based on Artificial neural networks and Deep learning . In recent years, various methods have been proposed to automatically evaluate machine translation quality by comparing hypothesis translations with reference translations. Examples of such methods are word error rate, position-independent word error rate (Tillmann et al., 1997) [37], generation string accuracy (Bangalore et al., 2000) [38], multi-reference word error rate (Niessen et al., 2000) [39], BLEU score (Papineni et al., 2002) [40], NIST score (Doddington, 2002) [41] All these criteria try to approximate human assessment and often achieve an astonishing degree of correlation to human subjective evaluation of fluency and adequacy (Papineni et al., 2001; Doddington, 2002) [42][43]. 6.2 Text Categorization Categorization systems inputs a large flow of data like official documents, military casualty reports, market data, newswires etc. and assign them to predefined categories or indices. For example, The Carnegie Group's Construe system (Hayes PJ ,Westein ; 1991)[44] , inputs Reuters articles and saves much time by doing the work that is to be done by staff or human indexers. Some companies have been using categorization systems to categorize trouble tickets or complaint requests and routing to the appropriate desks. Another application of text categorization is email spam filters. Spam filters is becoming important as the first line of defence against the unwanted emails. A false negative and false positive issues of spam filters are at the heart of NLP technology, its brought down to the challenge of extracting meaning from strings of text. A filtering solution that is applied to an email system uses a set of protocols to determine which of the incoming messages are spam and which are not. There are several types of spam filters available. Content filters: Review the content within the message to determine whether it is a spam or not. Header filters: Review the email header looking for fake information. General Blacklist filters: Stopes all emails from blacklisted recipients. Rules Based Filters: It uses user-defined criteria. Such as stopping mails from specific person or stopping mail including a specific word. Permission Filters: Require anyone sending a message to be pre-approved by the recipient. Challenge Response Filters: Requires anyone sending a message to enter a code in order to gain permission to send email. 6.3 Spam Filtering It works using text categorization and in recent times, various machine learning techniques have been applied to text categorization or Anti-Spam Filtering like Rule Learning (Cohen 1996)[45], Naïve Bayes (Sahami et al., 1998 ;Androutsopoulos et al.,2000b ;Rennie .,2000)[46][47][48],Memory based Learning (Androutsopoulos et al.,2000b)[47], Support vector machines (Druker et al., 1999)[49], Decision Trees (Carreras and Marquez , 2001)[50] Maximum Entropy Model (Berger et al. 1996)[51]. Sometimes combining different learners (Sakkis et al., 2001) [52]. Using these approaches is better as classifier is learned from training data rather than making by hand. The naïve bayes is preferred because of its performance despite its simplicity (Lewis, 1998) [53] In Text Categorization two types of models have been used (McCallum and Nigam, 1998) [54]. Both modules assume that a fixed vocabulary is present. But in first model a document is generated by first choosing a subset of vocabulary and then using the selected words any number of times, at least once irrespective of order. This is called Multi-variate Bernoulli model. It takes the information of which words are used in a document irrespective of number of words and order. In second model, a document is generated by choosing a set of word occurrences and arranging them in any order. this model is called multi-nomial model, in addition to the Multi-variate Bernoulli model, it also captures information on how many times a word is used in a document. Most text categorization approaches to anti spam Email filtering have used multi variate Bernoulli model (Androutsopoulos et al.,2000b) [47] 6.4 Information Extraction Information extraction is concerned with identifying phrases of interest of textual data. For many applications, extracting entities such as names, places, events, dates, times and prices is a powerful way of summarize the information relevant to a user's needs. In the case of a domain specific search engine, the automatic identification of important information can increase accuracy and efficiency of a directed search. There is use of hidden Markov models (HMMs) to extract the relevant fields of research papers. These extracted text segments are used to allow searched over specific fields and to provide effective presentation of search results and to match references to papers. For example, noticing the pop up ads on any websites showing the recent items you might have looked on an online store with discounts. In Information Retrieval two types of models have been used (McCallum and Nigam, 1998) [55]. Both modules assume that a fixed vocabulary is present. But in first model a document is generated by first choosing a subset of vocabulary and then using the selected words any number of times, at least once without any order. This is called Multi-variate Bernoulli model. It takes the information of which words are used in a document irrespective of number of words and order. In second model, a document is generated by choosing a set of word occurrences and arranging them in any order. this model is called multi-nomial model, in addition to the Multi-variate Bernoulli model , it also captures information on how many times a word is used in a document Discovery of knowledge is becoming important areas of research over the recent years. Knowledge discovery research use a variety of techniques in order to extract useful information from source documents like Parts of Speech (POS) tagging, Chunking or Shadow Parsing, Stop-words (Keywords that are used and must be removed before processing documents), Stemming (Mapping words to some base for, it has two methods, dictionary based stemming and Porter style stemming (Porter, 1980) [55]. Former one has higher accuracy but higher cost of implementation while latter has lower implementation cost and is usually insufficient for IR). Compound or Statistical Phrases (Compounds and statistical phrases index multi token units instead of single tokens.) Word Sense Disambiguation (Word sense disambiguation is the task of understanding the correct sense of a word in context. When used for information retrieval, terms are replaced by their senses in the document vector.) Its extracted information can be applied on a variety of purpose, for example to prepare a summary, to build databases, identify keywords, classifying text items according to some pre- defined categories etc. For example CONSTRUE, it was developed for Reuters, that is used in classifying news stories (Hayes, 1992) [57]. It has been suggested that many IE systems can successfully extract terms from documents, acquiring relations between the terms is still a difficulty. PROMETHEE is a system that extracts lexico-syntactic patterns relative to a specific conceptual relation (Morin,1999) [58]. IE systems should work at many levels, from word recognition to discourse analysis at the level of the complete document. An application of the Blank Slate Language Processor (BSLP) (Bondale et al., 1999) [59] approach for the analysis of a real life natural language corpus that consists of responses to open-ended questionnaires in the field of advertising. There's a system called MITA (Metlife's Intelligent Text Analyzer) (Glasgow et al. (1998) [60]) that extracts information from life insurance applications. Ahonen et al. (1998) [61] suggested a mainstream framework for text mining that uses pragmatic and discourse level analyses of text. 6.5 Summarization Overload of information is the real thing in this digital age, and already our reach and access to knowledge and information exceeds our capacity to understand it. This trend is not slowing down, so an ability to summarize the data while keeping the meaning intact is highly required. This is important not just allowing us the ability to recognize the understand the important information for a large set of data, it is used to understand the deeper emotional meanings; For example, a company determine the general sentiment on social media and use it on their latest product offering. This application is useful as a valuable marketing asset. The types of text summarization depends on the basis of the number of documents and the two important categories are single document summarization and multi document summarization (Zajic et al. 2008 [62]; Fattah and Ren 2009 [63]). Summaries can also be of two types: generic or query-focused (Gong and Liu 2001 [64]; Dunlavy et al. 2007 [65]; Wan 2008 [66]; Ouyang et al. 2011 [67]). Summarization task can be either supervised or unsupervised (Mani and Maybury 1999 [68]; Fattah and Ren 2009 [63]; Riedhammer et al. 2010 [69]). Training data is required in a supervised system for selecting relevant material from the documents. Large amount of annotated data is needed for learning techniques. Few techniques are as follows– - Bayesian Sentence based Topic Model (BSTM) uses both term-sentences and term document associations for summarizing multiple documents. (Wang et al. 2009 [70]) - Factorization with Given Bases (FGB) is a language model where sentence bases are the given bases and it utilizes document-term and sentence term matrices. This approach groups and summarizes the documents simultaneously. (Wang et al. 2011) [71]) - Topic Aspect-Oriented Summarization (TAOS) is based on topic factors. These topic factors are various features that describe topics such as capital words are used to represent entity. Various topics can have various aspects and various preferences of features are used to represent various aspects. (Fang et al. 2015 [72]) 6.6 Dialogue System Perhaps the most desirable application of the future, in the systems envisioned by large providers of end user applications, Dialogue systems, which focuses on a narrowly defined applications (like refrigerator or home theater systems) currently uses the phonetic and lexical levels of language. It is believed that these dialogue systems when utilizing all levels of language processing offer potential for fully automated dialog systems. (Elizabeth D. Liddy, 2001) [7]. Whether on text or via voice. This could lead to produce systems that can enable robots to interact with humans in natural languages. Examples like Google's assistant, Windows Cortana, Apple's Siri and Amazon's Alexa are the software and devices that follow Dialogue systems. 6.7 Medicine NLP is applied in medicine field as well. The Linguistic String Project-Medical Language Processor is one the large scale projects of NLP in the field of medicine [74][75][76][77][78]. The LSP-MLP helps enabling physicians to extract and summarize information of any signs or symptoms, drug dosage and response data with aim of identifying possible side effects of any medicine while highlighting or flagging data items [74]. The National Library of Medicine is developing The Specialist System [79][80][81][82][83]. It is expected to function as Information Extraction tool for Biomedical Knowledge Bases, particularly Medline abstracts. The lexicon was created using MeSH (Medical Subject Headings), Dorland's Illustrated Medical Dictionary and general English Dictionaries. The Centre d'Informatique Hospitaliere of the Hopital Cantonal de Geneve is working on an electronic archiving environment with NLP features [84][85]. In first phase, patient records were archived . At later stage the LSP-MLP has been adapted for French [86][87][88][89] , and finally , a proper NLP system called RECIT [90][91][92][93] has been developed using a method called Proximity Processing [94]. It's task was to implement a robust and multilingual system able to analyze/comprehend medical sentences, and to preserve a knowledge of free text into a language independent knowledge representation [95][96]. The Columbia university of New York has developed an NLP system called MEDLEE (MEDical Language Extraction and Encoding System) that identifies clinical information in narrative reports and transforms the textual information into structured representation [97]. 7. Approaches Rationalist approach or symbolic approach assume that crucial part of the knowledge in the human mind is not derived by the sense but is firm in advance, probably by genetic in heritance. Noam Chomsky was the strongest advocate of this approach. It was trusted that machine can be made to function like human brain by giving some fundamental knowledge and reasoning mechanism linguistics knowledge is directly encoded in rule or other forms of representation. This helps automatic process of natural languages. [98] Statistical and machine learning entail evolution of algorithms that allow a program to infer patterns. An iterative process is used to characterize a given algorithm's underlying algorithm that are optimised by a numerical measure that characterize numerical parameters and learning phase. Machine-learning models can be predominantly categorized as either generative or discriminative. Generative methods can generate synthetic data because of which they create rich models of probability distributions. Discriminative methods are more functional and have right estimating posterior probabilities and are based on observations. Srihari [99] explains the different generative models as one with a resemblance that is used to spot an unknown speaker's language and would bid the deep knowledge of numerous language to perform the match. Whereas discriminative methods rely on a less knowledge- intensive approach and using distinction between language. Whereas generative models, can become troublesome when many features are used and discriminative models allow use of more features. [100] Few of the examples of discriminative methods are Logistic regression and conditional random fields (CRFs), generative methods are Naive Bayes classifiers and hidden Markov models (HMMs). 7.1 Hidden Markov Model (HMM) An HMM is a system where a shifting takes place between several states, generating feasible output symbols with each switch. The sets of viable states and unique symbols may be large, but finite and known. We can descry the outputs, but the system's internals are hidden. Few of the problem could be solved are by Inference A certain sequence of output symbols, compute the probabilities of one or more candidate states with sequences. Pattern matching the state-switch sequence is realised are most likely to have generated a particular output- symbol sequence. Training the output-symbol chain data, reckon the state-switch/output probabilities that fit this data best. Hidden Markov Models are extensively used for speech recognition, where the output sequence is matched to the sequence of individual phonemes. Frederick Jelinek, a statistical- NLP advocate who first instigated HMMs at IBM's Speech Recognition Group, reportedly joked, every time a linguist leaves my group, the speech recognizer's performance improves. [101] HMM is not restricted to this application it has several others such as bioinformatics problems, for example, multiple sequence alignment [102]. Sonnhammer mentioned that Pfam hold multiple alignments and hidden Markov model based profiles (HMM-profiles) of entire protein domains. The cue of domain boundaries, family members and alignment is done semi-automatically found on expert knowledge, sequence similarity, other protein family databases and the capability of HMM-profiles to correctly identify and align the members. [103] 7.2 Naive Bayes Classifiers The choice of area is wide ranging covering usual items like word segmentation and translation but also unusual areas like segmentation for infant learning and identifying documents for opinions and facts. In addition, exclusive article was selected for its use of Bayesian methods to aid the research in designing algorithms for their investigation. 8. NLP in Talk This section discusses the recent developments in the NLP projects implemented by various companies and these are as follows: 8.1 ACE Powered GDPR Robot Launched by RAVN Systems [104] RAVN Systems, an leading expert in Artificial Intelligence (AI), Search and Knowledge Management Solutions, announced the launch of a RAVN ("Applied Cognitive Engine") i.e powered software Robot to help and facilitate the GDPR ("General Data Protection Regulation") compliance. The Robot uses AI techniques to automatically analyse documents and other types of data in any business system which is subject to GDPR rules. It allows users to quickly and easily search, retrieve, flag, classify and report on data mediated to be supersensitive under GDPR. Users also have the ability to identify personal data from documents, view feeds on the latest personal data that requires attention and provide reports on the data suggested to be deleted or secured. RAVN's GDPR Robot is also able to hasten requests for information (Data Subject Access Requests - "DSAR") in a simple and efficient way, removing the need for a physical approach to these requests which tends to be very labour thorough. Peter Wallqvist, CSO at RAVN Systems commented, "GDPR compliance is of universal paramountcy as it will exploit to any organisation that control and process data concerning EU citizens. LINK:http://markets.financialcontent.com/stocks/news/read/33888795/RAVN_Systems_Launch_the_ACE_Po wered_GDPR_Robot 8.2 Eno A Natural Language Chatbot Launched by Capital One [105] Capital one announces chatbot for customers called Eno. Eno is a natural language chatbot that people socialize through texting. Capital one claims that Eno is First natural language SMS chatbot from a U.S. bank that allows customer to ask questions using natural language. Customers can interact with Eno asking questions about their savings and others using a text interface. Eno makes such an environment that it feels that a human is interacting. Ken Dodelin, Capital One's vice president of digital product development, said "We kind of launched a chatbot and didn't know it." This provides a different platform than other brands that launch chatbots like Facebook Messenger and Skype. They believed that Facebook has too much access of private information of a person, which could get them into trouble with privacy laws of U.S. financial institutions work under. Like any Facebook Page admin can access full transcripts of the bot's conversations. If that would be the case then the admins could easily view the personal banking information of customers with is not correct LINK: https://www.macobserver.com/analysis/capital-one-natural-language-chatbot-eno/ 8.3 Future of BI in Natural Language Processing [106] Several companies in Bi spaces are trying to get with the trend and trying hard to ensure that data becomes more friendly and easily accessible. But still there is long way for this.BI will also make it easier to access as GUI is not needed. Because now a days the queries are made by text or voice command on smartphones.one of the most common example is Google might tell you today what will be the tomorrows weather. But soon enough, we will be able to ask our personal data chatbot about customer sentiment today, and how do we feel about their brand next week; all while walking down the street. Today, NLP tends to be based on turning natural language into machine language. But with time the technology matures – especially the AI component –the computer will get better at "understanding" the query and start to deliver answers rather than search results. Initially, the data chatbot will probably ask the question as how have revenues changed over the last three-quarters?' and then return pages of data for you to analyse. But once it learns the semantic relations and inferences of the question, it will be able to automatically perform the filtering and formulation necessary to provide an intelligible answer, rather than simply showing you data. Link: http://www.smartdatacollective.com/eran-levy/489410/here-s-why-natural-language-processing-future-bi 8.4 Using Natural Language Processing and Network Analysis to for Medication Therapy Develop a Conceptual Framework Management Research [107] Natural Language Processing and Network Analysis to Develop a Conceptual Framework for Medication Therapy Management Research describes a theory derivation process that is used to develop conceptual framework for medication therapy management (MTM) research. The MTM service model and chronic care model are selected as parent theories. Review article abstracts target medication therapy management in chronic disease care that were retrieved from Ovid Medline (2000-2016). Unique concepts in each abstract are extracted using Meta Map and their pairwise cooccurrence are determined. Then the information is used to construct a network graph of concept co-occurrence that is further analysed to identify content for the new conceptual model. 142 abstracts are analysed. Medication adherence is the most studied drug therapy problem and co-occurred with concepts related to patient-centred interventions targeting self- management. The enhanced model consists of 65 concepts clustered into 14 constructs. The framework requires additional refinement and evaluation to determine its relevance and applicability across a broad audience including underserved settings. Link: https://www.ncbi.nlm.nih.gov/pubmed/28269895?dopt=Abstract 8.5 Meet the Pilot, world's first language translating earbuds [108] The world's first smart earpiece Pilot will soon be transcribed over 15 languages. According to Spring wise, Waverly Labs' Pilot can already transliterate five spoken languages, English, French, Italian, Portuguese and Spanish, and seven written affixed languages, German, Hindi, Russian, Japanese, Arabic, Korean and Mandarin Chinese. The Pilot earpiece is connected via Bluetooth to the Pilot speech translation app, which uses speech recognition, machine translation and machine learning and speech synthesis technology. Simultaneously, the user will hear the translated version of the speech on the second earpiece. Moreover, it is not necessary that conversation would be taking place between two people only the users can join in and discuss as a group. As if now the user may experience a few second lag interpolated the speech and translation, which Waverly Labs pursue to reduce. The Pilot earpiece will be available from September, but can be pre-ordered now for $249. The earpieces can also be used for streaming music, answering voice calls and getting audio notifications. Link:https://www.indiegogo.com/projects/meet-the-pilot-smart-earpiece-language-translator- headphones-travel#/ REFRENCES [1] Chomsky, Noam, 1965, Aspects of the Theory of Syntax, Cambridge, Massachusetts: MIT Press. [2] Rospocher, M., van Erp, M., Vossen, P., Fokkens, A., Aldabe,I., Rigau, G., Soroa, A., Ploeger, T., and Bogaard, T.(2016). Building event-centric knowledge graphs from news. Web Semantics: Science, Services and Agents on the World Wide Web, In Press. [3] Shemtov, H. (1997). Ambiguity management in natural language generation. Stanford University. [4] Emele, M. C., & Dorna, M. (1998, August). Ambiguity preserving machine translation using packed representations. In Proceedings of the 36th Annual Meeting of the Association for Computational Linguistics and 17th International Conference on Computational Linguistics-Volume 1 (pp. 365-371). Association for Computational Linguistics. [5] Knight, K., & Langkilde, I. (2000, July). Preserving ambiguities in generation via automata intersection. In AAAI/IAAI (pp. 697-702). [6] Nation, K., Snowling, M. J., & Clarke, P. (2007). Dissecting the relationship between language skills and learning to read: Semantic and phonological contributions to new vocabulary learning in children with poor reading comprehension. Advances in Speech Language Pathology, 9(2), 131-139. [7] Liddy, E. D. (2001). Natural language processing. [8] Feldman, S. (1999). NLP Meets the Jabberwocky: Natural Language Processing in Information Retrieval. ONLINE-WESTON THEN WILTON-, 23, 62-73. [9] "Natural Language Processing." Natural Language Processing RSS. N.p., n.d. Web. 25 Mar. 2017 [10] Hutchins, W. J. (1986). Machine translation: past, present, future (p. 66). Chichester: Ellis Horwood. [11] Hutchins, W. J. (Ed.). (2000). Early years in machine translation: memoirs and biographies of pioneers (Vol. 97). John Benjamins Publishing. [12] Green Jr, B. F., Wolf, A. K., Chomsky, C., & Laughery, K. (1961, May). Baseball: an automatic question-answerer. In Papers presented at the May 9-11, 1961, western joint IRE- AIEE-ACM computer conference (pp. 219-224). ACM. [13] Woods, W. A. (1978). Semantics and quantification in natural language question answering. Advances in computers, 17, 1-87. [14] Hendrix, G. G., Sacerdoti, E. D., Sagalowicz, D., & Slocum, J. (1978). Developing a natural language interface to complex data. ACM Transactions on Database Systems (TODS), 3(2), 105-147. [15] Alshawi, H. (1992). The core language engine. MIT press. [16] Kamp, H., & Reyle, U. (1993). Tense and Aspect. In From Discourse to Logic (pp. 483- 689). Springer Netherlands. [17] Lea , W.A Trends in speech recognition , Englewoods Cliffs , NJ: Prentice Hall , 1980. [18] Young, S. J., & Chase, L. L. (1998). Speech recognition evaluation: a review of the US CSR and LVCSR programmes. Computer Speech & Language, 12(4), 263-279. [19] Sundheim, B. M., & Chinchor, N. A. (1993, March). Survey of the message understanding conferences. In Proceedings of the workshop on Human Language Technology (pp. 56-60). Association for Computational Linguistics. [20] Wahlster, W., & Kobsa, A. (1989). User models in dialog systems. In User models in dialog systems (pp. 4-34). Springer Berlin Heidelberg. [21] McKeown, K.R. Text generation , Cambridge: Cambridge University Press , 1985. [22] Small S.L., Cortell G.W., and Tanenhaus , M.K. Lexical Ambiguity Resolutions , San Mateo , CA : Morgan Kauffman, 1988. [23] Manning, C. D., & Schütze, H. (1999). Foundations of statistical natural language processing (Vol. 999). Cambridge: MIT press. [24] Mani, summarization (Vol. 293). Cambridge, MA: MIT press. I., & Maybury, M. T. (Eds.). (1999). Advances in automatic text [25] Yi, J., Nasukawa, T., Bunescu, R., & Niblack, W. (2003, November). Sentiment analyzer: Extracting sentiments about a given topic using natural language processing techniques. In Data Mining, 2003. ICDM 2003. Third IEEE International Conference on (pp. 427-434). IEEE. [26] Yi, J., Nasukawa, T., Bunescu, R., & Niblack, W. (2003, November). Sentiment analyzer: Extracting sentiments about a given topic using natural language processing techniques. In Data Mining, 2003. ICDM 2003. Third IEEE International Conference on (pp. 427-434). IEEE. [27] Tapaswi, N., & Jain, S. (2012, September). Treebank based deep grammar acquisition and Part-Of-Speech Tagging for Sanskrit sentences. In Software Engineering (CONSEG), 2012 CSI Sixth International Conference on (pp. 1-4). IEEE. [28] Ranjan, P., & Basu, H. V. S. S. A. (2003). Part of speech tagging and local word grouping techniques for natural language parsing in Hindi. In Proceedings of the 1st International Conference on Natural Language Processing (ICON 2003). [29] Diab, M., Hacioglu, K., & Jurafsky, D. (2004, May). Automatic tagging of Arabic text: From raw text to base phrase chunks. In Proceedings of HLT-NAACL 2004: Short papers (pp. 149-152). Association for Computational Linguistics. [30] Sha, F., & Pereira, F. (2003, May). Shallow parsing with conditional random fields. In Proceedings of the 2003 Conference of the North American Chapter of the Association for Computational Linguistics on Human Language Technology-Volume 1 (pp. 134-141). Association for Computational Linguistics. [31] McDonald, R., Crammer, K., & Pereira, F. (2005, October). Flexible text segmentation with structured multilabel classification. In Proceedings of the conference on Human Language Technology and Empirical Methods in Natural Language Processing (pp. 987- 994). Association for Computational Linguistics. [32] Sun, X., Morency, L. P., Okanohara, D., & Tsujii, J. I. (2008, August). Modeling latent- dynamic in shallow parsing: a latent conditional model with improved inference. In Proceedings of the 22nd International Conference on Computational Linguistics-Volume 1 (pp. 841-848). Association for Computational Linguistics. [33] Ritter, A., Clark, S., & Etzioni, O. (2011, July). Named entity recognition in tweets: an experimental study. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (pp. 1524-1534). Association for Computational Linguistics. [34] Sharma, S., Srinivas, PYKL, & Balabantaray, RC (2016). Emotion Detection using Online Machine Learning Method and TLBO on Mixed Script. In Proceedings of Language Resources and Evaluation Conference 2016 (pp. 47-51). [35] Palmer, M., Gildea, D., & Kingsbury, P. (2005). The proposition bank: An annotated corpus of semantic roles. Computational linguistics, 31(1), 71-106. [36] Benson, E., Haghighi, A., & Barzilay, R. (2011, June). Event discovery in social media feeds. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies-Volume 1 (pp. 389-398). Association for Computational Linguistics. [37] Tillmann, C., Vogel, S., Ney, H., Zubiaga, A., & Sawaf, H. (1997, September). Accelerated DP based search for statistical translation. In Eurospeech. [38] Bangalore, S., Rambow, O., & Whittaker, S. (2000, June). Evaluation metrics for generation. In Proceedings of the first international conference on Natural language generation-Volume 14 (pp. 1-8). Association for Computational Linguistics [39] Niessen, S., Och, F. J., Leusch, G., & Ney, H. (2000, May). An Evaluation Tool for Machine Translation: Fast Evaluation for MT Research. In LREC [40] Papineni, K., Roukos, S., Ward, T., & Zhu, W. J. (2002, July). BLEU: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting on association for computational linguistics (pp. 311-318). Association for Computational Linguistics [41] Doddington, G. (2002, March). Automatic evaluation of machine translation quality using n-gram co-occurrence statistics. In Proceedings of the second international conference on Human Language Technology Research (pp. 138-145). Morgan Kaufmann Publishers Inc [42] Papineni, K., Roukos, S., Ward, T., & Zhu, W. J. (2002, July). BLEU: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting on association for computational linguistics (pp. 311-318). Association for Computational Linguistics [43] Doddington, G. (2002, March). Automatic evaluation of machine translation quality using n-gram co-occurrence statistics. In Proceedings of the second international conference on Human Language Technology Research (pp. 138-145). Morgan Kaufmann Publishers Inc [44] Hayes, P. J. (1992). Intelligent high-volume text processing using shallow, domain- specific techniques. Text-based intelligent systems: Current research and practice in information extraction and retrieval, 227-242. [45] Cohen, W. W. (1996, March). Learning rules that classify e-mail. In AAAI spring symposium on machine learning in information access (Vol. 18, p. 25). [46] Sahami, M., Dumais, S., Heckerman, D., & Horvitz, E. (1998, July). A Bayesian approach to filtering junk e-mail. In Learning for Text Categorization: Papers from the 1998 workshop (Vol. 62, pp. 98-105). [47] Androutsopoulos, I., Paliouras, G., Karkaletsis, V., Sakkis, G., Spyropoulos, C. D., & Stamatopoulos, P. (2000). Learning to filter spam e-mail: A comparison of a naive bayesian and a memory-based approach. arXiv preprint cs/0009009. [48] Rennie, J. (2000, August). ifile: An application of machine learning to e-mail filtering. In Proc. KDD 2000 Workshop on Text Mining, Boston, MA [49] Drucker, H., Wu, D., & Vapnik, V. N. (1999). Support vector machines for spam categorization. IEEE Transactions on Neural networks, 10(5), 1048-1054 [50] Carreras, X., & Marquez, L. (2001). Boosting trees for anti-spam email filtering. arXiv preprint cs/0109015 [51] BERGER, A. L., DELLA PIETRA, S. A., AND DELLA PIETRA, V. J. 1996. A maximum entropy approach to natural language processing. Computational Linguistics 22, 1, 39–71 [52] Sakkis, G., Androutsopoulos, I., Paliouras, G., Karkaletsis, V., Spyropoulos, C. D., & Stamatopoulos, P. (2001). Stacking classifiers for anti-spam filtering of e-mail. arXiv preprint cs/0106040.. [53] Lewis, D. D. (1998, April). Naive (Bayes) at forty: The independence assumption in information retrieval. In European conference on machine learning (pp. 4-15). Springer Berlin Heidelberg [54] McCallum, A., & Nigam, K. (1998, July). A comparison of event models for naive bayes text classification. In AAAI-98 workshop on learning for text categorization (Vol. 752, pp. 41-48). [55] McCallum, A., & Nigam, K. (1998, July). A comparison of event models for naive bayes text classification. In AAAI-98 workshop on learning for text categorization (Vol. 752, pp. 41-48). [56] Porter, M. F. (1980). An algorithm for suffix stripping. Program, 14(3), 130-137 [57] Hayes, P. J. (1992). Intelligent high-volume text processing using shallow, domain- specific techniques. Text-based intelligent systems: Current research and practice in information extraction and retrieval, 227-242 [58] Morin, E. (1999, August). Automatic acquisition of semantic relations between terms from technical corpora. In Proc. of the Fifth International Congress on Terminology and Knowledge Engineering-TKE'99. [59] Bondale, N., Maloor, P., Vaidyanathan, A., Sengupta, S., & Rao, P. V. (1999). Extraction of information from open-ended questionnaires using natural language processing techniques. Computer Science and Informatics, 29(2), 15-22 [60] Glasgow, B., Mandell, A., Binney, D., Ghemri, L., & Fisher, D. (1998). MITA: An information-extraction approach to the analysis of free-form text in life insurance applications. AI magazine, 19(1), 59. [61] Ahonen, H., Heinonen, O., Klemettinen, M., & Verkamo, A. I. (1998, April). Applying data mining techniques for descriptive phrase extraction in digital document collections. In Research and Technology Advances in Digital Libraries, 1998. ADL 98. Proceedings. IEEE International Forum on (pp. 2-11). IEEE. [62] Zajic, D. M., Dorr, B. J., & Lin, J. (2008). Single-document and multi-document summarization techniques for email threads using sentence compression. Information Processing & Management, 44(4), 1600-1610. [63] Fattah, M. A., & Ren, F. (2009). GA, MR, FFNN, PNN and GMM based models for automatic text summarization. Computer Speech & Language, 23(1), 126-144. [64] Gong, Y., & Liu, X. (2001, September). Generic text summarization using relevance measure and latent semantic analysis. In Proceedings of the 24th annual international ACM SIGIR conference on Research and development in information retrieval (pp. 19-25). ACM. [65] Dunlavy, D. M., O'Leary, D. P., Conroy, J. M., & Schlesinger, J. D. (2007). QCS: A system for querying, clustering and summarizing documents. Information processing & management, 43(6), 1588-1605. [66] Wan, X. (2008). Using only cross-document relationships for both generic and topic- focused multi-document summarizations. Information Retrieval, 11(1), 25-49. [67] Ouyang, Y., Li, W., Li, S., & Lu, Q. (2011). Applying regression models to query- focused multi-document summarization. Information Processing & Management, 47(2), 227- 237. [68] Mani, summarization (Vol. 293). Cambridge, MA: MIT press. I., & Maybury, M. T. (Eds.). (1999). Advances in automatic text [69] Riedhammer, K., Favre, B., & Hakkani-Tür, D. (2010). Long story short–global unsupervised models summarization. Speech Communication, 52(10), 801-815. based meeting for keyphrase [70] Wang, D., Zhu, S., Li, T., & Gong, Y. (2009, August). Multi-document summarization using sentence-based topic models. In Proceedings of the ACL-IJCNLP 2009 Conference Short Papers (pp. 297-300). Association for Computational Linguistics. [71] Wang, D., Zhu, S., Li, T., Chi, Y., & Gong, Y. (2011). Integrating document clustering and multidocument summarization. ACM Transactions on Knowledge Discovery from Data (TKDD), 5(3), 14. [72] Fang, H., Lu, W., Wu, F., Zhang, Y., Shang, X., Shao, J., & Zhuang, Y. (2015). Topic aspect-oriented summarization via group selection. Neurocomputing, 149, 1613-1619. [73] Sager, N., Lyman, M., Nhan, N. T., & Tick, L. J. (1995). Medical language processing: applications to patient data representation and automatic encoding. Methods of information in medicine, 34(1-2), 140-146. [74] Chi, E. C., Lyman, M. S., Sager, N., Friedman, C., & Macleod, C. (1985, November). A database of computer-structured narrative: methods of computing complex relations. In Proceedings of the Annual Symposium on Computer Application in Medical Care (p. 221). American Medical Informatics Association. [75] Grishman, R., Sager, N., Raze, C., & Bookchin, B. (1973, June). The linguistic string parser. In Proceedings of the June 4-8, 1973, national computer conference and exposition (pp. 427-434). ACM. [76] Hirschman, L., Grishman, R., & Sager, N. (1976, June). From text to structured information: automatic processing of medical reports. In Proceedings of the June 7-10, 1976, national computer conference and exposition (pp. 267-275). ACM. [77] Sager, N. (1981). Natural language information processing. Addison-Wesley Publishing Company, Advanced Book Program. [78] Lyman, M., Sager, N., Friedman, C., & Chi, E. (1985, November). Computer-structured narrative in ambulatory care: its use in longitudinal review of clinical data. In Proceedings of the Annual Symposium on Computer Application in Medical Care (p. 82). American Medical Informatics Association. [79] McCray, A. T., & Nelson, S. J. (1995). The representation of meaning in the UMLS. Methods of information in medicine, 34(1-2), 193-201. [80] McGray, A. T., Sponsler, J. L., Brylawski, B., & Browne, A. C. (1987, November). The role of lexical knowledge in biomedical text understanding. In Proceedings of the Annual Symposium on Computer Application in Medical Care (p. 103). American Medical Informatics Association. [81] McCray, A. T. (1991). Natural language processing for intelligent information retrieval. In Engineering in Medicine and Biology Society, 1991. Vol. 13: 1991., Proceedings of the Annual International Conference of the IEEE (pp. 1160-1161). IEEE. [82] McCray, A. T. (1991). Extending a natural language parser with UMLS knowledge. In Proceedings of the Annual Symposium on Computer Application in Medical Care (p. 194). American Medical Informatics Association. [83] McCray, A. T., Srinivasan, S., & Browne, A. C. (1994). Lexical methods for managing variation in biomedical terminologies. In Proceedings of the Annual Symposium on Computer Application in Medical Care (p. 235). American Medical Informatics Association. [84] McCray, A. T., & Razi, A. (1994). The UMLS Knowledge Source server. Medinfo. MEDINFO, 8, 144-147. [85] Scherrer, J. R., Revillard, C., Borst, F., Berthoud, M., & Lovis, C. (1994). Medical office automation information system. Methods of information in medicine, 33(2), 174-179. the distributed architecture of a hospital integrated into [86] Baud, R. H., Rassinoux, A. M., & Scherrer, J. R. (1992). Natural language processing and semantical representation of medical texts. Methods of information in medicine, 31(2), 117-125. [87] Lyman, M., Sager, N., Chi, E. C., Tick, L. J., Nhan, N. T., Su, Y., ... & Scherrer, J. (1989, November). Medical Language Processing for Knowledge Representation and Retrievals. In Proceedings. Symposium on Computer Applications in Medical Care (pp. 548- 553). American Medical Informatics Association. [88] Nhàn, N. T., Sager, N., Lyman, M., Tick, L. J., Borst, F., & Su, Y. (1989, November). A Medical Language Processor In Proceedings. Symposium on Computer Applications in Medical Care (pp. 554-558). American Medical Informatics Association. Indo-European Languages. for Two [89] Sager, N., Lyman, M., Tick, L. J., Borst, F., Nhan, N. T., Revillard, C., ... & Scherrer, J. R. (1989). Adapting a medical language processor from English to French. Medinfo, 89, 795- 799. [90] Borst, F., Sager, N., Nhàn, N. T., Su, Y., Lyman, M., Tick, L. J., ... & Scherrer, J. R. (1989). Analyse automatique de comptes rendus d'hospitalisation. In Degoulet P, Stephan JC, Venot A, Yvon PJ, rédacteurs. Informatique et Santé, Informatique et Gestion des Unités de Soins, Comptes Rendus du Colloque AIM-IF, Paris (pp. 246-56). [5] [91] Baud, R. H., Rassinoux, A. M., & Scherrer, J. R. (1991). Knowledge representation of discharge summaries. In AIME 91 (pp. 173-182). Springer Berlin Heidelberg. [92] Baud, R. H., Alpay, L., & Lovis, C. (1994). Let's Meet the Users with Natural Language Understanding. Knowledge and Decisions in Health Telematics: The Next Decade, 12, 103. [93] Rassinoux, A. M., Baud, R. H., & Scherrer, J. R. (1992). Conceptual graphs model extension for knowledge representation of medical texts. MEDINFO, 92, 1368-1374. [94] Morel-Guillemaz, A. M., Baud, R. H., & Scherrer, J. R. (1990). Proximity Processing of Medical Text. In Medical Informatics Europe'90 (pp. 625-630). Springer Berlin Heidelberg. [95] Rassinoux, A. M., Michel, P. A., Juge, C., Baud, R., & Scherrer, J. R. (1994). Natural language processing of medical texts within the HELIOS environment. Computer methods and programs in biomedicine, 45, S79-96. [96] Rassinoux, A. M., Juge, C., Michel, P. A., Baud, R. H., Lemaitre, D., Jean, F. C., ... & Scherrer, J. R. (1995, June). Analysis of medical jargon: The RECIT system. In Conference on Artificial Intelligence in Medicine in Europe (pp. 42-52). Springer Berlin Heidelberg. [97] Friedman, C., Cimino, J. J., & Johnson, S. B. (1993). A conceptual model for clinical radiology reports. In Proceedings of the Annual Symposium on Computer Application in Medical Care (p. 829). American Medical Informatics Association. [98] "Natural Language Processing." Natural Language Processing RSS. N.p., n.d. Web. 23 Mar. 2017. [99] [Srihari S. Machine Learning: Generative and Discriminative Models. 2010. http:// www.cedar.buffalo.edu/wsrihari/CSE574/Discriminative-Generative.pdf (accessed 31 May 2011).] [100] [Elkan C. Log-Linear Models and Conditional Random Fields. 2008. http://cseweb. ucsd.edu/welkan/250B/cikmtutorial.pdf (accessed 28 Jun 2011). 62. Hearst MA, Dumais ST, Osman E, et al. Support vector machines] [101] [Jurafsky D, Martin JH. Speech and Language Processing. 2nd edn. Englewood Cliffs, NJ: Prentice-Hall, 2008.] [102] [Sonnhammer ELL, Eddy SR, Birney E, et al. Pfam: Multiple sequence alignments and HMM-profiles of protein domains. Nucleic Acids Res 1998;26:320] [103] [Sonnhammer, E. L., Eddy, S. R., Birney, E., Bateman, A., & Durbin, R. (1998). Pfam: multiple sequence alignments and HMM-profiles of protein domains. Nucleic acids research, 26(1), 320-322] [104] Systems, RAVN. "RAVN Systems Launch the ACE Powered GDPR Robot - Artificial Intelligence to Expedite GDPR Compliance." Stock Market. PR Newswire, n.d. Web. 19 Mar. 2017. [105] "Here's Why Natural Language Processing is the Future of BI." SmartData Collective. N.p., n.d. Web. 19 Mar. 2017 [106] "Using Natural Language Processing and Network Analysis to Develop a Conceptual Framework for Medication Therapy Management Research." AMIA ... Annual Symposium proceedings. AMIA Symposium. U.S. National Library of Medicine, n.d. Web. 19 Mar. 2017 [107] Ogallo, W., & Kanter, A. S. (2017, February 10). Using Natural Language Processing and Network Analysis to Develop a Conceptual Framework for Medication Therapy Management from https://www.ncbi.nlm.nih.gov/pubmed/28269895?dopt=Abstract Research. 2017, Retrieved April 10, [108] Ochoa, A. (2016, May 25). Meet the Pilot: Smart Earpiece Language Translator. Retrieved April 10, 2017, from https://www.indiegogo.com/projects/meet-the-pilot-smart- earpiece-language-translator-headphones-travel
1704.06360
1
1704
2017-04-20T23:02:14
SwellShark: A Generative Model for Biomedical Named Entity Recognition without Labeled Data
[ "cs.CL" ]
We present SwellShark, a framework for building biomedical named entity recognition (NER) systems quickly and without hand-labeled data. Our approach views biomedical resources like lexicons as function primitives for autogenerating weak supervision. We then use a generative model to unify and denoise this supervision and construct large-scale, probabilistically labeled datasets for training high-accuracy NER taggers. In three biomedical NER tasks, SwellShark achieves competitive scores with state-of-the-art supervised benchmarks using no hand-labeled training data. In a drug name extraction task using patient medical records, one domain expert using SwellShark achieved within 5.1% of a crowdsourced annotation approach -- which originally utilized 20 teams over the course of several weeks -- in 24 hours.
cs.CL
cs
SWELLSHARK: A Generative Model for Biomedical Named Entity Recognition without Labeled Data Jason Fries, Sen Wu, Alex Ratner, Christopher R´e {jfries,senwu,ajratner,chrismre}@cs.stanford.edu Stanford University / Stanford, CA 7 1 0 2 r p A 0 2 ] L C . s c [ 1 v 0 6 3 6 0 . 4 0 7 1 : v i X r a Abstract We present SWELLSHARK, a framework for building biomedical named entity recog- nition (NER) systems quickly and without hand-labeled data. Our approach views biomedical resources like lexicons as func- tion primitives for autogenerating weak su- pervision. We then use a generative model to unify and denoise this supervision and construct large-scale, probabilistically la- beled datasets for training high-accuracy NER taggers. In three biomedical NER tasks, SWELLSHARK achieves competi- tive scores with state-of-the-art supervised benchmarks using no hand-labeled training data. In a drug name extraction task using patient medical records, one domain expert using SWELLSHARK achieved within 5.1% of a crowdsourced annotation approach – which originally utilized 20 teams over the course of several weeks – in 24 hours. Introduction 1 Named-entity recognition (NER) is a foundational NLP task that is traditionally approached as a super- vised learning problem. In this setting, state-of-the- art NER systems often require considerable manual feature engineering to learn robust models using hand-labeled training data. Recent success in deep learning for NER (Lample et al., 2016) suggests that automatic feature extraction will largely re- place this process. However, this shifts the burden to constructing the massive hand-labeled training sets needed for robust deep models. How do we obtain enough training data to fit these complex models? Crowdsourcing offers one way of generating large-scale labeled data, but the process is expensive, especially when annotators require specialized domain knowledge or data has privacy concerns preventing distribution (Sabou et al., 2012; Gokhale et al., 2014). Furthermore, even expert inter-annotator agreement rates can be low for certain tasks. In NLP, another common approach is distant supervision (Mintz et al., 2009) where structured resources like ontologies and knowledge bases are used to heuristically label training data. While noisy, this technique has shown empirical suc- cess. Distant supervision is commonly used with a few, canonical structured resources like Free- base (Bollacker et al., 2008), weighting each re- source equally when labeling data. However, in biomedicine we are faced with a wide space of cu- rated resources; NCBO Bioportal (Whetzel et al., 2011) currently houses 541 distinct biomedical on- tologies. These resources contain different hier- archical structures, concept granularities, and oth- erwise overlap or conflict in their definitions of 8 million entities. Any single ontology may have widely varying accuracy depending on the target task, making them difficult to combine using sim- ple methods like majority vote. We present SWELLSHARK, a framework for quickly building biomedical NER taggers using lexicons, heuristics, and other forms of weak super- vision instead of hand-labeled data. Our approach effectively subsumes both crowdsourcing and dis- tant supervision, automatically modeling all such inputs as a generative labeling process. This func- tional view allows us to take advantage of recent advances in denoising weak supervision, more ef- fectively unifying large-scale biomedical resources. Our approach greatly simplifies supervision in an NER system. Traditional distant supervision pipelines consist of three basic components: (1) candidate generation, i.e., identifying potential en- tities for labeling and classification; (2) labeling heuristics for generating noisy labels; and (3) fea- tures describing candidates for classification. Pre- viously, each of these has required human engi- neering or supervision. In SWELLSHARK we show that in the presence of structured resources like lexi- cons and ontologies, components (1) and (2) can be largely automated. When coupled with automatic feature extraction models like LSTMs, we create a powerful end-to-end pipeline that requires dramati- cally less human input and can train high-accuracy taggers using unlabeled data. The central argument of this work is that model- ing noise in supervision resources is such a power- ful strategy that it enables tremendous performance gains from even simple NER techniques. This al- lows us to focus exclusively on the resources used to supervise a model instead of diffusing human effort across an entire extraction pipeline. Our three core contributions are summarized as: • Automatic Candidate Generation: SWELL- SHARK automatically generates potential or candidate entity mentions in documents, a heuristic process that traditionally required non-trivial engineering. Since candidates de- fine the space over which we both provide supervision and learn, selecting the right ap- proach is critical to overall performance. • Autogenerated Supervision: SWELL- SHARK only requires a set of positive and negative lexicons as baseline input. Several classes of automatic supervision generators apply transformations to these lexicons and efficiently generate a large space of noisy supervision with minimal human input. • Weakly-supervising Sequences: SWELL- SHARK allows us to "compile" supervision inputs, like lexicons and other heuristic rules, directly into a sequence prediction model. We propose a multinomial generative model to explicitly learn entity boundaries, a key part of NER, and model the accuracies of our un- derlying supervision sources. Modeling noise while generating data is criti- cal for scaling, where we improve tagger accuracy by using more unlabeled data to train our models. With SWELLSHARK, we construct weakly-labeled training sets of up to 100K documents, providing boosts of up to 6.7% (4.9 F1 points) over the same models trained on small ( ≤ 1K) document collec- tions. With scaling, we can achieve competitive results to state-of-the-art supervised models. Finally, as an applied validation challenge, we used SWELLSHARK to build an NER system in another biomedical domain: tagging drug names in clinical discharge summaries. We report the performance achieved by a single domain expert given 24 hours for development and model training. SWELLSHARK scored within 5.1% of a crowd- sourced annotation approach, which originally uti- lized 20 teams over the course of several weeks. 2 Related Work Domain-specific NER tasks are a well-studied NLP problem. The best performing systems use super- vised or semi-supervised learning and require hand- annotated training data. In biomedical NER, super- vised methods using CRFs are the standard (Settles, 2004; Leaman et al., 2008) though RNNs/LSTMs are increasingly common (Sahu and Anand, 2016; Dernoncourt et al., 2016). Semi-supervised meth- ods that augment labeled datasets with word em- beddings (Tang et al., 2014; Kuksa and Qi, 2010) or bootstrapping techniques (Vlachos and Gasperin, 2006) have been shown to outperform supervised baselines in tasks like gene name recognition. Un- like these existing approaches, SWELLSHARK does not require hand-labeled training data and is agnos- tic to the choice of discriminative model. Leveraging existing resources to heuristically label data has received considerable research inter- est. Distant supervision (Craven et al., 1999; Mintz et al., 2009) uses knowledge bases to supervise relation extraction tasks. Recent methods incor- porate more generalized knowledge into extrac- tion systems. Natarajan et al.(2016) used Markov Logic Networks to encode commonsense domain knowledge like "home teams are more likely to win a game" and generate weak training examples. SWELLSHARK is informed by these methods, but uses a generative model to unify and model noise across different supervision sources. 3 Background Biomedical NER Identifying named entities is a core component of applied biomedical informa- tion extraction systems and a critical subtask in normalization, where entities are mapped to canon- ical identifiers, and relation extraction, where we identify n-arity semantic connections between en- tities. Ontologies are key artifacts in formalizing biological concepts for normalization and use in computational systems. Biomedical NER focuses on identifying these concepts. For example we would label a sentence as: "Primary pulmonary hypertension is a rare, progressive and incurable disease." to identify a disease name. For simplicity, in this work we assume each en- tity is a binary classification task, i.e., each tag- ger predicts one entity type, although our method generalizes to multi-class settings without exten- sive changes. We focus on the recognition part of named entity extraction and do not address normal- ization. Data programming: Ratner et al. (2016) pro- posed data programming as a method for program- matic training set creation. In data programming, a collection of user-provided rules called labeling functions (LFs) are modeled as a generative pro- cess of training set labeling. Labeling functions may overlap and conflict in their labels, as long as the majority have accuracies greater than 50%. By default, it's assumed that labeling functions are con- ditionally independent. Fitting a generative model allows us to automatically estimate these accura- cies without ground truth data. The resulting model is then used to construct large-scale training sets with probabilistic labels. Formally, labeling functions are black box func- tions which label some subset of data. In our set- ting, given a set of candidates for a single entity class (e.g., disease names) and corresponding bi- nary labels, (x, y) ∈ X ×{−1, 1}, where the y are unseen, a labeling function λi maps: λi : X (cid:55)→ {−1, 0, 1} where 0 means a labeling function abstains from providing a label. The output of a set of M label- ing functions applied to N candidates is a matrix Λ ∈ {−1, 0, 1}N×M . Each labeling function is rep- resented by a single accuracy parameter, learned based on observing the agreements and disagree- ments between overlapping labeling functions. Instead of binary ground-truth training labels (x, y) with y ∈ {−1, 1}, we now utilize the marginal probabilities of our generative model, Pµ(Y Λ) ∈ [0, 1], as training labels for a dis- criminative model, such as logistic regression or an LSTM. This requires using a noise-aware ver- sion of our loss function. This can be implemented analytically in the discriminative model or simu- lated by creating a sampled dataset based on our marginal probabilities. Figure 1: SWELLSHARK pipeline. The numbers correspond to the stages described in §4.1 - §4.5. 4 Methods The SWELLSHARK pipeline is outlined in Figure 1 and consists of the following stages: 1) providing unlabeled documents and defining weak supervi- sion input; 2) using generators to transform docu- ments into a set of candidates for classification; 3) autogenerating labeling functions using structured resources or user heuristics; 4) fitting a multinomial generative model using the output of all labeling functions as applied to candidates; and 5) generat- ing probabilistically labeled data, which can then be used with any off-the-shelf classification model. Details for each stage are described below. 4.1 SwellShark Input SWELLSHARK requires as input a collection of un- labeled documents and some form of weak supervi- sion. This is typically a collection of lexicons, on- tologies, and optional heuristic rules. Supervision largely consists of specifying positive and negative lexicons. As a toy example, a minimal drug tagger specification could be (1: antibotic, -1: amino acid, peptide, or protein, gene or genome), with each semantic category mapping to source lexicons in the Unified Medical Language System (UMLS) (Bodenreider, 2004) or other external dictionaries. 4.2 Candidate Generators Our approach requires first identifying a set of po- tential or candidate mentions in documents. We define a candidate generator, Γφ, as a function that transforms a document collection D into a candi- date set: Γφ : D (cid:55)→ {x1, ..., xN}. Each candidate x is defined as a character-level span within a docu- ment sentence. Candidate generators are heuristics that can be restrictive e.g., the set of all dictionary matches, or permissive, such as all overlapping k- gram spans. The choice of heuristic impacts overall yi … yNxi … xNDATASET CREATION& LEARNINGAPPLY LABELING FUNCTIONSNoisy Training SetGenerative ModelLSTM / CRF / LogRegi … MINPUTDocsWeakSupervisionCandidateGeneratorsLabel MatrixLabeling FunctionGenerators12354 performance, since candidates define the space over which we both provide supervision and learn. We explore the following simple automated generators: • Noun Phrases All noun phrases as matched using regular expressions over POS tags. • Dictionary Domain dictionaries with no domain-specific stopword lists or other lex- ical curation. Each heuristic emits k-grams candidates; in our experiments k = [1-10]. Choosing a heuristic in- volves some trade-off between development time and performance. Hand-tuned matchers require more engineering, but generate more accurate can- didate sets. This requires less weak supervision to train the discriminative model, since the candidate generation step acts as an implicit hard filter. In contrast, dictionary and noun phrase candidates are generated automatically, but create additional chal- lenges during learning. Dictionary matches limit recall, impacting generalizability; noun phrase can- didates generate larger sets, introducing more noise during labeling function application. 4.3 Labeling Function Generators Labeling functions are a generalization of strategies used in distant supervision. For example, in disease name tagging we can define a labeling function that outputs 1 if a candidate occurs in a disease or syndrome lexicon and another function which outputs -1 if it's found in a gene or genome lexicon. Several examples are shown in Figure 2. def LF_in_lexicon(c): t = c.text() return 1 if t in umls_disease else 0 def LF_idf_filter(c): return -1 if idf(c) <= 4.0 else 0 def LF_temporal_modifiers(c): head = c.tokens("words")[0] return -1 if head in temp_mod else 0 Figure 2: Example labeling functions : (top) tests for membership in a lexicon; (middle) filters by can- didate inverse document frequency; and (bottom) defines a compositional grammar rule for rejecting candidates beginning with a temporal modifier, e.g., *recurrent* carcinoma, *childhood* cancer. Labeling functions using structured resources assume predictable froms, meaning most lexical- based supervision can be autogenerated. We define a labeling function generator (LFG), Γλ, as a func- tion which accepts a weak supervision resource, R, e.g., an ontology or empirical attributes like term frequencies, and automatically generates one or more labeling functions, Γλ : R (cid:55)→ {λ1, ..., λN}. LFGs automate a large space of supervision from minimal manual input, such as a collection of posi- tive and negative lexicons. We implemented LFGs as described in Table 1. Type Lexical Filters LF Modifiers LF Generator Description λ (cid:55)→ ci ∈ lexicon λ (cid:55)→ TailWord(ci) ∈ lexicon λ (cid:55)→ AbbrvDef(ci) ∈ lexicon ci is a parenthetical def. e.g., "Myotonic dystrophy (DM)" λ (cid:55)→ IDF (ci) > threshold λ (cid:55)→ DF (ci) > threshold λ (cid:55)→ PhraseFragment(ci) tail word is an adjective λa(λb) (cid:55)→ Children(ci) cascade λb to all fully nested child candidates λa(λb) (cid:55)→ λa(ci) ◦ λb(ci) logical composition of LFs Table 1: Labeling function generators. A single generator can instantiate multiple pos- itive and negative labeling functions. This occurs in the case of overlapping candidate spans, where we allow supervision to cascade to nested child entities. In Figure 3 some children of "primary pul- monary hypertension" are dictionary members and are assigned positive labels. However, if we wish to enforce longest match, we can define a dictionary generator that votes positive on the longest match and negative on all child nodes. Other complex primitives are possible using compositions, such as synonym or negation detection. Our goal is to make it easy and fast to use combinations of LFGs and LFs to provide supervision for a new tagger. 4.4 Multinomial Generative Model A key challenge of our simple, unified framework for accepting weak supervision is that it involves overlapping candidates. The generative model orig- inally proposed by data programming assumes can- didates are independent, and does not account for dependencies induced by overlapping spans. Fig- ure 3 shows how this can lead to incorrect marginal probability estimates. In this example, all vari- ants of "hypertension" are found in a single lexi- Figure 3: Sentence partitioning example. Each overlapping candidate set defines a spanset si. Given one positive and negative LF, green is positive, red is negative, and bold outlines indicate the true mention. NONE is the absence of an entity. Overlapping candidates, as in s1, cause errors in probability estimation. con, overestimating positive label probabilities for nested candidates. To address this bias, we extend the generative model to learn mutual exclusion con- straints. For NER, this change is vital because it allows us to learn entity boundaries while maintain- ing simple labeling function semantics, i.e., voting on discrete candidates. In our experiments, model- ing these dependencies improves overall F1 score by up-to 4.7% (3.4 points). We define a spanset, s, as a collection of overlap- ping candidates within a sentence as partitioned by the labeling matrix Λ, where each candidate's row contains the labels generated by all labeling func- tion. Candidates with ≥ 1 positive, overlapping labels form the basis of each spanset. Candidates with ≥ 1 negative labels and 0 positives are added if such addition does not join two disconnected spansets. Unlabeled candidates are removed. Each spanset is represented as a matrix X ∈ RM×K where M is the number of labeling func- tions and K is the number of overlapping can- didates per spanset plus the NONE class. In our datasets, these matrices are column sparse with small K. Pathologically long cases are filtered out. Positive label semantics remain unchanged in this framing. However negative labels are now underspecified since they don't provide enough su- pervision to perfectly map to a sequence prediction task. A candidate may be completely wrong (the NONE class) or a partial match. For example, in Figure 3 a negative vote for "primary" doesn't tell us if the whole spanset is wrong or if it's a subset of a correct entity (as is the case). Our convention is if the ith LF votes negatively on a candidate j, this is expressed as having uniform distribution over all K columns except j in row i of X. Learning is otherwise unchanged from the binary case, except we now apply the softmax function to each spanset matrix X to compute marginals. P (Y = j X; w) = exp(wT Xj ) (cid:80)K k=1 exp(wT Xk) 4.5 Sampling for Dataset Construction After training, each spanset now defines a multino- j); j = 1...k}, where mial distribution si = {(ci p is the probability of each candidate within the spanset. We treat all spansets in a sentence, S, as as sampling distribution S ∼ s1 × s2 × ...sN to generate noisily labeled tag sequences. We assume spansets are independent and generate 10 samples per observed sentence, sampling once per spanset. j, pi 5 Experiments 5.1 Weakly-supervised Taggers As our experimental testbed, we built three biomed- ical taggers: two for disease names ("osteoarthri- tis") and one for chemical names ("bupropion hy- drochloride"), with each tagger trained using a CRF or LSTM. Each model configuration is evaluated using 25K to 100K unlabeled training documents. Our primary experimental questions are: 1) what are the performance trade-offs of different candi- date generation heuristics; 2) how well does auto- generated supervision perform; and 3) how quickly can we write a tagger for use in other domains? Comparison Systems: For our baseline compar- ison system, we use reported benchmarks from TaggerOne (Leaman and Lu, 2016) a state-of-the- art general purpose biomedical NER tagger. Their approach uses a CRF with manually engineered fea- tures. We compute two simple baselines: a string matching score using all positive lexicons (LEX) and a domain-agnostic stop word list; and the ma- jority vote (MV) across all labeling functions. 1) Tuning Candidate Generation: We explored the trade-offs of two automated candidate genera- tion methods compared to a manually-engineered Primary pulmonary hypertension is a rare , progressive and incurable disease , whichpulmonary hypertensionhypertensionNONENONENONENONEdiseasepulmonary PrimaryS1= 6S2= 2S3= 2S4= 3 baseline. For each tagger, we implemented an optimized, hand-tuned generator using regular ex- pressions, dictionaries, and other fuzzy matching heuristics. These generators are task-specific, care- fully maximizing recall while minimizing false pos- itives. We compute precision-recall curves for each heuristic and report F1 scores when those methods are scaled. We empirically evaluated precision/re- call tradeoffs of different k-gram token lengths and use k=6 for all candidates. Here we use the CDR disease task as our motivating example. 2) Autogenerating Supervision: We trained models using only autogenerated, lexicon-based labeling functions and NounPhrase candidate gen- erators. Here supervision consists of specifying positive and negative semantic categories selected from the 133 semantic definitions provided by the UMLS. Lexicons provide a strong baseline super- vision framework, but they are usually incapable of modeling the entire dataset generation process. The definition of ground truth often depends on dataset-specific annotation guidelines. For exam- ple, in our clinical notes task, mentions of drug names that are negated or describe patient allergies are not considered true mentions; a lexicon alone cannot encode this form of supervision. Choosing what affixes, modifiers, and prepositional phrases constitute an entity can vary greatly across datasets. One advantage of SWELLSHARK is that this type of dataset-specific supervision is easily introduced into our system by adding more labeling functions. For each PubMed tagger, we extended our lexi- cal supervision with labeling functions to capture annotation guidelines and other dataset-specific su- pervision. This required writing 20-50 additional labeling functions per task. 3) Building a Tagger in 24-hours: We tested out ability to quickly build a high-performance tag- ger in another biomedical domain. Given a time budget of 24 hours, we used our tools to build a drug name tagger for clinical discharge summaries. For the autogenerated LF model, our positive su- pervision consisted of 13 chemical semantic types from the UMLS. This setup required about one hour. We spent the remaining time examining train- ing data to identify syntactical patterns and rules for labeling functions. Due to time constraints and the lack of additional unlabeled data, we did not explore scale-up performance. Labeling Function Development: All labeling functions and domain stop word lists were devel- oped iteratively by inspecting unlabeled training documents. Manually written LFs were refined based on empirical accuracy scores from a small set of held-out labeled training instances. No ground truth labels were used to fit our final discriminative models; we only use noise-aware labels produced by the generative model. 5.2 Materials and Setup Datasets: We evaluate performance on three bioinformatics datasets: (1) the NCBI Disease cor- pus (Dogan et al., 2014); (2) the BioCreative V Chemical Disease Relation task (CDR) corpus (Wei et al., 2015); and the i2b2-2009 Medication Ex- traction Challenge dataset (Uzuner et al., 2010a). NCBI Disease contains 792 PubMed abstracts sep- arated into training, development, and test subsets (n=592/100/100); CDR contains 1,500 PubMed ab- stracts (n=500/500/500); and i2b2-2009 contains 1249 electronic health record (EHR) discharge sum- maries (n=1000/124/125). PubMed datasets are annotated with mention-level disease and chemical entities and i2b2 data with drug names. For unlabeled PubMed data, we use a 100K doc- ument sample chosen uniformly at random from the BioASQ Task 4a challenge (Tsatsaronis et al., 2015) dataset. All LSTM experiments use the 200- dim word2vec embeddings provided as part of this dataset. For clinical text embeddings, we generated embeddings using 2.4M clinical narratives made available as part of the MIMIC-III critical care database (Johnson et al., 2016). Ontologies used in this work include those provided as part of the 2014AB release of the UMLS, and various other disease/chemical ontolo- gies (Schriml et al., 2012; Davis et al., 2015; Rath et al., 2012; Kohler et al., 2013). Data Preprocessing: All datasets are prepro- cessed using Stanford CoreNLP1 with default En- glish models for tokenization, sentence boundary detection, POS tagging, and dependency parsing. Discriminative Models: We use two external se- quence models: CRFsuite (Okazaki, 2007) and a bidirectional LSTM-CRF hybrid (Lample et al., 2016) which makes use of both word and character- level embeddings. Our LSTM-CRF uses automatic feature extraction based on word-level input. CRFs 1http://stanfordnlp.github.io/CoreNLP/ System CandGen TaggerOne∗ Hand-tuned Majority Vote Hand-tuned o CRF/emb o LSTM-CRF/emb Hand-tuned Noun Phrase Majority Vote Noun Phrase o CRF/emb o LSTM-CRF/emb Noun Phrase Lexicon Baseline NCBI (Disease) F1 P 81.5 83.5 84.5 79.8 78.4 78.7 80.8 81.6 84.4 64.1 60.2 56.5 67.1 64.7 36.3 49.5 R 79.6 75.5 78.0 80.1 51.7 64.4 69.7 77.6 CDR (Disease) F1 P 79.6 83.1 85.4 75.5 80.1 83.1 80.1 81.6 76.4 71.5 78.5 81.5 79.1 80.7 40.8 53.3 R 76.4 67.6 77.2 78.6 67.3 75.81 77.6 77.1 CDR (Chemical) P F1 88.4 92.4 89.8 86.3 86.7 89.6 87.6 89.8 86.2 86.2 87.9 89.2 88.3 88.3 62.0 70.3 R 84.7 83.1 84.0 85.5 86.1 86.7 88.3 81.2 Table 2: Best SWELLSHARK results compared against supervised baselines. Here we add additional labeling functions to improve performance and report scores for both hand-tuned and automatic candidate generators. o indicates the highest scoring model after scaling with additional (≤ 100K) unlabeled documents. * TaggerOne scores are for NER only. use a generic feature library (see §Appendix) based on TaggerOne. Evaluation Measures: Precision (P), Recall (R), F1-score (F1). 6 Results / Discussion 6.1 Candidate Generation Figure 4: Scale-up performance of different candi- date generation heuristics on CDR Disease using CRF/emb and extended labeling functions. The hand-tuned heuristic (red) performs better than our supervised baseline (the dashed line). Figure 4 shows performance trade-offs at scale of our three heuristics in CDR disease with ex- tended labeling functions. Using a hand-tuned candidate generator allows our system to surpass supervised performance, however, completely au- tomated methods also perform very well. A Noun- Phrase generator scores within 2% of the hand- tuned heuristic with CRF/emb and 1.25% using LSTM-CRF/emb (see Table 2). The bump in per- formance seen around 1K documents is an artifact of scale-up using a CRF with embeddings, where there is some early overfitting. Tables 2 contains scores for PubMed taggers, comparing manual and automated candidate gen- eration heuristics at scale. In both CDR tasks, we can closely match or exceed benchmark scores re- ported by TaggerOne (from +0.5 to -0.1 F1 points). In chemicals, NounPhrase candidate generation demonstrates better recall and improves on hand- tuned matchers by 0.7 points. In contrast, the NCBI task performs far below baseline using NounPhrase generators. This is due to that dataset's more com- plex definition of mentions, including conjunctions ("breast and ovarian cancer") and prepositional phrases ("deficiency of beta-hexosaminidase A"). These increase partial matches, hurting overall per- formance. With a hand-tuned candidate generator, we can account for these specific cases and dra- matically improve performance and scoring -0.7 F1 points within the benchmark. 6.2 Autogenerating Supervision Table 3 shows performance measures for our mod- els when using only lexical resources for supervi- sion, without any annotation guideline or dataset- specific labeling functions. In all cases, we find the LSTM-CRF/emb models outperform majority vote by 1.7 to 5.4 F1 points. In chemical tagging, we come within 1 F1 point of published TaggerOne's benchmark score; in NCBI we do much worse due to candidate issues outlined above. 747576777879801K25K50K100KHand-tunedDictionaryNoun PhrasesSupervised BaselineF1 ScoreNum. Unlabeled Documents Dataset (Entity) LFs LEX MV CDR (Disease) CDR (Chemical) NCBI (Disease) 77 28 77 53.3 70.3 49.5 69.2 85.7 58.6 CRF/emb LSTM-CRF/emb Train +5K +10K +25K Train +5K +10K +25K 73.5 71.3 87.4 86.2 64.0 58.3 73.8 87.3 64.2 73.3 87.2 63.6 71.4 85.2 62.4 72.5 86.9 57.7 73.0 86.9 57.6 73.1 87.1 56.3 Table 3: F1 scores for fully automated dictionary supervision, where the only supervision input consists of positive and negative class dictionaries and an optional list of domain-specific stop words. All candidates and labeling functions are generated automatically. Scale-up & Automatic Feature Extraction: Figure 5 gives a broader picture of the scale-up curve and the convergence differences between the human-generated feature library used for our CRF and LSTM-CRF models. Pretrained word embed- dings give the LSTM-CRF an advantage in smaller document settings, converging quickly to the best score after 10K additional unlabeled documents. In contrast, without embeddings, the LSTM-CRF is always dominated by CRF models, requiring over 3x more unlabeled data to learn features that ap- proach the same score. Models trained on 100k documents are similar in performance, although the LSTM-CRF is the best overall performer. Model Supervised Auto-LFs MV Auto-LFs Custom-LFs MV Custom-LFs Lexicon Baseline Crowdsourcing i2b2-2009 (Drug) LFs - 211 211 232 232 - 79* P 90.4 84.4 82.2 90.1 83.9 31.9 - R 88.5 62.5 74.7 69.2 82.9 67.6 - F1 89.4 71.8 78.3 78.3 83.4 43.3 87.8 Table 4: Building a stagger in 24 hours using 1K unlabeled discharge summaries. The crowdsourc- ing score is the macro-average of 79 annotators. achieved good performance and, most likely, would improve with more unlabeled training documents which unfortunately are not available for this task. Comparing our performance to the same task as done with crowdsourcing (Uzuner et al., 2010b), we are within 5.1% (4.4 F1 points) of the crowd macro average achieved by 79 annotators. This required 2 phases of labeling and adjudication over several weeks, although an exact time estimate for drug names alone is difficult as it was one of 1 of 7 annotated subtasks. 7 Conclusion In this work, we've demonstrated that program- matic supervision, provided by biomedical lexi- cons and other heuristics, can achieve competitive performance to state-of-the-art systems trained on hand-labeled data. SWELLSHARK accepts much weaker forms of supervision, allowing NER taggers to be built in less time and in a more intuitive fash- ion for domain experts. Our approach intrinsically scales to automatically construct large training sets, allowing SWELLSHARK to train high performance taggers using state of recent deep learning models. Figure 5: Scale-up F1 scores for automatic fea- ture extraction in CDR Disease. The x-axis is the number of unlabeled documents used for training. 6.3 A Tagger in 24 Hours Autogenerated labeling functions provide a strong baseline system in this task, scoring 6.5 F1 points over majority vote and boosting recall by 12.2 points. We extending this core system with 21 customized regular expression rules and other guideline specific labeling functions for an overall score within 7% (6 F1 points) of the same model trained on hand-labeled data. Our approach quickly 0.680.700.720.740.760.780.801k20K40K60k80K100KCRFCRF+embLSTM-CRFLSTM-CRF+embSupervised BaselineF1 ScoreNum. Unlabeled Documents Acknowledgments This work was supported in part by the Mobilize Center, a National Institutes of Health Big Data to Knowledge (BD2K) Center of Excellence sup- ported through Grant U54EB020405. References Olivier Bodenreider. 2004. The unified medical language system (UMLS): integrating biomedical Nucleic acids research 32(suppl terminology. 1):D267–D270. Kurt Bollacker, Colin Evans, Praveen Paritosh, Tim Sturge, and Jamie Taylor. 2008. Freebase: a collab- oratively created graph database for structuring hu- man knowledge. In Proceedings of the 2008 ACM SIGMOD international conference on Management of data. AcM, pages 1247–1250. Mark Craven, Johan Kumlien, et al. 1999. Construct- ing biological knowledge bases by extracting infor- In ISMB. volume 1999, mation from text sources. pages 77–86. Allan Peter Davis, Cynthia J Grondin, Kelley Lennon- Hopkins, Cynthia Saraceni-Richards, Daniela Sci- aky, Benjamin L King, Thomas C Wiegers, and Car- olyn J Mattingly. 2015. The Comparative Toxicoge- nomics Database's 10th year anniversary: update 2015. Nucleic acids research 43(D1):D914–D920. Franck Dernoncourt, Ji Young Lee, Ozlem Uzuner, and Peter Szolovits. 2016. De-identification of patient Journal of notes with recurrent neural networks. the American Medical Informatics Association page ocw156. Rezarta Islamaj Dogan, Robert Leaman, and Zhiyong Lu. 2014. Ncbi disease corpus: a resource for dis- ease name recognition and concept normalization. Journal of biomedical informatics 47:1–10. Chaitanya Gokhale, Sanjib Das, AnHai Doan, Jeffrey F Naughton, Narasimhan Rampalli, Jude Shavlik, and Xiaojin Zhu. 2014. Corleone: Hands-off crowd- In Proceedings of sourcing for entity matching. the 2014 ACM SIGMOD international conference on Management of data. ACM, pages 601–612. Alistair EW Johnson, Tom J Pollard, Lu Shen, Li- wei H Lehman, Mengling Feng, Mohammad Ghas- semi, Benjamin Moody, Peter Szolovits, Leo An- thony Celi, and Roger G Mark. 2016. Mimic-iii, a freely accessible critical care database. Scientific data 3. Sebastian Kohler, Sandra C Doelken, Christopher J Mungall, Sebastian Bauer, Helen V Firth, Isabelle Bailleul-Forestier, Graeme CM Black, Danielle L Brown, Michael Brudno, Jennifer Campbell, et al. 2013. The human phenotype ontology project: link- ing molecular biology and disease through pheno- type data. Nucleic acids research page gkt1026. Pavel P Kuksa and Yanjun Qi. 2010. Semi-supervised bio-named entity recognition with word-codebook In Proceedings of the 2010 SIAM Inter- learning. national Conference on Data Mining. SIAM, pages 25–36. Guillaume Lample, Miguel Ballesteros, Sandeep Sub- ramanian, Kazuya Kawakami, and Chris Dyer. 2016. Neural architectures for named entity recognition. arXiv preprint arXiv:1603.01360 . Robert Leaman, Graciela Gonzalez, et al. 2008. Ban- ner: an executable survey of advances in biomedical named entity recognition. In Pacific symposium on biocomputing. volume 13, pages 652–663. Robert Leaman and Zhiyong Lu. 2016. Taggerone: Joint named entity recognition and normalization Bioinformatics page with semi-markov models. btw343. Mike Mintz, Steven Bills, Rion Snow, and Dan Juraf- sky. 2009. Distant supervision for relation extrac- In Proceedings of the tion without labeled data. Joint Conference of the 47th Annual Meeting of the ACL and the 4th International Joint Conference on Natural Language Processing of the AFNLP: Vol- ume 2-Volume 2. Association for Computational Lin- guistics, pages 1003–1011. Sriraam Natarajan, Ameet Soni, Anurag Wazalwar, Dileep Viswanathan, and Kristian Kersting. 2016. Deep distant supervision: Learning statistical rela- tional models for weak supervision in natural lan- guage extraction. In Solving Large Scale Learning Tasks. Challenges and Algorithms, Springer, pages 331–345. Naoaki Okazaki. 2007. im- plementation of conditional random fields (crfs). http://www.chokkan.org/software/crfsuite/. Crfsuite: a fast Ana Rath, Annie Olry, Ferdinand Dhombres, Maja Milici´c Brandt, Bruno Urbero, and Sego- lene Ayme. 2012. Representation of rare diseases in health information systems: the orphanet approach to serve a wide range of end users. Human mutation 33(5):803–808. Alexander Ratner, Christopher De Sa, Sen Wu, Daniel Selsam, and Christopher R´e. 2016. Data program- ming: Creating large training sets, quickly. arXiv preprint arXiv:1605.07723 . Marta Sabou, Kalina Bontcheva, and Arno Scharl. Crowdsourcing research opportunities: 2012. In Pro- lessons from natural language processing. ceedings of the 12th International Conference on Knowledge Management and Knowledge Technolo- gies. ACM, page 17. Sunil Kumar Sahu and Ashish Anand. 2016. Recurrent neural network models for disease name recogni- tion using domain invariant features. arXiv preprint arXiv:1606.09371 . Lynn Marie Schriml, Cesar Arze, Suvarna Nadendla, Yu-Wei Wayne Chang, Mark Mazaitis, Victor Felix, Gang Feng, and Warren Alden Kibbe. 2012. Disease ontology: a backbone for disease semantic integra- tion. Nucleic acids research 40(D1):D940–D946. Burr Settles. 2004. Biomedical named entity recogni- tion using conditional random fields and rich fea- the International ture sets. Joint Workshop on Natural Language Processing in Biomedicine and its Applications. Association for Computational Linguistics, pages 104–107. In Proceedings of Buzhou Tang, Hongxin Cao, Xiaolong Wang, Qingcai Chen, and Hua Xu. 2014. Evaluating word represen- tation features in biomedical named entity recogni- tion tasks. BioMed research international 2014. George Tsatsaronis, Georgios Balikas, Prodromos Malakasiotis, Ioannis Partalas, Matthias Zschunke, Michael R Alvers, Dirk Weissenborn, Anastasia Krithara, Sergios Petridis, Dimitris Polychronopou- los, et al. 2015. An overview of the BIOASQ large- scale biomedical semantic indexing and question an- swering competition. BMC bioinformatics 16(1):1. Ozlem Uzuner, Imre Solti, and Eithon Cadag. 2010a. Extracting medication information from clinical text. Journal of the American Medical Informatics Asso- ciation 17(5):514–518. Ozlem Uzuner, Imre Solti, Fei Xia, and Eithon Cadag. 2010b. Community annotation experiment for ground truth generation for the i2b2 medication chal- lenge. Journal of the American Medical Informatics Association 17(5):519–523. Andreas Vlachos and Caroline Gasperin. 2006. Boot- strapping and evaluating named entity recognition in the biomedical domain. In Proceedings of the HLT- NAACL BioNLP Workshop on Linking Natural Lan- guage and Biology. Association for Computational Linguistics, pages 138–145. Chih-Hsuan Wei, Yifan Peng, Robert Leaman, Al- lan Peter Davis, Carolyn J Mattingly, Jiao Li, Thomas C Wiegers, and Zhiyong Lu. 2015. Overview of the biocreative v chemical disease rela- In Proceedings of the fifth BioCre- tion (cdr) task. ative challenge evaluation workshop. pages 154– 166. Patricia L Whetzel, Natalya F Noy, Nigam H Shah, Paul R Alexander, Csongor Nyulas, Tania Tudo- rache, and Mark A Musen. 2011. Bioportal: en- hanced functionality via new web services from the national center for biomedical ontology to access and use ontologies in software applications. Nucleic acids research 39(suppl 2):W541–W545. 8 Appendix 8.1 Materials Feature Library: Our CRF models use feature templates defined over the mention and it's parent dependency parse tree. Features includes context window features, part of speech tags, word shape, word embeddings, character n-grams, morphology, domain dictionary membership, and the lemma- tized form of a mention's dependency tree parent word. We expand in-document abbreviations, shar- ing features across any identical mention linked within a document by a parenthetical mention. 8.2 Results Candidate Generation Precision/Recall Curves: Figure 6 shows the precision-recall curves of can- didate generation methods in detail. Note how domain-engineered matchers suffer recall prob- lems, only generalizing a small amount beyond dictionaries and missing 20% of all mentions. Figure 6: Precision-recall curves for candidate generation methods, evaluated on CDR Disease. Phrases of length <=4 capture 96% of all men- tions. Multinomial Generative Model: Figure 7 shows the performance difference between the multinomial and binary generative models when sampled data is used to train noise-aware implementations of a CRF and logistic regression. We see the multinomial CRF model performs best overall for all choices of k-gram. For sequence models, k=6 scored best. Model CRF CRF/emb LSTM-CRF LSTM-CRF/emb CDR (Disease) +1k 75.6 75.5 71.0 77.3 +10k +100k 76.8 78.0 78.4 77.1 77.9 75.9 79.1 78.9 500 73.1 75.8 68.4 76.0 Table 5: CDR-Disease scale-up using NounPhrase candidates and extended labeling functions. Model CRF CRF/emb LSTM-CRF LSTM-CRF/emb CDR (Chemical) 500 87.5 86.7 78.5 85.8 +1k 88.0 87.7 79.3 87.4 +10k +25k 87.2 88.1 87.2 87.9 82.3 85.1 88.3 87.8 Table 6: CDR-Chemical scale-up using Noun- Phrase candidates. Scaling: Tables 5 and 6 show some of the ben- efits of scale, where we see gains of up to 3.1 F1 points, or 7.6 point improvement over majority vote. Scale-up improvements were smaller in our other tasks, but still beating majority vote in all systems using automatic feature extraction. Figure 7: F1 scores of the multinomial and binary generative models at different k-gram lengths. 0.00.20.40.60.81.00.00.20.40.60.81.0Hand-tunedDictionaryNoun PhrasesPrecisionRecall1234560.500.550.600.650.700.750.80Multinomial/CRFBinary/CRFBinary/LogRegF1 ScoreK-Grams
1704.06936
1
1704
2017-04-23T15:16:53
A* CCG Parsing with a Supertag and Dependency Factored Model
[ "cs.CL" ]
We propose a new A* CCG parsing model in which the probability of a tree is decomposed into factors of CCG categories and its syntactic dependencies both defined on bi-directional LSTMs. Our factored model allows the precomputation of all probabilities and runs very efficiently, while modeling sentence structures explicitly via dependencies. Our model achieves the state-of-the-art results on English and Japanese CCG parsing.
cs.CL
cs
A* CCG Parsing with a Supertag and Dependency Factored Model Masashi Yoshikawa and Hiroshi Noji and Yuji Matsumoto Graduate School of Information and Science Nara Institute of Science and Technology 8916-5, Takayama, Ikoma, Nara, 630-0192, Japan { masashi.yoshikawa.yh8, noji, matsu }@is.naist.jp 7 1 0 2 r p A 3 2 ] L C . s c [ 1 v 6 3 9 6 0 . 4 0 7 1 : v i X r a Abstract We propose a new A* CCG parsing model in which the probability of a tree is decom- posed into factors of CCG categories and its syntactic dependencies both defined on bi-directional LSTMs. Our factored model allows the precomputation of all probabil- ities and runs very efficiently, while mod- eling sentence structures explicitly via de- pendencies. Our model achieves the state- of-the-art results on English and Japanese CCG parsing.1 1 Introduction Supertagging in lexicalized grammar parsing is known as almost parsing (Bangalore and Joshi, 1999), in that each supertag is syntactically infor- mative and most ambiguities are resolved once a correct supertag is assigned to every word. Re- cently this property is effectively exploited in A* Combinatory Categorial Grammar (CCG; Steed- man (2000)) parsing (Lewis and Steedman, 2014; Lewis et al., 2016), in which the probability of a CCG tree y on a sentence x of length N is the product of the probabilities of supertags (cate- gories) ci (locally factored model): P (yx) = Yi∈[1,N ] Ptag(cix). (1) By not modeling every combinatory rule in a derivation, this formulation enables us to employ efficient A* search (see Section 2), which finds the most probable supertag sequence that can build a well-formed CCG tree. Although much ambiguity is resolved with this supertagging, some ambiguity still remains. Fig- ure 1 shows an example, where the two CCG 1 Our software and the pretrained models are available at: https://github.com/masashi-y/depccg. (a) a house in NP (NP \NP )/NP NP \NP NP (b) a house in NP (NP \NP )/NP Paris NP > < NP Paris NP in France (NP \NP )/NP NP NP \NP > < in France (NP \NP )/NP NP NP \NP NP > < > < NP \NP NP Figure 1: CCG trees that are equally likely under Eq. 1. Our model resolves this ambiguity by mod- eling the head of every word (dependencies). parses are derived from the same supertags. Lewis et al.'s approach to this problem is resorting to some deterministic rule. For example, Lewis et al. (2016) employ the attach low heuristics, which is motivated by the right-branching tendency of English, and always prioritizes (b) for this type of ambiguity. Though for English it empirically works well, an obvious limitation is that it does not always derive the correct parse; consider a phrase "a house in Paris with a garden", for which the correct parse has the structure corresponding to (a) instead. In this paper, we provide a way to resolve these remaining ambiguities under the locally factored model, by explicitly modeling bilexical dependen- cies as shown in Figure 1. Our joint model is still locally factored so that an efficient A* search can be applied. The key idea is to predict the head of every word independently as in Eq. 1 with a strong unigram model, for which we utilize the scoring model in the recent successful graph-based depen- dency parsing on LSTMs (Kiperwasser and Gold- berg, 2016; Dozat and Manning, 2016). Specif- ically, we extend the bi-directional LSTM (bi- LSTM) architecture of Lewis et al. (2016) predict- ing the supertag of a word to predict the head of it at the same time with a bilinear transformation. The importance of modeling structures beyond supertags is demonstrated in the performance gain in Lee et al. (2016), which adds a recursive com- ponent to the model of Eq. 1. Unfortunately, this formulation loses the efficiency of the original one since it needs to compute a recursive neural net- work every time it searches for a new node. Our model does not resort to the recursive networks while modeling tree structures via dependencies. We also extend the tri-training method of Lewis et al. (2016) to learn our model with dependen- cies from unlabeled data. On English CCGbank test data, our model with this technique achieves 88.8% and 94.0% in terms of labeled and unla- beled F1, which mark the best scores so far. Besides English, we provide experiments on Japanese employs freer Japanese CCG parsing. word order dominated by the case markers and a deterministic rule such as the attach low method may not work well. We show that this is actually the case; our method outperforms the simple ap- plication of Lewis et al. (2016) in a large margin, 10.0 points in terms of clause dependency accu- racy. 2 Background Our work is built on A* CCG parsing (Section 2.1), which we extend in Section 3 with a head prediction model on bi-LSTMs (Section 2.2). 2.1 Supertag-factored A* CCG Parsing CCG has a nice property that since every category is highly informative about attachment decisions, assigning it to every word (supertagging) resolves most of its syntactic structure. Lewis and Steed- man (2014) utilize this characteristics of the gram- mar. Let a CCG tree y be a list of categories hc1, . . . , cN i and a derivation on it. Their model looks for the most probable y given a sentence x of length N from the set Y (x) of possible CCG trees under the model of Eq. 1: y = arg max y∈Y (x) Xi∈[1,N ] log Ptag(cix). Since this score is factored into each supertag, they call the model a supertag-factored model. Exact inference of this problem is possible by A* parsing (Klein and D. Manning, 2003), which uses the following two scores on a chart: log Ptag(ckx), b(Ci,j) = Xck∈ci,j a(Ci,j) = Xk∈[1,N ]\[i,j] max ck log Ptag(ckx), where Ci,j is a chart item called an edge, which abstracts parses spanning interval [i, j] rooted by category C. The chart maps each edge to the derivation with the highest score, i.e., the Viterbi parse for Ci,j. ci,j is the sequence of categories on such Viterbi parse, and thus b is called the Viterbi inside score, while a is the approximation (upper bound) of the Viterbi outside score. A* parsing is a kind of CKY chart parsing aug- mented with an agenda, a priority queue that keeps the edges to be explored. At every step it pops the edge e with the highest priority b(e) + a(e) and inserts that into the chart, and enqueue any edges that can be built by combining e with other edges in the chart. The algorithm terminates when an edge C1,N is popped from the agenda. A* search for this model is quite efficient be- cause both b and a can be obtained from the uni- gram category distribution on every word, which can be precomputed before search. The heuris- tics a gives an upper bound on the true Viterbi outside score (i.e., admissible). Along with this the condition that the inside score never increases by expansion (monotonicity) guarantees that the first found derivation on C1,N is always optimal. a(Ci,j) matches the true outside score if the one- best category assignments on the outside words (arg maxck log Ptag(ckx)) can comprise a well- formed tree with Ci,j, which is generally not true. Scoring model For modeling Ptag , Lewis and Steedman (2014) use a log-linear model with fea- tures from a fixed window context. Lewis et al. (2016) extend this with bi-LSTMs, which encode the complete sentence and capture the long range syntactic information. We base our model on this bi-LSTM architecture, and extend it to modeling a head word at the same time. Attachment ambiguity In A* search, an edge with the highest priority b + a is searched first, but as shown in Figure 1 the same categories (with the same priority) may sometimes derive more than one tree. In Lewis and Steedman (2014), they pri- oritize the parse with longer dependencies, which they judge with a conversion rule from a CCG tree to a dependency tree (Section 4). Lewis et al. (2016) employ another heuristics prioritizing low attachments of constituencies, but inevitably these heuristics cannot be flawless in any situations. We provide a simple solution to this problem by ex- plicitly modeling bilexical dependencies. 2.2 Bi-LSTM Dependency Parsing For modeling dependencies, we borrow the idea from the recent graph-based neural dependency parsing (Kiperwasser and Goldberg, 2016; Dozat and Manning, 2016) in which each dependency arc is scored directly on the outputs of bi-LSTMs. Though the model is first-order, bi-LSTMs enable conditioning on the entire sentence and lead to the state-of-the-art performance. Note that this mech- anism is similar to modeling of the supertag distri- bution discussed above, in that for each word the distribution of the head choice is unigram and can be precomputed. As we will see this keeps our joint model still locally factored and A* search tractable. For score calculation, we use an ex- tended bilinear transformation by Dozat and Man- ning (2016) that models the prior headness of each token as well, which they call biaffine. 3 Proposed Method 3.1 A* parsing with Supertag and Dependency Factored Model We define a CCG tree y for a sentence x = hxi, . . . , xN i as a triplet of a list of CCG cat- egories c = hc1, . . . , cN i, dependencies h = hh1, . . . , hN i, and the derivation, where hi is the head index of xi. Our model is defined as follows: P (yx) = Yi∈[1,N ] Ptag(cix) Yi∈[1,N ] Pdep(hix). (2) The added term Pdep is a unigram distribution of the head choice. A* search is still tractable under this model. The search problem is changed as: y = arg max y∈Y (x) Xi∈[1,N ] + Xi∈[1,N ] log Ptag(cix) log Pdep(hix)!, Figure 2: Viterbi inside score for edge e3 under our model is the sum of those of e1 and e2 and the score of dependency arc going from the head of e2 to that of e1 (the head direction changes according to the child categories). and the inside score is given by: b(Ci,j) = Xck∈ci,j log Ptag(ckx) (3) + Xk∈[i,j]\{root(hC i,j)} log Pdep(hkx), where hC i,j is a dependency subtree for the Viterbi parse on Ci,j and root(h) returns the root index. We exclude the head score for the subtree root to- ken since it cannot be resolved inside [i, j]. This causes the mismatch between the goal inside score b(C1,N ) and the true model score (log of Eq. 2), which we adjust by adding a special unary rule that is always applied to the popped goal edge C1,N . We can calculate the dependency terms in Eq. 3 on the fly when expanding the chart. Let the cur- rently popped edge be Ai,k, which will be com- bined with Bk,j into Ci,j. The key observation is that only one dependency arc (between root(hA i,k) and root(hB k,j)) is resolved at every combination (see Figure 2). For every rule C → A B we can define the head direction (see Section 4) and Pdep is obtained accordingly. For example, when the right child B becomes the head, b(Ci,j) = b(Ai,k) + b(Bk,j) + log Pdep(hl = mx), where l = root(hA i,k) and m = root(hB k,j) (l < m). The Viterbi outside score is changed as: a(Ci,j) = Xk∈[1,N ]\[i,j] max ck log Ptag(ckx) + Xk∈L max hk log Pdep(hkx), where L = [1, N ] \ [k′k′ ∈ [i, j], root(hC i,j ) 6= k′]. We regard root(hC i,j) as an outside word since its head is undefined yet. For every outside word we independently assign the weight of its argmax head, which may not comprise a well-formed de- pendency tree. We initialize the agenda by adding an item for every supertag C and word xi with the score a(Ci,i) = Pk∈I\{i} max log Ptag(ckx) + Pk∈I max log Pdep(hkx). Note that the depen- dency component of it is the same for every word. 3.2 Network Architecture Following Lewis et al. (2016) and Dozat and Man- ning (2016), we model Ptag and Pdep using bi- LSTMs for exploiting the entire sentence to cap- ture the long range phenomena. See Figure 3 for the overall network architecture, where Ptag and Pdep share the common bi-LSTM hidden vectors. First we map every word xi to their hidden vec- tor ri with bi-LSTMs. The input to the LSTMs is word embeddings, which we describe in Sec- tion 6. We add special start and end tokens to each sentence with the trainable parameters following Lewis et al. (2016). For Pdep, we use the biaffine transformation in Dozat and Manning (2016): i = M LP dep gdep gdep = M LP dep hi child(ri), head(rhi), Pdep(hix) (4) ∝ exp((gdep i )TWdepgdep hi + wdepgdep hi ), where M LP is a multilayered perceptron. Though Lewis et al. (2016) simply use an MLP for mapping ri to Ptag, we additionally utilize the hidden vector of the most probable head hi = Pdep(h′ arg maxh′ ix), and apply ri and rhi to a bilinear function:2 i gtag i = M LP tag = M LP tag gtag hi child(ri), head(rhi), (5) ℓ = (gtag i )TUtaggtag hi + Wtag"gtag hi # + btag, i gtag Ptag(cix) ∝ exp(ℓc), where Utag is a third order tensor. As in Lewis et al. these values can be precomputed before search, which makes our A* parsing quite efficient. 4 CCG to Dependency Conversion (cid:1)(cid:5)(cid:6)(cid:7) (cid:1) (cid:2)(cid:3)(cid:4) .. S NP S/S .. .. x1 x2 x3 .. (cid:1)(cid:2)(cid:3)(cid:2)(cid:4)(cid:5)(cid:6)(cid:7) (cid:1)(cid:2)(cid:6)(cid:8)(cid:4)(cid:5) (cid:1)(cid:2)(cid:3)(cid:1)(cid:4)(cid:5) (cid:2) (cid:1) (cid:1)(cid:2)(cid:3)(cid:1)(cid:4)(cid:5) (cid:2) (cid:2) (cid:1)(cid:2)(cid:3)(cid:1)(cid:4)(cid:5) (cid:2) (cid:3) (cid:1)(cid:2)(cid:3)(cid:1)(cid:4)(cid:5) (cid:2) (cid:4) (cid:1)(cid:2)(cid:3)(cid:4) (cid:1)(cid:2)(cid:3)(cid:4) (cid:1)(cid:2)(cid:3)(cid:4) (cid:1)(cid:2)(cid:3)(cid:4) (cid:1)(cid:2)(cid:3)(cid:4) (cid:1)(cid:2)(cid:3)(cid:4) (cid:1)(cid:2)(cid:3)(cid:4) (cid:1)(cid:2)(cid:3)(cid:4) (cid:1) (cid:1)(cid:1) (cid:1)(cid:2) (cid:1) (cid:3) (cid:1) (cid:1)(cid:4) Figure 3: Neural networks of our supertag and dependency factored model. First we map every word xi to a hidden vector ri by bi-LSTMs, and then apply biaffine (Eq. 4) and bilinear (Eq. 5) transformations to obtain the distributions of de- pendency heads (Pdep) and supertags (Ptag). poses: 1) creation of the training data for the de- pendency component of our model; and 2) extrac- tion of a dependency arc at each combinatory rule during A* search (Section 3.1). Lewis and Steed- man (2014) describe one way to extract dependen- cies from a CCG tree (LEWISRULE). Below in addition to this we describe two simpler alterna- tives (HEADFIRST and HEADFINAL), and see the effects on parsing performance in our experiments (Section 6). See Figure 4 for the overview. LEWISRULE This is the same as the conversion rule in Lewis and Steedman (2014). As shown in Figure 4c the output looks a familiar English de- pendency tree. For forward application and (generalized) for- ward composition, we define the head to be the left argument of the combinatory rule, unless it matches either X/X or X/(X\Y ), in which case the right argument is the head. For example, on "Black Monday" in Figure 4a we choose Mon- day as the head of Black. For the backward rules, the conversions are defined as the reverse of the corresponding forward rules. For other rules, Re- movePunctuation (rp) chooses the non punctua- tion argument as the head, while Conjunction (Φ) chooses the right argument.3 Now we describe our conversion rules from a CCG tree to a dependency one, which we use in two pur- 2 This is inspired by the formulation of label prediction in Dozat and Manning (2016), which performs the best among other settings that remove or reverse the dependence between the head model and the supertag model. 3When applying LEWISRULE to Japanese, we ignore the feature values in determining the head argument, which we find often leads to a more natural dependency structure. For example, in "tabe ta" (eat PAST), the category of auxiliary verb "ta" is Sf1 \Sf2 with f1 6= f2, and thus Sf1 6= Sf2 . We choose "tabe" as the head in this case by removing the feature values, which makes the category X\X. No S /S , it was n′t Black Monday , NP (S \NP )/NP (S\NP )\(S\NP ) NP /NP NP (S \NP )/NP <B × S \NP NP S S S S (a) English sentence > > < rp > . . rp I Boku NP SUB wa NP \NP < NP English eigo NP ACC wo NP \NP < NP speak hanasi want tai (S \NP )\NP S \S <B2 (S \NP )\NP S \NP S S < < (b) Japanese sentence "I want to speak English." . . S \S < No , it was n't Black Monday . (c) LEWISRULE No , it was n't Black Monday . (d) HEADFIRST Boku wa eigo wo hanasi tai . (e) HEADFINAL Figure 4: Examples of applying conversion rules in Section 4 to English and Japanese sentences. One issue when applying this method for ob- taining the training data is that due to the mis- match between the rule set of our CCG parser, for which we follow Lewis and Steedman (2014), and the grammar in English CCGbank (Hockenmaier and Steedman, 2007) we cannot extract dependen- cies from some of annotated CCG trees.4 For this reason, we instead obtain the training data for this method from the original dependency annotations on CCGbank. Fortunately the dependency annota- tions of CCGbank matches LEWISRULE above in most cases and thus they can be a good approxi- mation to it. HEADFINAL Among SOV languages, Japanese is known as a strictly head final language, mean- ing that the head of every word always follows it. Japanese dependency parsing (Uchimoto et al., 1999; Kudo and Matsumoto, 2002) has exploited this property explicitly by only allowing left-to- right dependency arcs. Inspired by this tradition, we try a simple HEADFINAL rule in Japanese CCG parsing, in which we always select the right argument as the head. For example we obtain the head final dependency tree in Figure 4e from the Japanese CCG tree in Figure 4b. HEADFIRST We apply the similar idea as HEADFINAL into English. Since English has the opposite, SVO word order, we define the simple "head first" rule, in which the left argument always becomes the head (Figure 4d). 4 For example, the combinatory rules in Lewis and Steed- man (2014) do not contain Nconj → N N in CCGbank. Another difficulty is that in English CCGbank the name of each combinatory rule is not annotated explicitly. Though this conversion may look odd at first sight it also has some advantages over LEWIS- RULE. First, since the model with LEWISRULE is trained on the CCGbank dependencies, at infer- ence, occasionally the two components Pdep and Ptag cause some conflicts on their predictions. For example, the true Viterbi parse may have a lower score in terms of dependencies, in which case the parser slows down and may degrade the ac- curacy. HEADFIRST, in contract, does not suffer from such conflicts. Second, by fixing the direc- tion of arcs, the prediction of heads becomes eas- ier, meaning that the dependency predictions be- come more reliable. Later we show that this is in fact the case for existing dependency parsers (see Section 5), and in practice, we find that this simple conversion rule leads to the higher parsing scores than LEWISRULE on English (Section 6). 5 Tri-training We extend the existing tri-training method to our models and apply it to our English parsers. Tri-training is one of the semi-supervised meth- ods, in which the outputs of two parsers on un- labeled data are intersected to create (silver) new training data. This method is successfully applied to dependency parsing (Weiss et al., 2015) and CCG supertagging (Lewis et al., 2016). We simply combine the two previous ap- proaches. Lewis et al. (2016) obtain their sil- ver data annotated with the high quality supertags. Since they make this data publicly available 5, we obtain our silver data by assigning dependency 5https://github.com/uwnlp/taggerflow structures on top of them.6 We train two very different dependency parsers from the training data extracted from CCGbank Section 02-21. This training data differs depend- ing on our dependency conversion strategies (Sec- tion 4). For LEWISRULE, we extract the orig- inal dependency annotations of CCGbank. For HEADFIRST, we extract the head first dependen- cies from the CCG trees. Note that we cannot an- notate dependency labels so we assign a dummy "none" label to every arc. The first parser is graph-based RBGParser (Lei et al., 2014) with the default settings except that we train an unla- beled parser and use word embeddings of Turian et al. (2010). The second parser is transition-based lstm-parser (Dyer et al., 2015) with the de- fault parameters. On the development set (Section 00), with LEWISRULE dependencies RBGParser shows 93.8% unlabeled attachment score while that of lstm-parser is 92.5% using gold POS tags. the parsers with HEADFIRST de- Interestingly, pendencies achieve higher scores: 94.9% by RBGParser and 94.6% by lstm-parser, sug- gesting that HEADFIRST dependencies are easier to parse. For both dependencies, we obtain more than 1.7 million sentences on which two parsers agree. Following Lewis et al. (2016), we include 15 copies of CCGbank training set when using these silver data. Also to make effects of the tri-train samples smaller we multiply their loss by 0.4. 6 Experiments We perform experiments on English and Japanese CCGbanks. 6.1 English Experimental Settings We follow the standard data splits and use Sections 02-21 for training, Section 00 for development, and Section 23 for final evaluation. We report la- beled and unlabeled F1 of the extracted CCG se- mantic dependencies obtained using generate program supplied with C&C parser. For our models, we adopt the pruning strate- gies in Lewis and Steedman (2014) and allow at most 50 categories per word, use a variable-width beam with β = 0.00001, and utilize a tag dictio- nary, which maps frequent words to the possible 6We annotate POS tags on this data using Stanford POS tagger (Toutanova et al., 2003). supertags7. Unless otherwise stated, we only al- low normal form parses (Eisner, 1996; Hocken- maier and Bisk, 2010), choosing the same subset of the constraints as Lewis and Steedman (2014). We use as word representation the concatena- tion of word vectors initialized to GloVe8 (Pen- nington et al., 2014), and randomly initialized pre- fix and suffix vectors of the length 1 to 4, which is inspired by Lewis et al. (2016). All affixes ap- pearing less than two times in the training data are mapped to "UNK". child, M LP dep Other model configurations are: 4-layer bi- LSTMs with left and right 300-dimensional LSTMs, 1-layer 100-dimensional MLPs with ELU non-linearity (Clevert et al., 2015) for all M LP dep child and M LP tag head, and the Adam optimizer with β1 = 0.9, β2 = 0.9, L2 norm (1e−6), and learning rate decay with the ratio 0.75 for every 2,500 iteration starting from 2e−3, which is shown to be effective for training the biaffine parser (Dozat and Manning, 2016). head, M LP tag 6.2 Japanese Experimental Settings We follow the default train/dev/test splits of Japanese CCGbank (Uematsu et al., 2013). For the baselines, we use an existing shift-reduce CCG parser implemented in an NLP tool Jigg9 (Noji and Miyao, 2016), and our implementation of the supertag-factored model using bi-LSTMs. For Japanese, we use as word representation the concatenation of word vectors initialized to Japanese Wikipedia Entity Vector10, and 100- dimensional vectors computed from randomly initialized 50-dimensional character embeddings through convolution (dos Santos and Zadrozny, 2014). We do not use affix vectors as affixes are less informative in Japanese. All characters ap- pearing less than two times are mapped to "UNK". We use the same parameter settings as English for bi-LSTMs, MLPs, and optimization. One issue in Japanese experiments is evalua- tion. The Japanese CCGbank is encoded in a dif- ferent format than the English bank, and no stan- dalone script for extracting semantic dependen- cies is available yet. For this reason, we evaluate the parser outputs by converting them to bunsetsu 7We use the same tag dictionary provided with their bi- LSTM model. 8http://nlp.stanford.edu/projects/glove/ 9https://github.com/mynlp/jigg 10 http://www.cl.ecei.tohoku.ac.jp/ m-suzuki/jawiki vector/ Method Labeled Unlabeled Method Labeled Unlabeled CCGbank LEWISRULE w/o dep LEWISRULE HEADFIRST w/o dep HEADFIRST Tri-training LEWISRULE HEADFIRST 85.8 86.0 85.6 86.6 86.9 87.6 91.7 92.5 91.6 92.8 93.0 93.3 CCGbank C&C (Clark and Curran, 2007) w/ LSTMs (Vaswani et al., 2016) EasySRL (Lewis et al., 2016) EasySRL reimpl HEADFIRST w/o NF (Ours) Tri-training EasySRL (Lewis et al., 2016) neuralccg (Lee et al., 2016) HEADFIRST w/o NF (Ours) 85.5 88.3 87.2 86.8 87.7 88.0 88.7 88.8 91.7 - - 92.3 93.4 92.9 93.7 94.0 Table 1: Parsing results (F1) on English develop- ment set. "w/o dep" means that the model discards dependency components at prediction. Table 3: Parsing results (F1) on English test set (Section 23). Method Labeled Unlabeled # violations CCGbank LEWISRULE w/o dep LEWISRULE HEADFIRST w/o dep HEADFIRST Tri-training LEWISRULE HEADFIRST 85.8 85.4 85.6 86.8 86.7 87.7 91.7 92.2 91.6 93.0 92.8 93.5 2732 283 2773 89 253 66 Table 2: Parsing results (F1) on English develop- ment set when excluding the normal form con- straints. # violations is the number of combina- tions violating the constraints on the outputs. the syntactic representation ordi- dependencies, nary used in Japanese NLP (Kudo and Matsumoto, 2002). Given a CCG tree, we obtain this by first segment a sentence into bunsetsu (chunks) using CaboCha11 and extract dependencies that cross a bunsetsu boundary after obtaining the word-level, head final dependencies as in Figure 4b. For ex- ample, the sentence in Figure 4e is segmented as "Boku wa eigo wo hanashi tai", from which we extract two dependencies (Boku wa) ← (hanashi tai) and (eigo wo) ← (hanashi tai). We perform this conversion for both gold and output CCG trees and calculate the (unlabeled) attachment accuracy. Though this is imperfect, it can detect important parse errors such as attachment errors and thus can be a good proxy for the performance as a CCG parser. 6.3 English Parsing Results Effect of Dependency We first see how the de- pendency components added in our model affect the performance. Table 1 shows the results on the development set with the several configurations, in which "w/o dep" means discarding the depen- 11http://taku910.github.io/cabocha/ dency terms of the model and applying the attach low heuristics (Section 1) instead (i.e., a supertag- factored model; Section 2.1). We can see that for both LEWISRULE and HEADFIRST, adding de- pendency terms improves the performance. Choice of Dependency Conversion Rule To our surprise, our simple HEADFIRST strategy al- ways leads to better results than the linguistically motivated LEWISRULE. The absolute improve- ments by tri-training are equally large (about 1.0 points), suggesting that our model with dependen- cies can also benefit from the silver data. Excluding Normal Form Constraints One ad- vantage of HEADFIRST is that the direction of arcs is always right, making the structures sim- pler and more parsable (Section 5). From another viewpoint, this fixed direction means that the con- stituent structure behind a (head first) dependency tree is unique. Since the constituent structures of CCGbank trees basically follow the normal form (NF), we hypothesize that the model learned with HEADFIRST has an ability to force the outputs in NF automatically. We summarize the results with- out the NF constraints in Table 2, which shows that the above argument is correct; the number of violating NF rules on the outputs of HEAD- FIRST is much smaller than that of LEWISRULE (89 vs. 283). Interestingly the scores of HEAD- FIRST slightly increase from the models with NF (e.g., 86.8 vs. 86.6 for CCGbank), suggesting that the NF constraints hinder the search of HEAD- FIRST models occasionally. Results on Test Set Parsing results on the test set (Section 23) are shown in Table 3, where we compare our best performing HEADFIRST depen- dency model without NF constraints with the sev- eral existing parsers. In the CCGbank experi- EasySRL reimpl neuralccg Tagging A* Search Total 24.8 185.2 21.9 21.7 16.7 9.33 Ours 16.6 114.6 14.5 Table 4: Results of the efficiency experiment, where each number is the number of sentences processed per second. We compare our proposed parser against neuralccg and our reimplemen- tation of EasySRL. ment, our parser shows the better result than all the baseline parsers except C&C with an LSTM supertagger (Vaswani et al., 2016). Our parser outperforms EasySRL by 0.5% and our reimple- mentation of that parser (EasySRL reimpl) by 0.9% in terms of labeled F1. In the tri-training experiment, our parser shows much increased per- formance of 88.8% labeled F1 and 94.0% unla- beled F1, outperforming the current state-of-the- art neuralccg (Lee et al., 2016) that uses recur- sive neural networks by 0.1 point and 0.3 point in terms of labeled and unlabeled F1. This is the best reported F1 in English CCG parsing. Efficiency Comparison We compare the ef- ficiency of our parser with neuralccg and EasySRL reimpl.12 The results are shown in Table 4. For the overall speed (the third row), our parser is faster than neuralccg al- though lags behind EasySRL reimpl. Inspect- ing the details, our supertagger runs slower than those of neuralccg and EasySRL reimpl, while in A* search our parser processes over 7 times more sentences than neuralccg. The delay in supertagging can be attributed to sev- eral factors, in particular the differences in net- work architectures including the number of bi- LSTM layers (4 vs. 2) and the use of bilin- ear transformation instead of linear one. There are also many implementation differences in our parser (C++ A* parser with neural network model implemented with Chainer (Tokui et al., 2015)) and neuralccg (Java parser with C++ Tensor- Flow (Abadi et al., 2015) supertagger and recur- sive neural model in C++ DyNet (Neubig et al., 2017)). 6.4 Japanese Parsing Result We show the results of the Japanese parsing exper- iment in Table 5. The simple application of Lewis 12This experiment is performed on a laptop with 4-thread 2.0 GHz CPU. Method Category Bunsetsu Dep. Noji and Miyao (2016) Supertag model LEWISRULE (Ours) HEADFINAL (Ours) 93.0 93.7 93.8 94.1 87.5 81.5 90.8 91.5 Table 5: Results of Japanese CCGbank. Yesterday Kinoo S /S buy−PAST curry−ACC eat−PAST tabe − ta karee − wo kat − ta S NP S \NP S NP /NP > un NP S > < Yesterday Kinoo S /S buy−PAST curry−ACC eat−PAST tabe − ta karee − wo kat − ta NP S \NP S un NP /NP > S NP S < > Figure 5: Examples of ambiguous Japanese sen- tence given fixed supertags. The English transla- tion is "I ate the curry I bought yesterday". et al. (2016) (Supertag model) is not effective for Japanese, showing the lowest attachment score of 81.5%. We observe a performance boost with our method, especially with HEADFINAL dependen- cies, which outperforms the baseline shift-reduce parser by 1.1 points on category assignments and 4.0 points on bunsetsu dependencies. The degraded results of the simple application of the supertag-factored model can be attributed to the fact that the structure of a Japanese sentence is still highly ambiguous given the supertags (Fig- ure 5). This is particularly the case in construc- tions where phrasal adverbial/adnominal modi- fiers (with the supertag S/S) are involved. The result suggests the importance of modeling depen- dencies in some languages, at least Japanese. 7 Related Work There is some past work that utilizes dependencies in lexicalized grammar parsing, which we review briefly here. For Head-driven Phrase Structure Gram- mar (HPSG; Pollard and Sag (1994)), there are studies to use the predicted dependency structure to improve HPSG parsing accuracy. Sagae et al. (2007) use dependencies to constrain the form of the output tree. As in our method, for every rule (schema) application they define which child becomes the head and impose a soft constraint that these dependencies agree with the output of the dependency parser. Our method is different is optimal in that we do not use the one-best dependency structure alone, but rather we search for a CCG tree that in terms of dependencies and CCG supertags. Zhang et al. (2010) use the syntactic dependencies in a different way, and show that dependency-based features are useful for predicting HPSG supertags. In the CCG parsing literature, some work op- timizes a dependency model, instead of supertags or a derivation (Clark and Curran, 2007; Xu et al., 2014). This approach is reasonable given that the objective matches the evaluation metric. Instead of modeling dependencies alone, our method finds a CCG derivation that has a higher dependency score. Lewis et al. (2015) present a joint model of CCG parsing and semantic role labeling (SRL), which is closely related to our approach. They map each CCG semantic dependency to an SRL relation, for which they give the A* upper bound by the score from a predicate to the most proba- ble argument. Our approach is similar; the largest difference is that we instead model syntactic de- pendencies from each token to its head, and this is the key to our success. Since dependency parsing can be formulated as independent head selections similar to tagging, we can build the entire model on LSTMs to exploit features from the whole sen- tence. This formulation is not straightforward in the case of multi-headed semantic dependencies in their model. 8 Conclusion We have presented a new A* CCG parsing method, in which the probability of a CCG tree is decomposed into local factors of the CCG cat- egories and its dependency structure. By explic- itly modeling the dependency structure, we do not require any deterministic heuristics to resolve at- tachment ambiguities, and keep the model locally factored so that all the probabilities can be pre- computed before running the search. Our parser efficiently finds the optimal parse and achieves the state-of-the-art performance in both English and Japanese parsing. Acknowledgments We are grateful to Mike Lewis for answering our questions and your Github repository from which we learned many things. We also thank Yuichiro Sawai for the faster LSTM implementa- tion. This work was in part supported by JSPS KAKENHI Grant Number 16H06981, and also by JST CREST Grant Number JPMJCR1301. References Mart´ın Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Cor- rado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Man´e, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Tal- war, Paul Tucker, Vincent Vanhoucke, Vijay Va- sudevan, Fernanda Vi´egas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan TensorFlow: Yu, and Xiaoqiang Zheng. 2015. Large-Scale Machine Learning on Heterogeneous Systems. Software available from tensorflow.org. http://tensorflow.org/. Srinivas Bangalore and Aravind K Joshi. 1999. Su- pertagging: An Approach to Almost Parsing. Com- putational linguistics 25(2):237–265. Stephen Clark and James R. Curran. 2007. Wide– Coverage Efficient Statistical Parsing with CCG and Log-Linear Models. Computational Lin- guistics, Volume 33, Number 4, December 2007 http://aclweb.org/anthology/J07-4004. Djork-Arn´e Clevert, Thomas Unterthiner, and Fast and Accurate Sepp Hochreiter. 2015. Deep Network Learning by Exponential Lin- CoRR abs/1511.07289. ear Units http://arxiv.org/abs/1511.07289. (ELUs). C´ıcero Nogueira dos Santos and Bianca Zadrozny. 2014. Learning Character-level Representations for Part-of-Speech Tagging. ICML. Timothy Dozat and Christopher D. Manning. Deep Biaffine Attention for Neural CoRR abs/1611.01734. 2016. Dependency Parsing. http://arxiv.org/abs/1611.01734. Chris Dyer, Miguel Ballesteros, Wang Ling, Austin Transi- Matthews, and A. Noah Smith. 2015. tion-Based Dependency Parsing with Stack Long Short-Term Memory. the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th Interna- tional Joint Conference on Natural Language Pro- cessing (Volume 1: Long Papers). Association for Computational Linguistics, pages 334–343. https://doi.org/10.3115/v1/P15-1033. In Proceedings of Jason Eisner. 1996. Efficient Normal-Form Parsing for Combinatory Categorial Grammar. In 34th Annual Meeting of the Association for Computational Lin- guistics. http://aclweb.org/anthology/P96-1011. Julia Hockenmaier and Yonatan Bisk. 2010. Normal– form parsing for Combinatory Categorial Grammars with generalized composition and type-raising. In Proceedings of the 23rd International Conference on Computational Linguistics (Coling 2010). Col- ing 2010 Organizing Committee, pages 465–473. http://aclweb.org/anthology/C10-1053. Julia Hockenmaier and Mark Steedman. 2007. CCG- bank: A Corpus of CCG Derivations and Depen- dency Structures Extracted from the Penn Tree- bank. Computational Linguistics 33(3):355–396. http://www.aclweb.org/anthology/J07-3004. and Accurate Dependency Eliyahu Kiperwasser and Yoav Goldberg. 2016. Parsing Simple Using Bidirectional LSTM Feature Repre- sentations. the Association 4:313–327. for https://www.transacl.org/ojs/index.php/tacl/article/view/885. Transactions of Computational Linguistics Mike Lewis and Mark Steedman. 2014. A* CCG Pars- ing with a Supertag-factored Model. In Proceed- ings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP). Asso- ciation for Computational Linguistics, pages 990– 1000. https://doi.org/10.3115/v1/D14-1107. Graham Neubig, Chris Dyer, Yoav Goldberg, Austin Matthews, Waleed Ammar, Antonios Anastasopou- los, Miguel Ballesteros, David Chiang, Daniel Clothiaux, Trevor Cohn, Kevin Duh, Manaal Faruqui, Cynthia Gan, Dan Garrette, Yangfeng Ji, Lingpeng Kong, Adhiguna Kuncoro, Gaurav Ku- mar, Chaitanya Malaviya, Paul Michel, Yusuke Oda, Matthew Richardson, Naomi Saphra, Swabha Swayamdipta, and Pengcheng Yin. 2017. DyNet: The Dynamic Neural Network Toolkit. arXiv preprint arXiv:1701.03980 . Dan Klein and Christopher D. Manning. 2003. A* Parsing: Fast Exact Viterbi Parse Selection. In Proceedings of the 2003 Human Language Tech- nology Conference of the North American Chapter of the Association for Computational Linguistics. http://aclweb.org/anthology/N03-1016. Taku Kudo and Yuji Matsumoto. 2002. Japanese Dependency Analysis using Cascaded Chunking. In Proceedings of the 6th Conference on Natural Language Learning, CoNLL 2002, Held in coop- eration with COLING 2002, Taipei, Taiwan, 2002. http://aclweb.org/anthology/W/W02/W02-2016.pdf. Kenton Lee, Mike Lewis, and Luke Zettlemoyer. Global Neural CCG Parsing with Op- 2016. timality Guarantees. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing. Association for Computational Linguistics, pages 2366–2376. http://aclweb.org/anthology/D16-1262. Tao Lei, Yu Xin, Yuan Zhang, Regina Barzilay, and Tommi Jaakkola. 2014. Low-Rank Ten- sors for Scoring Dependency Structures. In the 52nd Annual Meeting of Proceedings of the Association for Computational Linguis- tics (Volume 1: Long Papers). Association for Computational Linguistics, pages 1381–1391. https://doi.org/10.3115/v1/P14-1130. Mike Lewis, Luheng He, and Luke Zettlemoyer. 2015. Joint A* CCG Parsing and Semantic Role Labelling. In Proceedings of the 2015 Conference on Empiri- cal Methods in Natural Language Processing. Asso- ciation for Computational Linguistics, pages 1444– 1454. https://doi.org/10.18653/v1/D15-1169. LSTM CCG Parsing. the 2016 Conference of Mike Lewis, Kenton Lee, and Luke Zettlemoyer. In Proceedings 2016. of the North American Chapter of the Association for Computational Lin- guistics: Human Language Technologies. Associa- tion for Computational Linguistics, pages 221–231. https://doi.org/10.18653/v1/N16-1026. Hiroshi Noji and Yusuke Miyao. 2016. Jigg: A Framework for an Easy Natural Language Processing Pipeline. In Proceedings of ACL- 2016 System Demonstrations. Association for Computational pages 103–108. https://doi.org/10.18653/v1/P16-4018. 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. http://www.aclweb.org/anthology/D14-1162. Carl Pollard and Ivan A Sag. 1994. Head-driven phrase structure grammar. University of Chicago Press. Kenji Sagae, Yusuke Miyao, and Jun'ichi Tsujii. 2007. HPSG Parsing with Shallow Dependency Con- straints. In Proceedings of the 45th Annual Meeting of the Association of Computational Linguistics. As- sociation for Computational Linguistics, pages 624– 631. http://aclweb.org/anthology/P07-1079. Mark Steedman. 2000. The Syntactic Process. The MIT Press. Chainer: Seiya Tokui, Kenta Oono, Shohei Hido, and Justin Clayton. 2015. a Next-Gen- for Deep eration Open Source Framework Learning. In Proceedings of Workshop on in Machine Learning Systems The Twenty-ninth Annual Conference on Neu- (NIPS). ral http://learningsys.org/papers/LearningSys 2015 paper 33.pdf. Information Processing (LearningSys) Systems Kristina Toutanova, Dan Klein, Christopher D. Man- Feature-Rich ning, and Yoram Singer. 2003. a Cyclic De- Part-of-Speech Tagging with pendency Network. the 2003 Human Language Technology Confer- ence of the Linguistics. Association http://www.aclweb.org/anthology/N03-1033. the North American Chapter of In Proceedings of Computational for Joseph Turian, Lev-Arie Ratinov, and Yoshua Ben- gio. 2010. Word Representations: A Simple and General Method for Semi-Supervised Learning. In Proceedings of the 48th Annual Meeting of the As- sociation for Computational Linguistics. Associa- tion for Computational Linguistics, pages 384–394. http://aclweb.org/anthology/P10-1040. Kiyotaka Uchimoto, Satoshi Sekine, and Hitoshi Isahara. 1999. Japanese Dependency Structure Analysis Based on Maximum Entropy Models. In Ninth Conference of the European Chapter of the Association for Computational Linguistics. http://aclweb.org/anthology/E99-1026. Sumire Uematsu, Takuya Matsuzaki, Hiroki Hanaoka, Yusuke Miyao, and Hideki Mima. 2013. Inte- grating Multiple Dependency Corpora for Induc- ing Wide-coverage Japanese CCG Resources. In Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics (Vol- ume 1: Long Papers). Association for Compu- tational Linguistics, Sofia, Bulgaria, pages 1042– 1051. http://www.aclweb.org/anthology/P13-1103. Ashish Vaswani, Yonatan Bisk, Kenji Sagae, and Ryan Musa. 2016. Supertagging With LSTMs. In Pro- ceedings of the 2016 Conference of the North Amer- ican Chapter of the Association for Computational Linguistics: Human Language Technologies. Asso- ciation for Computational Linguistics, pages 232– 237. https://doi.org/10.18653/v1/N16-1027. David Weiss, Chris Alberti, Michael Collins, and Slav Petrov. 2015. Structured Training for Neu- ral Network Transition-Based Parsing. In Proceed- ings of the 53rd Annual Meeting of the Associa- tion for Computational Linguistics and the 7th In- ternational Joint Conference on Natural Language Processing (Volume 1: Long Papers). Associa- tion for Computational Linguistics, pages 323–333. https://doi.org/10.3115/v1/P15-1032. Wenduan Xu, Stephen Clark, and Yue Zhang. 2014. Shift-Reduce CCG Parsing with a Dependency Model. In Proceedings of the 52nd Annual Meet- ing of the Association for Computational Lin- guistics (Volume 1: Long Papers). Association for Computational Linguistics, pages 218–227. https://doi.org/10.3115/v1/P14-1021. Yao-zhong Zhang, Takuya Matsuzaki, and Jun'ichi Tsujii. 2010. A Simple Approach for HPSG Su- pertagging Using Dependency Information. In Hu- man Language Technologies: The 2010 Annual Conference of the North American Chapter of the Association for Computational Linguistics. Associ- ation for Computational Linguistics, pages 645–648. http://aclweb.org/anthology/N10-1090.
1911.03937
1
1911
2019-11-10T14:04:59
Language Model-Driven Unsupervised Neural Machine Translation
[ "cs.CL" ]
Unsupervised neural machine translation(NMT) is associated with noise and errors in synthetic data when executing vanilla back-translations. Here, we explicitly exploits language model(LM) to drive construction of an unsupervised NMT system. This features two steps. First, we initialize NMT models using synthetic data generated via temporary statistical machine translation(SMT). Second, unlike vanilla back-translation, we formulate a weight function, that scores synthetic data at each step of subsequent iterative training; this allows unsupervised training to an improved outcome. We present the detailed mathematical construction of our method. Experimental WMT2014 English-French, and WMT2016 English-German and English-Russian translation tasks revealed that our method outperforms the best prior systems by more than 3 BLEU points.
cs.CL
cs
Language Model-Driven Unsupervised Neural Machine Translation Wei Zhang1*, Youyuan Lin1*, Ruoran Ren1, Xiaodong Wang2, Zhenshuang Liang2, Zhen Huang2 1. Ocean University of China, 2. Global Tone Communication Technology Co., Ltd.(Qingdao) Abstract Unsupervised neural machine translation(NMT) is as- sociated with noise and errors in synthetic data when executing vanilla back-translations. Here, we explic- itly exploits language model(LM) to drive construction of an unsupervised NMT system. This features two steps. First, we initialize NMT models using synthetic data generated via temporary statistical machine trans- lation(SMT). Second, unlike vanilla back-translation, we formulate a weight function, that scores synthetic data at each step of subsequent iterative training; this allows unsupervised training to an improved outcome. We present the detailed mathematical construction of our method. Experimental WMT2014 English-French, and WMT2016 English-German and English-Russian translation tasks revealed that our method outperforms the best prior systems by more than 3 BLEU points. Introduction Neural machine translation (NMT) has made remark- able progress in recent years(Sutskever, Vinyals, and Le, 2014; Cho et al., 2014; Bahdanau, Cho, and Bengio, 2014; Vaswani et al., 2017). However, NMT systems exploit many parallel data, and perform less well than statistical machine translation(SMT) systems under resource-poor conditions(Koehn and Knowles, 2017). Thus, NMT op- timization for resource-poor environments has attracted a great deal of interest. Parallel corpora are costly, and may be resource-poor in terms of language pairs. Ef- forts are underway to use the more readily available monolingual corpora to improve NMT systems. One of the most effective methods is back-translation (Sennrich, Haddow, and Birch, 2015); a source-to-target translation system is trained using synthetic corpora gen- erated by a backward model. Iterative back-translation is also promising (Zhang et al., 2018; Hoang et al., 2018). Language models (LMs) may be of assistance. In the context of unsupervised NMT, some authors (Artetxe et al., 2017; Lample et al., 2017, 2018) have leveraged LMs by training a seq2seq system (Sutskever, Vinyals, and Le, 2014) to serve as a denoising auto-encoder (DAE) (Vincent et al., 2008). Finally, initialization is also of con- cern in the context of resource-poor NMT. Cross-lingual lexica derived from monolingual corpora are widely used to initialize unsupervised NMT systems (Artetxe et al., 2017; Lample et al., 2017). In summary, as Lample et al. (2018) have noted, research on resource-poor NMT focuses principally on: 1) back- translation; 2) use of an LM; and, 3) initialization. Here, we engage in LM-driven unsupervised construc- tion of an NMT system. Given source sentences, we aimed to estimate accurately the posterior distributions of target sentences. If resources are poor, we compro- mise; we train the NMT system (in an unsupervised manner) to estimate the marginal distributions of target sentences. We derive a weight function for synthetic data based on well-trained LMs and a translation model. However, given the lack of correction during training, convergence of an unsupervised NMT system depends heavily on the initial parameters. Therefore, we use data generated by an unsupervised SMT constructed with the aid of an LM, and cross-lingual embedding, to jump- start training without modifying the NMT architecture. Figure 1 shows the training process. Experiments using the WMT2014 and WMT2016 datasets showed that our unsupervised NMT system was comparable to that with the optimal baseline (Lam- ple et al., 2018) in terms of English-French tasks, and about 3 BLEU better on English-German and English- Russian tasks; we have raised the bar of state-of-the-art performance. * Equal contribution, Wei Zhang: [email protected], Youyuan Lin: [email protected] Our contributions are: 1. We show how an LM can drive construction of an unsupervised NMT system. Then, we use a weight function • to correct training without changing the NMT architecture; this is simple but effective. 2. We explore how the initial synthetic data influence convergence during training, and we then use an SMT • method to boost the quality of initial synthetic data. This is simple, rapid, and requires only off-the-shelf software. 3. We test the system using English-German, English- French, and English-Russian language pairs; our method is the best currently available. Figure 1: Framework of Language Model Driven Unsupervised Neural Machine Translation. Monolingual corpus of language X and Y are given. As prepared, we train two LMs, include their cross-lingual embeddings, with which we infer a phrase table. Based on these materials, data for initialization will be generated. Training process will jump- start whereby these initial synthetic data. After initialization iterative back-translation starts, we still use a backward model to sample candidate synthetic data. Different from vanilla back-translation, we weight synthetic data by translation model and both two LMs(indicated by thick blue lines). Background Iterative Back-translation for NMT NMT is currently favored. NMT features an attention- base encoder-decoder structure within a recurrent neural network (Bahdanau, Cho, and Bengio, 2014) or a transformer (Vaswani et al., 2017). Given a parallel corpus{(x (n) , y (n) )} N n=1, where N,(y (n) , x (n) ) denote the the size of the corpus and each pair of parallel sentences (respectively), an x → y NMT model directly maximize the conditional log-probability associated with the parameter θ, as follows: ℒ𝑝𝑎𝑟𝑎(𝜃) = 1 𝑁 𝑁 ∑ log 𝑃(𝑌(𝑛)𝑋(𝑛); 𝜃) 𝑛=1 (1) Training objective 1 cannot be achieved when only monolingual corpora {y (n)} N n=1 are available. Instead, iterative back-translation is used to sample x and then maximize the likelihood of the synthetic data (Zhang et al., 2018): ℒ𝑚𝑜𝑛𝑜(𝜃) = 1 𝑁 𝑁 ∑ ∑ 𝑃(𝑋𝑌(𝑛))log𝑃(𝑌(𝑛)𝑋; 𝜃) (2) 𝑋 𝑛=1 Such iterative back-translation uses a backward model P(xy; θback) to estimate the real posterior distribution P(xy (n) ); however, noise is introduced. Cross-lingual Word Embedding A word embedding is a continuous representation of words. Cross-lingual word embeddings share vector spaces across multiple languages, and are usually trained by deriving a rotation matrix M that maps source embedding onto target embedding (Conneau et al., 2017). Thus, the distances between cross-language embeddings can be calculated; these reveal candidate word-level translations. The translation probability from word xi to yj is: 𝑃(𝑦𝑖𝑥𝑖) = exp 𝜆 cos < 𝑒𝑥𝑖, 𝑒𝑦𝑗 > ∑ exp 𝜆 cos < 𝑒𝑥𝑖, 𝑒𝑦 > 𝑦 (3) where ew is the cross-lingual embedding of word w, and λ is a hyper-parameter controlling the peakiness of the distribution. We use the training/inferential methods of Artetxe, Labaka, and Agirre (2018) . Framework Overview Figure 1 illustrates the training flow, corresponding algorithm 1. For Language X and Y , we first train two LMs using large amounts of monolingual data. We then train the cross-lingual word embeddings and develop a phrase table. Next, we generate initial synthetic data using Eqs.17 and 18 and use the data to initialize the NMT system. We then commence iterative joint training; at each step, we weight the synthetic data for both LMs as indicated by Eq. 14. Algorithm 1: LM Driven US-NMT Input: Monolingual Corpus Mx for language X; Monolingual Corpus My for language Y. −→ θ , parameters of x → y NMT system; Output: ←− θ , parameters of y → x NMT system. Train LMx, LMy, Word Embedding Ex, Ey on Mx, My; Train Cross-lingual Embeddings Ecross on Ex, Ey; Infer Phrase Table T on Ecross; Epoch:=0; Randomly initialize −→ θ , ←− θ ; while Not converge do Randomly select sub dataset Dy,Dx from My, Mx; if Epoch = 0 then Generate pseudo sentences Fx, Fy by LMx, LMy, T on Dy, Dx; else Generate pseudo sentences Fx, Fy by ←− θ , −→ θ on Dy, Dx; Weight (Fx, Dy), (Fy, Dx) by Eq.15; end −→ θ , ←− θ on synthetic data (Fx, Dy), (Fy, Dx); Epoch = Epoch + 1; Train end −→ θ , ←− θ ; return Training objective In a typical machine-translation problem, given a source sentence x ∈ X , the goal is to find a high-scoring target sentence y ∈ Y; X , Y stand for the source space and target space. The score of each (x, y) pair is modeled by the probability that both sentences x and y will occur, denoted as P(x = x, y = y) (Lopez, 2008). If a perfect x → y translation system is available, P(x = x, y = y) = P(y = yx = x)P(x = x). Thus, we seek θ; this is the optimal parameter for an x → y NMT system that estimates P(yx) when: ^ 𝑃 (𝑋, 𝑌; 𝜃 ) = 𝑃(𝑋, 𝑌) (4) Where P(x, y; θ) stands for the joint probability calculated by an NMT system using the parameter θ. If only monolingual data are available in Y, θ is difficult to calculate using only 4. Hence, we impose a necessary condition: ^ 𝑃 (𝐱, 𝐲; 𝜃 ^ )) = 𝑃(𝐱, 𝐲) → ∑ 𝑃 (𝐱, 𝐲; 𝜃 )) = ∑ 𝑃(𝐱, 𝐲) ^ ↔ 𝑃 (𝐲; 𝜃 )) = 𝑃(𝐲) (5) 𝒳 𝒳 This means that the marginal distribution expressed by θ should be real when x is deemed as hidden variable. This is a compromise made to effectively train an unsupervised NMT system. As large amounts of monolingual data are available, it is possible to construct an LM that accurately estimates the real marginal distribution P(y). Thus, for the untutored θ values of an x → y NMT system, we deliberately narrow the gap between P(y) and P(y; θ): ℒ∗(𝜃) = −𝐾𝐿[𝑃(𝑌)𝑃(𝑌; 𝜃)] (6) where KL[P(y)P(y; θ)] is the Kullback -- Leibler divergence between two distributions. Discarding irrelevant terms, the loss-maximizing 6 becomes: arg 𝑚𝑎𝑥 ℒ∗(𝜃) 𝜃 = arg 𝑚𝑎𝑥 𝜃 ∑ 𝑃(𝐲) log 𝑃(𝐲; 𝜃) 𝒴 = arg 𝑚𝑎𝑥 ∑ 𝑃(𝐲) log ∑ 𝑃(𝐲𝐱; 𝜃)𝑃(𝐱) 𝜃 𝒴 𝒳 (7) Note that Eq. 7 includes the unobserved data x and the logarithm of summation, which is difficult to calculate. Thus, we use the EM algorithm to train θ in an iterative manner. Consider the loss between iteration i + 1 and i. ℒ∗(𝜃𝑖+1) − ℒ∗(𝜃𝑖) = ∑ 𝑃(𝐲) log∑ 𝑃(𝐲𝐱; 𝜃𝑖+1)𝑃(𝐱) 𝑃(𝐲; 𝜃𝑖) 𝒴 𝒳 (8) ≥ ∑ 𝑃(𝐲)∑ 𝑃(𝐱𝐲; 𝜃𝑖)log 𝑃(𝐲𝐱; 𝜃𝑖+1)𝑃(𝐱) 𝑃(𝐱𝐲; 𝜃𝑖)𝑃(𝐲; 𝜃𝑖) 𝒴 𝒳 Above, we apply Jensen's inequality when a y value is certain. The equality sign is valid when θ i+1 equals θ i . We define the evidence lower bound (ELBO) Hoffman et al. (2013) as: 𝐸𝐿𝐵𝑂(𝜃, 𝜃𝑖) = ∑ 𝑃(𝐲)∑ 𝑃(𝐱𝐲; 𝜃𝑖) log 𝑃(𝐲𝐱; 𝜃)𝑃(𝐱) 𝑃(𝐱𝐲; 𝜃𝑖) (9) 𝒴 𝒳 It is easy to show that L ∗ (θ) ≥ ELBO(θ, θi ) and L ∗ (θ i ) = ELBO(θ i , θi ). Thus, for an θ i+1 value satisfying ELBO(θ i+1, θi ) ≥ ELBO(θ i , θi ), we confirm: ℒ∗(𝜃𝑖+1) ≥ 𝐸𝐿𝐵𝑂(𝜃𝑖+1, 𝜃𝑖) ≥ 𝐸𝐿𝐵𝑂(𝜃𝑖, 𝜃𝑖) = ℒ∗(𝜃𝑖). Hence, we choose to maximize the ELBO of θ i+1; this is the M-step of the EM algorithm: 𝜃𝑖+1 = arg 𝑚𝑎𝑥 𝜃 𝐸𝐿𝐵𝑂(𝜃, 𝜃𝑖) We must calculate the following loss (this is the E-step of the EM algorithm): ℒ(𝜃, 𝜃𝑖) = ∑ 𝑃(𝐲) ∑ 𝑃(𝐱𝐲; 𝜃𝑖)log𝑃(𝐲𝐱; 𝜃) 𝒴 𝒳 = 𝔼𝐲∼𝑃(𝐲) [𝔼 𝐱∼𝑃(𝐱𝐲; 𝜃𝑖 ) log 𝑃(𝐲𝐱; 𝜃)] (10) (11) (12) A solution of Eq. 12 requires two sampling processes that generate training data for P(yx; θ); this approach approximates the integral over the X and Y space. First, we randomly sample monolingual target sentences. The second sampling can proceed in two ways: 1) Use of the Bayes rules: 𝐱𝑏𝑒𝑠𝑡 = = arg 𝑚𝑎𝑥 𝑃(𝐱𝐲; 𝜃𝑖) 𝐱 arg 𝑚𝑎𝑥 𝐱 𝑃(𝐲𝐱; 𝜃𝑖) 𝑃(𝐱) (13) If a strong LM for language x is available, it is poss ible to sample natural sentences. However, it is necessary to use an encoder to choose all words of x because x serves as a condition. The initial state of the decoder is changed by each candidate word in x. The computational load is very high; it is impossible to perform the beam search of a typical neural encoder-decoder. 2) Alternatively, vanilla back-translation uses P(xy; θ i back) directly, thus, not P(xy; θ i ), to minimize the computational load; θ i back is a parameter of the backward model.This method slightly compromises mathematical soundness, and may generate noise Poncelas et al. (2018). Weighting of synthetic data Given the high computational demand, and the noise issue, we combined the two methods mentioned above when engaging in the second sampling process. We heuristically leveraged the back-translation weights. Given the derived loss (Eq. 12), for each target sentence y, we tested all source sentences x, and assign them weights: 𝒲(𝐱, 𝐲; 𝜃𝑖) = = 𝑃(𝐲)𝑃(𝐱𝐲; 𝜃𝑖) 𝑃(𝐲) 𝑃(𝐱)𝑃(𝐲𝐱; 𝜃𝑖) 𝑃(𝐲; 𝜃𝑖) (14) Intuitively, strong LMs fine-tune the weights of synthetic data in two ways. For a target sentence y, if the current P(y; θ i ) is an overestimate of the probability, P(y)/P(y; θ i ) will be less than 1, and the weight of a sentence pair containing y will be reduced. If P(y; θ i ) is an underestimate of the probability, the weight will increase. Therefore, the modeled estimation inaccuracy of a target sentence y will be corrected. On the other hand, for a pseudo-source sentence x, P(x) is reliable when sampling, reducing the effects of unnatural sentences. Thus, we applied weighting; we relaxed the synthetic data generated by back-translation. We proceeded as follows: 1) Treating the decoder as an LM, we used P(y; θ i dec) to estimate P(y; θ i ). θ i dec a decoder parameter. Thus, we chose a dummy as the source sentence; this avoids the need to calculate P(y; θ i ) = P x P(yx; θ i )P(x). We followed (Ramachandran, Liu, and Le, 2016). 2) we normalize the logarithmic weight using the zeromean approach and then employed a sigmoid function to obtain the final weights: 𝒲∗(𝐱, 𝐲; 𝜃𝑖) = 𝑠𝑖𝑔𝑚𝑜𝑖𝑑 (𝑍𝑀(log 𝒲(𝐱, 𝐲; 𝜃𝑖))) (15) where ZM indicates zero-mean normalization. Sentence probability values are always separated by exponential gaps; training is dominated by a few highly weighted sentences. Normalization of logarithmic weights reduces the dominance of sentences with absolutely higher probabilities; the sigmoid function restricts the weights to within an appropriate interval (0, 1). Better Initial Posterior Inference Figure 2: Illustration of the result when set goal as Eq. 5. Left denote the real distribution. Right is a possible training result, whose marginal distribution is equivalent to real, however posterior distribution does not converge to real due to the unobservability of real posterior distribution (indicated by shadow area). Fortunately, thanks to accuracy at marginal distribution, the result has been subjected to the solution space of a group of linear equations. As Eq. 5 indicates, P(y; θ) = P(y) is only one necessary condition for attainment of fundamental goal Eq. 4. This simply constrains θ to a smaller space; θ satisfies: 𝑊𝜃𝑃𝐱 = 𝑃𝐲 (16) Where Wθ is a Y × X matrix defined by θ, denotes each P(yx; θ). Px, Py is the probability vector of each language. θ, the optimal parameters for an x → y NMT system, also satisfies Eq. 16. There is no guarantee that training of P(yx; θ f inal) will converge to real distribution. Depending on θ 0 , the initial parameters, P(yx; θ f inal) may converge relatively poorly (Figure 2). As the algorithm is sensitive to the initial value, it is important to carefully choose the initial parameters. As Koehn and Knowles (2017) showed, SMT performs better than NMT in resource-poor environments. Thus, we used a temporary SMT to generate the initial synthetic data. Employing the "Noisy Channel" approach (Shannon, 1948), we used a well-trained LM and cross-lingual embedding to correct the word order and word-level translation; this is reminiscent of an unsupervised phrase-based SMT (PBSMT) (Lample et al., 2018). Formally, we applied the Bayes rule: 𝐱𝑏𝑒𝑠𝑡 = = arg 𝑚𝑎𝑥 𝑃(𝐱𝐲; 𝜃0) 𝐱 arg 𝑚𝑎𝑥 𝐱 𝑃(𝐲𝐱; 𝜃0) 𝑃(𝐱) (17) Next, we employed a PBSMT(Zens, Och, and Ney, 2002) and Eq. 3 to decompose P(yx; θ 0 ) into: 𝑃(𝐲𝐱; 𝜃0) 𝑛 = ∏ 𝜙(𝑦𝑖𝑥𝑖) 𝑖=1 𝑛 =∏ 𝑖=0 (18) exp 𝜆 cos < 𝑒𝑥𝑖, 𝑒𝑦𝑖 > ∑ exp 𝜆 cos < 𝑒𝑥𝑖, 𝑒𝑦 > 𝑦 in which y is segmented into a sequence of unrelated phrases y1, y2, ..., yn via inferred phrase table. We assumed that the probability distribution was uniform over all possible segmentations. Next, P(yx; θ 0 ) was decomposed into a series of phrase translation probabilities φ(yi xi) calculated using Eq. 3. When applying the Bayes rule, the model may be perceived as log-linear in nature (Och and Ney, 2002), associated with certain artificial features such as grammatical rewards, unknown word and length penalties, and distortion scores. These complicate the issue. We added only an unknown word penalty and a distortion Koehn, Och, and Marcu (2003). Experiment Settings We evaluated our method using three language pairs: English-French, English-German, and English-Russian. We used the BLEU score (Papineni et al., 2002) to assess translation quality. Dataset All available sentences in the four languages available in NewsCrawl (a monolingual dataset of WMT) were used; these served as the baselines. We employed all available monolingual data when training the LMs. We randomly chose four monolingual source sentences per iteration for each language to generate synthetic data. The validation datasets were those of newstest2014(enfr) and newstest2016(en-de, en-ru); both include 3, 000 sentence pairs. Details All data were tokenized and true-cased using Moses (Koehn et al., 2007) and segmented into subword symbols with the aid of Byte-Pair Encoding (BPE) (Sennrich, Haddow, and Birch, 2016); the shared vocabulary size was 60, 000. We use a kenLM (Heafield, 2011) and Fast-Text software Bojanowski et al. (2017) to generate word embeddings of dimension 512. Following Lample et al. (2018), we set λ of Eq. 18 to 30, and employed Vecmap[https://github.com/artetxem/vecmap] to perform cross-lingual embedding. When inferring initial data using the PBSMT, we implemented the Moses unknown word penalty and distortion score defaults. We did not further tune the PBSMT. For each language pair, we trained two independent NMT models (one in either translation direction) employing[https://github.com/tensorflow/tensor2tensor] , and we utilized beam searching (beam size 4) to generate subsequent synthetic data; testing featured a beam size of 16. Baseline We compare our method to 7 baselines. The first baseline is supervised, train featured 0.6 million parallel sentences. The second baseline employs a twolanguage shared encoder based on a DAE (Artetxe et al., 2017). The third baseline features an additional adversarial training method(Lample et al., 2017). The fourth baseline introduces a weight- sharing mechanism to enhance performance (Yang et al., 2018). The final baselines (5 to 7) are the strongest (Lample et al., 2018). Baseline 5 uses a DAE to substitute for and re- order synthetic data. Baseline 6 trains an unsupervised PBSMT system. Baseline 7 uses synthetic data generated by a PBSMT to tune the NMT further. Unlike our method, baseline 7 first fully trains an unsupervised PBSMT system, and then tunes an NMT system. We used the data generated by the initial PBSMT as initialization inputs. Results Table 1 shows that our method allows our unsupervised NMT model to converge at higher BLEU scores (compared to those of prior baselines) in almost all of the six directions; performance is comparable to that of a supervised NMT model using 0.6 million parallel sentences. We performed several iterations; the detailed BLEU results are shown in Figure3. Further iterations afforded no additional improvements in BLEU scores. Some examples are shown in Table 3. On the English-French task, the initial performance was better than those of the other two tasks, but subsequent training of the NMT model was not associated with immediate attainment of the strongest baseline. English and French constitute a strongly related language pair; it is simple to construct a strong phrase table. Thus, an SMT model performed better than an NMT model given an English-French task (Lample et al., 2018). As shown by the fifth baseline, our method renders an NMT model comparable to an SMT model in terms of an English-French task. On the English-German and English-Russian tasks, our model significantly outperformed the previous best models by about 3 BLEU; thus, we define a new stateof-the-art standard. By appropriately weighting the synthetic data, and optimizing initialization, an NMT system can be guided in the correct direction. Notably, the BLEUs of systems that focused on English always increased to the interval, suggesting that training advances in a manner whereby forward model enhancement relies on the performance of the backward model. Method Supervised(0.6 million) (Artetxe et al., 2017) (Lample et al., 2017) (Yang et al., 2018) (Lample et al., 2018), NMT (Lample et al., 2018), PBSMT (Lample et al., 2018), PBSMT+NMT Our method fr-en en-fr de-en 28.87 29.45 28.24 10.21 15.56 13.33 14.31 14.62 15.58 21.00 24.18 22.68 27.16 27.68 25.19 27.49 28.92 15.13 15.05 16.97 25.14 28.11 27.60 28.22 en-de 23.35 6.89 9.64 10.86 17.16 17.77 20.23 23.61 ru-en en-ru - - - - - - - - 9.09 16.62 16.62 19.57 7.98 13.37 13.76 16.14 Table 1: Comparison with previous work. Beam size is set to 16. (a) English-French. (b) English-German. (c) English-Russian. Figure 3: Bleu scores each iterations. Beam size is set to 16. Baselines are each strongest baseline of each translation task in table1 Ablation Study Model Full model Without weighting de-en 28.87 26.09 en-de 23.61 19.83 word-by-word initialization 17.19 14.62 Table 2: Ablation study on English-German task. We tested: 1) removal of weighting; and 2) word-byword initialization (Table 2). When the weightings of synthetic data were removed, the scores were similar to those of the seventh baseline, perhaps because an auxiliary SMT system was in play. We found that use of an SMT system to generate the initial synthetic data was equivalent to employment of a fully trained SMT system to fine-tune the NMT. The third line of Table 2 stresses the need for appropriate initialization. Case Study Source er argumentiert , dass er zunehmend von kommerziellen Rivalen nicht zu unterscheiden ist . Ref he argues that he is increasingly indistinguishable from commercial rivals. Initial he argued that he increasingly by commercial rivals not to distinguish is . " Iter 1 Iter 4 Iter 7 he also argues that he is increasingly of commercial rivals not to differentiate . he argues that he is increasingly not going to distinguish from commercial rivals . he also argued that he is increasingly unable to distinguish from any commercial rival . Source " des stratégies pédagogiques différentes , c' est ça le véritable besoin " , résume-t-elle . Ref Initial Iter 1 Iter 4 Iter 7 " the real need is for different educational strategies , " she summarises . " the educational strategies , it is the ultimate " it needs , " and various " the educational strategies , different ones , it 's something the ultimate need . " " from different teaching strategies , this is really the ultimate need , " he writes . " different teaching strategies is just the ultimate need , " she say . Table 3: Selected test cases. Synthetic Source but she didn 't pick the small computers . mitnehmen durfte sie den kleinen Rechner aber Monolingual Target Weight 0.723 but she didn 't pick the low computers . families with children are also in hotels with the disclaimer comfort hotel the exception. nicht . mitnehmen durfte sie den kleinen Rechner aber nicht . Familien mit Kindern sind dagegen in Hotels mit dem Zusatz Wohlfühlhotel die Ausnahme. 0.688 0.549 Table 4: Selected training cases and their weight in English-German direction, iteration 4. In second case, word <small> is manually replaced with <low> . To understand more fully how the score function (Eq. 15) corrects training of the NMT model, we illustrate three cases in Table 4. We manually replaced "small" by "low" in the first case; this is inappropriate, and the weight declines on LM scanning using the current NMT model. Moreover, given various synthetic sentence pairs, the model will find the more helpful cases and increase their weights, as may be seen by comparing the first and third cases. Generally, the model will prioritize frequently occurring sentences (such as short sentences); these are usually easier to translate. More complex and less common sentences will receive lower weights. Related Work NMTs that must operate in extremely resource-poor conditions are of great interest. Given the limited supervision, several efforts have been made to boost NMT systems using monolingual data, principally by leveraging bilingual lexica (Klementiev et al., 2012), by employing language models (Ramachandran, Liu, and Le, 2016; He et al., 2016; Gulcehre et al., 2015), and by exploiting iterative back-translation (Sennrich, Haddow, and Birch, 2015; Zhang et al., 2018; Hoang et al., 2018). Following the pioneering work of Ravi and Knight (2011), some authors have attempted to create unsupervised NMTs (Artetxe et al., 2017; Yang et al., 2018; Lample et al., 2017, 2018). In such works, source sentences are viewed as internal information and are mapped into a latent space that is not relevant to the language per se; target sentences are generated via DAE (Vincent et al., 2008). Back-translation was employed in almost all previous works. Lample et al. (2018) further tuned an NMT model using data generated by a PBSMT; performance improved significantly. Similar to our studies, some authors have sought to improve the initialization parameters of NMT models using weight-generated corpora during back-translation. Ramachandran, Liu, and Le (2016) initialized both the encoder and decoder as LMs. Encouraged by the success of bilingual lexicon induction (Fung and Yee, 1998; Conneau et al., 2017; Artetxe, Labaka, and Agirre, 2018), cross-lingual embedding is now widely used to initialize unsupervised models (Artetxe et al., 2017; Yang et al., 2018; Lample et al., 2017, 2018). Zhang et al. (2018) weighted synthetic data by translation probabilities computed with the aid of a backward model. He et al. (2016) viewed the LM scores as rewards of a reinforcement learning framework. Conclusion We sought to improve the performance of unsupervised NMT models. We employed an LM and an inferred bilingual dictionary to construct a PBSMT system, and initialized the NMT model using the PBSMT-generated data. We then employed non-vanilla back-translation to formulate a weight function for synthetic data; this allowed the NMT model to perform better than before. We applied our method to analysis of three language pairs; we have established new state-of-the-art performance parameters for unsupervised machine translation References Artetxe, M.; Labaka, G.; Agirre, E.; and Cho, K. 2017. Unsupervised neural machine translation. arXiv preprint arXiv:1710.11041. Artetxe, M.; Labaka, G.; and Agirre, E. 2018. Gen- eralizing and improving bilingual word embedding mappings with a multi-step framework of linear trans- formations. In Thirty-Second AAAI Conference on Artificial Intelligence. Bahdanau, D.; Cho, K.; and Bengio, Y. 2014. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473. Bojanowski, P.; Grave, E.; Joulin, A.; and Mikolov, T. 2017. Enriching word vectors with subword informa- tion. Transactions of the Association for Computa- tional Linguistics 5(1):135 -- 146. Cho, K.; Van Merriënboer, B.; Gulcehre, C.; Bahdanau, D.; Bougares, F.; Schwenk, H.; and Bengio, Y. 2014. Learning phrase representations using rnn encoder- decoder for statistical machine translation. arXiv preprint arXiv:1406.1078. Conneau, A.; Lample, G.; Ranzato, M.; Denoyer, L.; and Jégou, H. 2017. Word translation without parallel data. arXiv preprint arXiv:1710.04087. Fung, P., and Yee, L. Y. 1998. An ir approach for translating new words from nonparallel, comparable texts. In 36th Annual Meeting of the Association for Computational Linguistics and 17th International Conference on Computational Linguistics, Volume 1, volume 1. Gulcehre, C.; Firat, O.; Xu, K.; Cho, K.; Barrault, L.; Lin, H.-C.; Bougares, F.; Schwenk, H.; and Bengio, Y. 2015. On using monolingual corpora in neural machine translation. arXiv preprint arXiv:1503.03535. He, D.; Xia, Y.; Qin, T.; Wang, L.; Yu, N.; Liu, T.-Y.; and Ma, W.-Y. 2016. Dual learning for machine trans- lation. In Advances in Neural Information Processing Systems, 820 -- 828. Heafield, K. 2011. Kenlm: Faster and smaller language model queries. In In Proc. of the Sixth Workshop on Statistical Machine Translation. Hoang, V. C. D.; Koehn, P.; Haffari, G.; and Cohn, T. 2018. Iterative back-translation for neural machine translation. In Proceedings of the 2nd Workshop on Neural Machine Translation and Generation, 18 -- 24. Melbourne, Australia: Association for Computational Linguistics. Hoffman, M. D.; Blei, D. M.; Wang, C.; and Paisley, J. 2013. Stochastic variational inference. The Journal of Machine Learning Research 14(1):1303 -- 1347. Klementiev, A.; Irvine, A.; Callison-Burch, C.; and Yarowsky, D. 2012. Toward statistical machine trans- lation without parallel corpora. In Proceedings of the 13th Conference of the European Chapter of the Association for Computational Linguistics, 130 -- 140. Association for Computational Linguistics. Koehn, P., and Knowles, R. 2017. Six challenges for neural machine translation. arXiv preprint arXiv:1706.03872. Koehn, P.; Hoang, H.; Birch, A.; Callison-Burch, C.; Federico, M.; Bertoldi, N.; Cowan, B.; Shen, W.; Moran, C.; Zens, R.; et al. 2007. Moses: Open source toolkit for statistical machine translation. In Proceedings of the 45th annual meeting of the associ- ation for computational linguistics companion volume proceedings of the demo and poster sessions, 177 -- 180. Koehn, P.; Och, F. J.; and Marcu, D. 2003. Statistical phrase-based translation. In Proceedings of the 2003 Conference of the North American Chapter of the Association for Computational Linguistics on Human Language Technology- Volume 1, 48 -- 54. Association for Computational Linguistics. Lample, G.; Conneau, A.; Denoyer, L.; and Ran- zato, M. 2017. Unsupervised machine translation using monolingual corpora only. arXiv preprint arXiv:1711.00043. Lample, G.; Ott, M.; Conneau, A.; Denoyer, L.; and Ranzato, M. 2018. Phrase-based & neural unsupervised machine translation. arXiv preprint arXiv:1804.07755. Lopez, A. 2008. Statistical machine translation. ACM Comput. Surv. 40(3):8:1 -- 8:49. Och, F. J., and Ney, H. 2002. Discriminative training and maximum entropy models for statistical machine translation. In Proceedings of the 40th annual meeting on association for computational linguistics, 295 -- 302. Association for Computational Linguistics. Papineni, K.; Roukos, S.; Ward, T.; and Zhu, W.-J. 2002. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting on association for computational linguistics, 311 -- 318. Association for Computational Linguistics. Poncelas, A.; Shterionov, D.; Way, A.; Wenniger, G. M. d. B.; and Passban, P. 2018. Investigating backtrans- lation in neural machine translation. arXiv preprint arXiv:1804.06189. Ramachandran, P.; Liu, P. J.; and Le, Q. V. 2016. Unsupervised pretraining for sequence to sequence learning. arXiv preprint arXiv:1611.02683. Ravi, S., and Knight, K. 2011. Deciphering foreign language. In Proceedings of the 49th Annual Meet- ing of the Association for Computational Linguistics: Human Language Technologies, 12 -- 21. Sennrich, R.; Haddow, B.; and Birch, A. 2015. Improv- ing neural machine translation models with monolin- gual data. arXiv preprint arXiv:1511.06709. Sennrich, R.; Haddow, B.; and Birch, A. 2016. Neu- ral machine translation of rare words with subword units. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Vol- ume 1: Long Papers), 1715 -- 1725. Berlin, Germany: Association for Computational Linguistics. Shannon, C. E. 1948. A mathematical theory of commu- nication. Bell system technical journal 27(3):379 -- 423. Sutskever, I.; Vinyals, O.; and Le, Q. V. 2014. Se- quence to sequence learning with neural networks. In Advances in neural information processing systems, 3104 -- 3112. Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A. N.; Kaiser, Ł.; and Polosukhin, I. 2017. Attention is all you need. In Advances in Neural Information Processing Systems, 5998 -- 6008. Vincent, P.; Larochelle, H.; Bengio, Y.; and Manzagol, P.-A. 2008. Extracting and composing robust features with denoising autoencoders. In Proceedings of the 25th international conference on Machine learning, 1096 -- 1103. ACM. Yang, Z.; Chen, W.; Wang, F.; and Xu, B. 2018. Un- supervised neural machine translation with weight sharing. CoRR abs/1804.09057. Zens, R.; Och, F. J.; and Ney, H. 2002. Phrase-based statistical machine translation. In Annual Conference on Artificial Intelligence, 18 -- 32. Springer. Zhang, Z.; Liu, S.; Li, M.; Zhou, M.; and Chen, E. 2018. Joint training for neural machine translation models with monolingual data. In Thirty-Second AAAI Conference on Artificial Intelligence.
1709.03756
1
1709
2017-09-12T09:23:55
Cross-lingual Word Segmentation and Morpheme Segmentation as Sequence Labelling
[ "cs.CL" ]
This paper presents our segmentation system developed for the MLP 2017 shared tasks on cross-lingual word segmentation and morpheme segmentation. We model both word and morpheme segmentation as character-level sequence labelling tasks. The prevalent bidirectional recurrent neural network with conditional random fields as the output interface is adapted as the baseline system, which is further improved via ensemble decoding. Our universal system is applied to and extensively evaluated on all the official data sets without any language-specific adjustment. The official evaluation results indicate that the proposed model achieves outstanding accuracies both for word and morpheme segmentation on all the languages in various types when compared to the other participating systems.
cs.CL
cs
Cross-lingual Word Segmentation and Morpheme Segmentation as Sequence Labelling Yan Shao Department of Linguistics and Philology, Uppsala University [email protected] Abstract as identifying valid boundaries between consecu- tive characters. This paper presents our segmentation sys- tem developed for the MLP 2017 shared tasks on cross-lingual word segmentation and morpheme segmentation. We model both word and morpheme segmentation as character-level sequence labelling tasks. The prevalent bidirectional recurrent neu- ral network with conditional random fields as the output interface is adapted as the baseline system, which is further im- proved via ensemble decoding. Our uni- versal system is applied to and extensively evaluated on all the official data sets with- out any language-specific adjustment. The official evaluation results indicate that the proposed model achieves outstanding ac- curacies both for word and morpheme seg- mentation on all the languages in various types when compared to the other partici- pating systems. 1 Introduction In natural language processing, word segmenta- tion and morpheme segmentation are the initial steps to identify basic linguistic units, namely words and morphemes, for further analysis in higher-level tasks. Word segmentation can be very non-trivial, especially for languages without ex- plicit indicators for word boundaries, such as Chi- nese, Japanese and Vietnamese. For morphologi- cally rich languages like Turkish, words are fur- ther segmented into morphemes, such as stems, prefixes and suffixes for morphological analysis. Similar to non-trivial word segmentation, there are no clear boundaries between morphemes in the surface forms of words. Both word segmenta- tion and morpheme segmentation can be viewed labelling (CRF) sequence Word segmentation is often formalised as character-based prob- a (Xue, 2003; lem to predict position tags Straka and Strakov´a, 2017). Standard ma- chine algorithms, such as Maximum Entropy (Berger et al., 1996; Low et al., 2005), Condi- tional Random Fields (Lafferty et al., 2001; Peng et al., 2004) and neural networks (Chen et al., 2015) are applied for the task in previous research. Additionally, a number of word-based approaches have also been proposed (Zhang and Clark, 2007; Cai and Zhao, 2016). For morpheme segmentation, apart from un- (Creutz and Lagus, 2007; supervised methods Poon et al., 2009), Ruokolainen et al. (2013) model the task as sequence labelling, similarly to character-based word segmentation. They use CRF to predict position tags given words as sequences of characters. in- stead of employing traditional statistical models, Wang et al. (2016) propose and apply several recurrent neural network architectures to avoid heavy feature engineering. Furthermore, Considering the similarities between word segmentation and morpheme segmentation, we present a universal neural sequence labelling model that is capable of solving both segmentation tasks in this paper. Our baseline model is an adap- tation of a bidirectional recurrent neural network (RNN) using conditional random fields (CRF) as the output interface for sentence-level optimisa- tion (BiRNN-CRF). BiRNN-CRF achieves state- of-the-art accuracies on various sequence labelling tasks (Huang et al., 2015; Ma and Hovy, 2016). We modify the conventional position tags used for word segmentation so that they are also applicable to morpheme segmentation. Furthermore, a sim- ple ensemble decoding technique is implemented (summer) (too) (hot) 夏 天 太 热 Characters: elama tuo kremppoja mukanaan . Tags: BIIIEXBESXBIIIIIESSXBIIIIEBEXS Segmented: elama tu//o kremppo//j//a mukana//an . 3-gram character representations forward RNN backward RNN CRF Layer GRU GRU GRU GRU GRU GRU GRU GRU B E S S Output 夏天 太 热 Figure 1: The BiRNN-CRF model for segmenta- tion. The dashed arrows indicate that dropout lay- ers are applied. to obtain additional improvements over the base- line model. Our system is fully data-driven and language-independent. It is extensively evaluated on the MLP 2017 shared task data sets. 2 Segmentation Model 2.1 Baseline Model Our baseline model is shown in Figure 1. We adopt the concatenated 3-gram model introduced in Shao et al. (2017) as the vector representation of input characters. The pivot character in a given context is represented as the concatenation of the context-free vector along with the local bigram and trigram vectors. All the vectors are initialised randomly and separately. Utilising the concate- nated n-grams ensures that the same character has different yet closely related vector representations in different contexts, which is an effective way to encode contextual features. We use a single vector to represent all the characters that appeared only once in the training set while training. This vec- tor is later used as the representation for unknown characters in the development and test sets. The same representation scheme is also applied to lo- cal bigrams and trigrams. Figure 2: Boundary tags employed for morpheme segmentation. similar ward and backward recurrent layers. Gated re- current units (GRU) (Cho et al., 2014) are em- ployed as the basic recurrent cell to capture long term dependencies and global information. Com- pared to the more prevalent long-short term mem- ory cells (LSTM) (Hochreiter and Schmidhuber, 1997), GRU has functionalities but fewer parameters (Chung et al., 2014). Dropout (Srivastava et al., 2014) is applied to the input vec- tors as character representations and the outputs of the bidirectional recurrent layers. A first-order chain CRF layer is added on top of the recurrent layers to incorporate the transition information be- tween consecutive tags, which ensures that the op- timal sequence of tags over the entire sentence is obtained. The optimal sequence can be obtained efficiently via the Viterbi algorithm both for train- ing and decoding. The time complexity is linear with respect to sentence length. For the chain CRF interface while decoding, the final sequence of the position tags y is obtained via the conditional scores S(yixi) and the transition scores T (yi, yj) given the input sequence x. In the baseline model, the optimal sequence is com- puted with respect to the scores returned by a sin- gle model: y∗ = argmax y∈L(x) p(yx; S, T ) (1) There is a post processing step to retrieve seg- mented units with respect to the predicted tags, which varies from different segmentation tasks and different formats of data sets. 2.2 Tag Set For word segmentation, we use four position tags B, I, E, and S to indicate a character positioned at the beginning (B), inside (I), or at the end (E) of a word, or occurring as a single-character word (S). We extend this tag set for morpheme segmenta- tion by adding an extra tag X to represent the word boundaries. Figure 2 illustrates the input charac- ters and the boundary tags to be predicted in mor- pheme segmentation. The character vectors are passed to the for- Unlike previous work of Ruokolainen et al. Character vector size 2-gram and 3-gram vector sizes GRU state size Optimizer Initial learning rate Decay rate Gradient Clipping Dropout rate Batch size Length limit 50 50 200 Adagrad 0.1 0.05 5.0 0.5 10 300 Table 1: Hyper-parameters for segmentation. (2013) and Wang et al. (2016), our model per- forms morpheme segmentation at the sentence level rather than the word level to incorporate in- formation beyond word boundaries. 2.3 Ensemble Decoding We use a simple ensemble averaging technique to mitigate the deviations caused by random weight initialisation of the neural network and improve the baseline. For ensemble decoding, both the conditional scores S(yixi) and the transition scores T (yi, yj) are averaged over four models with identical parameter settings but trained inde- pendently with different random seeds: y∗ = argmax y∈L(x) p(yx; ¯{S}, ¯{T }) (2) 2.4 Implementation Our neural segmenter is implemented using the TensorFlow 1.2.0 library (Abadi et al., 2016). The bucket model is applied so that the training and tagging speed of our neural network on GPU de- vices can be drastically improved. The training time is proportional to the size of the training set. We provide an open-source implementation of our method.1 Table 1 shows the adopted hyper-parameters. We use one set of parameters for both tasks on all the provided data sets. The weights of the neural networks, including the character vectors, are initialised using the scheme introduced in Glorot and Bengio (2010). The network is trained with the error back-propagation algorithm. The vector representations of input characters are fine- tuned during training by back-propagating gra- dients. Adagrad (Duchi et al., 2011) with mini- batches is employed for optimisation with the ini- tial learning rate η0 = 0.1, which is updated with 1 https://github.com/yanshao9798/segmenter η0 a decay rate ρ = 0.05 as ηt = ρ(t−1)+1 , where t is the index of the current epoch. To increase the effi- ciency and reduce memory demand both for train- ing and decoding, we chop the sentences longer than 300 characters. For decoding, the chopped sentences are recovered after being processed. The model is optimised according to its perfor- mance on the development sets. F1-score with re- spect to the basic segmented unit is employed to measure the performance of the model after each epoch during training. In our experiments, the models are trained for 30 epochs. To ensure that the weights are well optimised, we only adopt the best epoch after the model is trained at least for 5 epochs. 3 Experiments 3.1 Data Sets There are in total 10 data sets provided in the MLP 2017 shared tasks. Traditional Chinese, Japanese and Vietnamese are for the word seg- mentation task, while Basque, Farsi, Filipino, Finnish, Kazakh, Marathi and Uyghur are for mor- pheme segmentation. The provided languages vary substantially both in typology and written form. The sizes of the data sets are also different. The detailed information can be found in Table 2. In our experiments, we only use the official training data to build separate segmentation mod- els for each language without utilising any exter- nal resources. For Vietnamese, we use the space- delimited units as the basic elements for boundary prediction. For all the rest, no language-specific modification or adjustment is made. 3.2 Experimental Results For word segmentation, word level precision, re- call and F1-score are employed as the evaluation metrics. For morpheme segmentation, precision, recall and F1-score are calculated only with re- spect to the identified prefixes and suffixes. The official experimental results are shown in Table 2. The results of both the single and en- semble models are presented. The F1-scores of the single model as Baseline are in comparison to the ensemble model as well as the best performing systems among the other participants of the shared task. In general, the BiRNN-CRF model is effective for both word segmentation and morpheme seg- mentation. Our baseline model is substantially Dataset Chinese Japanese Vietnamese Basque Farsi Filipino Finnish Kazakh Marathi Uyghur Uyghur* Size Train Dev 250 2,029 200 1,600 3,000 500 599 500 1,999 3,537 7,298 5,098 3,999 3,999 100 100 200 750 999 450 500 500 Test 250 200 500 100 100 200 762 1,000 450 501 501 Baseline Ensemble Diff 1 Diff 2 P 84.2 96.1 90.9 81.5 77.6 91.2 89.8 97.0 95.1 65.1 96.8 R 87.1 97.8 92.8 77.2 74.0 93.0 90.5 97.1 93.3 61.5 96.8 F 85.7 96.9 91.8 79.3 75.8 92.1 90.2 97.1 94.2 63.3 96.8 P 85.4 96.6 92.0 82.4 77.9 92.0 90.9 97.5 95.1 67.5 97.1 R 87.8 97.7 92.8 80.8 76.2 92.4 90.5 97.5 93.8 61.4 97.3 F 86.6 97.2 92.4 81.6 77.0 92.2 90.7 97.5 94.4 64.3 97.2 F +0.9 +0.3 +0.6 +2.3 +1.2 +0.1 +0.5 +0.4 +0.2 +0.1 +0.4 F +9.7 +3.4 - +28.2 +17.0 - +26.5 - - -0.8 +32.7 Table 2: Data size in numbers of sentences and official evaluation results in precision (P), recall (R) and F1-score (F). Ensemble is in comparison to the single model as Baseline in Diff1. Baseline is in comparison to the best or second best systems in Diff 2. Asterisk indicates post-official evaluation runs. better than the rest of the participating systems on all the languages, especially for morpheme seg- mentation. Due to some encoding issues, our sys- tem is relatively under-performing on Uyghur re- ferring to the official scores. We fixed the problem and report the corrected scores. The ensemble decoding is beneficial across all the data sets, but the overall improvement is rather marginal, especially if the baseline accuracy is very high. It is nonetheless helpful if the training sets are small as in the cases of Basque and Farsi. For word segmentation, we can see that very high accuracy is obtained on Japanese in spite of the relatively small training set. The writ- ing system of Japanese is a combination of hi- ragana, katakana and Chinese characters (kanji). The switching of different types of characters can be an indicator for word boundaries in a sentence. As opposed to Japanese, Chinese and Vietnamese only contain one type of characters. The identi- fication of word boundaries depends more heav- ily on the context. Additionally, the Chinese data set is composed of sentences from web search in different genres and the percentage of out-of- vocabulary words is high in the test set, which makes the segmentation task more challenging. For morpheme segmentation, the size of the training set has the biggest impact on accuracy. The evaluation scores on Basque and Farsi are therefore drastically lower than the others. Unlike Chinese and Japanese characters and the space- delimited units in Vietnamese, individual charac- ters by themselves in the languages for morpheme segmentation are less informative and the charac- ter vocabulary size is much smaller. The types of prefixes and suffixes to be identified are very limited and less ambiguous. As long as the data set is standardised and properly tokenised, very high accuracies can be achieved across languages in different writing systems given sufficient train- ing data. 4 Conclusions This paper presents our segmentation system for the MLP 2017 shared task on word segmentation and morpheme segmentation. Viewing both word and morpheme segmentation as character level se- quence labelling tasks, we adapt the BiRNN-CRF model that has been applied to various sequence labelling tasks previously. Regardless of the vast variety of the data sets, we employ a universal model that uses a single set of hyper-parameters on all the languages without any task and language- specific adaptations. The evaluation results indi- cate that our model is effective for both segmenta- tion tasks. In general, the proposed model achieves rela- tively high accuracies across all the languages for both tasks if sufficient amounts of training data are provided. However, as both word segmentation and morpheme segmentation are at the very low levels of the complete natural language processing framework, the segmentation errors propagate fur- ther to higher level tasks. Thus, it is still very valu- able to develop systems with higher performances in the future. In addition, we will explore the pos- sibility of adapting the proposed model to low- resource languages using cross-lingual approaches if sufficient amount of training data is not avail- able. Acknowledgments We acknowledge the computational resources pro- vided by CSC in Helsinki and Sigma2 in Oslo through NeIC-NLPL (www.nlpl.eu). References Mart´ın Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Is- ard, et al. 2016. Tensorflow: A system for large- scale machine learning. In Proceedings of the 12th USENIX Symposium on Operating Systems Design and Implementation (OSDI). Savannah, Georgia, USA. Adam L Berger, Vincent J Della Pietra, and Stephen A Della Pietra. 1996. A maximum entropy approach to natural language processing. Computational lin- guistics 22(1):39–71. Deng Cai and Hai Zhao. 2016. Neural word segmenta- tion learning for chinese pages 409–420. Xinchi Chen, Xipeng Qiu, Chenxi Zhu, Pengfei Liu, and Xuanjing Huang. 2015. Long short-term mem- ory neural networks for chinese word segmentation. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing. Associa- tion for Computational Linguistics, Lisbon, Portu- gal, pages 1197–1206. Kyunghyun Cho, Bart Van Merrienboer, Dzmitry Bah- danau, and Yoshua Bengio. 2014. On the properties of neural machine translation: Encoder-decoder ap- proaches. arXiv preprint arXiv:1409.1259 . 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 . Mathias Creutz and Krista Lagus. 2007. Unsupervised models for morpheme segmentation and morphol- ogy learning. ACM Transactions on Speech and Language Processing (TSLP) 4(1):3. John Duchi, Elad Hazan, and Yoram Singer. 2011. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research 12(Jul):2121–2159. Xavier Glorot and Yoshua Bengio. 2010. Understand- ing the difficulty of training deep feedforward neural networks. In Aistats. pages 249–256. Sepp Hochreiter and Jurgen Schmidhuber. 1997. Neural computation Long short-term memory. 9(8):1735–1780. Zhiheng Huang, Wei Xu, and Kai Yu. 2015. Bidirec- tional lstm-crf models for sequence tagging. arXiv preprint arXiv:1508.01991 . John D. Lafferty, Andrew McCallum, and Fernando C. N. Pereira. 2001. Conditional random fields: Probabilistic models for segmenting and labeling se- quence data. In Proceedings of the Eighteenth In- ternational Conference on Machine Learning. Mor- gan Kaufmann Publishers Inc., San Francisco, CA, USA, ICML '01, pages 282–289. Jin Kiat Low, Hwee Tou Ng, and Wenyuan Guo. 2005. A maximum entropy approach to chinese word seg- mentation. In Proceedings of the Fourth SIGHAN Workshop on Chinese Language Processing. Asso- ciation for Computational Linguistics, page 448455. Xuezhe Ma and Eduard Hovy. 2016. End-to-end se- quence labeling via bi-directional lstm-cnns-crf. In Proceedings of the 54th Annual Meeting of the Asso- ciation for Computational Linguistics. Berlin, Ger- many, page 10641074. Fuchun Peng, Fangfang Feng, and Andrew McCallum. 2004. Chinese segmentation and new word detec- tion using conditional random fields. In Proceed- ings of the 20th international conference on Compu- tational Linguistics. Association for Computational Linguistics, page 562. Hoifung Poon, Colin Cherry, and Kristina Toutanova. 2009. Unsupervised morphological segmentation with log-linear models. In Proceedings of Human Language Technologies: The 2009 Annual Confer- ence of the North American Chapter of the Associa- tion for Computational Linguistics. Association for Computational Linguistics, Stroudsburg, PA, USA, NAACL '09, pages 209–217. Teemu Ruokolainen, Oskar Kohonen, Sami Virpioja, and Mikko Kurimo. 2013. Supervised morphologi- cal segmentation in a low-resource learning setting using conditional random fields. In Proceedings of the Seventeenth Conference on Computational Nat- ural Language Learning. Association for Computa- tional Linguistics, Sofia, Bulgaria, pages 29–37. Yan Shao, Christian Hardmeier, Jorg Tiedemann, and Joakim Nivre. 2017. Character-based joint seg- mentation and POS tagging for Chinese using bidi- rectional RNN-CRF. ArXiv e-prints: 1704.01314 (cs.CL). Nitish Srivastava, Geoffrey E Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. 2014. Dropout: a simple way to prevent neural networks from overfitting. Journal of Machine Learning Re- search 15(1):1929–1958. Milan Straka and Jana Strakov´a. 2017. Tokenizing, pos tagging, lemmatizing and parsing ud 2.0 with udpipe. In Proceedings of the CoNLL 2017 Shared Task: Multilingual Parsing from Raw Text to Univer- sal Dependencies. Association for Computational Linguistics, Vancouver, Canada, pages 88–99. Linlin Wang, Zhu Cao, Yu Xia, and Gerard de Melo. 2016. Morphological segmentation with window lstm neural networks. In Proceedings of the Thir- tieth AAAI Conference on Artificial Intelligence. AAAI Press, AAAI'16, pages 2842–2848. Nianwen Xue. 2003. Chinese word segmentation as character tagging. Computational Linguistics and Chinese Language Processing pages 29–48. Yue Zhang and Stephen Clark. 2007. Chinese segmen- tation with a word-based perceptron algorithm. In Proceedings of the 45nd Annual Meeting of the As- sociation for Compu- tational Linguistics. Associa- tion for Computational Linguistics, Lisbon, Portu- gal, pages 840–847.
1704.08381
3
1704
2017-08-18T11:28:05
Neural AMR: Sequence-to-Sequence Models for Parsing and Generation
[ "cs.CL" ]
Sequence-to-sequence models have shown strong performance across a broad range of applications. However, their application to parsing and generating text usingAbstract Meaning Representation (AMR)has been limited, due to the relatively limited amount of labeled data and the non-sequential nature of the AMR graphs. We present a novel training procedure that can lift this limitation using millions of unlabeled sentences and careful preprocessing of the AMR graphs. For AMR parsing, our model achieves competitive results of 62.1SMATCH, the current best score reported without significant use of external semantic resources. For AMR generation, our model establishes a new state-of-the-art performance of BLEU 33.8. We present extensive ablative and qualitative analysis including strong evidence that sequence-based AMR models are robust against ordering variations of graph-to-sequence conversions.
cs.CL
cs
Neural AMR: Sequence-to-Sequence Models for Parsing and Generation Ioannis Konstas† Srinivasan Iyer† Mark Yatskar† Yejin Choi† Luke Zettlemoyer†‡ †Paul G. Allen School of Computer Science & Engineering, Univ. of Washington, Seattle, WA {ikonstas,sviyer,my89,yejin,lsz}@cs.washington.edu ‡Allen Institute for Artificial Intelligence, Seattle, WA [email protected] 7 1 0 2 g u A 8 1 ] L C . s c [ 3 v 1 8 3 8 0 . 4 0 7 1 : v i X r a Abstract Sequence-to-sequence models have shown strong performance across a broad range of applications. However, their applica- tion to parsing and generating text using Abstract Meaning Representation (AMR) has been limited, due to the relatively lim- ited amount of labeled data and the non- sequential nature of the AMR graphs. We present a novel training procedure that can lift this limitation using millions of unla- beled sentences and careful preprocessing of the AMR graphs. For AMR parsing, our model achieves competitive results of 62.1 SMATCH, the current best score reported without significant use of external seman- tic resources. For AMR generation, our model establishes a new state-of-the-art performance of BLEU 33.8. We present extensive ablative and qualitative analysis including strong evidence that sequence- based AMR models are robust against ordering variations of graph-to-sequence conversions. Introduction 1 Abstract Meaning Representation (AMR) is a se- mantic formalism to encode the meaning of natu- ral language text. As shown in Figure 1, AMR rep- resents the meaning using a directed graph while abstracting away the surface forms in text. AMR has been used as an intermediate meaning repre- sentation for several applications including ma- chine translation (MT) (Jones et al., 2012), sum- marization (Liu et al., 2015), sentence compres- sion (Takase et al., 2016), and event extraction (Huang et al., 2016). While AMR allows for rich semantic representation, annotating training data in AMR is expensive, which in turn limits the use Figure 1: An example sentence and its cor- responding Abstract Meaning Representation (AMR). AMR encodes semantic dependencies be- tween entities mentioned in the sentence, such as "Obama" being the "arg0" of the verb "elected". of neural network models (Misra and Artzi, 2016; Peng et al., 2017; Barzdins and Gosko, 2016). In this work, we present the first success- ful sequence-to-sequence (seq2seq) models that achieve strong results for both text-to-AMR pars- ing and AMR-to-text generation. Seq2seq models have been broadly successful in many other appli- cations (Wu et al., 2016; Bahdanau et al., 2015; Luong et al., 2015; Vinyals et al., 2015). How- ever, their application to AMR has been limited, in part because effective linearization (encoding graphs as linear sequences) and data sparsity were thought to pose significant challenges. We show that these challenges can be easily overcome, by demonstrating that seq2seq models can be trained using any graph-isomorphic linearization and that unlabeled text can be used to significantly reduce sparsity. Our approach is two-fold. First, we introduce a novel paired training procedure that enhances both the text-to-AMR parser and AMR-to-text genera- tor. More concretely, first we use self-training to Obama was elected and his voters celebratedObamaelect.01celebrate.01vote.01and *op1op2ARG0possARG0personnamenameop1personARG0-of bootstrap a high quality AMR parser from mil- lions of unlabeled Gigaword sentences (Napoles et al., 2012) and then use the automatically parsed AMR graphs to pre-train an AMR generator. This paired training allows both the parser and genera- tor to learn high quality representations of fluent English text from millions of weakly labeled ex- amples, that are then fine-tuned using human an- notated AMR data. Second, we propose a preprocessing procedure for the AMR graphs, which includes anonymizing entities and dates, grouping entity categories, and encoding nesting information in concise ways, as illustrated in Figure 2(d). This preprocessing pro- cedure helps overcoming the data sparsity while also substantially reducing the complexity of the AMR graphs. Under such a representation, we show that any depth first traversal of the AMR is an effective linearization, and it is even possible to use a different random order for each example. Experiments on the LDC2015E86 AMR cor- pus (SemEval-2016 Task 8) demonstrate the ef- fectiveness of the overall approach. For parsing, we are able to obtain competitive performance of 62.1 SMATCH without using any external anno- tated examples other than the output of a NER system, an improvement of over 10 points rela- tive to neural models with a comparable setup. For generation, we substantially outperform previ- ous best results, establishing a new state of the art of 33.8 BLEU. We also provide extensive ablative and qualitative analysis, quantifying the contribu- tions that come from preprocessing and the paired training procedure. et 2 Related Work Alignment-based Parsing Flanigan al. (2014) (JAMR) pipeline concept and relation identification with a graph-based algorithm. Zhou et al. (2016) extend JAMR by performing the concept and relation identification tasks jointly with an incremental model. Both systems rely on features based on a set of alignments produced using bi-lexical cues and hand-written rules. In contrast, our models train directly on parallel cor- pora, and make only minimal use of alignments to anonymize named entities. Grammar-based Parsing Wang et al. (2016) (CAMR) perform a series of shift-reduce transfor- mations on the output of an externally-trained de- pendency parser, similar to Damonte et al. (2017), Brandt et al. (2016), Puzikov et al. (2016), and Goodman et al. (2016). Artzi et al. (2015) use a grammar induction approach with Combinatory Categorical Grammar (CCG), which relies on pre- trained CCGBank categories, like Bjerva et al. (2016). Pust et al. (2015) recast parsing as a string-to-tree Machine Translation problem, us- ing unsupervised alignments (Pourdamghani et al., 2014), and employing several external semantic resources. Our neural approach is engineering lean, relying only on a large unannotated corpus of English and algorithms to find and canonicalize named entities. Neural Parsing Recently there have been a few seq2seq systems for AMR parsing (Barzdins and Gosko, 2016; Peng et al., 2017). Similar to our approach, Peng et al. (2017) deal with sparsity by anonymizing named entities and typing low fre- quency words, resulting in a very compact vocab- ulary (2k tokens). However, we avoid reducing our vocabulary by introducing a large set of unlabeled sentences from an external corpus, therefore dras- tically lowering the out-of-vocabulary rate (see Section 6). AMR Generation Flanigan et al. (2016b) spec- ify a number of tree-to-string transduction rules based on alignments and POS-based features that are used to drive a tree-based SMT system. Pour- damghani et al. (2016) also use an MT decoder; they learn a classifier that linearizes the input AMR graph in an order that follows the output sentence, effectively reducing the number of align- ment crossings of the phrase-based decoder. Song et al. (2016) recast generation as a traveling sales- man problem, after partitioning the graph into fragments and finding the best linearization order. Our models do not need to rely on a particular lin- earization of the input, attaining comparable per- formance even with a per example random traver- sal of the graph. Finally, all three systems intersect with a large language model trained on Gigaword. We show that our seq2seq model has the capacity to learn the same information as a language model, especially after pretraining on the external corpus. Data Augmentation Our paired training proce- dure is largely inspired by Sennrich et al. (2016). They improve neural MT performance for low re- source language pairs by using a back-translation MT system for a large monolingual corpus of the target language in order to create synthetic output, and mixing it with the human translations. We instead pre-train on the external corpus first, and then fine-tune on the original dataset. 3 Methods In this section, we first provide the formal defini- tion of AMR parsing and generation (section 3.1). Then we describe the sequence-to-sequence mod- els we use (section 3.2), graph-to-sequence con- version (section 3.3), and our paired training pro- cedure (section 3.4). 3.1 Tasks We assume access to a training dataset D where each example pairs a natural language sentence s with an AMR a. The AMR is a rooted directed acylical graph. It contains nodes whose names correspond to sense-identified verbs, nouns, or AMR specific concepts, for example elect.01, Obama, and person in Figure 1. One of these nodes is a distinguished root, for exam- ple, the node and in Figure 1. Furthermore, the graph contains labeled edges, which correspond to PropBank-style (Palmer et al., 2005) seman- tic roles for verbs or other relations introduced for AMR, for example, arg0 or op1 in Figure 1. The set of node and edge names in an AMR graph is drawn from a set of tokens C, and every word in a sentence is drawn from a vocabulary W . We study the task of training an AMR parser, i.e., finding a set of parameters θP for model f, that predicts an AMR graph a, given a sentence s: f(cid:0)as; θP (cid:1) a = argmax a (1) (2) We also consider the reverse task, training an AMR generator by finding a set of parameters θG, for a model f that predicts a sentence s, given an AMR graph a: f(cid:0)sa; θG (cid:1) s = argmax s In both cases, we use the same family of pre- dictors f, sequence-to-sequence models that use global attention, but the models have independent parameters, θP and θG. 3.2 Sequence-to-sequence Model For both tasks, we use a stacked-LSTM sequence- to-sequence neural architecture employed in neu- ral machine translation (Bahdanau et al., 2015; Wu et al., 2016).1 Our model uses a global atten- tion decoder and unknown word replacement with small modifications (Luong et al., 2015). The model uses a stacked bidirectional-LSTM encoder to encode an input sequence and a stacked LSTM to decode from the hidden states produced by the encoder. We make two modifications to the encoder: (1) we concatenate the forward and backward hidden states at every level of the stack instead of at the top of the stack, and (2) intro- duce dropout in the first layer of the encoder. The decoder predicts an attention vector over the en- coder hidden states using previous decoder states. The attention is used to weigh the hidden states of the encoder and then predict a token in the out- put sequence. The weighted hidden states, the decoded token, and an attention signal from the previous time step (input feeding) are then fed to- gether as input to the next decoder state. The de- coder can optionally choose to output an unknown word symbol, in which case the predicted atten- tion is used to copy a token directly from the input sequence into the output sequence. 3.3 Linearization Our seq2seq models require that both the input and target be presented as a linear sequence of tokens. We define a linearization order for an AMR graph as any sequence of its nodes and edges. A lin- earization is defined as (1) a linearization order and (2) a rendering function that generates any number of tokens when applied to an element in the linearization order (see Section 4.2 for imple- mentation details). Furthermore, for parsing, a valid AMR graph must be recoverable from the linearization. 3.4 Paired Training Obtaining a corpus of jointly annotated pairs of sentences and AMR graphs is expensive and cur- rent datasets only extend to thousands of exam- ples. Neural sequence-to-sequence models suffer from sparsity with so few training pairs. To reduce the effect of sparsity, we use an external unan- notated corpus of sentences Se, and a procedure which pairs the training of the parser and genera- tor. Our procedure is described in Algorithm 1, and first trains a parser on the dataset D of pairs of sen- tences and AMR graphs. Then it uses self-training 1We extended the Harvard NLP seq2seq framework from http://nlp.seas.harvard.edu/code. Algorithm 1 Paired Training Procedure Input: Training set of sentences and AMR graphs (s, a) ∈ D, an unannotated external corpus of sentences Se, a number of self training iterations, N, and an initial sam- ple size k. generator θG. e using parameters θP Output: Model parameters for AMR parser θP and AMR 1: θP ← Train parser on D (cid:46) Self-train AMR parser. e ← sample k sentences from Se 2: S1 3: for i = 1 to N do e ← Parse Si 4: Ai θP ← Train parser on (Ai θP ← Train parser on D with initial parameters θP 6: e ← sample k · 10i new sentences from Se 7: Si+1 8: end for e ← sample k · 10N new sentences from Se 9: SN (cid:46) Pre-train AMR generator. 10: Ae ← Parse SN 11: θG ← Train generator on (AN 12: θG ← Train generator on D using initial parameters θG 13: return θP , θG e using parameters θP e , SN e ) (cid:46) Fine tune AMR generator. 5: (cid:46) Pre-train AMR parser. (cid:46) Fine tune AMR parser. e, Si e) to improve the initial parser. Every iteration of self-training has three phases: (1) parsing samples from a large, unlabeled corpus Se, (2) creating a new set of parameters by training on Se, and (3) fine-tuning those parameters on the original paired data. After each iteration, we increase the size of the sample from Se by an order of magnitude. Af- ter we have the best parser from self-training, we use it to label AMRs for Se and pre-train the gen- erator. The final step of the procedure fine-tunes the generator on the original dataset D. 4 AMR Preprocessing We use a series of preprocessing steps, including AMR linerization, anonymization, and other mod- ifications we make to sentence-graph pairs. Our methods have two goals: (1) reduce the complex- ity of the linearized sequences to make learning easier while maintaining enough original informa- tion, and (2) address sparsity from certain open class vocabulary entries, such as named entities (NEs) and quantities. Figure 2(d) contains exam- ple inputs and outputs with all of our preprocess- ing techniques. Graph Simplification In order to reduce the overall length of the linearized graph, we first re- move variable names and the instance-of re- lation ( / ) before every concept. In case of re-entrant nodes we replace the variable mention with its co-referring concept. Even though this replacement incurs loss of information, often the surrounding context helps recover the correct real- ization, e.g., the possessive role :poss in the ex- ample of Figure 1 is strongly correlated with the surface form his. Following Pourdamghani et al. (2016) we also remove senses from all concepts for AMR generation only. Figure 2(a) contains an example output after this stage. 4.1 Anonymization of Named Entities Open-class types including NEs, dates, and num- bers account for 9.6% of tokens in the sentences of the training corpus, and 31.2% of vocabulary W . 83.4% of them occur fewer than 5 times in the dataset. In order to reduce sparsity and be able to account for new unseen entities, we perform ex- tensive anonymization. First, we anonymize sub-graphs headed by one of AMR's over 140 fine-grained entity types that contain a :name role. This captures structures referring to entities such as person, country, miscellaneous entities marked with *-enitity, and typed numerical values, *-quantity. We exclude date entities (see the next section). We then replace these sub-graphs with a token indicat- ing fine-grained type and an index, i, indicating it is the ith occurrence of that type.2 For example, in Figure 2 the sub-graph headed by country gets replaced with country 0. On the training set, we use alignments obtained using the JAMR aligner (Flanigan et al., 2014) and the unsupervised aligner of Pourdamghani et al. (2014) in order to find mappings of anonymized subgraphs to spans of text and replace mapped text with the anonymized token that we inserted into the AMR graph. We record this mapping for use during testing of generation models. If a gener- ation model predicts an anonymization token, we find the corresponding token in the AMR graph and replace the model's output with the most fre- quent mapping observed during training for the entity name. If the entity was never observed, we copy its name directly from the AMR graph. Anonymizing Dates For dates in AMR graphs, we use separate anonymization tokens for year, month-number, month-name, day-number and day-name, indicating whether the date is men- tioned by word or by number.3 In AMR gener- 2In practice we only used three groups of ids: a different one for NEs, dates and constants/numbers. 3We also use three date format markers that appear in the text as: YYYYMMDD, YYMMDD, and YYYY-MM-DD. Figure 2: Preprocessing methods applied to sentence (top row) - AMR graph (left column) pairs. Sentence-graph pairs after (a) graph simplification, (b) named entity anonymization, (c) named entity clustering, and (d) insertion of scope markers. ation, we render the corresponding format when predicted. Figure 2(b) contains an example of all preprocessing up to this stage. Named Entity Clusters When performing AMR generation, each of the AMR fine-grained entity types is manually mapped to one of the four coarse entity types used in the Stanford NER system (Finkel et al., 2005): person, location, organization and misc. This reduces the sparsity associated with many rarely occurring entity types. Figure 2 (c) contains an example with named entity clusters. NER for Parsing When parsing, we must nor- malize test sentences to match our anonymized training data. To produce fine-grained named enti- ties, we run the Stanford NER system and first try to replace any identified span with a fine-grained category based on alignments observed during training. If this fails, we anonymize the sentence using the coarse categories predicted by the NER system, which are also categories in AMR. After parsing, we deterministically generate AMR for anonymizations using the corresponding text span. 4.2 Linearization Linearization Order Our linearization order is defined by the order of nodes visited by depth first search, including backward travers- ing steps. in Figure 2, start- ing at meet the order contains meet, :ARG0, person, :ARG1-of, expert, :ARG2-of, For example, group, :ARG2-of, :ARG1-of, :ARG0.4 The order traverses children in the sequence they are presented in the AMR. We consider alternative or- derings of children in Section 7 but always follow the pattern demonstrated above. Rendering Function Our rendering function marks scope, and generates tokens following the pre-order traversal of the graph: (1) if the element is a node, it emits the type of the node. (2) if the el- ement is an edge, it emits the type of the edge and then recursively emits a bracketed string for the (concept) node immediately after it. In case the node has only one child we omit the scope mark- ers (denoted with left "(", and right ")" paren- theses), thus significantly reducing the number of generated tokens. Figure 2(d) contains an example showing all of the preprocessing techniques and scope markers that we use in our full model. 5 Experimental Setup We conduct all experiments on the AMR cor- pus used in SemEval-2016 Task 8 (LDC2015E86), which contains 16,833/1,368/1,371 train/dev/test examples. For the paired training procedure of Al- gorithm 1, we use Gigaword as our external cor- pus and sample sentences that only contain words from the AMR corpus vocabulary W . We sub- sampled the original sentence to ensure there is no overlap with the AMR training or test sets. Table 2 4Sense, instance-of and variable information has been removed at the point of linearization. US officials held an expert group meeting in January 2002 in New York.(h / hold-04 :ARG0 (p2 / person :ARG0-of (h2 / have-org-role-91 :ARG1 (c2 / country :name (n3 / name :op1 "United" op2: "States")) :ARG2 (o / official))) :ARG1 (m / meet-03 :ARG0 (p / person :ARG1-of (e / expert-01) :ARG2-of (g / group-01))) :time (d2 / date-entity :year 2002 :month 1) :location (c / city :name (n / name :op1 "New" :op2 "York")))hold :ARG0 person :ARG0-of have-org-role :ARG1 loc_0 :ARG2 official :ARG1 meet :ARG0 person :ARG1-of expert :ARG2-of group :time date-entity year_0 month_0 :location loc_1hold :ARG0 person :ARG0-of have-org-role :ARG1 country_0 :ARG2 official :ARG1 meet :ARG0 person :ARG1-of expert :ARG2-of group :time date-entity year_0 month_0 :location city_1hold :ARG0 person :ARG0-of have-org-role :ARG1 country :name name :op1 United :op2 States :ARG2 official :ARG1 meet :ARG0 person :ARG1-of expert :ARG2-of group :time date-entity :year 2002 :month 1 :location city :name name :op1 New :op2 Yorkhold :ARG0 ( person :ARG0-of ( have-org-role :ARG1 loc_0 :ARG2 official ) ) :ARG1 ( meet :ARG0 ( person :ARG1-of expert :ARG2-of group ) ) :time ( date-entity year_0 month_0 ) :location loc_1US officials held an expert group meeting in January 2002 in New York.country_0 officials held an expert group meeting in month_0 year_0 in city_1.loc_0 officials held an expert group meeting in month_0 year_0 in loc_1.loc_0 officials held an expert group meeting in month_0 year_0 in loc_1.(a)(b)(c)(d) Model SBMT (Pust et al., 2015) JAMR (Flanigan et al., 2016a) CAMR (Wang et al., 2016) CCG* (Artzi et al., 2015) JAMR (Flanigan et al., 2014) GIGA-20M GIGA-2M GIGA-200k AMR-ONLY SEQ2SEQ (Peng et al., 2017) CHAR-LSTM (Barzdins and Gosko, 2016) Dev Prec Rec - - 72.3 67.2 - 62.2 61.9 59.7 54.9 - - - - 61.4 65.1 - 66.0 64.8 62.9 60.0 - - F1 69.0 - 66.6 66.1 - 64.4 63.3 61.3 57.4 - - Test Prec Rec - 69.7 70.4 66.8 64.0 59.7 60.2 57.8 53.1 55.0 - - 64.5 63.1 65.7 53.0 64.7 63.6 60.9 58.1 50.0 - F1 67.1 67.0 66.5 66.3 58.0 62.1 61.9 59.3 55.5 52.0 43.0 Table 1: SMATCH scores for AMR Parsing. *Reported numbers are on the newswire portion of a previous release of the corpus (LDC2014T12). summarizes statistics about the original dataset and the extracted portions of Gigaword. We evalu- ate AMR parsing with SMATCH (Cai and Knight, 2013), and AMR generation using BLEU (Pap- ineni et al., 2002)5. We validated word embedding sizes and RNN hidden representation sizes by maximizing AMR development set performance (Algorithm 1 – line 1). We searched over the set {128, 256, 500, 1024} for the best combinations of sizes and set both to 500. Models were trained by optimiz- ing cross-entropy loss with stochastic gradient de- scent, using a batch size of 100 and dropout rate of 0.5. Across all models when performance does not improve on the AMR dev set, we decay the learning rate by 0.8. For the initial parser trained on the AMR cor- pus, (Algorithm 1 – line 1), we use a single stack version of our model, set initial learning rate to 0.5 and train for 60 epochs, taking the best per- forming model on the development set. All subse- quent models benefited from increased depth and we used 2-layer stacked versions, maintaining the same embedding sizes. We set the initial Giga- word sample size to k = 200, 000 and executed a maximum of 3 iterations of self-training. For pre- training the parser and generator, (Algorithm 1 – lines 4 and 9), we used an initial learning rate of 1.0, and ran for 20 epochs. We attempt to fine-tune the parser and generator, respectively, after every epoch of pre-training, setting the initial learning rate to 0.1. We select the best performing model on 5We use the multi-BLEU script from the MOSES decoder suite (Koehn et al., 2007). Corpus AMR GIGA-200k GIGA-2M GIGA-20M Examples OOV@1 OOV@5 16833 200k 2M 20M 44.7 17.5 11.2 8.0 74.9 35.3 19.1 12.7 LDC2015E86 AMR training set, Table 2: GIGA-200k, GIGA-2M and GIGA-20M statistics; OOV@1 and OOV@5 are the out-of-vocabulary rates on the NL side with thresholds of 1 and 5, re- spectively. Vocabulary sizes are 13027 tokens for the AMR side, and 17319 tokens for the NL side. the development set among all of these fine-tuning attempts. During prediction we perform decoding using beam search and set the beam size to 5 both for parsing and generation. 6 Results Parsing Results Table 1 summarizes our devel- opment results for different rounds of self-training and test results for our final system, self-trained on 200k, 2M and 20M unlabeled Gigaword sen- tences. Through every round of self-training, our parser improves. Our final parser outperforms comparable seq2seq and character LSTM models by over 10 points. While much of this improve- ment comes from self-training, our model with- out Gigaword data outperforms these approaches by 3.5 points on F1. We attribute this increase in performance to different handling of prepro- cessing and more careful hyper-parameter tuning. All other models that we compare against use se- mantic resources, such as WordNet, dependency Dev Test Model 33.1 33.8 GIGA-20M 31.8 32.3 GIGA-2M 27.2 27.4 GIGA-200k AMR-ONLY 21.7 22.0 PBMT* (Pourdamghani et al., 2016) 27.2 26.9 TSP (Song et al., 2016) 21.1 22.4 TREETOSTR (Flanigan et al., 2016b) 23.0 23.0 Table 3: BLEU results for AMR Generation. *Model has been trained on a previous release of the corpus (LDC2014T12). parsers or CCG parsers (models marked with * were trained with less data, but only evaluate on newswire text; the rest evaluate on the full test set, containing text from blogs). Our full models out- perform the original version of JAMR (Flanigan et al., 2014), a graph-based model but still lags behind other parser-dependent systems (CAMR6), and resource heavy approaches (SBMT). Generation Results Table 3 summarizes our AMR generation results on the development and test set. We outperform all previous state-of-the- art systems by the first round of self-training and further improve with the next rounds. Our fi- nal model trained on GIGA-20M outperforms TSP and TREETOSTR trained on LDC2015E86, by over 9 BLEU points.7 Overall, our model incor- porates less data than previous approaches as all reported methods train language models on the whole Gigaword corpus. We leave scaling our models to all of Gigaword for future work. Sparsity Reduction Even after anonymization of open class vocabulary entries, we still encounter a great deal of sparsity in vocabulary given the small size of the AMR corpus, as shown in Ta- ble 2. By incorporating sentences from Gigaword we are able to reduce vocabulary sparsity dramati- cally, as we increase the size of sampled sentences: the out-of-vocabulary rate with a threshold of 5 re- duces almost 5 times for GIGA-20M. Preprocessing Ablation Study We consider the contribution of each main component of our pre- 6Since we are currently not using any Wikipedia resources for the prediction of named entities, we compare against the no-wikification version of the CAMR system. 7We also trained our generator on GIGA-2M and fine- tuned on LDC2014T12 in order to have a direct comparison with PBMT, and achieved a BLEU score of 29.7, i.e., 2.8 points of improvement. Model FULL FULL - SCOPE FULL - SCOPE - NE FULL - SCOPE - NE - ANON BLEU 21.8 19.7 19.5 18.7 Table 4: BLEU scores for AMR generation abla- tions on preprocessing (DEV set). Model Prec Rec 60.0 FULL 54.9 FULL - ANON 22.7 54.2 F1 57.4 32.0 Table 5: SMATCH scores for AMR parsing abla- tions on preprocessing (DEV set). processing stages while keeping our linearization order identical. Figure 2 contains examples for each setting of the ablations we evaluate on. First we evaluate using linearized graphs without paren- theses for indicating scope, Figure 2(c), then with- out named entity clusters, Figure 2(b), and addi- tionally without any anonymization, Figure 2(a). Tables 4 summarizes our evaluation on the AMR generation. Each components is required, and scope markers and anonymization contribute the most to overall performance. We suspect with- out scope markers our seq2seq models are not as effective at capturing long range semantic rela- tionships between elements of the AMR graph. We also evaluated the contribution of anonymiza- tion to AMR parsing (Table 5). Following pre- vious work, we find that seq2seq-based AMR parsing is largely ineffective without anonymiza- tion (Peng et al., 2017). 7 Linearization Evaluation In this section we evaluate three strategies for con- verting AMR graphs into sequences in the context of AMR generation and show that our models are largely agnostic to linearization orders. Our re- sults argue, unlike SMT-based AMR generation methods (Pourdamghani et al., 2016), that seq2seq models can learn to ignore artifacts of the conver- sion of graphs to linear sequences. 7.1 Linearization Orders All linearizations we consider use the pattern de- scribed in Section 4.2, but differ on the order in which children are visited. Each linearization gen- erates anonymized, scope-marked output (see Sec- tion 4), of the form shown in Figure 2(d). Linearization Order BLEU HUMAN 21.7 20.8 GLOBAL-RANDOM RANDOM 20.3 Table 6: BLEU scores for AMR generation for dif- ferent linearization orders (DEV set). Human The proposal traverses children in the order presented by human authored AMR annota- tions exactly as shown in Figure 2(d). Global-Random We construct a random global ordering of all edge types appearing in AMR graphs and re-use it for every example in the dataset. We traverse children based on the posi- tion in the global ordering of the edge leading to a child. Random For each example in the dataset we tra- verse children following a different random order of edge types. 7.2 Results We present AMR generation results for the three proposed linearization orders in Table 6. Ran- dom linearization order performs somewhat worse than traversing the graph according to Human lin- earization order. Surprisingly, a per example ran- dom linearization order performs nearly identi- cally to a global random order, arguing seq2seq models can learn to ignore artifacts of the conver- sion of graphs to linear sequences. Human-authored AMR leaks information The small difference between random and global- random linearizations argues that our models are largely agnostic to variation in linearization order. On the other hand, the model that follows the human order performs better, which leads us to suspect it carries extra information not apparent in the graphical structure of the AMR. To further investigate, we compared the rela- tive ordering of edge pairs under the same par- ent to the relative position of children nodes de- rived from those edges in a sentence, as reported by JAMR alignments. We found that the majority of pairs of AMR edges (57.6%) always occurred in the same relative order, therefore revealing no extra generation order information.8 Of the exam- 8This is consistent with constraints encoded in the anno- tation tool used to collect AMR. For example, :ARG0 edges are always ordered before :ARG1 edges. Error Type Coverage Disfluency Anonymization Sparsity Attachment Other % 29 23 14 13 12 10 Table 7: Error analysis for AMR generation on a sample of 50 examples from the development set. ples corresponding to edge pairs that showed vari- ation, 70.3% appeared in an order consistent with the order they were realized in the sentence. The relative ordering of some pairs of AMR edges was particularly indicative of generation order. For ex- ample, the relative ordering of edges with types location and time, was 17% more indicative of the generation order than the majority of gener- ated locations before time.9 To compare to previous work we still report re- sults using human orderings. However, we note that any practical application requiring a system to generate an AMR representation with the intention to realize it later on, e.g., a dialog agent, will need to be trained either using consistent, or random- derived linearization orders. Arguably, our models are agnostic to this choice. 8 Qualitative Results Figure 3 shows example outputs of our full sys- tem. The generated text for the first graph is nearly perfect with only a small grammatical error due to anonymization. The second example is more challenging, with a deep right-branching struc- ture, and a coordination of the verbs stabilize and push in the subordinate clause headed by state. The model omits some information from the graph, namely the concepts terrorist and virus. In the third example there are greater parts of the graph that are missing, such as the whole sub-graph headed by expert. Also the model makes wrong attachment decisions in the last two sub-graphs (it is the evidence that is unimpeachable and irrefutable, and not the equipment), mostly due to insufficient annota- tion (thing) thus making their generation harder. 9Consider the sentences "She went to school in New York two years ago", and "Two years ago, she went to school in New York", where "two year ago" is the time modifying con- stituent for the verb went and "New York" is the location modifying constituent of went. Finally, Table 7 summarizes the proportions of error types we identified on 50 randomly selected examples from the development set. We found that the generator mostly suffers from coverage issues, an inability to mention all tokens in the input, fol- lowed by fluency mistakes, as illustrated above. Attachment errors are less frequent, which sup- ports our claim that the model is robust to graph linearization, and can successfully encode long range dependency information between concepts. 9 Conclusions We applied sequence-to-sequence models to the tasks of AMR parsing and AMR generation, by carefully preprocessing the graph representation and scaling our models via pretraining on mil- lions of unlabeled sentences sourced from Giga- word corpus. Crucially, we avoid relying on re- sources such as knowledge bases and externally trained parsers. We achieve competitive results for the parsing task (SMATCH 62.1) and state-of-the- art performance for generation (BLEU 33.8). For future work, we would like to extend our work to different meaning representations such as the Minimal Recursion Semantics (MRS; Copes- take et al. (2005)). This formalism tackles certain linguistic phenomena differently from AMR (e.g., negation, and co-reference), contains explicit an- notation on concepts for number, tense and case, and finally handles multiple languages10 (Bender, 2014). Taking a step further, we would like to apply our models on Semantics-Based Machine Translation using MRS as an intermediate rep- resentation between pairs of languages, and in- vestigate the added benefit compared to directly translating the surface strings, especially in the case of distant language pairs such as English and Japanese (Siegel et al., 2016). Acknowledgments The research was supported in part by DARPA under the DEFT program through AFRL (FA8750-13-2-0019) and the CwC program through ARO (W911NF-15-1-0543), the ARO (W911NF-16-1-0121), the NSF (IIS-1252835, IIS-1562364, IIS-1524371), an Allen Distinguished Investigator Award, Samsung GRO, and gifts by Google and Facebook. The au- thors thank Rik Koncel-Kedziorski, the UW NLP group, and the anonymous reviewers for their thorough and helpful com- ments. 10A list of actively maintained languages can be http://moin.delph-in.net/ found GrammarCatalogue here: Figure 3: Linearized AMR after preprocessing, reference sentence, and output of the generator. We mark with colors common error types: disflu- ency, coverage (missing information from the in- put graph), and attachment (implying a semantic relation from the AMR between incorrect entities). limit :arg0 ( treaty :arg0-of ( control :arg1 arms ) ) :arg1 ( number :arg1 ( weapon :mod conventional :arg1-of ( deploy :arg2 ( relative-pos :op1 loc_0 :dir west ) :arg1-of possible ) ) ) SYS: the arms control treaty limits the number of conventional weapons that can be deployed west of Ural Mountains .REF: the arms control treaty limits the number of conventional weapons that can be deployed west of the Ural Mountains . COMMENT: disfluencystate :arg0 ( person :arg0-of ( have-org-role :arg1 ( committee :mod technical ) :arg3 ( expert :arg1 person :arg2 missile :mod loc_0 ) ) ) :arg1 ( evidence :arg0 equipment :arg1 ( plan :arg1 ( transfer :arg1 ( contrast :arg1 ( missile :mod ( just :polarity - ) ) :arg2 ( capable :arg1 thing :arg2 ( make :arg1 missile ) ) ) ) ) :mod ( impeach :polarity - :arg1 thing ) :mod ( refute :polarity - :arg1 thing ) )SYS: a technical committee expert on the technical committee stated that the equipment is not impeach , but it is not refutes .REF: a technical committee of Indian missile experts stated that the equipment was unimpeachable and irrefutable evidence of a plan to transfer not just missiles but missile-making capability.COMMENT: coverage , disfluency, attachmentstate :arg0 report :arg1 ( obligate :arg1 ( government-organization :arg0-of ( govern :arg1 loc_0 ) ) :arg2 ( help :arg1 ( and :op1 ( stabilize :arg1 ( state :mod weak ) ) :op2 ( push :arg1 ( regulate :mod international :arg0-of ( stop :arg1 terrorist :arg2 ( use :arg1 ( information :arg2-of ( available :arg3-of free )) :arg2 ( and :op1 ( create :arg1 ( form :domain ( warfare :mod biology :example ( version :arg1-of modify :poss other_1 ) ) :mod new ) ) :op2 ( unleash :arg1 form ) ) ) ) ) ) ) ) )REF: the report stated British government must help to stabilize weak states and push for international regulations that would stop terrorists using freely available information to create and unleash new forms of biological warfare such as a modified version of the influenza virus .COMMENT: coverage , disfluency, attachmentSYS: the report stated that the Britain government must help stabilize the weak states and push international regulations to stop the use of freely available information to create a form of new biological warfare such as the modified version of the influenza . References Yoav Artzi, Kenton Lee, and Luke Zettlemoyer. 2015. Broad- coverage CCG semantic parsing with AMR. In Proceed- ings of the 2015 Conference on Empirical Methods in Natural Language Processing. Association for Compu- tational Linguistics, Lisbon, Portugal, pages 1699–1710. http://aclweb.org/anthology/D15-1198. Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. 2015. Neural machine translation by jointly learning to align and translate. In Proceedings of the 2015 Interna- tional Conference on Learning Representations. CBLS, San Diego, California. http://arxiv.org/abs/1409.0473. Guntis Barzdins and Didzis Gosko. 2016. RIGA at SemEval-2016 Task 8: Impact of Smatch extensions and character-level neural translation on AMR parsing accu- In Proceedings of the 10th International Work- racy. shop on Semantic Evaluation. Association for Computa- tional Linguistics, San Diego, California, pages 1143– 1147. http://www.aclweb.org/anthology/S16-1176. Emily M. Bender. 2014. Language CoLLAGE: Grammatical description with the LinGO grammar matrix. In Proceed- ings of the 9th International Conference on Language Re- sources and Evaluation. Reykjavik, Iceland, pages 2447– 2451. Johannes Bjerva, Johan Bos, and Hessel Haagsma. 2016. The Meaning Factory at SemEval-2016 Task 8: Producing In Proceedings of the 10th Interna- AMRs with Boxer. tional Workshop on Semantic Evaluation. Association for Computational Linguistics, San Diego, California, pages 1179–1184. http://www.aclweb.org/anthology/S16-1182. Lauritz Brandt, David Grimm, Mengfei Zhou, and Yan- ICL-HD at SemEval-2016 Task 8: nick Versley. 2016. Meaning representation parsing - augmenting AMR pars- ing with a preposition semantic role labeling neural net- In Proceedings of the 10th International Work- work. shop on Semantic Evaluation. Association for Computa- tional Linguistics, San Diego, California, pages 1160– 1166. http://www.aclweb.org/anthology/S16-1179. Shu Cai and Kevin Knight. 2013. an evalu- Smatch: In Pro- ation metric for semantic feature structures. ceedings of the 51st Annual Meeting of the Associa- tion for Computational Linguistics. Association for Com- putational Linguistics, Sofia, Bulgaria, pages 748–752. http://www.aclweb.org/anthology/P13-2131. Ann Copestake, Dan Flickinger, Carl Pollard, and Ivan A. Sag. 2005. Minimal Recursion Semantics: An introduc- tion. Research on Language and Computation 3(2):281– 332. https://doi.org/10.1007/s11168-006-6327-9. Marco Damonte, Shay B. Cohen, and Giorgio Satta. An incremental parser for abstract meaning 2017. the 15th Confer- representation. ence of the European Chapter of the Association for Computational Linguistics. Association for Computa- tional Linguistics, Valencia, Spain, pages 536–546. http://www.aclweb.org/anthology/E17-1051. In Proceedings of Jenny Rose Finkel, Trond Grenager, and Christopher Man- ning. 2005. Incorporating non-local information into in- formation extraction systems by Gibbs sampling. In Proceedings of the 43rd Annual Meeting on Association for Computational Linguistics. Association for Computa- tional Linguistics, Ann Arbor, Michigan, pages 363–370. https://doi.org/10.3115/1219840.1219885. Jeffrey Flanigan, Chris Dyer, Noah A. Smith, and Jaime Car- bonell. 2016a. Cmu at semeval-2016 task 8: Graph-based In Proceedings of amr parsing with infinite ramp loss. the 10th International Workshop on Semantic Evaluation (SemEval-2016). Association for Computational Linguis- tics, pages 1202–1206. https://doi.org/10.18653/v1/S16- 1186. Jeffrey Flanigan, Chris Dyer, Noah A. Smith, and Jaime Car- bonell. 2016b. Generation from abstract meaning repre- In Proceedings of the sentation using tree transducers. 2016 Conference of the North American Chapter of the As- sociation for Computational Linguistics. Association for Computational Linguistics, San Diego, California, pages 731–739. http://www.aclweb.org/anthology/N16-1087. Jeffrey Flanigan, Sam Thomson, Jaime Carbonell, Chris Dyer, and Noah A. Smith. 2014. A discriminative graph- based parser for the abstract meaning representation. In Proceedings of the 52nd Annual Meeting of the Associa- tion for Computational Linguistics. Association for Com- putational Linguistics, Baltimore, Maryland, pages 1426– 1436. http://www.aclweb.org/anthology/P14-1134. James Goodman, Andreas Vlachos, and Jason Narad- owsky. 2016. UCL+Sheffield at SemEval-2016 Task 8: Imitation learning for AMR parsing with an alpha- In Proceedings of the 10th International Work- bound. shop on Semantic Evaluation. Association for Computa- tional Linguistics, San Diego, California, pages 1167– 1172. http://www.aclweb.org/anthology/S16-1180. Lifu Huang, Taylor Cassidy, Xiaocheng Feng, Heng Ji, Clare R. Voss, Jiawei Han, and Avirup Sil. 2016. Lib- eral event extraction and event schema induction. In Proceedings of the 54th Annual Meeting of the Associa- tion for Computational Linguistics. Association for Com- putational Linguistics, Berlin, Germany, pages 258–268. http://www.aclweb.org/anthology/P16-1025. Bevan Jones, Jacob Andreas, Daniel Bauer, Karl Moritz Her- mann, and Kevin Knight. 2012. Semantics-Based Ma- chine Translation with Hyperedge Replacement Gram- In Proceedings of the 2012 International Confer- mars. ence on Computational Linguistics. Bombay, India, pages 1359–1376. http://www.aclweb.org/anthology/C12-1083. 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 In Proceedings of for statistical machine translation. the 45th Annual Meeting of the Association for Com- putational Linguistics. Association for Computational Linguistics, Prague, Czech Republic, pages 177–180. http://dl.acm.org/citation.cfm?id=1557769.1557821. Fei Liu, Jeffrey Flanigan, Sam Thomson, Norman Sadeh, and Noah A. Smith. 2015. Toward abstractive summariza- tion using semantic representations. In Proceedings of the 2015 Conference of the North American Chapter of the Association for Computational Linguistics. Association for Computational Linguistics, Denver, Colorado, pages 1077–1086. http://www.aclweb.org/anthology/N15-1114. Thang Luong, Hieu Pham, and Christopher D. Manning. 2015. Effective approaches to attention-based neural ma- chine translation. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing. Association for Computational Linguistics, Lisbon, Portu- gal, pages 1412–1421. http://aclweb.org/anthology/D15- 1166. Dipendra Kumar Misra and Yoav Artzi. 2016. Neu- In Proceed- ral shift-reduce CCG semantic parsing. ings of the 2016 Conference on Empirical Methods in Natural Language Processing. Association for Compu- tational Linguistics, Austin, Texas, pages 1775–1786. https://aclweb.org/anthology/D16-1183. Courtney Napoles, Matthew Gormley, and Benjamin In Proceed- Van Durme. 2012. Annotated Gigaword. ings of the Joint Workshop on Automatic Knowledge Base Construction and Web-scale Knowledge Extraction. Asso- ciation for Computational Linguistics, Montr´eal, Canada, pages 95–100. http://www.aclweb.org/anthology/W12- 3018. Martha Palmer, Daniel Gildea, and Paul Kingsbury. 2005. The Proposition Bank: An annotated corpus of seman- Computational Linguistics 31(1):71–106. tic roles. http://www.cs.rochester.edu/ gildea/palmer-propbank- cl.pdf. Kishore Papineni, Salim Roukos, Todd Ward, and Wei- Jing Zhu. 2002. Bleu: a method for automatic eval- In Proceedings of uation of machine translation. 40th Annual Meeting of the Association for Computa- tional Linguistics. Association for Computational Lin- guistics, Philadelphia, Pennsylvania, USA, pages 311– 318. https://doi.org/10.3115/1073083.1073135. Xiaochang Peng, Chuan Wang, Daniel Gildea, and Nian- wen Xue. 2017. Addressing the data sparsity issue In Proceedings of the 15th in neural AMR parsing. Conference of the Associa- tion for Computational Linguistics. Association for Com- putational Linguistics, Valencia, Spain, pages 366–375. http://www.aclweb.org/anthology/E17-1035. the European Chapter of Nima Pourdamghani, Yang Gao, Ulf Hermjakob, and Aligning English strings with Kevin Knight. 2014. In Proceed- abstract meaning representation graphs. ings of the 2014 Conference on Empirical Methods in Natural Language Processing. Association for Com- putational Linguistics, Doha, Qatar, pages 425–429. http://www.aclweb.org/anthology/D14-1048. Nima Pourdamghani, Kevin Knight, and Ulf Hermjakob. 2016. Generating English from abstract meaning repre- In Proceedings of the 9th International Nat- sentations. ural Language Generation conference. Association for Computational Linguistics, Edinburgh, UK, pages 21–25. http://anthology.aclweb.org/W16-6603. Michael Pust, Ulf Hermjakob, Kevin Knight, Daniel Marcu, and Jonathan May. 2015. Parsing english into abstract meaning representation using syntax-based machine trans- lation. In Proceedings of the 2015 Conference on Empiri- cal Methods in Natural Language Processing. Association for Computational Linguistics, Lisbon, Portugal, pages 1143–1154. https://aclweb.org/anthology/D/D15/D15- 1136. Yevgeniy Puzikov, Daisuke Kawahara, and Sadao Kurohashi. 2016. M2L at SemEval-2016 Task 8: AMR parsing with In Proceedings of the 10th Interna- neural networks. tional Workshop on Semantic Evaluation. Association for Computational Linguistics, San Diego, California, pages 1154–1159. http://www.aclweb.org/anthology/S16-1178. Rico Sennrich, Barry Haddow, and Alexandra Birch. 2016. Improving neural machine translation models with mono- lingual data. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics. Asso- ciation for Computational Linguistics, Berlin, Germany, pages 86–96. http://www.aclweb.org/anthology/P16- 1009. Melanie Emily M. Bender, and Siegel, Bond. 2016. mar of tional Linguistics. CSLI http://web.stanford.edu/group/cslipublications/cslipublications/site/9781684000180.shtml. Francis An Implemented Gram- in Computa- Stanford. CSLI Studies Publications, Jacy: Japanese. Linfeng Song, Yue Zhang, Xiaochang Peng, Zhiguo Wang, AMR-to-text generation and Daniel Gildea. 2016. In Proceedings of as a traveling salesman problem. the 2016 Conference on Empirical Methods in Nat- ural Language Processing. Association for Computa- tional Linguistics, Austin, Texas, pages 2084–2089. https://aclweb.org/anthology/D16-1224. Sho Takase, Jun Suzuki, Naoaki Okazaki, Tsutomu Hirao, and Masaaki Nagata. 2016. Neural headline genera- In Proceed- tion on abstract meaning representation. ings of the 2016 Conference on Empirical Methods in Natural Language Processing. Association for Compu- tational Linguistics, Austin, Texas, pages 1054–1059. https://aclweb.org/anthology/D16-1112. Oriol Vinyals, Ł ukasz Kaiser, Terry Koo, Slav Petrov, Gram- Ilya Sutskever, and Geoffrey Hinton. 2015. In Proceedings of mar as a foreign language. the 28th International Conference on Neural Infor- mation Processing Systems, MIT Press, pages 2773– 2781. http://papers.nips.cc/paper/5635-grammar-as-a- foreign-language.pdf. Chuan Wang, Sameer Pradhan, Xiaoman Pan, Heng Ji, and Nianwen Xue. 2016. CAMR at SemEval-2016 Task 8: An extended transition-based AMR parser. In Proceedings of the 10th International Workshop on Semantic Evaluation. Association for Computational Linguistics, San Diego, California, pages 1173–1178. http://www.aclweb.org/anthology/S16-1181. Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V. Le, Mo- hammad 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. 2016. Google's neural ma- chine translation system: Bridging the gap between hu- man and machine translation. CoRR abs/1609.08144. http://arxiv.org/abs/1609.08144. Junsheng Zhou, Feiyu Xu, Hans Uszkoreit, Weiguang QU, Ran Li, and Yanhui Gu. 2016. AMR parsing with an in- cremental joint model. In Proceedings of the 2016 Confer- ence on Empirical Methods in Natural Language Process- ing. Association for Computational Linguistics, Austin, Texas, pages 680–689. https://aclweb.org/anthology/D16- 1065.
1712.07229
1
1712
2017-12-19T21:43:59
Attentive Memory Networks: Efficient Machine Reading for Conversational Search
[ "cs.CL" ]
Recent advances in conversational systems have changed the search paradigm. Traditionally, a user poses a query to a search engine that returns an answer based on its index, possibly leveraging external knowledge bases and conditioning the response on earlier interactions in the search session. In a natural conversation, there is an additional source of information to take into account: utterances produced earlier in a conversation can also be referred to and a conversational IR system has to keep track of information conveyed by the user during the conversation, even if it is implicit. We argue that the process of building a representation of the conversation can be framed as a machine reading task, where an automated system is presented with a number of statements about which it should answer questions. The questions should be answered solely by referring to the statements provided, without consulting external knowledge. The time is right for the information retrieval community to embrace this task, both as a stand-alone task and integrated in a broader conversational search setting. In this paper, we focus on machine reading as a stand-alone task and present the Attentive Memory Network (AMN), an end-to-end trainable machine reading algorithm. Its key contribution is in efficiency, achieved by having an hierarchical input encoder, iterating over the input only once. Speed is an important requirement in the setting of conversational search, as gaps between conversational turns have a detrimental effect on naturalness. On 20 datasets commonly used for evaluating machine reading algorithms we show that the AMN achieves performance comparable to the state-of-the-art models, while using considerably fewer computations.
cs.CL
cs
Attentive Memory Networks: Efficient Machine Reading for Conversational Search Tom Kenter University of Amsterdam Amsterdam, The Netherlands [email protected] Maarten de Rijke University of Amsterdam Amsterdam, The Netherlands [email protected] 7 1 0 2 c e D 9 1 ] L C . s c [ 1 v 9 2 2 7 0 . 2 1 7 1 : v i X r a ABSTRACT Recent advances in conversational systems have changed the search paradigm. Traditionally, a user poses a query to a search engine that returns an answer based on its index, possibly leveraging external knowledge bases and conditioning the response on earlier interactions in the search session. In a natural conversation, there is an additional source of information to take into account: utterances produced earlier in a conversation can also be referred to and a conversational IR system has to keep track of information conveyed by the user during the conversation, even if it is implicit. We argue that the process of building a representation of the conversation can be framed as a machine reading task, where an automated system is presented with a number of statements about which it should answer questions. The questions should be an- swered solely by referring to the statements provided, without consulting external knowledge. The time is right for the informa- tion retrieval community to embrace this task, both as a stand-alone task and integrated in a broader conversational search setting. In this paper, we focus on machine reading as a stand-alone task and present the Attentive Memory Network (AMN), an end-to-end trainable machine reading algorithm. Its key contribution is in effi- ciency, achieved by having an hierarchical input encoder, iterating over the input only once. Speed is an important requirement in the setting of conversational search, as gaps between conversational turns have a detrimental effect on naturalness. On 20 datasets com- monly used for evaluating machine reading algorithms we show that the AMN achieves performance comparable to the state-of-the- art models, while using considerably fewer computations. CCS CONCEPTS • Human-centered computing → Natural language interfaces; ACM Reference Format: Tom Kenter and Maarten de Rijke. 2017. Attentive Memory Networks: Ef- ficient Machine Reading for Conversational Search. In Proceedings of 1st International Workshop on Conversational Approaches to Information Re- trieval (CAIR'17). ACM, New York, NY, USA, 7 pages. 1 INTRODUCTION Recent advances in conversational systems [18, 19] have changed the search paradigm. In a classic setting, a search engine answers Permission to make digital or hard copies of part or all 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 third-party components of this work must be honored. For all other uses, contact the owner/author(s). CAIR'17, August 11, 2017, Tokyo, Japan © 2017 Copyright held by the owner/author(s). . a query based on an index, possibly enriching it with information from an external knowledge base [25]. Additionally, previous in- teractions in the same session can be leveraged [6]. In addition to these sources, in natural language conversations, information contained in previous utterances can be referred to, even implicitly. Suppose a conversational system has to answer the query Where are my keys? based on a previous statement I was home before I went to work, which is where I found out I didn't have my keys with me. The statement conveys a lot of information, including the likely possibility that the keys are still at the speaker's house. As is clear from this example, indices or external knowledge bases are of no avail in this setting. It is crucial for a conversational system to maintain an internal state, representing the dialogue with the user so far. To address this issue, substantial work has been done in goal-oriented dialogues, tailored to specific settings such as restau- rant reservations [3] and the tourist domain [13]. We argue that a generic conversational agent should be able to maintain a dialogue state without being constrained to a particular task with prede- termined slots to be filled. The time has come for the Information Retrieval (IR) community to address the task of machine reading for conversational search [18]. As an important step towards generic conversational IR [15], we frame the task of conversational search as a general machine reading task [10, 11], where a number of statements is provided to an automated agent that answers questions about it. This scenario is different from the traditional question answering setting, in which questions are typically factoid in nature, and answers are based on background knowledge or external sources of knowledge. In the machine reading task, much as in a natural conversation, a number of statements is provided, and the conversational agent should be able to answer questions based on its understanding of these statements alone. In [11], for example, a single Wikipedia page is provided to a machine algorithm which has to answer questions about it. In [26] the machine reads stories abouts persons and objects and has to keep track of their whereabouts. Memory networks have proven to be an effective architecture in machine reading tasks [22, 27]. Their key component is a memory module in which the model stores intermediate representations of input, that can be seen as multiple views on the input so far, from which a final output is computed. Speed is an important constraint in the context of conversational agents, since long pauses between turns hamper the naturalness of a conversation. We strive for an efficient architecture, and propose to use a hierarchical input encoder. Input can be large, hundreds of words, and we hypothesize that first processing the input to get a smaller set of higher-level input representations can benefit a network in two ways: (1) the higher-level representations provide a distilled representation of the CAIR'17, August 11, 2017, Tokyo, Japan Tom Kenter and Maarten de Rijke input; (2) as there are fewer higher-level representations it should be (computationally) easier for the network to focus on the relevant parts of the input. In short, in this paper we present the Attentive Memory Network (AMN), an end-to-end trainable memory network, with hierarchical input encoder. To test its general applicability we use 20 machine reading datasets specifically designed to highlight different aspects of natural language understanding. We show that the AMN achieves performance comparable to the state-of-the-art models, while using considerably fewer computations. 3 ATTENTIVE MEMORY NETWORKS To facilitate the presentation of our Attentive Memory Networks, we first briefly recapitulate standard sequence-to-sequence models. Recurrent cells An input sequence is processed one unit per time step, where the recurrent cell computes a new state ht as a function of an input representation x and a hidden state ht−1 as: ht = f (x, ht−1; θ), (1) 2 RELATED WORK Machine reading is a much-studied domain [4, 10, 11]. It is related to question answering, the difference being that in question answering, external domain or world knowledge is typically needed to answer questions [7, 17, 29], while in machine reading answers should be inferred from a given text. Hierarchical encoders are employed in a dialogue setting in [20] and for query suggestion in [21]. In both works, the hierarchical encoder is also trained, for every input sentence, to predict every next input sentence, a setting we did not experiment with. We build on previous work on memory networks [22, 23, 27], in particular on dynamic memory networks [16, 28]. Memory net- works are an extension of standard sequence-to-sequence archi- tectures; their distinguishing feature is a memory module added between the encoder and decoder. As they are typically applied in question answering settings, there are two encoders, one for a question and one for a document the question is about. The decoder does not have access to the input but only to the memory module, which distills relevant information from the input, conditioned on the question. The key difference between the Attentive Memory Network we propose and the work in [16, 28], is in the defining component, the memory module. In [16, 28], to obtain every next memory, a Gated Recurrent Unit (GRU) cell iterates over the input sequence. This leads to a memory intensive and computationally expensive architecture, since multiple cells are repeatedly being unrolled over the input sequence. The number of steps an Recurrent Neural Network (RNN) is unrolled for, i.e., the number of input rep- resentations it reads, together with the hidden state size, is the main determining factor regarding computational complexity. Therefore, we propose to obtain memories by an RNN that, rather than iterat- ing over the entire input, only applies attention over it, which is a much cheaper operation (see §3). In [22] an attention-based memory network is presented, where the input is represented as a sequence of embeddings on which attention is computed (i.e., there is no input reader). Our Attentive Memory Network differs from this work in that we do use an input reader, a hierarchical RNN. As a consequence, our memory module has far fewer hidden states to attend over. At the output side, we use GRUs to decode answers, which is different from the softmax over a dot product between the sum of attention-weighted input and question employed in [22]. To sum up, we propose a memory network that shares its overall architecture with previous models, and that differs in how all key components are constructed, with a view to improve efficiency and, thereby, enable its usage in conversational search scenarios. 2 n based on internal parameters θ. The function f itself can be imple- mented in many ways, for example as an Long Short-Term Mem- ory (LSTM) [12] or Gated Recurrent Unit (GRU) cell [5]. The initial hidden state h0 is usually a 0-vector. For a given input Xenc = ]-e.g., embeddings representing words in a [xenc 1 sentence-an encoder repeatedly applies this function, which yields an n×denc matrix Henc = [henc ] of n hidden states 1 of dimension denc. , . . . , henc , . . . , xenc , henc , xenc A decoder generates output according to Equation 1, where the initial hidden state is the last hidden state of the encoder henc . The predicted output at time step t, ot , is typically generated from the hidden state of the decoder, hdec , by calculating a softmax over the vocabulary V : n n 2 t  o = arg max v∈V t ·v ehdec v′∈V ehdec t ·v′ . (2) Here V is a matrix of vector representations v, representing words in the output vocabulary. At training time, the embedding of the correct word-the word that should have been returned-is usually given as input to the recurrent cell at time step t + 1. Attention An attention mechanism was proposed in [2], which gives the decoder access to the hidden states of an encoder. Instead of using Equation 1 to produce a new hidden state dependent only on the input, the computation now also depends on Hatt , the states to attend over, typically the states of the encoder. Following, e.g., [24], we have: hdec t = д(xdec , Hatt , hdec t−1) = Wproj · dt hdec , t where is the concatenation operator, hdec = f (xdec , hdec from Equation 1 and dt is calculated from Hatt by: t (3) t−1; θdec) n i =1 at,i hatt dt = i at = softmax(ut) ut,i = vT tanh(W1hatt i + W2hdec t ), i where hatt is the i-th state in Hatt and W1 and W2 are extra parameters learned during training. From the hidden state produced this way, output can be generated by applying Equation 2 as usual. Attentive Memory Networks CAIR'17, August 11, 2017, Tokyo, Japan Figure 1: Attentive Memory Network. Connected blocks sharing color represent RNNs. Attention is depicted by dashed lines. 3.1 Attentive Memory Network architecture Document encoder. To encode the document we use a hierarchi- cal approach. First, a word-level RNN is used to encode sentences. We now present the Attentive Memory Network (AMN) architec- The word-level encoder is applied for every sentence individually. ture. AMNs, like traditional sequence-to-sequence networks, are The unroll length is the maximum sentence length in words. For composed of recurrent neural networks. Their key part is a memory sentences S ∈ {s1, s2, . . . , sS } the word-level encoder yields Hwrd, module, which is a recurrent network itself. It stores memories by an S × dwrd matrix. attending over the input document, conditioned on the question. As can be seen from Equation 3, the computational complexity of the attention mechanism is primarily dependent on the size of Hatt , the states to attend over. To keep this matrix small, a hierarchical approach is taken, where the input is first read by a word-level document encoder, which reads word embeddings-also trained by the model-per sentence to compute sentence representations. A sentence-level encoder iterates over these sentence embeddings to get a final document encoding. The memory module only has access to the sentence embeddings produced by the sentence-level encoder. For example, if the input consists of 20 sentences of 12 words each, the memory module of the AMN attends over 20 sen- tence representations, rather than over 240 representations, had a non-hierarchical word-level approach been taken. The sentence representations in Hwrd are read as a sequence by a sentence-level encoder. Following, e.g., [28], we use a bidirectional RNN for the sentence-level encoder, which for S sentences and a hidden state size dsen yields Hsen, an S × dsen matrix. The final state of the question encoder, hque Q , is used as initial value of the hidden states of the sentence-level encoder. Memory module. The memory module consists of a single recur- rent cell that produces M, a matrix of m memory representations of dimension dmem. The i-th memory mi is computed conditioned on the question representation and the sentence representations, analogous to Equation 3, as: (cid:17) (cid:16) mi = д hque Q , Hsen, mi−1 . (4) Figure 1 shows a graphical overview of the network layout. There are two input encoders, a question encoder and a word-level doc- ument encoder. The memory module, the green block in Figure 1, attends over the sentence embeddings to extract relevant parts of the input, conditioned on the question. Lastly, the answer decoder attends over the memory states, to produce the final output. Let us turn to the details. Question encoder. For encoding the question we use a single Recurrent Neural Network (RNN). For a question Q ∈ {q1, q2, ..., qQ } it produces a final state hque Q , a vector of dimension dque, that is used as a distributed representation of the question. That is, the final representation of the question encoder hque is Q repeatedly provided as input to a recurrent cell, whose hidden state is computed from the memory it produced previously, mi−1, while attending over the hidden states of the sentence-level encoder Hsen. The final representation of the sentence-level document encoder is used to initialize the hidden state of the memory cell, m0. Answer decoder. Finally, the decoder produces an answer using is computed by attending over the memory hsenS Equation 2, where hdec states: t hdec t = д(xdec t t−1). , M, hdec memory moduleanswer decoderquestion encoderword-leveldocumentencoderbidirectionalsentence-levelencoderword1,1word1,2word1,n...word2,1word2,2word2,n...wordm,1wordm,2wordm,n...answer1,1answer1,2answer1,n...question1,1question1,2question1,n...sentence1sentence2sentencem CAIR'17, August 11, 2017, Tokyo, Japan Tom Kenter and Maarten de Rijke 3.2 Efficiency As can be seen from Equation 4, the memory module is a recur- rent cell itself. In previous memory networks, the memory module passes over the input multiple times, updating memory after each pass [16, 28]. The key difference in our approach is that AMNs iterate over the input only once, but attend over it multiple times. This is more efficient, as the attention mechanism (Equation 3) has far less paramaters than an LSTM or GRU recurrent cell, which update multiple gates and an internal state at every time step. The attention mechanism calculates a softmax over the input encodings, the number of which in our case is reduced to number of input sentences, rather than words, by the hierarchical encoder. Additionally, the AMN needs relatively few iterations to learn. Details per evaluation set are provided in §5.2. 4 EXPERIMENTAL SETUP To the best of our knowledge, there is currently no conversational search data set (consisting of sequences of utterances plus questions about these utterances) on which we could evaluate AMN. Instead we evaluate AMN on a broad collection of more traditional machine reading datasets. Specifically, we evaluate AMN on the 20 datasets provided by the bAbi tasks [26], of which we use the 10k sets, version 1.2. The sets consist of stories, 2 to over 100 sentences in length, and questions about these stories. The 20 sets are designed to highlight different aspects of natural language understanding like counting, deduction, induction and spatial reasoning. As argued by Kumar et al. [16], while showing the ability to solve one of the bAbi tasks is not sufficient to conclude a model would succeed at the same task on real world text data -such as conversational search data- it is a necessary condition. Every dataset in the bAbi collection comes as a training set of 10,000 examples and a test set of 1,000 examples. We split the 10,000 training examples of each dataset into a training set-the first 9,000 examples-and a validation set-the remaining 1,000 examples-on which we tune the hyperparameters. All text is lowercased. We use GRU cells [5] for all recurrent cells. To restrict the number of hyperparameters to tune, the same value is used for all embed- ding sizes, and for the state sizes of all recurrent cells. I.e., for an embedding size e, we have e = dque = dwrd = dsen = dmem, which is either 32 or 64. The weights of the question encoder and document word-level encoder are tied. GRU cells can be stacked and we experiment with 1 to 3 level deep encoder, memory, and decoder cells, the depths of which always match (i.e., if, for example, 3-level encoder cells are used, 3-level decoder cells are used). We use a single embedding matrix for the words in the question, document and answer. The number of memories to generate, m, is chosen from {1, 2, 3}. Dropout is applied at every recurrent cell, the dropout probability being either 0.0 (no dropout), 0.1 or 0.2. We optimize cross entropy loss between actual and predicted answers, using Adam [14] as optimization algorithm and set the initial learning rate to one of {0.1, 0.5, 1.0}. We measure performance every 1000 training examples. If the loss does not improve or performance on the validation set decreases for three times in a row, the learn- ing rate is annealed by dividing it by 2. The maximum norm for gradients is either 1 or 5. The batch size is set to 50. Table 1: Results in terms of error rate on the bAbi 10k tasks. For comparison, results of previous work are copied from [22, MemN2N], [8, DNC], [28, DMN+], and [9, EntNet]. Dataset single supporting fact two supporting facts three supporting facts two arg relations three arg relations yes-no questions counting lists sets simple negation indefinite knowledge basic coreference conjunction compound coreference time reasoning basic deduction basic induction positional reasoning size reasoning path finding agents motivations number of tasks solved MemN2N DNC DMN+ EntNet AMN 0.0 0.0 0.1 4.1 4.1 29.1 0.0 0.0 0.3 0.7 0.2 0.2 0.0 3.1 0.5 0.3 0.1 0.0 0.6 0.1 0.3 0.0 0.0 0.0 1.3 0.0 0.0 3.6 0.0 0.0 0.2 45.4 0.5 1.6 0.3 0.9 2.3 0.3 0.0 0.0 20 18 0.0 0.0 0.4 0.3 1.8 2.1 0.0 0.0 0.8 0.8 0.0 0.1 0.6 2.0 0.3 0.9 0.2 0.3 0.2 0.0 0.0 0.1 0.0 0.0 0.1 0.0 0.4 0.1 0.0 0.0 51.8 55.1 18.6 12.0 5.3 0.8 3.9 2.3 0.0 0.0 18 18 0.0 0.3 1.1 0.0 0.5 0.0 2.4 0.0 0.0 0.0 0.0 0.0 0.0 0.2 0.0 45.3 4.2 2.1 0.0 0.0 19 Table 2: Hyperparameter values for the minimal AMNs that were fastest in achieving best performance on the validation set. The size refers to both size of embeddings and hidden states. The last column lists the number of batches needed. Dataset single supporting fact two supporting facts three supporting facts two arg relations three arg relations yes-no questions counting lists sets simple negation indefinite knowledge basic coreference conjunction comp coreference time reasoning basic deduction basic induction positional reasoning size reasoning path finding agents motivations size # layers # mem # batches 1,000 32 12,200 64 14,000 64 32 1,200 3,000 32 3,800 32 5,000 32 32 4,400 3,200 32 3,800 32 1,400 32 1,200 32 32 10,000 6,000 64 2,200 32 10,200 64 32 6,200 2,400 32 13,000 64 32 3,600 1 2 2 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 3 3 1 2 1 3 1 2 1 2 1 1 1 1 2 3 3 1 3 We implemented the AMN in Tensorflow [1]. The implementa- tion is released under an open source license and is available at https: //bitbucket.org/TomKenter/attentive-memory-networks-code. Attentive Memory Networks CAIR'17, August 11, 2017, Tokyo, Japan 5 RESULTS AND ANALYSIS We present the results of the experiments described in §4 and pro- vide an analysis of the results. 5.1 Main results Table 1 lists the results of our Attentive Memory Network (AMN) on the 20 bAbi 10k datasets, together with results of previous ap- proaches. Following [26], we consider a dataset solved if the error rate is less than 5%. As can be seen from the Table 1, AMN solves 18 of the 20 datasets. This is particularly noteworthy given the fact that it is a general framework, not catered towards tracking entities (as in [9]). More- over, the AMN needs an order of magnitude fewer computation steps than previous memory network architectures used for these tasks [16, 28] as it only reads the input once. There are two tasks the AMN does not solve. The basic induc- tion set proves to be hard for the AMN, as it does for most other networks. More interestingly, the three supporting facts sets is prob- lematic as well. This dataset has the longest documents, sometimes over 100 sentences long. Analysis of the results, see below for ex- amples, shows that the probability mass of the attention vectors of the memory module is much more spread out across sentences then it is in other sets. That is, the network struggles to keep its attention focused. The results in Table 1 show that the AMN can solve a wide variety of machine reading tasks and that it behaves different from other memory networks. 5.2 Analysis We analyze the hyperparameter settings used to produce the re- sults in Table 1 and provide examples of the inner workings of the attention mechanism of the memory module. Hyperparameters and speed of convergence. Table 2 lists the hy- perparameter values for the smallest AMNs that achieve the best performance on the validation set, with fewest training examples. Here, smallest network refers to the size of the network in terms of embedding size and number of memories. The last column lists the number of batches needed. As can be seen from Table 2, AMNs can learn fast. As an example, it needs only 5 epochs to solve the first dataset: there are 10k examples-1,000 batches of 50 examples = 50k examples = 5 epochs. This is in contrast to the 100 epochs reported in [22] and 256 epochs listed as a maximum in [16]. Interestingly, adding depth to a network by stacking GRU cells was helpful in only 3 out of 20 cases. Result analysis. Figure 2 shows a visualization of the attention vectors of the memory module. The attention is visualized per memory step. Although some stories in the dataset are over 100 sentences in length, short examples were picked here, for reasons of brevity. Every column represents a memory step, and the values per memory step add up to 1 (barring rounding errors). Figure 2a shows an example where one memory step is used. The attention focuses on the last time Daniel, the person the question is about, is mentioned. Interestingly, the second sentence also gets some attention, presumably because the bedroom, which features in the question, is being referred to. A particularly striking detail is that-correctly-nearly no attention is paid to the fifth sentence, although it is almost identical to the question. In Figure 2b, attention is highest for sentences in which the per- son being asked about is referred to. This is especially noteworthy, as the reference is only by a personal pronoun, which moreover refers to two people. For the size reasoning dataset, three memory steps were needed (see Table 2). An example is shown in Figure 2c. The first mem- ory step mistakenly focuses on the sixth sentence about the chest. Gradually, however, the memory module recovers from this error, and attention shifts to the fourth sentence about the suitcase. Figure 2d shows the ability of the network to focus only on relevant parts. Although the seventh and tenth sentence are nearly identical, it is the last sentence that matters, and it is this sentence the network attends to almost solely. Curiously, the two memory steps attend to the same sentences, which is consistently the case for this dataset. This might indicate that a single memory step could suffice too. Indeed, experiments show that on some datasets networks with fewer memory steps achieve the same or nearly the same performance as bigger networks, but take longer to reach it. The extra memory steps might serve as extra training material. The last two cases, Figure 2e and 2f, are from the three support- ing facts dataset that the model could not solve. What stands out immediately is the fact that the attention is much more spread out than in other cases. This is the case throughout the entire dataset. It shows that the model is confused and fails to learn what is relevant. In Figure 2e just reading the last five sentences would have been enough. The model does seem to capture that John picked up the apple, but only very weakly so. The crucial sentence, third form the end, is the sentence the model pays least attention to. Figure 2e shows the model being even more confused. It starts out by attend- ing mostly to Mary, who has nothing to do with the story. The sentences that do matter, again, get very little attention. Overall, these examples indicate that, when the AMN learns to solve a task, its memory module is very decisive in paying attention to the relevant parts of the input and ignoring the rest. 6 CONCLUSION As search becomes more conversational, the machine reading task, where a system is able to answer questions against prior utterances in a conversation, becomes a highly relevant task for Information Retrieval (IR). We introduced Attentive Memory Networks (AMNs), efficient end-to-end trainable memory networks with a hierarchical input encoder. AMNs perform nearly as well as existing machine reading algorithms, with less computation. Analysis shows they typically need only a few epochs to achieve optimal performance, making them ideally suited for IR's high efficiency settings. Our findings indicate that a straightforward architecture like the AMN is sufficient for solving a wide variety of machine reading tasks. The bAbi datasets provide an ideal test bed for machine reading algorithms as the tasks and evaluation are well-defined. However, it would also be interesting to test the performance of AMNs on bigger datasets, with more varied and noisier problems, especially ones that are directly derived from conversational search scenarios. CAIR'17, August 11, 2017, Tokyo, Japan Tom Kenter and Maarten de Rijke (a) Dataset: yes-no questions, question: 'is daniel in the bedroom?', prediction: 'no', ground truth: 'no'. (b) Dataset: compound coreference, ques- tion: 'where is daniel?', prediction: 'hallway', ground truth: 'hallway'. (c) Dataset: size reasoning, question: 'is the suitcase bigger than the chocolate?', predic- tion: 'yes', ground truth: 'yes'. (d) Dataset: three arg relations, question: 'what did bill give to mary?', prediction: 'ap- ple', ground truth: 'apple'. (e) Dataset: three supporting facts, ques- tion: 'where was the apple before the bath- room?', prediction: 'garden', ground truth: 'bedroom'. (f) Dataset: three supporting facts, question: 'where was the milk before the office?', pre- diction: 'hallway', ground truth: 'kitchen'. Figure 2: Attention visualizations. The attention is visualized per memory step. Every column represents a memory step, and adds up to 1 (allowing for rounding errors), except in the last two examples where some (irrelevant) sentences were left out. Although some stories in the dataset are over 100 sentences in length, short examples were picked here, for brevity. Memory networks have also been applied in settings where external knowledge is available, in particular in the form of key- value pairs [17]. Although this setting is different from the machine reading setting, it would be interesting to see how AMNs could be applied here. Finally, in a conversational setting involving multiple actors, it would be challenging for the memory module to attend to the utterances of the right actor at the right time. A richer attention- like mechanism seems to be needed. One that allows a decoder to attend to specific parts of the input, including the utterances produced by the system itself, conditioned on whose utterances are being referred to. ACKNOWLEDGMENTS We would like to thank Nikos Voskarides of the University of Ams- terdam for valuable feedback on an earlier version of the manuscript, and Llion Jones and Daniel Hewlett of Google Research for many inspiring discussions on topics related to the work in this paper. This research was supported by Ahold Delhaize, Amsterdam Data Science, the Bloomberg Research Grant program, the Criteo Faculty Research Award program, the Dutch national program COMMIT, Elsevier, the European Community's Seventh Frame- work Programme (FP7/2007-2013) under grant agreement nr 312827 (VOX-Pol), the Microsoft Research Ph.D. program, the Netherlands Institute for Sound and Vision, the Netherlands Organisation for Scientific Research (NWO) under project nrs 612.001.116, HOR-11- 10, CI-14-25, 652.002.001, 612.001.551, 652.001.003, and Yandex. All content represents the opinion of the authors, which is not nec- essarily shared or endorsed by their respective employers and/or sponsors. REFERENCES [1] Martín Abadi, Ashish Agarwal, Paul Barham, et al. 2015. TensorFlow: Large- scale machine learning on heterogeneous distributed systems. arXiv preprint arXiv:1603.04467 (2015). [2] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. 2014. Neural machine translation by jointly learning to align and translate. In ICLR. [3] Antoine Bordes and Jason Weston. 2016. Learning end-to-end goal-oriented dialog. arXiv preprint arXiv:1605.07683 (2016). [4] Jianpeng Cheng, Li Dong, and Mirella Lapata. 2016. Long short-term memory- networks for machine reading. In EMNLP. [5] Kyunghyun Cho, Bart Van Merriënboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. 2014. Learning phrase representations using RNN encoder-decoder for statistical machine translation. In EMNLP. [6] Carsten Eickhoff, Jaime Teevan, Ryen W. White, and Susan T. Dumais. 2014. Lessons from the journey: a query log analysis of within-session learning. In WSDM. [7] Anthony Fader, Luke S. Zettlemoyer, and Oren Etzioni. 2013. Paraphrase-driven learning for open question answering. In ACL. [8] Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Ag- nieszka Grabska-Barwińska, Sergio Gómez Colmenarejo, Edward Grefenstette, Tiago Ramalho, John Agapiou, et al. 2016. Hybrid computing using a neural network with dynamic external memory. Nature 538 (2016), 471–476. [9] Mikael Henaff, Jason Weston, Arthur Szlam, Antoine Bordes, and Yann LeCun. 2016. Tracking the world state with recurrent entity networks. arXiv preprint arXiv:1612.03969 (2016). [10] Karl Moritz Hermann, Tomas Kocisky, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman, and Phil Blunsom. 2015. Teaching machines to read and comprehend. In NIPS. .000mary got the milk there.073john moved to the bedroom.000mary discarded the milk.000john went to the garden.004daniel moved to the bedroom.193daniel went to the garden.727daniel travelled to the bathroom.002sandra travelled to the bedroom.000mary took the football there.000sandra grabbed the milk there.000mary and daniel travelled to the bedroom.000then they journeyed to the hallway.002daniel and sandra went back to the garden.384following that they journeyed to the bathroom.002sandra and john went back to the bedroom.000then they journeyed to the garden.000john and daniel moved to the office.025after that they went back to the hallway.001sandra and daniel travelled to the bedroom.587after that they travelled to the hallway.001.004.005the box is bigger than the chocolate.036.090.105the chocolate fits inside the suitcase.024.066.080the box is bigger than the box of chocolates.216.272.296the box of chocolates fits inside the suitcase.052.076.080the box is bigger than the box of chocolates.458.316.275the chocolate fits inside the chest.120.098.090the chocolate fits inside the box.091.075.067the box of chocolates fits inside the box.001.000.000the suitcase is bigger than the chest.001.002.002the suitcase is bigger than the chocolate.000.000bill moved to the bedroom.000.000fred went to the hallway.000.000jeff went to the garden.000.000fred travelled to the office.000.000mary took the apple there.000.000mary passed the apple to bill.000.000bill gave the apple to mary.053.045mary passed the apple to bill.000.000fred travelled to the bathroom.940.950bill passed the apple to mary.002.002bill went back to the office.004.003mary dropped the apple..........042.043.041mary grabbed the apple.032.031.030john travelled to the hallway.031.029.029mary went back to the hallway.040.039.038sandra went back to the bedroom.038.036.035mary left the apple.038.035.034john dropped the milk.049.052.051john got the apple.041.041.041john dropped the apple..........045.039.040john picked up the apple.018.014.015sandra went back to the garden.006.006.007john went back to the bedroom.002.002.003john went back to the bathroom.002.002.002mary moved to the garden..........074.045.048daniel travelled to the hallway.121.067.075mary travelled to the hallway.070.047.049mary went to the office.050.033.033sandra journeyed to the bathroom.057.037.037daniel took the milk.054.033.036daniel travelled to the kitchen.018.013.015mary moved to the bedroom.025.019.021daniel picked up the football there.010.011.011daniel journeyed to the office.009.010.010daniel left the milk there.013.015.015mary took the apple there.006.005.006sandra journeyed to the garden.008.008.008mary dropped the apple.008.009.008mary travelled to the kitchen Attentive Memory Networks CAIR'17, August 11, 2017, Tokyo, Japan [11] Daniel Hewlett, Alexandre Lacoste, Llion Jones, Illia Polosukhin, Andrew Fan- drianto, Jay Han, Matthew Kelcey, and David Berthelot. 2016. WIKIREADING: A novel large-scale language understanding task over Wikipedia. In ACL. [12] Sepp Hochreiter and Jürgen Schmidhuber. 1997. Long short-term memory. Neural Computation 9, 8 (1997), 1735–1780. [13] Seokhwan Kim, Luis Fernando D'Haro, Rafael E Banchs, Jason D Williams, and Matthew Henderson. 2017. The fourth dialog state tracking challenge. In Dia- logues with Social Robots. Springer, 435–449. [14] Diederik Kingma and Jimmy Ba. 2015. Adam: A method for stochastic optimiza- tion. In ICLR. [15] Julia Kiseleva and Maarten de Rijke. 2017. Evaluating personal assistants on mobile devices. In 1st International Workshop on Conversational Approaches to Information Retrieval (CAIR'17). ACM. [16] Ankit Kumar, Ozan Irsoy, Peter Ondruska, Mohit Iyyer, James Bradbury, Ishaan Gulrajani, Victor Zhong, Romain Paulus, and Richard Socher. 2016. Ask me anything: Dynamic memory networks for natural language processing. In ICML. [17] Alexander Miller, Adam Fisch, Jesse Dodge, Amir-Hossein Karimi, Antoine Bor- des, and Jason Weston. 2016. Key-value memory networks for directly reading documents. In EMNLP. [18] Filip Radlinski and Nick Craswell. 2017. A theoretical framework for conversa- tional search. In CHIIR. ACM, 117–126. [19] Iulian Serban, Alessandro Sordoni, Yoshua Bengio, Aaron C. Courville, and Joelle Pineau. 2016. Building end-to-end dialogue systems using generative hierarchical neural network models. In AAAI. [20] Iulian Vlad Serban, Alessandro Sordoni, Ryan Lowe, Laurent Charlin, Joelle Pineau, Aaron Courville, and Yoshua Bengio. 2016. A hierarchical latent variable encoder-decoder model for generating dialogues. arXiv preprint arXiv:1605.06069 (2016). [21] Alessandro Sordoni, Yoshua Bengio, Hossein Vahabi, Christina Lioma, Jakob Grue Simonsen, and Jian-Yun Nie. 2015. A hierarchical recurrent encoder-decoder for generative context-aware query suggestion. In CIKM. [22] Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston, and Rob Fergus. 2015. End- to-end memory networks. In NIPS. [23] Ke Tran, Arianna Bisazza, and Christof Monz. 2016. Recurrent memory networks for language modeling. In NAACL-HLT. [24] Oriol Vinyals, Łukasz Kaiser, Terry Koo, Slav Petrov, Ilya Sutskever, and Geoffrey Hinton. 2015. Grammar as a foreign language. In NIPS 2015. [25] Zhongyuan Wang, Kejun Zhao, Haixun Wang, Xiaofeng Meng, and Ji-Rong Wen. 2015. Query understanding through knowledge-based conceptualization. In IJCAI. [26] Jason Weston, Antoine Bordes, Sumit Chopra, Alexander M Rush, Bart van Merriënboer, Armand Joulin, and Tomas Mikolov. 2016. Towards AI-complete question answering: A set of prerequisite toy tasks. In ICLR. [27] Jason Weston, Sumit Chopra, and Antoine Bordes. 2015. Memory networks. In [28] Caiming Xiong, Stephen Merity, and Richard Socher. 2016. Dynamic memory networks for visual and textual question answering. In ICML. [29] Yi Yang, Wen tau Yih, and Christopher Meek. 2015. WikiQA: A challenge dataset for open-domain question answering. In EMNLP. ICLR.
1906.01833
1
1906
2019-06-05T05:27:31
A Hierarchical Reinforced Sequence Operation Method for Unsupervised Text Style Transfer
[ "cs.CL", "cs.AI" ]
Unsupervised text style transfer aims to alter text styles while preserving the content, without aligned data for supervision. Existing seq2seq methods face three challenges: 1) the transfer is weakly interpretable, 2) generated outputs struggle in content preservation, and 3) the trade-off between content and style is intractable. To address these challenges, we propose a hierarchical reinforced sequence operation method, named Point-Then-Operate (PTO), which consists of a high-level agent that proposes operation positions and a low-level agent that alters the sentence. We provide comprehensive training objectives to control the fluency, style, and content of the outputs and a mask-based inference algorithm that allows for multi-step revision based on the single-step trained agents. Experimental results on two text style transfer datasets show that our method significantly outperforms recent methods and effectively addresses the aforementioned challenges.
cs.CL
cs
A Hierarchical Reinforced Sequence Operation Method for Unsupervised Text Style Transfer Chen Wu1∗, Xuancheng Ren2∗, Fuli Luo2, Xu Sun2,3 1Department of Foreign Languages and Literatures, Tsinghua University 2MOE Key Laboratory of Computational Linguistics, School of EECS, Peking University 3Center for Data Science, Beijing Institute of Big Data Research, Peking University [email protected] {renxc, luofuli, xusun}@pku.edu.cn 9 1 0 2 n u J 5 ] L C . s c [ 1 v 3 3 8 1 0 . 6 0 9 1 : v i X r a Abstract Unsupervised text style transfer aims to al- ter text styles while preserving the content, without aligned data for supervision. Exist- ing seq2seq methods face three challenges: 1) the transfer is weakly interpretable, 2) gener- ated outputs struggle in content preservation, and 3) the trade-off between content and style is intractable. To address these challenges, we propose a hierarchical reinforced sequence op- eration method, named Point-Then-Operate (PTO), which consists of a high-level agent that proposes operation positions and a low- level agent that alters the sentence. We pro- vide comprehensive training objectives to con- trol the fluency, style, and content of the out- puts and a mask-based inference algorithm that allows for multi-step revision based on the single-step trained agents. Experimental re- sults on two text style transfer datasets show that our method significantly outperforms re- cent methods and effectively addresses the aforementioned challenges. 1 Introduction 1 Text style transfer aims to convert a sentence of one style into another while preserving the style-independent content (Shen et al., 2017; Fu et al., 2018). In most cases, aligned sentences are not available, which requires learning from non- aligned data. Previous work mainly learns dis- entangled content and style representations using seq2seq (Sutskever et al., 2014) models and de- composes the transfer into neutralization and styl- ization steps. Although impressive results have been achieved, three challenges remain: 1) the in- terpretability of the transfer procedure is still weak in seq2seq models, 2) generated sentences are usu- ally highly stylized with poor content preserva- ∗Equal Contributions. 1 Our code is available at https://github.com/ ChenWu98/Point-Then-Operate. Figure 1: Our proposed Point-Then-Operate (PTO) ap- plied to a real test sample. A high-level agent (red squares) iteratively proposes operation positions, and a low-level agent (arrows) alters the sentence based on the high-level proposals. Compared with seq2seq methods, PTO is more interpretable and better pre- serves style-independent contents. tion, and 3) the trade-off between content preser- vation and style polarity is intractable. To address these challenges, we propose a se- quence operation-based method within the hierar- chical reinforcement learning (HRL) framework, named Point-Then-Operate (PTO). It consists of a hierarchy of a high-level agent that proposes operation positions and a low-level agent that al- ters the sentence based on high-level proposals. We propose a policy-based training algorithm to model the key aspects in text style transfer, i.e., fluency, style polarity, and content preservation. For fluency, we use a language model reward; for style polarity, we introduce a classification confi- dence reward and an auxiliary classification task; for content preservation, we adopt a reconstruc- tion reward and a self-supervised reconstruction loss. We introduce a mask-based inference al- gorithm that applies multi-step sequence opera- tions to the input sentence, allowing for single- step training which is more stable. Figure 1 shows an example of our method applied to a real test sample from Yelp. Compared with existing seq2seq methods, our I will be going back and enjoying this great place !I will be going back and enjoying this horrible place !I will be going back and avoid this horrible place !I will not be going back and avoid this horrible place !Replace(great,horrible) Replace(enjoying,avoid) InsertBefore(be,not) [Input] [Iteration 1] [Iteration 2] [Iteration 3] sequence operation method has three merits. 1) In- terpretability: our method explicitly models where and how to transfer. 2) Content preservation: se- quence operations are targeted at stylized parts; thus, style-independent content can be better pre- served. 3) Controllable trade-off : the trade-off between content preservation and style polarity could be tuned in our method. Specifically, we tune it by biasing the number of operation steps. We conduct extensive experiments on two text style transfer datasets, i.e., Yelp and Amazon. We show that our proposed method outperforms re- cent methods and that it addresses the challenges of existing seq2seq methods. The contributions of this paper are: • We propose a sequence operation method, i.e., Point-Then-Operate, for unsupervised text style transfer. The transfer procedure is modeled as explicit revisions on the input sentences, which improves interpretability, content preservation, and controllable style- content trade-off. • The method is interpreted and trained in the HRL framework with a high-level agent that proposes operation positions and a low-level agent that applies explicit operations. We design comprehensive learning objectives to capture three important aspects of text style transfer and propose a mask-based inference algorithm that allows for multi-step revision based on the single-step trained agents. • Experiments on Yelp and Amazon show that our method significantly improves BLEU, fluency, and content preservation compared with recent methods and effectively ad- dresses the aforementioned challenges. 2 Related Work Text Style Transfer Most work on text style transfer learns disentangled representations of style and content. We categorize them based on how they represent content. Hidden vec- tor approaches represent content as hidden vec- tors, e.g., Hu et al. (2017) adversarially incor- porate a VAE and a style classifier; Shen et al. (2017) propose a cross-aligned AE that adversar- ially aligns the hidden states of the decoder; Fu et al. (2018) design a multi-decoder model and a style-embedding model for better style represen- tations; Yang et al. (2018) use language models as style discriminators; John et al. (2018) utilize bag- of-words prediction for better disentanglement of style and content. Deletion approaches represent content as the input sentence with stylized words deleted, e.g., Li et al. (2018) delete stylized n- grams based on corpus-level statistics and stylize it based on similar, retrieved sentences; Xu et al. (2018) jointly train a neutralization module and a stylization module the with reinforcement learn- ing; Zhang et al. (2018a) facilitate the stylization step with a learned sentiment memory. As far as we know, there are two work that avoid disentangled representations. Zhang et al. (2018b) construct a pseudo-aligned dataset with an SMT model and then learn two NMT models jointly and iteratively. A concurrent work, Luo et al. (2019), propose to learn two dual seq2seq models between two styles via reinforcement learning, without dis- entangling style and content. Sequence Operation Methods Our work is also closely related to sequence operation methods, which are widely used in SMT (Durrani et al., 2011, 2015; Pal et al., 2016) and starts to attract attention in NMT (Stahlberg et al., 2018). Com- pared with methods based on seq2seq models, se- quence operation methods are inherently more in- terpretable (Stahlberg et al., 2018). Notably, our method is revision-based, i.e., it operates directly on the input sentence and does not generate from scratch as in machine translation systems. Hierarchical Reinforcement Learning In this work, we adopt the Options Framework (Sutton et al., 1999) in HRL, in which a high-level agent learns to determine more abstract options and a low-level agent learns to take less abstract ac- tions given the option. Recent work has shown that HRL is effective in various tasks, e.g., Atari games (Kulkarni et al., 2016), relation classi- fication (Feng et al., 2018), relation extraction (Takanobu et al., 2018), and video captioning (Wang et al., 2018). 3 Formulation We start by formalizing the problem of our in- terest. Given two non-aligned sets of sentences 1 ,··· , x(n) X1 = {x(1) 1 } of style s1 and X2 = {x(1) 2 } of style s2. Unsupervised text style transfer aims to learn two conditional dis- tributions p(x1→2x1) and p(x2→1x2) which al- ter the style of a sentence and preserve the style- 2 ,··· , x(m) independent content. However, defining content is not trivial. Different from previous text style trans- fer methods that explicitly model contents with disentangled representations, we implicitly model content with reconstruction, similar to the idea proposed adopted in CycleGAN (Zhu et al., 2017). Given the discreteness nature of natural language texts, we use sequence operations to approximate p(x1→2x1) and p(x2→1x2). In our notations, x1→2 and x2→1 are transferred sentences, which are the outputs of a text style transfer system; x2 and x1 are operated sentences, which are not nec- essarily fully transferred. 4 Our Approach Our proposed sequence operation-based method, Point-Then-Operate (PTO), decomposes style transfer into two steps: 1) finding where to transfer and 2) determining how to transfer. It could be nat- urally formulated as an HRL problem, in which a high-level agent (i.e., pointer) proposes operation positions and a low-level agent (i.e., operators) al- ters the sentence based on high-level proposals. In this section, we first briefly review the Op- tions Framework in HRL. Then we introduce the proposed pointer module (§4.2) and operator mod- ules (§4.3). The training algorithm is in §4.4, in which two extrinsic rewards, an intrinsic reward, and a self-supervised loss are proposed for fluency, style polarity, and content preservation. The infer- ence algorithm is in §4.5, in which a mask mech- anism is proposed to iteratively and dynamically apply sequence operations to the input. 4.1 Review: The Options Framework in HRL The Options framework (Sutton et al., 1999) is a well-known formulation in HRL. We denote the state space as S; the option space, O; the action space, A. The high-level agent learns a stochastic policy µ : S × O → [0, 1]. The low-level agent learns a stochastic policy πo : S×A → [0, 1], con- ditioned on an option o ∈ O. Additionally, each option o ∈ O has a low-level stochastic termina- tion condition βo : S → [0, 1] which indicates In each whether the current option should end. episode, the high-level agent executes a trajectory (o1,··· , oL) based on µ; once an option ot is sampled, the low-level agent executes a trajectory t ,··· , alt t ) based on πot, where lt is dependent (a1 on βot. Intuitively, the flattened trajectory for one L,··· , alL episode is (o1, a1 L ). 1 ,··· , oL, a1 1,··· , al1 Module Operation IFφ1 IBφ2 Repφ3 DC DF DB Skip Insert a word w in Front of the position Insert a word w Behind the position Replace it with another word w Delete the Current word Delete the word in Front of the position Delete the word Behind the position Do not change anything Table 1: Operator modules. Parameters φ1, φ2, and φ3 are meant to generate their corresponding w. 4.2 High-Level Agent: Pointer The high-level policy µ aims to propose operation positions; thus, we model it as an attention-based (Bahdanau et al., 2015) pointer network, which as- signs normalized probability to each position. Option Given a sentence x = {x1,··· , xT}, the option space is O = {1,··· , T}. Note that T changes within an episode, since operations may change the length of a sentence. State The state is represented by the sentence representation hT and each position representa- tion hi, where {h1,··· , hT} is mapped from the sentence x by a bi-LSTM encoder. Policy We adopt an attention-based policy µ: µ(ix) = (cid:80)T exp(a(hT , hi)) t=1 exp(a(hT , ht)) (1) where a(·,·) is the scoring function for attention, and i ∈ {1,··· , T} denotes each position in the intput sentence. 4.3 Low-Level Agent: Operators The low-level policy π alters the sentence around the position i (i.e., option) sampled from µ. We re- strict the operations to those listed in Table 1. Note that these operations are complete to generate all natural language sentences in multiple steps. Action Given the sentence x = {x1,··· , xT} and the operation position i, the action of the low- level agent can be decomposed into two step, i.e., 1. Operator selection. Select an operator mod- ule from Table 1. 2. Word generation (optional). Generates a word, if necessary as is specified in Table 1. State Compared with the high-level agent, our low-level agent focuses on features that are more local. We map x to {h1,··· , hT}2 through a bi- LSTM encoder and take hi as the state represen- tation. Low-Level Termination Condition Different from the original Options Framework in which a stochastic termination condition βo is learned, we adopt a deterministic termination condition: the low-level agent takes one action in each option and terminates, which makes training easier and more stable. Notably, it does not harm the expressive- ness of our method, since multiple options can be executed. Policy for Operator Selection For training, we adopt a uniform policy for operator selection, i.e., we uniformly sample an operator module from Ta- ble 1. In preliminary experiments, we explored a learned policy for operator selection. However, we observed that the learned policy quickly collapses to a nearly deterministic choice of Repφ3. Our ex- planation is that, in many cases, replacing a styl- ized word is the optimal choice for style transfer. Thus, the uniform policy assures that all operators are trained on sufficient and diversified data. For inference, we adopt a heuristic policy based on flu- ency and style polarity, detailed in §4.5.3. Policy for Word Generation As shown in Ta- ble 1, three operators are parameterized, which are burdened with the task of generating a proper word to complete the action. For each parameterized op- erator M, the probability of generating w is M ( wx, i) = softmax w(W hi) (2) 1, φ(cid:48) Notably, for each M we train two sets of parame- ters for s1 → s2 and s2 → s1. For readability, we omit the direction subscripts and assure that they can be inferred from contexts; parameters of the 2, and φ(cid:48) opposite direction are denoted as φ(cid:48) 3. 4.4 Hierarchical Policy Learning We introduce comprehensive training objectives to model the key aspects in text style transfer, i.e., fluency, style polarity, and content preservation. For fluency, we use an extrinsic language model reward; for style polarity, we use an extrinsic classification confidence reward and incorporate an auxiliary style classification task; for content 2We reuse h and W notations for all modules for brevity. Figure 2: Graphical overview for the training algo- rithm, which consists of a transfer step (left) and a re- construction step (right). Solid lines denote forward pass; dotted lines denote rewards or losses. Blue / red items belong to the source / target styles; yellow items denotes the agents. Best viewed in color. cls (cid:46) Eq. 6 Algorithm 1 Point-Then-Operate Training 1: Input: Non-aligned sets of sentences X1,2 2: Initialize θ, φ1,2,3 3: Train language models LM2 on X2 4: Pre-train θ by optimizing Lθ 5: for each iteration i = 1, 2,··· , m do 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: end if 20: 21: end for Sample x1 from X1 Sample i from µθ(ix1) Uniformly sample M x2 ← Transfer(x1, M, i) Compute Rconf and Rlm Update θ based on Lθ Get M(cid:48) and i(cid:48) if M(cid:48) is parameterized by φ(cid:48) then ¯x1 ← Reconstruct( x2, M(cid:48), i(cid:48)) Update φ(cid:48) by optimizing Lφ(cid:48) end if if M is parameterized by φ then Compute Rrec if M is Repφ3 Update φ with ∇φJ(φ) (cid:46) Eq. 1 (cid:46) Table 1 (cid:46) Table 1 (cid:46) Eq. 3 and 4 cls and ∇θJ(θ) (cid:46) Eq. 6 and 9 rec (cid:46) Table 2 (cid:46) Table 1 (cid:46) Eq. 7 (cid:46) Eq. 8 (cid:46) Eq. 11 preservation, we use a self-supervised reconstruc- tion loss and an intrinsic reconstruction reward. In the following parts, we only illustrate equations related to x1 → x2 operations and x2 → x1 reconstructions for brevity; the opposite direction can be derived by swapping 1 and 2. The training algorithm is presented in Algorithm 1. A graphical overview is shown in Figure 2. 4.4.1 Modeling Fluency Language Model Reward To improve the flu- ency, we adopt a language model reward. Let LM1, LM2 denote the language models for s1 and s2, respectively. Given the generated word w in the operated sentence x2, the language model re- ward is defined as Rlm = λlmLM2( w x2) (3) InputOperatorsTransferred lm,confconfStyle LabelclsInputPointer rec,recOperatorsTransferredReconstruction M Repφ3 DC DF DB M(cid:48) Repφ(cid:48) 3 IFφ(cid:48) IFφ(cid:48) IFφ(cid:48) 1 1 1 or IBφ(cid:48) or IBφ(cid:48) or IBφ(cid:48) 2 2 2 i(cid:48) i i or i − 1 i − 1 or i − 2 i + 1 or i Table 2: Construction of self-supervised data. where LM2( w x2) denotes the probability of w given other words in x2. In our experiments, the probability is computed by averaging a forward LSTM-LM and a backward LSTM-LM. 4.4.2 Modeling Style Polarity Classification Confidence Reward We observe that language models are not adequate to capture style polarity; thus, we encourage larger change in the confidence of a style classifier, by adopting a classification confidence reward, i.e., Rconf = λconf[p(s2 x2) − p(s2x1)] (4) where we reuse the classifier defined in Eq. 5. Auxiliary Task: Style Classification In HRL, the high-level policy usually suffers from the high variance of gradients since the estimated gradients are dependent on the poorly trained low-level pol- icy. To stabilize the high-level policy learning, we introduce auxiliary supervision to the pointer. Specifically, we extend the pointer to an attention- based classifier, i.e., p(sjx) = softmaxj(W µ(ix)hi) (5) T(cid:88) i=1 (cid:88) for j = 1, 2. Let θ denotes the parameters of the pointer. The auxiliary classification loss for θ is Lθ cls = Exj∼Xj [− log pθ(sjxj)] (6) j=1,2 The underlying assumption is that positions with larger attention weights for classification are more likely to be critical to style transfer. 4.4.3 Modeling Content Preservation Self-Supervised Reconstruction Loss To im- prove content preservation, we propose a recon- struction loss that guides the operator modules with self-supervision. Suppose the word w at the ith position is deleted or replaced by operator M, we identify the reconstruction operator M(cid:48) and re- construction position i(cid:48) in Table 2. Then M(cid:48) is up- dated with MLE, by operating on position i(cid:48) in x2 with w as gold output. For those with two (M(cid:48), i(cid:48)) pairs, we uniformly sample one for training. For- mally, the reconstruction loss is defined as Lφ(cid:48) rec = − log M(cid:48)(w x2, i(cid:48)) (7) Reconstruction Reward One-to-one transfer (e.g., {delicious↔bland, caring↔unconcerned}) is usually preferable to many-to-one transfer (e.g., {delicious→bad, caring→bad}). Thus, we intro- duce a reconstruction reward for Repφ3 to encour- age one-to-one transfer, i.e., Rrec = −λrecLφ(cid:48) 3rec (8) 3rec is the reconstruction loss in Eq. 7. where Lφ(cid:48) 4.4.4 Training with Single-Option Trajectory Instead of executing multi-option trajectories, we only allow the high-level agent to execute a sin- gle option per episode during training, and leave the multi-option scenario to the inference algo- rithm (§4.5). We have two motivations for execut- ing single-option trajectories: 1) executing multi- option trajectories is less tractable and stable, es- pecially in the case of style transfer which is sensi- tive to nuances in the sentence; 2) self-supervised reconstruction is ambiguous in a multi-option tra- jectory, i.e., the gold trajectory for reconstruction is not deterministic. High-Level Policy Gradients Since the lan- guage model reward is more local and increases the variance of estimated gradients, we only use the classification confidence reward for the high- level policy. The policy gradient is ∇θJ(θ) = Ei[Rconf · ∇θ log µθ(ix1)] (9) where gradients are detached from Rconf. Low-Level Policy Gradients All the extrinsic and intrinsic rewards are used for low-level policy learning. Specifically, the rewards for φ1,2,3 are R1,2 = Rlm + Rconf R3 = Rlm + Rconf + Rrec For φ = φ1, φ2, φ3, the policy gradient is ∇φJ(φ) = E w[R · ∇φ log Mφ( wx1, i)] (10) (11) Overall Objectives The overall objectives for θ are the classification loss in Eq. 6 and the policy gradient in Eq. 9. The overall objectives for φ1,2,3 are the reconstruction loss in Eq. 7 and the policy gradients in Eq. 11. 2 ← x1, j ← 1 2 ) > pstop and j ≤ jmax do Algorithm 2 Point-Then-Operate Inference 1: Input: Input sentence x1, additional classifier padd 2: Initialize x2 ← x1, xm 3: while padd(s1 xm 4: Mask the options in µθ(i x2) 5: 6: 7: 8: 9: 10: end while 11: The output is x1→2 ← x2 12: return x1→2 (cid:46) §4.5.1 Select i that maximizes the masked µθ(i x2) (cid:46) §4.5.3 Select the best M from Table 1 Update x2 ← Transfer( x2, M, i) (cid:46) §4.3 (cid:46) §4.5.2 Update xm j ← j + 1 2 Inference 4.5 The main problems in applying single-step trained modules to the multi-step scenario are 1) previ- ous steps of operations may influence later steps, and 2) we need to dynamically decide when the trajectory should terminate. We leverage a mask mechanism to address these problems. The basic idea is that given an input sentence, the high-level agent iteratively proposes operation positions for the low-level agent to operate around. In each iter- ation, the high-level agent sees the whole sentence but with some options (i.e., positions) masked in its policy. The trajectory termination condition is modeled by an additional pre-trained classifier. The algorithm for style transfer from s1 to s2 is detailed in Algorithm 2. 4.5.1 Masked Options To tackle the first problem, we mask the options (i.e., positions) in the high-level policy which ap- pear in the contexts in which any words are in- serted, replaced, or skipped (but not for deleted words). Note that we only mask the options in the policy but do not mask the words in the sen- tence (i.e., both agents still receive the complete sentence), since we cannot bias the state represen- tations (§4.2 and §4.3) with masked tokens. We set the window size as 1 (i.e., three words are masked in each step). We find the use of window size nec- essary, since in many cases, e.g., negation and em- phasis, the window size of 1 is capable of covering a complete semantic unit. 4.5.2 Termination Condition A simple solution to the second problem is to ter- minate the trajectory if the operated sentence is confidently classified as the target style. The prob- lem with this simple solution is that the highly stylized part may result in too early termination. For example, Otherwise a terrible experience and we will go again may be classified as negative with high confidence. Thus, we propose to mask words in the operated sentence for the termination condition. The masking strategy is the same as §4.5.1 and masked words are replaced by (cid:104)unk(cid:105). To tackle the excessive number of (cid:104)unk(cid:105), we train an additional classifier as defined in §4.4.2, but trained on sentences with words randomly re- placed as (cid:104)unk(cid:105). 4.5.3 Inference Policy for Operator Selection As discussed in §4.3, we adopt a heuristic infer- ence policy for operator selection. Specifically, we enumerate each operator and select the oper- ated sentence x2 which maximizes the criterion: c( x2) = LM2( x2) · p(s2 x2)η (12) where LM2( x2) denotes the probability of x2 computed by the language model LM2, p(sj·) is the classifier defined in §4.4.2, and η is a balancing hyper-parameter. 5 Experiments 5.1 Datasets We conduct experiments on two commonly used datasets for unsupervised text style transfer, i.e., Yelp and Amazon, following the split of datasets in Li et al. (2018). Dataset statistics are shown in Table 3. For each dataset, Li et al. (2018) provided a gold output for each entry in the test set written by crowd-workers on Amazon Mechanical Turk. Since gold outputs are not written for development sets, we tune the hyper-parameters on the develop- ment sets based on our intuition of English. Yelp The Yelp dataset consists of business re- views and their labeled sentiments (from 1 to 5) from Yelp. Those labeled greater than 3 are considered as positive samples and those labeled smaller than 3 are negative samples. Amazon The Amazon dataset consists of prod- uct reviews and labeled sentiments from Amazon (He and McAuley, 2016). Positive and negative samples are defined in the same way as Yelp. We observe that the Amazon dataset contains many neutral or wrongly labeled sentences, which greatly harms our HRL-based sequence operation method. Thus, on the Amazon dataset, we adopt a cross-domain setting, i.e., we train the modules Dataset Yelp Amazon Attributes Positive Negative Positive Negative Train 270K 2000 180K 2000 277K 985 278K 1015 Dev Test 500 500 500 500 Table 3: Dataset statistics. on the Yelp training set using the Amazon vocab- ulary and test the method on Amazon test set. Ex- perimental results show the effectiveness of our method under this cross-domain setting. 5.2 Evaluation Metrics Automatic Evaluation Following previous work (Shen et al., 2017; Xu et al., 2018), we pre-train a style classifier TextCNN (Kim, 2014) on each dataset and measure the style polarity of system outputs based on the classification accuracy. Also, based on the human references provided by Li et al. (2018), we adopt a case- insensitive BLEU metric, which is computed using the Moses multi-bleu.perl script. Human Evaluation Following previous work (Shen et al., 2017; Xu et al., 2018), we also conduct human evaluations. For each input sen- tence and corresponding output, each participant is asked to score from 1 to 5 for fluency, content preservation, and style polarity. If a transfer gets scores of 4 or 5 on all three aspects, it is considered as a successful transfer. We count the success rate over the test set for each system, which is denoted as Suc in Table 5. 5.3 Baselines We make a comprehensive comparison with state- of-the-art style transfer methods. CrossAligned (Shen et al., 2017) aligns decoder hidden states ad- versarially. MultiDecoder (Fu et al., 2018) adopts multiple decoders for different styles. StyleEm- bedding (Fu et al., 2018) adopts a single decoder conditioned on learned style embeddings. Tem- plateBased (Li et al., 2018) retrieves and replaces stylized words. DeleteOnly (Li et al., 2018) only deletes the stylized words in the input sentence. Del-Ret-Gen (Li et al., 2018) is the same as Tem- plateBased except that an RNN is adopted to gen- erate the output. BackTranslate (Prabhumoye et al., 2018) stylizes the back-translated input. Un- pairedRL (Xu et al., 2018) deletes stylized words and generates with a denoising AE. UnsuperMT Yelp Amazon Acc BLEU 9.06 74.7 14.54 50.6 21.06 8.4 81.2 22.57 14.64 86.0 15.96 88.6 2.46 94.6 18.81 57.5 97.8 22.75 - 74.7 29.86 91.5 Acc BLEU 1.90 75.1 9.07 69.9 15.07 38.2 64.3 34.79 33.00 47.0 30.09 51.0 76.7 1.04 15.93 56.3 72.4 33.95 43.2 - 41.86 40.2 CrossAligned MultiDecoder StyleEmbedding TemplateBased DeleteOnly Del-Ret-Gen BackTranslate UnpairedRL UnsuperMT Human Point-Then-Operate Table 4: Automatic evaluation results for classification accuracy and BLEU with human reference. Human de- notes human references. Note that Acc for human ref- erences are relatively low; thus, we do not consider it as a valid metric for comparison. (Zhang et al., 2018b) produces pseudo-aligned data and iteratively learns two NMT models. The outputs of the first six baselines are made public by Li et al. (2018). The outputs of Back- Translate and UnpairedRL are obtained by run- ning the publicly available codes. We get the out- puts of UnsuperMT from the authors of Zhang et al. (2018b). 5.4 Evaluation Results Table 4 shows the results of automatic evaluation. It should be noted that the classification accuracy for human reference is relatively low (74.7% on Yelp and 43.2% on Amazon); thus, we do not consider it as a valid metric for comparison. For BLEU score, our method outperforms recent sys- tems by a large margin, which shows that our out- puts have higher overlap with reference sentences provided by humans. To lighten the burden on human participants, we compare our proposed method to only four of the previous methods, selected based on their perfor- mance in automatic evaluation. Given the obser- vation discussed in §5.1, we remove the wrongly labeled test samples for human evaluation. Ta- ble 5 shows the results of human evaluation. Our proposed method achieves the highest fluency and content preservation on Yelp and performs the best on all human evaluation metrics on Amazon. 5.5 Controllable Trade-Off Figure 3 shows how classification accuracy and BLEU change when we manually set pstop. When Yelp Fluency Content TemplateBased Del-Ret-Gen UnpairedRL UnsuperMT Point-Then-Operate 3.47 3.82 3.54 4.26 4.39 3.76 3.73 3.59 4.24 4.56 Amazon Style 3.25 3.52 2.90 4.03 3.78 Suc 68.0 % 70.3 % 53.8 % 82.5 % 81.5 % Fluency Content 3.46 4.02 2.58 4.24 4.28 4.08 4.31 2.55 4.13 4.47 Style 2.15 2.69 2.44 3.05 3.31 Suc 9.0 % 21.0 % 4.5 % 35.5 % 47.0 % Table 5: Human evaluation results. Methods are selected based on automatic evaluation. Style: style polarity; Content: content preservation; Fluency: fluency; Suc: the proportion of successful transfer (refer to §5.2) Yelp Acc BLEU 23.93 68.6 93.8 26.41 25.70 37.6 39.1 27.80 - 74.7 29.86 91.5 Amazon Acc BLEU 36.77 48.2 47.8 37.39 41.68 25.0 46.3 40.52 43.2 - 41.86 40.2 InsertOnly ReplaceOnly DeleteOnly w/o Rrec and Lrec Human Full Table 6: Ablation Studies. Table 6 shows the ablation results. It shows that BLEU drops if operators are restricted to a fixed set, showing the necessity of cooperating opera- tor modules. It also shows that BLEU drops if we remove the reconstruction loss and the recon- struction reward, indicating the generated words overlap less with human references in this ablation case. As discussed in §5.4, we ignore Acc since it is low on human references. 5.7 Qualitative Study Figure 1 is an example of our method applied to a test sample. The transfer starts from more stylized parts and ends at less stylized parts, while keeping neutral parts intact. It also shows that our method learns lexical substitution and negation in an unsu- pervised way. Table 7 displays some comparisons of different systems. It shows that our proposed method is better at performing local changes to re- verse the style of the input sentence while preserv- ing most style-independent parts. 6 Discussions We study the system outputs and observe two cases that our method cannot properly handle: Neutral Input The reconstruction nature of our method prefers stylized input to neutral input. We observe that it fails to convert some neutral in- puts, e.g., I bought this toy for my daughter about (a) Yelp (b) Amazon Figure 3: The controllable trade-off between content preservation and style polarity. The x-axis is pstop (de- fined in Algorithm 2). The y-axis is the value of differ- ent automatic metrics, i.e., BLEU (the blue lines) and classification accuracy (the orange lines). pstop is larger, classification accuracy drops and BLEU increases. Based on our observation of human references, we find that humans usually make minimal changes to the input sentence; thus, BLEU computed with human references can be viewed as an indicator of content preservation. From this perspective, Figure 3 shows that if we stop earlier, i.e., when the current style is closer to the source style, more content will be preserved and more weakly stylized words may be kept. Thus, controllable trade-off is achieved by man- ually setting pstop. 5.6 Ablation Studies We conduct several ablation studies to show the effect of different components in our method: Ablations of Operators To show that incorpo- rating various operators is essential, we evaluate the performance of the following ablations: Inser- tOnly, ReplaceOnly, and DeleteOnly, in which op- erator choices are restricted to subsets of Table 1. Ablation of Reconstruction Reward and Recon- struction Loss To show the effectiveness of our reconstruction-based objectives, we remove the reconstruction reward and the reconstruction loss as an ablation. 0.00.20.40.60.81.0pstop020406080100value (%)MetricBLEUAcc0.00.20.40.60.81.0pstop253035404550value (%)MetricBLEUAcc Original (Yelp, negative) TemplateBased Del-Ret-Gen UnpairedRL UnsuperMT Point-Then-Operate Original (Yelp, positive) TemplateBased Del-Ret-Gen UnpairedRL UnsuperMT Point-Then-Operate staffed primarily by teenagers that do n't understand customer service . staffed primarily by teenagers that huge portions and customer service are pretty good . staffed , the best and sterile by flies , how fantastic customer service . staffed established each tech feel when great customer service professional . staffed distance that love customer service . staffed by great teenagers that do delightfully understand customer service . i will be going back and enjoying this great place ! i will be going back and enjoying this i did not @unk i will be going back and will not be returning into this i will be going back and enjoying this great place . i wo n't be going back and sitting this @num . i will not be going back and avoid this horrible place ! Original (Amazon, negative) TemplateBased Del-Ret-Gen UnpairedRL UnsuperMT Point-Then-Operate i could barely get through it they taste so nasty . beautifully through it they taste so nasty . i have used it through and it is very sharp and it was very nasty . i could barely get through it they taste so nasty . i can perfect get through it they taste so delicious . i could get through it they taste so good . Original (Amazon, positive) TemplateBased Del-Ret-Gen UnpairedRL UnsuperMT Point-Then-Operate i also prefered the blade weight and thickness of the wustof . i also prefered the blade weight and thickness of the wustof toe . i also prefered the blade and was very disappointed in the weight and thickness of the wustof . i also sampled the comfortable base and follow of the uk . i also encounter the blade weight and width of the guitar . i only prefered the weight and thickness of the wustof . Table 7: Sampled system outputs. The dataset and the original style for each input sentence are parenthesized. We mark improperly generated or preserved words in blue, and mark words that show target style and are grammatical in the context in red. Best viewed in color. @num months ago., which shows that the high- level policy is not well learned for some neutral sentences. Adjacent Stylized Words We introduce a win- dow size of 1 in §4.5.1 to deal with most seman- tic units. However, we observe in some cases two adjacent stylized words occur, e.g., poor watery food. If the first step is to replace one of them, then the other will be masked in later iterations, leading to incomplete transfer; if the first step is deletion, our method performs well, since we do not mask the context of deletion as stated in §4.5.1. Notably, phrases like completely horrible is not one of these cases, since completely itself is not stylized. Experiments in this work show the effectiveness of our proposed method for positive-negative text style transfer. Given its sequence operation nature, we see potentials of the method for other types of transfers that require local changes, e.g., polite- impolite and written-spoken, while further empir- ical verification is needed. 7 Conclusions We identify three challenges of existing seq2seq methods for unsupervised text style transfer and propose Point-Then-Operate (PTO), a sequence operation-based method within the hierarchical re- inforcement learning (HRL) framework consisting of a hierarchy of agents for pointing and operating respectively. We show that the key aspects of text style transfer, i.e., fluency, style polarity, and con- tent preservation, can be modeled by comprehen- sive training objectives. To make the HRL training more stable, we provide an efficient mask-based inference algorithm that allows for single-option trajectory during training. Experimental results show the effectiveness of our method to address the challenges of existing methods. Acknowledgments We would like to thank the anonymous reviewers for their thorough and helpful comments. We are grateful to the authors of Zhang et al. (2018b) for providing the UnsuperMT results. Xu Sun is the corresponding author of this paper. References Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Ben- gio. 2015. Neural machine translation by jointly In 3rd Inter- learning to align and translate. national Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings. Nadir Durrani, Helmut Schmid, and Alexander M. Fraser. 2011. A joint sequence translation model In The 49th Annual with integrated reordering. Meeting of the Association for Computational Lin- guistics: Human Language Technologies, Proceed- ings of the Conference, 19-24 June, 2011, Portland, Oregon, USA, pages 1045 -- 1054. Nadir Durrani, Helmut Schmid, Alexander M. Fraser, Philipp Koehn, and Hinrich Schutze. 2015. The operation sequence model - combining n-gram- based and phrase-based statistical machine transla- tion. Computational Linguistics, 41(2):185 -- 214. Jun Feng, Minlie Huang, Li Zhao, Yang Yang, and Xi- aoyan Zhu. 2018. Reinforcement learning for re- In Proceed- lation classification from noisy data. ings of the Thirty-Second AAAI Conference on Ar- tificial Intelligence, (AAAI-18), the 30th innovative Applications of Artificial Intelligence (IAAI-18), and the 8th AAAI Symposium on Educational Advances in Artificial Intelligence (EAAI-18), New Orleans, Louisiana, USA, February 2-7, 2018, pages 5779 -- 5786. Zhenxin Fu, Xiaoye Tan, Nanyun Peng, Dongyan Zhao, and Rui Yan. 2018. Style transfer in text: In Proceedings of the Exploration and evaluation. Thirty-Second AAAI Conference on Artificial Intelli- gence, (AAAI-18), the 30th innovative Applications of Artificial Intelligence (IAAI-18), and the 8th AAAI Symposium on Educational Advances in Artificial Intelligence (EAAI-18), New Orleans, Louisiana, USA, February 2-7, 2018, pages 663 -- 670. Ruining He and Julian McAuley. 2016. Ups and downs: Modeling the visual evolution of fashion trends with one-class collaborative filtering. In Pro- ceedings of the 25th International Conference on World Wide Web, WWW 2016, Montreal, Canada, April 11 - 15, 2016, pages 507 -- 517. Zhiting Hu, Zichao Yang, Xiaodan Liang, Ruslan Salakhutdinov, and Eric P. Xing. 2017. Toward con- In Proceedings of the trolled generation of text. 34th International Conference on Machine Learn- ing, ICML 2017, Sydney, NSW, Australia, 6-11 Au- gust 2017, volume 70 of Proceedings of Machine Learning Research, pages 1587 -- 1596. Vineet John, Lili Mou, Hareesh Bahuleyan, and Olga Vechtomova. 2018. Disentangled represen- CoRR, tation learning for text style transfer. abs/1808.04339. Yoon Kim. 2014. Convolutional neural networks for sentence classification. In Proceedings of the 2014 Conference on Empirical Methods in Natural Lan- guage Processing, EMNLP 2014, October 25-29, 2014, Doha, Qatar, pages 1746 -- 1751. Tejas D. Kulkarni, Karthik Narasimhan, Ardavan Saeedi, and Josh Tenenbaum. 2016. Hierarchical deep reinforcement learning: Integrating temporal abstraction and intrinsic motivation. In Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Sys- tems 2016, December 5-10, 2016, Barcelona, Spain, pages 3675 -- 3683. Juncen Li, Robin Jia, He He, and Percy Liang. 2018. Delete, retrieve, generate: A simple approach to sen- In Proceedings of the timent and style transfer. 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2018, New Orleans, Louisiana, USA, June 1-6, 2018, Vol- ume 1 (Long Papers), pages 1865 -- 1874. Fuli Luo, Peng Li, Jie Zhou, Pengcheng Yang, Baobao Chang, Zhifang Sui, and Xu Sun. 2019. A dual rein- forcement learning framework for unsupervised text style transfer. CoRR, abs/1905.10060. Santanu Pal, Marcos Zampieri, and Josef van Genabith. 2016. USAAR: An operation sequential model for In Proceedings automatic statistical post-editing. of the First Conference on Machine Translation, WMT 2016, colocated with ACL 2016, August 11- 12, Berlin, Germany, pages 759 -- 763. Shrimai Prabhumoye, Yulia Tsvetkov, Ruslan Salakhutdinov, and Alan W. Black. 2018. Style In Proceedings transfer through back-translation. of the 56th Annual Meeting of the Association for Computational Linguistics, ACL 2018, Melbourne, Australia, July 15-20, 2018, Volume 1: Long Papers, pages 866 -- 876. Tianxiao Shen, Tao Lei, Regina Barzilay, and Tommi S. Jaakkola. 2017. Style transfer from non-parallel text In Advances in Neural Infor- by cross-alignment. mation Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, 4- 9 December 2017, Long Beach, CA, USA, pages 6833 -- 6844. Felix Stahlberg, Danielle Saunders, and Bill Byrne. 2018. An operation sequence model for explainable In Proceedings of the neural machine translation. Workshop: Analyzing and Interpreting Neural Net- works for NLP, BlackboxNLP@EMNLP 2018, Brus- sels, Belgium, November 1, 2018, pages 175 -- 186. 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: Annual Conference on Neural In- formation Processing Systems 2014, December 8- 13 2014, Montreal, Quebec, Canada, pages 3104 -- 3112. Richard S. Sutton, Doina Precup, and Satinder P. Singh. 1999. Between MDPs and semi-MDPs: A framework for temporal abstraction in reinforcement learning. Artif. Intell., 112(1-2):181 -- 211. Ryuichi Takanobu, Tianyang Zhang, Jiexi Liu, and Minlie Huang. 2018. A hierarchical framework for relation extraction with reinforcement learning. CoRR, abs/1811.03925. Xin Wang, Wenhu Chen, Jiawei Wu, Yuan-Fang Wang, and William Yang Wang. 2018. Video captioning In 2018 via hierarchical reinforcement learning. IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2018, Salt Lake City, UT, USA, June 18-22, 2018, pages 4213 -- 4222. Jingjing Xu, Xu Sun, Qi Zeng, Xiaodong Zhang, Xu- ancheng Ren, Houfeng Wang, and Wenjie Li. 2018. Unpaired sentiment-to-sentiment translation: A cy- cled reinforcement learning approach. In Proceed- ings of the 56th Annual Meeting of the Associa- tion for Computational Linguistics, ACL 2018, Mel- bourne, Australia, July 15-20, 2018, Volume 1: Long Papers, pages 979 -- 988. Zichao Yang, Zhiting Hu, Chris Dyer, Eric P. Xing, and Taylor Berg-Kirkpatrick. 2018. Unsupervised text style transfer using language models as discrimina- tors. In Advances in Neural Information Processing Systems 31: Annual Conference on Neural Informa- tion Processing Systems 2018, NeurIPS 2018, 3-8 December 2018, Montr´eal, Canada., pages 7298 -- 7309. Yi Zhang, Jingjing Xu, Pengcheng Yang, and Xu Sun. 2018a. Learning sentiment memories for sentiment modification without parallel data. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, Brussels, Belgium, October 31 - November 4, 2018, pages 1103 -- 1108. Zhirui Zhang, Shuo Ren, Shujie Liu, Jianyong Wang, Peng Chen, Mu Li, Ming Zhou, and Enhong Chen. 2018b. Style transfer as unsupervised machine translation. CoRR, abs/1808.07894. Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A. Efros. 2017. Unpaired image-to-image translation using cycle-consistent adversarial net- works. In IEEE International Conference on Com- puter Vision, ICCV 2017, Venice, Italy, October 22- 29, 2017, pages 2242 -- 2251.
1606.01994
2
1606
2016-07-04T03:04:38
CFO: Conditional Focused Neural Question Answering with Large-scale Knowledge Bases
[ "cs.CL" ]
How can we enable computers to automatically answer questions like "Who created the character Harry Potter"? Carefully built knowledge bases provide rich sources of facts. However, it remains a challenge to answer factoid questions raised in natural language due to numerous expressions of one question. In particular, we focus on the most common questions --- ones that can be answered with a single fact in the knowledge base. We propose CFO, a Conditional Focused neural-network-based approach to answering factoid questions with knowledge bases. Our approach first zooms in a question to find more probable candidate subject mentions, and infers the final answers with a unified conditional probabilistic framework. Powered by deep recurrent neural networks and neural embeddings, our proposed CFO achieves an accuracy of 75.7% on a dataset of 108k questions - the largest public one to date. It outperforms the current state of the art by an absolute margin of 11.8%.
cs.CL
cs
CFO: Conditional Focused Neural Question Answering with Large-scale Knowledge Bases Zihang Dai∗ Carnegie Mellon University Lei Li∗ Toutiao.com Wei Xu Baidu Research [email protected] [email protected] [email protected] 6 1 0 2 l u J 4 ] L C . s c [ 2 v 4 9 9 1 0 . 6 0 6 1 : v i X r a Abstract How can we enable computers to automat- ically answer questions like "Who created the character Harry Potter"? Carefully built knowledge bases provide rich sources of facts. However, it remains a chal- lenge to answer factoid questions raised in natural language due to numerous ex- pressions of one question. In particular, we focus on the most common questions - ones that can be answered with a sin- gle fact in the knowledge base. We pro- pose CFO, a Conditional Focused neural- network-based approach to answering fac- toid questions with knowledge bases. Our approach first zooms in a question to find more probable candidate subject men- tions, and infers the final answers with a unified conditional probabilistic frame- work. Powered by deep recurrent neural networks and neural embeddings, our pro- posed CFO achieves an accuracy of 75.7% on a dataset of 108k questions – the largest public one to date. It outperforms the cur- rent state of the art by an absolute margin of 11.8%. Introduction 1 Community-driven question answering (QA) web- sites such as Quora, Yahoo-Answers, and An- swers.com are accumulating millions of users and hundreds of millions of questions. A large portion of the questions are about facts or trivia. It has been a long pursuit to enable machines to answer such questions automatically. In recent years, several efforts have been made on utilizing open-domain knowledge bases A knowledge to answer factoid questions. ∗Part of the work was done while at Baidu. Lately, several base (KB) consists of structured representation of facts in the form of subject-relation-object large-scale general- triples. purpose KBs have been constructed, including YAGO (Suchanek et al., 2007), Freebase (Bol- lacker et al., 2008), NELL (Carlson et al., 2010), and DBpedia (Lehmann et al., 2014). Typically, structured queries with predefined semantics (e.g. SPARQL) can be issued to retrieve specified facts from such KBs. Thus, answering factoid questions will be straightforward once they are converted into the corresponding structured form. However, due to complexity of language, converting natural language questions to structure forms remains an open challenge. Among all sorts of questions, there is one cat- egory that only requires a single fact (triple) in KB as the supporting evidence. As a typical ex- the question "Who created the charac- ample, ter Harry Potter" can be answered with the sin- gle fact (HarryPotter, CharacterCreatedBy, J.K.Rowling). In this work, we refer to such questions as single-fact questions. Previously, it has been observed that single-fact questions con- stitute the majority of factoid questions in commu- nity QA sites (Fader et al., 2013). Despite the sim- plicity, automatically answering such questions re- mains far from solved - the latest best result on a dataset of 108k single-fact questions is only 63.9% in terms of accuracy (Bordes et al., 2015). To find the answer to a single-fact question, it suffices to identify the subject entity and relation (implicitly) mentioned by the question, and then forms a corresponding structured query. The prob- lem can be formulated into a probabilistic form. Given a single-fact question q, finding the subject- relation pair s, r from the KB K which maximizes the conditional probability p(s, rq), i.e. s, r = arg max s,r∈K p(s, rq) (1) Based on the formulation (1), the central prob- lem is to estimate the conditional distribution p(s, rq). It is very challenging because of a) the vast amount of facts - a large-scale KB such as Freebase contains billions of triples, b) the huge variety of language - there are multiple aliases for an entity, and numerous ways to compose a question, c) the severe sparsity of supervision - most combinations of s, r, q are not expressed in training data. Faced with these challenges, exist- ing methods have exploited to incorporate prior knowledge into semantic parsers, to design mod- els and representations with better generalization property, to utilize large-margin ranking objective to estimate the model parameters, and to prune the search space during inference. Noticeably, mod- els based on neural networks and distributed rep- resentations have largely contributed to the recent progress (see section 2). In this paper, we propose CFO, a novel method to answer single-fact questions with large-scale knowledge bases. The contributions of this paper are, • we employ a fully probabilistic treatment of the problem with a novel conditional param- eterization using neural networks, • we propose the focused pruning method to re- duce the search space during inference, and • we investigate two variations to improve the generalization of representations for millions of entities under highly sparse supervision. In experiments, CFO achieves 75.7% in terms of top-1 accuracy on the largest dataset to date, out- performing the current best record by an absolute margin of 11.8%. 2 Related Work The research of KB supported QA has evolved from earlier domain-specific QA (Zelle and Mooney, 1996; Tang and Mooney, 2001; Liang et al., 2013) to open-domain QA based on large- scale KBs. An important line of research has been trying to tackle the problem by semantic parsing, which directly parses natural language questions into structured queries (Liang et al., 2011; Cai and Yates, 2013; Kwiatkowski et al., 2013; Yao and Van Durme, 2014). Recent progresses in- clude designing KB specific logical representation and parsing grammar (Berant et al., 2013), using distant supervision (Berant et al., 2013), utilizing paraphrase information (Fader et al., 2013; Be- rant and Liang, 2014), requiring little question- answer pairs (Reddy et al., 2014), and exploit- ing ideas from agenda-based parsing (Berant and Liang, 2015). In contrast, another line of research tackles the problem by deep learning powered similarity matching. The core idea is to learn semantic repre- sentations of both the question and the knowledge from observed data, such that the correct support- ing evidence will be the nearest neighbor of the question in the learned vector space. Thus, a main difference among several approaches lies in the neural networks proposed to represent questions and KB elements. While (Bordes et al., 2014b; Bordes et al., 2014a; Bordes et al., 2015; Yang et al., 2014) use relatively shallow embedding mod- els to represent the question and knowledge, (Yih et al., 2014; Yih et al., 2015) employ a convolu- tional neural network (CNN) to produce the repre- sentation. In the latter case, both the question and the relation are treated as a sequence of letter-tri- gram patterns, and fed into two parameter shared CNNs to get their embeddings. What's more, in- stead of measuring the similarity between a ques- tion and an evidence triple with a single model as in (Bordes et al., 2015), (Yih et al., 2014; Yih et al., 2015) adopt a multi-stage approach. In each stage, one element of the triple is compared with the question to produce a partial similarity score by a dedicated model. Then, these partial scores are combined to generate the overall measurement. Our proposed method is closely related to the second line of research, since neural models are employed to learn semantic representations. As in (Bordes et al., 2015; Yih et al., 2014), we focus on single-fact questions. However, we propose to use recurrent neural networks (RNN) to produce the question representation. More importantly, our method follows a probabilistic formulation, and our parameterization relies on factors other than similarity measurement. Besides KB-based QA, our work is also loosely related to work using deep learning systems in QA tasks with free text evidences. For example, (Iyyer et al., 2014) focuses questions from the quiz bowl competition with recursive neural network. New architectures including memory networks (Weston et al., 2015), dynamic memory networks (Kumar et al., 2015), and more (Peng et al., 2015; Lee et al., 2015) have been explored under the bAbI syn- thetic QA task (Weston et al., 2016). In addition, (Hermann et al., 2015) seeks to answer Cloze style questions based on news articles. 3 Overview In this section, we formally formulate the problem of single-fact question answering with knowledge bases. A knowledge base K contains three com- ponents: a set of entities E, a set of relations R, and a set of facts F = {(cid:104)s, r, o(cid:105)} ⊆ E × R × E, where s, o ∈ E are the subject and object enti- ties, and r ∈ R is a binary relation. E(r), E(s) are the vector representations of a relation and an en- tity, respectively. s → r indicates that there exists some entity o such that (cid:104)s, r, o(cid:105) ∈ F. For single- fact questions, a common assumption is that the answer entity o and some triple (cid:104)si, rk, o(cid:105) ∈ F reside in the given knowledge base. The goal of our model is to find such subject si and relation rk mentioned or implied in the question. Once found, a structured query (e.g. in SPARQL) can be con- structed to retrieve the result entity. 3.1 Conditional Factoid Factorization Given a question q, the joint conditional probabil- ity of subject-relation pairs p(s, rq) can be used to retrieve the answer using the exact inference defined by Eq. (1). However, since there can be millions of entities and thousands of relations in a knowledge base, it is less effective to model p(s, rq) directly. Instead, we propose a condi- tional factoid factorization, p(s, rq) = p(rq) · p(sq, r) (2) and utilize two neural networks to parameter- ize each component, p(rq) and p(sq, r), respec- tively. Hence, our proposed method contains two phases: inferring the implied relation r from the question q, and inferring the mentioned subject en- tity s given the relation r and the question q. There is an alternative factorization p(s, rq) = p(sq)· p(rs, q). However, it is rather challenging to estimate p(sq) directly due to the vast amount of entities (> 106) in a KB. In comparison, our proposed factorization takes advantage of the rel- atively limited number of relations (on the order of thousands). What's more, by exploiting addi- tional information from the candidate relation r, it's more feasible to model p(sq, r) than p(sq), leading to more robust estimation. A key difference from prior multi-step approach is that our method do not assume any indepen- dence between the target subject and relation given a question, as does in the prior method (Yih et al., 2014). It proves effective in our experiments. Inference via Focused Pruning 3.2 As defined by the Eq. (1), a solution needs to con- sider all available subject-relation pairs in the KB as candidates. With a large-scale KB, the number of candidates can be notoriously large, resulting in a extremely noisy candidate pool. We propose a method to prune the candidate space. The pruning is equivalent to a function that takes a KB K and a question q as input, and outputs a much limited set C of candidate subject-relation pairs. H(K, q) → C (3) Cs and Cr are used to represent the subject and re- lation candidates, respectively. The fundamental intuition for pruning is that the subject entity must be mentioned by some textual substring (subject mention) in the question. Thus, the candidate space can be restricted to entities whose name/alias matches an n-gram of the ques- tion, as in (Yih et al., 2014; Yih et al., 2015; Bor- des et al., 2015). We refer to this straight-forward method as N-Gram pruning. By considering all n- grams, this approach usually achieves a high recall rate. However, the candidate pool is still noisy due to many non-subject-mention n-grams. Our key idea is to reduce the noise by guiding the pruning method's attention to more probable parts of a question. An observation is that cer- tain parts of a sentence are more likely to be the subject mention than others. For example, "Harry Potter" in "Who created the character Harry Pot- ter" is more likely than "the character", "charac- ter Harry", etc. Specifically, our method employs a deep network to identify such focus segments in a question. This way, the candidate pool can be not only more compact, but also significantly less noisy. Finally, combing the ideas of Eq.(2) and (3), we propose an approximate solution to the problem defined by Eq. (1) (4) s, r ≈ arg max p(sq, r)p(rq) s,r∈C 4 Proposed CFO In this section, we first review the gated recurrent unit (GRU), an RNN variant extensively used in this work. Then, we describe the model parame- terization of p(rq) and p(sq, r), and the focused pruning method in inference. 4.1 Review: Gated Recurrent Units In this work we employ GRU (Cho et al., 2014) as the RNN structure. At time step t, a GRU com- putes its hidden state ht using the following com- pound functions z = sigmoid (Wxzxt + Whzht−1 + bz) r = sigmoid (Wxrxt + Whrht−1 + br) h = tanh (Wxhxt + r ⊗ Whhht−1 + bh) ht = z ⊗ ht−1 + (1 − z) ⊗ h (5) (6) (7) (8) where W{·}, and b{·} are all trainable parameters. To better capture the context information on both sides, two GRUs with opposite directions can be combined to form a bidirectional GRU (BiGRU). 4.2 Model Parameterization Relation network In this work, the probability of relations given a question, p(rq), is modeled by the following network exp(cid:0)v(r, q)(cid:1) r(cid:48) exp(cid:0)v(r(cid:48), q)(cid:1) (cid:80) pθr (rq) = (9) where the relation scoring function v(r, q) mea- sures the similarity between the question and the relation v(r, q) = f (q)(cid:62)E(r) (10) E(r) is the trainable embedding of the relation (randomly initialized in this work) and f (q) com- putes the semantic question embedding. Specifi- cally, the question q is represented as a sequence of tokens (potentially with unknown ones). Then, the question embedding model f consists of a word embedding layer to transform tokens into distributed representations, a two-layer BiGRU to capture the question semantics, and a linear layer to project the final hidden states of the BiGRU into the same vector space as E(r). Subject network As introduced in section 3, the factor p(sq, r) models the fitness of a subject s appearing in the question q, given the main topic is about the relation r. Thus, two forces a) the raw context expressed by q, and b) the candidate topic described by r, jointly impact the fitness of the subject s. For simplicity, we use two additive terms to model the joint effect exp(cid:0)u(s, r, q)(cid:1) s(cid:48) exp(cid:0)u(s(cid:48), r, q)(cid:1) (cid:80) (11) pθs(sq, r) = where u(s, r, q) is the subject scoring function, u(s, r, q) = g(q)(cid:62)E(s) + αh(r, s) (12) g(q) is another semantic question embedding, E(s) is a vector representation of a subject, h(r, s) is the subject-relation score, and α is the weight parameter used to trade off the two sources. Firstly, the context score g(q)(cid:62)E(s) models the intrinsic plausibility that the subject s appears in the question q using vector space similarity. As g(q)(cid:62)E(s) has the same form as equation (10), we let g adpot the same model structure as f. However, initializing E(s) randomly and training it with supervised signal, just like training E(r), is insufficient in practice - while a large-scale KB has millions of subjects, only thousands of question-triple pairs are available for training. To alleviate the problem, we seek two potential solu- tions: a) pretrained embeddings, and b) type vec- tor representation. The pretrained embedding approach utilizes un- supervised method to train entity embedings. In particular, we employ the TransE (Bordes et al., 2013), which trains the embedings of entities and relations by enforcing E(s) + E(r) = E(o) for every observed triple (s, r, o) ∈ K. As there exists other improved variants (Gu et al., 2015), TransE scales the best when KB size grows. Alternatively, type vector is a fixed (not train- able) vector representation of entities using type information. Since each entity in the KB has one or more predefined types, we can encode the en- tity as a vector (bag) of types. Each dimension of a type vector is either 1 or 0, indicating whether the entity is associated with a specific type or not. Thus, the dimensionality of a type vector is equal to the number of types in KB. Under this setting, with E(s) being a binary vector, let g(q) be a con- tinuous vector with arbitrary value range can be problematic. Therefore, when type vector is used as E(s), we add a sigmoid layer upon the final lin- ear projection of g, squashing each element of g(q) to the range [0, 1]. Compared to the first solution, type vector is fully based on the type profile of an entity, and requires no training. As a benefit, considerably Hs is defined as pκ(wq) w = arg max w∈W(q) C = {(s, r) : M(s, w), s → r} (14) where M(s, w) represents some predefined match between the subject s and the predicted subject mention w. Intuitively, this pruning method re- sembles the human behavior of first identifying the subject mention with the help of context, and then using it as the key word to search the KB. To illustrate the effectiveness of this idea, we parameterize pκ(wq) with a general-purpose neu- ral labeling model, which consists of a word em- bedding layer, two layers of BiGRU, and a linear- chain conditional random field (CRF). Thus, given a question q of length T , the score of a sequence label configuration y ∈ RT is T(cid:88) T(cid:88) s(y, q) = H(q)t,yt + Ayt−1,yt t=1 t=2 where H(q) is the hidden output of the top-layer BiGRU, A is the transition matrix possesed by the CRF, and [·]i,j indicates the matrix element on row i collum j. Finally, the match function M(s, w) is simply defined as either strict match between an alias of s and w, or approximate match provided by the Freebase entity suggest API 1. Note that more elaborative match function can further boost the performance, but we leave it for future work. 5 Parameter Estimation In this section, we discuss the parameter estima- tion for the neural models presented in section 4. With standard parameterization, the focused la- beling model pκ(wq) can be directly trained by maximum likelihood estimation (MLE) and back- propagation. Thus, we omit the discussion here, and refer readers to (Huang et al., 2015) for de- tails. Also, we leave the problem of how to obtain the training data to section 6. 5.1 Decomposable Log-Likelihood To estimate the parameters of pθr (rq) and pθs(sr, q), MLE can be utilized to maximize the empirical (log-)likelihood of subject-relation pairs 1The approximate match is used only when there is no strict match. The suggest API takes a string as input, and returns no more than 20 potentially matched entities. Figure 1: Overall structure of the subject network. Sigmoid layer is added only when type vector is used as E(s). fewer parameters are needed. Also, given the type information is discriminative enough, using type vector will lead to easier generalization. However, containing only type information can be very re- strictive. In addition to the context score, we use the subject-relation score h(r, s) to capture the com- patibility that s and r show up together. Intuitively, for an entity to appear in a topic characterized by a relation, a necessary condition will be that the entity has the relation connected to it. Inspired by this structural regularity, in the simplest manner, we instantiate the idea with an indicator function, h(r, s) = 1(s → r) (13) As there exists other more sophisticated statistical parameterizations, the proposed approach is able to capture the core idea of the structural regularity without any parameter. Finally, putting two scores together, Fig.1 summarizes the overall structure of the subject network. 4.3 Focused Pruning As discussed in section 3.2, N-Gram pruning is still subject to large amount of noise in inference due to many non-subject-mention n-grams. Moti- vated by this problem, we propose to reduce such noise by focusing on more probable candidates us- ing a special-purpose sequence labeling network. Basically, a sequence labeling model is trained to tag some consecutive tokens as the subject men- tion. Following this idea, during inference, only the most probable n-gram predicted by the model will be retained, and then used as the subject men- tion to generate the candidate pool C. Hence, we refer to this method as focused pruning. Formally, let W(q) be all the n-grams of the question q, p(wq) be the probability that the n-gram w is the subject mention of q, the focused pruning function Who created ... Potter?𝐸(𝑟$)𝐸(𝑠')𝐸(𝑠()𝐸(𝑠))𝐸(𝑠*)…Linear Projection(+ Sigmoid)𝑔(𝑞)𝑝(𝑠(𝑞,𝑟$)BiGRUWordEmbed.ConcatBiGRU given the associated question. Following this idea, let {s(i), r(i), q(i)}N i=1 be the training dataset, the MLE solution takes the form N(cid:88) (cid:16) θMLE = arg max log pθr (r(i)q(i)) θr,θs (cid:17) + log pθs(s(i)r(i), q(i)) i=1 the predefined margin. Similarly, the loss function w.r.t θs takes the form N(cid:88) Ms(cid:88) L(θs) = (15) i=1 j=1 max(cid:2)0, γs − u(s(i), r(i), q(i)) + u(s(j), r(i), q(i))(cid:3) (18) N(cid:88) N(cid:88) i=1 i=1 Note that there is no shared parameter between pθs(sq, r) and pθr (rq). 2 Therefore, the same so- lution can be reached by separately optimizing the two log terms, i.e. θMLE r = arg max θr θMLE s = arg max θs log pθr (r(i)q(i)) (16) log pθs(s(i)r(i), q(i)) It is important to point out that the decomposabil- ity does not always hold. For example, when the parametric form of h(s, r) depends on the embed- ding of r, the two terms will be coupled and joint optimization must be performed. From this per- spective, the simple form of h(s, r) also eases the training by inducing the decomposability. 5.2 Approximation with Negative Samples As the two problems defined by equation (16) take the standard form of classification, theoretically, cross entropy can used as the training objective. However, computing the partition function is often intractable, especially for pθs(sr, q), since there can be millions of entities in the KB. Faced with this problem, classic solutions include contrastive estimation (Smith and Eisner, 2005), importance sampling approximation (Bengio et al., 2003), and hinge loss with negative samples (Collobert and Weston, 2008). In this work, we utilize the hinge loss with nega- tive samples as the training objective. Specifically, the loss function w.r.t θr has the form N(cid:88) Mr(cid:88) i=1 j=1 max(cid:2)0, γr − v(r(i), q(i)) + v(r(j), q(i))(cid:3) (17) L(θr) = where r(j) is one of the Mr negative samples (i.e. s(i) (cid:54)→ r(j)) randomly sampled from R, and γr is 2Word embeddings are not shared across models. Despite the negative sample based approximation, there is another practical difficulty when type vec- tor is used as the subject representation. Specifi- cally, computing the value of u(s(j), r(i), q(i)) re- quires to query the KB for all types of each nega- tive sample s(j). So, when Ms is large, the train- ing can be extremely slow due to the limited band- width of KB query. Consequently, under the set- ting of type vector, we instead resort to the follow- ing type-wise binary cross-entropy loss (cid:16) L(θs) = − N(cid:88) K(cid:88) (cid:3) log(cid:2)1 − g(q(i))k +(cid:2)1 − E(s(i))k E(s(i))k log g(q(i))k (cid:3)(cid:17) (19) k=1 i=1 where K is the total number of types, g(q)k and E(s(i))k are the k-th element of g(q) and E(s(i)) respectively. Intuitively, with sigmoid squashed output, g(q) can be regarded as K binary classi- fiers, one for each type. Hence, g(q)k reprents the predicted probability that the subject is associated with the k-th type. 6 Experiments In this section, we conduct experiments to evaluate the proposed system empirically. 6.1 Dataset and Knowledge Base We train and evaluate our method on the SIMPLE- QUESTIONS dataset3 - the largest question-triple dataset. It consists of 108,442 questions written in English by human annotators. Each question is paired with a subject-relation-object triple from Freebase. We follow the same splitting for train- ing (70%), validation (10%) and testing (20%) as (Bordes et al., 2015). We use the same subset of Freebase (FB5M) as our knowledge base so that the results are directly comparable. It includes 4,904,397 entities, 7,523 relations, and 22,441,880 facts. There are alternative datasets available, such as WebQuestions (Berant et al., 2013) and 3https://research.facebook.com/ researchers/1543934539189348 Free917 (Cai and Yates, 2013). However, these datasets are quite restricted in sample size - the former includes 5,810 samples (train + test) and the latter includes 917 ones. They are fewer than the number of relations in Freebase. To train the focused labeling model, the infor- mation about whether a word is part of the sub- ject mention is needed. We obtain such informa- tion by reverse linking from the ground-truth sub- ject to its mention in the question. Given a ques- tion q corresponding to subject s, we match the name and aliases of s to all n-grams that can be generated from q. Once a match is found, we la- bel the matched n-gram as the subject mention. In the case of multiple matches, only the longest matched n-gram is used as the correct one. 6.2 Evaluation and Baselines For evaluation, we consider the same metric in- troduced in (Bordes et al., 2015), which takes the prediction as correct if both the subject and rela- tion are correctly retrieved. Based on this met- ric, we compare CFO with a few baseline systems, which include both the Memory Network QA sys- tem (Bordes et al., 2015), and systems with al- ternative components and parameterizations from existing work (Yih et al., 2014; Yih et al., 2015). We did not compare with alternative subject net- works because the only existing method (Yih et al., 2014) relies on unique textual name of each entity, which does not generally hold in knowledge bases (except in REVERB). Alternative approaches for pruning method, relation network, and entity rep- resentation are described below. Pruning methods We consider two baseline methods previously used to prune the search space. The first baseline is the N-Gram pruning method introduced in Section 3, as it has been suc- cessfully used in previous work (Yih et al., 2014; Yih et al., 2015). Basically, it establishes the candidate pool by retaining subject-relation pairs whose subject can be linked to one of the n-grams generated from the question. The second one is N- Gram+, a revised version of the N-Gram pruning with additional heuristics (Bordes et al., 2015). In- stead of considering all n-grams that can be linked to entities in KB, heuristics related to overlapping n-grams, stop words, interrogative pronouns, and so on are exploited to further shrink the n-gram pool. Accordingly, the search space is restricted to subject-relation pairs whose subject can be linked to one of the remaining n-grams after applying the heuristic filtering. Relation scoring network We compare our pro- posed method with two previously used models. The first baseline is the embedding average model (Embed-AVG) used in (Bordes et al., 2014a; Bor- des et al., 2014b; Bordes et al., 2015). Basically, it takes the element-wise average of the word em- beddings of the question to be the question rep- resentation. The second one is the letter-tri-gram CNN (LTG-CNN) used in (Yih et al., 2014; Yih et al., 2015), where the question and relation are separately embedded into the vector space by two parameter shared LTG-CNNs. 4 In addition, (Yih et al., 2014; Yih et al., 2015) observed better per- formance of the LTG-CNN when substituting the subject mention with a special symbol. Naturally, this can be combined with the proposed focused labeling, since the latter is able to identify the po- tential subject mention in the question. So, we train another LTG-CNN with symbolized ques- tions, which is denoted as LTG-CNN+. Note that this model is only tested when the focused labeling pruning is used. Entity representation In section 4.2, we de- scribe two possible ways to improve the vector representation of the subject, TransE pretrained embedding and type vectors. To evaluate their ef- fectiveness, we also include this variation in the experiment, and compare their performance with randomly initialized entity embeddings. 6.3 Experiment Setting During training, all word embeddings are initial- ized using the pretrained GloVe (Pennington et al., 2014), and then fine tuned in subsequent train- ing. The word embedding dimension is set to 300, and the BiGRU hidden size 256. For pre- training the entity embeddings using TransE (see section 4.2), only triples included in FB5M are used. All other parameters are randomly ini- tialized uniformly from [−0.08, 0.08], following (Graves, 2013). Both hinge loss margins γs and γr are set to 0.1. Negative sampling sizes Ms and Mr are both 1024. For optimization, parameters are trained using mini-batch AdaGrad (Duchi et al., 2011) with Mo- mentum (Pham et al., 2015). Learning rates are 4In Freebase, each predefined relation has a single human- recognizable reference form, usually a sequence of words. Pruning Method Relation Network Memory Network Entity Representation Random Pretrain Type Vec 62.9 63.9∗ N-Gram N-Gram+ Focused Pruning Embed-AVG LTG-CNN BiGRU Embed-AVG LTG-CNN BiGRU Embed-AVG LTG-CNN LTG-CNN+ BiGRU 39.4 32.8 43.7 53.8 46.3 58.3 71.4 67.6 70.2 75.2 42.2 36.8 46.7 57.0 50.9 61.6 71.7 67.9 70.4 75.5 50.9 45.6 55.7 58.7 56.0 62.6 72.1 68.6 71.1 75.7 Table 1: Accuracy on SIMPLEQUESTIONS testing set. ∗ indi- cates using ensembles. N-Gram+ uses additional heuristics. The proposed CFO (focused pruning + BiGRU + type vector) achieves the top accuracy. tuned to be 0.001 for question embedding with type vector, 0.03 for LTG-CNN methods, and 0.02 for rest of the models. Momentum rate is set to 0.9 for all models, and the mini-batch size is 256. In addition, vertical dropout (Pham et al., 2014; Zaremba et al., 2014) is used to regularize all Bi- GRUs in our experiment. 5 6.4 Results Trained on 75,910 questions, our proposed model and baseline methods are evaluated on the testing set with 21,687 questions. Table 1 presents the ac- curacy of those methods. We evaluated all combi- nations of pruning methods, relation networks and entity representation schemes, as well as the result from memory network, as described in Section 6.1. CFO (focused pruning + BiGRU + type vec- tor) achieves the best performance, outperforming all other methods by substantial margins. By inspecting vertically within each cell in Ta- ble 1, for the same pruning methods and entity rep- resentation scheme, BiGRU based relation scor- ing network boosts the accuracy by 3.5 % to 4.8% compared to the second best alternative. This ev- idence suggests the superiority of RNN in captur- ing semantics of question utterances. Surprisingly, it turns out that Embed-AVG achieves better per- formance than the more complex LTG-CNN. By inspecting Table 1 horizontally, type vec- tor based representation constantly leads to bet- ter performance, especially when N-Gram pruning is used. It suggests that under sparse supervision, training high-quality distributed knowledge repre- sentations remains a challenging problem. That said, pretraining entity embeddings with TransE indeed gives better performance compared to ran- dom initialization, indicating the future potential of unsupervised methods in improving continuous knowledge representation. In addition, all systems using our proposed fo- cused pruning method outperform their counter- parts with alternative pruning methods. Without using ensembles, CFO is already better than the memory network ensembles by 11.8%. It sub- stantiates the general effectiveness of the focused pruning with subject labeling method regardless of other sub-modules. 6.5 Effectiveness of Pruning According to the results in section 6.4, the focused pruning plays a critical role in achieving the best performance. To get a deeper understanding of its effectiveness, we analyze how the pruning meth- ods affect the accuracy of the system. Due to space limit, we focus on systems with BiGRU as the re- lation scoring function and type vector as the en- tity representation. Table 2 summarizes the recall - the percent- age of pruned subject-relation candidates contain- ing the answer - and the resulting accuracy. The single-subject case refers to the scenario that there is only one candidate entity in Cs (possi- bly with multiple relations), and the multi-subject case means there are multiple entities in Cs. As the table shows, focused pruning achieves com- parable recall rate to N-Gram pruning.6 Given the state-of-the-art performance of sequence la- beling systems, this result should not be surpris- ing. Thus, the difference in performances entirely comes from their resulting accuracy. Notice that there exists a huge accuracy gap between the two cases. Essentially, in the single-candidate case, the system only need to identify the relation based on the more robust model pθr (rq). In contrast, under the multi-candidate case, the system also relies on pθs(sq, r), which has significantly more parame- ters to estimate, and thus is less robust. Conse- quently, by only focusing on the most probable sub-string, the proposed focused pruning produces much more single-candidate situations, leading to a better overall accuracy. 5For more details, source code is available at http:// zihangdai.github.io/cfo for reference. 6Less than 3% of the recalled candidates rely on approxi- mate matching in the focused pruning. Pruning method Pruning recall N-Gram N-Gram+ Focused pruning 94.8% 92.9% 94.9% 9925 / 10705 = 92.7% = 85.7% 12051 / 20533 = 58.7% 55.7% = 91.3% 13460 / 20017 = 67.2% 62.6% 6482 / 9876 = 65.6% 75.7% Single-subject case 18 / 21 126 / 138 Inference accuracy within the recalled Multi-subject case Overall accuracy Table 2: Comparison of different space pruning methods. N-Gram+ uses additional heuristics. Single- and multi-subject refers to the number of distinct subjects in candidates. The proposed focused pruning achieves best scores. 6.6 Additional Analysis In the aforementioned experiments, we have kept the focused labeling model and the subject scoring network fixed. To further understand the impor- tance and sensitivity of this specific model design, we investigate some variants of these two models. Alternative focus with CRF RNN-CRF based models have achieved the state-of-the-art perfor- mance on various sequence labeling tasks (Huang et al., 2015; Lu et al., 2015). However, the la- beling task we consider here is relatively unso- phisticated in the sense that there are only two categories of labels - part of subject string (SUB) or not (O). Thus, it's worth investigating whether RNN (BiGRU in our case) is still a critical com- ponent when the task gets simple. Hence, we es- tablish a CRF baseline which uses traditional fea- tures as input. Specifically, the model is trained with Stanford CRF-NER toolkit 7 on the same reversely linked labeling data (section 6.1). For evaluation, we directly compare the sentence level accuracy of these two models on the test portion of the labeling data. A sentence labeling is con- sidered correct only when all tokens are correctly labeled. 8 It turns out the RNN-CRF achieves an accuracy of 95.5% while the accuracy of feature based CRF is only 91.2%. Based on the result, we conclude that BiGRU plays a crucial role in our focused pruning module. Subject scoring with average embedding As discussed in section 4.2, the subject network g is chosen to be the same as f, mainly relying on a two-layer BiGRU to produce the semantic ques- tion embeding. Although it is a natural choice, it remains unclear whether the final performance is sensitive to this design. Motivated by this ques- tion, we substitute the BiGRU with an Embed- AVG model, and evalute the system performance. 7http://nlp.stanford.edu/software/ CRF-NER.shtml 8As F -1 score is usually used as the metric for sequence labeling, sentence level accuracy is more informative here. Relation Network Embed-AVG LTG-CNN LTG-CNN+ BiGRU Subject Network Embed-AVG BiGRU 71.6 68.0 70.4 75.4 72.1 68.6 71.1 75.7 Table 3: System performance with different subject network structures. For this experiment, we always use focused prun- ing and type vector, but vary the structure of the relation scoring network to allow high-order inter- action across models. The result is summarized in Table 3. Insepcting the table horizontally, when BiGRU is employed as the subject network, the accuracy is consistently higher regardless of re- lation network structures. However, the margin is quite narrow, especially compared to the effect of varying the relation network structure the same way. We suspect this difference reflects the fact that modeling p(sr, q) is intrinsically more chal- lenging than modeling p(rq). It also suggests that learning smooth entity representations with good discriminative power remains an open problem. 7 Conclusion In this paper, we propose CFO, a novel approach to single-fact question answering. We employ a conditional factoid factorization by inferring the target relation first and then the target subject as- sociated with the candidate relations. To resolve the representation for millions of entities, we pro- posed type-vector scheme which requires no train- ing. Our focused pruning largely reduces the can- didate space without loss of recall rate, leading to significant improvement of overall accuracy. Compared with multiple baselines across three as- pects, our method achieves the state-of-the-art ac- curacy on a 108k question dataset, the largest pub- licly available one. Future work could be extend- ing the proposed method to handle more complex questions. References [Bengio et al.2003] Yoshua Bengio, R´ejean Ducharme, Pas- cal Vincent, and Christian Janvin. 2003. A neural proba- bilistic language model. The Journal of Machine Learning Research, 3:1137–1155. [Berant and Liang2014] Jonathan Berant and Percy Liang. 2014. Semantic parsing via paraphrasing. In Proceedings of ACL, volume 7, page 92. [Berant and Liang2015] Jonathan Berant and Percy Liang. 2015. Imitation learning of agenda-based semantic parsers. Transactions of the Association for Computa- tional Linguistics, 3:545–558. [Berant et al.2013] Jonathan Berant, Andrew Chou, Roy Frostig, and Percy Liang. 2013. Semantic parsing on free- In Proceedings of the base from question-answer pairs. 2013 Conference on Empirical Methods in Natural Lan- guage Processing, pages 1533–1544. [Bollacker et al.2008] Kurt Bollacker, Colin Evans, Praveen Paritosh, Tim Sturge, and Jamie Taylor. 2008. Freebase: a collaboratively created graph database for structuring hu- man knowledge. In Proceedings of the 2008 ACM SIG- MOD international conference on Management of data, pages 1247–1250. ACM. [Bordes et al.2013] Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. 2013. Translating embeddings for modeling multi- relational data. In Advances in Neural Information Pro- cessing Systems, pages 2787–2795. [Bordes et al.2014a] Antoine Bordes, Sumit Chopra, and Ja- son Weston. 2014a. Question answering with subgraph In Proceedings of the 2014 Conference embeddings. on Empirical Methods in Natural Language Processing, pages 615–620. [Bordes et al.2014b] Antoine Bordes, Jason Weston, and Nicolas Usunier. 2014b. Open question answering with weakly supervised embedding models. In Machine Learn- ing and Knowledge Discovery in Databases, pages 165– 180. Springer. [Bordes et al.2015] Antoine Bordes, Nicolas Usunier, Sumit Chopra, and Jason Weston. 2015. Large-scale sim- ple question answering with memory networks. arXiv preprint arXiv:1506.02075. [Cai and Yates2013] Qingqing Cai and Alexander Yates. 2013. Large-scale semantic parsing via schema match- In ACL (1), pages 423–433. ing and lexicon extension. Citeseer. [Carlson et al.2010] Andrew Carlson, Justin Betteridge, Bryan Kisiel, Burr Settles, Estevam R Hruschka Jr, and 2010. Toward an architecture for Tom M Mitchell. In AAAI, volume 5, never-ending language learning. page 3. [Cho et al.2014] Kyunghyun Cho, Bart van Merrienboer, C¸ aglar Gulc¸ehre, 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 Natural Language Processing, pages 1724–1734. [Collobert and Weston2008] Ronan Collobert and Jason We- ston. 2008. A unified architecture for natural language processing: Deep neural networks with multitask learn- ing. In Proceedings of the 25th international conference on Machine learning, pages 160–167. ACM. [Duchi et al.2011] John Duchi, Elad Hazan, and Yoram Singer. 2011. Adaptive subgradient methods for online learning and stochastic optimization. The Journal of Ma- chine Learning Research, 12:2121–2159. [Fader et al.2013] Anthony Fader, Luke S Zettlemoyer, and Oren Etzioni. 2013. Paraphrase-driven learning for open question answering. In ACL (1), pages 1608–1618. Cite- seer. [Graves2013] Alex Graves. Generating se- quences with recurrent neural networks. arXiv preprint arXiv:1308.0850. 2013. [Gu et al.2015] Kelvin Gu, John Miller, and Percy Liang. 2015. Traversing knowledge graphs in vector space. In Proceedings of the 2015 Conference on Empirical Meth- ods in Natural Language Processing, pages 318–327. [Hermann et al.2015] Karl Moritz Hermann, Tomas Kocisky, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman, and Phil Blunsom. 2015. Teaching machines to read and comprehend. In Advances in Neural Informa- tion Processing Systems, pages 1684–1692. [Huang et al.2015] Zhiheng Huang, Wei Xu, and Kai Yu. 2015. Bidirectional LSTM-CRF models for sequence tag- ging. CoRR, abs/1508.01991. [Iyyer et al.2014] Mohit Iyyer, Boyd-Graber, Leonardo Claudino, Richard Socher, and Hal Daum´e III. 2014. A neural network for factoid question answering In Empirical Methods in Natural over paragraphs. Language Processing. Jordan [Kumar et al.2015] Ankit Kumar, Ozan Irsoy, Jonathan Su, James Bradbury, Robert English, Brian Pierce, Peter On- druska, Ishaan Gulrajani, and Richard Socher. 2015. Ask me anything: Dynamic memory networks for natural lan- guage processing. arXiv preprint arXiv:1506.07285. [Kwiatkowski et al.2013] Tom Kwiatkowski, Eunsol Choi, Yoav Artzi, and Luke Zettlemoyer. 2013. Scaling se- mantic parsers with on-the-fly ontology matching. In Pro- ceedings of the 2013 Conference on Empirical Methods in Natural Language Processing. [Lee et al.2015] Moontae Lee, Xiaodong He, Wen-tau Yih, Jianfeng Gao, Li Deng, and Paul Smolensky. 2015. Rea- soning in vector space: An exploratory study of question answering. arXiv preprint arXiv:1511.06426. [Lehmann et al.2014] Jens Lehmann, Robert Isele, Max Jakob, Anja Jentzsch, Dimitris Kontokostas, Pablo N Mendes, Sebastian Hellmann, Mohamed Morsey, Patrick van Kleef, Soren Auer, et al. 2014. Dbpedia-a large-scale, multilingual knowledge base extracted from wikipedia. Semantic Web Journal, 5:1–29. [Liang et al.2011] Percy Liang, Michael I Jordan, and Dan Klein. 2011. Learning dependency-based compositional semantics. In Association for Computational Linguistics (ACL), pages 590–599. [Liang et al.2013] Percy Liang, Michael I Jordan, and Dan Klein. 2013. Learning dependency-based compositional semantics. Computational Linguistics, 39(2):389–446. [Yih et al.2014] Wen-tau Yih, Xiaodong He, and Christopher Meek. 2014. Semantic parsing for single-relation ques- tion answering. In Proceedings of ACL. [Yih et al.2015] Wen-tau Yih, Ming-Wei Chang, Xiaodong He, and Jianfeng Gao. 2015. Semantic parsing via staged query graph generation: Question answering with knowl- edge base. In Proceedings of ACL. [Zaremba et al.2014] Wojciech Zaremba, Ilya Sutskever, and Oriol Vinyals. 2014. Recurrent neural network regular- ization. CoRR, abs/1409.2329. [Zelle and Mooney1996] John M Zelle and Raymond J Mooney. 1996. Learning to parse database queries using inductive logic programming. In Proceedings of the Na- tional Conference on Artificial Intelligence, pages 1050– 1055. [Lu et al.2015] Zefu Lu, Lei Li, and Wei Xu. 2015. Twisted In Bay recurrent network for named entity recognition. Area Machine Learning Symposium. [Peng et al.2015] Baolin Peng, Zhengdong Lu, Hang Li, and Kam-Fai Wong. 2015. Towards neural network-based reasoning. arXiv preprint arXiv:1508.05508. [Pennington et al.2014] Jeffrey Pennington, Richard Socher, and Christopher D. Manning. 2014. Glove: Global vec- tors for word representation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing, pages 1532–1543. [Pham et al.2014] Vu Pham, Th´eodore Bluche, Christopher Kermorvant, and J´erome Louradour. 2014. Dropout im- proves recurrent neural networks for handwriting recogni- tion. In Frontiers in Handwriting Recognition (ICFHR), 2014 14th International Conference on, pages 285–290. IEEE. [Pham et al.2015] Hieu Pham, Zihang Dai, and Lei Li. 2015. On optimization algorithms for recurrent networks with long short-term memory. In Bay Area Machine Learning Symposium. [Reddy et al.2014] 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. [Smith and Eisner2005] Noah A Smith and Jason Eisner. 2005. Contrastive estimation: Training log-linear mod- In Proceedings of the 43rd An- els on unlabeled data. nual Meeting on Association for Computational Linguis- tics, pages 354–362. Association for Computational Lin- guistics. [Suchanek et al.2007] Fabian M Suchanek, Gjergji Kasneci, and Gerhard Weikum. 2007. Yago: a core of semantic knowledge. In Proceedings of the 16th international con- ference on World Wide Web, pages 697–706. ACM. [Tang and Mooney2001] Lappoon R Tang and Raymond J Mooney. 2001. Using multiple clause constructors in in- ductive logic programming for semantic parsing. In Ma- chine Learning: ECML 2001, pages 466–477. Springer. [Weston et al.2015] Jason Weston, Sumit Chopra, and An- toine Bordes. 2015. Memory networks. In International Conference on Learning Representations (ICLR2015). [Weston et al.2016] Jason Weston, Antoine Bordes, Sumit Chopra, and Tomas Mikolov. 2016. Towards ai-complete question answering: A set of prerequisite toy tasks. In International Conference on Learning Representations (ICLR2016). [Yang et al.2014] Min-Chul Yang, Nan Duan, Ming Zhou, and Hae-Chang Rim. 2014. Joint relational embeddings for knowledge-based question answering. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing, pages 645–650. [Yao and Van Durme2014] Xuchen Yao and Benjamin Van Durme. 2014. Information extraction over structured data: Question answering with freebase. In Proceedings of ACL.
1711.05170
1
1711
2017-11-14T16:19:34
On Extending Neural Networks with Loss Ensembles for Text Classification
[ "cs.CL", "cs.LG", "stat.ML" ]
Ensemble techniques are powerful approaches that combine several weak learners to build a stronger one. As a meta learning framework, ensemble techniques can easily be applied to many machine learning techniques. In this paper we propose a neural network extended with an ensemble loss function for text classification. The weight of each weak loss function is tuned within the training phase through the gradient propagation optimization method of the neural network. The approach is evaluated on several text classification datasets. We also evaluate its performance in various environments with several degrees of label noise. Experimental results indicate an improvement of the results and strong resilience against label noise in comparison with other methods.
cs.CL
cs
On Extending Neural Networks with Loss Ensembles for Text Classification Hamideh Hajiabadi Ferdowsi University of Mashhad (FUM) Mashhad, Iran Diego Molla-Aliod Macquarie University Sydney, New South Wales, Australia [email protected] [email protected] Ferdowsi University of Mashhad (FUM) Reza Monsefi Mashhad, Iran 7 1 0 2 v o N 4 1 ] L C . s c [ 1 v 0 7 1 5 0 . 1 1 7 1 : v i X r a [email protected] Abstract Ensemble techniques are powerful ap- proaches that combine several weak learn- ers to build a stronger one. As a meta learning framework, ensemble techniques can easily be applied to many machine learning techniques. In this paper we propose a neural network extended with an ensemble loss function for text clas- sification. The weight of each weak loss function is tuned within the train- ing phase through the gradient propaga- tion optimization method of the neural net- work. The approach is evaluated on sev- eral text classification datasets. We also evaluate its performance in various en- vironments with several degrees of label noise. Experimental results indicate an improvement of the results and strong re- silience against label noise in comparison with other methods. Introduction 1 In statistics and machine learning, ensemble meth- ods use multiple learning algorithms to obtain better predictive performance (Mannor and Meir, 2001). It has been proved that ensemble meth- ods can boost weak learners whose accuracies are slightly better than random guessing into arbi- trarily accurate strong learners (Bai et al., 2014; Zhang et al., 2016). When it could not be possi- ble to directly design a strong complicated learn- ing system, ensemble methods would be a possible solution. In this paper, we are inspired by ensem- ble techniques to combine several weak loss func- tions in order to design a stronger ensemble loss function for text classification. In this paper we will focus on multi-class clas- sification where the class to predict is encoded as a vector y with the one-hot encoding of the target label, and the output of a classifier y = f (x; θ) is a vector of probability estimates of each label given input sample x and training parameters θ. Then, a loss function L(y, y) is a positive function that measures the error of estimation (Steinwart and Christmann, 2008). Different loss functions have different properties, and some well-known loss functions are shown in Table 1. Different loss functions lead to different Optimum Bayes Estimators having their own unique characteris- tics. So, in each environment, picking a specific loss function will affect performance significantly (Xiao et al., 2017; Zhao et al., 2010). In this paper, we propose an approach for com- bining loss functions which performs substantially better especially when facing annotation noise. The framework is designed as an extension to reg- ular neural networks, where the loss function is re- placed with an ensemble of loss functions, and the ensemble weights are learned as part of the gradi- ent propagation process. We implement and eval- uate our proposed algorithm on several text classi- fication datasets. The paper is structured as follows. An overview of several loss functions for classification is briefly introduced in Section 2. The proposed framework and the proposed algorithm are explained in Sec- tion 3. Section 4 contains experimental results on classifying several text datasets. The paper is con- cluded in Section 5. 2 Background A typical machine learning problem can be re- duced to an expected loss function minimization problem (Bartlett et al., 2006; Painsky and Rosset, 2016). Rosasco et al. (2004) studied the impact of choosing different loss functions from the view- point of statistical learning theory. In this section, Name of loss function Zero-One (Xiao et al., 2017) L(y, y) L0−1 = z ≥ 0 z < 0 0 max(0, 1 − z) z ≥ 1 z < 1 0 1 (cid:40) (cid:40) 0 z ≥ 1 0 ≤ z < 1 z ≤ 0 Hinge Loss (Masnadi-Shirazi and Vasconcelos, 2009; Steinwart, 2002) LH = Smoothed Hinge (Zhao et al., 2010) Square Loss Correntropy Loss (Liu et al., 2007, 2006) Cross-Entropy Loss (Masnadi-Shirazi et al., 2010) Absolute Loss LS−H = 1−z2 max(0, 1 − z) 2 2 LS = (cid:107)y − y(cid:107)2 (cid:107)y−y(cid:107)2 LC = exp LC−E = log (1 + exp (−z)) LA = (cid:107)y − y(cid:107)1 σ2 2 Table 1: Several well-known loss functions, where z = y · y ∈ R. several well-known loss functions are briefly in- troduced, followed by a review of ensemble meth- ods. In the literature, loss functions are divided into margin-based and distance-based categories. Margin-based loss functions are often used for classification purposes (Steinwart and Christ- mann, 2008; Khan et al., 2013; Chen et al., 2017). Since we evaluate our work on classification of text datasets, in this paper we focus on margin- based loss functions. A margin-based loss function is defined as a penalty function L(y, y) based in a margin z = y · y. In any given application, some margin- based loss functions might have several disadvan- tages and advantages and we could not certainly tell which loss function is preferable in general. For example, consider the Zero-One loss function which penalizes all the misclassified samples with the constant value of 1 and the correctly classified samples with no loss. This loss function would re- sult in a robust classifier when facing outliers but it would have a terrible performance in an applica- tion with margin focus (Zhao et al., 2010). A loss function is margin enforcing if minimiza- tion of the expected loss function leads to a clas- sifier enhancing the margin (Masnadi-Shirazi and Vasconcelos, 2009). Learning a classifier with an acceptable margin would increase generalization. Enhancing the margin would be possible if the loss function returns a small amount of loss for the cor- rect samples close to the classification hyperplane. For example, Zero-One does not penalize correct samples at all and therefore it does not enhance the margin, while Hinge Loss is a margin enhancing loss function. The general idea of ensemble techniques is to combine different expert ideas aiming at boosting the accuracy based on enhanced decision making. Predominantly, the underlying idea is that the de- cision made by a committee of experts is more re- liable than the decision of one expert alone (Bai et al., 2014; Mannor and Meir, 2001). Ensemble techniques as a framework have been applied to a variety of real problems and better results have been achieved in comparison to using a single ex- pert. Having considered the importance of the loss function in learning algorithms, in order to reach a better learning system, we are inspired by ensem- ble techniques to design an ensemble loss func- tion. The weight applied to each weak loss func- tion is tuned through the gradient propagation op- timization of a neural network working on a text classification dataset. Other works (Shi et al., 2015; BenTaieb et al., 2016) have combined two loss functions where the weights are specified as a hyperparameter set prior to the learning process (e.g. during a fine-tuning process with crossvalidation). In this paper, we combine more than two functions and the hyperpa- rameter is not set a-priory but it is learned during the training process. 3 Proposed Approach Let (x, y) be a sample where x ∈ RN is the input and y ∈ {0, 1}C is the one-hot encoding of the label (C is the number of classes). Let θ be the parameters of a neural network classi- fier with a top softmax layer so that the proba- bility estimates are y = sof tmax(f (x; θ)). Let {Li(y, y)}M i=1 denote M weak loss functions. In addition to finding the optimal θ, the goal is to find the best weights , {λ1, λ2, . . . , λM}, to combine M weak loss functions in order to generate a bet- ter application-tailored loss function. We need to add a further constraint to avoid yielding near zero values for all λi weights. The proposed ensemble loss function is defined as below. M(cid:88) M(cid:88) L = λjLj(y, y), λj = 1 (1) j=1 j=1 The optimization problem could be defined as fol- lows, given T training samples. M(cid:88) T(cid:88) M(cid:88) i=1 j=1 minimize θ,λ s.t. λjLj(yi, yi) j=1 λj = 1, λi ≥ 0 (2) To make the optimization algorithm simpler, we use λ2 instead of λi, so the second constraint i λi ≥ 0 can be omitted. We then incorporate the constraint as a regularization term based on the concept of Augmented Lagrangian. The modified objective function using Augmented Lagrangian is presented as follows. minimize θ,λ T(cid:88) M(cid:88) M(cid:88) j=1 i=1 η1( j=1 λ2 j Lj(yi, yi)+ M(cid:88) j − 1) + η2( λ2 j=1 j − 1)2 λ2 (3) Note that the amount of η2 must be significantly greater that η1 (Nocedal and Wright, 2006) . The first and the second terms of the objective function cause λ2 i values to approach zero but the third term satisfies(cid:80)M j=1 λ2 j = 1. Figure 1 illustrates the framework of the pro- posed approach with the dashed box represent- ing the contribution of this paper. In the training phase, the weight of each weak loss function is trained through the gradient propagation optimiza- tion method. The accuracy of the model is calcu- lated in a test phase not shown in the figure. Figure 1: The proposed learning diagram 4 Experimental Results We have applied the proposed ensemble loss func- tion to several text datasets. Table 2 provides a brief description of the datasets. To reach a bet- ter ensemble loss function we choose three loss functions with different approaches in facing with outliers, as weak loss functions: Correntropy Loss which does not assign a high weight to sam- ples with big errors, Hinge Loss which penalizes linearly and Cross-entropy Loss function which highly penalizes the samples whose predictions are far from the targets. We compared results with 3 loss functions which are widely used in neural networks: Cross-entropy, Square Loss, and Hinge Loss. We picked η1 near zero and η2 = 200 in (3). Since this work is a proof of concept, the neural networks of each application are simply a softmax of the linear combination of input features plus bias: y = softmax(x · W + b) where the input features x are the word frequen- cies in the input text. Thus, θ in our notation is composed of W and b. We use Python and its Ten- sorFlow package for implementing the proposed approach. The results are shown in Table 3. The table compares the results of using individual loss functions and the ensemble loss. Name of Datasets 20-newsgroup Movie-reviews in corpus Email-Classification (TREC) Reuters-21578 Description is a col- This data set lection of 20,000 mes- from sages,collected 20 different net-news newsgroups. The NLTK corpus movie- reviews data set has the re- views, and they are labeled already as positive or nega- tive. It is a collection of sample emails (i.e. a text corpus). In this corpus, each email has already been labeled as Spam or Ham. The data was originally collected and labeled by Carnegie Group, Inc. and Reuters, Ltd. in the course of developing the CON- STRUE text categorization system Table 2: Description of dataset Dataset Cross- entropy 0.80 0.83 20- newsgroups Movie- review 0.88 Email- Classification (TREC) Reuters 0.79 Hinge Square Ensemble 0.69 0.81 0.78 0.82 0.85 0.96 0.85 0.83 0.97 0.79 0.81 0.81 Table 3: Accuracy We have also compared the robustness of the proposed loss function with the use of individual loss functions. In particular, we add label noise by randomly modifying the target label in the train- ing samples, and keep the evaluation set intact. We conducted experiments with 10% and 30% of noise, where e.g. 30% of noise means randomly changing 30% of the labels in the training data. Tables 4 and 5 show the results, with the best re- sults shown in boldface. We can observe that, in virtually all of the experiments, the ensemble loss is at least as good as the individual losses, and in only two cases the loss is (slightly) worse. And, in general, the ensemble loss performed compara- tively better as we increased the label noise. Dataset Cross- entropy 0.79 0.75 20- newsgroups Movie- reviews Email- 0.86 Classification (TREC) Reuters 0.76 Hinge Square Ensemble 0.67 0.74 0.57 0.69 0.73 0.82 0.83 0.78 0.96 0.69 0.71 0.73 Table 4: Accuracy in data with 10% label noise 5 Conclusion This paper proposed a new loss function based on ensemble methods. This work focused on text classification tasks and can be considered as an initial attempt to explore the use of ensemble loss functions. The proposed loss function shows an improvement when compared with the use of well- known individual loss functions. Furthermore, the approach is more robust against the presence of label noise. Moreover, according to our experi- ments, the gradient descent method quickly con- verged. Dataset Cross- entropy 0.57 0.55 20- newsgroups movie- review 0.80 Email- Classification (TREC) Reuters 0.64 Hinge Square Ensemble 0.64 0.54 0.46 0.55 0.55 0.81 0.82 0.6 0.93 0.54 0.53 0.68 Table 5: Accuracy in data with 30% label noise We have used a very simple neural architecture in this work but in principle this method could be used for systems that use any neural networks. In future work we will explore the integration of more complex neural networks such as those using convolutions and recurrent networks. We also plan to study the application of this method to other tasks such as sequence labeling (e.g. for NER and PoS tagging). Another possible extension could focus on handling sparseness by adding a regular- ization term. application to Lasso regularization. IEEE transac- tions on pattern analysis and machine intelligence 38(2):308–321. Lorenzo Rosasco, Ernesto De Vito, Andrea Capon- netto, Michele Piana, and Alessandro Verri. 2004. Are loss functions all the same? Neural Computa- tion 16(5):1063–1076. Qinfeng Shi, Mark Reid, Tiberio Caetano, An- and Zhenhua Wang. ton Van Den Hengel, 2015. A hybrid loss for multiclass and struc- IEEE Transactions on Pattern tured prediction. Analysis and Machine Intelligence 37(1):2–12. https://doi.org/10.1109/TPAMI.2014.2306414. Ingo Steinwart. 2002. Support vector machines are universally consistent. Journal of Complexity 18(3):768–791. Ingo Steinwart and Andreas Christmann. 2008. Sup- port Vector Machines. Springer Science & Business Media. Yingchao Xiao, Huangang Wang, and Wenli Xu. 2017. Ramp loss based robust one-class SVM. Pattern Recognition Letters 85:15–20. Peng Zhang, Tao Zhuo, Yanning Zhang, Hanqiao Huang, and Kangli Chen. 2016. Bayesian track- ing fusion framework with online classifier ensem- ble for immersive visual applications. Multimedia Tools and Applications 75(9):5075–5092. Lei Zhao, Musa Mammadov, and John Yearwood. 2010. From convex to nonconvex: A loss func- tion analysis for binary classification. In Data Min- ing Workshops (ICDMW), 2010 IEEE International Conference on. IEEE, pages 1281–1288. References Qinxun Bai, Henry Lam, and Stan Sclaroff. 2014. A Bayesian framework for online classifier ensemble. In Proceedings of the 31st International Conference on Machine Learning (ICML-14). pages 1584–1592. Peter L Bartlett, Michael I Jordan, and Jon D McAuliffe. 2006. Convexity, classification, and risk bounds. Journal of the American Statistical Associ- ation 101(473):138–156. Aıcha BenTaieb, Jeremy Kawahara, and Ghassan Hamarneh. 2016. Multi-loss convolutional networks In Biomedical for gland analysis in microscopy. Imaging (ISBI 2016). pages 642–645. Badong Chen, Lei Xing, Bin Xu, Haiquan Zhao, Nan- ning Zheng, and Jose C Principe. 2017. Kernel risk- sensitive loss: Definition, properties and application IEEE Transactions on to robust adaptive filtering. Signal Processing 65(11):2888–2901. Inayatullah Khan, Peter M Roth, Abdul Bais, and Horst Bischof. 2013. Semi-supervised image classifica- tion with huberized Laplacian support vector ma- In Emerging Technologies (ICET), 2013 chines. IEEE 9th International Conference on. IEEE, pages 1–6. W. Liu, P. P. Pokharel, and J. C. Principe. 2007. Correntropy: Properties and applications in non- IEEE Transac- Gaussian signal processing. tions on Signal Processing 55(11):5286–5298. https://doi.org/10.1109/TSP.2007.896065. Weifeng Liu, P. P. Pokharel, and J. C. Principe. 2006. Correntropy: A localized similarity measure. In The 2006 IEEE International Joint Conference on Neural Network Proceedings. pages 4919–4924. https://doi.org/10.1109/IJCNN.2006.247192. Shie Mannor and Ron Meir. 2001. Weak learners and improved rates of convergence in boosting. In Ad- vances in Neural Information Processing Systems. pages 280–286. Hamed Masnadi-Shirazi, Vijay Mahadevan, and Nuno Vasconcelos. 2010. On the design of robust clas- In Computer Vision sifiers for computer vision. and Pattern Recognition (CVPR), 2010 IEEE Con- ference on. IEEE, pages 779–786. Hamed Masnadi-Shirazi and Nuno Vasconcelos. 2009. On the design of loss functions for classification: theory, robustness to outliers, and SavageBoost. In Advances in neural information processing systems. pages 1049–1056. Jorge Nocedal and Stephen J Wright. 2006. Penalty and augmented Lagrangian methods. Numerical Optimization pages 497–528. Amichai Painsky and Saharon Rosset. 2016. Isotonic modeling with non-differentiable loss functions with
1712.01818
1
1712
2017-12-05T18:52:18
Minimum Word Error Rate Training for Attention-based Sequence-to-Sequence Models
[ "cs.CL", "eess.AS", "stat.ML" ]
Sequence-to-sequence models, such as attention-based models in automatic speech recognition (ASR), are typically trained to optimize the cross-entropy criterion which corresponds to improving the log-likelihood of the data. However, system performance is usually measured in terms of word error rate (WER), not log-likelihood. Traditional ASR systems benefit from discriminative sequence training which optimizes criteria such as the state-level minimum Bayes risk (sMBR) which are more closely related to WER. In the present work, we explore techniques to train attention-based models to directly minimize expected word error rate. We consider two loss functions which approximate the expected number of word errors: either by sampling from the model, or by using N-best lists of decoded hypotheses, which we find to be more effective than the sampling-based method. In experimental evaluations, we find that the proposed training procedure improves performance by up to 8.2% relative to the baseline system. This allows us to train grapheme-based, uni-directional attention-based models which match the performance of a traditional, state-of-the-art, discriminative sequence-trained system on a mobile voice-search task.
cs.CL
cs
MINIMUM WORD ERROR RATE TRAINING FOR ATTENTION-BASED SEQUENCE-TO-SEQUENCE MODELS Rohit Prabhavalkar Zhifeng Chen Tara N. Sainath Yonghui Wu Patrick Nguyen Chung-Cheng Chiu Anjuli Kannan 7 1 0 2 c e D 5 ] L C . s c [ 1 v 8 1 8 1 0 . 2 1 7 1 : v i X r a {prabhavalkar,tsainath,yonghui,drpng,zhifengc,chungchengc,anjuli}@google.com Google Inc. ABSTRACT Sequence-to-sequence models, such as attention-based models in au- tomatic speech recognition (ASR), are typically trained to optimize the cross-entropy criterion which corresponds to improving the log- likelihood of the data. However, system performance is usually mea- sured in terms of word error rate (WER), not log-likelihood. Tradi- tional ASR systems benefit from discriminative sequence training which optimizes criteria such as the state-level minimum Bayes risk (sMBR) which are more closely related to WER. In the present work, we explore techniques to train attention- based models to directly minimize expected word error rate. We consider two loss functions which approximate the expected num- ber of word errors: either by sampling from the model, or by using N-best lists of decoded hypotheses, which we find to be more effec- tive than the sampling-based method. In experimental evaluations, we find that the proposed training procedure improves performance by up to 8.2% relative to the baseline system. This allows us to train grapheme-based, uni-directional attention-based models which match the performance of a traditional, state-of-the-art, discrimina- tive sequence-trained system on a mobile voice-search task. Index Terms- sequence-to-sequence models, attention mod- els, minimum word error rate training, minimum Bayes risk 1. INTRODUCTION There has been growing interest in the automatic speech recogni- tion (ASR) community in building end-to-end trained, sequence-to- sequence models which directly output a word sequence given in- put speech frames, without requiring explicit alignments between the speech frames and labels. Examples of such approaches include the recurrent neural network transducer (RNN-T) [1, 2], the recurrent neural aligner (RNA) [3], attention-based models [4, 5], and connec- tionist temporal classification (CTC) [6] with word-based targets [7]. Such approaches are motivated by their simplicity: since these mod- els directly output graphemes, word-pieces [8], or words, they do not require expertly curated pronunuciation dictionaries; since they can be trained to directly output normalized text, they do not require sep- arate modules to map recognized text from the spoken to the written domain. In our recent work, we have shown that such approaches are comparable to traditional state-of-the-art speech recognition sys- tems [9, 10]. Most sequence-to-sequence models (e.g., [4]) are typically trained to optimize the cross-entropy (CE) loss function, which The authors would like to thank Matt Shannon, Erik McDermott, Michiel Bacchiani and Has¸im Sak for helpful comments and suggestions on this work. corresponds to improving log-likelihood of the training data. Dur- ing inference, however, model performance is commonly measured using task-specific criteria, not log-likelihood: e.g., word error rate (WER) for ASR, or BLEU score [11] for machine translation. Traditional ASR systems account for this mismatch through dis- criminative sequence training of neural network acoustic models (AMs) [12, 13] which fine-tunes a cross-entropy trained AM with criteria such as state-level minimum Bayes risk (sMBR) which are more closely related to word error rate. In the context of sequence-to-sequence models, there have been a few previous proposals to optimize task-specific losses. In their seminal work, Graves and Jaitly [14] minimize expected WER of an RNN-T model by approximating the expectation with samples drawn from the model. This approach is similar to the edit-based minimum Bayes risk (EMBR) approach proposed by Shannon, which was used for minimum expected WER training of conven- tional ASR systems [15] and the recurrent neural aligner [3]. An alternative approach is based on reinforcement learning, where the label output at each step can be viewed as an action, so that the task of learning consists of learning the optimal policy (i.e., optimal output label sequence) which results in the greatest expected reward (lowest expected task-specific loss). Ranzato et al. [16] apply a variant of the REINFORCE algorithm [17] to optimize task-specific losses for summarization and machine translation. More recently Bahdanau et al. [18] use an actor-critic approach, which was shown to improve BLEU scores for machine translation. In the present work, we consider techniques to optimize attention- based sequence-to-sequence models in order to directly minimize WER. Our proposed approach is similar to [14, 15] in that we ap- proximate the expected WER using hypotheses from the model. We consider both the use of sampling-based approaches [14, 15] as well as approximating the loss over N-best lists of recognition hypotheses as is commonly done in ASR (e.g., [19]). However, unlike Sak et al. [3] we find that the process is more effective if we approximate the expectation using N-best hypotheses decoded from the model using beam-search [20] rather than sampling from the model (See section 5.1). We apply the proposed techniques on an English mo- bile voice-search task, to optimize grapheme-based models, with uni- and bi-directional encoders, where we find that we can improve WER by up to 8.2% relative to a CE-trained baseline model. Min- imum word error rate training allows us to train grapheme-based sequence-to-sequence models which are comparable in performance to a strong state-of-the-art context-dependent (CD) phoneme-based speech recognition system [21]. The organization of the rest of the paper is as follows. We de- scribe the particular attention-based model used in this work in Sec- tion 2 and describe the proposed approach for minimum WER train- 2.1. Multi-headed Attention The attention mechanism used in the present work differs from our previous work [10] in two important ways: firstly, we replace dot- product attention [4] with additive attention [22] which we find to be more stable; secondly, we use multiple, independent attention heads [23] allowing the model to simultaneously attend to multi- ple locations in the input utterance, which we find to significantly improve model performance. More specifically, we denote the re- current hidden state of the decoder network after predicting u − 1 labels as hatt u−1. The model employs M independent attention heads, t,u ∈ R, for 1 ≤ i ≤ M, each of which computes attention values, βi 1 ≤ t ≤ T : t,u = ui tanh(W ihatt βi u−1 + V ihenc t ) (1) The individual attention values are then transformed into soft atten- tion weights through a softmax operation, and used to compute a summary of the encoder features, ci u: αi t,u = (cid:80)T exp(βi t,u) s=1 exp(βi s,u) T(cid:88) t=1 ci u = t,uZ ihenc αi t (2) The matrices V i, W i, and Z i and the vector, ui, are parame- ters of the model. Finally, the overall context vector is com- puted by concatenating together the individual summaries: cu = [c1 u;··· ; cM u ]. u; c2 2.2. Training and Inference Most attention-based models are trained by optimizing the cross- entropy (CE) loss function, which maximizes the the log-likelihood of the training data: LCE = − log P (y uy ∗ u−1,··· , y ∗ 0 = (cid:104)sos(cid:105), x) ∗ (3) (cid:88) L+1(cid:88) (x,y∗) u=1 where, we always input the ground-truth label sequence during train- ing (i.e., we do not use scheduled sampling [24]). Inference in the model is performed using a beam-search algorithm [20], where the models predictions are fed back until the model outputs the (cid:104)eos(cid:105) symbol which indicates that inference is complete. 3. MINIMUM WORD ERROR RATE TRAINING OF ATTENTION-BASED MODELS In this section we described how an attention-based model can be trained to minimize the expected number of word errors, and thus the word error rate. We denote by W(y, y∗) the number of word errors in a hypothesis, y, relative to the ground-truth sequence, y∗. In order to minimize word error rates on test data, we consider as our loss function, the expected number of word errors over the training set: Lwerr(x, y ∗ ) = E[W(y, y ∗ )] = P (yx)W(y, y ∗ ) (4) (cid:88) y Computing the loss in (4) exactly is intractable since it involves a summation over all possible label sequences. We therefore consider two possible approximations which ensure tractability: approximat- ing the expectation in (4) with samples [3, 15], or restricting the summation to an N-best list as is commonly done during sequence- training for ASR [19]. Fig. 1: The attention-based model defines a probability distribution over the next label, conditioned on the history of previous predic- tions: P (yuyu−1,··· , y0, x). ing of attention models in Section 3. We describe our experimental setup and our results in Sections 4 and 5, respectively, before con- cluding in Section 6. 2. ATTENTION-BASED MODELS 0 , y∗ We denote the set of speech utterances, suitably parameterized into feature vectors as: x = (x1, x2,··· , xT ), where xi ∈ Rd, and the corresponding ground-truth label sequence as: y∗ = i ∈ G (graphemes, in this work). (y∗ We assume that the set of labels, G, contains two special labels, (cid:104)sos(cid:105) and (cid:104)eos(cid:105), which denote the start and the end of the sen- tence, respectively, such that y∗ L+1), where y∗ 0 = (cid:104)sos(cid:105) and y∗ L+1 = (cid:104)eos(cid:105). 2 ,··· , y∗ 1 , y∗ u−1, y∗ u−2,··· , y∗ 1 ,··· , henc An attention-based model [4] consists of three components: an encoder network which maps input acoustic vectors into a higher- level representation, an attention model which summarizes the output of the encoder based on the current state of the decoder, and a decoder network which models an output distribution over the next target conditioned on the sequence of previous predic- tions: P (yuy∗ 0 , x). The model is depicted in Figure 1. The encoder network consists of a deep recurrent neural network which receives as input the sequence of acoustic fea- ture vectors, x, and computes a sequence of encoded features, henc = (henc T ), and is analogous to an acoustic model in a traditional ASR system. The decoder network - which is analo- gous to the pronunication and language modeling components in a traditional ASR system - consists of a deep recurrent neural net- work which is augmented with an attention mechanism [22]. The decoder network predicts a single label at each step, conditioned on the history of previous predictions. At each prediction step, the attention mechanism summarizes the encoded features based on the decoder state to compute a context vector, cu, as described in Section 2.1. The attention model thus corresponds to the component of a traditional ASR system which learns the alignments between the input acoustics and the output labels. This context vector is input to the decoder along with the previous label, y∗ u−1. The final decoder layer produces a set of logits which are input to a softmax layer which computes a distribution over the set of output labels: P (yuy∗ 0 = (cid:104)sos(cid:105)). u−1,··· , y∗ 3.1. Approximation By Sampling We can approximate the expectation in (4) using an empirical aver- age over samples drawn from the model [15]: directly to optimize LSample or LN-best with random initialization is hard, since the model is not directly provided with the ground-truth label sequence. Therefore, we initialize the model with the parame- ters obtained after CE training. Lwerr(x, y ∗ ) ≈ LSample werr (x, y ∗ ) = 1 N W(yi, y ∗ ) (5) 4. EXPERIMENTAL SETUP (cid:88) yi∼P (yx) where, yi are N samples drawn from the model distribution. Criti- cally, the gradient of the expectation in (5) can be itself be expressed as an expectation, which allows it to be approximated using sam- ples [15]: ∇LSample P (yx) [W(y, y∗) − E[W(y, y∗)]] ∇ log P (yx) (x, y∗) = (cid:88) werr (cid:88) y ≈ 1 N [W(yi, y∗) −(cid:99)W]∇ log P (yx) (6) yi∼P (yx) where, we exploit the fact that E[∇ log P (yx)] = 0, and (cid:99)W = (cid:80)N samples. Subtracting (cid:99)W, serves to reduce the variance of the gradi- i=1 W(yi, y∗) is the average number of word errors over the 1 N ent estimates, and is important to stabilize training [15]. 3.2. Approximation Using N-best Lists One of the potential disadvantages of the sampling-based approach is that a large number of samples might be required in order to ap- proximate the expectation well. However, since the probability mass is likely to be concentrated on the top-N hypotheses, it is reasonable to approximate the loss function by restricting the sum over just the top N hypotheses. We note that this is typically done in traditional discriminative sequence training approaches as well, where the sum- mation is restricted to paths in a lattice [12, 13]. Denote by Beam(x, N ) = {y1,··· , yN}, the set of N-best hy- potheses computed using beam-search decoding [20] for the input utterance x, with a beam-size, N. We can then approximate the loss function in (4) by assuming that the probability mass is concentrated on just the N-best hypotheses, as follows: (cid:88) (cid:98)P (yix) (cid:104)W(yi, y ) −(cid:99)W ∗ (cid:105) LN-best werr (x, y ∗ ) = Where, (cid:98)P (yix) = tion re-normalized over just the N-best hypotheses, and (cid:99)W is the yi∈Beam(x,N ) P (yix) , represents the distribu- yi∈Beam(x,N ) (cid:80) P (yix) average number of word errors over the N-best hypohtheses, which is applied as a form of variance reduction, since it does not affect the gradient. 3.3. Initialization and Training Based on the two schemes for approximating the expected word er- ror rate, we can define two possible loss functions: (cid:88) (cid:88) (x,y∗) (x,y∗) LSample = LN-best = LSample werr (x, y ∗ ) + λLCE LN-best werr (x, y ∗ ) + λLCE (7) (8) In both cases, we interpolate with the CE loss function using a hy- perparameter λ which we find is important to stabilize training (See Section 5). We note that interpolation with the CE loss function is similar to the f-smoothing approach [25] in ASR. Training the model The proposed approach is evaluated by conducting experiments on a mobile voice-search task. Models are trained on the same datasets as in our previous works [10, 26]. The training set consists of ∼15M hand-transcribed anonymized utterances extracted from Google voice-search traffic (∼12,500 hours). In order to improve robustness to noise, multi-style training data (MTR) are constructed by artificially distorting training utterances with reverberation and noise drawn from environmental recordings of daily events and from YouTube using a room simulator, where the overall SNR ranges from 0-30dB with an average SNR of 12dB [27]. Model hyperparameters are tuned on a development set of ∼12.9K utterances (∼63K words) and results are reported on a set of ∼14.8K utterances (∼71.6K words). The acoustic input is parameterized into 80-dimensional log- Mel filterbank features extracted over the 16kHz frequency range, computed with a 25ms window and a 10ms frame shift. Follow- ing [28], three consecutive frames are stacked together, and every third stacked frame is presented as input to the encoder. The same frontend is used for all models reported in this work. Two attention-based models are trained in this work, differ- ing only in the structure of the encoder network: the first model (Uni-LAS) uses 5 layers of 1,400 uni-directional LSTM cells [29], whereas the second model (Bidi-LAS) uses 5 layers of 1,024 bi- directional LSTM cells [30] (i.e., 1,024 cells in the forward and backward directions, for each layer). The decoder network of both models consists of two layers of 1,024 LSTM cells in each layer. Both models use multi-headed attention as described in Section 2.1 with M = 4 attention heads. Models are trained to output a proba- bility distribution over grapheme symbols: 26 lower case alphabets a-z, the numerals 0-9, punctuation symbols ,'! etc., and the special symbols (cid:104)sos(cid:105), (cid:104)eos(cid:105). All models are trained using the Tensorflow toolkit [31], with asynchronous stochastic gradient de- scent (ASGD) [32] using the Adam optimizer [33]. 5. RESULTS We investigate the impact of various hyperparameters, and the choice of approximation scheme by conducting detailed experiments on the uni-directional LAS model. Results on the bi-directional LAS model, along with a comparison to a traditional CD-phone based state-of-the-art system are deferred until Section 5.2. 5.1. Comparison of loss functions: LSample and LN-best Our first set of experiments evaluate the effectiveness of approxi- mating the expected number of word errors using samples (i.e., op- timizing LSample) versus the approximation using N-best lists (i.e., optimizing LN-best), as described in Section 3.3. Our observations are illustrated in Figure 2, where we plot various metrics on a held- out portion of the training data. As can be seen in Figure 2a, optimizing the sample-based ap- proximation, LSample, reduces the expected number of word errors by ∼50% after training, with performance appearing to improve as the number of samples, N, used in the approximation increases. Un- like [3], however, as can be seen in Figure 2b, the WER for the (a) Expected number of word errors on held- out set computed using (4) when optimizing LSample as number of samples, N, varies. Fig. 2: Metrics computed on held-out portion of the training set when optimizing loss functions LSample and LN-best, described in Section 3.3. (b) Word error rates on held-out set when optimizing LSample as a function of the num- ber of samples, N. (c) Word error rates on held-out set when optimizing LN-best as a function of the depth of the N-best list, N. System Bi-LAS +MWER (LN-best) Uni-LAS +MWER (LN-best) CD-phone (CE + sMBR) WER(%) Rescored WER(%) 7.2 6.9 8.1 7.5 7.5 6.6 6.2 7.3 6.7 6.7 Table 1: WERs on the test set after minimum WER training for uni- and bi-directional LAS models. The proposed procedure improves WER by up to 8.2% relative to the CE-trained baseline system. 768 uni-directional cells. The model is first trained to optimize the CE loss function, followed by discriminative sequence training to optimize the state-level minimum Bayes risk (sMBR) criterion [12]. The model is decoded using a pruned, first-pass, 5-gram language model, which uses a vocabulary of millions of words, as well as an expert-curated pronunciation dictionary. As before, we report results both before and after second-pass lattice rescoring. As can be seen in Table 1, when decoded without second- pass rescoring (i.e., end-to-end training), MWER training improves performance of the uni- and bi-directional LAS systems by 7.4% and 4.2% respectively. The gains after MWER training are even larger after second-pass rescoring, improving the baseline uni- and bi-directional LAS systems by 8.2% and 6.1%, respectively. Finally, we note that after MWER training the grapheme-based uni-directional LAS system matches the performance of a state-of- the-art traditional CD-phoneme-based ASR system. 6. CONCLUSIONS We described a technique for training sequence-to-sequence sys- tems to optmize the expected test error rate, which was applied to attention-based systems. Unlike [3], we find that sampling-based approximations are not as effective as approximations based on us- ing N-best decoded hypotheses. Overall, we find that the proposed approach allows us to improve WER by up to 8.2% relative. We find that the proposed techniques allow us to train grapheme-based sequence-to-sequence models which match performance with a tra- ditional CD-phone-based state-of-the-art system on a voice-search task, which when viewed jointly with our previous works [10, 9] adds further evidence to the effectiveness of sequence-to-sequence modeling approaches. Fig. 3: Word error rates on held-out portion of training set when optimizing LN-best, as a function of the CE-loss interpolation weight λ, when using N = 4 hypotheses in the N-best list. top-hypothesis computed using beam search does not improve, but instead degrades as a result of training. We hypothesize that this is a result of the mis-match between the beam-search decoding proce- dure, which focuses on the head of the distribution during each next- label prediction, and the sampling procedure which also considers lower-probability paths [16]. As illustrated in Figure 2c, optimizing LN-best (i.e., using the N- best list-based approximation) significantly improves WER by about 10.4% on the held-out portion of the training set. Further, perfor- mance seems to be similar even when just the top four hypotheses are considered during the optimization. As a final note, we find that it is important to also interpolate with CE loss function during optimization (i.e., setting λ > 0). This is illustrated for the case where we optimize LN-best using N = 4 hypotheses in the N-best list in Figure 3. 5.2. Improvements from Minimum WER Training for LAS Models We present results after expected minimum WER training (MWER) of the uni- and bi-directional LAS models described in Section 4 in Table 1, where we set N = 4 and λ = 0.01. We report results after directly decoding the models to produce grapheme sequences using a beam-search decoding with 8 beams (column 2) as well as after rescoring the 8-best list using a very large 5-gram language model (column 3). For comparison, we also report results using a traditional state-of-the-art low frame rate (LFR) [34] CD-phone based system, which uses an acoustic model composed of four lay- ers of 1,024 uni-directional LSTM cells, followed by one layer of 7. REFERENCES [1] A. Graves, "Sequence transduction with recurrent neural net- works," in In Proc. of ICML Representation Learning Work- shop, 2012. [2] A. Graves, A-. R. Mohamed, and G. Hinton, "Speech recogni- tion with deep neural networks," in Proc. of ICASSP, 2013. [3] H. Sak, M. Shannon, K. Rao, and F. Beaufays, "Recurrent neural aligner: An encoder-decoder neural network model for sequence to sequence mapping," in Proc. of Interspeech, 2017. [4] W. Chan, N. Jaitly, Q. V. Le, and O. Vinyals, "Listen, attend and spell: A neural network for large vocabulary conversa- tional speech recognition," in Proc. of ICASSP, 2016. [5] D. Bahdanau, J. Chorowski, D. Serdyuk, P. Brakel, and Y. Ben- "End-to-end attention-based large vocabulary speech gio, recognition," in Proc. of ICASSP, 2016. [6] A. Graves, S. Fern´andez, F. Gomez, and J. Schmidhuber, "Connectionist temporal classificatio: Labelling unsegmented in Proc. of sequence data with recurrent neural networks," ICML, 2006. [7] H. Soltau, H. Liao, and H. Sak, "Neural speech recognizer: Acoustic-to-word lstm model for large vocabulary speech recognition," in Proc. of Interspeech, 2017. [8] M. Schuster and K. Nakajima, "Japanese and korean voice search," in Proc. of ICASSP, 2012. [9] K. Rao, H. Sak, and R. Prabhavalkar, "Exploring architec- tures, data and units for streaming end-to-end speech recogni- tion with rnn-transducer," in Proc. of ASRU, 2017. [10] 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. of Interspeech, 2017. [11] K. Papineni, S. Roukos, T. Ward, and W-. J. Zhu, "BLEU: A method for automatic evaluation of machine translation," in Proc. of ACL, 2002. [12] B. Kingsbury, "Lattice-based optimization of sequence clas- sification criteria for neural-network acoustic modeling," in Proc. of ICASSP, 2009. [13] K. Vesel`y, A. Ghoshal, L. Burget, and D. Povey, "Sequence- discriminative training of deep neural networks.," in Proc. of Interspeech, 2013. [14] A. Graves and N. Jaitly, "Towards end-to-end speech recogni- tion with recurrent neural networks," in Proc. of ICML, 2014. [15] M. Shannon, "Optimizing expected word error rate via sam- pling for speech recognition," in Proc. of Interspeech, 2017. [16] M. Ranzato, S. Chopra, M. Auli, and W. Zaremba, "Sequence in Proc. of level training with recurrent neural networks," ICLR, 2016. [17] R. J. Williams, "Simple statistical gradient-following algo- rithms for connectionist reinforcement learning," Machine learning, vol. 8, no. 3-4, 1992. [18] D. Bahadanau, P. Brakel, R. Lowe, J. Pineau, K. Xu, A. Goyal, A. Courville, and Y. Bengio, "An actor-critic algorithm for structured prediction," in Proc. of ICLR, 2017. [19] D. Povey, Discriminative Training for Large Vocabulary Speech Recognition, Ph.D. thesis, Cambridge University En- gineering Department, 2003. [20] I. Sutskever, O. Vinyals, and Q. V. Le, "Sequence to sequence learning with neural networks," in Proc. Of NIPS, 2014. [21] A. Senior, H. Sak, F. de Chaumont Quitry, T. N. Sainath, and K. Rao, "Acoustic modelling with cd-ctc-smbr lstm rnns," in Proc. of ASRU, 2015. [22] D. Bahdanau, K. Cho, and Y. Bengio, "Neural machine trans- lation by jointly learning to align and translate," in Proc. of ICLR, 2015. [23] A. Vaswani, N. Shazeer, N. Parmar, L. Jones, J. Uszkoreit, A. N. Gomez, Ł. Kaiser, and I. Polosukhin, "Attention is all you need," in Proc. of NIPS, 2017. [24] S. Bengio, O. Vinyals, N. Jaitly, and N. Shazeer, "Scheduled sampling for sequence prediction with recurrent neural net- works," in Proc. of NIPS, 2015. [25] H. Su, G. Li, D. Yu, and F. Seide, "Error back propagation for sequence training of context-dependent deep networks for con- versational speech transcription," in Proc. of ICASSP, 2013. [26] R. Prabhavalkar, T. N. Sainath, B. Li, K. Rao, and N. Jaitly, "An analysis of "attention" in sequence-to-sequence models," in Proc. of Interspeech, 2017. [27] C. Kim, A. Misra, K. Chin, T. Hughes, A. Narayanan, T. N. Sainath, and M. Bacchiani, "Generation of large-scale simu- lated utterances in virtual rooms to train deep-neural networks for far-field speech recognition in google home," in Proc. of Interspeech, 2017. [28] H. Sak, A. Senior, K. Rao, and F. Beaufays, "Fast and accurate recurrent neural network acoustic models for speech recogni- tion," in Proc. of Interspeech, 2015. [29] S. Hochreiter and J. Schmidhuber, "Long short-term memory," Neural Computation, vol. 9, no. 8, pp. 1735–1780, Nov 1997. [30] M. Schuster and K. K. Paliwal, "Bidirectional recurrent neural networks," IEEE Transactions on Signal Processing, vol. 45, no. 11, pp. 2673–2681, Nov 1997. [31] M. Abadi, A. Agarwal, P. Barham, E. Brevdo, Z. Chen, C. Citro, G. Corrado, A. Davis, J. Dean, M. Devin, S. Ghe- mawat, I. Goodfellow, A. Harp, G. Irving, M. Isard, Y. Jia, R. Jozefowicz, L. Kaiser, M. Kudlur, J. Levenberg, D. Man´e, R. Monga, S. Moore, D. Murray, C. Olah, M. Schuster, J. Shlens, B. Steiner, I. Sutskever, K. Talwar, P. Tucker, V. Vanhoucke, V. Vasudevan, F. Vi´egas, O. Vinyals, P. War- den, M. Wattenberg, M. Wicke, Y. Yu, and X. Zheng, "Ten- sorflow: Large-scale machine learning on heterogeneous dis- tributed systems," 2015. [32] B. Recht, C. Re, S. Wright, and F. Niu, "Hogwild: A lock-free approach to parallelizing stochastic gradient descent," in Proc. of NIPS, 2011. [33] D. P. Kingma and J. Ba, "Adam: A method for stochastic opti- mization," in Proc. of ICLR, 2015. [34] G. Pundak and T. N. Sainath, "Lower frame rate neural net- work acoustic models," in Proc. of Interspeech, 2016.
1808.08933
2
1808
2018-09-06T17:58:00
Unsupervised Multilingual Word Embeddings
[ "cs.CL" ]
Multilingual Word Embeddings (MWEs) represent words from multiple languages in a single distributional vector space. Unsupervised MWE (UMWE) methods acquire multilingual embeddings without cross-lingual supervision, which is a significant advantage over traditional supervised approaches and opens many new possibilities for low-resource languages. Prior art for learning UMWEs, however, merely relies on a number of independently trained Unsupervised Bilingual Word Embeddings (UBWEs) to obtain multilingual embeddings. These methods fail to leverage the interdependencies that exist among many languages. To address this shortcoming, we propose a fully unsupervised framework for learning MWEs that directly exploits the relations between all language pairs. Our model substantially outperforms previous approaches in the experiments on multilingual word translation and cross-lingual word similarity. In addition, our model even beats supervised approaches trained with cross-lingual resources.
cs.CL
cs
Unsupervised Multilingual Word Embeddings Xilun Chen Claire Cardie Department of Computer Science Department of Computer Science Cornell Unversity Ithaca, NY, 14853, USA Cornell Unversity Ithaca, NY, 14853, USA 8 1 0 2 p e S 6 ] L C . s c [ 2 v 3 3 9 8 0 . 8 0 8 1 : v i X r a [email protected] [email protected] Abstract Multilingual Word Embeddings (MWEs) rep- resent words from multiple languages in a sin- gle distributional vector space. Unsupervised MWE (UMWE) methods acquire multilin- gual embeddings without cross-lingual super- vision, which is a significant advantage over traditional supervised approaches and opens many new possibilities for low-resource lan- guages. Prior art for learning UMWEs, how- ever, merely relies on a number of indepen- dently trained Unsupervised Bilingual Word Embeddings (UBWEs) to obtain multilingual embeddings. These methods fail to leverage the interdependencies that exist among many languages. To address this shortcoming, we propose a fully unsupervised framework for learning MWEs1 that directly exploits the re- lations between all language pairs. Our model substantially outperforms previous approaches in the experiments on multilingual word trans- lation and cross-lingual word similarity. In ad- dition, our model even beats supervised ap- proaches trained with cross-lingual resources. Introduction distributional word 1 Continuous representa- tions (Turian et al., 2010) have become a common technique across a wide variety of NLP tasks. Recent research, moreover, proposes cross-lingual word representations (Klementiev et al., 2012; Mikolov et al., 2013a) that create a shared em- bedding space for words across two (Bilingual Word Embeddings, BWE) or more languages (Multilingual Word Embeddings, MWE). Words from different languages with similar meanings will be close to one another in this cross-lingual embedding space. These embeddings have been found beneficial for a number of cross-lingual and even monolingual NLP tasks (Faruqui and Dyer, 2014; Ammar et al., 2016). 1Code: https://github.com/ccsasuke/umwe The most common form of cross-lingual word representations is the BWE, which connects the lexical semantics of two languages. Traditionally for training BWEs, cross-lingual supervision is re- quired, either in the form of parallel corpora (Kle- mentiev et al., 2012; Zou et al., 2013), or in the form of bilingual lexica (Mikolov et al., 2013a; Xing et al., 2015). This makes learning BWEs for low-resource language pairs much more dif- ficult. Fortunately, there are attempts to reduce the dependence on bilingual supervision by requir- ing a very small parallel lexicon such as identi- cal character strings (Smith et al., 2017), or nu- merals (Artetxe et al., 2017). Furthermore, re- cent work proposes approaches to obtain unsuper- vised BWEs without relying on any bilingual re- sources (Zhang et al., 2017; Lample et al., 2018b). In contrast to BWEs that only focus on a pair of languages, MWEs instead strive to leverage the interdependencies among multiple languages to learn a multilingual embedding space. MWEs are desirable when dealing with multiple languages simultaneously and have also been shown to im- prove the performance on some bilingual tasks thanks to its ability to acquire knowledge from other languages (Ammar et al., 2016; Duong et al., 2017). Similar to training BWEs, cross-lingual su- pervision is typically needed for training MWEs, and the prior art for obtaining fully unsupervised MWEs simply maps all the languages indepen- dently to the embedding space of a chosen tar- get language2 (usually English) (Lample et al., 2018b). There are downsides, however, when us- ing a single fixed target language with no interac- tion between any of the two source languages. For instance, French and Italian are very similar, and the fact that each of them is individually converted to a less similar language, English for example, in 2Henceforth, we refer to this method as BWE-Pivot as the target language serves as a pivot to connect other languages. order to produce a shared embedding space will inevitably degrade the quality of the MWEs. For certain multilingual tasks such as translat- ing between any pair of N given languages, an- other option for obtaining UMWEs exists. One can directly train UBWEs for each of such lan- guage pairs (referred to as BWE-Direct). This is seldom used in practice, since it requires training O(N 2) BWE models as opposed to only O(N ) in BWE-Pivot, and is too expensive for most use cases. Moreover, this method still does not fully exploit the language interdependence. For exam- ple, when learning embeddings between French and Italian, BWE-Direct only utilizes information from the pair itself, but other Romance languages such as Spanish may also provide valuable infor- mation that could improve performance. In this work, we propose a novel unsupervised algorithm to train MWEs using only monolingual corpora (or equivalently, monolingual word em- beddings). Our method exploits the interdepen- dencies between any two languages and maps all monolingual embeddings into a shared multilin- gual embedding space via a two-stage algorithm consisting of (i) Multilingual Adversarial Training (MAT) and (ii) Multilingual Pseudo-Supervised Refinement (MPSR). As shown by experimental results on multilingual word translation and cross- lingual word similarity, our model is as efficient as BWE-Pivot yet outperforms both BWE-Pivot and BWE-Direct despite the latter being much more expensive. In addition, our model achieves a higher overall performance than state-of-the-art supervised methods in these experiments. 2 Related Work There is a plethora of literature on learning cross- lingual word representations, focusing either on a pair of languages, or multiple languages at the same time (Klementiev et al., 2012; Zou et al., 2013; Mikolov et al., 2013a; Gouws et al., 2015; Coulmance et al., 2015; Ammar et al., 2016; Duong et al., 2017, inter alia). One shortcom- ing of these methods is the dependence on cross- lingual supervision such as parallel corpora or bilingual lexica. Abundant research efforts have been made to alleviate such dependence (Vuli´c and Moens, 2015; Artetxe et al., 2017; Smith et al., 2017), but consider only the case of a single pair of languages (BWEs). Furthermore, fully unsu- pervised methods exist for learning BWEs (Zhang et al., 2017; Lample et al., 2018b; Artetxe et al., 2018a). For unsupervised MWEs, however, pre- vious methods merely rely on a number of inde- pendent BWEs to separately map each language into the embedding space of a chosen target lan- guage (Smith et al., 2017; Lample et al., 2018b). Adversarial Neural Networks have been suc- cessfully applied to various cross-lingual NLP tasks where annotated data is not available, such as cross-lingual text classification (Chen et al., 2016), unsupervised BWE induction (Zhang et al., 2017; Lample et al., 2018b) and unsupervised machine translation (Lample et al., 2018a; Artetxe et al., 2018b). These works, however, only consider the case of two languages, and our MAT method (§3.1) is a generalization to multiple languages. Mikolov et al. (2013a) first propose to learn cross-lingual word representations by learning a linear mapping between the monolingual embed- ding spaces of a pair of languages. It has then been observed that enforcing the linear mapping to be orthogonal could significantly improve per- formance (Xing et al., 2015; Artetxe et al., 2016; Smith et al., 2017). These methods solve a linear equation called the orthogonal Procrustes prob- lem for the optimal orthogonal linear mapping be- tween two languages, given a set of word pairs as supervision. Artetxe et al. (2017) find that when using weak supervision (e.g. digits in both lan- guages), applying this Procrustes process itera- tively achieves higher performance. Lample et al. (2018b) adopt the iterative Procrustes method with pseudo-supervision in a fully unsupervised setting and also obtain good results. In the MWE task, however, the multilingual mappings no longer have a closed-form solution, and we hence pro- pose the MPSR algorithm (§3.2) for learning mul- tilingual embeddings using gradient-based opti- mization methods. 3 Model In this work, our goal is to learn a single multi- lingual embedding space for N languages, with- out relying on any cross-lingual supervision. We assume that we have access to monolingual em- beddings for each of the N languages, which can be obtained using unlabeled monolingual cor- pora (Mikolov et al., 2013b; Bojanowski et al., 2017). We now present our unsupervised MWE (UMWE) model that jointly maps the monolin- gual embeddings of all N languages into a single space by explicitly leveraging the interdependen- cies between arbitrary language pairs, but is com- putationally as efficient as learning O(N ) BWEs (instead of O(N 2)). −1 l Denote the set of languages as L with L = N. Suppose for each language l ∈ L with vocab- ulary Vl, we have a set of d-dimensional mono- lingual word embeddings El of size Vl × d. Let Sl denote the monolingual embedding space for l, namely the distribution of the monolingual em- beddings of l. If a set of embeddings E are in an embedding space S, we write E (cid:96) S (e.g. ∀l : El (cid:96) Sl). Our models learns a set of encoders Ml, one for each language l, and the correspond- ing decoders M . The encoders map all El to a single target space T : Ml(El) (cid:96) T . On the other −1 hand, a decoder M l maps an embedding in T back to Sl. Previous research (Mikolov et al., 2013a) shows that there is a strong linear correlation between the vector spaces of two languages, and that learn- ing a complex non-linear neural mapping does not yield better results. Xing et al. (2015) further show that enforcing the linear mappings to be orthogo- nal matrices achieves higher performance. There- fore, we let our encoders Ml be orthogonal linear matrices, and the corresponding decoders can be −1 obtained by simply taking the transpose: M l = (cid:62) l . Thus, applying the encoder or decoder to an M embedding vector is accomplished by multiplying the vector with the encoder/decoder matrix. Another benefit of using linear encoders and de- coders (also referred to as mappings) is that we can learn N − 1 mappings instead of N by choosing the target space T to be the embedding space of a specific language (denoted as the target language) without losing any expressiveness of the model. Given a MWE with an arbitrary T , we can con- struct an equivalent one with only N −1 mappings by multiplying the encoders of each language Ml (cid:62) to the decoder of the chosen target language M t : (cid:62) (cid:48) t Mt = I t = M M (cid:48) (cid:62) lEl = (M t Ml)El (cid:96) St M where I is the identity matrix. The new MWE is isomorphic to the original one. We now present the two major components of our approach, Multilingual Adversarial Training (§3.1) and Multilingual Pseudo-Supervised Re- finement (§3.2). Figure 1: Multilingual Adversarial Training (Algo- rithm 1). langi and langj are two randomly selected languages at each training step. JDj and JMi are the objectives of Dj and Mi, respectively (Eqn. 1 and 2). 3.1 Multilingual Adversarial Training In this section, we introduce an adversarial train- ing approach for learning multilingual embed- dings without cross-lingual supervision. Adver- sarial Training is a powerful technique for min- imizing the divergence between complex distri- to directly butions that are otherwise difficult model (Goodfellow et al., 2014). In the cross- lingual setting, it has been successfully ap- plied to unsupervised cross-lingual text classifica- tion (Chen et al., 2016) and unsupervised bilin- gual word embedding learning (Zhang et al., 2017; Lample et al., 2018b). However, these methods only consider one pair of languages at a time, and do not fully exploit the cross-lingual relations in the multilingual setting. Figure 1 shows our Multilingual Adversarial Training (MAT) model and the training procedure is described in Algorithm 1. Note that as ex- plained in §3, the encoders and decoders adopted in practice are orthogonal linear mappings while the shared embedding space is chosen to be the Embeddings from langilangi Encoder langj Decoder langj Discriminator Shared Embedding SpaceEmbeddings from langjForward and backward passes when training MForward and backward passes when training DDjMiM>jJDjJMilangilangilangjlangjlangj perparameter k ∈ N. lossd = 0 for all langj ∈ L do (cid:46) D iterations for diter = 1 to k do Select at random langi ∈ L Sample a batch of words xi ∼ Vi Sample a batch of words xj ∼ Vj xt = Mi(xi) xj = M(cid:62) j (xt) yj = Dj(xj) yj = Dj(xj) lossd += Ld(1, yj) + Ld(0, yj) Algorithm 1 Multilingual Adversarial Training Require: Vocabulary Vi for each language langi ∈ L . Hy- 1: repeat 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: until convergence Select at random langj ∈ L Sample a batch of words xi ∼ Vi xt = Mi(xi) xj = M(cid:62) j (xt) yj = Dj(xj) loss += Ld(1, yj) Update all M parameters to minimize loss orthogonalize(M) (cid:46) encode to T (cid:46) decode to Sj (cid:46) real vectors (cid:46) converted vectors (cid:46) M iteration loss = 0 for all langi ∈ L do Update all D parameters to minimize lossd (cid:46) encode to T (cid:46) decode to Sj (cid:46) see §3.3 same space as a selected target language. In order to learn a multilingual embedding space without supervision, we employ a series of language discriminators Dl, one for each lan- guage l ∈ L . Each Dl is a binary classifier with a sigmoid layer on top, and is trained to identify how likely a given vector is from Sl, the embed- ding space of language l. On the other hand, to train the mappings, we convert a vector from a ran- dom language langi to another random language langj (via the target space T first). The objective of the mappings is to confuse Dj, the language dis- criminator for langj, so the mappings are updated in a way that Dj cannot differentiate the converted vectors from the real vectors in Sj. This multilin- gual objective enables us to explicitly exploit the relations between all language pairs during train- ing, leading to improved performance. Formally, for any language langj, the objective that Dj is minimizing is: JDj = E i∼L (cid:114)Ld (1,Dj(xj)) + (cid:17)(cid:122) (cid:62) j Mixi) E xi∼Si xj∼Sj 0,Dj(M (cid:16) Ld (1) where Ld(y, y) is the loss function of D, which is chosen as the cross entropy loss in practice. y is the language label with y = 1 indicates a real embedding from that language. (cid:17) Furthermore, the objective of Mi for langi is: JMi = E (2) j∼L (cid:62) j Mixi) 1,Dj(M (cid:16) Ld E xi∼Si xj∼Sj where Mi strives to make Dj believe that a con- verted vector to langj is instead real. This adver- sarial relation between M and D stimulates M to learn a shared multilingual embedding space by making the converted vectors look as authentic as possible so that D cannot predict whether a vector is a genuine embedding from a certain language or converted from another language via M. In addition, we allow langi and langj to be the same language in (1) and (2). In this case, we are encoding a language to T and back to itself, essentially forming an adversarial autoen- coder (Makhzani et al., 2015), which is reported to improve the model performance (Zhang et al., 2017). Finally, on Line 5 and 17 in Algorithm 1, a for loop is used instead of random sampling. This is to ensure that in each step, every discrimina- tor (or mapping) is getting updated at least once, so that we do not need to increase the number of training iterations when adding more languages. Computationally, when compared to the BWE- Pivot and BWE-Direct baselines, one step of MAT training costs similarly to N BWE training steps, and in practice we train MAT for the same num- ber of iterations as training the baselines. There- fore, MAT training scales linearly with the num- ber of languages similar to BWE-Pivot (instead of quadratically as in BWE-Direct). 3.2 Multilingual Pseudo-Supervised Refinement Using MAT, we are able to obtain UMWEs with reasonable quality, but they do not yet achieve state-of-the-art performance. Previous research on learning unsupervised BWEs (Lample et al., 2018b) observes that the embeddings obtained from adversarial training do a good job aligning the frequent words between two languages, but performance degrades when considering the full vocabulary. They hence propose to use an iter- ative refinement method (Artetxe et al., 2017) to repeatedly refine the embeddings obtained from the adversarial training. The idea is that we can anchor on the more accurately predicted relations between frequent words to improve the mappings learned by adversarial training. Algorithm 2 Multilingual Pseudo-Supervised Re- finement Require: A set of (pseudo-)supervised lexica of word pairs between each pair of languages Lex(langi, langj). loss = 0 for all langi ∈ L do 1: repeat 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: until convergence Select at random langj ∈ L Sample (xi, xj) ∼ Lex(langi, langj) ti = Mi(xi) tj = Mj(xj) loss += Lr(ti, tj) Update all M parameters to minimize loss orthogonalize(M) (cid:46) encode xi (cid:46) encode xj (cid:46) refinement loss (cid:46) see §3.3 When learning MWEs, however, it is desirable to go beyond aligning each language with the tar- get space individually, and instead utilize the re- lations between all languages as we did in MAT. Therefore, we in this section propose a general- ization of the existing refinement methods to in- corporate a multilingual objective. Thus, In particular, MAT can produce an approxi- mately aligned embedding space. As mentioned earlier, however, the training signals from D for rare words are noisier and may lead to worse performance. the idea of Multilingual Pseudo-Supervised Refinement (MPSR) is to in- duce a dictionary of highly confident word pairs for every language pair, used as pseudo supervi- sion to improve the embeddings learned by MAT. For a specific language pair (langi, langj), the pseudo-supervised lexicon Lex(langi, langj) is constructed from mutual nearest neighbors be- tween MiEi and MjEj, among the most frequent 15k words of both languages. With the constructed lexica, the MPSR objective is: E Jr = E (i,j)∼L 2 (xi,xj )∼Lex(i,j) Lr(Mixi,Mjxj) (3) where Lr(x, x) is the loss function for MPSR, for which we use the mean square loss. The MPSR training is depicted in Algorithm 2. Scaling Similarity Cross-Lingual (CSLS) When constructing the pseudo-supervised lexica, a distance metric between embeddings is needed to compute nearest neighbors. Standard distance metrics such as the Euclidean distance or cosine similarity, however, can lead to the hubness problem in high-dimensional spaces when used (Radovanovi´c to calculate nearest neighbors et al., 2010; Dinu and Baroni, 2015). Namely, some words are very likely to be the nearest neighbors of many others (hubs), while others are not the nearest neighbor of any word. This problem is addressed in the literature by designing alternative distance metrics, such as the inverted softmax (Smith et al., 2017) or the CSLS (Lample et al., 2018b). In this work, we adopt the CSLS similarity as a drop-in replacement for cosine similarity whenever a distance metric is needed. The CSLS similarity (whose negation is a distance metric) is calculated as follows: CSLS(x, y) = 2 cos(x, y) (cid:88) (cid:88) y(cid:48)∈NY (x) x(cid:48)∈NX (y) 1 n 1 n − − cos(x, y (cid:48)) cos(x (cid:48) , y) (4) where NY (x) is the set of n nearest neighbors of x in the vector space that y comes from: Y = {y1, ..., yY }, and vice versa for NX (y). In prac- tice, we use n = 10. 3.3 Orthogonalization As mentioned in §3, orthogonal linear mappings are the preferred choice when learning transforma- tions between the embedding spaces of different languages (Xing et al., 2015; Smith et al., 2017). Therefore, we perform an orthogonalization up- date (Cisse et al., 2017) after each training step to ensure that our mappings M are (approximately) orthogonal: ∀l : Ml = (1 + β)Ml − βMlM (cid:62) l Ml where β is set to 0.001. 3.4 Unsupervised Multilingual Validation In order to do model selection in the unsupervised setting, where no validation set can be used, a sur- rogate validation criterion is required that does not depend on bilingual data. Previous work shows promising results using such surrogate criteria for model validation in the bilingual case (Lample et al., 2018b), and we in this work adopt a vari- ant adapted to our multilingual setting: (cid:88) (cid:62) V (M,E) = E mean csls(M j MiEi,Ej) (cid:62) j MiEi,Ej) pij · mean csls(M (i,j)∼Pij = i(cid:54)=j 1 where pij forms a probability simplex. In this work, we let all pij = N (N−1) so that V (M,E) reduces to the macro average over all language pairs. Using different pij values can place varying weights on different language pairs, which might be desirable in certain scenarios. The mean csls function is an unsupervised bilingual validation criterion proposed by Lample et al. (2018b), which is the mean CSLS similari- ties between the most frequent 10k words and their translations (nearest neighbors). 4 Experiments In this section, we present experimental results to demonstrate the effectiveness of our unsupervised MWE method on two benchmark tasks, the mul- tilingual word translation task, and the SemEval- 2017 cross-lingual word similarity task. We com- pare our MAT+MPSR method with state-of-the- art unsupervised and supervised approaches, and show that ours outperforms previous methods, su- pervised or not, on both tasks. Pre-trained 300d fastText (monolingual) em- beddings (Bojanowski et al., 2017) trained on the Wikipedia corpus are used for all systems that re- quire monolingual word embeddings for learning cross-lingual embeddings. 4.1 Multilingual Word Translation In this section, we consider the task of word trans- lation between arbitrary pairs of a set of N lan- guages. To this end, we use the recently released multilingual word translation dataset on six lan- guages: English, French, German, Italian, Por- tuguese and Spanish (Lample et al., 2018b). For any pair of the six languages, a ground-truth bilin- gual dictionary is provided with a train-test split of 5000 and 1500 unique source words, respec- tively. The 5k training pairs are used in training supervised baseline methods, while all unsuper- vised methods do not rely on any cross-lingual re- sources. All systems are tested on the 1500 test word pairs for each pair of languages. For comparison, we adopted a state-of-the-art unsupervised BWE method (Lample et al., 2018b) and generalize it for the multilingual setting us- ing the two aforementioned approaches, namely BWE-Pivot and BWE-Direct, to produce unsuper- vised baseline MWE systems. English is cho- sen as the pivot language in BWE-Pivot. We fur- ther incorporate the supervised BWE-Direct (Sup- BWE-Direct) method as a baseline, where each BWE is trained on the 5k gold-standard word pairs via the orthogonal Procrustes process (Artetxe et al., 2017; Lample et al., 2018b). Table 1 presents the evaluation results, wherein the numbers represent precision@1, namely how many times one of the correct translations of a source word is retrieved as the top candidate. All systems retrieve word translations using the CSLS similarity in the learned embedding space. Ta- ble 1a shows the detailed results for all 30 lan- guage pairs, while Table 1b summarizes the re- sults in a number of ways. We first observe the training cost of all systems summarized in Ta- ble 1b. #BWEs indicates the training cost of a cer- tain method measured by how many BWE mod- els it is equivalent to train. BWE-Pivot needs to train 2(N−1) BWEs since a separate BWE is trained for each direction in a language pair for increased performance. BWE-Direct on the other hand, trains an individual BWE for all (again, di- rected) pairs, resulting a total of N (N−1) BWEs. The supervised Sup-BWE-Direct method trains the same number of BWEs as BWE-Direct but is much faster in practice, for it does not require the unsupervised adversarial training stage. Finally, while our MAT+MPSR method does not train in- dependent BWEs, as argued in §3.1, the training cost is roughly equivalent to training N−1 BWEs, which is corroborated by the real training time shown in Table 1b. We can see in Table 1a that our MAT+MPSR method achieves the highest performance on all but 3 language pairs, compared against both the unsupervised and supervised approaches. When looking at the overall performance across all lan- guage pairs, BWE-Direct achieves a +0.6% per- formance gain over BWE-Pivot at the cost of be- ing much slower to train. When supervision is available, Sup-BWE-Direct further improves an- other 0.4% over BWE-Direct. Our MAT+MPSR method, however, attains an impressive 1.3% im- provement against Sup-BWE-Direct, despite the lack of cross-lingual supervision. To provide a more in-depth examination of the results, we first consider the Romance language pairs, such as fr-es, fr-it, fr-pt, es-it, it-pt and their reverse directions. BWE-Pivot performs notably worse than BWE-Direct on these pairs, which vali- dates our hypothesis that going through a less sim- ilar language (English) when translating between en-de en-fr en-es en-it en-pt de-fr de-es de-it de-pt fr-es fr-it fr-pt es-it es-pt it-pt Supervised methods with cross-lingual supervision Sup-BWE-Direct 77.3 73.5 81.1 81.4 79.9 73.3 67.7 69.5 59.1 82.6 83.2 78.1 83.5 87.3 81.0 Unsupervised methods without cross-lingual supervision BWE-Pivot BWE-Direct 82.3 82.3 82.4 81.7 81.7 82.5 77.0 77.0 78.8 80.7 80.7 81.5 MAT+MPSR 71.9 73.0 76.7 66.1 65.7 69.6 68.0 66.5 72.0 57.4 58.5 63.2 81.1 79.7 74.7 81.9 85.0 78.9 83.1 83.0 77.9 83.3 87.3 80.5 83.9 83.5 79.3 84.5 87.8 82.3 74.0 74.0 74.8 72.2 72.2 72.9 de-en fr-en es-en it-en pt-en fr-de es-de it-de pt-de es-fr it-fr pt-fr it-es pt-es pt-it Supervised methods with cross-lingual supervision Sup-BWE-Direct 82.4 72.4 82.9 76.9 80.3 69.5 68.3 67.5 63.7 85.8 87.1 84.3 87.3 91.5 81.1 Unsupervised methods without cross-lingual supervision BWE-Pivot BWE-Direct 77.7 77.7 80.1 80.1 82.1 82.1 MAT+MPSR 81.8 77.4 79.9 83.3 83.3 83.7 68.1 69.7 71.2 67.9 68.8 69.0 66.1 62.5 69.5 63.1 60.5 65.7 84.7 86.5 82.6 85.8 91.3 79.2 86 87.6 83.9 87.7 92.1 80.6 86.9 88.1 86.3 88.2 92.7 82.6 (a) Detailed Results Training Cost Single Source Single Target #BWEs time en-xx de-xx fr-xx es-xx it-xx pt-xx xx-en xx-de xx-fr xx-es xx-it xx-pt Overall Supervised methods with cross-lingual supervision Sup-BWE-Direct N (N−1) Unsupervised methods without cross-lingual supervision BWE-Pivot BWE-Direct 78.6 2(N−1) 79.1 N (N−1) 23h 79.1 N−1 80.0 MAT+MPSR 4h 8h 5h 67.1 77.1 80.6 79.0 79.3 79.1 67.2 79.2 81.7 79.2 79.4 79.1 70.9 79.9 82.4 81.1 81.4 79.1 68.4 79.2 81.6 80.0 80.2 79.0 68.5 82.3 82.1 78.9 77.1 78.0 67.8 81.6 81.2 77.2 75.3 67.1 82.6 82.1 78.1 77.0 70.0 84.1 83.4 80.3 78.8 77.0 77.6 79.3 (b) Summarized Results Table 1: Multilingual Word Translation Results for English, German, French, Spanish, Italian and Portuguese. The reported numbers are precision@1 in percentage. All systems use the nearest neighbor under the CSLS distance for predicting the translation of a certain word. similar languages will result in reduced accuracy. Our MAT+MPSR method, however, overcomes this disadvantage of BWE-Pivot and achieves the best performance on all these pairs through an explicit multilingual learning mechanism without increas- ing the computational cost. Furthermore, our method also beats the BWE- Direct approach, which supports our second hy- pothesis that utilizing knowledge from languages beyond the pair itself could improve performance. For instance, there are a few pairs where BWE- Pivot outperforms BWE-Direct, such as de-it, it- de and pt-de, even though it goes through a third language (English) in BWE-Pivot. This might suggest that for some less similar language pairs, leveraging a third language as a bridge could in some cases work better than only relying on the language pair itself. German is involved in all these language pairs where BWE-Pivot outper- forms than BWE-Direct, which is potentially due to the similarity between German and the pivot language English. We speculate that if choosing a different pivot language, there might be other pairs that could benefit. This observation serves as a possible explanation of the superior perfor- mance of our multilingual method over BWE- Direct, since our method utilizes knowledge from all languages during training. 4.2 Cross-Lingual Word Similarity In this section, we evaluate the quality of our MWEs on the cross-lingual word similarity (CLWS) task, which assesses how well the sim- ilarity in the cross-lingual embedding space cor- responds to a human-annotated semantic similar- ity score. The high-quality CLWS dataset from SemEval-2017 (Camacho-Collados et al., 2017) is en-de en-es de-es en-it de-it es-it en-fa de-fa es-fa it-fa Average Supervised methods with cross-lingual supervision Luminoso NASARI .787 .647 .772 .630 .735 .548 .769 .594 .747 .557 Unsupervised methods without cross-lingual supervision BWE-Pivot BWE-Direct .703 .703 .709 .709 .682 .675 .709 .709 .711 .711 MAT+MPSR .711 .712 .708 .709 .684 .767 .592 .721 .726 .730 .595 .492 .672 .672 .680 .587 .452 .655 .662 .674 .634 .466 .606 .475 .701 .714 .720 .688 .695 .709 .700 .545 .695 .698 .704 Table 2: Results for the SemEval-2017 Cross-Lingual Word Similarity task. Spearman's ρ is reported. Lumi- noso (Speer and Lowry-Duda, 2017) and NASARI (Camacho-Collados et al., 2016) are the two top-performing systems for SemEval-2017 that reported results on all language pairs. used for evaluation. The dataset contains word pairs from any two of the five languages: English, German, Spanish, Italian, and Farsi (Persian), an- notated with semantic similarity scores. In addition to the BWE-Pivot and BWE- Direct baseline methods, we also include the two best-performing systems on SemEval-2017, Luminoso (Speer and Lowry-Duda, 2017) and NASARI (Camacho-Collados et al., 2016) for comparison. Note that these two methods are su- pervised, and have access to the Europarl3 (for all languages but Farsi) and the OpenSubtitles20164 parallel corpora. Table 2 shows the results, where the perfor- mance of each model is measured by the Spear- man correlation. When compared to the BWE- Pivot and the BWE-Direct baselines, MAT+MPSR continues to perform the best on all language pairs. The qualitative findings stay the same as in the word translation task, except the margin is less sig- nificant. This might be because the CLWS task is much more lenient compared to the word transla- tion task, where in the latter one needs to correctly identify the translation of a word out of hundreds of thousands of words in the vocabulary. In CLWS though, one can still achieve relatively high corre- lation in spite of minor inaccuracies. On the other hand, an encouraging result is that when compared to the state-of-the-art super- vised results, our MAT+MPSR method outperforms NASARI by a very large margin, and achieves top-notch overall performance similar to the com- petition winner, Luminoso, without using any bi- texts. A closer examination reveals that our unsu- pervised method lags a few points behind Lumi- 3http://opus.nlpl.eu/Europarl.php 4http://opus.nlpl.eu/ OpenSubtitles2016.php noso on the European languages wherein the su- pervised methods have access to the large-scale high-quality Europarl parallel corpora. It is the low-resource language, Farsi, that makes our un- supervised method stand out. All of the unsuper- vised methods outperform the supervised systems from SemEval-2017 on language pairs involving Farsi, which is not covered by the Europarl bitexts. This suggests the advantage of learning unsuper- vised embeddings for lower-resourced languages, where the supervision might be noisy or absent. Furthermore, within the unsupervised methods, MAT+MPSR again performs the best, and attains a higher margin over the baseline approaches on the low-resource language pairs, vindicating our claim of better multilingual performance. 5 Conclusion In this work, we propose a fully unsupervised model for learning multilingual word embeddings (MWEs). Although methods exist for learning high-quality unsupervised BWEs (Lample et al., 2018b), little work has been done in the unsuper- vised multilingual setting. Previous work relies solely on a number of unsupervised BWE models to generate MWEs (e.g. BWE-Pivot and BWE- Direct), which does not fully leverage the interde- pendencies among all the languages. Therefore, we propose the MAT+MPSR method that explicitly exploits the relations between all language pairs without increasing the computational cost. In our experiments on multilingual word translation and cross-lingual word similarity (SemEval-2017), we show that MAT+MPSR outperforms existing unsu- pervised and even supervised models, achieving new state-of-the-art performance. For future work, we plan to investigate how our method can be extended to work with other BWE frameworks, in order to overcome the instability issue of Lample et al. (2018b). As pointed out by recent work (Søgaard et al., 2018; Artetxe et al., 2018a), the method by Lample et al. (2018b) per- forms much worse on certain languages such as Finnish, etc. More reliable multilingual embed- dings might be obtained on these languages if we adapt our multilingual training framework to work with the more robust methods proposed recently. References Waleed Ammar, George Mulcaire, Yulia Tsvetkov, Guillaume Lample, Chris Dyer, and Noah A. Smith. 2016. Massively multilingual word embeddings. CoRR, abs/1602.01925. Mikel Artetxe, Gorka Labaka, and Eneko Agirre. 2016. Learning principled bilingual mappings of word em- beddings while preserving monolingual invariance. In Proceedings of the 2016 Conference on Empiri- cal Methods in Natural Language Processing, pages 2289 -- 2294, Austin, Texas. Association for Compu- tational Linguistics. Mikel Artetxe, Gorka Labaka, and Eneko Agirre. 2017. Learning bilingual word embeddings with (almost) no bilingual data. In Proceedings of the 55th Annual Meeting of the Association for Computational Lin- guistics (Volume 1: Long Papers), pages 451 -- 462, Vancouver, Canada. Association for Computational Linguistics. Mikel Artetxe, Gorka Labaka, and Eneko Agirre. 2018a. A robust self-learning method for fully un- supervised cross-lingual mappings of word embed- dings. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Vol- ume 1: Long Papers), pages 789 -- 798. Association for Computational Linguistics. Mikel Artetxe, Gorka Labaka, Eneko Agirre, and Kyunghyun Cho. 2018b. Unsupervised neural ma- In International Conference on chine translation. Learning Representations. 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. Jose Camacho-Collados, Mohammad Taher Pilehvar, Nigel Collier, and Roberto Navigli. 2017. Semeval- 2017 task 2: Multilingual and cross-lingual semantic word similarity. In Proceedings of the 11th Interna- tional Workshop on Semantic Evaluation (SemEval- 2017), pages 15 -- 26, Vancouver, Canada. Associa- tion for Computational Linguistics. Jos´e Camacho-Collados, Mohammad Taher Pilehvar, and Roberto Navigli. 2016. Nasari: Integrating ex- plicit knowledge and corpus statistics for a multilin- gual representation of concepts and entities. Artifi- cial Intelligence, 240:36 -- 64. Xilun Chen, Yu Sun, Ben Athiwaratkun, Claire Cardie, and Kilian Weinberger. 2016. Adversarial deep av- eraging networks for cross-lingual sentiment classi- fication. arXiv e-prints 1606.01614v5. Moustapha Cisse, Piotr Bojanowski, Edouard Grave, Yann Dauphin, and Nicolas Usunier. 2017. Parse- val networks: Improving robustness to adversarial examples. In Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 854 -- 863, International Convention Centre, Sydney, Australia. PMLR. Jocelyn Coulmance, Jean-Marc Marty, Guillaume Wenzek, and Amine Benhalloum. 2015. Trans- gram, fast cross-lingual word-embeddings. In Pro- ceedings of the 2015 Conference on Empirical Meth- ods in Natural Language Processing, pages 1109 -- 1113, Lisbon, Portugal. Association for Computa- tional Linguistics. Georgiana Dinu and Marco Baroni. 2015. Improving zero-shot learning by mitigating the hubness prob- lem. In International Conference on Learning Rep- resentations, Workshop Track. Long Duong, Hiroshi Kanayama, Tengfei Ma, Steven Bird, and Trevor Cohn. 2017. Multilingual training of crosslingual word embeddings. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 1, Long Papers, pages 894 -- 904, Valencia, Spain. Association for Computational Linguistics. Manaal Faruqui and Chris Dyer. 2014. Improving vec- tor space word representations using multilingual correlation. In Proceedings of the 14th Conference of the European Chapter of the Association for Com- putational Linguistics, pages 462 -- 471. Association for Computational Linguistics. Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. 2014. Generative ad- In Advances in Neural Information versarial nets. Processing Systems 27, pages 2672 -- 2680. Curran Associates, Inc. Stephan Gouws, Yoshua Bengio, and Greg Corrado. 2015. Bilbowa: Fast bilingual distributed represen- In Proceedings tations without word alignments. of the 32nd International Conference on Machine Learning. Alexandre Klementiev, Ivan Titov, and Binod Bhat- Inducing crosslingual distributed rep- tarai. 2012. resentations of words. In Proceedings of COLING 2012, pages 1459 -- 1474, Mumbai, India. The COL- ING 2012 Organizing Committee. 719 -- 725, Beijing, China. Association for Computa- tional Linguistics. Chao Xing, Dong Wang, Chao Liu, and Yiye Lin. 2015. Normalized word embedding and orthog- onal transform for bilingual word translation. In Proceedings of the 2015 Conference of the North American Chapter of the Association for Computa- tional Linguistics: Human Language Technologies, pages 1006 -- 1011, Denver, Colorado. Association for Computational Linguistics. Meng Zhang, Yang Liu, Huanbo Luan, and Maosong Sun. 2017. Adversarial training for unsupervised In Proceedings of the bilingual lexicon induction. 55th Annual Meeting of the Association for Com- putational Linguistics (Volume 1: Long Papers), pages 1959 -- 1970, Vancouver, Canada. Association for Computational Linguistics. Will Y. Zou, Richard Socher, Daniel Cer, and Christo- pher D. Manning. 2013. Bilingual word embeddings In Proceed- for phrase-based machine translation. ings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 1393 -- 1398, Seattle, Washington, USA. Association for Compu- tational Linguistics. Guillaume Lample, Alexis Conneau, Ludovic De- noyer, and Marc'Aurelio Ranzato. 2018a. Unsu- pervised machine translation using monolingual cor- pora only. In International Conference on Learning Representations. Guillaume Lample, Alexis Conneau, Marc'Aurelio Ranzato, Ludovic Denoyer, and Herv Jgou. 2018b. Word translation without parallel data. In Interna- tional Conference on Learning Representations. Alireza Makhzani, Jonathon Shlens, Navdeep Jaitly, Ian Goodfellow, and Brendan Frey. 2015. Adversar- ial autoencoders. arXiv preprint arXiv:1511.05644. Tomas Mikolov, Quoc V. Le, and Ilya Sutskever. 2013a. Exploiting similarities among languages for ma- chine translation. CoRR, abs/1309.4168. Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg Cor- rado, and Jeffrey Dean. 2013b. Distributed repre- sentations of words and phrases and their composi- tionality. In Proceedings of the 26th International Conference on Neural Information Processing Sys- tems - Volume 2, pages 3111 -- 3119, USA. Curran Associates Inc. Milos Radovanovi´c, Alexandros Nanopoulos, and Mir- jana Ivanovi´c. 2010. Hubs in space: Popular nearest neighbors in high-dimensional data. J. Mach. Learn. Res., 11:2487 -- 2531. Samuel L. Smith, David H. P. Turban, Steven Hamblin, and Nils Y. Hammerla. 2017. Offline bilingual word vectors, orthogonal transformations and the inverted softmax. In Proceedings of ICLR. Anders Søgaard, Sebastian Ruder, and Ivan Vuli´c. 2018. On the limitations of unsupervised bilingual dictionary induction. In Proceedings of the 56th An- nual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 778 -- 788. Association for Computational Linguistics. Robert Speer and Joanna Lowry-Duda. 2017. Con- ceptnet at semeval-2017 task 2: Extending word embeddings with multilingual relational knowledge. In Proceedings of the 11th International Workshop on Semantic Evaluation, SemEval@ACL 2017, Van- couver, Canada, August 3-4, 2017, pages 85 -- 89. Joseph Turian, Lev-Arie Ratinov, and Yoshua Bengio. 2010. Word representations: A simple and general In Proceed- method for semi-supervised learning. ings of the 48th Annual Meeting of the Association for Computational Linguistics, pages 384 -- 394, Up- psala, Sweden. Association for Computational Lin- guistics. Ivan Vuli´c and Marie-Francine Moens. 2015. Bilin- gual word embeddings from non-parallel document- aligned data applied to bilingual lexicon induction. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Lan- guage Processing (Volume 2: Short Papers), pages
1805.10187
1
1805
2018-05-25T15:00:30
Recursive Neural Network Based Preordering for English-to-Japanese Machine Translation
[ "cs.CL" ]
The word order between source and target languages significantly influences the translation quality in machine translation. Preordering can effectively address this problem. Previous preordering methods require a manual feature design, making language dependent design costly. In this paper, we propose a preordering method with a recursive neural network that learns features from raw inputs. Experiments show that the proposed method achieves comparable gain in translation quality to the state-of-the-art method but without a manual feature design.
cs.CL
cs
Recursive Neural Network Based Preordering for English-to-Japanese Machine Translation Yuki Arase† Yuki Kawara† †Graduate School of Information Science and Technology, Osaka University Chenhui Chu‡ ‡Institute for Datability Science, Osaka University 8 1 0 2 y a M 5 2 ] L C . s c [ 1 v 7 8 1 0 1 . 5 0 8 1 : v i X r a {kawara.yuki,arase}@ist.osaka-u.ac.jp,[email protected] Abstract The word order between source and tar- get languages significantly influences the translation quality in machine translation. Preordering can effectively address this problem. Previous preordering methods require a manual feature design, making language dependent design costly. In this paper, we propose a preordering method with a recursive neural network that learns features from raw inputs. Experiments show that the proposed method achieves comparable gain in translation quality to the state-of-the-art method but without a manual feature design. Introduction 1 The word order between source and target lan- guages significantly influences the translation quality in statistical machine translation (SMT) (Tillmann, 2004; Hayashi et al., 2013; Nakagawa, 2015). Models that adjust orders of translated phrases in decoding have been proposed to solve this problem (Tillmann, 2004; Koehn et al., 2005; Nagata et al., 2006). However, such reordering models do not perform well for long-distance re- ordering. In addition, their computational costs are expensive. To address these problems, pre- ordering (Xia and McCord, 2004; Wang et al., 2007; Xu et al., 2009; Isozaki et al., 2010b; Go- jun and Fraser, 2012; Nakagawa, 2015) and post- ordering (Goto et al., 2012, 2013; Hayashi et al., 2013) models have been proposed. Preordering re- orders source sentences before translation, while post-ordering reorders sentences translated with- out considering the word order after translation. In particular, preordering effectively improves the translation quality because it solves long-distance reordering and computational complexity issues (Jehl et al., 2014; Nakagawa, 2015). Rule-based preordering methods either manu- ally create reordering rules (Wang et al., 2007; Xu et al., 2009; Isozaki et al., 2010b; Gojun and Fraser, 2012) or extract reordering rules from a corpus (Xia and McCord, 2004; Genzel, 2010). On the other hand, studies in (Neubig et al., 2012; Lerner and Petrov, 2013; Hoshino et al., 2015; Nakagawa, 2015) apply machine learning to the preordering problem. Hoshino et al. (2015) pro- posed a method that learns whether child nodes should be swapped at each node of a syntax tree. Neubig et al. (2012) and Nakagawa (2015) pro- posed methods that construct a binary tree and re- ordering simultaneously from a source sentence. These methods require a manual feature design for every language pair, which makes language dependent design costly. To overcome this chal- lenge, methods based on feed forward neural net- works that do not require a manual feature de- sign have been proposed (de Gispert et al., 2015; Botha et al., 2017). However, these methods de- cide whether to reorder child nodes without con- sidering the sub-trees, which contains important information for reordering. As a preordering method that is free of man- ual feature design and makes use of information in sub-trees, we propose a preordering method with a recursive neural network (RvNN). RvNN cal- culates reordering in a bottom-up manner (from the leaf nodes to the root) on a source syntax tree. Thus, preordering is performed consid- ering the entire sub-trees. Specifically, RvNN learns whether to reorder nodes of a syntax tree1 with a vector representation of sub-trees and syntactic categories. We evaluate the proposed method for English-to-Japanese translations us- ing both phrase-based SMT (PBSMT) and neural 1In this paper, we used binary syntax trees. MT (NMT). The results confirm that the proposed method achieves comparable translation quality to the state-of-the-art preordering method (Naka- gawa, 2015) that requires a manual feature design. 2 Preordering with a Recursive Neural Network We explain our design of the RvNN to conduct preordering after describing how to obtain gold- standard labels for preordering. 2.1 Gold-Standard Labels for Preordering We created training data for preordering by label- ing whether each node of the source-side syntax tree has reordered child nodes against a target- side sentence. The label is determined based on Kendall's τ (Kendall, 1938) as in (Nakagawa, 2015), which is calculated by Equation (1). (cid:80)y 4(cid:80)y−1 (cid:40) i=1 y(y − 1) 1 (x is true), 0 (otherwise), τ = δ(x) = j=i+1 δ(yi < yj) − 1,(1) where y is a vector of target word indexes that are aligned with source words. The value of Kendall's τ is in [−1, 1]. When it is 1, it means the se- quence of y is in a complete ascending order, i.e., target sentence has the same word order with the source in terms of word alignment. At each node, if Kendall's τ increases by reordering child nodes, an "Inverted" label is assigned; otherwise, a "Straight" label, which means the child nodes do not need to be reordered, is assigned. When a source word of a child node does not have an alignment, a "Straight" label is assigned. 2.2 Preordering Model RvNN is constructed given a binary syntax tree. It predicts the label determined in Section 2.1 at each node. RvNN decides whether to reorder the child nodes by considering the sub-tree. The vector of the sub-tree is calculated in a bottom-up manner from the leaf nodes. Figure 1 shows an example of preordering of an English sentence "My parents live in London." At the VP node corresponding to "live in London," the vector of the node is calcu- lated by Equation (2), considering its child nodes correspond to "live" and "in London." p = f ([pl; pr]W + b), s = pWs + bs, (2) (3) Figure 1: Preordering an English sentence "My parents live in London" with RvNN (Nodes with a horizontal line mean "Inverted"). where f is a rectifier, W ∈ R2λ×λ is a weight ma- trix, pl and pr are vector representations of the left [·;·] denotes and right child nodes, respectively. the concatenation of two vectors. Ws ∈ Rλ×2 is a weight matrix for the output layer, and b, bs ∈ Rλ are the biases. s ∈ R2 calculated by Equation (3) is a weight vector for each label, which is fed into a softmax function to calculate the probabilities of the "Straight" and "Inverted" labels. At a leaf node, a word embedding calculated by Equations (4) and (5) is fed into Equation (2). e = xWE, pe = f (eWl + bl), (4) (5) where x ∈ RN is a one-hot vector of an input word with a vocabulary size of N, WE ∈ RN×λ is an embedding matrix, and bl ∈ Rλ is the bias. The loss function is the cross entropy defined by Equation (6). L(θ) = − 1 K k log p(ln ln k ; θ), (6) where θ is the parameters of the model, n is the node of a syntax tree T , K is a mini batch size, and k is the label of the n-th node in the k-th syntax ln tree in the mini batch. With the model using POS tags and syntactic categories, we use Equation (7) instead of Equa- tion (2). p = f ([pl; pr; et]Wt + bt), (7) where et represents a vector of POS tags or syn- tactic categories, Wt ∈ R3λ×λ is a weight matrix, and bt ∈ Rλ is the bias. et is calculated in the same manner as Equations (4) and (5), but the in- put is a one-hot vector of the POS tags or syntactic K(cid:88) (cid:88) n∈T k=1 VPPPMyparentsliveinLondonMyparentsliveinLondonPRP$NNSVBPINNNPNPS categories at each node. λ is tuned on a develop- ment set, whose effects are investigated in Section 3.2. 3 Experiments 3.1 Settings We conducted English-to-Japanese translation ex- periments using the ASPEC corpus (Nakazawa et al., 2016). This corpus provides 3M sentence pairs as training data, 1, 790 sentence pairs as de- velopment data, and 1, 812 sentence pairs as test data. We used Stanford CoreNLP2 for tokeniza- tion and POS tagging, Enju3 for parsing of En- glish, and MeCab4 for tokenization of Japanese. For word alignment, we used MGIZA.5 Source-to- target and target-to-source word alignments were calculated using IBM model 1 and hidden Markov model, and they were combined with the intersec- tion heuristic following (Nakagawa, 2015). We implemented our RvNN preordering model with Chainer.6 The ASPEC corpus was created using the sentence alignment method proposed in (Utiyama and Isahara, 2007) and was sorted based on the alignment confidence scores. In this pa- per, we used 100k sentences sampled from the top 500k sentences as training data for preordering. The vocabulary size N was set to 50k. We used Adam (Kingma and Ba, 2015) with a weight de- cay and gradient clipping for optimization. The mini batch size K was set to 500. We compared our model with the state-of-the- art preordering method proposed in (Nakagawa, 2015), which is hereafter referred to as BTG. We used its publicly available implementation,7 and trained it on the same 100k sentences as our model. We used the 1.8M source and target sentences as training data for MT. We excluded part of the sentence pairs whose lengths were longer than 50 words or the source to target length ratio ex- ceeded 9. For SMT, we used Moses.8 We trained the 5-gram language model on the target side of the training corpus with KenLM.9 Tuning was performed by minimum error rate training (Och, 2http://stanfordnlp.github.io/CoreNLP/ 3http://www.nactem.ac.uk/enju/ 4http://taku910.github.io/mecab/ 5http://github.com/moses-smt/giza-pp 6http://chainer.org/ 7http://github.com/google/topdown-btg-preordering 8http://www.statmt.org/moses/ 9http://github.com/kpu/kenlm Figure 2: Learning curve of our preordering model. Node dimensions w/o preordering 100 w/o tags and categories w/ tags and categories 24.63 25.22 200 22.73 24.95 25.41 500 25.02 25.38 Table 1: BLEU scores with preordering by our model and without preordering under different λ settings (trained on a 500k subset of the training data). 2003). We repeated tuning and testing of each model 3 times and reported the average of scores. For NMT, we used the attention-based encoder- decoder model of (Luong et al., 2015) with 2-layer LSTM implemented in OpenNMT.10 The sizes of the vocabulary, word embedding, and hidden layer were set to 50k, 500, and 500, respectively. The batch size was set to 64, and the number of epochs was set to 13. The translation quality was evaluated using BLEU (Papineni et al., 2002) and RIBES (Isozaki et al., 2010a) using the bootstrap resampling method (Koehn, 2004) for the signifi- cance test. 3.2 Results Figure 2 shows the learning curve of our preorder- ing model with λ = 200.11 Both the training and the development losses decreased until 2 epochs. However, the development loss started to increase after 3 epochs. Therefore, the number of epochs was set up to 5, and we chose the model with the lowest development loss. The source sentences in the translation evaluation were preordered with 10http://opennmt.net/ 11The learning curve behaves similarly for different λ val- ues. 12345Epoch6.86.97.07.17.27.37.47.57.6Trainloss13.4613.4813.5013.5213.5413.5613.58Devlosstrainlossdevloss Figure 4: Example of a syntax tree with a parse-error (the phrase "(1811)" was divided in two phrases by mistake). Our preordering result was affected by such parse-errors. (Nodes with a horizontal line means "Inverted".) w/o preordering w/ BTG w/ RvNN PBSMT NMT BLEU RIBES BLEU RIBES 81.68 22.88 79.58 29.51 29.16 79.63 32.68 28.91 29.01 64.07 77.20 76.39 Table 2: BLEU and RIBES scores on the test set. (All models are trained on the entire training cor- pus of 1.8M sentence pairs.) Numbers in bold in- dicate the best systems and the systems that are statistically insignificant at p < 0.05 from the best systems. Figure 3: Distribution of Kendall's τ in the train- ing data without preordering, preordering by BTG, and preordering by our RvNN. this model. Next, we investigated the effect of λ. Table 1 shows the BLEU scores with different λ val- ues, as well as the BLEU score without preorder- ing. In this experiment, PBSMT was trained with a 500k subset of training data, and the distortion limit was set to 6. Our RvNNs consistently out- performed the plain PBSMT without preordering. The BLEU score improved as λ increased when only word embedding was considered. In addi- tion, RvNNs involving POS tags and syntactic cat- egories achieved even higher BLEU scores. This result shows the effectiveness of POS tags and syntactic categories in reordering. For these mod- els, setting λ larger than 200 did not contribute to the translation quality. Based on these, we further evaluated the RvNN with POS tags and syntactic categories where λ = 200. Table 2 shows BLEU and RIBES scores of the test set on PBSMT and NMT trained on the en- tire training data of 1.8M sentence pairs. The dis- tortion limit of SMT systems trained using pre- ordered sentences by RvNN and BTG was set to 0, while that without preordering was set to 6. Com- pared to the plain PBSMT without preordering, both BLEU and RIBES increased significantly with preordering by RvNN and BTG. These scores were comparable (statistically insignificant at p < 0.05) between RvNN and BTG,12 indicating that the proposed method achieves a translation quality comparable to BTG. In contrast to the case of PB- SMT, NMT without preordering achieved a signif- icantly higher BLEU score than NMT models with preordering by RvNN and BTG. This is the same phenomenon in the Chinese-to-Japanese transla- tion experiment reported in (Sudoh and Nagata, 2016). We assume that one reason is the isola- tion between preordering and NMT models, where both models are trained using independent opti- mization functions. In the future, we will investi- gate this problem and consider a model that unifies preordering and translation in a single model. Figure 3 shows the distribution of Kendall's τ in the original training data as well as the dis- tributions after preordering by RvNN and BTG. The ratio of high Kendall's τ largely increased in the case of RvNN, suggesting that the proposed 12The p-value for BLEU and RIBES were 0.068 and 0.226, respectively. Avogadro 's hypothesis ( 1811 ) contributed to the development in since then−101Kendall'sτ0.000.050.100.150.20proportiontauofw/opreorderingtauofpreorderingwithBTGtauofpreorderingwithRvNN Source sentence BTG RvNN Preordered examples because of the embedding heterostructure, current leakage around the threshold was minimal. of the embedding heterostructure because, the threshold around current leakage minimal was. embedding heterostructure the of because, around threshold the current leakage minimal was. Translation examples by PBSMT Reference 埋込みヘテロ構造のため、しきい値近くでの漏れ電流は非常に小さかった。 (embedding heterostructure of because, threshold around leakage very minimal.) w/o preordering 埋込みヘテロ構造のため、漏れ電流のしきい値付近では最低であった。 BTG  RvNN (embedding heterostructure of because, leakage threshold around minimal.) の埋込みヘテロ構造のため、このしきい値付近での漏れ電流の最小であった。 (of embedding heterostructure of because, the threshold around leakage minimal.) 埋込みヘテロ構造のため、周辺のしきい値の電流漏れは認められなかった。 (embedding heterostructure of because, around threshold leakage recognized not.) Table 3: Example where preordering improves translation. (Literal translations are given in the paren- thesis under the Japanese sentences.) Source sentence BTG RvNN Reference Preordered examples avogadro's hypothesis (1811) contributed to the development in since then. avogadro's hypothesis (1811) the then since in development to contributed . avogadro's hypothesis (1811 then since in to development the contributed). Translation examples by PBSMT Avogadroの仮説 (1811)は,以後の発展に貢献した。 (Avogadro's hypothesis (1811), since then development to contributed.) w/o preordering Avogadroの仮説 (1811)の開発に貢献し以後である。 BTG RvNN (Avogadro's hypothesis (1811) development to contributed since then.) Avogadroの仮説 (1811)以後の発展に貢献した。 (Avogadro's hypothesis (1811) since then development to contributed.) Avogadroの仮説 (1811以降のこれらの開発に貢献した。  (Avogadro's hypothesis (1811 since then these development to contributed.) Table 4: Example of a parse-error disturbed preordering in our method. (Literal translations are given in the parenthesis under the Japanese sentences.) method learns preordering properly. Furthermore, the ratio of high Kendall's τ by RvNN is more than that of BTG, implying that preordering by RvNN is better than that by BTG. We also manually investigated the preordering and translation results. We found that our model improved both. Table 3 shows a successful pre- ordering and translation example on PBSMT. The word order is notably different between source and reference sentences. After preordering, the word order between the source and reference sentences became the same. Because RvNN depends on parsing, sentences with a parse-error tended to fail in preordering. For example, the phrase "(1811)" in Figure 4 was divided in two phrases by mistake. Consequently, preordering failed. Table 4 shows preordering and translation examples for the sen- tence in Figure 4. Compared to the translation without preordering, the translation quality after preordering was improved to deliver correct mean- ing. 4 Conclusion In this paper, we proposed a preordering method without a manual feature design for MT. The ex- periments confirmed that the proposed method achieved a translation quality comparable to the state-of-the-art preordering method that requires a manual feature design. As a future work, we plan to develop a model that jointly parses and pre- orders a source sentence. In addition, we plan to integrate preordering into the NMT model. Acknowledgement This work was supported by NTT communica- tion science laboratories and Grant-in-Aid for Re- search Activity Start-up #17H06822, JSPS. References Jan A. Botha, Emily Pitler, Ji Ma, Anton Bakalov, Alex Salcianu, David Weiss, Ryan McDonald, and Slav Petrov. 2017. Natural language processing with small feed-forward networks. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2879–2885, Copenhagen, Denmark. Dmitriy Genzel. 2010. Automatically learning source- side reordering rules for large scale machine trans- In Proceedings of the International Con- lation. ference on Computational Linguistics (COLING), pages 376–384, Beijing, China. Adri`a de Gispert, Gonzalo Iglesias, and Bill Byrne. 2015. Fast and accurate preordering for SMT us- ing neural networks. In Proceedings of the Confer- ence of the North American Chapter of the Associ- ation for Computational Linguistics: Human Lan- guage Technologies (NAACL-HLT), pages 1012– 1017, Denver, Colorado. Anita Gojun and Alexander Fraser. 2012. Determin- ing the placement of German verbs in English–to– German SMT. In Proceedings of the Conference of the European Chapter of the Association for Com- putational Linguistics (EACL), pages 726–735, Avi- gnon, France. Isao Goto, Masao Utiyama, and Eiichiro Sumita. 2012. Post-ordering by parsing for Japanese-English sta- In Proceedings of the tistical machine translation. Annual Meeting of the Association for Computa- tional Linguistics (ACL), pages 311–316, Jeju Is- land, Korea. Isao Goto, Masao Utiyama, and Eiichiro Sumita. 2013. Post-ordering by parsing with ITG for Japanese- English statistical machine translation. ACM Trans- actions on Asian Language Information Processing, 12(4):17:1–17:22. Katsuhiko Hayashi, Katsuhito Sudoh, Hajime Tsukada, Jun Suzuki, and Masaaki Nagata. 2013. Shift- reduce word reordering for machine translation. In Proceedings of the Conference on Empirical Meth- ods in Natural Language Processing (EMNLP), pages 1382–1386, Seattle, Washington, USA. Sho Hoshino, Yusuke Miyao, Katsuhito Sudoh, Kat- suhiko Hayashi, and Masaaki Nagata. 2015. Dis- criminative preordering meets Kendall's τ maxi- In Proceedings of the Annual Meeting mization. of the Association for Computational Linguistics and International Joint Conference on Natural Lan- guage Processing (ACL-IJCNLP), pages 139–144, Beijing, China. Hideki Isozaki, Tsutomu Hirao, Kevin Duh, Katsuhito Sudoh, and Hajime Tsukada. 2010a. Automatic evaluation of translation quality for distant language In Proceedings of the Conference on Em- pairs. pirical Methods in Natural Language Processing (EMNLP), pages 944–952, Cambridge, USA. Hideki Isozaki, Katsuhito Sudoh, Hajime Tsukada, and Kevin Duh. 2010b. Head finalization: A simple re- In Proceedings ordering rule for SOV languages. of the Workshop on Statistical Machine Translation and MetricsMATR, pages 244–251, Uppsala, Swe- den. Laura Jehl, Adri`a de Gispert, Mark Hopkins, and Bill Byrne. 2014. Source-side preordering for transla- tion using logistic regression and depth-first branch- In Proceedings of the Confer- and-bound search. ence of the European Chapter of the Association for Computational Linguistics (EACL), pages 239–248, Gothenburg, Sweden. M. G. Kendall. 1938. A new measure of rank correla- tion. Biometrika, 30(1/2):81–93. Diederik P. Kingma and Jimmy Ba. 2015. Adam: A method for stochastic optimization. In Proceedings of the International Conference for Learning Repre- sentations (ICLR), San Diego, USA. Philipp Koehn. 2004. Statistical significance tests for machine translation evaluation. In Proceedings of the Conference on Empirical Methods in Natu- ral Language Processing (EMNLP), pages 388–395, Barcelona, Spain. Philipp Koehn, Amittai Axelrod, Alexandra Birch- Mayne, Chris Callison-Burch, Miles Osborne, and David Talbot. 2005. Edinburgh system description for the 2005 IWSLT speech translation evaluation. In Proceedings of the International Workshop on Spoken Language Translation (IWSLT), pages 68– 75, Pittsburgh, USA. Uri Lerner and Slav Petrov. 2013. Source-side clas- In Pro- sifier preordering for machine translation. ceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 513–523, Seattle, USA. Thang Luong, Hieu Pham, and Christopher D. Man- ning. 2015. Effective approaches to attention-based In Proceedings of the neural machine translation. Conference on Empirical Methods in Natural Lan- guage Processing (EMNLP), pages 1412–1421, Lis- bon, Portugal. Masaaki Nagata, Kuniko Saito, Kazuhide Yamamoto, and Kazuteru Ohashi. 2006. A clustered global phrase reordering model for statistical machine In Proceedings of the International translation. Conference on Computational Linguistics and An- nual Meeting of the Association for Computational Linguistics (COLING-ACL), pages 713–720, Syd- ney, Australia. Tetsuji Nakagawa. 2015. Efficient top-down BTG parsing for machine translation preordering. In Proceedings of the Annual Meeting of the Associ- ation for Computational Linguistics and Interna- tional Joint Conference on Natural Language Pro- cessing (ACL-IJCNLP), pages 208–218, Beijing, China. Toshiaki Nakazawa, Manabu Yaguchi, Kiyotaka Uchi- moto, Masao Utiyama, Eiichiro Sumita, Sadao Kurohashi, and Hitoshi Isahara. 2016. ASPEC: Asian scientific paper excerpt corpus. In Proceed- ings of the International Conference on Language Resources and Evaluation (LREC), pages 2204– 2208, Portoroz, Slovenia. Graham Neubig, Taro Watanabe, and Shinsuke Mori. 2012. Inducing a discriminative parser to optimize In Proceedings of machine translation reordering. the Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning (EMNLP-CoNLL), pages 843– 853, Jeju Island, Korea. Franz Josef Och. 2003. Minimum error rate training in statistical machine translation. In Proceedings of the Annual Meeting of the Association for Computa- tional Linguistics (ACL), pages 160–167, Sapporo, Japan. Kishore Papineni, Salim Roukos, Todd Ward, and Wei- Jing Zhu. 2002. BLEU: a method for automatic evaluation of machine translation. In Proceedings of the Annual Meeting of the Association for Computa- tional Linguistics (ACL), pages 311–318, Philadel- phia, USA. Katsuhito Sudoh and Masaaki Nagata. 2016. Chinese- to-Japanese patent machine translation based on syntactic pre-ordering for WAT 2016. In Proceed- ings of the Workshop on Asian Translation (WAT), pages 211–215, Osaka, Japan. Christoph Tillmann. 2004. A unigram orientation In Pro- model for statistical machine translation. ceedings of the Human Language Technology Con- ference of the Association for Computational Linguistics (HLT- NAACL), pages 101–104, Boston, Massachusetts, USA. the North American Chapter of Masao Utiyama and Hitoshi A In Pro- Japanese-English patent parallel corpus. ceedings of the Machine Translation Summit XI, pages 475–482, Copenhagen, Denmark. Isahara. 2007. Chao Wang, Michael Collins, and Philipp Koehn. 2007. Chinese syntactic reordering for statistical machine In Proceedings of the Conference on translation. Empirical Methods in Natural Language Process- ing and Computational Natural Language Learning (EMNLP-CoNLL), pages 737–745, Prague, Czech Republic. Fei Xia and Michael McCord. 2004. Improving a statistical MT system with automatically learned rewrite patterns. In Proceedings of the International Conference on Computational Linguistics (COL- ING), pages 508–514, Geneva, Switzerland. Peng Xu, Jaeho Kang, Michael Ringgaard, and Franz Och. 2009. Using a dependency parser to improve In Pro- SMT for subject-object-verb languages. ceedings of the Human Language Technologies: An- nual Conference of the North American Chapter of the Association for Computational Linguistics (HLT- NAACL), pages 245–253, Boulder, USA.
1804.00831
2
1804
2018-04-17T00:21:43
AttnConvnet at SemEval-2018 Task 1: Attention-based Convolutional Neural Networks for Multi-label Emotion Classification
[ "cs.CL", "cs.LG", "cs.NE" ]
In this paper, we propose an attention-based classifier that predicts multiple emotions of a given sentence. Our model imitates human's two-step procedure of sentence understanding and it can effectively represent and classify sentences. With emoji-to-meaning preprocessing and extra lexicon utilization, we further improve the model performance. We train and evaluate our model with data provided by SemEval-2018 task 1-5, each sentence of which has several labels among 11 given sentiments. Our model achieves 5-th/1-th rank in English/Spanish respectively.
cs.CL
cs
AttnConvnet at SemEval-2018 Task 1: Attention-based Convolutional Neural Networks for Multi-label Emotion Classification Yanghoon Kim1,2, Hwanhee Lee1 and Kyomin Jung1,2 1Seoul National University, Seoul, Korea 2Automation and Systems Research Institute, Seoul National University, Seoul, Korea {ad26kr,wanted1007,kjung}@snu.ac.kr 8 1 0 2 r p A 7 1 ] L C . s c [ 2 v 1 3 8 0 0 . 4 0 8 1 : v i X r a Abstract In this paper, we propose an attention-based classifier that predicts multiple emotions of a given sentence. Our model imitates human's two-step procedure of sentence understanding and it can effectively represent and classify sentences. With emoji-to-meaning preprocess- ing and extra lexicon utilization, we further improve the model performance. We train and evaluate our model with data provided by SemEval-2018 task 1-5, each sentence of which has several labels among 11 given emo- tions. Our model achieves 5th/1st rank in En- glish/Spanish respectively. Introduction 1 Since the revolution in deep neural networks, es- pecially with the help of Long short-term mem- ory(Hochreiter and Schmidhuber, 1997), it has been easy for machines to imitate human's linguis- tic activities, such as sentence classification(Kim, 2014), language model(Sundermeyer et al., 2010), machine translation(Bahdanau et al., 2015). Emotion classification is a subpart of sentence classification that predicts the emotion of the given sentence by understanding the meaning of it. Multi-label emotion classification requires more powerful ability to comprehend the sentence in variety of aspects. For example, given a sen- tence 'For real? Look what I got for my birth- day present!!', it is easy for human to figure out that the sentence not only expressing 'joy' but also 'surprise'. However, machines may require more task-specific structure to solve the same problem. Attention mechanisms are one of the most spot- lighted trends in deep learning and recently made their way into NLP. Applied to systems with neu- ral networks, it functions as visual attention mech- anisms found in humans(Denil et al., 2012) and the most effective region of features will be high- lighted over time, making the system better exploit the features related to the training objective. (Bah- danau et al., 2015) is one of the most significant footprints of attention mechanism in NLP and they applied attention mechanisms to machine transla- tion for the first time. The model generates target word under the influence of related source words. Furthermore, Vaswani et al. (2017) proposed a brand new architecture for neural machine transla- tion. The model utilizes attention mechanisms not only as the submodule but also as the main struc- ture, improving time complexity and performance. Inspired by (Vaswani et al., 2017), we come up with attention-based multi-label sentence clas- sifier that can effectively represent and classify sentences. Our system is composed of a self- attention module and multiple CNNs enabling it to imitate human's two-step procedure of analyz- ing sentences: comprehend and classify. Further- more, our emoji-to-meaning preprocessing and extra lexicon utilization improve model perfor- mance on given dataset. We evaluated our system on the dataset of (Mohammad et al., 2018), where it ranked 5th/1st rank in English/Spanish respec- tively. 2 Model Our system is mainly composed of two parts: self- attention module and multiple independent CNNs as depicted in Figure 1. This structure is actually imitating how human perform the same task. In general, human firstly read a sentence and try to comprehend the meaning, which corresponds to self-attention in our system. Then human catego- rize the sentence to each emotion separately but not all at once, and that is the reason why our sys- tem use 11 independent CNNs. In addition to main structure, we added the description of preprocess- ing in the model description because it makes up a large proportion in NLP tasks, especially when Figure 1: Overall architecture of the model. Preprocessed data goes through embedding layer, self-attention layer, Convolution layer and pooling layer step by step. the dataset is small. Details are described in the following paragraph step by step. Preprocessing: For raw data, we applied 3 steps of preprocessing: (i) Our system mainly deals with limited num- bers of tweet data, which is very noisy. In this case, preprocessing of data has crucial impact on model performance. Emoji may be referred to as a typical property of tweets and we found that considerable number of tweets contain emojis. Each emoji has a meaning of their own, and we converted ev- ery emoji in the data to phrase/word that represents its meaning. We call this pro- cedure as emoji-to-meaning preprocessing. Some tweets have too many repetition of cer- tain emoji that may make the sentence over- biased to certain emotions. Against expec- tations, removing overlapped emojis reduced performance. (ii) Lower-case and tokenize data with TweetTo- kenizer in (Bird and Loper, 2002). (iii) Remove all of the mentions and '#' symbols in the beginning of all topics. Unlike men- tions, topics may include emotional words and hence we don't remove the topic itself. Embedding: It is especially helpful to use pre- trained word embeddings when dealing with a small dataset. Among those well-known word em- beddings such as Word2Vec(Mikolov et al., 2013), GloVe(Pennington et al., 2014) and fastText(Piotr et al., 2016), we adopt 300-dimension GloVe vectors for English ,which is trained on Com- mon Crawl data of 840 billion tokens and 300- dimension fastText vectors for Spanish, which is trained on Wikipedia. Self-attention: Vaswani et al. (2017) proposed a non-recurrent machine translation architecture called Transformer that is based on dot-product attention module. Usually, attention mechanisms are used as a submodule of deep learning mod- els, calculating the importance weight of each po- sition given a sequence. In our system, we adopt the self-attention mechanisms in (Vaswani et al., 2017) to represent sentences. The detailed struc- ture of self-attention is shown in Figure 2. Dot- product of every embedded vector and weight ma- trix W ∈ Rde×3de is split through dimension as Q, K, V of the same size, where de is the dimension- ality of embedded vectors. Then attended vector is computed as in (3). E = [emb(x1), emb(x2), ..., emb(xn)] [Q, K, V ] = [eW f or e in E] QKT√ de Attn(Q, K, V ) = sof tmax( )V (1) (2) (3) Multi-head attention allows the model to benefit from ensemble effect only with the same amount labels among 11 pre-set emotions: 'angry', 'antic- ipation', 'disgust', 'fear', 'joy', 'love' 'optimism', 'pessimism', 'sadness', 'surprise' and 'trust'. We only use English and Spanish data among three different The dataset consists of 6838/887/3259 tweets in English, 3561/679/2854 tweets in Spanish for train/validation/test data re- spectively. languages. 3.2 Setup We implemented a model with 3-layer self- attention and 1-layer CNN. With the restriction of fixed-size GloVe vector, we found that 300- dimension hidden state is excessive for such a small dataset that we added a position-wise lin- ear layer between the embedding layer and self- attention layers to make de = 30. We employed h = 2 for multi-head attention and set df = 64. Two regularization techniques are applied to our system: Dropout with Pdrop = 0.1 for self- attention, and L2 regularization for all weight ma- trix but not bias. We added 0.001 times regulariza- tion loss to original loss function. We optimized the loss with Gradient Descent using Adam op- timization algorithm with additional learning rate decay. 3.3 Model variants We conduct experiments with following variants of our model. • AC: Self-attention + CNNs, which is our ba- sic system. • AC - attn: Basic system without self- attention module. • AC + nrc1: We mainly used NRC Emo- tion lexicon(Mohammad and Turney, 2013) to make word-level label of each sentence, counting the occurence of each emotion in the sentence. Each of the word-level label is concatenated to the output vector of each pooling layer. • AC + nrc2: At evaluation/test step, binarize the word-level label and add 0.4 times the la- bel value to the logit. • AC + synth: Inspired by (Sennrich et al., 2016), we made synthetic data using unla- beled SemEval-2018 AIT DISC data1 with 1https://www.dropbox.com/s/2phcvj300lcdnpl/SemEval2018- AIT-DISC.zip?dl=0 Figure 2: Inner architecture of self-attention module of parameter. M ultihead(Q, K, V ) = Concat(head1, ..., headh) (4) where headi = Attn(Qi, Ki, Vi) Q = [Q1, ..., Qh], Qi ∈ Rn× de K = [K1, ..., Kh], Ki ∈ Rn× de V = [V1, ..., Vh], Vi ∈ Rn× de h h h For each self-attention layer, there are additional position-wise feed-forward networks right after the attention submodule. F F N (x) = max(0, xW1 + b1)W2 + b2 where W1 ∈ Rde×df , W2 ∈ Rdf×de (5) (6) In addition to these two sub-layers, there is a residual connection around each sub-layer, fol- lowed by layer normalization. Also, we can stack self-attention layers by substituting the embedding vectors in (1) with the output of the last self- attention layer. Convolution & Pooling: Followed by self- attention layer are 11 independent 1-layer Convo- lution layers with max-pooling layers. Kim (2014) has proved that CNNs have lots of potential in sen- tence processing task and we adopt the CNNs in the same way. Output & Loss: Each output of CNNs go through a fully-connected layer to generate a logit. Sigmoid activation is applied to calculate the prob- ability of each emotion, and we use the sum of each class' cross-entropy as the final loss function. 3 Experiments & Results 3.1 Data For the SemEval 2018 shared task, Mohammad et al.(2018) has provided tweet data with multiple pre-trained model, and fine-tuned the model with synthetic data. 3.4 Experimental results We conduct several experiments to prove the ef- fectiveness of our model, each to verify the bene- fit from: (1) tweets specific preprocessing (2) self- attention representation (3) emotional lexicon uti- lization. Experimental results are mainly com- pared with English data. Impact of emoji-to-meaning 3.4.1 We firstly verify the efficiency of emoji-to- meaning preprocessing. Table 1 shows the accura- cies of the same model with different preprocess- ing. We found that emoji-to-meaning preprocess- ing can improve the model accuracy by 1%. When a emoji is converted to its meaning, it can be rep- resented as a combination of emotional words al- lowing it to not only reduce redundant vocabulary but also further emphasize the influence of certain emotions. Model AC (w/o) AC Accuracy(valid) Accuracy(test) 54.86% 55.94% 54.91% 55.90% Table 1: Experimental results with and without emoji- to-meaning preprocessing. Impact of self-attention 3.4.2 To examine the effectiveness of self-attention rep- resentation, we simply get rid of self-attention lay- ers. Table 2 shows that by removing the self- attention layers, both the validation/test accuracy dropped over 4%. This may be attributed to the ability of self-attention: It helps the model to bet- ter learn the long-range dependency of sentences. Learning long-range dependencies is a key chal- lenge in NLP tasks and self-attention module can shorten the length of paths forward and backward signals have to traverse in the network as described in (Vaswani et al., 2017). Model AC - attn AC Accuracy(valid) Accuracy(test) 51.04% 55.94% 51.60% 55.90% Table 2: Comparison between our basic system and ba- sic system without self-attention module. Impact of extra resources 3.4.3 Lack of data has crucial impact on model general- ization. Generalization techniques such as dropout or L2 regularization can relieve over-fitting prob- lem to a certain extent; however, it can't totally substitute the effect of rich data. So we apply some heuristic methods to exploit extra resources as described in 3.3. Table 2 shows that model can slightly benefit from extra lexicon if used prop- erly. However, adding synthetic data which is made from pre-trained model didn't help a lot, and in some cases even reduce the accuracy of the test result. Actually, Sennrich et al.(2016) emphasized that they used the monolingual sentences as the target sentences, informing that the target-side in- formation, which corresponds to label in our task, is not synthetic. However, we made synthetic la- bels with a pre-trained model and it may only cause over-fitting problem to the original training data. Model AC AC + nrc1 AC + nrc2 AC + synth Ensemble Accuracy(valid) Accuracy(test) 55.94% 56.13% 57.16% 55.88% 59.76% 55.90% 56.02% 56.40% 55.90% 57.40% Table 3: Experimental results with extra resources and an ensemble result 3.4.4 Ensemble Our best results are obtained with an ensem- ble of 9 parameter sets of AC + nrc2 model that differ in their random initializations. The ensemble model achieved validation/test accu- racy of 59.76%/57.40% in English data and 50.00%/46.90% in Spanish data respectively. 4 Conclusion In this paper, we proposed an attention-based sen- tence classifier that can classify a sentence into multiple emotions. Experimental results demon- strated that our system has effective structure for sentence understanding. Our system shallowly follows human's procedure of classifying sen- tences into multiple labels. However, some emo- tions may have some relatedness while our model treats them independently. In our future work, we would like to further take those latent relation among emotions into account. 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, pages 86–96. Martin Sundermeyer, Ralf Schluter, and Hermann Ney. 2010. Lstm neural networks for language modeling. Interspeech, pages 194–197. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. Annual Conference on Neural Informa- tion Processing Systems. Acknowledgments This work was supported by the National Research Foundation of Korea(NRF) funded by the Korea government(MSIT) (No. 2016M3C4A7952632), Industrial Strategic Technology Development Program(No. 10073144) funded by the Ministry of Trade, Industry & Energy(MOTIE, Korea) 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 Workshop. Steven Bird and Edward Loper. 2002. Nltk: the natu- ral language toolkit. In Proceedings of the ACL-02 Workshop on Effective tools and methodologies for teaching natural language processing and computa- tional linguistics. Misha Denil, Loris Bazzani, Hugo Larochelle, and Nando de Freitas. 2012. Learning where to attend with deep architectures for image tracking. Neural Computation. Sepp Hochreiter and Jrgen Schmidhuber. 1997. Neural computation, Long short-term memory. 9(8):1735–1780. Yoon Kim. 2014. Convolutional neural networks for sentence classification. In Proceedings of the 2014 Conference on Empirical Methods in Natural Lan- guage Processing, pages 1746–1751. Association for Computational Linguistics. Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg Cor- rado, and Jeff Dean. 2013. Distributed representa- tions of words and phrases and their composition- ality. Advances in Neural Information Processing Systems, 26:3111–3119. Saif Mohammad and Peter Turney. 2013. Crowdsourc- ing a word-emotion association lexicon. Computa- tional Intelligence, 29(3):436–465. Saif M. Mohammad, Felipe Bravo-Marquez, Mo- hammad Salameh, and Svetlana Kiritchenko. 2018. Semeval-2018 Task 1: Affect in tweets. In Proceed- ings of International Workshop on Semantic Evalu- ation (SemEval-2018), New Orleans, LA, USA. Jeffrey Pennington, Richard Socher, and Christopher D.Manning. 2014. Glove: Global vectors for word representation. In Proceedings of the Conference on Empirical Methods in Natural Language Process- ing. Bojanowski Piotr, Grave Edouard, Joulin Armand, and Mikolov Tomas. 2016. Enriching word vec- arXiv preprint tors with subword information. arXiv:1607.04606.
1806.07407
1
1806
2018-06-19T18:03:33
Speaker Adapted Beamforming for Multi-Channel Automatic Speech Recognition
[ "cs.CL", "cs.SD", "eess.AS" ]
This paper presents, in the context of multi-channel ASR, a method to adapt a mask based, statistically optimal beamforming approach to a speaker of interest. The beamforming vector of the statistically optimal beamformer is computed by utilizing speech and noise masks, which are estimated by a neural network. The proposed adaptation approach is based on the integration of the beamformer, which includes the mask estimation network, and the acoustic model of the ASR system. This allows for the propagation of the training error, from the acoustic modeling cost function, all the way through the beamforming operation and through the mask estimation network. By using the results of a first pass recognition and by keeping all other parameters fixed, the mask estimation network can therefore be fine tuned by retraining. Utterances of a speaker of interest can thus be used in a two pass approach, to optimize the beamforming for the speech characteristics of that specific speaker. It is shown that this approach improves the ASR performance of a state-of-the-art multi-channel ASR system on the CHiME-4 data. Furthermore the effect of the adaptation on the estimated speech masks is discussed.
cs.CL
cs
Speaker Adapted Beamforming for Multi-Channel Automatic Speech Recognition Tobias Menne, Ralf Schluter, Hermann Ney Human Language Technology and Pattern Recognition, Computer Science Department, RWTH Aachen University, Aachen, Germany {menne, schlueter, ney}@cs.rwth-aachen.de 8 1 0 2 n u J 9 1 ] L C . s c [ 1 v 7 0 4 7 0 . 6 0 8 1 : v i X r a Abstract This paper presents, in the context of multi-channel ASR, a method to adapt a mask based, statistically optimal beamform- ing approach to a speaker of interest. The beamforming vector of the statistically optimal beamformer is computed by utilizing speech and noise masks, which are estimated by a neural net- work. The proposed adaptation approach is based on the inte- gration of the beamformer, which includes the mask estimation network, and the acoustic model of the ASR system. This al- lows for the propagation of the training error, from the acoustic modeling cost function, all the way through the beamforming operation and through the mask estimation network. By using the results of a first pass recognition and by keeping all other parameters fixed, the mask estimation network can therefore be fine tuned by retraining. Utterances of a speaker of interest can thus be used in a two pass approach, to optimize the beamform- ing for the speech characteristics of that specific speaker. It is shown that this approach improves the ASR performance of a state-of-the-art multi-channel ASR system on the CHiME-4 data. Furthermore the effect of the adaptation on the estimated speech masks is discussed. Index Terms: robust ASR, multi-channel ASR, speaker adap- tation, acoustic beamforming, CHiME-4 1. Introduction The performance of automatic speech recognition (ASR) sys- tems has shown significant improvements over the last decade. Those have especially been driven by the utilization of deep learning techniques [1]. Nevertheless the performance of sys- tems dealing with realistic noisy and far-field scenarios is still significantly worse than the performance of close talking sys- tems on clean recordings [2, 3]. Multi-channel ASR systems are often used in those scenarios to improve recognition ro- bustness. In these systems the effect of noise, reverberation and speech overlap is mitigated by utilizing spatial information through beamforming [4]. Usually beamforming is done in a separate preprocessing step before applying the ASR system to the enhanced signal, which is obtained from the output of the preprocessing [5]. A general formulation for beamforming is the filter-and-sum ap- proach [6, 7], where the single channels are summed up after applying a separate linear filter to each one. Usually those filters are derived such that an objective criterion on the signal level, such as signal-to-noise ratio (SNR), is optimized. Popular ap- proaches are the delay and sum (DAS) [4], minimum variance distortionless response (MVDR) [8] and generalized eigenvalue (GEV) [9] beamforming methods. Most systems submitted to the CHiME and REVERB challenges [10, 11, 12] follow one or more of these approaches. The objective used to optimize the preprocessing thus dif- fers from the objective of the acoustic model training. Even before the introduction of deep neural network (DNN) hybrid systems in ASR, the optimization of the preprocessing towards the goal of speech recognition was proposed e.g. in [13]. The success of deep learning also motivated the integration of the beamforming operation into the acoustic model. E.g. in [14, 15] the filters of the filter-and-sum beamforming are es- timated by a neural network based on input features derived from the multi-channel input signal. Even learning the com- plete multi-channel preprocessing, starting from the raw time signal, has been shown to work [16, 17, 18]. The advantage of those approaches is, that the preprocessing is not optimized for a proxy measure like SNR at the output of the beamformer, but directly towards the criterion for acoustic model training. But thus far, a very large amount of training data is necessary to obtain satisfying performance with those approaches. Lately the performance of statistically optimal beamform- ers was improved by using neural networks to estimate speech and noise masks, which are then used to compute the beam- forming vectors [19, 20, 8]. This approach has worked well for many submissions to the 4th CHiME challenge [5, 21, 22]. One problem of that approach is the need for target masks in the mask estimator training, which usually requires stereo data (the noisy and its respective clean signal) to create the target masks for training. Since this type of data is much more difficult to collect than only the noisy data, training of the mask estimator is usually done on simulated signals, which can lead to a mis- match between training and test data. To solve this problem, the authors of [23] proposed to integrate the mask based, statis- tically optimal beamforming with the acoustic modeling of the ASR system. This enables the propagation of the training error all the way through the acoustic model and the mask estimator network in the preprocessing. Therefore the mask estimator can be trained based on the training criterion of the acoustic model training. In this paper, the approach of integrating the mask based, statistically optimal beamformer with the acoustic model is uti- lized to adapt the mask estimation to the speech characteristics of a speaker of interest in a two pass recognition approach. The rest of the paper is organized as follows. An overview of the integrated system is given in Section 2. Furthermore an alternative approach to [23] for the propagation of the gradients through the eigenvalue problem of the beamformer is presented. Section 3 describes the experimental setup of a state-of-the-art system for the CHiME-4 speech recognition task followed by the experimental results in Section 4. w(GEV) f ΦN N,f ΦXX,f λ(X) t,f λ(N ) t,f Where St,f ∈ C is an estimate of the speech component, ob- tained by applying the beamforming vector wf ∈ CM . (·)H denotes the Hermitian transpose. For this work we use the GEV beamformer with blind ana- lytic normalization (BAN), as described in [9] and which is also used in [23]. The beamforming vector of the GEV beamformer is derived by maximizing the a posteriori SNR: w(GEV) f = argmax wf wH wH f ΦXX,f wf f ΦN N,f wf (3) Where ΦXX,f and ΦN N,f are the spatial covariance matrices of speech and noise, respectively. This results in the generalized eigenvalue problem ΦXX,f W = ΦN N,f WΛ (4) w(OPT) f St,f Yt,f Figure 1: Overview of the integrated system. The grey blocks indicate modules with trainable parameters. 2. System overview The system used in this work integrates the acoustic beam- former, usually called front-end, with the acoustic model of the ASR system, usually called back-end, very similarly to the in- tegration described in [23]. Figure 1 gives an overview of the integrated system. Yt,f is the input in the short-time Fourier transform (STFT) domain, recorded from an array of M micro- phones. It consists of a speech component Xt,f and a noise component Nt,f : Yt,f = Xt,f + Nt,f (1) Where Yt,f , Xt,f , Nt,f ∈ CM , t is the time frame index and f is the frequency bin index. The main difference to the system introduced in [23] will be described in Section 2.3, whereas the acoustic beamformer and acoustic model are described in Sections 2.1 and 2.2, re- spectively. During a first pass decoding a hidden Markov model (HMM)-state sequence sT 1 is obtained for the input sig- nal YT,F 1,1 , where T and F are the number of time frames and frequency bins of the signal. Section 2.4 describes the utiliza- tion of the state sequence to adapt the acoustic beamformer to a certain speaker. f with w(GEV) eigenvalue. being the eigenvector corresponding to the largest The spatial covariance matrices Φνν,f for ν ∈ {X, N} t,f to the recorded multi- are computed by applying a mask λ(ν) channel signal Yt,f 1(cid:80)T t=1 λ(ν) t,f T(cid:88) t=1 Φνν,f = λ(ν) t,f Yt,f YH t,f (5) A mask estimating neural network is used to estimate λ(X) t,f and λ(N ) t,f . For both, speech and noise, one mask is estimated for every channel, λ(ν) t,f is then computed as the median mask, which contains the element-wise median of the channel depen- dent masks, as described e.g. in [19]. The BAN post-filter, as described in [9], is a frequency de- pendent scaling of the GEV beamforming vector, such that the final beamforming vector used here is: w(OPT) f = w(BAN) f · w(GEV) f (6) With w(BAN) f ∈ C being the scaling factor described in [9]. 2.2. Acoustic model The acoustic model is a bidirectional long short-term memory (BLSTM) hybrid model using log-mel filterbank features as in- put. Apart from the features, the training pipeline is the same as for the speaker independent model described in [5]. 2.3. Beamformer integration into acoustic model Training of the integrated system presented in Figure 1 is done according to standard error back propagation. The gradient computation for the propagation through the acoustic model, feature extraction, linear filtering of the beamformer, BAN and mask estimator network are straight forward. To propagate the gradient through the computation of the principal eigenvector of Φf = Φ −1 N N,f ΦXX,f (7) 2.1. GEV beamformer The main purpose of the front-end is to denoise the input signal. Here this is achieved by acoustic beamforming [6, 7]: St,f = wH f · Yt,f (2) as required for computing the beamforming vector w(GEV) ac- cording to Equation 4, the derivatives of the eigenvalue problem w.r.t. ΦN N,f and ΦXX,f are derived in [24] and used in [23]. In contrast, here the principal eigenvector of Equation 7 is approximated by applying the QR-algorithm as presented in [25]. A matrix Ak is decomposed by the QR-decomposition f Spatial covarianceMask estimatorMedian maskMagnitudeBeamform filteringMagnitudeFilterbankAcoustic modelQR-alg.BAN into a product of a unitary matrix Qk and an upper triangular matrix Rk: Ak = QkRk (8) With k being the iteration index, Ak+1 is then computed as Ak+1 = RkQk (9) eigenvalues of A0 and(cid:81)K It is shown in [25], that AK converges to an upper triangular matrix as K → ∞. The diagonal of AK then contains the k=0 Qk contains the respective eigen- vectors. This QR-algorithm is used here to approximate the principal eigenvector of Φf by setting A0 = Φf (10) The algorithmic differentiation of the QR decomposition is outlined in [26] and applied here in the error back propagation. 2.4. Speaker adaptation of mask estimator After a first pass recognition an optimal sequence of HMM states sT is obtained from the decoding process for each of t the evaluation segments of the speaker of interest. Those align- ments are then used as training targets for an adaptation training of the integrated system. Of the system shown in Figure 1, only the parameters of the mask estimator are adjusted in the adap- tation training. The parameters of the remaining pipeline are kept fixed, such that only the mask estimator network is tuned towards optimizing the cost function of the integrated system. Therefore the mask estimator and thus the computation of the beamforming vector are optimized for the speech characteristics of the speaker of interest. Even though this work is using the GEV beamformer with BAN, it is noteworthy that the proposed speaker adaptation method is equally applicable to the mask based MVDR beam- former that is presented in [20], by changing the initialization of A0 in Equation 10 and omitting the BAN. 3. Experimental setup The proposed speaker adaptation scheme for the acoustic beam- former is evaluated on the data of the CHiME-4 speech recogni- tion task [11]. The CHiME-4 dataset features real and simulated 16 kHz, multi-channel audio data recorded with a six channel microphone array arranged around a tablet device. Based on the 5k WSJ0-Corpus recordings and simulations have been done with four different kinds of real-world background noise. The training set contains approximately 18 h of data per channel recorded from 87 different speakers. Results are provided for the real development and real evaluation set of the 6-Channel track. Both sets contain audio of 4 speakers each, of which 2 are male and 2 are female, with no overlap between devel- opment and evaluation set. The amount of data per speaker is approximately 0.7 h in the development set and around 0.5 h in the evaluation set. The acoustic model used in the experiments is a BLSTM network, with 5 layers and 600 units per layer. Different to the system in [5], the input features are 80 dimensional log-mel filterbank features computed in the STFT domain employing a blackman window with a window size of 25 ms and a frame shift of 10 ms. The input features are unnormalized, but a linear layer with 80 units, employing batch normalization, was added as a first layer to the network. This results in a marginally bet- ter baseline system over the one described in [5]. The initial training of the acoustic model is done as described in [5], where at first alignments for the training set are computed on the data of the close talking microphone by using a Gaussian mixture model (GMM)-HMM trained only on the data of the close talk- ing microphones of the training set. Those alignments can then be used for all other channels, since the data is recorded sam- ple synchronized. The training of the BLSTM acoustic model is done by using the unprocessed audio data of the single chan- nels. This has been demonstrated to be beneficial in many sub- missions to the 3rd and 4th CHiME challenge e.g. in [27]. The mask estimator network used in the experiments is sim- ilar to the one described in [19]. It consists of a BLSTM layer with 256 units followed by two fully connected layers with 512 units and ReLU activations and another fully connected layer with 402 units and sigmoid activation. Thus the resolution of the estimated masks in frequency is lower than described in [19]. This is due to the adjustment of the dimensions of the masks to the discrete Fourier transform (DFT) size of the fea- ture extraction pipeline of the ASR system used here. The input of the mask estimation network is the magnitude spectrum of a single channel. The output of the network is the concatenation of the noise mask and the speech mask. During decoding the outputs of the different channels, of one utterance, are grouped and the median masks are calculated. Those are then applied to all channels to estimate the spatial covariance matrices as de- scribed in Section 2.1. The initial mask estimation network is trained on the simulated training data as described in [19]. In contrast to [19], only the provided baseline configuration of the simulation is used and no additional data augmentation is done. The number of iterations of the QR-algorithm described in Sec- tion 2.3 is fixed to 5. The decoding is done with the 5-gram language model pro- vided as a baseline language model with the CHiME-4 dataset. In a post processing step a recurrent neural network (RNN) language model lattice rescoring is done. The RNN language model is a 3 layer long short-term memory (LSTM) with high- way connections. Details about the language model and lattice rescoring can be found in [5]. In addition to the acoustic beamforming described in Sec- tion 2.1, the baseline beamforming algorithm of the CHiME-4 task (BFIT) is used to provide baseline results. Apart from the beamforming algorithm, the exact same pipeline as described above is used. The hyper-parameters for the speaker adaptation training such as the learning rate were tuned on the development set and applied to the evaluation set. 4. Experimental results 4.1. Baseline systems Table 1 shows an overview of the experimental results. It shows, that using the GEV front-end described in Section 2.1 yields an improvement of about 20 % - 30 % relative over the base- line system with the BFIT front-end. Joint training of the GEV front-end and acoustic model further improves the performance another 5 % relative. Those results are in line with the results reported in [23]. When comparing the mask output of the mask estimator before and after joint training only minor differences in the masks can be observed. This is in line with the suggestion of the authors of [23], that a majority of the performance in- crease stems from the adaptation of the acoustic model towards the specific front-end. Table 1: Average WER (%) for the described systems for differ- ent stages of the integrated training. System System id 0 1 2 3 Front- end BFIT GEV Joint training Speaker adapted - + - + Dev Eval 4.36 7.17 3.46 5.18 3.32 4.84 3.09 4.58 4.2. Speaker adapted beamforming Table 1 shows an overall improvement of WER after speaker adaptation and Table 2 shows that improved performance is ob- tained for the majority of the speakers with an improvement in WER of up to 11 % and 15 % relative for single speakers of the evaluation and development set, respectively. Figure 2 shows an example of the estimated speech mask before and after the speaker adaptation. It can be seen, that the speech mask after speaker adaptation shows a stronger emphasis on the fundamen- tal frequency and the harmonics. This can be seen repeatedly between the time marks of 2 s and 3 s. At time mark 4 s a pat- tern of fundamental frequency and harmonics can be seen in the mask after adaptation, which is not present in the mask before adaptation and which can also hardly be spotted in the input sig- nal or the clean signal. This could indicate an increased bias of the mask estimator towards this kind of pattern. Table 2: WER (%) of separate speakers for the jointly trained system and the speaker adapted system Dev Sys. id 2 3 F01 4.19 3.23 3.55 3.20 Eval F04 M03 M04 F05 2.77 2.48 3.07 3.14 F06 M05 M06 4.58 4.48 3.83 3.38 6.88 4.09 6.35 4.09 5. Conclusion This work describes a method for speaker adaptation of mask based beamforming in a multi-channel ASR system. The basis of the adaptation method is the integration of the statistically optimal beamforming with the acoustic model to allow the back propagation of the training errors through the complete system, which has been previously introduced in [23]. Here an alter- native solution for the back propagation of the errors through the computation of the beamforming vector, based on the QR- algorithm, is presented. The system is then used in a two pass approach to adapt the mask estimator to a speaker of interest during the decoding phase. It was shown that this adaptation method results in speech masks which show a stronger empha- sis on the fundamental frequency and harmonics of the speaker. Furthermore a relative ASR improvement, for single speakers of the real evaluation data of the CHiME-4 ASR task, of up to 11 % relative was shown. 6. Acknowledgements This project has received funding from the European Research Council (ERC) under the European Union's Horizon 2020 re- search and innovation program grant agreement No. 694537. This work has also been supported by Deutsche Forschungs- 2: of the Two snippet seconds signal Figure "F01 421C0210 BUS" of the development set starting at second 2 and showing the frequency range up to 3 kHz. a) log magnitude spectrum of the noisy signal recorded at channel 5 b) log magnitude spectrum of the signal recorded at the close talking microphone c) estimated speech mask of system 2 (jointly trained but before speaker adaptation) d) estimated speech mask of system 3 (after speaker adaptation) gemeinschaft (DFG) under contract No. Schl2043/1-1 and European Union's Horizon 2020 research and innovation pro- gram under the Marie Skłodowska-Curie grant agreement No. 644283. The work reflects only the authors' views and the European Research Council Executive Agency is not respon- sible for any use that may be made of the information it contains. The GPU cluster used for the experiments was partially funded by Deutsche Forschungsgemeinschaft (DFG) Grant INST 222/1168-1. 7. References [1] G. Hinton, L. Deng, D. Yu, G. E. Dahl, A.-r. Mohamed, J. Navdeep, A. Senior, V. Vanhoucke, P. Nguyen, T. N. Sainath, and B. Kingsbury, "Deep neural networks for acoustic model- ing in speech recognition," IEEE Signal Processing Magazine, vol. 29, no. 6, pp. 82–97, Nov 2012. [2] J. Li, L. Deng, Y. Gong, and R. Haeb-Umbach, "An overview of noise-robust automatic speech recognition," IEEE/ACM Transac- tions on Audio, Speech, and Language Processing, vol. 22, no. 4, pp. 745–777, Apr 2014. [3] M. Delcroix, T. Yoshioka, A. Ogawa, Y. Kubo, M. Fujimoto, N. Ito, K. Kinoshita, M. Espi, S. Araki, H. Takaaki, and T. Nakatani, "Strategies for distant speech recognitionin rever- berant environments," EURASIP Journal on Advances in Signal Processing, vol. 2015, no. 4, pp. 60–74, Jul 2015. [4] M. Brandstein and D. Ward, Microphone arrays: signal process- Springer Science & Business ing techniques and applications. Media, 2013. [5] T. Menne, J. Heymann, A. Alexandridis, K. Irie, A. Zeyer, M. Kitza, P. Golik, I. Kulikov, L. Drude, R. Schluter, H. Ney, R. Haeb-Umbach, and A. Mouchtaris, "The RWTH/UPB/FORTH system combination for the 4th CHiME challenge evaluation," in Proc. of the 4th Intl. Workshop on Speech Processing in Everyday Environments (CHiME 2016), San Francisco, CA, Sep. 2016, pp. 39–44. [6] E. Warsitz and R. Haeb-Umbach, "Acoustic filter-and-sum beam- forming by adaptive principal component analysis," in Proc. IEEE 234time in s0123frequency in kHza)432101234time in s0123frequency in kHzb)432101234time in s0123frequency in kHzc)0.00.20.40.60.81.0234time in s0123frequency in kHzd)0.00.20.40.60.81.0 [21] J. Heymann, L. Drude, and R. Haeb-Umbach, "Wide residual BLSTM network with discriminative speaker adaptation for ro- bust speech recognition," in Proc. of the 4th Intl. Workshop on Speech Processing in Everyday Environments (CHiME 2016), San Francisco, CA, Sep 2016, pp. 12–17. [22] J. Du, T. Yan-Hui, L. Sun, F. Ma, H.-K. Wang, J. Pan, C. Liu, J.- D. Chen, and C.-H. Lee, "The USTC-iflytek system for CHiME-4 challenge," in Proc. of the 4th Intl. Workshop on Speech Process- ing in Everyday Environments (CHiME 2016), San Francisco, CA, Sep. 2016, pp. 36–38. [23] J. Heymann, L. Durde, C. Boeddeker, P. Hanebrink, and R. Haeb- Umbach, "Beamnet: End-to-end training of a beamformer- supported multi-channel ASR system," in Proc. IEEE Interna- tional Conference on Acoustics, Speech and Signal Processing (ICASSP), New Orleans, LA, Mar. 2017, pp. 5325–5329. [24] C. Boeddeker, P. Hanebrink, L. Durde, J. Heymann, and R. Haeb- Umbach, "Optimizing neural-network supported acoustic beam- forming by algorithmic differentiation," in Proc. IEEE Interna- tional Conference on Acoustics, Speech and Signal Processing (ICASSP), New Orleans, LA, Mar. 2017, pp. 171–175. [25] J. G. Francis, "The QR transformation a unitary analogue to the LR transformation - part 1," The Computer Journal, vol. 4, no. 3, pp. 265–271, Jan 1961. [26] S. F. Walter, L. Lehmann, and R. Lamour, "On evaluating higher- order derivatives of the QR decomposition of tall matrices with full column rank in forward and reverse mode algorithmic differ- entiation," Optimization Methods and Software, vol. 27, no. 2, pp. 391–403, 2012. [27] T. Yoshioka, N. Ito, M. Delcroix, A. Ogawa, K. Kinoshita, M. Fu- jimoto, C. Yu, W. J. Fabian, M. Espi, T. Higuchi et al., "The NTT CHiME-3 system: Advances in speech enhancement and recogni- tion for mobile multi-microphone devices," in Proc. IEEE Auto- matic Speech Recognition and Understanding Workshop (ASRU), Scottsdale, AZ, Dec 2015, pp. 436–443. International Conference on Acoustics, Speech and Signal Pro- cessing (ICASSP), Philadelphia, PA, Mar 2005, pp. 797–800. [7] B. D. Van Veen and K. M. Buckley, "Beamforming: A versatile approach to spatial filtering," IEEE ASSP Magazine, vol. 5, no. 2, pp. 4–24, Apr 1988. [8] H. Erdogan, J. Hershey, S. Watanabe, M. Mandel, and J. Le Roux, "Improved MVDR beamforming using single-channel mask pre- diction networks," in Proc. Interspeech, San Francisco, CA, Sep 2016, pp. 1981–1985. [9] E. Warsitz and R. Haeb-Umach, "Blind acoustic beamformting based on generalized eigenvalue decomposition," IEEE Transac- tions on audio, speech, and language processing, vol. 15, pp. 1529–1539, Jun. 2007. [10] J. Barker, R. Marxer, E. Vincent, and S. Watanabe, "The third 'CHiME' speech separation and recognition challenge: Dataset, task and baselines," in IEEE Workshop on Automatic Speech Recognition and Understanding (ASRU), Scottsdale, AZ, Dec 2015, pp. 504–511. [11] E. Vincent, S. Watanabe, A. A. Nugraha, J. Barker, and R. Marxer, "An analysis of environment, microphone and data simulation mismatches in robust speech recognition," Computer Speech & Language, vol. 46, pp. 535–557, Nov 2017. [12] K. Kinoshita, M. Delcroix, T. Yoshioka, T. Nakatani, A. Sehr, W. Kellermann, and R. Maas, "The reverb challenge: Acommon evaluation framework for dereverberation and recognition of re- verberant speech," in IEEE Workshop on Applications of Signal Processing to Audio and Acoustics, New Paltz, NY, Oct. 2013, pp. 1–4. [13] M. L. Seltzer, B. Raj, and R. M. Stern, "Likelihood-maximizing beamforming for robust hands-free speech recognition," IEEE Transactions on speech and audio processing, vol. 12, no. 5, pp. 489–498, Sep 2004. [14] X. Xiao, S. Watanabe, H. Erdogan, L. Lu, J. Hershey, M. L. Seltzer, G. Chen, Y. Zhang, M. Mandel, and D. Yu, "Deep beam- forming networks for multi-channel speech recognition," in Proc. IEEE International Conference on Acoustics, Speech and Sig- nal Processing (ICASSP), Shanghai, China, Mar 2016, pp. 5745– 5749. [15] Z. Meng, S. Watanabe, J. R. Hershey, and H. Erdogan, "Deep long short-term memory adaptive beamforming networks for mul- tichannel robust speech recognition," in Proc. IEEE Interna- tional Conference on Acoustics, Speech and Signal Processing (ICASSP), New Orleans, LA, Mar 2017, pp. 271–275. [16] T. N. Sainath, R. J. Weiss, K. W. Wilson, A. Narayanan, M. Bac- chiani, and A. Senior, "Speaker location and microphone spacing invariant acoustic modeling from raw multichannel waveforms," in IEEE Workshop on Automatic Speech Recognition and Under- standing (ASRU), Scottsdale, AZ, Dec 2015, pp. 30–36. [17] T. N. Sainath, R. J. Weiss, K. W. Wilson, A. Narayanan, and M. Bacchiani, "Factored spatial and spectral multichannel raw waveform cldnns," in Proc. IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Shanghai, China, Mar 2016, pp. 5075–5079. [18] B. Li, T. N. Sainath, R. J. Weiss, K. W. Wilson, and M. Bacchiani, "Neural network adaptive beamforming for robust multichannel speech recognition," in Proc. Interspeech, San Francisco, CA, Sep 2016, pp. 1976–1980. [19] J. Heymann, L. Drude, A. Chinaev, and R. Haeb-Umbach, "BLSTM supported GEV beamformer front-end for the 3rd CHiME challenge," in Proc. IEEE Automatic Speech Recogni- tion and Understanding Workshop (ASRU), Scottsdale, AZ, Dec. 2015, pp. 444–451. [20] T. Higuchi, N. Ito, T. Yoshioka, and T. Nakatani, "Robust MVDR beamforming using time frequency masks for online offline ASR in noise," in Proc. IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Shanghai, China, Mar. 2016, pp. 5210–5214.
1508.06034
1
1508
2015-08-25T05:04:53
Better Summarization Evaluation with Word Embeddings for ROUGE
[ "cs.CL", "cs.IR" ]
ROUGE is a widely adopted, automatic evaluation measure for text summarization. While it has been shown to correlate well with human judgements, it is biased towards surface lexical similarities. This makes it unsuitable for the evaluation of abstractive summarization, or summaries with substantial paraphrasing. We study the effectiveness of word embeddings to overcome this disadvantage of ROUGE. Specifically, instead of measuring lexical overlaps, word embeddings are used to compute the semantic similarity of the words used in summaries instead. Our experimental results show that our proposal is able to achieve better correlations with human judgements when measured with the Spearman and Kendall rank coefficients.
cs.CL
cs
Better Summarization Evaluation with Word Embeddings for ROUGE Jun-Ping Ng Bloomberg L.P. New York, USA Viktoria Abrecht Bloomberg L.P. New York, USA [email protected] [email protected] 5 1 0 2 g u A 5 2 ] L C . s c [ 1 v 4 3 0 6 0 . 8 0 5 1 : v i X r a Abstract ROUGE is a widely adopted, automatic evaluation measure for text summariza- tion. While it has been shown to corre- late well with human judgements, it is bi- ased towards surface lexical similarities. This makes it unsuitable for the evalua- tion of abstractive summarization, or sum- maries with substantial paraphrasing. We study the effectiveness of word embed- dings to overcome this disadvantage of ROUGE. Specifically, instead of measur- ing lexical overlaps, word embeddings are used to compute the semantic similarity of the words used in summaries instead. Our experimental results show that our pro- posal is able to achieve better correlations with human judgements when measured with the Spearman and Kendall rank co- efficients. 1 Introduction Automatic text summarization is a rich field of re- search. For example, shared task evaluation work- shops for summarization were held for more than a decade in the Document Understanding Con- ference (DUC), and subsequently the Text Anal- ysis Conference (TAC). An important element of these shared tasks is the evaluation of participat- ing systems. Initially, manual evaluation was car- ried out, where human judges were tasked to as- sess the quality of automatically generated sum- maries. However in an effort to make evalua- tion more scaleable, the automatic ROUGE1 mea- sure (Lin, 2004b) was introduced in DUC-2004. ROUGE determines the quality of an automatic summary through comparing overlapping units such as n-grams, word sequences, and word pairs with human written summaries. 1Recall-Oriented Understudy of Gisting Evaluation ROUGE is not perfect however. Two problems with ROUGE are that 1) it favors lexical simi- larities between generated summaries and model summaries, which makes it unsuitable to evaluate abstractive summarization, or summaries with a significant amount of paraphrasing, and 2) it does not make any provision to cater for the readability or fluency of the generated summaries. automatic such as Summaries TAC in of Peers There has been on-going efforts summarization to im- evalua- prove on the Automatically tion measures, (AESOP) Evaluating (Dang and Owczarzak, 2009; task Owczarzak, 2010; Owczarzak and Dang, 2011). However, ROUGE remains as one of the most popular metric of choice, as it has repeatedly been shown to correlate very well with human judgements (Lin, 2004a; Over and Yen, 2004; Owczarzak and Dang, 2011). In this work, we describe our efforts to tackle the first problem of ROUGE that we have iden- tified above — its bias towards lexical similari- ties. We propose to do this by making use of word embeddings (Bengio et al., 2003). Word embed- dings refer to the mapping of words into a multi- dimensional vector space. We can construct the mapping, such that the distance between two word projections in the vector space corresponds to the semantic similarity between the two words. By in- corporating these word embeddings into ROUGE, we can overcome its bias towards lexical similar- ities and instead make comparisons based on the semantics of words sequences. We believe that this will result in better correlations with human assessments, and avoid situations where two word sequences share similar meanings, but get unfairly penalized by ROUGE due to differences in lexico- graphic representations. As an example, consider these two phrases: 1) It is raining heavily, and 2) It is pouring. If we are performing a lexical string match, as ROUGE does, there is nothing in common between the terms “raining”, “heavily”, and “pouring”. How- ever, these two phrases mean the same thing. If one of the phrases was part of a human written summary, while the other was output by an auto- matic summarization system, we want to be able to reward the automatic system accordingly. In our experiments, we show that word embed- dings indeed give us better correlations with hu- man judgements when measured with the Spear- man and Kendall rank coefficient. This is a signif- icant and exciting result. Beyond just improving the evaluation prowess of ROUGE, it has the po- tential to expand the applicability of ROUGE to abstractive summmarization as well. 2 Related Work as we have While ROUGE is widely-used, there is a significant body of noted earlier, work studying the evaluation of automatic text summarization systems. A good survey of many of these measures has been written by Steinberger and Jezek (2012). We will thus not at- tempt to go through every measure here, but rather highlight the more significant efforts in this area. Elements (Hovy et al., 2005) has also been used (BE) in the DUC/TAC shared task evaluations. It is an automatic method which evaluates the content completeness of a generated summary by breaking up sentences into smaller, more granular units of information (referred to as “Basic Elements”). ROUGE, Besides Basic The pyramid method originally proposed by staple in is another Passonneau et al. (2005) DUC/TAC. However is a semi-automated it method, where significant human intervention is required to identify units of information, called Summary Content Units (SCUs), and then to map content within generated summaries Recently however, an auto- to these SCUs. mated variant of this method has been pro- posed (Passonneau et al., 2013). In this variant, word embeddings are used, as we are proposing in this paper, to map text content within generated summaries to SCUs. However the SCUs still need to be manually identified, limiting this variant’s scalability and applicability. Many systems have also been proposed in the AESOP task in TAC from 2009 to 2011. the top system re- ported in Owczarzak and Dang (2011), AutoSum- For example, mENG (Giannakopoulos and Karkaletsis, 2009), is a graph-based system which scores summaries based on the similarity between the graph struc- tures of the generated summaries and model sum- maries. 3 Methodology Let us now describe our proposal to integrate word embeddings into ROUGE in greater detail. To start off, we will first describe the word embeddings that we intend to adopt. A word embedding is really a function W , where W : w → Rn, and w is a word or word sequence. For our purpose, we want W to map two words w1 and w2 such that their respective projections are closer to each other if the words are se- mantically similar, and further apart if they are not. Mikolov et al. (2013) describe one such vari- ant, called word2vec, which gives us this de- sired property2. We will thus be making use of word2vec. ROUGE-2, We will now explain how word embed- dings can be incorporated into ROUGE. There are several variants of ROUGE, of which and ROUGE-SU4 ROUGE-1, have often been used. This is because they have been found to correlate well with human (Lin, 2004a; Over and Yen, 2004; judgements Owczarzak and Dang, 2011). ROUGE-1 mea- sures the amount of unigram overlap between model summaries and automatic summaries, and ROUGE-2 measures the amount of bigram overlap. ROUGE-SU4 measures the amount of overlap of skip-bigrams, which are pairs of words in the same order as they appear in a sentence. In each of these variants, overlap is computed by matching the lexical form of the words within the target pieces of text. Formally, we can define this as a similarity function fR such that: fR(w1, w2) =(1, 0, if w1 = w2 otherwise (1) where w1 and w2 are the words (could be unigrams or n-grams) being compared. In our proposal3, which we will refer to as ROUGE-WE, we define a new similarity function 2The effectiveness of the learnt mapping is such that we can now compute analogies such as king − man + woman = queen. 3https://github.com/ng-j-p/rouge-we fW E such that: fW E(w1, w2) =(0, if v1or v2 are OOV v1 · v2, otherwise (2) where w1 and w2 are the words being compared, and vx = W (wx). OOV here means a situation where we encounter a word w that our word em- bedding function W returns no vector for. For the purpose of this work, we make use of a set of 3 million pre-trained vector mappings4 trained from part of Google’s news dataset (?) for W . Reducing OOV terms for n-grams. With our formulation for fW E, we are able to compute variants of ROUGE-WE that correspond to those of ROUGE, including ROUGE-WE-1, ROUGE- WE-2, and ROUGE-WE-SU4. However, despite the large number of vector mappings that we have, there will still be a large number of OOV terms in the case of ROUGE-WE-2 and ROUGE-WE-SU4, where the basic units of comparison are bigrams. To solve this problem, we can compose in- dividual word embeddings together. We follow the simple multiplicative approach described by Mitchell and Lapata (2008), where individual vec- tors of constituent tokens are multiplied together to produce the vector for a n-gram, i.e., W (w) = W (w1) × . . . × W (wn) (3) where w is a n-gram composed of individual word tokens, i.e., w = w1w2 . . . wn. Multiplication be- tween two vectors W (wi) = {vi1, . . . , vik} and W (wj) = {vj 1, . . . , vjk} in this case is defined as: {vi1 × vj 1, . . . , vik × vjk} (4) 4 Experiments 4.1 Dataset and Metrics For our experiments, we make use of the dataset used in AESOP (Owczarzak and Dang, 2011), and the corresponding correlation measures. For clarity, let us first describe the dataset used in the main TAC summarization task. The main summarization dataset consists of 44 topics, each of which is associated with a set of 10 docu- ments. There are also four human-curated model summaries for each of these topics. Each of the 51 participating systems generated a summary for each of these topics. These automatically gener- ated summaries, together with the human-curated The evaluation system’s scores are then tested to see how well they correlate with the human assess- ments. The correlation is evaluated with a set of three metrics, including 1) Pearson correlation (P), 2) Spearman rank coefficient (S), and 3) Kendall rank coefficient (K). 4.2 Results We evaluate three different variants of our proposal, ROUGE-WE-1, ROUGE-WE-2, and ROUGE-WE-SU4, against their corresponding variants of ROUGE (i.e., ROUGE-1, ROUGE-2, ROUGE-SU4). It is worth noting here that in AE- SOP in 2011, ROUGE-SU4 was shown to corre- late very well with human judgements, especially for pyramid and responsiveness, and out-performs most of the participating systems. Tables 1, 2, and 3 show the correlation of the scores produced by each variant of ROUGE-WE with human assessed scores for pyramid, respon- siveness, and readability respectively. The tables also show the correlations achieved by ROUGE-1, ROUGE-2, and ROUGE-SU4. The best result for each column has been bolded for readability. ROUGE-WE-1 is observed to correlate very well with the pyramid, responsiveness, and read- ability scores when measured with the Spear- man and Kendall rank correlation. However, ROUGE-SU4 correlates better with human assess- ments for the Pearson correlation. The key differ- ence between the Pearson correlation and Spear- man/Kendall rank correlation, is that the former assumes that the variables being tested are nor- mally distributed. It also further assumes that the model summaries, dataset for AESOP. then form the basis of the As reviewed in Section 2, this semi-automated measure described in To assess how effective an automatic evaluation system is, the system is first tasked to assign a score for each of the summaries generated by all of the 51 participating systems. Each of these sum- maries would also have been assessed by human judges using these three key metrics: Pyramid. is Passonneau et al. (2005). Responsiveness. Human judges are tasked to evaluate how well a summary adheres to the infor- mation requested, as well as the linguistic quality of the generated summary. Readability. Human judges give their judgement on how fluent and readable a summary is. a 4https://drive.google.com/file/d/0B7XkCwpI5KDYNlNUTTlSS21pQmM/edit?usp=sharing Measure ROUGE-WE-1 ROUGE-WE-2 ROUGE-WE-SU4 ROUGE-1 ROUGE-2 ROUGE-SU4 P 0.9492 0.9765 0.9783 0.9661 0.9606 0.9806 S 0.9138 0.8984 0.8808 0.9085 0.8943 0.8935 K 0.7534 0.7439 0.7198 0.7466 0.7450 0.7371 Measure ROUGE-WE-1 ROUGE-WE-2 ROUGE-WE-SU4 ROUGE-1 ROUGE-2 ROUGE-SU4 P 0.7846 0.7819 0.7931 0.7900 0.7524 0.7840 S 0.4312 0.4141 0.4068 0.3914 0.3975 0.3953 K 0.3216 0.3042 0.3020 0.2846 0.2925 0.2925 Table 1: Correlation with pyramid scores, mea- sured with Pearson r (P), Spearman ρ (S), and Kendall τ (K) coefficients. Table 3: Correlation with readability scores, mea- sured with Pearson r (P), Spearman ρ (S), and Kendall τ (K) coefficients. Measure ROUGE-WE-1 ROUGE-WE-2 ROUGE-WE-SU4 ROUGE-1 ROUGE-2 ROUGE-SU4 P 0.9155 0.9534 0.9538 0.9349 0.9416 0.9545 S 0.8192 0.7974 0.7872 0.8182 0.7897 0.7902 K 0.6308 0.6149 0.5969 0.6334 0.6096 0.6017 Table 2: Correlation with responsiveness scores, measured with Pearson r (P), Spearman ρ (S), and Kendall τ (K) coefficients. variables are linearly related to each other. The lat- ter two measures are however non-parametric and make no assumptions about the distribution of the variables being tested. We argue that the assump- tions made by the Pearson correlation may be too constraining, given that any two independent eval- uation systems may not exhibit linearity. Looking at the two bigram based variants, ROUGE-WE-2 and ROUGE-WE-SU4, we ob- serve that ROUGE-WE-2 improves on ROUGE-2 most of the time, regardless of the correlation met- ric used. This lends further support to our proposal to use word embeddings with ROUGE. However ROUGE-WE-SU4 is only better than ROUGE-SU4 when evaluating readability. It does consistently worse than ROUGE-SU4 for pyramid and responsiveness. The reason for this is likely due to how we have chosen to compose unigram word vectors into bigram equivalents. The mul- tiplicative approach that we have taken worked better for ROUGE-WE-2 which looks at contigu- ous bigrams. These are easier to interpret seman- tically than skip-bigrams (the target of ROUGE- WE-SU4). The latter, by nature of their construc- tion, loses some of the semantic meaning attached to each word, and thus may not be as amenable to the linear composition of word vectors. Owczarzak and Dang (2011) reports only the results of the top systems in AESOP in terms of Pearson’s correlation. To get a more com- plete picture of the usefulness of our proposal, it will be instructive to also compare it against the other top systems in AESOP, when mea- sured with the Spearman/Kendall correlations. We show in Table 4 the top three systems which correlate best with the pyramid score when measured with the Spearman rank coefficient. C S IIITH3 (Kumar et al., 2011) is a graph- based system which assess summaries based on differences in word co-locations between gener- ated summaries and model summaries. BE-HM (baseline by the organizers of the AESOP task) is the BE system (Hovy et al., 2005), where ba- sic elements are identified using a head-modifier criterion on parse results from Minipar. Lastly, catolicasc1 (de Oliveira, 2011) is also a graph-based system which frames the summary evaluation problem as a maximum bipartite graph matching problem. Measure ROUGE-WE-1 C S IIITH3 BE-HM catolicasc1 S 0.9138 0.9033 0.9030 0.9017 K 0.7534 0.7582 0.7456 0.7351 Table 4: Correlation with pyramid scores of top systems in AESOP 2011, measured with the Spearman ρ (S), and Kendall τ (K) coefficients. We see that ROUGE-WE-1 displays better cor- relations with pyramid scores than the top system in AESOP 2011 (i.e., C S IIITH3) when mea- sured with the Spearman coefficient. The latter does slightly better however for the Kendall coef- ficient. This observation further validates that our proposal is an effective enhancement to ROUGE. References 5 Conclusion We proposed an enhancement to the popu- lar ROUGE metric in this work, ROUGE-WE. ROUGE is biased towards identifying lexical sim- ilarity when assessing the quality of a generated summary. We improve on this by incorporat- ing the use of word embeddings. This enhance- ment allows us to go beyond surface lexicographic matches, and capture instead the semantic similar- ities between words used in a generated summary and a human-written model summary. Experi- menting on the TAC AESOP dataset, we show that this proposal exhibits very good correlations with human assessments, measured with the Spear- man and Kendall rank coefficients. In particular, ROUGE-WE-1 outperforms leading state-of-the- art systems consistently. Looking ahead, we want to continue building on this work. One area to improve on is the use of a more inclusive evaluation dataset. The AESOP summaries that we have used in our ex- periments are drawn from systems participating in the TAC summarization task, where there is a strong exhibited bias towards extractive summa- rizers. It will be helpful to enlarge this set of sum- maries to include output from summarizers which carry out substantial paraphrasing (Li et al., 2013; Ng et al., 2014; Liu et al., 2015). Another immediate goal is to study the use of better compositional embedding models. The generalization of unigram word embeddings into bigrams (or phrases), is still an open prob- lem (Yin and Schutze, 2014; Yu et al., 2014). A better compositional embedding model than the one that we adopted in this work should help us improve the results achieved by bigram variants of ROUGE-WE, especially ROUGE-WE-SU4. This is important because earlier works have demon- strated the value of using skip-bigrams for sum- marization evaluation. An effective and accurate automatic evaluation measure will be a big boon to our quest for bet- ter text summarization systems. Word embeddings add a promising dimension to summarization eval- uation, and we hope to expand on the work we have shared to further realize its potential. [Bengio et al.2003] Yoshua Bengio, R´ejean Ducharme, Pascal Vincent, and Christian Janvin. 2003. A Neu- ral Probabilistic Language Model. The Journal of Machine Learning Research, 3:1137–1155. [Dang and Owczarzak2009] Hoa Trang Dang and Karolina Owczarzak. 2009. Overview of the TAC 2009 Summarization Track. In Proceedings of the Text Analysis Conference (TAC). [de Oliveira2011] Paulo C. F. de Oliveira. 2011. CatolicaSC at TAC 2011. In Proceedings of the Text Analysis Conference (TAC). Gi- [Giannakopoulos and Karkaletsis2009] George annakopoulos and Vangelis Karkaletsis. 2009. AutoSummENG and MeMoG in Evaluating Guided Summaries. In Proceedings of the Text Analysis Conference (TAC). [Hovy et al.2005] Eduard Hovy, Chin-Yew Lin, and Liang Zhou. 2005. Evaluating DUC 2005 using Basic Elements. In Proceedings of the Document Understanding Conference (DUC). [Kumar et al.2011] Niraj Kumar, Kannan Srinathan, and Vasudeva Varma. 2011. Using Unsupervised System with Least Linguistic Features for TAC- AESOP Task. In Proceedings of the Text Analysis Conference (TAC). [Li et al.2013] Chen Li, Fei Liu, Fuliang Weng, and Yang Liu. 2013. Document Summarization via Guided Sentence Compression. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 490–500. [Lin2004a] Chin-Yew Lin. 2004a. Looking for a Few Good Metrics: ROUGE and its Evaluation. In Work- ing Notes of the 4th NTCIR Workshop Meeting. [Lin2004b] Chin-Yew Lin. 2004b. ROUGE: A Pack- age for Automatic Evaluation of Summaries. In Text Summarization Branches Out: Proceedings of the ACL-04 Workshop. [Liu et al.2015] Fei Liu, Jeffrey Flanigan, Sam Thom- son, Norman Sadeh, and Noah A. Smith. 2015. Toward Abstractive Summarization Using Semantic Representations. In Proceedings of the Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), pages 1077–1086. [Mikolov et al.2013] Tomas Mikolov, Wen-tau Yih, and Geoffrey Zweig. 2013. Linguistic Regularities in Continuous Space Word Representations. In Pro- ceedings of the Conference of the North American Chapter of the Association for Computational Lin- guistics: Human Language Technologies (NAACL- HLT), pages 746–751. [Mitchell and Lapata2008] Jeff Mitchell and Mirella 2008. Vector-based Models of Seman- Lapata. tic Composition. In Proceedings of the 46th An- nual Meeting of the Association for Computational Linguistics: Human Language Technologies (ACL), pages 236–244. [Ng et al.2014] Jun-Ping Ng, Yan Chen, Min-Yen Kan, and Zhoujun Li. 2014. Exploiting Timelines to Enhance Multi-document Summarization. In Pro- ceedings of the 52nd Annual Meeting of the Asso- ciation for Computational Linguistics (ACL), pages 923–933. [Over and Yen2004] Paul Over and James Yen. 2004. An Introduction to DUC 2004 Intrinsic Evaluation of Generic New Text Summarization Systems. In Proceedings of the Document Understanding Con- ference (DUC). [Owczarzak and Dang2011] Karolina Owczarzak and Hoa Trang Dang. 2011. Overview of the TAC 2011 Summarization Track: Guided Task and AE- SOP Task. In Proceedings of the Text Analysis Con- ference (TAC). [Owczarzak2010] Karolina Owczarzak. 2010. Overview of the TAC 2010 Summarization Track. In Proceedings of the Text Analysis Conference (TAC). [Passonneau et al.2005] Rebecca J Passonneau, Ani Nenkova, Kathleen McKeown, and Sergey Sigel- man. 2005. Applying the Pyramid Method in DUC 2005. In Proceedings of the Document Understand- ing Conference (DUC). [Passonneau et al.2013] Rebecca J Passonneau, Emily Chen, Weiwei Guo, and Dolores Perin. 2013. Auto- mated Pyramid Scoring of Summaries using Distri- butional Semantics. In Proceedings of the 51st An- nual Meeting of the Association for Computational Linguistics (ACL), pages 143–147. [Steinberger and Jezek2012] Josef and Karel Jezek. Evaluation Measures for Text Summarization. Computing and Informatics, 28(2):251–275. 2012. Steinberger [Yin and Schutze2014] Wenpeng Yin and Hinrich Schutze. 2014. An Exploration of Embeddings for Generalized Phrases. In Proceedings of the ACL 2014 Student Research Workshop, pages 41–47. [Yu et al.2014] Mo Yu, Matthew Gormley, and Mark Dredze. 2014. Factor-based Compositional Embed- ding Models. In Proceedings of the NIPS 2014 Deep Learning and Representation Learning Workshop.
1904.00788
2
1904
2019-12-12T07:46:43
Neural Abstractive Text Summarization and Fake News Detection
[ "cs.CL", "cs.LG", "stat.ML" ]
In this work, we study abstractive text summarization by exploring different models such as LSTM-encoder-decoder with attention, pointer-generator networks, coverage mechanisms, and transformers. Upon extensive and careful hyperparameter tuning we compare the proposed architectures against each other for the abstractive text summarization task. Finally, as an extension of our work, we apply our text summarization model as a feature extractor for a fake news detection task where the news articles prior to classification will be summarized and the results are compared against the classification using only the original news text. keywords: LSTM, encoder-deconder, abstractive text summarization, pointer-generator, coverage mechanism, transformers, fake news detection
cs.CL
cs
Neural Abstractive Text Summarization and Fake News Detection Soheil Esmaeilzadeh [email protected] Stanford University, CA Gao Xian Peh [email protected] Stanford University, CA Angela Xu [email protected] Stanford University, CA Abstract In this work, we study abstractive text summarization by exploring different models such as LSTM-encoder-decoder with attention, pointer-generator networks, cover- age mechanisms, and transformers. Upon extensive and careful hyperparameter tuning we compare the proposed architectures against each other for the abstractive text summarization task. Finally, as an extension of our work, we apply our text summarization model as a feature extractor for a fake news detection task where the news articles prior to classification will be summarized and the results are compared against the classification using only the original news text. keywords: LSTM, encoder-deconder, abstractive text summarization, pointer- generator, coverage mechanism, transformers, fake news detection 1 Introduction Pattern recognition and data understanding has been the topic of research in multiple deep learning tasks such computer vision and natural language processing [1 -- 5]. In the natural language processing area, understanding the content and main idea of a text and summarizing a corpus is of great importance. In simple words, text summarization is the task of creating a summary for a large piece of text. Generating meaningful summaries of long texts is of great importance in many different areas such as medical, educational, media, social, and etc., where the summary needs to contain the main contextual aspects of the text while reducing the amount of unnecessary information. In general, text summarization can be classified into two main groups: extractive summarization and abstractive summarization [6]. Extractive summarization creates summaries by synthesizing salient phrases from the full text verbatim [7, 8], however, abstractive summarization creates an internal semantic representation of the text. Unlike extractive summarization which concatenates sentences taken explicitly from the source text, abstractive text summarization paraphrases the text in a way that it is closer to the human's style of summarization and this makes abstractive text summarization a challenging yet preferable approach [9, 10]. Decent quality summaries using abstractive approaches were only obtained in the past few years by applying the sequence-to-sequence endoder-decoder architectures with attention mechanisms common in machine translation tasks to summarization [11, 12] however only focused on short input texts. Subsequent works attempted to perform the abstractive summarization task on longer input texts, however, appearance of unknown words and repetitions adversely affected the outcome of the summarization tasks [13]. In this work, we focus on abstractive text summarization as a more robust approach compared to its counterpart (i.e. extractive summarization) and explore recent advancements in the state-of-the-art natural language models for abstractive text summarization. The input of our natural language model is a single document or article and the output of it is a combination of a few sentences that summarize the content of the input document in a meaningful manner. In addition to the main goal of this work, after exploring the natural language models for abstractive text summarization, we use the summarization model as a feature building module for fake news detection and news headline generation, and show the effect of summarization on fake news detection. Preprint. Work in progress. 2 Approaches Figure 1: Baseline sequence-to-sequence model's architecture with attention [14] 2.1 Baseline Model In this work, as the baseline model we consider an LSTM Encoder-Decoder architecture with attention as shown in Figure 1. Sequence-to-Sequence Encoder-Decoder: The sequence-to-sequence framework consists of a Recurrent Neural Network (RNN) encoder and an RNN decoder. The RNN encoder as a single-layer bidirectional Long-short-term-memory (LSTM) unit reads in the input sequence token by token and produces a sequence of encoder's hidden states hi that encode or represent the input. The RNN decoder as a single-layer unidirectional LSTM generates the decoder's hidden states st one by one which produces the output sequence as the summary. Attention Mechanism: In the attention mechanism, an attention distribution at is calculated as a probability distribution over the words in the source text that helps the decoder decide which source words to concentrate on when it generates the next word. The attention distribution at is calculated for each decoder timestep t as: at = softmax(et), i = vT tanh(Whhi + W st + battn), et (1a) (1b) where v, Wh, Ws, battn are learnable parameters. On each decoder's step, attention weights at i, which are part of the at distribution for the source words are computed. An attention weight represents the amount of attention that should be paid to a certain source word in order to generate an output word (decoder state) in the decoder. The attention distribution is used to compute a weighted sum of the encoder hidden states, known as the context vector h∗ t , which represents what has been read from the source for this step, and can be calculated as: h∗ t = (cid:88) at ihi . (2) i The context vector along with the decoder's state are then used to calculate the vocabulary distribution Pvocab, which provides a final distribution for predicting words w as: (3a) (3b) where V , V (cid:48), b, and b(cid:48) are learnable parameters. Subsequently, we calculate the loss for the timestep t as the negative log-likelihood of the target word w∗ Pvocab = softmax(V (cid:48)(V [st, h∗ P(w) = Pvocab(w), t ] + b) + b(cid:48)), The overall loss for the whole sequence is the average of the loss at each time step (i.e. losst) as: (4) (5) t as: losst = − log P(w∗ t ) . loss = 1 T losst . T(cid:88) t=0 2 Baseline Model's Problems: Some problems are associated with the baseline model proposed in section 2.1. One problem is the model's tendency to reproduce factual details inaccurately, this happens specially when an uncommon word that exists in the vocabulary is replaced with a more common word. Another problem with the baseline model is that during summary generation it repeats the already generated parts of the summary. Lastly, the baseline is unable to handle out-of-vocabulary words (OOV). In general, it is hard for the sequence-to-sequence-with-attention model to copy source words as well as to retain longer-term information in the decoder state, which leads to the aforementioned issues. See [14] proposed a so called pointer-generator network that also includes a coverage mechanism in order to address these problems by combining both context extraction (pointing) and context abstraction (generating). We revisit the model proposed by See [14] in the following and as well compare it with a transformer based model proposed by [15] for machine translation tasks, and finally use it as a feature generation mechanism for fake news classification. 2.2 Pointer-Generator Network Figure 2: Pointer-generator model's architecture [14] Pointer-Generator Mechanism: Pointer-generator is a hybrid network that chooses during training and test whether to copy words from the source via pointing or to generate words from a fixed vocabulary set. Figure 2 shows the architecture for the pointer-generator mechanism where the decoder part is modified compared to Figure 1. In Figure 1, the baseline model, only an attention distribution and a vocabulary distribution are calculated. However, here in the pointer-generator network a generation probability pgen, which is a scalar value between 0 and 1 is also calculated which represents the probability of generating a word from the vocabulary, versus copying a word from the source text. The generation probability pgen weights and combines the vocabulary distribution Pvocab (used for generating) and the attention distribution a (used for pointing to source words ωi) into the final distribution Pfinal as: (cid:88) Pfinal(w) = pgenPvocab(w) + (1 − pgen) ai . (6) i:wi=w Based on Equation (6), the probability of producing word ω is equal to the probability of generating it from the vocabulary multiplied by the generation probability plus the probability of pointing to it anywhere it appears in the source text multiplied by the copying probability. Compared to the LSTM Encoder-Decoder model with attention as baseline in section 2.1, the pointer-generator network makes it easy to copy words from the source text by putting sufficiently large attention on the relevant word. It also is able to copy out-of-vocabulary words from the source text, enabling the model to handle unseen words while allowing to use a smaller vocabulary, leading to less computation and storage space. The pointer-generator model is also faster to train, as it requires fewer training iterations to achieve the same performance as the baseline model in section 2.1. 3 (a) (b) Figure 3: (a). The Transformer - model architecture, (b). (left) Scaled Dot-Product Attention. (right) Multi-Head Attention consists of several attention layers running in parallel - [15] Coverage Mechanism: To reduce the repetition during summarization as a common issue with sequence-to-sequence models mentioned in section 2.1, we apply the coverage mechanism, first proposed by [16] and adapted by [14]. The coverage mechanism keeps track of a coverage vector, computed as the sum of attention distributions over previous decoder time steps. This coverage vector is incorporated into the attention mechanism and represents the degree of coverage that words in the source text have received from the attention mechanism so far. Thus, by maintaining this coverage vector, which represents a cumulative attention, the model avoids attending to any word that has already been covered and used for summarization. On each timestep t of the decoder, the coverage vector ct is the sum of all the attention distributions at(cid:48) so far as: ct = at(cid:48) . (7) This coverage vector also contributes to computing the attention mechanism described in the previous section, so that Equation (1a) becomes: t(cid:48)=0 i = vT tanh(Whhi + W st + wcct et (8) Intuitively, this informs the attention mechanism's current timestep about the previous attention information which is captured in ct, thus preventing repeated attention to the same source words. To further discourage repetition, See [14] penalizes repeatedly attending to the same parts of the source text by defining a coverage loss and adding it to the primary loss function in Equation (4). This extra coverage loss term penalizes any overlap between the coverage vector ct and the new attention distribution at as: i + battn) . covlosst = min(at i, ct i) . (9) t−1(cid:88) (cid:88) i (cid:80)T Finally the total loss becomes: loss = 1 T we have consulted the Gihub repositories referenced at the end of this report. t=0(losst + covlosst). For the aforementioned models 2.3 Transformers In this part, we revisit the transformers network proposed by Vaswani [15] for machine translation, and investigate its performance on abstractive text summarization on our dataset. In the transformer 4 model, the encoder maps an input sequence of symbol representations as x = (x1, ..., xn) to a sequence of continuous representations as z = (z1, ..., zn). Given z, the decoder then generates an output sequence as y = (y1, ..., yn) of symbols one element at a time. At each step the model is auto-regressive, consuming the previously generated symbols as additional input when generating the next. The Transformer follows this overall architecture using stacked self-attention and point-wise fully connected layers for both the encoder and decoder, shown in the left and right halves of Figure 3, respectively. The encoder part of this architecture is mainly a stack of some identical layers where each one has two sublayers. The first is a multi-head self-attention mechanism, and the second is a simple, position wise fully connected feed-forward network. The decoder is also composed of a stack of identical layers. In addition to the two sub-layers in each encoder layer, the decoder inserts a third sub-layer, which performs multi-head attention over the output of the encoder stack. In the transformer architecture a variation of attention mechanism called Scaled Dot-Product Attention is used where the input consists of queries and keys of dimension dk, and values of dimension dv. The dot products of the query with all keys is calculated, then divided by dk, the result goes through a softmax function to obtain the weights on the values. In practice the attention function is computed on a set of queries simultaneously, packed together into a matrix Q. The keys and values are also packed together into matrices K and V , where the matrix of output can be calculated as: √ Attention(Q, K, V ) = softmax( QK T√ dk )V . (10) In the proposed transformer model by [15] instead of performing a single attention function they linearly project the queries, keys, and values different times with different learned linear projections and that way they build a multi-head attention. On each of the projected versions of queries, keys, and values they then perform the attention function in parallel, yielding multi-dimensional output values which are concatenated and once again projected (Figure 3b). For the transformer model we have consulted the Gihub repositories referenced at the end of this report. 3 Experiments 3.1 Dataset Overview & Preprocessing To train our summarization models, we use the CNN-Dailymail dataset, a collection of news articles and interviews that have been published on the two popular news websites CNN.com and Daily- mail.com. Like the common styles on newspapers and journals, each article contains 3-4 highlighted sections that together form the summary of the whole article. The raw dataset includes the text contents of web-pages saved in separate HTML files [17, 18]. We use the CNN and Dailymail dataset provided by DeepMind. Our dataset is split in 92%, 4.2%, 3.8% between training, dev, and test set respectively leading to 287,200 training pairs, 13,360 validation pairs, and 11,400 test pairs. There is an average of 781 tokens per news article. Each reference summary contains 3.75 sentences and 56 tokens on average. We preprocess the dataset and convert the characters all to lower case. We use the Stanford CoreNLP library to tokenize the input articles and their corresponding reference summaries and to add para- graph and sentence start and end markers as < p >, < /p > and < s >, < /s > respectively. In addition, we have tried limiting our vocabulary size to 150k and 50k. 3.2 Evaluation Metric We evaluate our models with the standard ROUGE (Recall-Oriented Understudy for Gisting Evalu- ation) score, a measure of the amount of overlap between the system-generated and the reference summaries ([19]). We report the F1, precision, and recall scores for ROUGE-1, ROUGE-2, and ROUGE-L, which measure respectively the word-overlap, bigram-overlap, and longest common sequence between the system-generated and reference summaries. The ROUGE recall and precision for summarization task can be calculated as: ROUGE recall = ROUGE precision = number of overlapping words total words in reference summary number of overlapping words total words in system summary , , (11a) (11b) 5 where the system summary refers to the summary generated by a summarization model. Using precision, it's possible to measure essentially how much of the system summary was in fact relevant or needed, and using recall ROUGE it's possible to measure how much of the reference summary is the summarization model generating. In terms of measuring the overlapping words in Equations (11a) and (11b), considering the overlap of unigrams, or bigrams, or longest common sequence leads to ROUGE-1, ROUGE-2, and ROUGE-L scores respectively for precision and recall. 3.3 Experimental Details & Results and Analysis Text Summarization In this work, we investigate the performance of the summarization models presented in section 2 namely: (1). LSTM encoder-decoder with only attention mechanism (baseline), (2). LSTM encoder-decoder with attention and pointer-generator mechanisms, (3). LSTM encoder-decoder with attention, pointer-generator, and coverage mechanisms, and (4). transformers. Table 1 shows the ROUGE-1, ROUGE-2, and ROUGE-L scores for the four different models that have been trained on the summarization dataset. We have trained the models upon hyperparameter tuning using Adagrad optimizer for 340 iterations (19 epochs). Our training results outperform the similar ones presented by [14] for cases [1] and [2], and are very close in case [3]. Model [1] [2] [3] [4] F1 35.68 38.47 38.97 36.55 1 Precision Recall 31.95 36.98 38.21 34.50 44.07 43.02 42.71 43.33 F1 14.21 16.33 16.81 15.21 ROUGE 2 Precision Recall 12.87 15.94 16.22 13.89 17.66 18.68 18.12 17.92 L Precision Recall 29.67 33.99 35.04 31.54 41.02 39.60 38.63 40.38 F1 30.56 33.37 35.41 31.19 Table 1: [1]. LSTM encoder-decoder with only attention mechanism (baseline), [2]. LSTM encoder- decoder with attention and pointer-generator mechanisms, [3]. LSTM encoder-decoder with attention, pointer-generator, and coverage mechanisms, and [4]. transformers Figure 4: Validation and training loss values v.s. the number of iterations for summarization models Figure 4 shows the loss on the training set and validation set for as a function of number of iterations for the summarization models for 340,000 iterations (19 epochs). The results of summarization are compared for one case v.s. its ground truth for the three summarization models in Table 2. As it can be seen the summary generated by model [1] contains < unk > instead of the word mysak in the original summary. However, due to having attention and the pointer-generator mechanism model [2] has replaced the < unk > with the proper word from the source text. However, summary of model [2] has repeated a sentence twice. The summary generated by the pointer-generator together with the coverage mechanism not only could have overcome the < unk > problem but also does not have repetition in the generated summary and gives a nice summary pretty close to the reference summary. 6 100k200k300k400kIterations02.557.510LossValue[1]-Val.[1]-Train[2]-Val.[2]-Train[3]-Val.[3]-Train Reference Model [1] Model [2] Model [3] Model [4] once a super typhoon , maysak is now a tropical storm with 70 mph winds . it could still cause flooding , landslides and other problems in the philippines . [UNK] gained super typhoon status thanks to its sustained 150 mph winds. it 's now classified as a tropical storm. it 's expected to make landfall sunday on the southeastern coast of [UNK] province . tropical storm maysak approached the asian island nation saturday . it's now classified as a tropical storm , according to the philippine national weather service . it's now classified as a tropical storm , according to the philippine weather service . just a few days ago , maysak gained super typhoon status thanks to its sustained 150 mph winds . it 's now classified as a tropical storm , according to the philippine national weather service . super typhoon could weaken . new jersey , but it will . philippine ocean strength . at least 132 people are injured , including 18 . Table 2: Comparison of the generated summary using the summarization models v.s. the ground truth The summary generated by the transformer model can only capture some keywords but does not convey the grasp of summary very well. Fake News Detection Subsequent to Summarization In this part, we use the best summarization model that we have trained on the summarization dataset in order to create summaries of a fake news detection dataset. We will build a fake news detection model and we investigate its performance when the input is the original news text, the news headline, and the summarized news text generated by our summarization model. Basically, We use our text summarizing model as a feature generator for a fake news classification model. In fake news classification the article content contains much more information than the article headline and due to this a fake news classifier performs better on article contents than on article headlines. Figure 5: Fake news classification architecture (a) Full body text (b) Headline text (c) Summary text Figure 6: Confusion matrix for test set of fake news detection task using three different input features 7 Input SequenceEmbeddigLayerRecurrentLayersDropoutSoftmaxLayerClassification'sOutput001True Label1Predicted Label1400120010008006004001009934049144001True Label1Predicted Label1400120010008006004001001064714213 Input features Exp. # train loss train acc. % valid loss Full body text Headline text Summary text 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 Cells LSTM LSTM LSTM LSTM Size Drop-out 64 64 128 128 Bi-LSTM 64 Bi-LSTM 64 Bi-LSTM 128 Bi-LSTM 128 64 64 128 128 Bi-LSTM 64 Bi-LSTM 64 Bi-LSTM 128 Bi-LSTM 128 64 64 128 128 Bi-LSTM 64 Bi-LSTM 64 Bi-LSTM 128 Bi-LSTM 128 Table 3: Experiments on the fake news detection 0.081 0.143 0.076 0.141 0.025 0.08 0.026 0.0741 0.121 0.157 0.099 0.156 0.103 0.154 0.106 0.158 0.074 0.146 0.083 0.139 0.078 0.152 0.079 0.146 97.4 93.7 97.2 94.5 99.1 97.1 99.2 97.3 95.3 93.2 95.9 93.6 95.6 93.5 95.7 93.5 97.3 94.5 97 94.6 97.1 94.1 97.1 94.5 0.2 0.5 0.2 0.5 0.2 0.5 0.2 0.5 0.2 0.5 0.2 0.5 0.2 0.5 0.2 0.5 0.2 0.5 0.2 0.5 0.2 0.5 0.2 0.5 LSTM LSTM LSTM LSTM LSTM LSTM LSTM LSTM 0.12 0.167 0.178 0.224 0.129 0.128 0.111 0.113 0.241 0.215 0.227 0.221 0.229 0.219 0.239 0.217 0.291 0.231 0.247 0.201 0.291 0.246 0.221 0.242 valid acc. % 92.1 91.5 91.4 90.2 90.9 91.2 89.7 88.6 91.6 91.3 91.7 91.0 91.8 91.0 91.5 91.1 92.1 92.2 92.3 91.3 91.9 91.6 93.1 91.8 Input Features Accuracy % Average Length (in words) Full body text Headline text Summary text 10.51 387.89 20.41 Table 4: Fake news classifier results 92 91 93 For fake news classification, we use a fake news dataset with headlines and article content provided by George McIntire 1. The dataset contains 3164 fake news articles and 3171 real articles (i.e. a balanced dataset) on politics from a wide range of news sources. We shuffle the data and use 80% of it for training, 10% of it for validation, and 10% for testing, and also do 5-fold cross validation. We build a Long-short-term-memory (LSTM) network together with an Embedding Layer as shown in Figure 5. Table 3 shows our hyperparameter studies for fake news classification and Table 4 shows the final test accuracies, using the three input features of full body text, headline text, and generated summary texts by our summarization models. As it can be seen in this table the best model using the body text as input features perform better than headline text as input. Furthermore, it's worth noting that the summary text as input feature leads to an even higher accuracy compared to the full body text as input feature. This finding shows that summarization model serves as a feature generator for fake news detection task which actually increases its accuracy. Also, this summarization model can also serve as a headline generator for the news articles as an automatic approach. 4 Conclusion As we showed in section 3.3 the pointer-generator architecture with attention and coverage mecha- nisms led to the highest accuracies and could overcome the problems common in abstractive text summarization such as out-of-vocabulary words and repetition. Furthermore, as shown in section 3.3 a text summarizing model can successfully be applied as a feature generator prior to classification tasks such as fake news classification and increase the accuracy of those tasks. 1https://www.datasciencecentral.com/profiles/blogs/on-building-a-fake-news-classification-model 8 References [1] Soheil Esmaeilzadeh, Ouassim Khebzegga, and Mehrad Moradshahi. Clinical Parameters Prediction for Gait Disorder Recognition. arXiv:1806.04627. 2018. https://arxiv.org/ abs/1806.04627. [2] Soheil Esmaeilzadeh, Dimitrios Ioannis Belivanis, Kilian M. Pohl, and Ehsan Adeli. End- to-end Alzheimer's disease diagnosis and biomarker identification. Machine Learning in Medical Imaging. MLMI 2018. pp 337-345. vol 11046. https://doi.org/10.1007/ 978-3-030-00919-9_39. [3] Soheil Esmaeilzadeh, Yao Yang, and Ehsan Adeli. End-to-End Parkinson Disease Diagnosis using Brain MR-Images by 3D-CNN. arXiv:1806.05233. 2018. https://arxiv.org/abs/ 1806.05233. [4] Pengxiang Cheng, and Katrin Erk Attending to Entities for Better Text Understanding. arXiv:1911.04361. 2019. https://arxiv.org/abs/1911.04361 [5] Hui Liu, Qingyu Yin, and William Yang Wang Towards Explainable NLP: A Generative Expla- nation Framework for Text Classification. arXiv:1811.00196. 2018 https://arxiv.org/abs/ 1811.00196 [6] Mehdi Allahyari, Seyedamin Pouriyeh, Mehdi Assefi, Saeid Safaei, Elizabeth D. Trippe, Juan B. Gutierrez, and Krys Kochut. Text Summarization Techniques : A Brief Survey. arXiv:1707.02268. 2017. https://arxiv.org/abs/1707.02268 [7] Bonnie Dorr, David Zajic, and Richard Schwartz. Hedge Trimmer: A Parse-and-Trim Approach to Headline Generation. Proceedings of the HLT-NAACL 03 Text Summarization Workshop. pp. 1-8, 2003. http://doi.org/10.3115/1119467.1119468 [8] Ramesh Nallapati, Feifei Zhai, and Bowen Zhou. SummaRuNNer: A Recurrent Neural Network based Sequence Model for Extractive Summarization of Documents. arXiv:1611.04230. 2016. https://arxiv.org/abs/1611.04230 [9] Chandra Khatri, Gyanit Singh, and Nish Parikh. Abstractive and Extractive Text Summarization using Document Context Vector and Recurrent Neural Networks. arXiv:1807.08000. 2018. https: //arxiv.org/abs/1807.08000 [10] Shen Gao, Xiuying Chen, Piji Li, Zhaochun Ren, Lidong Bing, Dongyan Zhao, and Rui Yan. Abstractive Text Summarization by Incorporating Reader Comments. arXiv:1812.05407. 2018. https://arxiv.org/abs/1812.05407 [11] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural Machine Translation by Jointly Learning to Align and Translate. arXiv:1409.0473. 2014. https://arxiv.org/abs/ 1409.0473 [12] Ramesh Nallapati, Bing Xiang and Bowen Zhou. Sequence-to-Sequence RNNs for Text Summa- rization. ICLR 2016. [13] Karl Moritz Hermann, Tomas Kocisky, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman, and Phil Blunsom. Teaching Machines to Read and Comprehend. Advances in Neural Information Processing Systems. NIPS 2015. [14] Abigail See, Peter J. Liu, and Christopher D. Manning. Get To The Point: Summarization with Pointer-Generator Networks. arXiv:1704.04368. 2017. https://arxiv.org/abs/1704. 04368. [15] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention Is All You Need. arXiv:1706.03762. 2017. https: //arxiv.org/abs/1706.03762. 9 [16] Zhaopeng Tu, Zhengdong Lu, Yang Liu, Xiaohua Liu, and Hang Li. Modeling Coverage for Neural Machine Translation. arXiv:1601.04811. 2016. https://arxiv.org/abs/1601. 04811 [17] Danqi Chen, Jason Bolton, and Christopher D. Manning. A Thorough Examination of the CNN/Daily Mail Reading Comprehension Task. Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics. ACL 2016. http://doi.org/10.18653/v1/ P16-1223 [18] Mahnaz Koupaee, and William Yang Wang. WikiHow: A Large Scale Text Summarization Dataset. arXiv:1810.09305. 2018. https://arxiv.org/abs/1810.09305 [19] Chin Yew Lin, and Marina Rey. ROUGE : A Package for Automatic Evaluation of Summaries. Text Summarization Branches Out. ACL 2004. 10
1908.05453
1
1908
2019-08-15T08:09:52
What's Wrong with Hebrew NLP? And How to Make it Right
[ "cs.CL" ]
For languages with simple morphology, such as English, automatic annotation pipelines such as spaCy or Stanford's CoreNLP successfully serve projects in academia and the industry. For many morphologically-rich languages (MRLs), similar pipelines show sub-optimal performance that limits their applicability for text analysis in research and the industry.The sub-optimal performance is mainly due to errors in early morphological disambiguation decisions, which cannot be recovered later in the pipeline, yielding incoherent annotations on the whole. In this paper we describe the design and use of the Onlp suite, a joint morpho-syntactic parsing framework for processing Modern Hebrew texts. The joint inference over morphology and syntax substantially limits error propagation, and leads to high accuracy. Onlp provides rich and expressive output which already serves diverse academic and commercial needs. Its accompanying online demo further serves educational activities, introducing Hebrew NLP intricacies to researchers and non-researchers alike.
cs.CL
cs
What's Wrong with Hebrew NLP? And How to Make it Right Reut Tsarfaty Amit Seker Stav Klein Open University of Israel, University Road 1, Ra'anana, Israel {reutts,shovalsa,amitse,stavkl}@openu.ac.il Shoval Sadde 9 1 0 2 g u A 5 1 ] L C . s c [ 1 v 3 5 4 5 0 . 8 0 9 1 : v i X r a Abstract For languages with simple morphology, such as English, automatic annotation pipelines such as spaCy or Stanford's CoreNLP success- fully serve projects in academia and the indus- try. For many morphologically-rich languages (MRLs), similar pipelines show sub-optimal performance that limits their applicability for text analysis in research and the industry. The sub-optimal performance is mainly due to er- rors in early morphological disambiguation decisions, which cannot be recovered later in the pipeline, yielding incoherent annotations on the whole. In this paper we describe the design and use of the ONLP suite, a joint morpho-syntactic parsing framework for pro- cessing Modern Hebrew texts. The joint in- ference over morphology and syntax substan- tially limits error propagation, and leads to high accuracy. ONLP provides rich and ex- pressive output which already serves diverse academic and commercial needs. Its accompa- nying online demo further serves educational activities, introducing Hebrew NLP intricacies to researchers and non-researchers alike. Introduction 1 NLP pipelines for the automatic annotation of un- structured texts are at the core of language tech- nology applications for Data Science, Text Ana- lytic and Artificial Intelligence. For English, an- notation pipelines such as spaCy (Honnibal and Montani, 2017) or Stanford's CoreNLP (Manning et al., 2014) successfully deliver the ability to au- tomatically annotate unstructured texts with their underlying linguistic structures, including: Part- of-Speech (POS) Tags, Morphological Features, Dependency Relations, Named Entities, and so on. These annotations serve research labs, non-profit organizations and commercial endeavors in their quest to make sense of the vast amount of unstruc- tured data available to them. Universal processing pipelines such as UDPipe (Straka et al., 2016) aim to serve a range of other languages, but unfortunately, their performance on many morphologically rich languages (MRLs) (Tsarfaty et al., 2010), and in particular Semitic languages, is not on a par with their performance on English. This, in turn, greatly limits their appli- cability for further research and commercial use. The main reason for this sub-optimal performance on Semitic languages is that the pipeline design inherent in these frameworks is inappropriate for languages that exhibit extreme morphological am- biguity in their input stream. This is because errors made in morphological segmentation and disam- biguation early on, jeopardize the system accuracy down the pipeline. For Hebrew, this performance gap has long been a show-stopper for advancing Language Technology and Artificial Intelligence for the Hebrew-speaking community. With this contribution, we aim to remedy this situation. In this paper we describe the design and use of the ONLP system, a joint morphological-syntactic parsing framework for processing the Semitic language Modren Hebrew (Henceforth, Hebrew). The system is accurate, efficient, and provides rich and expressive output including: Segmentation, POS tags, Lemmas, Features and Labeled Depen- dencies. The joint training and inference over the different layers substantially limits error propaga- tion, and leads in turn to speed and high accuracy. Among the technical advantages of the ONLP suite are its open license, an easy 3-step installation, and a single package with all elements included -- no need to train or maintain individual compo- nents separately. The ONLP suite already serves academic and commercial projects in diverse do- mains. Its accompanying online demo has fur- ther proved valuable for educational purposes, ex- posing CS/NLP and non-CS researchers and engi- neers to the intricacies of Semitic NLP. 2 The Linguistic Challenge In morphologically-rich languages (MRLs), each input token may consist of multiple lexical and functional units (henceforth, morphemes), each of which serves a particular role in the overall syn- tactic or semantic representation. In Hebrew, for example, the token '!הדבעמהמשכו' corresponds to five word tokens in English, each of which car- rying its distinct role: '!ו' (and, CC), '!שכ' (when, REL), '! ְמ' (from, IN), '!ה' (the, DT), '!הדבעמ' (lab, NN).1 This means that in order to process Hebrew texts, one first needs to segment the Hebrew to- kens into their constituting morphemes. At the same time, Hebrew raw tokens are highly ambigu- ous. A token such as: '!הפקה' may be interpreted as '!הפקה' (orbit, NN), '!ה' + '!הפק' (the+coffee, DT+NN), or '!Pקה'+ '!לש' + '!איה' (perimeter of her, NN+POSS+PRP), etc. This is further compli- cated by the lack of diacritics in standardized texts, meaning that most vowels are not present, and that no reading is a-priory more likely than the others, out of context. Only in context the correct inter- pretation and segmentation become apparent. These facts create an apparent loop in the de- sign of NLP pipelines for Hebrew: syntactic pars- ing requires morphological disambiguation -- but morphological disambiguation requires syntactic context. This apparent loop has called for the de- velopment of joint systems rather than pipelines, for Semitic languages processing (Tsarfaty, 2006; Green and Manning, 2010). This joint hypothesis has proven useful for Hebrew and Arabic phrase- structure parsing (Goldberg and Tsarfaty, 2008; Green and Manning, 2010; Goldberg and Elhadad, 2011). The ONLP suite is a dependency-based parsing framework implementing this joint hy- pothesis, over the entire morpho-syntactic search- space, as depicted in Figure 1 (More et al., 2019). 3 The Architectural Design The core of ONLP is YAP (Yet Another Parser), a morpho-syntactic parser for morphological and syntactic analysis of Hebrew Texts. YAP re- implements and extends the structure-prediction framework of Zhang and Clark (2011). We de- scribe YAP in detail in More and Tsarfaty (2016); More et al. (2019). Here we only provide a bird's eye view of the architecture. 1We use the annotation conventions of simaan01 that un- derlie the Hebrew SPMRL scheme http://www.spmrl. org/spmrl2013-sharedtask.html. Figure 1: The Joint Morpho-Syntactic Search-Space. Lattice paths are of different lengths. Each lattice path can be assigned an exponential number of trees. In YAP we embrace the extreme morpholog- ical ambiguity in Hebrew. That is, we do not aim to resolve morphological ambiguity via pre- processing. The input to YAP is the complete Mor- phological Analysis (MA) of an input sentence x, termed here MA(x). MA(x) is a lattice structure, consisting of all possible morphological analysis possibilities of the input sentence, as seen in the middle of Figure 1. Each arc is a tuple specify- ing the start-index, end-index, the form of the seg- ment, its part-of-speech, lemma, features, and the index of the raw token the arc has originated from. An arc in the lattice can serve as a node in a syn- tactic dependency tree. Each contiguous path in the lattice presents one valid morphological seg- mentation of the sentence, for which a dependency tree can be assigned, as in Figure 1. For each path in the lattice, there is an exponential number of dependency trees that are potentially applicable. We refer to the task of selecting the most likely lattice-path as Morphological Disambigua- tion (MD), and to the task of selecting the most likely dependency tree for a given path as Depen- dency Parsing (DEP). For an input sentence x, our goal is to jointly predict a single pair of MD(x) and DEP(x) that are consistent with one another, and form the most-likely analysis of the sentence. is the transition-based morphological parser of More and Tsarfaty (2016), which is formally based on the structure- The MD component prediction framework of Zhang and Clark (2011). MD accepts a sentence lattice MA(x) as input and delivers a selected sequence of arcs (mor- phemes) MD(x) as output. The transition-based system for MD selects arcs for MD one at a time. It decodes the lattice using beam-search, and keeps the K-best paths at each step, scored accord- ing to morpheme-level and token-level features, weighted via structured-perceptron learning. The DEP component is a re-implementation of the Zhang and Nivre (2011) dependency parser for English, adapted for Hebrew. We assume an Arc- Eager transition system and beam-search decod- ing. Feature weights are learned via the structured perceptron. We employ a carefully-designed fea- ture set that reflects linguistic properties of He- brew such as its rich morphological paradigms, flexible word-order, agreement, etc. This provides SOTA results on Hebrew dependency parsing, al- beit in Oracle (i.e., gold morphology) scenario. Seen that both the MD and DEP realize the same formal framework and inherit from the same computational machinery, we can easily unify them and treat the morpho-synactic task as a sin- gle objective. The transition systems are combined and the beam-search decoder interleaves morpho- logical and syntactic decisions.2 Now morpholog- ical decisions may be affected by syntactic con- tent, and vice versa. The architecture is depicted in Figure 2. In More et al. (2019) we compared the performance of the joint system to our own pipeline system and to other systems available for Hebrew morpholog- ical and syntactic parsing, and showed significant improvements of YAP's joint model over all com- peting systems. 4 The Annotation Scheme We deliver automatic morpho-syntactic annota- tion of Hebrew texts based on the scheme of the SPMRL Hebrew dependency treebank.3 The SPMRL Hebrew scheme employs the labels of Sima'an et al. (2001) for morphology and POS tags, and the Unified-SD scheme of Tsarfaty (2013) for the labeled dependencies.4 Specifically, 2For a complete formal exposition of the algorithm we refer the reader to More et al. (2019) 3The detailed annotation scheme is provided, with exam- ples, in the supplementary material along with the screencast. 4With an eye for future comparability, we further de- veloped a conversion algorithm to convert the the depen- dency tree from Unified-SD to Universal Dependencies Figure 2: A bird's eye view of the Architecture we deliver the following annotation layers: Morphological Segmentation The most basic form of analysis of Hebrew texts is the segmenta- tion of raw tokens into multiple meaning-bearing units that we call morphemes. 5 Due to orthographic and phonological pro- cesses, some morphemes do not appear explicitly in the surface form. Our segmentation recovers all morphemes, both overt and covert. the token '!תיבב' (in the house) is segmented as '!ב' + '!ה' + '!תיב'. Part-of-Speech (POS) Tags Each morphologi- cal segment is assigned a single Part-of-Speech tag category that indicates its syntactic role. The set of tags used by the system is based on the SPMRL scheme which in turn adopts the POS labels from Sima'an et al. (2001) (detailed in our appendix). Morphological Features Along with the POS category, we specify for each segment the prop- erties that are signalled by inflectional morphol- ogy. The scheme encodes the following prop- erties: Number [S (Singular) / P (Plural) / D (Dual)], Gender [F (Female) / M (Male) / F,M (both)], Person [1 / 2 / 3 / A (All)],6 and Tense [Past, Present, Future, Imperative, Infinitive].7 Lemmas Each segment is also assigned a lemma, i.e., the cannonical representation of its core (uninflected) meaning.8 For Hebrew nouns (UD).https://universaldependencies.org/ 5In UD they are called words. In Hebrew NLP they are called segments. We use morphemes or segments herein. 6A is used in cases where all analyses are valid, such as in Beinoni form - '!תלכוא' (I/you/she eat.singular.feminine) 7Present-tense verbs and participles are tagged 'Beinoni'. 8Note that due to high morphological fusion in Hebrew, simple surface-based stemming will not suffice. and adjectives, the lemma is chosen to be the Masculine-Singular form. For verbs, the lemma is in the Masculine-Singular-3per form in Past tense. Dependency Tree The dependency tree is de- fined over all morphological segments and an ar- tificial root node. It consists of a set of labeled binary relations that indicate the bi-lexical depen- dencies between segments. Note that the SPMRL dependency scheme, as opposed to UD, always selects functional heads, rather than lexical heads. The dependency label- ing is based on the scheme from Tsarfaty (2013), repeated in the appendix. Lattices As explained in section 3 above, a word can be segmented into morphemes in multiple ways, which are constrained by a broad-coverage lexicon. In addition to the parsed output, we makes available for each input sentence its sen- tence lattice, i.e. the set of all possible segmenta- tions for a given sentence, along with all possible morphosyntactic analyses for each arc. 5 Technical Details and Forms of Use YAP is implemented in the Go language.9 It re- quires 6GB of RAM to run, and employs a sim- ple 3-step installation, given in the supplementray material in the appendix. The input to the sys- tem is a tokenized sentence, with tokens appear- ing one per line, and a line break after every sen- tence.10 The output is a dependency tree (where each node in the tree is a lattice arc) provided in the CoNLL-X format (Buchholz and Marsi, 2006). YAP is trained on the Hebrew section of the SPMRL shared task. It also makes use of the broad-coverage lexicon of Itai and Wintner (2008) for finding all potential lattice paths. In case of out-of-vocabulary (OOV) items, we employ a sim- ple heuristics where we suggest the 10 most-likely analyses of rare tokens observed during training. Simple Use Command line From the com- mand line, one can process one input file at a time, with a single sentence or more. The input file must be formatted with a single token per line, and an empty line denoting the end of every sentence. Processing a file is done in 2 steps: First, run Morphological Analysis ./yap hebma to gen- erates a sentence lattice containing all possible 9https://golang.org/ 10We assume the tokenization convention of MILA (Itai and Wintner, 2008). morphological breakdowns of each token. YAP will save the lattice to the file specified via the -out flag. Now you can run joint Morphological Dis- ambiguation and Dependency Parsing ./yap joint to jointly predict the best lattice path and corresponding dependency tree. The input to this command is the output file generated in the pre- vious step, and there are 3 output files: one con- taining word segments, one containing the disam- biguated lattice path, and one containing the com- plete dependency tree in CoNLL-X format. Advanced Use RESTful API YAP can run as a RESTful server that accepts parse requests. To do this simply start the server, listening on localhost port 8000. Now you can call the joint endpoint with a json object containing the list of tokens to process in the HTTP data payload. The response is a json object containing the three output levels (MA, MD and Dep). You can use jq and sed (or any other json and line processing tools) to format the (tab separated value) responses and reassemble the output. Check our appendix for an illustration. Educational Use The Online Demo In 2018 we decided to create an online demo of the system, for educational purposes: (i) To exposed NLP/AI researchers to NLP capabilities available for He- brew. (ii) To educate non-CS scientists and engi- neers who work with Hebrew data (e.g., digital hu- manities) on text annotations that can potentially be useful for their applications. (iii) To launch out- reach activities where we teach what is NLP to the local community (e.g., school kids).11 To use the demo, simply go to onlp.openu. ac.il and type Hebrew sentence in the textbox. The demo is built with Django and Bootstrap web frameworks. It sends the user's Hebrew text input to the ONLP server, which returns a CoNLL-X for- matted parse along with the complete sentence lat- tice. Pre-processing includes pre-morphological tokenization of the input, where punctuation is be- ing separated from the tokens. Double quotation marks are being separated from the word unless they appear before the last character of the word, to avoid over-segmentation of acronyms.12 The tokenized sequence is then passed to the ONLP server. The CoNLL-X output is then processed 11E.g., https://www.youtube.com/watch?v= TFwQeoKpznA&feature=youtu.be 12Acronyms in Hebrew are written with a quotation mark before the last letter, e.g. '!ב"!הרא' (USA) . Tok MA MD POS Lem Feats Deps Joint Tasks MILA NITE Hebrew-NLP Adler Goldberg Pipelines UDPipe CoreNLP ONLP (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) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) Table 1: Existing Coverage for Hebrew NLP Tasks into the following layers: the FORM column is concatenated and presented as "Segmented Text", and the POS, LEMMA, FEATS and DEPS are pre- sented in separate accordion tabs. Furthermore, the demo presents the sentence lattice which is the input to the joint parser. This is useful for debugging, and for analyzing lexical- coverage in out-of-domain scenarios. Expert Use Out of Domain Scenarios A bot- tleneck for the system in out-of-domain parsing scenarios is the coverage of the lexicon. We rely on a general-purpose lexicon containing over 500K entries. OOV words are treated via heuris- tics we designed, which are suitable for the general case only. However, identifying accurately vo- cabulary items may be critical when applying the parser to new domains with domain-specific infor- mation (medical, financial, political, etc.). Fortu- nately, we can extend the system with a domain- specific lexicon, thus extending the MA coverage. Due to joint inference, the availability of a bet- ter suited lexical analysis triggers better lexico- syntactic decisions on the whole.13 6 Related and Future Work Hebrew NLP in general and Hebrew parsing in particular are known to be challenging, due to in- teresting linguistic properties, the scarcity of an- notated data, and the small research community around. So, Hebrew has been seriously under- studied in NLP. During the early 2000, the MILA knowledge center was established, where the two of the main Hebrew resources for NLP were devel- oped: the Hebrew treebank (Sima'an et al., 2001) and the Hebrew Lexicon (Itai and Wintner, 2008). Morphological Taggers for Hebrew using local linear-context have been trained on these data and were made available for free use (Adler and El- hadad, 2006; Bar-haim et al., 2008). However, 13We discuss how exactly this is executed in the appendix. their performance was not on a par with parallel tools for English and thus insufficient for com- mercial use. Hebrew dependency parsing was ini- tially provided by Goldberg and Elhadad (2009), but the parser provides unlabeled dependency, and the pipeline relied on Adler's morphologi- cal tagger. This left the automatic dependency trees inaccurate and unsatisfying. Joint morpho- syntactic models for constituency-based parsing models Tsarfaty (2010) showed good performance on benchmark data, but their code was never re- leased for open use. With the development of the UD treebanks collection, general frameworks such as UDPipe (Straka et al., 2016) and CoreNLP (Manning et al., 2014) have been trained on the Hebrew UD tree- bank, and made the model available. However, these models provide performance that is still far from satisfactory, As we also demonstrate in our screen-cast,14 these systems make very basic mis- takes, even with the simplest sentence. We con- jecture that this is due to their inherent pipeline assumption: initial layers of processing present many mistakes. due to the extreme morphological ambiguity, and later layers cannot recover. No- tably, also neural network models utilizing word embeddings, (e.g., UDPipe) still lag behind. Table 1 shows the task-coverage of existing tools and toolkits for NLP in Hebrew, academic as well as private initiatives (NITE,Hebrew-NLP). The task-coverage of the ONLP suite we present is on a par with international standards (UD- Pipe, CoreNLP), and its level of performance was shown to exceed all existing models (More et al., 2019). We are currently working towards Named- Entity Recognition as well as Open Information Extraction, to be added to ONLP in the near future. 7 Conclusion This paper presents ONLP, a complete language- processing framework for automatic annotation of Modern Hebrew Texts. The framework covers morphological segmentation, POS tags, lemmas and features, and dependency parsing, predicted jointly. The system is easy to install and to use, and we support multiple forms of usage fitting user-personas with different needs. We hope the availability of an open-source, accurate, and easy- to-use system for NLP in Hebrew will benefit the 14https://www.youtube.com/watch?v= H6pvh1x20FQ local NLP open-source community and greatly ad- vance Hebrew language technology research and development, in academia and in the industry. Acknowledgements We thank the NLPH community, in particular Shay Palachi, Amit Shkolnick and Yuval Fein- stein, for much discussion and insightful com- ments. We further thank the Avi Bivas (Innovation Authority) and Milo Avisar for promoting NLP initiatives in Israel. This research is supported by an ISF grant (1739/26) and an ERC Starting grant (677352), for which we are grateful. References Meni Adler and Michael Elhadad. 2006. An unsuper- vised morpheme-based hmm for Hebrew morpho- logical disambiguation. In ACL. The Association for Computer Linguistics. Roy Bar-haim, Khalil Sima'an, and Yoad Winter. 2008. Part-of-speech tagging of Modern Hebrew text. Nat- ural Language Engineering, 14(2):223 -- 251. Sabine Buchholz and Erwin Marsi. 2006. Conll-x shared task on multilingual dependency parsing. In Proceedings of CoNLL, pages 149 -- 164. Yoav Goldberg and Michael Elhadad. 2009. Hebrew In Proceed- dependency parsing: ings of the 11th International Conference on Parsing Technologies, IWPT '09, pages 129 -- 133. Initial results. Yoav Goldberg and Michael Elhadad. 2011. Joint He- brew segmentation and parsing using a PCFGLA lat- tice parser. In Proceedings of ACL. Yoav Goldberg and Reut Tsarfaty. 2008. A sin- gle framework for joint morphological segmentation and syntactic parsing. In Proceedings of ACL. Spence Green and Christopher D. Manning. 2010. Bet- ter Arabic parsing: Baselines, evaluations, and anal- ysis. In Proceedings of COLING. Matthew Honnibal and Ines Montani. 2017. spaCy 2: Natural language understanding with Bloom embed- dings, convolutional neural networks and incremen- tal parsing. To appear. Alon Itai and Shuly Wintner. 2008. Language re- sources for Hebrew. Language Resources and Eval- uation, 42(1):75 -- 98. Christopher Manning, Mihai Surdeanu, John Bauer, Jenny Finkel, Steven Bethard, and David McClosky. 2014. The stanford corenlp natural language pro- cessing toolkit. In Proceedings ACL: system demon- strations, pages 55 -- 60. Amir More, Amit Seker, Victoria Basmova, and Reut Tsarfaty. 2019. Joint transition-based models for morpho-syntactic parsing: Parsing strategies for MRLs and a case study from modern Hebrew. Transactions of the Association for Computational Linguistics, 7:33 -- 48. Amir More and Reut Tsarfaty. 2016. Data-driven mor- phological analysis and disambiguation for morpho- logically rich languages and universal dependencies. In Proceedings of COLING, pages 337 -- 348. The COLING 2016 Organizing Committee. Khalil Sima'an, Alon Itai, Yoad Winter, Alon Altman, and N. Nativ. 2001. Building a tree-bank of Modern Hebrew text. Traitment Automatique des Langues, 42(2). Milan Straka, Jan Hajic, and Jana Strakov´a. 2016. Ud- pipe: Trainable pipeline for processing conll-u files performing tokenization, morphological analysis, pos tagging and parsing. In Proceedings of the Tenth International Conference on Language Resources and Evaluation (LREC 2016), Paris, France. Euro- pean Language Resources Association (ELRA). Reut Tsarfaty. 2006. Integrated morphological and In syntactic disambiguation for modern Hebrew. Proceedings ACL-CoLing Student Research Work- shop, pages 49 -- 54, Stroudsburg, PA, USA. ACL. Reut Tsarfaty. 2010. Relational-realizational parsing. Ph.D. thesis. Reut Tsarfaty. 2013. A unified morphosyntactic scheme for stanford dependencies. In Proceedings of ACL. Reut Tsarfaty, Djam´e Seddah, Yoav Goldberg, San- dra Kubler, Marie Candito, Jennifer Foster, Yannick Versley, Ines Rehbein, and Lamia Tounsi. 2010. Sta- tistical parsing of morphologically rich languages In Proceedings (spmrl): What, how and whither. of the NAACL HLT 2010 First Workshop on Statis- tical Parsing of Morphologically-Rich Languages, SPMRL '10, pages 1 -- 12, Stroudsburg, PA, USA. Association for Computational Linguistics. Yue Zhang and Stephen Clark. 2011. Syntactic pro- cessing using the generalized perceptron and beam search. Computational Linguistics, 37(1):105 -- 151. Yue Zhang and Joakim Nivre. 2011. Transition-based dependency parsing with rich non-local features. In Proceedings of the ACL, HLT '11, pages 188 -- 193, Stroudsburg, PA, USA. ACL. Supplementary Material For EMNLP Demo Paper These supplementary materials document the ab- solute essentials for starting to use the sys- tem: installation, annotation scheme documenta- tion, forms of use, and enhancements for out-of- domains scenarios. A Resources 1. YAP Github: https://github.com/OnlpLab/yap 2. YAP Demo - Website: http://onlp.openu.org.il 3. YAP Demo - Screencast: (Youtube) https://www.youtube.com/watch?v= H6pvh1x20FQ 4. YAP Python-Wrapper: https://github.com/amit-shkolnik/ YAP-Wrapper 5. SPMRL-to-UD Conversion: https://github.com/OnlpLab/Hebrew_UD 6. ONLP Lab Website: http://onlp.openu.org.il/home B Screen-Cast Check out our screen-cast online demo at: https://www. youtube.com/watch?v=H6pvh1x20FQ C Morphological Ambiguity: Lattices Table 2 shows a sentence lattice capturing the high ambiguity of Hebrew morphological analysis. For a simple 3-tokens input sentence, 22 possible arcs present valid analyses of the various tokens. A single consecutive path through the lattice needs to be selected, for the sentence to be further processed by syntactic parsers or downstream applications. D Annotation Layers The annotation scheme provided by ONLP corresponds to the Hebrew section of the SPMRL shared task. 2013-201415 The Part-of-Speech Tags we employ are provided, along with il- lustrative examples, in Table 3. The Dependency labels are defined and illustrated in Table 5. E The Online Demo In Figure 3 we present a screen capture of the Morphological Segmentation, POS tags and Dependency Relations for two raw input sentences: • '!לצב בכש Nבה' 'the-boy was-lying in-the-shade' • '!לצב Mנש Nבה' 'the-boy that-was-napping in-the-shade' As executed on our demo page. Note that the two raw sen- tences have very similar form (in fact, they only differ in two characters). But they end up forming very different syntactic structures, which the ONLP system annotates correctly. 15http://www.spmrl.org/ spmrl2013-sharedtask.html F Forms of Use Figures 4 -- 6 present the usage patterns with the YAP parser, the core algorithm of the framework. In Figure 4 we present the 3-step installation, in Figure 5 we show a simple command-line use, and in Figure 6 we show how to use YAP as a service. As noted before, The input file must be format- ted with a single token per line and an empty line denoting end of sentence.1617 YAP has been written in Go in order to enable multi-threading. This means that it can be called from multiple threads in parallel. As of June 2019 there is also a python wrapper, created by members of the Israeli open- source community.18 G Out-of-Domain Scenarios When observing errors in a new domain, one first thing we have to check is whether or not these are due to lexical gaps. I.e., whether they stem from lack of coverage of the lexicon. The availability of the sentence lattice output is of great value in this respect. By reviewing the lattice, it is possible to see whether the lexicon contains the correct morphological anal- ysis for the input token at all. If the correct analysis is not in the lattice, it is easy to add the missing analyses by editing the lexicon.19 Each line in the lexicon file contains a token followed by a list of one or more possible morphological analyses of that to- ken. An analysis is a tuple made of 3 parts (cid:104) prefix:host:suffix (cid:105) followed by the host lemma. Each tuple member contains the part-of-speech tag and morphological features for any of these elements. prefix and suffix can possibly be empty. E.g. > !דבאא :VB-MF-S-1-FUTURE-NIFAL: !דבאנ :VB-MF-S-1- FUTURE-PIEL: !דביא An example use case could arise when processing medi- cal domain texts related to cancer in which the word '!הפמיל' (lymph) appears in the text but is missing from the lexicon. In this case, the parser errs in identifying the first '!ל' as the preposition "to", followed by a proper noun. To remedy this, we can update the lexicon by adding the following line: > !הפמיל :NN-F-S: !הפמיל This means that the token !הפמיל is a common noun with fem- inine gender and singular number, followed by the lemma, and that it is unambigous (i.e., only one analysis is available). Note that after updating the lexicon you need to restart YAP (if running as a restful server) for the lexical changes to apply. Now that !הפמיל is no longer an OOV, sentences contain- ing this token will be given a more accurate lattice and as a result will be analyzed with a global syntactic structure that accords with the correct analysis. We suggested these lexicon edits for our users working in specific domains in the indus- try (medical, social, political), and they attested to significant improvements when running on particular domains.20 16Crucially, the last line in the file must be empty to denote the end of the last sentence. 17A note for Windows users: YAP doesn't handle Win- dows style text files that have BOM marks and CRLF new- lines. So if you're running on Windows and YAP doesn't work, make sure you don't have CRLF line endings and no BOM marks. 18The Credit goes to Amit Shkolnik of the 4girls initiative. Further details can be found here: https://github. com/amit-shkolnik/YAP-Wrapper 19The lexicon file located at data/bgulex/bgulex. utf8.hr 20Yuval Feinstain, NLP Consultant, p.c. From To Form Lemma Part of Speech Features Token Number 0 0 0 1 1 1 1 2 3 3 3 3 4 5 5 6 6 6 6 7 7 7 8 8 8 9 9 1 3 5 2 5 5 5 5 4 5 5 5 5 6 7 7 7 7 7 8 10 10 9 10 10 10 10 !ה !ה !Nבה !ב !Nב !Nב !Nב !Nה !ב !Nב !Nב !Nב !Nה !ש !Mנש !Mנ !Mנ !Mנ !Mנ !ב !לצב !לצב !ה !לצ !לצ !לצ !לצ !ה !ה !Nיבה !ב !Nב !Nב !Nב !Nה !ב !Nב !Nב !Nב !Nה !ש !Nש !Mנ !Mנ !Mנ !Mנ !ב !לצב !לצב !ה !לצ !לצ !לצ !לצ DEF REL VB IN NNP NNT NN S PRN IN NNP NNT NN S PRN REL NN VB BNT BN VB gen=M,num=S,per=2,tense=IMPERATIVE gen=M,num=S gen=M,num=S gen=M,num=S gen=F,num=P,per=3 gen=M,num=S gen=M,num=S gen=M,num=S gen=F,num=P,per=3 gen=F,num=S,suf gen=M,suf num=P,suf per=3 gen=M,num=S,per=A,tense=BEINONI gen=M,num=S,per=A gen=M,num=S,per=A gen=M,num=S,per=3,tense=PAST PREPOSITION NN NNT DEF NN NNT NNT NN gen=M,num=S gen=M,num=S gen=M,num=S gen=M,num=S gen=M,num=S gen=M,num=S 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 3 3 Table 2: The Lattice representation for '!לצב Mנש Nבה' 'The boy who slept in the shade'. Col 1-2: From/To - the start and end nodes of the morpheme. The numbers are with respect to the maximal length route. Col 3: Form - the surface form of the morphological segment. Col 4-5-6: Form/Lemma/Part of Speech - the same segment may belong to different entries in the lexicon. Each entry is given in a separate row, where the differences between the different meanings are surfaced in one (or more) of the Form/Lemma/Part of Speech columns. Col 7: Token Number - represents the index of the raw (space-delimited) token in the input before segmentation. ְכּ before numerals Definition The word ! The accusative marker !תא which is a seperate word in Hebrew Participle (Beinoni) Participle in construct state form Conjunction Relative clause marker Numeral Numeral in construct state Coordinating conjunction !ו Copula A special tag assigned to the definite marker !ה which appears with nouns, adjectives and numerals Determiner Accusative marker !תא when used with a pronominal suffix The existential markers !שי or !Nיא Preposition Interjection Adjective Adjective in construct state Modal predicates Noun Noun with a pronominal suffix Proper Noun Construct state noun Prefix written as a separate word Possessive preposition !לש POS ADVERB AT BN BNT CC REL CD CDT CONJ COP DEF DTT DUMMY AT EX IN INTJ JJ JJT MD NN NN S PP NNP NNT P POS PREPOSITION Inseperable preposition PRP S PRP QW S PRN TEMP VB yyCLN yyCM yyDASH yyDOT yyELPS yyEXCL yyLRB yyQM yyQUOT yyRRB yySCLN Personal Pronoun Reflexive pronoun Question word Personal pronoun attached to a preposition as a pronominal suffix Subordinating conjunction introducing time clauses Verb Colon Comma hyphen or dash Period Ellipsis Exclamation mark Left Parenthesis Question Mark Quotation Mark Right Parenthesis Semicolon Table 3: The Part-of-Speech Tags Provided by ONLP Example !Nוילימְכּ !בלכה תא !Mיעיגמ !Nותיעה ימיקמ !אלא ש !תואמ !יפלא ו !היה !ה !לכ !ותוא !שי !דע !אנ !Mירז !שפנ יפי !Kירצ !רבח !Mהילעופ !ימענ !תקסעה !יתלב !לש ְבּ !איה !ימצע !דציכ !ונתוא שְכּ !הרמא : , - . ... ! ( ? " " ) ; ! ! ! ! Dependency Definition num subj ROOT prepmod pobj comp conj punct advcl advmod obj amod det def gobj possmod rcmod relcomp appos nn ccomp neg pcomp xcomp acc vmod gen number mwe goeswith cop cc npred parataxis npadvmod apred vocative aux ppred acomp qmark numerical modifier subject root prepositional modifier object of a preposition complement conjunct punctuation adverbial clause adverbial modifier object adjectival modifier determiner definite marker genitive object possession modifier relative clause modifier relative complement apposition / parenthetical noun modifier complement clause with internal subject negative modifier complement clause of a preposition complement clause with external subject accusative case verb as modifier genitive case numerical modifier in digits multi-word expression tokens originally connected with a hyphen copular element introducing conjunction noun as predicate side-by-side, interjection noun phrase as adverbial modifier adjective as predicate explicitly addressing a dialogue participant auxilary verb or feature-bundle preposition as predicate adjectival complement question ְמ , !דצ) ְל , !Mיגיצנ) Example num (!Mישנא, !תורשע) subj (!הררבתה, !העפותה) ROOT ( root ,!הנעט) prepmod (! pobj (! comp (!הכב, !רשאכ) conj (! ו , !Mימער ) punct (!העמשנ , : ) advcl (!Mא, !גשוי) advmod (!ולבקתי, !רתלאל) obj (!השעת, !המחלמ) amod (!חוטיבה,!ימואלה) det (!Mידליה,!לכ) def (!סנלובמא,!ה) gobj (!ישרפ,!הרטשמ) possmod (!תדעו,!לש) rcmod (!הדעוה,! ש) relcomp (! ש,!הנד) appos (!כּ"!ח,!Mפמ) nn (!Nס,!Nומיס) ccomp (! ש,!דומח) neg (!סעכת,!אל) pcomp (!ידכ,!Pתתשהל) xcomp (!הצר,!תולעהל) acc (!יתפטיל,!תא) vmod (!יוכיס,!לבקתהל) gen (!הבתכמ,!לש) number(!תומיתח,84) mwe (!ידמ,!הנש) goeswith (!Nוסנומ,!הוונ) cop (!Mוקמ,!איה) cc (!רמא,!ירה) npred (!היה,!טסינומוק) parataxis (!Mשא,!דלונ) npadvmod (!היהי,!Mוי) apred (!יתייה,!Mימת) vocative(!תעה,!יתובר) aux (!העוקש,!התיה) ppred (!היהי,! acomp (!הארנ,!דחוימ) qmark (!Mילוכי,!Mאה) ְבּ) !דנליאתמ Mיעיגמ Mישנא תורשע !לומתא הררבתה העפותה !Kכ הנעט איה !דחא דצמ !Mיגיצנל הנפת איה !עוצעצה תא ול וחקל רשאכ הכב דליה !Mיקרבו Mימער !!Pפוכתת :!האירק העמשנ !Mכסה גשוי אל Mא ותבשי Mה !רתלאל ולבקתי Mלוכ !המחלמ Kל השעת המכחב !התיבשב ימואלה חוטיבה !Mידליה לכ תא האור ינא !עוסנל ליחתה סנלובמאה !ואצי הרטשמ ישרפ !תסנכה לש Mיפסכה תדעו !אשונב הנדש הדעוה !אשונב הנדש הדעוה (!Mפמ ) !Nבצ ריאי !כּ"!ח !Nומיס Nס רזנמ !דומח התאש Kל יתרמא !סעכת אל איה !תורחתב Pתתשהל ידכ סט אוה !רכשה תא תולעהל הצר אוה !בלכה תא יתפטיל !הימדקאל לבקתהל יוכיס ול שי !Nרובספיליפ ילמ לש הבתכמ !תומיתח 84 !Pסא אוה !הנש ידמ סט אוה !Nוסנומ-!הוונב Mירג ונחנא !יתרגש אל Mוקמ איה הבויא !Mדוק תאז רמא אוה ירה !טסינומוק היה אוה !הככ דלונ אוה ,!Mשא אל אוה !אישנה היהי אוה דחא Mוי !Mימת יתייהש רבתסמ !יתובר ,!Nושיל תעה וז !Nותימב העוקש התייה התלכלכ !ומוציעב היהי Pיטקה רחמ !דחוימ הארנ אוה !Kישמהל Mילוכי Mתא Mאה Table 4: The Dependency Labels Provided by ONLP Figure 3: On the right, we present a screen capture of the Morphological Segmentation, POS tags and Dependency Relations for the raw input sentence '!לצב בכש Nבה' ('the boy was lying in the shade'), as seen on our demo page. On the left, we likewise present the Morphological Segmentation, POS tags and Dependency Relations for the nominal phrase '!לצב Mנש Nבה' ('the boy that was napping in the shade'). Note that the two raw sentences have very similar form (in fact, they only differ in two characters). But they end up forming very different syntactic structures, which our system identifies and annotates correctly. Morphological Analysis Lattice (.ma and .md files) Column Definition col 1 col 2 col 3 col 4 col 5 col 6 col 7 col 8 Morpheme Start Index in the Lattice Morpheme end Index in the Lattice Form of the Morpheme Lemma of the Morpheme Coarse Part of Speech Tag Fine Part of Speech Tag Morphological Features Source Token Index CONLL File format (.conll) Morpheme Index in the Sentence Form of the Morpheme Lemma of the Morpheme Coarse Part of Speech Tag Fine Part of Speech Tag Morphological Features Head Index Pointer Dependency relation to the HEAD Projective Head Dependency relation to the PHEAD col 1 col 2 col 3 col 4 col 5 col 6 col 7 col 8 col 9 col 10 Comment Tag FROM TO FORM LEMMA CPOSTAG underscore if unavailable POSTAG FEATS TOKEN CPOSTAG and POSTAG are identical in YAP underscore if unavailable ID FORM LEMMA underscore if unavailable CPOSTAG underscore if unavailable POSTAG FEATS HEAD DEPREL PHEAD ignore - unused by YAP PDEPREL ignore - unused by YAP CPOSTAG and POSTAG are identical in YAP underscore if unavailable note that the resulting structure is a tree Table 5: Columns Definitions in .ma, .md and .conll files 1. Setup a Go environment: mkdir yapproj ; export GOPATH=/full/path/to/yapproj; cd yapproj 2. Clone the repository in src folder: mkdir src; cd src; git clone github.com/OnlpLab/yap.git 3. Unzip the models and build yap: cd yap; bunzip2 data/*.bz2; go get .; go build. Figure 4: A 3-Step Installation. To install YAP make sure you have Go, Git and BZip2 installed and available on your system's PATH. The instructions are for Linux but similarly can be done on Windows/MacOS 1. Morphological Analysis: ./yap hebma -raw input.txt -out input.lattice 2. Joint Morpho-syntactic Parsing: ./yap joint -in input.lattice -os output.segmentation -om output.mapping -oc output.conll Figure 5: Simple Use Command line "<word1> <word2> 1. Start the server: ./yap api 2. Call the joint endpoint: curl -s -X GET -H 'Content-Type: application/json' -d'"text": <word3> <word4> ..."' localhost:8000/yap/heb/joint > response.json 3. The response is a jason object: jq '.ma lattice, .md lattice, .dep tree' < response.json sed -e 's/.//' -e 's/.$//' -e 's/\\t/\t/g' -e 's/\\n/\n/g' Figure 6: Advanced Use RESTful API
1707.03172
1
1707
2017-07-11T08:33:55
Dataset for a Neural Natural Language Interface for Databases (NNLIDB)
[ "cs.CL" ]
Progress in natural language interfaces to databases (NLIDB) has been slow mainly due to linguistic issues (such as language ambiguity) and domain portability. Moreover, the lack of a large corpus to be used as a standard benchmark has made data-driven approaches difficult to develop and compare. In this paper, we revisit the problem of NLIDBs and recast it as a sequence translation problem. To this end, we introduce a large dataset extracted from the Stack Exchange Data Explorer website, which can be used for training neural natural language interfaces for databases. We also report encouraging baseline results on a smaller manually annotated test corpus, obtained using an attention-based sequence-to-sequence neural network.
cs.CL
cs
Dataset for a Neural Natural Language Interface for Databases (NNLIDB) Florin Brad1, Radu Iacob2, Ionel Hosu2, and Traian Rebedea2 1Bitdefender, Romania 2University Politehnica of Bucharest Abstract Progress in natural language interfaces to databases (NLIDB) has been slow mainly due to linguistic is- sues (such as language ambiguity) and domain porta- bility. Moreover, the lack of a large corpus to be used as a standard benchmark has made data-driven ap- proaches difficult to develop and compare. In this paper, we revisit the problem of NLIDBs and re- cast it as a sequence translation problem. To this end, we introduce a large dataset extracted from the Stack Exchange Data Explorer website, which can be used for training neural natural language inter- faces for databases. We also report encouraging baseline results on a smaller manually annotated test corpus, obtained using an attention-based sequence- to-sequence neural network. 1 Introduction Natural language interfaces have gathered a lot of attention as tools for simplifying the interaction be- tween users and computers. These interfaces often exclude or complement input devices, such as key- board or touch screens, or even specific languages used for interacting with an application. A more focused area is composed of Natural Language In- terface to Databases (NLIDB), which would allow a person to retrieve useful information from any database without knowledge of specific query lan- guages such as structured query language (SQL) for relational databases. Despite initial efforts into NLIDBs started decades ago, research has advanced slowly and at this moment there are no commercial solutions or widespread prototypes. The main diffi- culties in solving this problem stem from linguistic failures and the inability to develop general-purpose solutions that are portable to different databases and schemas. Due to the recent success of deep neural ap- proaches in natural language processing, our aim is twofold. First, we hope to rejuvenate interest in the NLIDB problem by proposing a large dataset, called the Stack Exchange Natural Language Interface to Database (SENLIDB) corpus, for developing data- driven machine learning models and for reporting progress. The training set consists of 24, 890 pairs (textual description, SQL snippet) crawled using the Stack Exchange API that we filtered and cleaned. A smaller test set consisting of 780 pairs that were manually created by two annotators is also available for comparing solutions. 1 Second, we report results on a neural baseline that uses an attention-enhanced sequence-to-sequence (SEQ2SEQ) architecture [Bahdanau et al., 2014] to model the conditional probability of an SQL query given a natural language description. This model is trained on the aforementioned dataset and its perfor- mance is computed both using cross-validation and on the manually labeled test set. Qualitative results reveal code that is almost syntactically correct and closely related to the user's intention. Moreover, we report results on two smaller tasks, which we call the tables and columns identification tasks. These results suggest that our dataset is indeed valuable for training the first end-to-end neural natural language interface for databases (NNLIDB). The paper continues with a short overview of related work in natural language interfaces for databases and in similar tasks where deep networks have been successfully employed. Section 3 contains a detailed description of the large SENLIDB dataset created for training, together with the smaller dataset used for testing and comparing various NLIDB sys- tems. Preliminary results using a SEQ2SEQ neural model with attention trained on the dataset proposed in this paper are presented in Section 4. We then pro- pose alternative indicators for assessing the correct- ness of generated SQL queries in Section 5, while Section 6 concludes the paper by highlighting the key insights and future work. 2 Related Work As all current NLIDB solutions are using mainly dependency and semantic parsing together with rule-based or constraint-based algorithms, we also present similar problems which inspired our ap- proach, where deep networks have achieved state of the art results. In the last part of the section, we intro- duce the most frequently used corpora for evaluating the performance of NLIDB systems. 2.1 Current approaches for NLIDB Natural language interfaces for databases have been studied for decades. Early solutions proposed us- ing dictionaries, grammars and dialogue systems for guiding the user articulate the query in natural lan- guage on a step by step basis [Codd, 1974, Hendrix et al., 1978]. Most systems developed until mid-90s used a mix of pattern matching, syntactic parsing, semantic grammar systems, and intermediate repre- sentation languages for generating the query from text [Androutsopoulos et al., 1995]. The most impor- tant problems encountered by NLIDBs were related to ambiguity in semantics and pragmatics present in natural language: modifier attachment, understand- ing quantifiers, conjunction and disjunction, nominal compounds, anaphora, and elliptical sentences [An- droutsopoulos et al., 1995]. In more recent studies, Popescu et al. [2004] com- bine syntactic parsing and semantic interpretation for natural language queries to change parse trees such that, by changing the order of some nodes in a tree, it will be correctly interpreted by the semantic ana- lyzer. Then they use a maximum flow algorithm and dictionaries for semantic alignment between the text and several SQL candidates. One of their main con- tributions is that they introduce a subset of semanti- cally tractable text queries, for which the proposed method generates correct SQL queries in most cases. NaLIR [Li and Jagadish, 2014] uses dependency parse trees generated with CoreNLP [Manning et al., 2014] and several heuristics and rules to generate mappings from natural language to candidate SQL queries. Given the dependency tree, the database schema and associated semantic mappings, the sys- tem proceeds in building alternative query trees which can be easily translated to SQL. To determine the best query tree, the system combines a scoring 2 mechanism and an interaction with the user to select the best choice (from a list of reformulations of the query tree into natural language). The scoring for each query tree takes into account the number of al- terations performed on the dependency tree in order to generate it, the database similarity/proximity be- tween nodes adjacent in the query tree, and the syn- tactic correctness of the generated SQL query. The most promising results reported on several databases used for validating NLIDBs have been recently achieved by Sqlizer [Yaghmazadeh et al., 2017]. Its main contributions are related to the fact that it uses a semantic parser to generate a query sketch, which is then completed using a rule based system, and iteratively refined and repaired using rules and heuristics until the score of the generated SQL query cannot be improved. Sqlizer is one of the few systems which employs machine learning and Word2Vec [Mikolov et al., 2013] for generating the query sketch - a general form of the query, includ- ing clauses, but which does not contain any specific database schema information (e.g. table and column names). 2.2 Deep learning solutions problems for related To the best of our knowledge, no deep learning so- lution has been proposed for the NLIDB problem until now, mainly due to the lack of large datasets for training such complex models. However, neural models have been successfully used for similar prob- lems. Mou et al. [2015] introduced a case study for code generation from problem descriptions using recurrent neural networks (RNN). They trained a SEQ2SEQ architecture with a character-level de- coder and produced program snippets that are almost executable and retain functionality. Moreover, they showed that the RNN generates novel code alterna- tives compared to the programs seen during train- ing, thus ruling out the possibility that the network merely memorizes the input examples. Ling et al. [2016] combined the SEQ2SEQ approach with a pointing mechanism [Vinyals et al., 2015] in order to generate Python and Java code using textual descrip- tions automatically extracted from collectible trading card games. More recently, Yin and Neubig [2017] proposed a syntax-aware neural model that generates Abstract Syntax Trees from natural language descriptions, which then get mapped deterministically to the tar- get source code. The decoder is guided by a pre- defined grammar, so their solution is agnostic of the target programming language. Using this syntax aware decoding mechanism, they show to improve the SEQ2SEQ baseline for code generation. Another related topic is semantic parsing using deep neural networks. Semantic parsing focuses on converting natural language into logical forms which are used for querying knowledge bases [Be- rant et al., 2013] and has also been successfully used for NLIDBs. Recent neural approaches for seman- tic parsing [Dong and Lapata, 2016, Herzig and Be- rant, 2017] use a SEQ2SEQ network that maps nat- ural language text to logical forms. Recent solutions bypass the need for ground truth logical forms and instead train a supervised neural model from query- answer pairs [Yin et al., 2015, Neelakantan et al., 2016]. 2.3 Existing corpora for NLIDB evaluation Solutions to the NLIDB problem have been tradi- tionally evaluated against databases with few tables and on validation datasets with a small number of entries. One of the most complex databases for NLIDB evaluation is ATIS (Air Travel Information Corpus) [Hemphill et al., 1990], which stores information 3 Dataset ATIS NLmaps MAS IMDB Yelp SENLIDB Train SENLIDB Test # Tables 27 N/A 17 16 7 29 15 # Columns - N/A 53 65 38 204 98 # Text queries 2,866 2,380 196 131 128 24,890 780 # SQL queries N/A N/A 196 131 128 24,890 296 Table 1: Comparison of existing datasets and the SENLIDB corpora for NLIDB systems about data flights and features 27 tables. However, it only has 2,886 natural language queries and no corresponding SQL statements, making it unsuitable for a data-driven approach. Most recent systems have moved to validation datasets which contain both the natural language query and the correspond- ing SQL snippet, such as MAS (Microsoft Academic Search), IMDB, and Yelp. For example, Sqlizer [Yaghmazadeh et al., 2017] achieves 80% accuracy on MAS, while NaLIR [Li and Jagadish, 2014] ob- tains only 32% accuracy on the same data. There also exist some slightly larger corpora for query- ing geolocation databases, the largest being NLmaps [Haas and Riezler, 2016] which contains 2,380 text queries but with no corresponding SQL code (instead they use machine readable language - MRL for ex- pressing queries). The training set (SENLIDB Train) proposed in this paper is by far larger than any of the existing datasets, as can be seen from Table 1. This makes it extremely useful for training solutions using ma- chine learning, including neural NLIDBs. More, the test set (SENLIDB Test), which has been manually annotated by two experts, is twice as large as current validation corpora and contains several text formula- tions for the same SQL query. 3 Dataset construction A deep neural architecture, such as SEQ2SEQ, re- quires a large number of input-output pairs to pro- duce qualitative results. The next subsections de- scribe the steps taken to build the SENLIDB dataset, including our attempts to correct some of the prob- lems inherent with crowdsourced data. 3.1 Data crawling and preprocessing The Stack Exchange Data Explorer allows users to query the entire database of the well-known question-answering platform through a public API1. The database uses Microsoft SQL Server, therefore users query it using the SQL extension developed by Microsoft, called Transact-SQL (T-SQL). For each query to the Stack Exchange database issued by a user, the web interface enforces the user to add a ti- tle and also an optional longer description. The main rationale for these two fields is for users to provide an accurate textual description for each query they make. However, there is no method to ensure that the title or the description entered for a query are ac- tually relevant in describing it. 1http://data.stackexchange.com/ stackoverflow/query/new 4 The list of all user queries is available online2 and Stack Exchange offers various sorting and fil- tering capabilities including most upvoted or viewed queries. An important characteristic is that all avail- able queries are correct, meaning that they do not throw any errors when querying the Stack Exchange database. Moreover, some of them are "interactive" - users can input values in the web interface for tem- porary variables enclosed by '##' or '#' in the SQL query. In order to build the proposed dataset, we started by crawling all user queries from Stack Exchange, as they appear in the section 'Everything' ordered descending by creation date 3. First of all, we dis- carded SQL snippets longer than 2, 000 characters as we considered them to be too complex. This step resulted in about 2, 000, 000 queries. The next step was to create pairs of textual description (which in- cluded the title and the actual description of a query) and corresponding SQL snippet. We then removed duplicate pairs (identical SQL code and description) and approximately 600,000 pairs were left. After this step, we removed items with SQL code in the de- scription using simple empirical rules (descriptions starting with 'select' and containing 'from'). The remaining dataset was reduced to roughly 170,000 pairs. Afterwards, we removed the comments from the SQL snippets and eliminated the entries that now had void snippets. Finally, we took away items with identical textual descriptions and different SQL snip- pets. For description d and corresponding SQL snip- pets s1, ..., sn, we kept the code snippet si of median length, as we consider that an average length descrip- tion is probably better than very long and very short ones which are probably outliers. This resulted in 2http://data.stackexchange.com/ stackoverflow/queries 3http://data.stackexchange.com/ stackoverflow/queries?order_by=everything a dataset with 24,890 items, each having an unique textual description and an associated SQL query. Although descriptions in this dataset are unique, there are 2, 225 identical SQL queries with different descriptions. 3.2 Large dataset for training and valida- tion We consider that the previously described dataset can be used effectively for training machine learn- ing models for NLIDB, including more data-hungry models such as neural NLIDBs. As this corpus was created by a large number of users from the Stack Exchange data portal, one might expect that the qual- ity of the entries to be similar to other corpora cre- ated using various crowdsourcing mechanisms. To this extent, although this dataset can also be used for validation (using either cross-validation or a hold-out set), the results will be impacted by the inherent bi- ases, noise and errors collected through crowdsourc- ing. Some of the particularities of these data are ad- dressed next. First, most of the SQL snippets are relatively sim- ple, containing at most 10 distinct tokens, as can be easily seen in Table 2. In contrast, textual descrip- tions are more evenly distributed, based on the num- ber of tokens, with 2, 003 of the entries in the dataset having more than 100 tokens. Thus although some queries might have an incomplete textual descrip- tion, most of them are well explained. Second, the Stack Exchange database schema available in the dataset contains 29 tables. Interest- ingly, their actual appearances in the dataset, judging by the number of occurrences in individual queries, follows Zipf's law [Zipf, 1949] as it can be observed in Table 3. We note that a large majority of queries refer to the 'Posts' and 'Users' tables, while other ta- bles make almost no appearance in the dataset (e.g. 'PostNotices', 'PostNoticeTypes'). In Table 4 we 5 # SQL query tokens 2-4 5-10 11-20 21-50 51+ Total # text tokens 1-10 11-25 26-50 51-100 100+ Total 2094 641 121 21 1 2878 3321 2547 724 239 10 6841 2634 3182 1150 470 35 7471 1536 2306 876 584 99 5401 605 742 318 266 72 2003 10190 9418 3189 1580 217 (a) Length statistics for the training dataset # text tokens 1-10 11-25 26-50 51-100 Total 88 270 77 1 436 1 69 181 34 285 0 8 23 18 49 89 351 285 55 0 4 4 2 10 #SQL query tokens 2-4 5-10 11-20 21-50 Total (b) Length statistics for the test dataset Table 2: Overview of the number of tokens from the SQL snippet and the textual description for the SEN- LIDB corpora Table name Posts Users Tags Posttags Votes Comments Posthistory Badges Posttypes Votetypes Other tables # occur. train 15159 7672 4765 3370 2476 1583 1214 625 616 336 1080 # occur. test 383 229 134 39 22 41 2 16 4 6 16 Table 3: Most frequent table names in SENLIDB sorted descending by occurrences in training set 6 SQL expr. select from where order count join group # occur. train 22145 21982 18894 13114 8294 7943 7366 # occur. test 295 295 203 77 57 29 27 Table 4: Most frequent SQL expressions in SENLIDB present the most frequent SQL expressions in the datasets. Half of the queries contain ordering clauses and almost a third include multiple joined tables and group by clauses. Third, the dataset contains samples of varied dif- ficulty, from simple select operations to complex nested queries. We computed the Halstead complex- ity metrics [Halstead, 1977] to gain an insight into the difficulty of the SQL snippets in our datasets. To measure the difficulty of a snippet we used the for- mula [Halstead, 1977]: Dif f iculty = η1 2 · N η2 (1) where: η1 = number of distinct operators η2 = number of distinct operands N = total number of operands Finally, we used an off-the-shelf library 4 to detect the language of the query descriptions. More than 95% were classified as English, followed at a great distance by French and Russian with less than 100 entries each. We remarked that some of the descrip- tions contain table and column names, which could affect the language identification performance (with a small bias towards English). 3.3 Manually annotated test dataset In order to have a reliable test and validation dataset for the Stack Exchange database, we also developed a smaller corpus which was manually annotated by two senior undergraduate students in Computer Sci- ence. The SQL queries included in the test dataset are a subset of the data collected from the Stack Ex- change Data Explorer as previously described. Each 4https://pypi.python.org/pypi/polyglot 7 (a) Training dataset difficulty (b) Test dataset difficulty Figure 1: Histograms of the Halstead difficulty mea- sure for the training (a) and test (b) sets query has been labelled by at least one annotator us- ing between 1 and 3 different textual descriptions that describe the respective SQL snippet in natu- ral language (English). The annotators then ran the query in the interface and verified that the returned results are correct and correspond to the description. The total number of distinct queries is 296, while the number of textual annotations is 780, averaging to 2.63 textual reformulations per query. In order to facilitate the annotation process, the an- notators used an application which allowed the user to view a SQL query from the original dataset and add one or more possible descriptions. The SQL queries chosen for manual annotation were randomly selected from those with a very short textual descrip- tion in the original corpus, consisting of only 1-2 to- kens. These items were considered not informative enough to be included in the training set and were thus added to the human-annotated test set. In order to achieve a better understanding of how similar or different the produced annotations are, for each sample we computed the BLEU score [Papineni et al., 2002], with the smoothing function proposed in Chen and Cherry [2014], between the descriptions of one annotator and those produced by the other an- notator. The average of the scores obtained for each sample was 57.10, which is consistent with inter- translator BLEU scores observed in machine trans- lation. It is important to notice that there are some differ- ences between the train and test dataset. The most important one is highlighted in Figure 1 where the Halstead difficulty score for the test set is concen- trated between 0-5 as opposed to the train dataset where the mode is at 8. This means that the queries in the test dataset are slightly less complex than the queries in the train dataset. There are also some other differences between the two datasets, such as the dis- tribution of query and description sizes (see Table 2) and most frequent table names (see Table 3); these Dataset Validation Test-original Test-annotated Perplexity BLEU 16.9 13.5 18.2 1.16 1.24 1.23 Table 5: Perplexity and BLEU score of the gener- ated SQL statements on the validation set, original test set and annotated test set descriptions arise from how the test SQL queries were subsam- pled and annotated. 4 Model and experiments For what we consider to be the first end-to-end neu- ral NLIDB, we trained a SEQ2SEQ model with at- tention on the (description, SQL) pairs in the SEN- LIDB train set. We used the open-source neural machine translation toolkit OpenNMT (http:// opennmt.net/) [Klein et al., 2017]. This sys- tem implements a standard SEQ2SEQ model with global-general-attention [Luong et al., 2015]. Both the encoder and the decoder are long short-term memory (LSTM) cells with two hidden layers and 500 neurons. The word embedding layer has 500 neurons. We used batches of maximum size 64. We trained the models with Stochastic Gradient Descent (SGD) for 25 epochs with a learning rate of 1.0 and a learning decay of 0.5 if perplexity did not decrease on the validation set. We generated SQL statement using a beam search of size 5. Similarly to Ling et al. [2016], we report the BLEU score between the generated SQL queries and the ground truth SQL snippets in Table 5. While the BLEU score could penalize differently written, but otherwise correct, code snippets, it is still useful to measure the degree of token overlap. The results are reported for a validation set (holdout of 4, 000 random samples from the train set) and for the test 8 Natural language description top 50 users from india top 100 users with no of gold badge user rep text of highest - scored comment questions with most view Predicted SQL query select top 50 id , displayname , reputation , web- siteurl , location from users where location like india order by reputation desc select top 100 b . userid , u . displayname , count ( * ) as gold from badges b inner join users u on u . id = b . userid group by b . userid , u . displayname order by count ( b . name ) desc select reputation , count ( * ) from users group by reputation order by reputation select top 100 id as [ comment link ] , score , text from comments order by score desc select top 500 id as [ post link ] , viewcount from posts order by viewcount desc Table 6: Examples of SQL queries generated by the SEQ2SEQ model with attention Dataset Validation Test-original Test-annotated Precision Recall F1 score 0.62 0.45 0.76 0.71 0.51 0.82 0.55 0.41 0.72 Table 7: Precision, recall and F1 score for the tables identification task Dataset Validation Test-original Test-annotated Precision Recall F1 score 0.54 0.31 0.50 0.65 0.35 0.55 0.47 0.29 0.47 Table 8: columns identification task Precision, recall and F1 score for the set, using both the original and the manually anno- tated texts. We notice similar perplexities for SQL code generated from the original test titles and from the manually annotated ones, which means that both generate likely code. This is to be expected as the de- coder is trained on SQL select statement therefore it will probably generate some sort of select statement even for short input texts given to the encoder. How- ever, the original titles are much shorter compared to the annotated titles, and so the more informative natural language descriptions yield a SQL query that resembles more closely the ground truth SQL under a BLEU score. Thus, although both shorter (incom- plete) and longer (and more descriptive) texts gener- ate likely SQL statements, the more descriptive man- ually annotated texts generate queries significantly more similar to the ground truth (BLEU score 18.2 vs 13.5, as reported in Table 5). The initial vocabulary for the encoder (text de- scriptions) had 6, 000 tokens, while the vocabulary of the decoder (SQL queries) consisted of 16, 000 9 tokens. This resulted in a very large embedding ma- trix, thus we decided to restrict the number of tokens for both encoder and decoder to 500 and 2, 000, re- spectively, by keeping only the most frequent tokens and replacing the others with the UNK token. Re- ducing the size of the vocabularies for both encoder and decoder resulted in a significant improvement for the performance of the model (BLEU score 18.2 vs 13.06 for the annotated test set). From a qualitative perspective, Table 6 provides several examples of SQL queries generated for the validation set. The generated SQL statement are syn- tactically correct most of the time even when the tex- tual description is incomplete or use abbreviations (e.g. "no" for "number). More, in the second ex- ample, we can also observe that the model learns to use table aliases correctly in complex queries with joined tables. On another hand, although the gener- ated queries are syntactically correct, in most cases they fail to return the desired results when they are executed against the database. When the system fails to generate the correct SQL query for a description, it still generates a query related to the natural language description. It is important to mention that, in order to cor- rectly write an SQL statement, one needs to know the schema of the database. This is an aspect that we did not take into consideration when training the baseline model. Thus the model is not explicitly pro- vided with the database schema, however it can infer it from the training set. However, we believe that more complex approaches that integrate schema in- formation and are syntax-aware can produce better results than a SEQ2SEQ model. 5 Discussion Given that, unlike natural language, SQL is highly restricted and unambiguous, we believe that the problem of generating SQL queries from natural lan- guage can be reduced to a number of independent sub-problems. For example, in order to retrieve the desired information from a database, the appropriate table columns need to be instantiated in the SELECT clauses, and the correct tables need to be instanti- ated in the FROM clause. Breaking down the com- plex task of automatically generating SQL in mul- tiple simpler tasks and working on each task sepa- rately can, in our opinion, yield significant improve- ments faster. Apart from the BLEU score, we propose two new tasks that are easier than the NLIDB problem. This approach stemmed from the difficulty of the prob- lem and the need for a more structured grasp of the performance of a certain system on this task. There- fore, we chose to also evaluate the ability of the pro- posed NNLIDB to correctly instantiate tables and columns from the database schema. For these two tasks, the most important metrics are precision and recall. For example, given a sample from the dataset, we compare the SQL query generated by the neu- ral network architecture with the correct SQL state- ment and count existing and missing table and col- umn names. In tables 7 and 8 we evaluate the performance of our baseline on the tables and columns identifica- tion tasks. We observe that on the validation and annotated test set, precision and recall scores are significantly higher, due to the fact that these are more informative than the original test set descrip- tions. Given the fact that the database schema con- tains a total of 29 entities (table names) and 204 attributes (column names), the precision and recall scores prove that the baseline model delivers de- cent performance on these tasks and moreover, that both tasks are representative for measuring the per- formance of a system on the NLIDB problem. It is important to mention that, for the sake of simplic- ity, for the columns identification task we ignored 10 the fact that in different tables there may be columns with the same name (e.g. "id"). Both the tables and columns identification tasks can be made more difficult using stricter evaluation. For example, for the table task, one could consider only the entities that are instantiated strictly in the FROM clause and the attributes that are instantiated in the SELECT clause. 6 Conclusions In this paper we have introduced new datasets for training and validating natural language interfaces to databases. The SENLIDB train dataset is the first large corpus designed to develop data-driven NLIDB systems and it has been successfully used to train an end-to-end neural NLIDB (NNLIDB) us- ing a SEQ2SEQ model with attention. Although the generated SQL output may sometimes be syntacti- cally invalid and is rarely the desired SQL statement for the given textual query, the results are promising. The pursuit of a successful NNLIDB is still at the beginning and we hope that the current research will provide the first steps needed to investigate more complex solutions. Future research will investigate whether using a stacked decoder - one for generating a query sketch (e.g. subclauses) and one for the ele- ments related to the database schema - will provide a better solution. In comparison with existing approaches for NLIDB systems, our solution does not use any rules, heuristics or information about the underlying database schema or SQL syntax. On the other hand, the generated SQL queries are more often than not inaccurate and thus we have not compared the accu- racy of the NNLIDB with existing solutions. How- ever, we have focused on verifying how similar the generated SQL queries are to the annotated ones us- ing measures from machine translation (BLEU) and also precision and recall for simpler tasks, such as generating the correct table and column names in a SQL statement. References I. Androutsopoulos, G.D. Ritchie, and P. Thanisch. Natural language interfaces to databases an in- troduction. Natural Language Engineering, 1(1): 2981, 1995. doi: 10.1017/S135132490000005X. Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine transla- tion by jointly learning to align and trans- late. URL http://arxiv.org/abs/1409.0473. CoRR, abs/1409.0473, 2014. Jonathan Berant, Andrew Chou, Roy Frostig, and Percy Liang. Semantic parsing on freebase from In Proceedings of the question-answer pairs. 2013 Conference on Empirical Methods in Nat- ural Language Processing, EMNLP 2013, 18- 21 October 2013, Grand Hyatt Seattle, Seat- tle, Washington, USA, A meeting of SIGDAT, a Special Interest Group of the ACL, pages 1533– 1544, 2013. URL http://aclweb.org/ anthology/D/D13/D13-1160.pdf. Boxing Chen and Colin Cherry. A systematic com- parison of smoothing techniques for sentence- level bleu. ACL 2014, page 362, 2014. E. F. Codd. Seven steps to rendezvous with In IFIP Working Conference the casual user. Data Base Management, pages 179–200, January 1974. URL http://dblp.uni-trier.de/ db/conf/ds/dbm74.html#Codd74. IBM Research Report RJ 1333, San Jose, California. Li Dong and Mirella Lapata. Language to CoRR, logical form with neural attention. 11 abs/1601.01280, 2016. URL http://arxiv. org/abs/1601.01280. Carolin Haas and Stefan Riezler. A corpus and se- mantic parser for multilingual natural language In Proceedings of querying of openstreetmap. NAACL-HLT, pages 740–750, 2016. Maurice Howard Halstead. Elements of software sci- ence, volume 7. Elsevier New York, 1977. Charles T Hemphill, John J Godfrey, George R Dod- dington, et al. The atis spoken language systems pilot corpus. In Proceedings of the DARPA speech and natural language workshop, pages 96–101, 1990. Gary G. Hendrix, Earl D. Sacerdoti, Daniel Saga- Developing lowicz, and Jonathan Slocum. language interface to complex data. a natural ACM Trans. Database Syst., 3(2):105–147, June 1978. ISSN 0362-5915. doi: 10.1145/320251. 320253. URL http://doi.acm.org/10. 1145/320251.320253. Jonathan Herzig and Jonathan Berant. Neural se- mantic parsing over multiple knowledge-bases. CoRR, abs/1702.01569, 2017. URL http:// arxiv.org/abs/1702.01569. Guillaume Klein, Yoon Kim, Yuntian Deng, Jean Senellart, and Alexander M. Rush. Opennmt: Open-source toolkit for neural machine transla- tion. CoRR, abs/1701.02810, 2017. URL http: //arxiv.org/abs/1701.02810. Fei Li and H. V. Jagadish. Constructing an in- teractive natural language interface for relational Proc. VLDB Endow., 8(1):73–84, databases. September 2014. doi: 10. 14778/2735461.2735468. URL http://dx. doi.org/10.14778/2735461.2735468. ISSN 2150-8097. Wang Ling, Edward Grefenstette, Karl Moritz Her- mann, Tomas Kocisky, Andrew Senior, Fumin Wang, and Phil Blunsom. Latent Predictor Net- works for Code Generation. Acl, pages 1–13, 2016. Minh-Thang Luong, Hieu Pham, and Christopher D Effective approaches to attention- Manning. based neural machine translation. arXiv preprint arXiv:1508.04025, 2015. Christopher D. Manning, Mihai Surdeanu, John Bauer, Jenny Finkel, Steven J. Bethard, and David McClosky. The Stanford CoreNLP natural In Association language processing toolkit. for Computational Linguistics (ACL) System Demonstrations, pages 55–60, 2014. URL http://www.aclweb.org/anthology/ P/P14/P14-5010. Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg Corrado, and Jeffrey Dean. Distributed rep- resentations of words and phrases and their In Proceedings of the 26th compositionality. International Conference on Neural Information Processing Systems, NIPS'13, pages 3111– 3119, USA, 2013. Curran Associates Inc. URL http://dl.acm.org/citation.cfm? id=2999792.2999959. Lili Mou, Rui Men, Ge Li, Lu Zhang, and Zhi Jin. On End-to-End Program Generation from User Intention by Deep Neural Networks. Arxiv, (March 2016), 2015. URL http://arxiv. org/abs/1510.07211. Arvind Neelakantan, Quoc V. Le, Mart´ın Abadi, An- drew McCallum, and Dario Amodei. Learning a natural language interface with neural program- mer. CoRR, abs/1611.08945, 2016. URL http: //arxiv.org/abs/1611.08945. 12 Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic eval- uation of machine translation. In Proceedings of the 40th annual meeting on association for com- putational linguistics, pages 311–318. Associa- tion for Computational Linguistics, 2002. Ana-Maria Popescu, Alex Armanasu, Oren Etzioni, David Ko, and Alexander Yates. Modern nat- ural language interfaces to databases: Compos- ing statistical parsing with semantic tractability. In Proceedings of the 20th International Con- ference on Computational Linguistics, COLING '04, Stroudsburg, PA, USA, 2004. Association for Computational Linguistics. doi: 10.3115/ 1220355.1220376. URL https://doi.org/ 10.3115/1220355.1220376. Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer Networks. ISSN 10495258. URL http://arxiv.org/abs/ 1506.03134. pages 1–9, 2015. Navid Yaghmazadeh, Yuepeng Wang, Isil Dillig, and Thomas Dillig. Type- and content-driven synthe- sis of SQL queries from natural language. CoRR, abs/1702.01168, 2017. URL http://arxiv. org/abs/1702.01168. Pengcheng Yin and Graham Neubig. A Syntactic Neural Model for General-Purpose Code Genera- tion. 2017. URL http://arxiv.org/abs/ 1704.01696. Pengcheng Yin, Zhengdong Lu, Hang Li, and Ben Kao. Neural enquirer: Learning to query tables. arXiv preprint arXiv:1512.00965, 2015. George Kingsley Zipf. Human behavior and the principle of least effort: An introduction to human ecology. Ravenio Books, 1949. 13
1709.09587
3
1709
2017-11-20T20:32:26
Multi-Label Classification of Patient Notes a Case Study on ICD Code Assignment
[ "cs.CL", "cs.AI" ]
In the context of the Electronic Health Record, automated diagnosis coding of patient notes is a useful task, but a challenging one due to the large number of codes and the length of patient notes. We investigate four models for assigning multiple ICD codes to discharge summaries taken from both MIMIC II and III. We present Hierarchical Attention-GRU (HA-GRU), a hierarchical approach to tag a document by identifying the sentences relevant for each label. HA-GRU achieves state-of-the art results. Furthermore, the learned sentence-level attention layer highlights the model decision process, allows easier error analysis, and suggests future directions for improvement.
cs.CL
cs
Multi-Label Classification of Patient Notes: Case Study on ICD Code Assignment Tal Baumel Ben-Gurion University Beer-Sheva, Israel Ben-Gurion University Beer-Sheva, Israel Jumana Nassour-Kassis Raphael Cohen Chorus.ai San Francisco, CA Michael Elhadad Ben-Gurion University Beer-Sheva, Israel No´emie Elhadad Columbia University New York, NY 7 1 0 2 v o N 0 2 ] L C . s c [ 3 v 7 8 5 9 0 . 9 0 7 1 : v i X r a Abstract The automatic coding of clinical documentation according to diagnosis codes is a useful task in the Electronic Health Record, but a challenging one due to the large number of codes and the length of patient notes. We investigate four models for assigning multiple ICD codes to discharge summaries, and experiment with data from the MIMIC II and III clinical datasets. We present Hierarchical Attention- bidirectional Gated Recurrent Unit (HA-GRU), a hierarchi- cal approach to tag a document by identifying the sentences relevant for each label. HA-GRU achieves state-of-the art re- sults. Furthermore, the learned sentence-level attention layer highlights the model decision process, allows for easier error analysis, and suggests future directions for improvement. Introduction In Electronic Health Records (EHRs), there is often a need to assign multiple labels to a patient record, choosing from a large number of potential labels. Diagnosis code assign- ment is such a task, with a massive amount of labels to chose from (14,000 ICD9 codes and 68,000 ICD10 codes). Large- scale multiple phenotyping assignment, problem list iden- tification, or even intermediate patient representation can all be cast as a multi-label classification over a large label set. More recently, in the context of predictive modeling, approaches to predict multiple future healthcare outcomes, such as future diagnosis codes or medication orders have been proposed in the literature. There again, the same setup occurs where patient-record data is fed to a multi-label clas- sification over a large label set. In this paper, we investigate how to leverage the unstruc- tured portion of the EHR, the patient notes, along a novel ap- plication of neural architectures. We focus on three charac- teristics: (i) a very large label set (6,500 unique ICD9 codes and 1,047 3-digit unique ICD9 codes); (ii) a multi-label set- ting (up to 20 labels per instance); (iii) instances are long documents (discharge summaries on average 1,900-word long); and (iv) furthermore, because we work on long docu- ments, one critical aspect of the multi-label classification is transparency-to highlight the elements in the documents that explain and support the predicted labels. While there has been much work on each of these characteristics, there Copyright c(cid:13) 2018, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. has been limited work to tackle all at once, particularly in the clinical domain. We experiment with four approaches to classification: an SVM-based one-vs-all model, a continuous bag-of-words (CBOW) model, a convolutional neural network (CNN) model, and a bidirectional Gated Recurrent Unit model with a Hierarchical Attention mechanism (HA-GRU). Among them, the attention mechanism of the HA-GRU model provides full transparency for classification deci- sions. We rely on the publicly available MIMIC datasets to validate our experiments. A characteristic of the healthcare domain is long documents with a large number of technical words and typos/misspellings. We experiment with simple yet effective preprocessing of the input texts. Our results show that careful tokenization of the input texts, and hierarchical segmentation of the original docu- ment allow our Hierarchical Attention GRU architecture to yield the most promising results, over the SVM, CBOW, and CNN models, while preserving the full input text and provid- ing effective transparency. Previous Work We review previous work in the healthcare domain as well as recent approaches to extreme multi-label classification, which take place in a range of domains and tasks. Multi-label Patient Classifications Approaches to classification of patient records against mul- tiple labels fall into three types of tasks: diagnosis code as- signment, patient record labeling, and predictive modeling. Diagnosis Code Assignment. Automated ICD coding is a well established task, with several methods proposed in the literature, ranging from rule based (Crammer et al. 2007; Farkas and Szarvas 2008) to machine learning such as sup- port vector machines, Bayesian ridge regression, and K- nearest neighbor (Larkey and Croft 1995; Lita et al. 2008). Some methods exploit the hierarchical structure of the ICD taxonomy (Perotte et al. 2011; Perotte et al. 2014), while others incorporated explicit co-occurrence relations between codes (Kavuluru, Rios, and Lu 2015). In many cases, to han- dle the sheer amount of labels, the different approaches fo- cus on rolled-up ICD codes (i.e., 3-digit version of the codes and their descendants in the ICD taxonomy) or on a subset of the codes, like in the shared community task for radiology code assignment (Pestian et al. 2007). It is difficult to compare the different methods proposed, since each relies on different (and usually not publicly avail- able) datasets. We experiment with the MIMIC dataset, since it is publicly available to the research community. Methods- wise, our approach departs from previous work in two im- portant ways: we experiment with both massively large and very large label sets (all ICD9 code and rolled-up ICD9 codes), and we experiment with transparent models that highlight portions of the input text that support the assigned codes. Patient Record Labeling. Other than automated diagno- sis coding, most multi-label patient record classifiers fall in the tasks of phenotyping across multiple conditions at once. For instance, the UPhenome model takes a probabilistic gen- erative approach to assign 750 latent variables (Pivovarov et al. 2015). More recently, in the context of multi-task learn- ing, Harutyunyan and colleagues experimented with pheno- typing over 25 critical care conditions (Harutyunyan et al. 2017). Predictive Modeling. Previous work in EHR multi-label classification has mostly focused on predictive scenarios. The size of the label set varies from one approach to an- other, and most limit the label set size however: DeepPa- tient (Miotto et al. 2016) predicts over a set of 78 condi- tion codes. (Lipton et al. 2015) leverage an LSTM model to predict over a vocabulary of 128 diagnosis codes. Doc- torAI (Choi, Bahadori, and Sun 2015) predicts over a set of 1,183 3-digit ICD codes and 595 medication groups. The Survival Filter (Ranganath et al. 2015) predicts a series of future ICD codes across approximately 8,000 ICD codes. Inputs to Multi-Label Classifications. Most work in multi-label classification takes structured input. For in- stance, the Survival Filter expects ICD codes as input to predict the future ICD codes. DoctorAI takes as input med- ication orders, ICD codes, problem list, and procedure or- ders at a given visit. Deep Patient does take the content of notes as input, but the content is heavily preprocessed into a structured input to their neural network, by tagging all texts with medical named entities. In contrast, our approach is to leverage the entire content of the input texts. Our work contributes to clinical natural language processing (Dem- ner Fushman and Elhadad 2016), which only recently in- vestigated neural representations and architectures for tra- ditional tasks such as named entity recognition (Jagannatha and Yu 2016). Multi-label Extreme Classification In extreme multi-label learning, the objective is to anno- tate each data point with the most relevant subset of labels from an extremely large label set. Much work has been car- ried outside of the healthcare domain on tasks such as im- age classification (Tsoumakas and Katakis 2006; Weston, Bengio, and Usunier 2011), question answering (Choi et al. 2016), and advertising (Jain, Prabhu, and Varma 2016). In (Weston, Bengio, and Usunier 2011), the task of annotating a very large dataset of images (> 10M) with a very large label set (> 100K) was first addressed. The authors introduced the WSABIE method which relies on two main features: (i) records (images) and labels are embedded in a shared low- dimension vector space; and (ii) the multi-label classifica- tion task is modeled as a ranking problem, evaluated with a Hamming Loss on a P@k metric. The proposed online ap- proximate WARP loss allowed the algorithm to perform fast enough on the scale of the dataset. We found that in our case, the standard Micro-F measure is more appropriate as we do not tolerate approximate annotations to the same extent as in the image annotation task. The SLEEC method (Bhatia et al. 2015) also relies on learning an embedding transformation to map label vectors into a low-dimensional representation. SLEEC learns an en- semble of local distance preserving embeddings to accu- rately predict infrequently occurring labels. This approach attempts to exploit the similarity among labels to improve classification, and learns different representations for clus- ters of similar labels. Other approaches attempt to reduce the cost of training over very large datasets by considering only part of the labels for each classification decision (Yen et al. 2016). SLEEC was later improved in (Jain, Prabhu, and Varma 2016) with the PfastreXML method which also adopted P@k loss functions aiming at predicting tail labels. In (Joulin et al. 2016), the FastText method was intro- duced as a simple and scalable neural bag of words approach for assigning multiple labels to text. We test a similar model (CBOW) in our experiments as one of our baselines. Dataset and Preprocessing We use the publicly available de-identified MIMIC dataset of ICU stays from Beth Israel Deaconess Medical Cen- ter (Saeed et al. 2011; Johnson et al. 2016). MIMIC Datasets To test the impact of training size, we relied on both the MIMIC II (v2.6) and MIMIC III (v1.4) datasets. MIMIC III comprises records collected between 2001 and 2012, and can be described as an expansion of MIMIC II (which com- prises records collected between 2001 and 2008), along with some edits to the dataset (including de-identification proce- dures). To compare our experiments to previous work in ICD cod- ing, we used the publicly available split of MIMIC II from (Perotte et al. 2014). It contains 22,815 discharge summaries divided into a training set (20,533 summaries) and a test- set of unseen patients (2,282 summaries). We thus kept the same train and the test-set from MIMIC II, and constructed an additional training set from MIMIC III. We made sure that the test-set patients remained unseen in this training set as well. Overall, we have two training sets, which we refer to as MIMIC II and MIMIC III, and a common test-set com- prising summaries of unseen patients. While there is a large overlap between MIMIC II and MIMIC III, there are also marked differences. We found Nb of records Nb of unique tokens Avg nb of tokens / record Avg nb of sentences / record Nb of full labels Nb of rolled-up labels Label Cardinality Label Density % labels with 50+ records MIMIC II MIMIC III 49,857 119,171 1,947 112 6,527 1,047 11.48 0.0018 18.19% 20,533 69,248 1,529 90 4,847 948 9.24 0.0019 11.33% Test Set 2,282 33,958 1,893 104 2,451 684 11.42 0.0047 4.08% Table 1: Datasets descriptive statistics. many cases where discharge summaries from 2001-2008 are found in one dataset but not in the other. In addition, MIMIC III contains addenda to the discharge summaries that were not part of MIMIC II. After examining the summaries and their addenda, we noticed that the addenda contain vital in- formation for ICD coding that is missing from the main dis- charge summaries; therefore, we decided to concatenate the summaries with their addenda. Table 1 reports some descriptives statistics regarding the datasets. Overall, MIMIC III is larger than MIMIC II from all standpoints, including amounts of training data, vocabu- lary size, and overall number of labels. ICD9 Codes Our label set comes from the ICD9 taxonomy. The Interna- tional Classification of Diseases (ICD) is a repository main- tained by the World Health Organization (WHO) to provide a standardized system of diagnostic codes for classifying diseases. It has a hierarchical structure, connecting specific diagnostic codes through is-a relations. The hierarchy has eight levels, from less specific to more specific. ICD codes contain both diagnosis and procedure codes. In this paper, we focus on diagnosis codes only. ICD9 codes are conveyed as 5 digits, with 3 primary digits and 2 secondary ones. Table 1 provides the ICD9 label cardinality and density as defined by (Tsoumakas and Katakis 2006). Cardinality is the average number of codes assigned to records in the dataset. Density is the cardinality divided by the total num- ber of codes. For both training sets, the number of labels is of the same order as the number of records, and the label den- sity is extremely low. This confirms that the task of code as- signment belongs to the family of extreme multi-label clas- sification. We did not filter any ICD code based on their frequency. We note, however that there are approximately 1,000 fre- quent labels (defined as assigned to at least 50 records) (Ta- ble 1). We experimented with two versions of the label set: one with all the labels (i.e., 5-digit), and one with the labels rolled up to their 3-digit equivalent. Input Texts Tokenization. Preprocessing of the input records com- prised the following steps: (i) tokenize all input texts us- ing spaCy library 1; (ii) convert all non-alphabetical char- acters to pseudo-tokens (e.g., "11/2/1986" was mapped to "dd/d/dddd"); (iii) build the vocabulary as tokens that appear at least 5 times in the training set; and (iv) map any out-of- vocabulary word to its nearest word in the vocabulary (using the edit distance). This step is simple, yet particularly useful in reducing the number of misspellings of medical terms. These preprocessing steps has a strong impact on the vo- cabulary. For instance, there were 1,005,489 unique tokens in MIMIC III and test set before preprocessing, and only 121,595 remaining in the vocabulary after preprocessing (an 88% drop). This step improved F-measure performance by 0.5% when tested on the CBOW and CNN methods (not reported). Hierarchical Segmentation. Besides tokenization of the input texts, we carried one more level of segmentation, at the sentence level (using the spaCy library as well). There are two reasons for preprocessing the input texts with sentence segmentation. First, because we deal with long documents, it is impossible and ineffective to train a sequence model like an GRU on such long sequences. In previous approaches in document classification, this problem was resolved by trun- cating the input documents. In the case of discharge sum- maries, however, this is not an acceptable solution: we want to preserve the entire document for transparency. Second, we are inspired by the moving windows of (Johnson and Zhang 2014) and posit that sentences form linguistically inspired windows of word sequences. Beyond tokens and sentences, discharge summaries ex- hibit strong discourse-level structure (e.g., history of present illness and past medical history, followed by hospital course, and discharge plans) (Li, Lipsky Gorman, and Elhadad 2010). This presents an exciting opportunity for future work to exploit discourse segments as an additional representation layer of input texts. Methods We describe the four models we experimented with. ICD coding has been evaluated in the literature according to dif- ferent metrics: Micro-F, Macro-F, a variant of Macro-F that takes into account the hierarchy of the codes (Perotte et al. 2014), Hamming and ranking loss (Wang et al. 2016), and a modified version of mean reciprocal rank (MRR) (Subotin and Davis 2014). We evaluate performance using the Micro- F metric, since it is the most commonly used metric. SVM. We used Scikit Learn (Pedregosa et al. 2011) to im- plement a one-vs-all, multi-label binary SVM classifier. Fea- tures were bag of words, with tf*idf weights (determined from the corpus of release notes) for each label. Stop words were removed using Scikit Learn default English stop-word list. The model fits a binary SVM classifier for each label (ICD code) against the rest of the labels. We also experi- mented with χ2 feature filtering to select the top-N words 1https://spacy.io/ diagnoses that share lexical words will not be distinguished by the model. CNN. To address the problems of the CBOW model, the next model we investigate is a convolutional neural network (CNN). A one dimensional convolution applied on list of embedded words could be considered as a type of n-gram model, where n is the convolution filter size. The architecture of this model is very similar to the CBOW model, but instead of averaging the embedded words we apply a one dimensional convolution layer with filter f, followed by a max pooling layer. On the output of the max pool layered a fully connected layer was applied, like in the CBOW model. We also experimented with deeper convolu- tion networks and inception module (LeCun 2015), but they did not yield improved results. Embedding = E · [w1, w2, ..., wn] Conved = max i∈channels (Embedding ∗ f ) P rob = sigmoid(W · Conved + b) In our experiments, we used the same embedding parameter as in the CBOW model. In addition, we set the number of channels to 300, and the filter size to 3. HA-GRU. We now introduce the Hierarchical Attention- bidirectional Gated Recurrent Unit model (HA-GRU) an adaptation of a Hierarchical Attention Networks (Yang et al. 2016) to be able to handle multi-label classification. A Gated Recurrent Unit (GRU) is a type of Recurrent Neural Network. Since the documents are long (see Table 1 ad up to 13,590 tokens in the MIMIC III training set), a regular GRU applied over the entire document is too slow as it re- quires number layers of the document length. Instead we ap- ply a hierarchal model with two levels of bidirectional GRU encoding. The first bidirectional GRU operates over tokens and encodes sentences. The second bidirectional GRU en- codes the document , applied over all the encoded sentences. In this architecture, each GRU is applied to a much shorter sequence compared with a single GRU. To take advantage of the property that each label is in- voked from different parts of the text, we use an attention mechanism over the second GRU with different weights for each label. This allows the model to focus on the relevant sentences for each label (Choi et al. 2016). To allow clarity into what the model learns and enable error analysis atten- tion is also applied over the first GRU with the same weights for all the labels. Each sentence in the input text is encoded to a fixed length vector (64) by applying an embedding layer over all the in- puts, applying a bidirectional GRU layer on the embedded words, and using a neural attention mechanism to encode the bidirectional GRU outputs (size of 128). After the sen- tences are encoded into a fixed length vector, we apply a second bidirectional GRU layer over the sentences using dif- ferent attention layers to generate an encoding specified to each class (128 × #labels). Finally we applied a fully con- nected layer with softmax for each classifier to determine if the label should be assigned to the document. Training is Figure 1: CBOW architecture on the left and CNN model architecture on the right. according to their mutual information with each label, but this did not improve performance. CBOW. The continuous-bag-of-words (CBOW) model is inspired by the word2vec CBOW model (Mikolov et al. 2013) and FastText (Joulin et al. 2016). Both methods use a simple neural-network to create a dense representation of words and use the average of this representation for predic- tion. The word2vec CBOW tries to predict a word from the words that appear around it, while our CBOW model for ICD classification predicts ICD9 codes from the words of its input discharge summary. The model architecture consists of an embedding layer applied to all the words in a given input text [w1, w2, ..., wn], where wi is a one-hot encoding vector of the vocabulary. E is the embedding matrix with dimension nemb × V , where V is the size of the vocabulary and nemb is the embedding size (set to 100). The embedded words are averaged into a fixed-size vec- tor and are fed to a fully connected layer with a matrix W and bias b, where the output dimension is the number of labels. We use a sigmoid activation on the output layer so all values are in the range of [0 − 1] and use a fixed threshold (0.5) to determine whether to assign a particular label. To train the model, we used binary cross-entropy loss (loss(target, output) = −(target · log(output) + (1 − target) · log(1 − output)). Embedding = E · [w1, w2, ..., wn] Averaged = 1/nΣe∈Embedding (e) P rob = sigmoid(W · Averaged + b) While the model is extremely lightweight and fast it suf- fers from known bag-of-words issues: (i) it ignores word or- der; i.e., if negation will appear before a diagnosis mention, the model would not be able to learn this; (ii) multi-word- expressions cannot be identified by the model, so different Embedding𝑤"𝑤#𝑤$𝑤%…Max PoolingFully Connected (Sigmoid Activation)Binary Cross-Entropy LossConvolution LayerEmbedding𝑤"𝑤#𝑤$𝑤%…AverageFully Connected (Sigmoid Activation)Binary Cross-Entropy Loss ICD9 codes Rolled-up ICD9 codes MIMIC II MIMIC III MIMIC II MIMIC III 28.13% 30.60% 33.25% 36.60% 32.50% 42.06% 46.40% 53.86% 53.02% 43.30% 52.64% 55.86% 22.25% 30.02% 40.72% 40.52% SVM CBOW CNN HA-GRU Table 2: Micro-F on two settings (full and rolled-up ICDs) and for the four models when trained on MIMIC II or MIMIC III datasets. Results Model Comparison To evaluate the proposed methods on the MIMIC datasets, we conducted the following experiments. In the first setting we considered all ICD9 codes as our label set. We trained the SVM, CBOW, and CNN on the MIMIC II and on the MIMIC III training sets separately. All models were evalu- ated on the same test set according to Micro-F. In the second setting, we only considered the rolled-up ICD9 codes to their 3-digit codes. There (Table 2). HA-GRU gives the best results in the rolled-up ICD9 set- ting, with a 7.4% and 3.2% improvement over the CNN and SVM, the second best methods, in MIMIC II and MIMIC III respectively. In the full ICD-9 scenario, all methods yield better results when trained on MIMIC III rather than on MIMIC II. This is expected considering the larger size of MIMIC III over II. We note that our CNN yields the best Micro-F when trained on MIMIC III passing the HA-GRU by a small margin. In comparison to the previous work of (Perotte et al. 2014), our one-vs-all SVM yielded better results than their flat and hierarchy classifiers. This trend was confirmed when training on the new MIMIC III set, as well as when using the same evaluation metrics of (Perotte et al. 2014). We attribute these improved results both to the one-vs-all approach as well as our tokenization approach. Figure 2: HA-GRU model architecture overview. sifier separately (loss(target, output) = −(cid:80) achieved by using categorical cross-entropy on every clas- x ouput(x) · log(target(x))) AttW eight(ini, v, w) = v · tanh(w · (ini)) AttW eight(ini, v, w) = (cid:80) e eAttW eight(ini,v,w) j AttW eightj (v,w) Attend(in, v, w) = sum(ini · AttW eight(ini, v, w)) Embedding = E · [w1, w2, ..., wn] EncSentsj = Attend(GRU words(Embedding), vwords, wwords) EncDoclabel = Attend(GRUsents(EncSents, vlabel, wlabel), ) P roblabel = sof tmax(pwlabel · EncDoclabel + pblabel) Where wi is a one-hot encoding vector of the vocabu- lary size V , E is an embedding matrix size of nemb × V , GRUwords is a GRU layer with state size hstate, wwords is a square matrix (hstate × hstate) and vwords is a vec- tor (hstate) for the sentence level attention. GRUsents is a GRU layer with state size of hstate. wlabel is a square ma- trix (hstate × hstate) and vlabel is a vector (hstate) for the document level attention for each class, pwlabel is a matrix (hstate × 2) and pblabel is a bias vector with a size of 2 for each label. We implemented the model using DyNet (Neu- big et al. 2017)2. Label Frequency We also tested the effect label frequency on the performance of the HA-GRU classifier. We recalculated precision and re- call scores on subsets of labels. The subsets were created by sorting the labels by frequency they appear in MIMIC-III dataset and binning them to groups of 50 labels. As such, bin 1 comprises the 50 most frequent ICD9 codes in the training set (with an average 12% frequency over the records in the training set), codes in bin 2 had an average 1.9% frequency, codes in bin 3 appeared in 1.1% of the records, up to bin 8 which 0.2% of the records in the training set. The effect can be seen in Figure 5. We note that the recall score drops much more dramatically than the precision as the label frequency decreases. Model Explaining Power We discuss how the CNN and HA-GRU architectures can support model explaining power. Figure 3: Zoom-in of the sentence encoder and classifier. 2Code available at https://github.com/talbaumel/ MIMIC. ClassifiersClassifiers𝑤","𝑤",$𝑤",%𝑤",&'…Sentence EncoderDocument GRU LayerClassifiers𝑤$,"𝑤$,$𝑤$,%𝑤$,&)…𝑤*,"𝑤*,$𝑤*,%𝑤*,&+…Sentence EncoderSentence Encoder…Embedding𝑤",$𝑤",%𝑤",&𝑤",'(…Sentence GRU LayerSentence AttentionSentence Encoder𝑠"Weighted AverageClassifier𝑠$𝑠%𝑠&𝑠'…Label AttentionWeighted AverageFully Connected LayerSoftmaxCategorical Cross-Entropy loss𝑐" Figure 4: Sample text of a patient note (one sentence per line). On the left, visualization for the with attention weights at the sentence and word levels associated with the ICD9 codes, on the left sentence level attention weights for ICD9 code "Heart failure", on the the right for code "Traumatic pneumothorax and hemothorax". find what word received the highest attention score. For ex- ample, in our experiments for label "428-Heart failure" we found that the sentence with the highest attention score was "d . congestive heart failure ( with an ejection fraction of dd % to dd % ) .", while the token "failure" was found most relevant across all labels. Figure 4 provides additional examples. Note that the "d" and "dd" tokens are from the pre-procecssing step, which mapped all numbers to pseudo- tokens. Like in the CNN, we can use this process for error anal- ysis. In fact, the HA-GRU model explains prediction with greater precision, at the sentence level. For instance, we could explore the following False Positive prediction: the model assigned the label "331-Other cerebral degenera- tions" to the sentence:"alzheimer 's dementia .". We can see that the condition was relevant to the medical note, but was mentioned under the patient's past medical history (and not a current problem). In fact, many of the False Positive labels under the HA-GRU model were due to mentions belonging to the past medical history section. This suggests that the coding task would benefit from a deeper architecture, with attention to discourse-level structure. In contrast to the CNN, the HA-GRU model can also help analyze False Negative label assignments. When we explored the False Negative labels, we found that in many cases the model found a relevant sentence, but failed to clas- sify correctly. This suggests the document-level attention mechanism is successful. For instance, for the False Neg- ative "682-Other cellulitis and abscess", the most attended sentence was "... for right lower extremity cellulitis prior to admission ...". The false positive codes for this sentence included "250-Diabetes mellitus" and "414-Other forms of chronic ischemic heart disease". We note that in the case of cellulitis, it is reasonable that the classifier preferred other, more frequent codes, as it is a common comorbid condition in the ICU.3 3Full visualizations of sample discharge summaries are https://www.cs.bgu.ac.il/talbau/ provided at mimicdemo Figure 5: Effect label frequency on HA-GRU performance when trained on MIMIC III. X-axis represents the bins of labels ranked by their frequency in the training set. CNN. To analyze the CNN prediction we can test which n-grams triggered the max-pooling layer. Given a sentence with n words we can feed it forward through the embedding layer and the convolution layer. The output of the convolu- tion a list of vectors each the size of the number of chan- nels of the convolution layer where vector corresponds to an n-gram. We can identify what triggered the max pooling layer by finding the maximum value of each channel. Thus, for predicted labels, one of the activated n-grams does in- clude information relevant for that label (whether correct for true positive labels or incorrect for false positive labels). For example in our experiments, for the label: "682.6-Cellulitis and abscess of leg, except foot" one of the activated n-gram detected was "extremity cellulitis prior". This transparency process can also be useful for error analysis while building a model, as it can highlight True Pos- itive and False Positive labels. However, it is difficult in the CNN to trace back the decisions for False Negatives predic- tions. HA-GRU For the HA-GRU model we can use attention weights to better understand what sentences and what words in that sentence contributed the most to each decision. We can find which sentence had the highest attention score for each label, and given the most important sentence, we can Conclusion We investigate four modern models for the task of extreme multi-label classification on the MIMIC datasets. Unlike previous work, we evaluate our models on all ICD9 codes thus making sure our models could be used for real world ICD9 tagging. The tokenization step, mapping rare variants using edit distance, improved results for CBOW and CNN models by 0.5%, highlighting the importance of preprocess- ing data noise problems in real-world settings. The HA-GRU model not only achieves the best performance on the task of rolled-up codes (55.86% F 1 on MIMIC III, 2.8% ab- solute improvement on the best SVM baseline) but is able to provide insight on the task for future work such as us- ing discourse-level structure available in medical notes yet never used before. The ability to highlight the decision pro- cess of the model is important for adoption of such models by medical experts. On the sub-task of MIMIC II, which includes a smaller training dataset, HA-GRU achieved 7% absolute F 1 improvement, suggesting it requires less train- ing data to achieve top performance, which is important for domain adaptation efforts when applying such models to pa- tient records from other sources (such as different hospitals). Acknowledgements This work is supported by National Institute of General Medical Sciences Grant R01GM114355 (NE) and Frankel Center for Computer Science . References 2015. [Bhatia et al. 2015] Bhatia, K.; Jain, H.; Kar, P.; Varma, M.; and Jain, P. 2015. Sparse local embeddings for extreme multi-label classification. In Advances in Neural Informa- tion Processing Systems (NIPS), 730–738. [Choi, Bahadori, and Sun 2015] Choi, E.; Bahadori, M. T.; Doctor AI: Predicting clinical and Sun, J. arXiv preprint events via recurrent neural networks. arXiv:1511.05942. [Choi et al. 2016] Choi, E.; Hewlett, D.; Lacoste, A.; Polo- sukhin, I.; Uszkoreit, J.; and Berant, J. 2016. Hierarchi- cal question answering for long documents. arXiv preprint arXiv:1611.01839. [Crammer et al. 2007] Crammer, K.; Dredze, M.; Ganchev, K.; Talukdar, P. P.; and Carroll, S. 2007. Automatic code as- signment to medical text. In Proceedings of the ACL Work- shop on BioNLP 2007: Biological, Translational, and Clin- ical Language Processing, 129–136. [Demner Fushman and Elhadad 2016] Demner Fushman, D., and Elhadad, N. 2016. Aspiring to unintended conse- quences of natural language processing: A review of recent developments in clinical and consumer-generated text pro- cessing. Yearbook of Medical Informatics 10(1):224–233. [Farkas and Szarvas 2008] Farkas, R., and Szarvas, G. 2008. Automatic construction of rule-based ICD-9-CM coding systems. BMC bioinformatics 9(3):S10. [Harutyunyan et al. 2017] Harutyunyan, H.; Khachatrian, H.; Kale, D. C.; and Galstyan, A. 2017. Multitask learn- for ing and benchmarking with clinical time series data. arXiv preprint arXiv:1703.07771. [Jagannatha and Yu 2016] Jagannatha, A. N., and Yu, H. 2016. Structured prediction models for RNN based se- quence labeling in clinical text. In Proceedings of the Con- ference on Empirical Methods in Natural Language Pro- cessing (EMNLP), 856. [Jain, Prabhu, and Varma 2016] Jain, H.; Prabhu, Y.; and Varma, M. 2016. Extreme multi-label loss functions for recommendation, tagging, ranking & other missing label ap- In Proceedings of the 22nd ACM SIGKDD In- plications. ternational Conference on Knowledge Discovery and Data Mining, 935–944. [Johnson and Zhang 2014] Johnson, R., and Zhang, T. 2014. text categorization Effective use of word order arXiv preprint with convolutional neural networks. arXiv:1412.1058. [Johnson et al. 2016] Johnson, A. E.; Pollard, T. J.; Shen, L.; Lehman, L.-w. H.; Feng, M.; Ghassemi, M.; Moody, B.; Szolovits, P.; Celi, L. A.; and Mark, R. G. 2016. MIMIC-III, a freely accessible critical care database. Scientific Data 3. [Joulin et al. 2016] Joulin, A.; Grave, E.; Bojanowski, P.; Douze, M.; J´egou, H.; and Mikolov, T. 2016. Fasttext.zip: arXiv preprint Compressing text classification models. arXiv:1612.03651. [Kavuluru, Rios, and Lu 2015] Kavuluru, R.; Rios, A.; and Lu, Y. 2015. An empirical evaluation of supervised learning approaches in assigning diagnosis codes to electronic med- ical records. Artificial Intelligence in Medicine 65(2):155– 166. [Larkey and Croft 1995] Larkey, L. S., and Croft, W. B. 1995. Automatic assignment of ICD9 codes to discharge summaries. Technical report, University of Massachusetts at Amherst, Amherst, MA. [LeCun 2015] LeCun, Y. 2015. LeNet-5, convolutional neural networks. http://yann.lecun.com/exdb/ lenet. [Li, Lipsky Gorman, and Elhadad 2010] Li, Y.; Lipsky Gor- man, S.; and Elhadad, N. 2010. Section classification in clinical notes using supervised hidden Markov model. In Proceedings of the 1st ACM International Health Informat- ics Symposium, 744–750. ACM. [Lipton et al. 2015] Lipton, Z. C.; Kale, D. C.; Elkan, C.; and Wetzell, R. 2015. Learning to diagnose with LSTM recur- rent neural networks. arXiv preprint arXiv:1511.03677. [Lita et al. 2008] Lita, L. V.; Yu, S.; Niculescu, R. S.; and 2008. Large scale diagnostic code classification Bi, J. In Proceedings of the Inter- for medical patient records. national Joint Conference on Natural Language Processing (IJCNLP), 877–882. [Mikolov et al. 2013] Mikolov, T.; Chen, K.; Corrado, G.; and Dean, J. 2013. Efficient estimation of word representa- tions in vector space. arXiv preprint arXiv:1301.3781. [Miotto et al. 2016] Miotto, R.; Li, L.; Kidd, B. A.; and Dud- ley, J. T. 2016. Deep Patient: An unsupervised represen- tional Joint Conference on Artificial Intelligence (IJCAI), volume 11, 2764–2770. [Yang et al. 2016] Yang, Z.; Yang, D.; Dyer, C.; He, X.; 2016. Hierarchical attention Smola, A.; and Hovy, E. In Proceedings of networks for document classification. NAACL-HLT, 1480–1489. [Yen et al. 2016] Yen, I. E.; Huang, X.; Zhong, K.; Raviku- mar, P.; and Dhillon, I. S. 2016. PD-Sparse: A primal and dual sparse approach to extreme multiclass and multilabel classification. In Proceedings of the International Confer- ence on Machine Learning (ICML). tation to predict the future of patients from the electronic health records. Scientific Reports 6. [Neubig et al. 2017] Neubig, G.; Dyer, C.; Goldberg, Y.; Matthews, A.; Ammar, W.; Anastasopoulos, A.; Ballesteros, M.; Chiang, D.; Clothiaux, D.; Cohn, T.; et al. 2017. Dynet: The dynamic neural network toolkit. arXiv preprint arXiv:1701.03980. [Pedregosa et al. 2011] Pedregosa, F.; Varoquaux, G.; Gram- fort, A.; Michel, V.; Thirion, B.; Grisel, O.; Blondel, M.; Prettenhofer, P.; Weiss, R.; Dubourg, V.; et al. 2011. Scikit- Journal of Machine learn: Machine learning in python. Learning Research 12(Oct):2825–2830. [Perotte et al. 2011] Perotte, A. J.; Wood, F.; Elhadad, N.; and Bartlett, N. 2011. Hierarchically supervised latent dirichlet allocation. In Advances in Neural Information Pro- cessing Systems (NIPS), 2609–2617. [Perotte et al. 2014] Perotte, A.; Pivovarov, R.; Natarajan, K.; Weiskopf, N.; Wood, F.; and Elhadad, N. 2014. Di- agnosis code assignment: models and evaluation metrics. Journal of the American Medical Informatics Association 21(2):231–237. [Pestian et al. 2007] Pestian, J. P.; Brew, C.; Matykiewicz, P.; Hovermale, D. J.; Johnson, N.; Cohen, K. B.; and Duch, W. 2007. A shared task involving multi-label classification of clinical free text. In Proceedings of the ACL Workshop on BioNLP: Biological, Translational, and Clinical Language Processing, 97–104. [Pivovarov et al. 2015] Pivovarov, R.; Perotte, A. J.; Grave, E.; Angiolillo, J.; Wiggins, C. H.; and Elhadad, N. 2015. Learning probabilistic phenotypes from heterogeneous EHR data. Journal of Biomedical Informatics 58:156–165. [Ranganath et al. 2015] Ranganath, R.; Perotte, A. J.; El- hadad, N.; and Blei, D. M. 2015. The Survival Filter: joint survival analysis with a latent time series. In UAI, 742–751. [Saeed et al. 2011] Saeed, M.; Villarroel, M.; Reisner, A. T.; Clifford, G.; Lehman, L.-W.; Moody, G.; Heldt, T.; Kyaw, T. H.; Moody, B.; and Mark, R. G. 2011. Multiparame- ter intelligent monitoring in intensive care II (MIMIC-II): a public-access intensive care unit database. Critical Care Medicine 39(5):952. [Subotin and Davis 2014] Subotin, M., and Davis, A. R. 2014. A system for predicting ICD-10-PCS codes from elec- tronic health records. In Proceedings of the ACL Workshop on Biomedical Natural Language Processing (BioNLP), 59– 67. Citeseer. [Tsoumakas and Katakis 2006] Tsoumakas, G., and Katakis, I. 2006. Multi-label classification: An overview. Interna- tional Journal of Data Warehousing and Mining 3(3). [Wang et al. 2016] Wang, S.; Chang, X.; Li, X.; Long, G.; Yao, L.; and Sheng, Q. Z. 2016. Diagnosis code assign- ment using sparsity-based disease correlation embedding. IEEE Transactions on Knowledge and Data Engineering 28(12):3191–3202. [Weston, Bengio, and Usunier 2011] Weston, J.; Bengio, S.; and Usunier, N. 2011. WSABIE: Scaling up to large vo- cabulary image annotation. In Proceedings of the Interna-
1706.00465
1
1706
2017-06-01T19:20:50
Machine Assisted Analysis of Vowel Length Contrasts in Wolof
[ "cs.CL" ]
Growing digital archives and improving algorithms for automatic analysis of text and speech create new research opportunities for fundamental research in phonetics. Such empirical approaches allow statistical evaluation of a much larger set of hypothesis about phonetic variation and its conditioning factors (among them geographical / dialectal variants). This paper illustrates this vision and proposes to challenge automatic methods for the analysis of a not easily observable phenomenon: vowel length contrast. We focus on Wolof, an under-resourced language from Sub-Saharan Africa. In particular, we propose multiple features to make a fine evaluation of the degree of length contrast under different factors such as: read vs semi spontaneous speech ; standard vs dialectal Wolof. Our measures made fully automatically on more than 20k vowel tokens show that our proposed features can highlight different degrees of contrast for each vowel considered. We notably show that contrast is weaker in semi-spontaneous speech and in a non standard semi-spontaneous dialect.
cs.CL
cs
Machine Assisted Analysis of Vowel Length Contrasts in Wolof Elodie Gauthier1, Laurent Besacier1, Sylvie Voisin2 1Laboratoire d'Informatique de Grenoble (LIG), Univ. Grenoble Alpes, Grenoble, France 2Laboratoire Dynamique Du Langage (DDL), CNRS - Universit´e Aix Marseille, France [email protected], [email protected], [email protected] 7 1 0 2 n u J 1 ] L C . s c [ 1 v 5 6 4 0 0 . 6 0 7 1 : v i X r a Abstract Growing digital archives and improving algorithms for au- tomatic analysis of text and speech create new research oppor- tunities for fundamental research in phonetics. Such empirical approaches allow statistical evaluation of a much larger set of hypothesis about phonetic variation and its conditioning factors (among them geographical / dialectal variants). This paper il- lustrates this vision and proposes to challenge automatic meth- ods for the analysis of a not easily observable phenomenon: vowel length contrast. We focus on Wolof, an under-resourced language from Sub-Saharan Africa. In particular, we propose multiple features to make a fine evaluation of the degree of length contrast under different factors such as: read vs semi- spontaneous speech ; standard vs dialectal Wolof. Our mea- sures made fully automatically on more than 20k vowel tokens show that our proposed features can highlight different degrees of contrast for each vowel considered. We notably show that contrast is weaker in semi-spontaneous speech and in a non standard semi-spontaneous dialect. Index Terms: computational phonetics, vowel length contrast, automatic speech recognition, wolof language, under-resourced languages 1. Introduction Growing digital archives and improving algorithms for auto- matic analysis of text and speech create new research oppor- tunities for fundamental research in linguistics and phonetics. This vision is shared by [1] where audiobooks (large amount of recordings in many languages and dialects, distributed in a nat- ural way across a wide variety of speakers) are used for corpus- based phonetics. In their work, authors claim that - for the pho- netic events observed - "the data used from audiobooks offers more tokens than have been examined in the entire 50-year his- tory of sociolinguistic study of Spanish". In a similar trend, we have recently shown the value of stochastic and neural acoustic models for analyzing, at a relatively large scale, vowel length contrast in two under-resourced african languages [2]. Such em- pirical approaches allow statistical evaluation of a much larger set of hypothesis about phonetic variation and its conditioning factors (among them geographical / dialectal variants). This pa- per illustrates this vision and proposes a detailed analysis of vowel length constrast in Wolof under different factors such as: read vs semi-spontaneous speech ; standard (Dakar) Wolof vs dialectal (Faana-Faana) Wolof. Paper contributions. The first contribution of this paper is a large scale analysis of vowel length contrast on Wolof read speech. Multiple features are proposed to judge the degree of bimodality in the distribution (of durations) for a given vowel. Our measures made on 14k vowel tokens show different degrees of contrast according to the vowel considered. We also show, in a second contribution, that in the case of read speech, the need of manual transcriptions can be relaxed since the use of automatic speech recognition (ASR) can lead to very similar measurements and to the same conclusions. Our third contri- bution is an application of our machine-assisted methodology to study vowel length contrast in more spontaneous speech for Wolof and for one of its dialectal variant (Faana-Faana). For reproductible research, a Wolof ASR VM and the data of this study are also made available online1. Languages studied. Wolof is the vehicular language of Senegambia (Senegal and Gambia), also spoken in Mauritania. This paper focuses on senegalese Wolof. We will use the term "standard" to refer to Wolof spoken in Dakar by native speak- ers of the language and "urban" for Wolof spoken by non-native speakers. In Senegal, there are also dialectal variants but mutual understanding exists between people living in the different ar- eas. Linguists observe some phonetic or morpho-phonological variations, focusing on vocalism, on some forms of verbal in- flection [3] and also on some morphological and syntactical variations [4], [5]. The Faana-Faana dialect studied in this paper is spoken in the region of Kaolack, also named Wolof of the Saloum. It is described by Dram´e [6] and is closer to the Wolof of Gambia. This regional variant is not much influenced by other Wolof di- alects. However, young people and men often spend part of their lives in Dakar and come back with influences from stan- dard Wolof. Faana-Faana speakers live in a predominant Sereer speaking area which influences their own language, but they are not subject to other major linguistic influences. In Wolof, the vocalic system is composed of 8 short vowels /i/, /e/, /E/, /a/, /@/, /O/, /o/, /u/; each having a long counterpart (except /@/). There is no tone in Wolof but phonemes can vary in length [7]. This means that word sense may differ depending on phoneme duration. For instance, the pronunciation of "fit" (bravery) and "fiit" (trap) varies only at the vowel length level, as well as "wall" (to rescue) and "waal" (to take advantage of ), or "set" (to be clean) and "seet" (to look for). Same short and long vowels exists in the Faana-Faana variant. As can be seen in the examples above, reduplication of the vowel, in the spelling of Wolof, encodes the duration. One goal of this paper is to verify if this expected (phonological) contrast is also observed at the phonetic level. Paper outline. This paper is organized as following. Sec- tion 2 reviews previous works on phonemic contrast analysis. In Section 3, we propose several features to measure degree of (length) contrast for a given unit. In Section 4, we present our multi factor analysis of vowel length contrast in Wolof read and semi-spontaneous speech (Dakar and Faana-Faana). Finally, Section 5 concludes this work and gives some perspectives. 1see https://github.com/besacier/ALFFA_ and PUBLIC/blob/master/ASR/WOLOF/WOLOF-VM/ https://github.com/besacier/ALFFA_PUBLIC/blob/ master/ASR/WOLOF/INTERSPEECH_2017 2. Related Works Vowel duration is a phonetic measure widely used in speech acoustic research. Many factors affect vowel duration such as its location within the vowel space ([8], [9]), position and length of the word [10], surrounding context of the vowel ([11], [12]), speech rate ([13], [14]) and position of the vowel within the word [15]. As raised by [16], main past studies of vowel dura- tion were done through manual annotations. It is consequently a very time-consuming task and only few words were generally analyzed. We believe that use of automatic tools can lead to more objective and reproductible measures, at a larger scale. As far as vowel length contrast is concerned, [17] studied its production and perception in Korean. They found that all Korean speakers of the study produced (length) contrasted vow- els but they also concluded that short/long contrast is weaker in spontaneous speech. Vowel length contrast was also investi- gated to better understand language acquisition. [18] analyzed 11 hours of Japanese infant-directed speech, using statistical methods, to explore how infants learn to discriminate vowel length contrast existing in Japanese. They discovered that dura- tion distribution for a given vowel is not clearly bi-modal since long vowels may be much less frequent than short vowels. In Wolof, very few phonetic studies were published, espe- cially on vowel length contrast. One exception is the work of [19] who studied a dialectal variant of Gambian Wolof, close to Faana-Faana analyzed in this paper. The author compared 3 minimal pairs, each containing /i/, /a/ and /u/ vowels (read speech) and noticed that length contrast was more important for vowel /a/ than for /i/ and /u/. Moreover, less (length) contrast was observed in rapid speech rate compared to normal speech rate. Finally, in 2006, [7] pointed out that a large analysis of Wolof phonetics was lacking and to the best of our knowledge this is still the case at present. 3. Measuring Vowel Length Contrast It is not trivial to objectively analyze the degree of bimodality in the distribution of durations for a given vowel. One reason is that - for some vowels - there may be much more short oc- curences than long ones [20]. Eye-looking at distributions is a possibility but more objective features are needed if we want a fine evaluation of the degree of contrast across different speech styles and dialects (see [18] for Japanese). This section pro- poses different criteria (features) to estimate the degree of bi- modality for the (duration) distribution of a given vowel. These features are not extracted from true distributions of short and long vowels, but from their normalized gamma approximations2 - see Figure 1 for the notations used: (1) ratio r1, (2) ratio r2, (3) area A between both (short/long) gamma distributions and (4) delta ∆ between modes of both gamma distributions. We define dS(x) and dL(x) as representing respectively the distribution of the short and long units of a vowel (for instance d/i/(x) and d/ii/(x)). In accordance with this definition, r1 is defined by equation (1) and is the ratio between dS(a) and dL(a), when a is the global maximum value of dS(x). A high value of r1 means a large amount of short tokens compared to long tokens at the maximum peak of dS(x). In the same way, r2 defined in equation (2) is the ratio between dL(b) and dS(b), when b is the global maximum value of dL(x). A high value of r2 means a large amount of long tokens compared to short tokens at the maximum peak of dL(x). For both ratios, the bigger the value, the stronger the duration contrast is. 2We preferred Gamma distributions to Gaussian for their skewness. r1 = dS(a) dL(a) where a = arg max (dS(x)) . x r2 = dL(b) dS(b) where b = arg max (dL(x)) . x (1) (2) A corresponds to the computed area between both curves when dS(x) < dL(x), as shown in equation (3). The larger the area, the stronger the duration contrast should be. We consider that a significant contrast should give an area A > 0.40. (cid:90) ∞ A = dL(x) − dS(x) dx (3) I We also compute ∆ which is the difference between both modes of dS(x) and dL(x), as represented in equation (4). The greater the value of ∆, the more significant the contrast is. Fig- ure 1 displays duration histograms, associated gamma curves and notations, for phoneme /a/. ∆ = arg max (dL(x)) − arg max (dS(x)) (4) x x Finally, it is important to note that we did not use Harti- gan's Dip test of unimodality [21] since our preliminary mea- surements have shown that this test always concludes to the bi- modality of our distribution - even for extremely weak contrasts. 4. Machine Assisted Analysis of Vowel Length Contrasts in Wolof 4.1. Data and ASR System In addition to our existing in-house (Dakar standard) Wolof read speech corpus [22], we recently collected data during a field trip in Senegal.We collected semi-spontaneous speech of Wolof (Dakar standard) and dialectal variants. In total, we gathered around 1.5 hours of elicitated speech from 22 speakers (6 Faana- Faana speakers, 2 Lebu speakers, 3 speakers of urban Wolof and 11 speakers of standard Wolof). Each speaker had to watch a series of 76 short videos designed to express trajectory [23]. This data can be considered as semi-spontaneous speech. Our best Wolof ASR system was used to decode new recorded speech. This is a standard context dependent DNN- HMM hybrid system trained with Kaldi speech recognition toolkit [24]. More details on this system can be found in [2] and it is made available through a VM3. We used 5 transcrip- tions of Faana-Faana (over 6) and 3 transcriptions of standard Wolof (over 11), because only a subset of ASR hypotheses were corrected by Wolof linguists. Table 1 summarizes each data set on which we will measure vowel length contrast in this paper. Table 1: Wolof speech data overview. Data Set Wolof (read) Wolof spontaneous) Faana-Faana (semi- spontaneous) (semi- Male Female 8 2 5 6 1 0 #Utt 1,120 254 #Words 10,461 2,825 Duration 1h12 mins 14 mins 454 3,365 19 mins 3see https://github.com/besacier/ALFFA_PUBLIC/ blob/master/ASR/WOLOF/WOLOF-VM/ 4.2. Analysis on Wolof Read Speech 4.2.1. Forced Alignment with Human Transcriptions In a first phase, we extract vowel durations by force-aligning human transcriptions of development (dev) set described in [2] (1,120 utterances, 1h12mn of speech) and made up of Wolof read speech (see Table 1). Forced-alignment is done with our CD-DNN-HMM-based acoustic model (length con- trasted acoustic models with different units for short and long vowels). The 7 contrasted vowels are tagged as /short/ or /long/ depending on the duplication of the grapheme within the word. Data is partitioned in different sets denoted by D v where v ∈ V = {i, e, E, a, O, o, u} is the studied vowel and l l ∈ L = {S, L} is the expected length of the vowel (short or long). We computed vowel durations and built their histogram for each vowel after deleting outliers (we keep observations x so that µ − 3σ < x < µ + 3σ). We also approximate our real dis- tribution by the probability density function of a Gamma distri- bution. Eye-looking at normalized distributions for each vowel confirms that bimodality exists for all of them. However, the degree of contrast differs for each vowel. For instance, strong duration contrast is observed for vowel /a/ (Figure 1) whereas weak contrast is observed for vowel /O/ (Figure 2). Figure 1: Histogram and Gamma Distribution for vowel /a/ in Wolof Read Speech - Strong Contrast Figure 2: Histogram and Gamma Distribution for vowel /O/ in Wolof Read Speech - Weak Contrast Table 2 shows measurements of length contrast. Vowels are sorted according to their height. In addition to the contrast fea- tures described in Section 3, we also display in third column the mean duration µ (in ms) for each short and long vowel. Vowel /a/ is the one that appears most frequently (both short and long) while vowel /o/ is the one that appears most rarely. This is eas- ily explained because words containing the vowel /a/ are very common while those containing vowel /o/ are rare in Wolof. We observe that 2 articulatory features affect vowel duration: height and backness. Indeed, mean duration of short vowels in- Table 2: Contrast Features Extracted on Wolof Read Speech. Phoneme short long /i/ /i:/ /e/ /e:/ /E/ /E:/ /a/ /a:/ /O/ /O:/ /o/ /o:/ /u/ /u:/ #occurences 2,149 133 227 178 1,264 557 4,673 880 881 710 60 69 1,893 111 µ (in ms) 76 131 79 120 81 131 69 125 73 102 68 108 67 110 r1 r2 2.54 2.63 2.64 4.07 1.62 2.85 2.34 1.42 1.52 1.50 2.21 0.93 1.27 1.09 A 0.44 0.45 0.45 0.56 0.27 0.46 0.40 ∆ (in ms) 49 37 46 50 24 34 36 creases with the aperture of the jaw, as described in [19], except for /a/. The phonological status of /a/ is still in debate and [7] raises the fact that linguists are not all unanimous on the issue. The same rule is not observed on long vowels. Mean duration also shows that back vowels (/O/, /o/ and /u/) are shorter than front vowels (/i/, /e/, /E/), for both short and long phonemes. ∆ varies from 24 ms to 50 ms and A from 0.27 to 0.56. Vowel /a/ is the one with the strongest length contrast, with large r1 and r2 ratios, as well as large area A and large ∆. Though /O/ is the vowel with the least distinguishable length contrast, with low r1 and r2 ratios, small A and moderate ∆, features unveil that all vowels are length-contrasted. The table also shows that contrast features are correlated but they are complementary to describe the shape of the vowel length distributions. To con- clude on this sub-section, this analysis (made fully automati- cally on 14k vowel tokens) show that our proposed features can highlight different degrees of contrast for each vowel consid- ered and confirm - at a larger scale - previous analyses made. 4.2.2. Forced Alignment with Automatic (ASR) Transcriptions In this sub-section, we try to see if manual transcriptions can be replaced by ASR hypotheses while keeping same trends/conclusions. In that case, we relax the constraint of hav- ing manual transcription of the data set. We computed vowel durations from forced alignment obtained with ASR transcripts (from our baseline Wolof ASR system, trained on held-out data - around 20% WER on read speech) and built gamma distri- butions as in previous section. For each vowel, we compared both distributions (manual transcription vs ASR transcription) using Kolmogorov-Smirnov statistical test [25] (the null hy- pothesis H0 was that both distributions obtained after manual and ASR transcriptions are similar). For each vowel v, no sig- nificant difference was found. To illustrate this result, Figure 3 shows duration histograms and associated gamma curves for phoneme /u/ when human (ref) or ASR (hyp) transcriptions are used for forced-alignment. Both curves are very similar and this confirms that, for read speech, the need of manual transcrip- tions can be relaxed since the use of ASR leads to very similar measurements and to the same conclusions. For the next sub- sections (semi-spontaneous speech), ASR will be also used to produce transcripts but they will be further corrected by humans due to the more spontaneous nature of the data4. 4Preliminary measurements have shown that the ASR transcriptions on spontaneous speech are too noisy to be used directly. We got around 31% WER for Wolof and 66% WER for Faana-Faana. 050100150200250300350duration (in ms)0.0000.0020.0040.0060.0080.0100.0120.0140.016short /O/long /O/ Table 4: Contrast Features Extracted on Faana-Faana Semi- Spontaneous Speech. Phoneme short long /i/ /i:/ /e/ /e:/ /E/ /E:/ /a/ /a:/ /O/ /O:/ /o/ /o:/ #occurences µ (in ms) r1 r2 A ∆ (in ms) 882 167 77 116 197 176 909 188 197 112 24 50 69 75 74 83 69 87 63 94 63 68 53 77 0.91 1.14 0.09 0.87 1.41 0.21 1.17 1.06 0.18 1.76 1.02 0.32 1.12 0.90 0.06 2.76 1.40 0.46 8 11 17 27 3 21 † /u/ is not represented because we do not have enough data for a comparison. 4.4. Analysis on a Dialectal Variant of Wolof We computed same features shown in Table 2 and Table 3 on our Faana-Faana semi-spontaneous corpus (see Table 4). As we can see in Table 4, long vowels /e:/ and /o:/ still appear more frequently than their short counterpart, as in semi- spontaneous (standard) Wolof. We observe that the duration increases with vowel height, for front long vowels (/i:/, /e:/, /E:/) but not for their short counterparts. By looking at the value of the features, we note that distinction between short and long pronunciation of vowels is tenuous. The length con- trast on vowel /O/ is also weakened, as in semi-spontaneous (standard) Wolof. These results do not allow to demonstrate that there exists in Faana-Faana a strong opposition of vow- els length as observed in (standard) Wolof. In the mean time, we can not affirm that vowel length contrast does not exist in Faana-Faana. In the descriptions of this dialect, as in the Gam- bian Wolof, the short/long opposition is described, so we can hypothesize that dialectal differences in Wolof are not based on this lack of contrast. In addition, two-sample Kolmogorov- Smirnov tests revealed that /e/, /E/, /a/, /O/ vowel distributions in semi-spontaneous Wolof data set were not found significantly different from those in semi-spontaneous Faana-Faana data set but /i/, /o/ and /u/ vowel distributions were. Finally, since this variant has been little studied, we hope that our analysis repre- sent one first stone in the study of phonemic contrast in Wolof dialects. 5. Conclusion We presented in this study a large scale analysis (compared to previous phonetic studies) of vowel length contrasts in Wolof. We worked on different speaking styles but also on one dialec- tal variant (Faana-Faana). We proposed correlated but comple- mentary features to describe the shape of the vowel length dis- tributions and to highlight different degrees of length contrast given a vowel. Another important result is that relaxing the constraints on the transcriptions (by using ASR transcriptions instead of manual transcriptions) is possible for read speech since it leads to very similar distributions of durations. Future work will be dedicated to leveraging computational models and machine learning for large scale speech analysis and laboratory phonetics. Further work will analyze the relation between these distinctive features of the length contrast distribution and the functional load concept developed by [27]. Figure 3: Histogram and Gamma Distribution for /u/ in Wolof Read Speech - Using Human (ref) or ASR (hyp) Transcripts 4.3. Analysis on Wolof Semi-Spontaneous Speech Table 3: Spontaneous Speech. Contrast Features Extracted on Wolof Semi- Phoneme short long /i/ /i:/ /e/ /e:/ /E/ /E:/ /a/ /a:/ /O/ /O:/ /o/ /o:/ /u/ /u:/ #occurences µ (in ms) r1 r2 A ∆ (in ms) 1,757 252 161 213 518 225 1,815 324 360 190 62 123 755 16 72 83 71 83 69 90 60 100 67 74 51 89 51 96 1.06 1.01 0.10 1.10 1.14 0.19 1.40 0.91 0.21 2.56 1.32 0.44 1.22 0.84 0.09 6.12 3.26 0.61 † 5.95 0.73 11 12 18 35 5 35 44 † The ratio can not be computed because there were no data for the long unit of the phone (dL(a) = 0) at point corresponding to the mode of the short phone distribution. We computed same features shown in Table 2 on our Wolof semi-spontaneous corpus. Results are presented in Table 3. Looking at the mean duration of the vowels µ, our first remark is that it is lower in semi-spontaneous speech com- pared to read speech (for both short and long units). These conclusions were expected but they confirm that our machine- assisted methodology allows usable measurements at a larger scale. Comparing µ in read and semi-spontaneous context, we observe that long vowels are the most affected by the speak- ing style, especially front vowels (/i:/, /e:/ and /E:/), while short units are the least impacted among the vowel set. Results for /u/ have to be taken with caution, since we only have 16 long occurences, as well as for /o/~/o:/ for which we have less occurences compared to other vowels. All computed features show that length contrast on /O/~/O:/ pair is significantly re- duced in semi-spontaneous speech in comparison to what was observed in read speech. In addition, the vowel height has no longer influence on the duration. Theses findings are consistent with [26] who described that spontaneous speech have an effect on the vowel pronunciation which tends to be more centralized when pronounced shorter. 050100150200250300duration (in ms)0.0000.0050.0100.0150.020short /u/ of reflong /u/ of refshort /u/ of hyplong /u/ of hyp [22] E. Gauthier, L. Besacier, S. Voisin, M. Melese, and U. P. Elin- gui, "Collecting Resources in Sub-Saharan African Languages for Automatic Speech Recognition: a Case Study of Wolof," LREC, 2016. [23] C. Grinevald, "On constructing a working typology of the expres- sion of path," Faits de langues, no. 3, pp. 43 -- 70, 2011. [24] D. Povey, A. Ghoshal, G. Boulianne, L. Burget, O. Glembek, N. Goel, M. Hannemann, P. Motl´ıcek, Y. Qian, P. Schwarz et al., "The kaldi speech recognition toolkit," 2011. [25] F. J. Massey Jr, "The Kolmogorov-Smirnov test for goodness of fit," Journal of the American statistical Association, vol. 46, no. 253, pp. 68 -- 78, 1951. [26] C. Gendrot and M. Adda-Decker, "Impact of duration on F1/F2 formant values of oral vowels: an automatic analysis of large broadcast news corpora in French and German," Variations, vol. 2, no. 22.5, pp. 2 -- 4, 2005. [27] E. Ferragne, N. Bedoin, V. Boulenger, and F. Pellegrino, "The perception of a derived contrast in Scottish English," in International Congress of Phonetic Sciences, Hong Kong SAR China, Aug. 2011, p. [Online]. Available: https://hal.archives-ouvertes.fr/hal-00613604 ICPHS. 6. Acknowledgements This work was realized in the framework of the French ANR project ALFFA (ANR-13-BS02-0009). 7. References [1] N. Ryan and M. Liberman, "Large-scale analysis of Spanish /s/- lenition using audiobooks," in Proceedings of the 22d Interna- tional Congress on Acoustics, Buenos Aires, Argentina, 2016. [2] E. Gauthier, L. Besacier, and S. Voisin, "Speed perturbation and vowel duration modelling for ASR in Hausa and Wolof lan- guages," in Proceedings of Interspeech, San Francisco, California, USA, September 2016 2016. [3] S. Robert, "Le wolof," in Dictionnaire des langues, ser. Dicos Poche, J. B. . A. P. Emilio Bonvini, Ed. Quadrige/P.U.F., 2011, pp. 23 -- 30. [Online]. Available: https://hal.archives-ouvertes.fr/ hal-00600630 [4] S. Voisin and M. Dram´e, "Inaccompli et complexe verbal dans diff´erentes variantes du wolof," Africana Linguistica, still in prep. [5] S. Voisin, "Le wolof et ses variantes," JWAL, still in prep. [6] M. Dram´e, "Phonologie et morphosyntaxe compar´ees de trois di- alects wolof," Ph.D. dissertation, UCAD, Dakar., 2012. [7] M. T. Ciss´e, "Probl`emes de phon´etique et de phonologie en wolof," Revue ´electronique internationale de sciences du langage SudLangues, vol. 6, pp. 1 -- 41, 2006. [8] B. Lindblom, "Vowel duration and a model of lip mandible co- ordination," Speech Transmission Laboratory Quarterly Progress Status Report, vol. 4, pp. 1 -- 29, 1967. [9] I. Lehiste, Suprasegmentals. MIT Press, Cambridge, MA, 1970. [10] B. Lindblom, B. Lyberg, and K. Holmgren, Durational patterns of Swedish phonology: do they reflect short-term motor memory processes? Indiana University Linguistics Club, 1981, vol. 3. [11] A. S. House, "On vowel duration in English," The Journal of the Acoustical Society of America, vol. 33, no. 9, pp. 1174 -- 1178, 1961. [12] I. Maddieson, "Phonetic cues to syllabification," UCLA Working papers in phonetics, vol. 59, pp. 85 -- 101, 1984. [13] T. Gay, "Mechanisms in the control of speech rate," Phonetica, vol. 38, no. 1-3, pp. 148 -- 158, 1981. [14] H. S. Magen and S. E. Blumstein, "Effects of speaking rate on the vowel length distinction in Korean." Journal of Phonetics, no. 21, pp. 387 -- 410, 1993. [15] S. Myers, "Vowel duration and neutralization of vowel length con- trasts in Kinyarwanda," Journal of Phonetics, vol. 33, no. 4, pp. 427 -- 446, 2005. [16] Y. Adi, J. Keshet, E. Cibelli, E. Gustafson, C. Clopper, and M. Goldrick, "Automatic measurement of vowel duration via structured prediction," The Journal of the Acoustical Society of America, vol. 140, no. 6, pp. 4517 -- 4527, 2016. [17] G. Lee and D.-J. Shin, "An acoustic and perceptual investigation of the vowel length contrast in Korean," Journal of the Korean society of speech sciences, vol. 8, no. 1, pp. 37 -- 44, 2016. [18] R. A. Bion, K. Miyazawa, H. Kikuchi, and R. Mazuka, "Learning phonemic vowel length from naturalistic recordings of Japanese infant-directed speech," PloS one, vol. 8, no. 2, p. e51594, 2013. [19] R. Sock, "L'organisation temporelle de l'opposition de quantit´e vocalique en wolof de gambie. sa r´esistivit´e aux conditions de dur´ee segmentales et suprasegmenales." Ph.D. dissertation, 1983. [20] S. Sauvageot, Description synchronique d'un dialecte wolof: le Institut Franc¸ais d'Afrique Noire, Dakar., parler du Dyolof. 1965, no. 73. [21] J. A. Hartigan and P. Hartigan, "The dip test of unimodality," The Annals of Statistics, pp. 70 -- 84, 1985.
1711.00354
1
1711
2017-10-28T05:28:01
JSUT corpus: free large-scale Japanese speech corpus for end-to-end speech synthesis
[ "cs.CL" ]
Thanks to improvements in machine learning techniques including deep learning, a free large-scale speech corpus that can be shared between academic institutions and commercial companies has an important role. However, such a corpus for Japanese speech synthesis does not exist. In this paper, we designed a novel Japanese speech corpus, named the "JSUT corpus," that is aimed at achieving end-to-end speech synthesis. The corpus consists of 10 hours of reading-style speech data and its transcription and covers all of the main pronunciations of daily-use Japanese characters. In this paper, we describe how we designed and analyzed the corpus. The corpus is freely available online.
cs.CL
cs
JSUT CORPUS: FREE LARGE-SCALE JAPANESE SPEECH CORPUS FOR END-TO-END SPEECH SYNTHESIS Ryosuke Sonobe, Shinnosuke Takamichi, and Hiroshi Saruwatari Graduate School of Information Science and Technology, The University of Tokyo, 3-7-1 Hongo Bunkyo-ku, Tokyo 133–8656, Japan ABSTRACT Thanks to improvements in machine learning techniques in- cluding deep learning, a free large-scale speech corpus that can be shared between academic institutions and commercial companies has an important role. However, such a corpus for Japanese speech synthesis does not exist. In this paper, we designed a novel Japanese speech corpus, named the "JSUT corpus," that is aimed at achieving end-to-end speech synthe- sis. The corpus consists of 10 hours of reading-style speech data and its transcription and covers all of the main pronun- ciations of daily-use Japanese characters. In this paper, we describe how we designed and analyzed the corpus. The cor- pus is freely available online. Index Terms- speech corpus, Japanese, speech synthe- sis, end-to-end 1. INTRODUCTION Thanks to developments in deep learning techniques, studies on speech have accelerated [1, 2, 3, 4]. In particu- lar, in speech-to-text and text-to-speech research, end-to-end conversion from speech to text or from text to speech is an actively targeted task. Some studies on speech synthesis re- ported methods that do not use linguistic knowledge, e.g., no use of intermediate representations such as phonemes, in English, Spanish, and German [5, 6, 7]. However, it is known that natural language processing for Japanese is a more dif- ficult task, e.g., semantic parsing and grapheme-to-phoneme conversion [8]. We expect that a Japanese speech corpus that is freely available would accelerate related research such as on end-to-end speech synthesis. However, there are no existing corpora, e.g., [9], for this purpose. In this paper, we describe the results of constructing a free, large-scale Japanese speech corpus, named the "JSUT (Japanese speech corpus of Saruwatari Laboratory, the Uni- versity of Tokyo) corpus." The corpus is designed to have all pronunciations of daily-use characters and individual read- ings in Japanese, which are not measured by conventional intermediate representation, such as phonemes and prosody. Also, it includes different-domain utterances, such as loan- words, and travel-domain and precedent utterances. We recorded 10 hours of speech data read by a native Japanese speaker and analyzed its linguistic and speech statistics. The corpus, including Japanese text and speech data, is freely available online [10]. 2. CORPUS DESIGN 2.1. Structures To accelerate end-to-end research, the main purpose of the JSUT corpus is to cover all of the main pronunciations of daily-use Japanese characters, not to cover intermedi- ate representations such as phonemes. The corpus includes the following nine sub-corpora. Their name is formatted as [NAME][NUMBER]. [NUMBER] indicates the number of utterances of the sub-corpus. • basic5000 ... utterances to cover all of the main pro- nunciations of daily-use Japanese characters. • countersuffix26: utterances including individual read- ings of counter suffixes. • loanword128: utterances including loanwords, e.g., verbs or nouns. • utparaphrase512: utterances for which a word or phrase of a piece of text is replaced with its paraphrase. • voiceactress100: para-speech for a free corpus of Japanese voice actresses [11]. • onomatopee300: utterances including famous Japanese onomatopee (onomatopoeia). • repeat500: repeatedly spoken utterances. • travel1000: travel-domain utterances. • precedent130: precedent-domain utterances. 2.2. Components We describe how we designed the nine sub-corpora below. 2.2.1. basic5000 This is the main sub-corpus of the JSUT corpus. In Japanese, 2136 kanji characters (kanji are the logographic characters used in the modern Japanese writing system) are officially defined as daily-use characters [12], and each char- acter has individual pronunciations consisting of its individual kunyomi (Chinese readings) and onyomi (Japanese readings). For example, we pronounce "一" (one in English) as "ichi," "itsu," "hito," and "hito (tsu)." we collected 5000 sentences from Wikipedia [13] and the TANAKA corpus [14] so that all pronunciations of the daily-use kanji characters could be covered. Some of the pronunciations cannot be found in these corpora, therefore, we manually made additional sentences to cover the remaining readings. 2.2.2. countersuffix26 In Japanese, numerals cannot quantify nouns by them- selves, and the pronunciation of the numerals changes de- pending on the suffix. For example, "二" ("two" in English) is pronounced "ni" with "個" (ko) as the suffix and "futa" with "つ" (tsu) . We crowdsourced 26 sentences including such counter suffixes. 2.2.3. loanword128 Japanese sentences spoken daily have many loanwords, e.g., verbs and nouns, for example, "ググる (guguru)" is a verb meaning to Google, and "ディズニー (dyizunii)" means Disney. The pronunciations and accents of loanwords are a curious task in spoken language processing [15]. We crowdsourced such words and sentences. Also, we collected sentences from Wikipedia that included pronunciations not included in the modern Japanese system, for example, sen- tences that had a Japanese-accented foreign proper name. 2.2.4. utparaphrase512 Paraphrasing, e.g., lexical simplification, is a technique that substitutes a word or phrase into another sentence [16, 17]. It can support the reading comprehension of a wide range of readers in speech communication. The SNOW E4 corpus [17, 18] includes sentences and a list of its paraphrased words. We chose one paraphrased word per sentence, and constructed 256 sentences and paraphrased sentences. The total number of sentences was 512. 2.2.5. voiceactress100 The Voice Actress Corpus [11] is a free speech corpus of professional Japanese voice actresses and includes not only neutral but also emotional voices. Collecting para-speech for this speech corpus is very helpful to build attractive and emo- tional speech synthesis systems. We used sentences from this corpus and manually modified the pause positions. Japanese is rich in onomatopoeia words. We crowdsourced 300 sentences having individual onomatopoeia words. 2.2.7. repeat500 Human speech production is not deterministic, i.e., speech waveforms always differ even if we try to reproduce the same linguistic and para-linguistic information. Takamichi et al. [3] proposed moment matching network-based speech syn- thesis that synthesizes speech with natural randomness within the same contexts. To quantify randomness, we recorded ut- terances spoken repeatedly by a single speaker. The speaker made utterances 5 times for each of the 100 sentences of the Voice Actress Corpus. 2.2.8. travel1000 and precedent138 We further constructed sentences whose domain differed from the above corpora. 1000 travel-domain sentences were collected from English-Japanese Translation Alignment Data [19]. Also, 138 copyright-free precedent sentences were col- lected from [20]. The words and phrases of the precedent sen- tences were significantly different from the above corpora, but some sentences are too difficult to read. Therefore, we man- ually removed and modified these sentences to make reading easier. 3. RESULTS OF DATA COLLECTION 3.1. Corpus specs We hired a female native Japanese speaker and recorded her voice in our anechoic room. She was not a professional speaker but had experience working with her voice. The recordings were made in February, March, September, and October of 2017 for a few hours each day. The speaker made the recordings herself with our recording system. The speech data was sampled at 48 kHz. We used Lancers [21] to collect several kinds of Japanese sentences. The total duration was 10 hours including small amounts of the non-speech region. The 16 bit/sample RIFF WAV format was used. Sentences (transcriptions) were encoded in UTF-8. The distributed corpora included UTF-8-encoded sen- tences, 48-kHz speech, and recording information. Because the recording period was comparably long and the objective scores among the recording days varied as shown below, the recording information shows what day the speech data was recorded. The power of the speech data was normalized, but basically we made no additional modifications. Commas were added between breath groups. The positions of the commas were manually annotated. 2.2.6. Onomatopee300 3.2. Analysis Onomatopee (onomatopoeia) has an important role in connecting speech and non-speech sounds in nature, and We analyzed the linguistic and speech information of the constructed corpus. Note that not all of the data was y c n e u q e r F 0.040 0.035 0.030 0.025 0.020 0.015 0.010 0.005 0.000 0 40 20 120 Number of moras in one utterance 100 80 60 0 F g o l f o n a e M 5.42 5.40 5.38 5.36 5.34 5.32 140 Fig. 1. Histogram of number of moras (sub-syllables) in one utterance. Minimum, mean, and maximum values are 7, 37.14, and 133, respectively. y c n e u q e r F 0.08 0.07 0.06 0.05 0.04 0.03 0.02 0.01 0.00 0 20 10 60 Number of words in one utterance 30 40 50 70 Fig. 2. Histogram of number of words in one utterance. Min- imum, mean, and maximum values are 2, 18.03, and 70, re- spectively. used for the analysis to shorten the computation time. First, we counted the number of moras (sub-syllables) and words within one utterance by using MeCab [22] and NEologd [23, 24]. The utterance length is the important factor in speech synthesis using the sequence-to-sequence mechanisms [25, 26]. Fig. 1 and Fig. 2 show histograms of the moras and words, respectively. As we can see, the corpus included a variety of lengths, from short utterances (a few words and moras) to long utterances (70 words and 140 moras). Next, we analyzed the changes in speech statistics per recording day. Speech data recorded during long periods causes objective and subjective differences among recording days [27]. The Mean of log F0 was calculated for each recording day. F0 was extracted by using the WORLD analysis-synthesis system [28]. Fig. 3 shows the result. There was no special tendency in the first half of the record- ings, but we can see that the log F0 increased for the days of the second half. st 1 5th 9th 0th 2th 3th 4th 5th 6th 3th 4th 5th 6th 2th 3th 3th 4th st 1 6 7 7 6 6 6 6 6 6 5 5 4 4 1 1 1 1 1 1 1 1 1 1 1 Recording day Fig. 3. Mean of log-scaled F0 for each recording day. Ordinal number of x-axis means how much time passed from "1st" recording day. For example, "5th" means 4 days after 1st recording day. 4. CONCLUSION In this paper, we constructed a free, large-scale Japanese speech corpus (JSUT corpus) for end-to-end speech synthe- sis research. The corpus was designed to have all pronuncia- tions of daily-use kanji characters of Japanese and sentences of several domains. The corpus may be used for research by academic institutions and non-commercial research including research conducted within commercial organizations. Acknowledgements: Part of this work was supported by the SECOM Science and Technology Foundation. We thank Dr. Masahiro Mizukami of the Nara Institute of Science and Technology for the fruitful discussion on the paraphrase corpus, Assistant Prof. Kazuhide Yamamoto of the Nagaoka University of Technology and Tomoyuki Kajiwara of the Tokyo Metropolitan University for the use of the SNOW E4 corpus, and the person in charge of the Voice Actress Corpus for the use of their corpus. 5. REFERENCES [1] G. Hinton, L. Deng, D. Yu, G. Dahl, A. r. Mo- hamed, N. Jaitly, A. Senior, V. Vanhoucke, P. Nguyen, T. Sainath, and B. Kingsbury, "Deep neural networks for acoustic modeling in speech recognition: The shared views of four research groups," Signal Processing Mag- azine of IEEE, vol. 29, no. 6, pp. 82–97, 2012. [2] A. v. d. Oord, S. Dieleman, H. Zen, K. Simonyan, O. Vinyals, A. Graves, N. Kalchbrenner, A. W. Senior, and K. Kavukcuoglu, "WaveNet: A generative model for raw audio," vol. abs/1609.03499, 2016. [3] S. Takamichi, K. Tomoki, and H. Saruwatari, "Sampling-based speech parameter generation using moment-matching network," in Proc. INTERSPEECH, Stockholm, Sweden, Aug. 2017. [4] Y. Saito, S. Takamichi, and H. Saruwatari, "Training al- gorithm to deceive anti-spoofing verification for DNN- based speech synthesis," in Proc. ICASSP, Orleans, U.S.A., Mar. 2017. [5] Y. Wang, RJ Skerry-Ryan, D. Stanton, Y. Wu, Ron J. Weiss, N. Jaitly, Z. Yang, Y. Xiao, Z. Chen, S. Ben- gio, Q. Le, Y. Agiomyrgiannakis, R. Clark, and R. A. Saurous, "Tacotron: Towards end-to-end speech syn- thesis," vol. abs/1609.03499, 2017. [6] S. Jose, M. Soroush, K. Kundan, S. Joao F., K. Kyle, "Char2Wav: End-to- C. Aaron, and B. Yoshua, end speech synthesis," in International Conference on Learning Representations (Workshop Track), April 2017. [7] O. Watts, "Unsupervised learning for text-to-speech synthesis," Ph. D thesis of the University of Edinburgh, 2012. [8] K. Kubo, S. Sakti, G. Neubig, T. Toda, and S. Naka- mura, "Narrow adaptive regularization of weights for grapheme-to-phoneme conversion," in Proc. ICASSP, Florence, Italy, May 2014. [9] M. Abe, Y. Sagisaka, T. Umeda, and H. Kuwabara, "ATR technical report," , no. TR-I-0166M, 1990. [17] K. Tomoyuki and Y. Kazuhide, "Evaluation dataset and system for japanese lexical simplification," in Proceed- ings of the ACL-IJCNLP 2015 Student Research Work- shop, Beijing, China, July 2015, pp. 35–40. [18] "SNOW E4: evaluation data set of japanese lexical sim- plification," http://www.jnlp.org/SNOW/E4, 2010. [19] M. Utiyama and M. Takahashi, translation "English- data," japanese http://www2.nict.go.jp/astrec-att/member/mutiyama/align/index.html, 2003. alignment [20] "COURTS IN JAPAN," http://www.courts.go.jp/app/hanrei_jp/search1. [21] "Lancers http://www.lancers.jp," . [22] T. Kudo, K. Yamamoto, and Y. Matsumoto, "Apply- ing conditional random fields to Japanese morphologi- cal analysis," in Proc. EMNLP, Barcelona, Spain, Jul. 2004, pp. 230–237. [23] T. Sato, T. Hashimoro, and M. Okumura, "Implemen- tation of a word segmentation dictionary called mecab- ipadic-neologd and study on how to use it effectively for information retrieval (in Japanese)," in Proceedings of the Twenty-three Annual Meeting of the Association for Natural Language Processing, 2017, pp. NLP2017–B6– 1. [24] T. Sato, "Neologism dictionary based on the language resources on the web for Mecab," 2015. [10] "JSUT: speech Japanese the corpus of of Saruwatari corpus," Lab, https://sites.google.com/site/shinnosuketakamichi/publication/jsut. University Tokyo [11] y benjo and MagnesiumRibbon, "Voice-actress corpus," http://voice-statistics.github.io/. [25] W. Wang, S. Xu, and B. Xu, "First step towards end- toend parametric TTS synthesis: Generating spectral parameters with neural attention," in Proc. INTER- SPEECH, San Francisco, U.S.A., Sep. 2016, pp. 2243– 2247. [12] Governments of Japan "List Agency of for daily-use Cul- kanjis tural Affairs, http://www.bunka.go.jp/kokugo_nihongo/sisaku/joho/joho/kijun/naikaku/kanji/index.html," 2010. [26] H. Miyoshi, Y. Saito, S. Takamichi, and H. Saruwatari, "Voice conversion using sequence-to-sequence learning of context posterior probabilities," in Proc. INTER- SPEECH, Stockholm, Sweden, Aug. 2017, pp. 1268– 1272. [13] "Wikipedia," https://ja.wikipedia.org/. [14] Y. Tanaka, "Compilation of a multilingual parallel cor- pus," in Proc. Pacling2001, 2001. [15] H. Kubozono, "Where does loanword prosody come from?: A case study of Japanese loanword accent," Lin- gua, vol. 116, no. 7, pp. 1140–1170, 2006. [16] M. Moku, K. Yamamoto, and A. Makabi, "Automatic easy Japanese translation for information accessibility of foreigners," in the Workshop on Speech and Lan- guage Processing Tools in Education, 2012, pp. 85–90. [27] H. Kawai, T. Toda, J. Ni, M. Tsuzaki, and K. Tokuda., "XIMERA: a new TTS from ATR based on corpus- based technologies," in Proc. SSW5, Pittsburgh, USA, June 2004, pp. 179–184. [28] M. Morise, F. Yokomori, and K. Ozawa, "WORLD: a vocoder-based high-quality speech synthesis system for real-time applications," IEICE transactions on infor- mation and systems, vol. E99-D, no. 7, pp. 1877–1884, 2016.
1702.07071
1
1702
2017-02-23T02:31:03
Pronunciation recognition of English phonemes /\textipa{@}/, /{\ae}/, /\textipa{A}:/ and /\textipa{2}/ using Formants and Mel Frequency Cepstral Coefficients
[ "cs.CL", "cs.SD" ]
The Vocal Joystick Vowel Corpus, by Washington University, was used to study monophthongs pronounced by native English speakers. The objective of this study was to quantitatively measure the extent at which speech recognition methods can distinguish between similar sounding vowels. In particular, the phonemes /\textipa{@}/, /{\ae}/, /\textipa{A}:/ and /\textipa{2}/ were analysed. 748 sound files from the corpus were used and subjected to Linear Predictive Coding (LPC) to compute their formants, and to Mel Frequency Cepstral Coefficients (MFCC) algorithm, to compute the cepstral coefficients. A Decision Tree Classifier was used to build a predictive model that learnt the patterns of the two first formants measured in the data set, as well as the patterns of the 13 cepstral coefficients. An accuracy of 70\% was achieved using formants for the mentioned phonemes. For the MFCC analysis an accuracy of 52 \% was achieved and an accuracy of 71\% when /\textipa{@}/ was ignored. The results obtained show that the studied algorithms are far from mimicking the ability of distinguishing subtle differences in sounds like human hearing does.
cs.CL
cs
Pronunciation recognition of English phonemes /@/, /ae/, /A:/ and /2/ using Formants and Mel Frequency Cepstral Coefficients Keith Y. Patarroyo and Vladimir Vargas-Calder´on∗ The Vocal Joystick Vowel Corpus, by Washington University, was used to study monophthongs pronounced by native English speakers. The objective of this study was to quantitatively measure the extent at which speech recognition methods can distinguish between similar sounding vowels. In particular, the phonemes /@/, /ae/, /A:/ and /2/ were analysed. 748 sound files from the corpus were used and subjected to Linear Predictive Coding (LPC) to compute their formants, and to Mel Frequency Cepstral Coefficients (MFCC) algorithm, to compute the cepstral coefficients. A Decision Tree Classifier was used to build a predictive model that learnt the patterns of the two first formants measured in the data set, as well as the patterns of the 13 cepstral coefficients. An accuracy of 70% was achieved using formants for the mentioned phonemes. For the MFCC analysis an accuracy of 52 % was achieved and an accuracy of 71% when /@/ was ignored. The results obtained show that the studied algorithms are far from mimicking the ability of distinguishing subtle differences in sounds like human hearing does. Keywords: sound processing, formants, Mel frequency cepstral coefficients, pro- nunciation recognition, machine learning. 1 Introduction Throughout computing history, scientists have developed a vast amount of theories and algorithms for speech recognition that are widely known (e.g. see the work by Lee (1988)). Many of them are motivated by using some of the principles of the human ear operation (Davis & Mermelstein, 1980). In recent years, the blooming of high-speed processing computers has allowed us to start using deep machine learning to improve the efficacy of our speech recognizers (Baker et al., 2009). The techniques that are currently used for speech recognizers yield high prediction rates (Hinton et al., 2012). The most common and successful technique is the implementation of multi- layered neural networks (Zegers, 1998; Wellekens, 1998). The performance of such techniques seeded the question of implementing recognizers as objective evaluators of speech ability in humans. This takes great relevance in the field of pronunciation teaching, not only because it provides the teachers (especially teachers who are non-native speakers of the taught language) a tool for assessing objectively the pronunciation of their students (Neri, Mich, Gerosa, & Giuliani, 2008), and of themselves, but also because if a student has access to such a tool, he or she could learn pronunciation autonomously (Hinks, 2003). Unquestionably, the main goal in pronunciation teaching is to improve the ability of a language learner to use their vocal tract to produce sounds that are recognized as native sounds by native speakers of that language. Although this remains a challenge, ∗Physics Department. National University of Colombia. Corresponding author e-mail: [email protected] 1 particularly in the early stages of learning a language (Mirzaei, Gowhary, Azizifar, & Esmaeili, 2015), it also provides a means by which students can improve the learning and retention of grammatical structures (Martin & Jackson, 2016). Also, since dif- ferent languages have different sound systems, it is normal for language learners to struggle learning them. For instance, the phonemes /@/, /ae/, /A:/ and /2/ found in the English language are troublesome for many English learners because of their similarity. For example, Spanish and Italian speakers tend to mix these phonemes into a single one: /a/. There are cases of learners from other languages, such as Azerbaijani, in which this confusion has been studied (Ghaffarvand Mokari & Werner, 2016). This article aims to study the ability of two of the most historically important speech recognition tools to differentiate between these phonemes, i.e. how good tools would they be in evaluating the correct pronunciation of these phonemes. These tools are the formants (computed with Linear Predictive Coding), attractive for its simplic- ity in vowel pronunciation recognition, and the Mel Frequency Cepstral Coefficients, attractive for its computational speed in continuous speech recognition. Both tools were tested with the Vocal Joystick Vowel Corpus, from the Washington University. 2 Theoretical Framework 2.1 Sound Formation The frequency range of the pressure waves in the air that compose the audible sounds by humans goes from 20Hz to 20kHz (Rosen & Howell, 2011). The process by which sound is produced by humans is the following (for a complete understanding of sound production by humans see reference (O'Grady & Dobrovolosky, 1997)). The diaphragm and intercostal contractions make the lungs generate a flow of air from the chest to the mouth. This air first passes through the larynx, wherein the vocal cords are. These are muscles that can be geometrically distributed in several ways, each of which is excited by the passing air creating modes of vibration or glottal states that result in sound. The pharynx, the oral cavity and the nasal cavity are filters and resonators of the aforementioned sounds. Also, the tongue and lips allow us to rapidly articulate and change the shape of the vocal cavity in order to filter some frequencies. In this study, we are interested in vowels, which are voiced glottal states produced with little obstruction of the vocal tract. This means having the lips open and also the tongue without contact with the palate. 2.2 Human Hearing Detection Principles It is also convenient to mention some of the principles that the human ear uses to detect sound signals. The human ear analyses pressure variations in the air into different frequencies. Roughly, the human ear does a Fourier transform of the pressure signal P (t), where t is the time, and transmits P (ω)2, where ω is the frequency, to the brain (Sethna, 2006). However, this initial model falls short for many analyses. Some of the reasons are (Lyons, n.d.): the tonal information is changing as a word or tune progresses; the difference between two closely spaced frequencies is hard to recognize for humans, especially at high frequencies; and humans hear loudness on a non-linear scale. All of these factors propose a significant challenge to mimic the human hearing system. Davis and Mermelstein (1980) developed a method (Mel Frequency Cepstral Coef- ficients) to mimic this process, and has been the state of the art in the field of speech recognition since then. 2 2.3 Formants and Linear Predictive Coding (LPC) The vocal tract can be thought of as a vibrating cavity, or resonator, whose geometry (morphology) is constantly changing in continuous speech. This change in the geom- etry allows the superposition of different modes of vibration, and thereby different sounds. Experiments have shown that for English vowels there are some characteristic frequencies of vibration called formants (Hillenbrand, Getty, Wheeler, & Clark, 1994; Hunter & Kebede, 2012; Deterding, 2006), that correspond to maxima of vibration, i.e. where the acoustic energy is focused. The first formant is roughly located from 0 to 1kHz, while the second formant is located from 1kHz to 2kHz, and so on (these frequency boundaries are not rigid, because there might be some second formants below 1kHz, as seen in the references). In the studies mentioned only the two first formants are taken into account for characterising each vowel. However, there are studies like (Prica & Ili´c, 2010) in which 3 formants are used to characterise the Serbian vowels in order to improve accuracy when performing classification of vowel sounds. Formants can be found by performing an acoustic power spectrum of a sound signal (or a spectrograph of the signal), and identifying the peaks in the spectrograph. This can be done by computing the envelope of the signal's frequency spectrum. Since the envelope contains information about the energy peaks, the formants can be determined. To predict the envelope of a signal s[n(∆t)] sampled in discrete time steps n = 0, 1, 2, . . ., the Linear Predictive Coding method was introduced (Deng & O'Shaughnessy, 2003). The goal of LPC is to predict s[n] with a linear combination of s[n − 1], s[n − 2], . . . , s[n − M ], where M is the integer that sets the number of predicting signal samplings. 2.4 Mel Frequency Cepstral Coefficients (MFCC) This method aims to mimic the procedure performed by the human hearing system to decode a sound signal. It can be summarised in the steps shown in table 1 (Lyons, n.d.). 3 Table 1: Steps of the MFCC method compared to the sound analysis of the human body. Step Human Detection The hearing sense is sensible to the tonal information change as a word or tune progresses. Different frequencies are detected by vibrations at different spots of the cochlea depending on the frequency of the incoming sounds. Mel Frequency Coefficients Frame the signal into short frames to account that on short time scales the audio signal does not change much. For each frame calculate the periodogram estimate of the power spectrum. 1. 2. 3. 4. 5. 6. The cochlea cannot discern the difference between two closely Apply the Mel filterbank to the power spectra, sum the energy spaced frequencies. Loudness is detected on a non-linear scale, where in each filter. Take the logarithm of all differences in small frequencies filterbank energies. are more considerable. -- -- -- -- -- -- -- -- -- -- -- Identifies the linguistic content and discards all the other stuff (background noise, emotion) Take the DCT (Discrete Cosine Transform) of the log filterbank energies. Keep DCT coefficients 2-13, discard the rest. 2.5 Decision Tree Classifiers (DTC) Classifiers are computer tools that learn patterns from labelled data, so that when a new sample is presented to the computer, it will classify the sample into one of the different labels. In other words, consider a data set D = {(di, li)}, where di is a vector of N components (features). The vector di is also called a sample. li is a label. The classifier is a function f (d) : F → L, where F is the vector space of the samples and L the space of the labels. To see how DTCs work, consider the following example. Suppose that a data set consists of samples in one dimension: each sample is the salary of every single person in Colombia. The labels for this data set are the social stratum. We might have people that earn a lot of money, but they live in stratum 2, or vice versa. However, these cases are strange and in general there is a structure that allows predicting the label (social stratum) from the samples. The DTC will try to learn the salary ranges for each single social stratum, so that when a new sample is presented to the model, it will classify it in a specific label. The boundaries of the salary ranges are random at first, but as the learning process advances, the boundaries become more accurate and clear. To test how well the DTC is able to predict labels, a data set D(cid:48) called the testing data is normally built. D(cid:48) consists of M samples with known labels. Only the samples, and not the labels, are presented to the DTC. The percentage of correctly predicted labels will tell the accuracy or effectiveness of the DTC. For a more thorough explanation, refer to (Tan, Steinbach & Kumar, 2005). 3 Methodology The pipeline of this study (see Figure 1) was to extract and prepare audio files from the Vocal Joystick Vowel Corpus. Then, formants and cepstral coefficients were computed 4 for each file. The set of files with their corresponding formants and cepstral coefficients was split into training and testing data. A DTC was trained with the training data, and tested with the testing data, yielding an accuracy percentage. The characteristics of each step are explained in this section. Figure 1: Diagram of the method used to measure the performance of formants and MFCC in pronunciation prediction. 3.1 Corpus and Audio Processing In this study we used the Vocal Joystick Vowel Corpus (Bilmes, Wright, Xiao, Malkin Kilanski, 2006). This project selected a group of nine monophthongs and 12 vowel- to-vowel transitions. Sounds with different duration, amplitude and intonation were recorded for each vowel: • Duration: short (1 second), long (2 seconds) and nudge (very short repetitions of the same vowel). • Amplitude: quiet, normal, loud, quiet to loud and loud to quiet. • Intonation: level, rising and falling. From this corpus, we considered all the sound files available in the corpus corre- sponding to the phonemes /@/, /ae/, /A:/ and /2/ whose duration was either short or long, whose amplitude was quite, normal or loud, and whose intonation was in a single level. A total of 784 files satisfied these conditions. 3.2 Data Preparation An example of a raw data file from the corpus is shown in Figure 2a. It can be seen that there are silent parts and the amplitude is not normalised. Also, even though we selected a single level of intonation, it is clear that the amplitude of the sound decreases as time progresses. Therefore, for each file we deleted the silent part. Then, a section of duration 40ms was selected so that the signal does not change considerably and is approximately periodic (Figure 2b). Finally, a Hamming window was applied to the resulting sound signal with the purpose of smoothing the Fourier Transform used in the MFCC extraction (Figure 2c). 5 Figure 2: Preparation example of a sound signal corresponding to the /2/ phoneme. a) Raw signal. b) Silence deletion, amplitude normalisation and selection of a 40ms interval. c) Application of a Hamming window. 3.3 Evaluation of Formants and MFCC Performance with a DTC Then, the LPC Python implementation by Danilo Bellini was used to compute the formants (Bellini, 2016). To do the calculation of the MFCC, the Python implemen- tation by James Lyons (Lyons, 2016) was used. Finally, the set of computed formants and the set of computed cepstral coefficients were partitioned into two groups each. One of the groups contained two thirds of the data, and the other one contained a third. The former was the training data, and the later was the testing data. To ex- emplify this procedure, denote S = {(s, v)} as the set of the sound signal files, each of which is labelled by a vowel v. Let F (s) be a function that computes the formants F of a sound signal s. Let X = {(F (s), v)∀s ∈ S} be the data set of formants, labelled by their respective vowel. Let Xtr ⊂ X be the set of training data and Xte ⊂ X be the set of testing data. The DTC learns the ranges corresponding to each vowel in the formants space by creating a function DT C(F (s)) that takes the values of the labels, i.e. the phonemes /@/, /ae/, /A:/ and /2/. For instance, if after the learning process is finished, a sample F (s), labelled by the phoneme /@/, is presented to the DTC, and DT C(F (s)) = /ae/, then the DTC failed to predict the correct phoneme. If instead DT C(F (s)) = /@/ then the DTC was successful in the prediction. The accuracy is thus defined as the percentage of correctly predicted phonemes from the testing data. We used the accuracy to test the quality of prediction by the DTC using formants and Mel coefficients separately. This gives a measure of how well could formants and cepstral coefficients help in the objective evaluation of pronunciation. 6 4 Results, Analysis and Discussion 4.1 Formants From the 784 sound files, 142 were discarded for this analysis and for the one cor- responding to the MFCC. The reason to discard these files was that some recorded sounds contained parts in which the signal was not periodic due to a trembling voice from the speaker. This could cause the LPC and MFCC algorithms to be affected. The criterion used to discard the data is now explained. Denote the recordings or sound signals that belong to vowel v as (s, v). Also, denote the mean value of the i-th formant (i = 1, 2) and the standard deviation of the i-th formant, for a vowel v, as (µi, v), (σi, v), respectively. The remaining 642 sound signals satisfied the condition Fi(s) − µi < 1.5σi, (1) for each vowel v, where Fi refers to the i-th formant. The computed formants for these sound signals are shown in figure 3. Figure 3: Frequencies in Hertz of the first two formants for the studied phonemes. aa is /A:/, ax is /@/, ae is /ae/ and ah is /2/. The DTC trained with the formants yielded a 70% accuracy. Although this success rate of the predictive model is a very low rate, it can be considered as good taking into account that only two features were used to predict the data: the first two formants. This means that with little information about four very similar sounding phonemes, we were able to predict, with an accuracy of 70%, the vowel of a sound taken at random from the recordings obtained from the corpus. Furthermore, Figure 3 shows a non-Gaussian distribution in either formant for every phoneme. This is supported by observations in which it was seen that formants do not only depend on the geometry of the vocal tract of each person, but also are statistically dependent on the age, as shown in (Hawkings & Midgley, 2005); as well as on gender, as shown in (Hillenbrand, Getty, Clark, & Wheeler, 1995). The formants measured are shown in table 2 and compared with measurements from other studies. Table 2: Formants measurement in Hertz. Our measurements are compared with Hawkings et. al., Hunter et. al., Deterding. Study Our Hawkings et. al. Hunter et. al. Deterding Phoneme /@/ /ae/ /A:/ /2/ F1 631 720 573 693 F2 1049 1644 1311 1182 F1 496 696 608 629 F1 643 667 680 661 F2 1019 1565 1193 1296 F1 625 748 757 724 F2 973 1360 1211 1282 F2 833 1574 1062 1160 7 Studies shown in Table 2 show that formants vary a lot with age, gender and geography. Therefore, we see that identifying a phoneme by its formants is not trivial, but as we showed, can be done with an estimated accuracy of 70%. Despite the low accuracy, formants keep being used for vowel pronunciation research, as in (Rasilo & Rasanen, 2017), in which the process of infants learning their native language was simulated through a Leaning Virtual Infant that received sounds from its caregivers. At first the Learning Virtual Infant babbled randomly, but as the learning process advanced, it began to compute formants to identify similar sounding vowels and to improve its pronunciation. 4.2 MFCC In order to visualise the MFCC 13 MFCC were obtained for every sound signal. of every sound signal, a dimension reduction from 13 to 2 (i.e. from the MFCC space to a plane) was performed with Principal Component Analysis (PCA). This method projects the data from the high-dimensional space onto a plane that preserves the maximum possible variance of the data. The distribution of the MFCC for the different phonemes on the plane computed with PCA is shown in Figure 4. Figure 4: PCA of the MFCC. a) shows the four studied phonemes and b) shows only /@/, /ae/ and /2/. As it can be seen from Figure 4a, the MFCC of the phonemes seem mixed. In particular, note that the points corresponding to the phoneme /A:/ are mixed with the ones corresponding to the phoneme /2/. This can also be seen in the formants figure. Ignoring the /A:/ points produces Figure 4b, in which the clusters of data can be identified. Partitioning the data shown in Figure 4a in training and testing data, an accu- racy of 56% was accomplished with the DTC. While if the data shown in Figure 4b was used, an accuracy of 71% was measured. These very low accuracies show that the MFCC method lacks sensibility to subtle differences between the studied sound signals. But, why are the MFCC so good at speech recognition then? The first thing to mention is that the MFCC are normally used to train models that are more complex than a DTC, like neural networks. The goal in speech recognition is to understand words, instead of single sounds. To check the accuracy of the MFCC at recognising different sounding sounds, we proceeded to analyse the phonemes /2/, /e/, /u/ and /o/. The PCA results are shown in Figure 5. 8 Figure 5: PCA of the MFCC. a) shows the phonemes /2/, /e/, /u/ and /o/. b) shows only /2/, /e/ and /u/. ee is /e/, uu is /u/ and oo is /o/. Using the data shown in Figure 5a, the accuracy was measured in 73%. Clearly the MFCC corresponding to the phoneme /o/ were mixed with the ones corresponding to the phoneme /u/. To avoid this noise, if /o/ is removed, an accuracy of 88% was reached. This shows that MFCC are a reasonable method to recognise different phonemes. 5 Conclusions and Perspectives The Vocal Joystick Corpus was used to build a data set of sounds corresponding to the phonemes /@/, /ae/, /A:/ and /2/. From each of the sound signals, both formants and MFCC were computed. These were used to train a DTC that acted as a classifier. Using formants, an accuracy of 70% was achieved. Using MFCC, an acuraccy of 52% was measured. MFCC's performance was much better when the DTC was trained with the coefficients computed from the phonemes /2/, /e/ and /u/, reaching 88%. However, these speech recognition tools fail to correctly predict the phonemes of similar sounding signals. As a response to this deficiency, computer and linguistics scientists work to build computational tools that learn subtle differences between sounds in order to assess a person's pronunciation correctly. For instance, a research in the Chinese language showed results that improved significantly the previous recognition models in detect- ing mispronunciation of phonemes (Wei, Hu, Hu, & Wang, 2009). However, the advance of technology to support pronunciation learning must be accompanied by designed learning programs that help students to learn autonomously. More people need to be encouraged to work in this interdisciplinary field that is pioneering and improving language teaching. References [1] Baker, J., Li Deng, Glass, J., Khudanpur, S., Chin-hui Lee, Morgan, N., & O'Shaughnessy, D. (2009). Developments and directions in speech recognition and understanding, Part 1 [DSP Education]. IEEE Signal Processing Magazine, 26(3), 75-80. http://dx.doi.org/10.1109/msp.2009.932166 [2] Bellini, D. (n.d.). Expressive Digital Signal Processing (DSP) package for Python, 2016. Retrieved November 16, 2016, from https://github.com/danilobellini/ audiolazy [3] Bilmes, J., Wright, R., Xiao, L., Malkin, J. & Kilanski, K. 2006. http://melodi. ee.washington.edu/vj/index.html 9 [4] Davis, S. & Mermelstein, P. (1980). Comparison of parametric representations for monosyllabic word recognition in continuously spoken sentences. IEEE Trans- actions On Acoustics, Speech, And Signal Processing, 28(4), 357-366. http: //dx.doi.org/10.1109/tassp.1980.1163420 [5] Deng, L. & O'Shaughnessy, D. (2003). Speech processing (1st ed., pp. 19-26). New York: Marcel Dekker. [6] Deterding, D. (2006). The North Wind versus a Wolf: short texts for the description and measurement of English pronunciation. Journal Of The In- ternational Phonetic Association, 36(02), 187. http://dx.doi.org/10.1017/ s0025100306002544 [7] Ghaffarvand Mokari, P. & Werner, S. (2016). Perceptual assimilation predicts ac- quisition of foreign language sounds: The case of Azerbaijani learners' production and perception of Standard Southern British English vowels. Lingua, 185, 81-95. http://dx.doi.org/10.1016/j.lingua.2016.07.008 [8] Hawkins, S. & Midgley, J. (2005). Formant frequencies of RP monophthongs in four age groups of speakers. Journal Of The International Phonetic Association, 35(02), 183. http://dx.doi.org/10.1017/s0025100305002124 [9] Hillenbrand, J., Getty, L., Clark, M., & Wheeler, K. (1995). Acoustic charac- teristics of American English vowels. The Journal Of The Acoustical Society Of America, 97(5), 3099. http://dx.doi.org/10.1121/1.411872 [10] Hincks, R. (2003). Speech technologies for pronunciation feedback and evaluation. Recall, 15(01). http://dx.doi.org/10.1017/s0958344003000211 [11] Hinton, G., Deng, L., Yu, D., Dahl, G., Mohamed, A., & Jailty, N. et al. (2012). Deep Neural Networks for Acoustic Modeling in Speech Recognition. Retrieved from http://static.googleusercontent.com/media/research.google.com/ en//pubs/archive/38131.pdf [12] Hunter, G. & Kebede, H. (2012). Formant frequencies of British English vowels produced by native speakers of Farsi. Soci´et´e Fran¸caise d'Acoustique. Retrieved from https://hal.archives-ouvertes.fr/hal-00810580/document [13] Lee, K. (1988). On large-vocabulary speaker-independent continuous speech recognition. Speech Communication, 7(4), 375-379. http://dx.doi.org/10. 1016/0167-6393(88)90053-2 [14] Lyons, J. Mel Frequency Cepstral Coefficient (MFCC) tutorial, Practical Cryp- tography. Retrieved October 15, 2016, from http://practicalcryptography. com/miscellaneous/machine-learning/guide-mel-frequency-cepstral- coefficients-mfccs/ [15] Martin, I. & Jackson, C. (2016). Pronunciation Training Facilitates the Learning and Retention of L2 Grammatical Structures. Foreign Language Annals, 49(4), 658-676. http://dx.doi.org/10.1111/flan.12224 [16] Mirzaei, K., Gowhary, H., Azizifar, A., & Esmaeili, Z. (2015). Comparing the Phonological Performance of Kurdish and Persian EFL Learners in Pronunciation of English Vowels. Procedia - Social And Behavioral Sciences, 199, 387-393. http: //dx.doi.org/10.1016/j.sbspro.2015.07.523 10 [17] Neri, A., Mich, O., Gerosa, M., & Giuliani, D. (2008). The effectiveness of com- puter assisted pronunciation training for foreign language learning by children. Computer Assisted Language Learning, 21(5), 393-408. http://dx.doi.org/10. 1080/09588220802447651 [18] Oppenheim, J. & Magnasco, M. (2013). Human Time-Frequency Acuity Beats the Fourier Uncertainty Principle. Physical Review Letters, 110(4). http://dx. doi.org/10.1103/physrevlett.110.044301 [19] O'Grady, W. & Dobrovolosky, M. (1997). Contemporary Linguistics (3rd ed., pp. 40-87). Boston: Bedford/St. Martin's. [20] Prica, B. & Ili´c, S. (2010). Recognition of vowels in continuous speech by using formants. Facta Universitatis - Series: Electronics And Energetics, 23(3), 379-393. http://dx.doi.org/10.2298/fuee1003379p [21] Rasilo, H. & Rasanen, O. (2017). An online model for vowel imitation learn- ing. Speech Communication, 86, 1-23. http://dx.doi.org/10.1016/j.specom. 2016.10.010 [22] Rosen, S. & Howell, P. (2011). Signals and systems for speech and hearing (2nd ed., p. 163). London: Academic Press. [23] Sethna, J. (2006). Statistical mechanics: Entropy, Order Parameters and Com- plexity (1st ed., p. 299). Oxford: Oxford University Press. [24] Tan, P., Steinbach, M., & Kumar, V. (2005). Introduction to Data Mining (1st ed., p. 150). Boston: Pearson. [25] Wei, S., Hu, G., Hu, Y., & Wang, R. (2009). A new method for mispronun- ciation detection using Support Vector Machine based on Pronunciation Space Models. Speech Communication, 51(10), 896-905. http://dx.doi.org/10.1016/ j.specom.2009.03.004 [26] Wellekens, C. (1998). Introduction to Speech Recognition Using Neural Networks. Bruges: ESANN. Retrieved from https://www.elen.ucl.ac.be/Proceedings/ esann/esannpdf/es1998-456.pdf [27] Zegers, P. (1998). Speech Recognition Using Neural Networks (Master of Science with a major in Electrical Engineering). University of Arizona. 11
1809.10617
1
1809
2018-09-27T16:28:18
Enabling FAIR Research in Earth Science through Research Objects
[ "cs.CL", "cs.DL" ]
Data-intensive science communities are progressively adopting FAIR practices that enhance the visibility of scientific breakthroughs and enable reuse. At the core of this movement, research objects contain and describe scientific information and resources in a way compliant with the FAIR principles and sustain the development of key infrastructure and tools. This paper provides an account of the challenges, experiences and solutions involved in the adoption of FAIR around research objects over several Earth Science disciplines. During this journey, our work has been comprehensive, with outcomes including: an extended research object model adapted to the needs of earth scientists; the provisioning of digital object identifiers (DOI) to enable persistent identification and to give due credit to authors; the generation of content-based, semantically rich, research object metadata through natural language processing, enhancing visibility and reuse through recommendation systems and third-party search engines; and various types of checklists that provide a compact representation of research object quality as a key enabler of scientific reuse. All these results have been integrated in ROHub, a platform that provides research object management functionality to a wealth of applications and interfaces across different scientific communities. To monitor and quantify the community uptake of research objects, we have defined indicators and obtained measures via ROHub that are also discussed herein.
cs.CL
cs
Enabling FAIR Research in Earth Science through Research Objects Andres Garcia-Silvaa,∗, Jose Manuel Gomez-Pereza,∗, Raul Palmab, Marcin Krystekb, Simone Mantovanic, Federica Foglinid, Valentina Granded, Francesco De Leod, Stefano Salvie, Elisa Trasatie, Vito Romanielloe, Mirko Albanif, Cristiano Silvagnif, Rosemarie Leonef, Fulvio Marellig, Sergio Albanih, Michele Lazzarinih, Hazel J. Napieri, Helen M. Glavesi, Timothy Aldridgei, Charles Meertensj, Fran Bolerj, Henry W Loescherk, Christine Laneyk, Melissa A Genazziok, Daniel Crawll, Ilkay Altintasl aExpert System, Calle Profesor Waskman 10, 28036 Madrid bPoznań Supercomputing and Networking Center PSCN, Jana Pawła II 10, 61-139 Poznań, Poland cMeteorological and Environmental Earth Observation MEEO, Viale Volano 195/A Int. 2 I-44123 Ferrara, Italy dIstituto di Scienze Marine-Consiglio Nazionale delle Ricerche ISMAR-CNR, Via Gobetti, 101 40129 Bologna Italia eIstituto Nazionale di Geofisica e Vulcanologia, Via di Vigna Murata, 605 00143 Roma Italy fEuropean Space Agency ESA-ESRIN, Largo Galileo Galilei, 1, 00044 Frascati RM, Italy gTerradue Srl, Via Giovanni Amendola,46 00185 Rome Italy hEuropean Union Satellite Center, Apdo. de Correos 511, 28850 Torrejón de Ardoz, Madrid -- Spain iBritish Geological Survey, Nicker Hill, Keyworth, Nottingham NG12 5GG jUNAVCO, Boulder, CO, USA kBattelle-National Ecological Observatory, Network, Boulder, CO, USA lSan Diego Supercomputer Center, UCSD, La Jolla, CA, USA Abstract Data-intensive science communities are progressively adopting FAIR practices that enhance the visibility of scientific breakthroughs and enable reuse. At the core of this movement, research objects contain and describe scientific information and resources in a way compliant with the FAIR principles and sustain the development of key infrastructure and tools. This paper provides an account of the challenges, experiences and solutions involved in the adoption of FAIR around research objects over several Earth Science disciplines. During this journey, our work has been comprehensive, with outcomes including: an extended research object model adapted to the needs of earth scientists; the provisioning of digital object identifiers (DOI) to enable persistent identification and to give due credit to authors; the generation of content-based, semantically rich, research object metadata through natural language processing, enhancing visibility and reuse through recommendation systems and third-party search engines; and various types of checklists that provide a compact representation of research object quality as a key enabler of scientific reuse. All these results have been integrated in ROHub, a platform that provides research object management functionality to a wealth of applications and interfaces across different scientific communities. To monitor and quantify the community uptake of research objects, we have defined indicators and obtained measures via ROHub that are also discussed herein. Keywords: FAIR principles, Research Objects, Research Infrastructure, Semantic Technologies, Earth Science ∗Corresponding author Email addresses: [email protected] (Andres Garcia-Silva), [email protected] (Jose Manuel Gomez-Perez), [email protected] (Raul Palma), [email protected] (Marcin Krystek), [email protected] (Simone Mantovani), [email protected] (Federica Foglini), [email protected] (Valentina Grande), [email protected] (Francesco De Leo), [email protected] (Stefano Salvi), [email protected] (Elisa Trasati), [email protected] (Vito Romaniello), [email protected] (Mirko Albani), [email protected] (Cristiano Silvagni), [email protected] (Rosemarie Leone), [email protected] (Fulvio Marelli), [email protected] (Sergio Albani), [email protected] (Michele Lazzarini), [email protected] (Hazel J. Napier), [email protected] (Helen M. Glaves), [email protected] (Timothy Aldridge), Preprint submitted to Journal of LATEX Templates 1. Introduction Data-intensive science communities, together with a di- verse group of stakeholders from academia, industry, fund- ing agencies and publishers, are calling for innovative ways to manage their data, methods and other resources that enhance the visibility of scientific breakthroughs, encourage reuse, and foster a broader data accessibility[1]. These ini- tiatives seek to overcome the current limitations imposed by conventional scholarly communications, such as the [email protected] (Charles Meertens), [email protected] (Fran Boler), [email protected] (Henry W Loescher), [email protected] (Christine Laney), [email protected] (Melissa A Genazzio), [email protected] (Daniel Crawl), [email protected] (Ilkay Altintas) September 28, 2018 publication of data1 and research software[2] in isolated repositories. Modern science requires to systematically capture the research lifecycle and to provide a unified entry point with accepted (standardized) means to access the process-level information about the scientific investigation, e.g., hypotheses investigated, the data used and produced in a study, the type of analytics and computations used, the derived conclusions, the researchers themselves, and the different versions and licensing of data or software, to name a few. Some envision a new science grand challenge: to create artificial intelligence that can eventually make major scientific discoveries worthy of a Nobel Prize [3]. While this is still far from being realized, it highlights the increased need to enhance the type of data and knowledge management that supports the advancement of scientific frontiers[4]. The use of Research Objects (RO) enable such vision, and have the potential to accelerate the production of scientific knowledge and foster the adoption of good data (and method) management practices. A research object [5, 6, 7] is a semantically enriched information unit that encapsulates all the materials and methods relevant to a scientific investigation, the associated annotations and the context where such resources were produced and used. Research objects can be viewed as technical and social artifacts with the goal to enhance the sharing, preservation and communication of data-intensive science, facilitate validation, and encourage reuse by the community. On the one hand, research objects address the technical challenges, e.g., preservation, reproducibility, and interoperability, and contain metadata that make them uniquely identifiable, processable, and machine readable. Inspired by software sustainability initiatives[8, 9], data, methods and software can be encapsulated as a citable research object in ways that are also complementary to traditional publications. On the other hand, research objects also address some of the social aspects in the scientific enterprise [10], by fostering author accreditation of their respective contributions that, in turn, enables personal and team advancement, discussion around the investigation itself, and supports collaboration and innovation. Moreover, there are other added benefits of the use of research objects in this context, such as broader distributions of the cited work, shortened publication times, and the release of other resources used in the scientific study. Research objects reinforce the FAIR Data Principles [11]: a concise and measureable set of guidelines to enhance data reusability, which put emphasis on enhancing the ability of machines to automatically find and use data. Research objects also support the '7-R's' (Reusable, Repurposeable, Repeatable, Reproducible, Replayable, Referenceable, Re- spectful) that characterize reuse in e-laboratories [5], and which was the original motivation for the creation of re- search objects in this context. In support of the FAIR 1Data Citation Synthesis Group Joint Declaration of Data Citation Principles: https://doi.org/10.25490/a97f-egyk principles and 7-R's, research objects not only foster data reuse but also place the specific scientific study in a broader (accessible) perspective by providing contextual informa- tion about the study. This paper describes the use of research objects in Earth Science, as an exemplar of the adoption of FAIR principles and the 7-R's, supported by the ROHub platform 2. Our approach has been informed and validated by numerous earth scientists from different communities, in the context of projects to build e-research infrastructure (EVER-EST project3, and CoopEUS project4). We have set an ecosys- tem of tools around research objects that helps to ensure that they are rich in metadata, indexable, searchable and discoverable, authors receive due credit, and end-user ap- plications are tailored to the needs of earth scientist. The remainder of the paper is structured as follows. Section 2 further motivates our work by showing a FAIR assessment on available earth observation data sets. Sec- tion 3 describes research objects. Section 4 presents our approach to build a FAIR research environment. Section 5 describes the extensions, customizations, and enhance- ments to support end-user needs and the management of the research life cycle. Section 6 focuses on the generation of content-based research object metadata. Section 7 shows how such metadata is leveraged by dedicated recommender systems and third party search engines. In Section 8, we demonstrate our approach with 3 use cases. Section 9 presents our work towards community building and take up. Finally, Section 10 presents conclusions and future work. 2. FAIR challenges in Earth Science Earth scientists work with heterogeneous datasets gener- ated by data providers such as space agencies, specialized organizations and research projects that produce earth ob- servation data. For example, scientists interested in marine litter need to understand complex scientific inquiries about the distribution and sources of litter, the pathways, the transport mechanisms to the open deep sea, its transforma- tions, the impact on the ecosystem and the sink of marine litter in the marine environment. For such tasks, they work with multiple data types, including: in situ sea floor obser- vations from imaging technology (ROV or Dive transects), fishing trawling, geophysical surveys (e.g. Multi Beam and Side Scan Sonar), visual surveys of floating debris and data for oceanographic modeling. Were such data published according to the FAIR prin- ciples, it would be easier for domain scientists to focus exclusively on the analysis of the data and generate sci- entific results derived from such observations. However, this is typically not the case. We selected a sample of 35 2ROHub is available online at http://www.rohub.org 3http://ever-est.eu/ 4https://www.neonscience.org/observatory/ strategic-development/coopeus-project 2 Table 1: Shortlist of public marine litter data sets per project Area Period Project Format Size .shp .csv 200 KB 2009-2012 Artic, Atlantic, HERMIONE Mediterranean .shp .csv 200 KB 2012-2015 Mediterranean PERSEUS .shp .csv 200 KB 2013-2016 Mediterranean MIDAS 2007-2010 Mediterranean PROMETEO .mp4 2010-2012 Mediterranean OASIS DEL MAR .mp4 .shp Ritmare Venice Lagoon CoCoNet .shp 1 GB 1 GB 14 MB 2013 90 GB 2012-2015 Adriatic as well as other important metadata that describe the char- acteristics, inter-dependencies, context and dynamics of the aggregated resources [5] [6]. As such, a research object can encapsulate scientific knowledge and provide a mech- anism for sharing and discovering reusable assets of the investigation within and across relevant communities, and in a way that supports the reliability and reproducibility of the results of such investigation. Nowadays, ROHub [13] is the reference platform for research object management, with myExperiment as its nearest precursor [14]. While there are no pre-defined constraints related to the type of resources that a research object can contain, in the context of scientific research the following usually apply: • Data used and produced during the experiment or • Scientific methods applied. • Software and workflows implementing the methods. • Provenance and execution settings. • People involved in the investigation. • Annotations about these resources, to interpret the observation. scientific outcomes captured by a research object. Figure 1: FAIR-ness evaluation of 35 datasets about marine litter highly curated, marine research datasets frequently used for marine litter analysis (table 1 shows some of them), col- lected by public organizations and publicly funded research projects through EU framework programs and national pro- grams and qualitatively assessed their level of FAIR-ness. To this purpose, we followed the methodology proposed by Dunning et al. [12], which systematically evaluates each of the 15 principles corresponding to the 4 letters of FAIR. The methodology considers the information available on the website of the data provider, what is written on help pages, and what is visible in the published data record. The results of our analysis (see figure 1) show that none of the selected datasets can be considered FAIR at the present stage, while most of them do not comply with the FAIR principles. While this analysis only covers a specific area of Earth Science, the conclusions we obtained illustrate the general situation of research data in the observational scientific disciplines. 3. Research Objects Research objects describe aggregations of scientific knowl- edge in a form, rich with annotations, that makes it rec- ognizable, processable, and exchangeable by both humans and machines. A research object is a semantically rich aggregation of resources that bundles together essential sci- entific information about a scientific investigation [5]. This information is not limited merely to the data used and the methods employed to produce and analyze such data, but it may also include links to the members of the investigation The research object model relies on the W3C Resource Description Framework RDF [15], a data model specifi- cally designed for data interchange in the web, and the Web Ontology Language OWL [16], a rich knowledge rep- resentation model. In practice, this means that research objects can be easily processed not only by humans but also by machines, since both data and its semantics are described following standard means. The research object model comprises a set of vocabularies that allow describing a research object formally. Such vocabularies are defined in the following ontologies: • The Research Object Core Ontology5 (ro), de- scribing the aggregation of resources in the research object, as well as the annotations made on those re- sources. • The Workflow Description Ontology6 (wfdesc), meant as an upper ontology for more specific workflow definitions, and as a way to express abstract workflows. • The Workflow Execution Provenance Ontol- ogy7 (wfprov), for the representation of provenance information generated by the execution of a scientific workflow. • The Research Object Evolution Ontology8 (roevo), which describes research object lifecycle infor- mation. Aggregation is supported through the use of the OAI- ORE vocabulary while annotation is supported by the Web Annotation Ontology9. In addition, the research object 5http://purl.org/wf4ever/ro 6http://purl.org/wf4ever/wfdesc 7http://purl.org/wf4ever/wfprov 8http://purl.org/wf4ever/roevo 9Respectively,http://openarchives.org/ore and https:// www.w3.org/ns/oa 3 Figure 2: Simplified view of the research object containing a habitat suitability model (earth science specific metadata in the dashed rectangle). model makes use of existing vocabularies, in particular, Friend of a Friend (FOAF), Dublin Core Terms (DCTerms), and the Citation Typing Ontology (CITO), to provide research object authors with the means to express aspects such as the contributors to a research object, its citations, and the dependencies the research object and its content may have. Figure 2 shows a graphical representation of an existing research object 10 that uses the core vocabulary. This research object shows a partial and simplified view of the structure of an existing exemplary research object, which uses several modules of the research object ontology suite. It contains a habitat suitability model to derive the Marine Strategy Framework Directive indicator 1.5 (habitat area), assessing a descriptor of biological diversity. The research object encapsulates a scientific workflow, the input dataset, provenance information about the execution of the work- flow, the output dataset, ancillary documentation such as images and presentations, and information regarding the author, plus metadata about the research object evolution and quality checks. 4. FAIR research environment based on Research Objects To enable a FAIR research environment we advocate for the creation of an ecosystem of tools around the research object model and lifecycle. The research object model is at the core of this ecosystem since it is based on a standardized formal semantics and an agreed upon vocabulary, making scientific outcomes interoperable, machine-readable, and shareable. The research object model is generic enough to accommodate any scientific community. Nevertheless, to make it practical for earth sciences we extended and customized the model to the specific needs of this area of science. 10http://sandbox.rohub.org/rodl/ROs/SeaMonitoring01/ 4 The ecosystem, which is depicted in figure 3, takes into account that: i) rich and expressive metadata is a key factor for sharing and reuse, ii) scientific results need to be visible and easily discovered, iii) scientists need to receive due credit for their work, and iv) research object management capabilities need to be integrated in existing analytic tools already in use by earth scientists in order to foster adoption. First, the research object model enables to capture spe- cific metadata from each of the processes and tools used in the research lifecycle and ensembles them into a more comprehensive suite of metadata about the structure, con- tent, and lifecycle of the research object. The structure and lifecycle metadata can be generated automatically by a re- search object management system, e.g., ROHub. However, producing metadata about the content of a research object, e.g. unstructured text like scientific papers, slides, etc. is a complex tasks that requires more intelligent management of the information, which typically falls on the scientist. As a consequence, these metadata are usually neglected and scarce. Our solution to this issue is a semantic enrichment process that carries out natural language processing against the research object payload. In addition, it is necessary to establish functionality that monitors the availability of current and relevant metadata, and the overall quality of the research object. We address this challenge through the use of checklists, defined according to the research object usage scenarios with the input of earth scientists. Second, we make sure that research objects are indexable and searchable by search engines and tools that leverage the available metadata. Moreover, we developed a recom- mender system that identifies research objects that may be similar (in terms of their content) to other objects selected by a scientist. Third, dynamic accreditation is crafted through an exten- sion of the research object lifecycle with a fork mechanism inspired by software development practices [17], which auto- matically cites the research object being reused. Moreover, Figure 3: Conceptual diagram that outlines the suite of tools around research objects to enable FAIR research. Around the research model the inner circle depicts the features required and the outer circle shows their technical support. ROHub (a DataCite11 member) assigns Digital Object Identifiers (DOI) to research objects upon release of inter- mediate or final research results. Lastly, end-users have a plethora of analytical tools tai- lored to their scientific disciplines. Hence, the challenge is to develop functional capabilities to integrate research ob- ject with the tools and datasets that facilitate earth-system science, e.g., statistical packages, images, time series, re- mote sensed- mapped resources, and geo-referenced data, etc. As a solution, ROHub offers a generic research object management portal where scientists can create research objects and reuse existing ones from its repository, and can manage their access policies, resources and metadata including licensing. In addition, we describe two additional applications working on ROHub's back-end to facilitate the integration of other user interfaces: a Virtual Research Environment (VRE) that brings together earth observa- tion datasets and analytical tools, and a time series data management application to more easily query and visualize real-time data on a map. In table 2 we show how the contributions presented in this paper support FAIR research data in our target scientific communities. The research object model covers practically all the aspects of FAIR. Nevertheless, while the model en- ables the generation of FAIR data, tools that implement the model are required to actually produce and manage FAIR data. DOIs, as permanent identifiers, reinforce findabil- ity and reuse given that they link to metadata about the publication. The semantic enrichment enhances findabil- ity by producing rich metadata, while checklists support accessibility, by validating that metadata is available, and 11https://www.datacite.org reuse, by checking the existence of license and provenance metadata among other types. The visibility of research objects by search and recommendation systems is another step towards increasing findability. Finally, ROHub, which has been built on top of the the research object model and integrates the other developments presented herein, supports the generation and reuse of FAIR data. This is further illustrated by the other applications described in the paper, i.e. the EVER-EST virtual research environ- ment and the time-series data management application developed in the context of the COOPEUS project. 5. Research Object Model - Earth Science Exten- sions In this paper we focus on scientific communities in Earth Science disciplines including sea monitoring, volcanology and biodiversity, that use earth observation data for dif- ferent purposes. Such communities are represented by the following institutions. • Institute of Marine Science (CNR-ISMAR)12. • Geohazard Supersites and Natural Laborato- ries (GSNL)13, represented by the Italian National Institute of Geophysics and Volcanology (INGV). • National Ecological Observatory Network (NEON)14. All these communities pursue FAIR practices for collab- oration, sharing and reuse of scientific knowledge, even 12http://www.ismar.cnr.it 13http://supersites.earthobservations.org 14https://www.neonscience.org/ 5 Table 2: Research object model and tools in support of FAIR principles. Rows are a subset of 12 FAIR principles and the model or tool support of each principle is indicated with an x. Research object model + Digital Object Semantic Enrichment Search Engines Earth Science Extensions Identifiers (DOI) Quality Assessment Recommenders & x & x F Models & tools \ Principles - Rich Metadata - (meta)Data searchable - Persistent Identifier - (meta)Data retrievable - Open & universal protocol A - Authentication & I Authorization - Formal Knowledge Rep - FAIR Vocabularies - Link to other metadata - Usage license - Provenance R - Standard community meta(data) x x x x x x x x x x x x x x x x x x x User interfaces: ROHub portal User interfaces: VRE portal x x x x x x x x x x x x x x x x x x x x x x x x User interfaces: Time Series Data Management x x x x x x x x x x x x before actual publication of their work in conferences or journals. Two additional organizations focused on earth observation took part in our study, equally contributing requirements for the extension of the research object model and producing exemplary research objects: The UK Natu- ral Hazards Partnership (NHP)15, and the European Union Satellite Centre (SatCen)16. However, while the former three are focused on scientific research missions (and there- fore fall in the scope of this paper), the last two serve operational purposes, providing earth observation services to a limited set of stakeholders and security agencies. The research object model was developed initially in the context of experimental disciplines like genomics and astrophysics [18], where scientific workflows play a central role to enable reproducibility. However, though that is also a relevant aspect for Earth Science communities, these are more focused on observations, e.g. involving the analysis of time series satellite data, rather than experimentation. Therefore we carried out a gap analysis to identify the necessary updates to be implemented in the model. In doing so, we used three main channels [19]: • A requirements questionnaire with 14 questions related to the intended use of research objects that was distributed to each of the four organizations. • A survey addressed to the broader Earth Science com- munity containing a subset of the above questionary, distributed ammong the participants of the Research Data Alliance RDA 9th Plenary Meeting17. • Two Research Object Hackathons, where 50+ users in total from the four organizations received training on research objects methods and tools and started modeling their own exemplars. In the first hackathon, delegates from other scientific domains like Astrophysics18 also participated, sharing their experi- ences with research objects. The analysis of the surveys and the hackathons revealed five main areas where the gap between the coverage pro- 15http://www.naturalhazardspartnership.org.uk 16https://www.satcen.europa.eu 17https://www.rd-alliance.org/plenaries/ rda-ninth-plenary-meeting-barcelona 18http://www.iaa.es 6 vided by the research object model and the needs of earth scientists were significant: geospatial information, time- period coverage, intellectual property rights, data access policies, and general-purpose information. In some cases, such information was not covered at all by the previous version of the research object model (geographic, time, data access policies), and in other cases it was not covered with sufficient detail as required by the earth scientists (intellec- tual property rights). The main additions to the model are summarized below (details available in this technical report [20]) and illustrated in Figure 2 (see the annotations, and prefixes indicating the vocabularies used to model the new information, enclosed in the lower-right dashed rectangle). • Geospatial, the coordinates of the region relevant for the research object and the observation it represents. • Time-period: time span covered in the observation. • Intellectual property rights, including copyright holder, copyright starting year, type of license and attribution. • Data access policy, i.e. the access level and policies • General metadata, including the main scientific dis- cipline of the research object, the size and format of the resources aggregated by the research object, the date when the research object was released, its digital object identifier (DOI), the status according to the research object lifecycle, and its target community. under which the research object can be accessed. The executable resources covered by the model have also been extended to cover not only scientific workflows but also other types of processes, such as web services, scripts, command line tools and dedicated software frequently used in Earth Sciences. Earth scientist also requested new types of research objects according to the kind of the aggregated resources. We extended the research object types to charac- terize not only workflow-centric research objects, but also data-centric and service-centric, as well as documentation and bibliographic research objects. Finally, the research object lifecycle was extended with a new status (forked), which characterizes a new branch of the research object derived from the main one. While some of these changes were considered important for the overall research object community and were incor- porated in the research object model19, other updates were specific to Earth Sciences. Therefore we created a new branch in the code repository of the research object model containing all the new metadata elicited in our analysis20. 5.1. Lifecycle Management Extensions The lifecycle refers to the different stages that a scientific research (and its associated research object) transitions, from hypothesis generation to publication and archival. In previous versions of the research object lifecycle [6], research objects could be Live (mutable research objects related to on-going research processes), Snapshot (immutable re- search objects derived from live research objects, that are ready to release intermediate results), and Archived (im- mutable research objects with final research results, where the research process has been completed). However, the creation of snapshots and archived research objects was limited to the authors of the particular research object, and hence other authors aiming to reuse intermediate results should wait until such snapshot was created. To cope with this limitation, and inspired in Open Source Software devel- opment practices, we introduced a Fork action21 for public, live research objects. Forking a research object means to create a copy of the research object that could be used for testing new ideas without affecting the original research object, or start a new research process based on the forked research object, contributing to speed up research. Another fundamental aspect that the original lifecycle lacked was the provisioning of DOIs for research objects. DOIs are an important tool to encourage scientists to change their current way of work to a one based on re- search objects since they can see the benefits of releasing intermediate results that will be properly credited. DOIs are aligned with the FAIR principles: i) they contribute to the findability of research data and methods, since they are persistent and searchable through a public DOI registry, and ii) they are dereferenceable, meaning that, through a single click, the user will be redirected to a landing page with the main metadata of the research object. Therefore, we extended the lifecycle and associated infrastructure in ROHub22 so that a DOI is automatically generated when a snapshot or and archived research object is released. 6. Extracting Content-based Research Object Metadata through NLP The reuse of research objects depends to a large extent on their associated metadata. Metadata is key for scien- tists to evaluate if a given research object produced by someone else is suitable for their own needs, as a whole or partially. Similarly, it is also critical for computer systems, 19https://github.com/ResearchObject/specifications/ issues/13 20https://github.com/wf4ever/ro/tree/earth-science 21https://help.github.com/articles/fork-a-repo/ 22ROHub is a node of DataCite and an authorized DOI provider. like search engines and recommenders, to automatically collect potentially relevant information through machine- readable annotations. The research object model supports the generation of metadata enabling research object description from dif- ferent viewpoints, including lifecycle information (status, evolution, quality checks, authors), resource types (docu- ment, workflow, dataset), and information derived from the actual content of such resources, like the specific re- search areas or the location of the investigation. It can also contain human annotations in titles, labels, descrip- tions, hypotheses, conclusions and comments. Amongst the different types of metadata, the latter is probably the most descriptive, accurate and valuable in order to obtain a deeper insight on the research since it deals with knowledge directly from the field. However, it formalization requires human involvement and tends to be neglected or embedded in unstructured documents of various formats, like tech- nical reports, presentations or scientific papers. Despite its importance we found that content metadata is scarce for a large number of research objects. From a random sample of 2,500 research objects in ROHub only 800 have such basic content metadata as a descriptive title, with an average character count of 38. In addition, research object descriptions have a typical length of 138 characters, as concise as a Tweet. 6.1. Semantic Enrichment To alleviate the scarceness of content descriptive annota- tions and to structure them beyond plain text, we propose to automatically enrich research objects with semantic metadata extracted from human-generated content in the research object, enhancing human and machine readability thus contributing to enable FAIR research and in line with related efforts like the Concept Web Alliance [21]. The resulting annotations are structured as semantic markup based on a knowledge graph [22] and included as annota- tions following the research object model. The enrichment process, depicted in Figure 4, comprises three main stages: the extraction of text from resources in the research ob- ject, the semantic analysis of such text, and the actual generation of semantic metadata. 6.1.1. Text Extraction The enrichment process starts by gathering all the text available within research object resources and human annotations. We process resources in plain text, Microsoft Word and Powerpoint, and Adobe PDF formats, tagged as any of the following types23: Title (dcterms:Title), Description (dcterms:Description), Document BibliographicRe- source (dcterms:BibliographicResource), Conclusions (roterms:Conclusions), Hypothesis (roterms:Hypothesis), (wf4ever:Document), 23Resource type is assigned upon research object modeling in RO- Hub. 7 gether behave as a noun. E.g., water reservoir or hydrochemical element. • Main Named Entities: Most frequently mentioned named entities, i.e. People, Organizations and Places. E.g., the black sea is a place, UN is an organization, and Elizabeth Mary is a person. Cogito is built on a knowledge graph (Sensigrafo), where concepts (syncons) are represented as groups of lemmas with the same meaning. Syncons are interconnected through semantic and linguistic relations, like hyperonymy, hyponymy and other properties. The English standard Sensigrafo we used in this work contains 301,582 syncons, 401,028 lemmas and 80+ relation types that yield about 2.8 million links. Among other purposes, Cogito leverages the knowledge contained in Sensigrafo to disambiguate the meaning of a word by recognizing its context. 6.2.1. Annotation Generation At the final stage we add the annotations produced by Cogito as research object metadata, following the anno- tation ontology, which is the standard way to annotate resources in the research object model, and the Content- Desc vocabulary (see https://w3id.org/contentdesc), which we developed to explicitly link these annotations to the semantics identified by Cogito. We have integrated the semantic enrichment service in ROHub as a nightly daemon, and a collection of semantically enriched research objects is available at http://everest.expertsystemlab.com/ browse, including a search engine built on Solr26. 6.2.2. Semantic Enrichment Example The research object Land Monitoring Change Detecting Step27 contains a workflow for change detection analysis and includes textual documents describing the hypotheses and conclusions of the analysis. The code excerpt in listing 1 shows the turtle28 serialization of the semantic annotations added to the research object that were extracted from the textual content. In this example the semantic enrichment added six pieces of metadata stating that the research object content, as defined by the dc:subject predicate, mainly refers to con- cepts (cdesc/Concept) "Monitoring" and "Segmentation and Reassembly", which fit in the "Geology" and "Graphic" domains (cdesc/Domain). Two of the most frequent com- pound terms or expressions (cdesc/Expression) are "ex- ploitation of the image archive" and "image processing algorithm". Since the research object actually aims at de- tecting changes in a region by analysing satellite images and applying different image processing algorithms, the resulting metadata provides a rather accurate summary. 26http://lucene.apache.org/solr 27http://sandbox.rohub.org/rodl/ROs/LandMonitoring_ Change_Detecting/ 28https://www.w3.org/TR/turtle Figure 4: Semantic enrichment process ResearchQuestion (roterms:ResearchQuestion), and Paper (roterms:Paper). We use open source tools to process PDF and Microsoft formats, such as apache PDFBOX and POI. 6.2. Semantic analysis Research object enrichment builds on the semantic anal- ysis of text[23], supported by tools such as DBpedia Spotlight[24], which uses Wikipedia articles as senses to annotate the text, or GATE[25], for ontology-based text annotation. Note that this paper focuses on the benefits of semantically annotating research object content beyond the actual tool producing such annotations. So, we will not compare the different alternatives avaliable. In this case we used Expert System's commercial platform Cogito24 for convenience but could have chosen a different option. Rather than trying to cover the whole spectrum of meta- data specified by the research object model, we focus on a more limited set of annotations supported by Cogito, that describe textual content at the domain level as follows: • Main Concepts most frequently mentioned in a docu- ment. A concept groups words with the same meaning. E.g., reservoir, artificial lake, man-made lake are used to refer to a lake used to store water for community use. • Main Domains: Fields of knowledge in which the main concepts are commonly used, e.g. Hidrology for the words in the former case. • Main Lemmas: The cannonical form of the most frequent words in the text, e.g., reservoir, artificial lake, and man-made lake. A lemma can have different meanings and be associated to more than one concept, e.g. reservoir can also refer to a person, animal, plant or substance in which an infectious agent normally lives and multiplies. • Main Compound Terms: Most frequent noun phrases25, a group of words in a sentence that to- 24http://www.expertsystem.com/cogito 25http://dictionary.cambridge.org/dictionary/english/ noun-phrase 8 @base: <.../LandMonitoring_Change_Detecting> . @prefix skos: <http://www.w3.org/2004/02/skos/core#> . @prefix dc: <http://purl.org/dc/terms/> . @prefix cdesc: <https://w3id.org/contentdesc/> . <.../ROs/LandMonitoring_Change_Detecting_Step> dc:subject <subject/1302006390>,<subject/280343272>, <subject/734754489>,<subject/1557562560>, <subject/1852089416>,<subject/79018874> . <subject/1557562560> a "cdesc/Concept" ; skos:prefLabel "Segmentation and Reassembly" . <subject/1852089416> a "cdesc/Concept" ; skos:prefLabel "Monitoring" . <subject/79018874> a "cdesc/Domain" ; skos:prefLabel "Geology" . <subject/280343272> a "cdesc/Domain" ; skos:prefLabel "Graphic" . <subject/734754489> a "cdesc/Expression" ; skos:prefLabel "image processing algorithm" . <subject/1302006390> a "cdesc/Expression" ; skos:prefLabel "exploitation of image archive" . Listing 1: Example of semantic annotations 6.2.3. Assessing the Relevance of the Semantic Metadata We asked members of the organizations participating in our study to answer a questionnaire regarding the new metadata added to the research objects. The objective was to assess the relevance of the annotation types (Domains, Concepts, Named Entities and Compound Terms) with which research objects are enriched against the research object content. In total, 10 researchers participated, who evaluated 19 research objects from their area of expertise and their annotations. The analysis of the results [26] showed that domains and compound terms in general are perceived as relevant to the research object content, while concepts are also relevant but to a lesser extent, and named entities were not found useful by most of the evaluators. Domains are identified by aggregating the domains of all the concepts inferred from the text. Since we are reporting the most frequent domains in the text, erroneously identified domains are left in the long tail of the domain distribution. Compound terms, in turn, explicitly appear as expressions in the text, hence the high relevance perceived by the participants. The results showed evidence that automatically produced semantic metadata brings about a positive enrichment of research object descriptions. They also suggest that dedi- cated user interfaces enabling users to act as curators of the annotations generated may be needed, since a fully auto- mated solution is not feasible yet, given the state of the art in word sense disambiguation. However, we confirmed that a standard, out of the box version of Cogito can produce sufficiently good results for many of the target types of metadata, whose accuracy would be significantly improved, particularly for named entity recognition, with an extended version of Sensigrafo including additional Earth Science knowlege. 6.3. Research Object Quality Research objects with high quality metadata are more likely to be reused than low quality ones, and in the long 9 term such quality could experience changes, for example when some input file (e.g, an annotation file) becomes unavailable, degrading the overall quality of the research object and introducing decay. Inspired in wet lab practices checklists [27] were proposed as the main tool to assess the quality of research objects through their lifecycle [28]. These checklists are made up of statements that specify the required metadata a research object must contain. A checklist contains the requirements that a research object must fulfill for a given purpose. It is not realistic to have a single set of criteria that fits all situations, i.e. the required metadata when reviewing an experiment differs from that involved in workflow execution. A requirement is a condition about the research object metadata and can be defined as mandatory, desirable, or optional. Requirements are validated through rules that describes how the require- ment has to be tested. The most common type of rules are queries over the research object metadata to check for the existence of a particular piece of metadata. Checklists collect the necessary information to calculate quality metrics about the completeness, stability and re- liability of research objects[28]. Completeness measures the extent to which a research object satisfies a number of requirements specified in a checklist, stability measures the degree to which the research object completeness remains unchanged, and reliability combines both previous metrics to provide a unique value indicating to what extent the research object is complete and how stable it has been historically. These metrics are visualized in ROHub via an interactive chart displayed after clicking the RO monitoring tool link in the quality tab. The hackathons allowed earth scientists to acquire ex- perience with the research object model, create their own research objects and become aware of related benefits for their daily work. Scientists actually proposed specific new types of research objects to encapsulate mainly informa- tion regarding scientific workflows, data products, research products, and bibliographic information, which required to design different checklists to assess their quality [29]: • Basic: This checklist addresses the minimum meta- data required for a research object such as title, descrip- tion, author, and access level. The rest of checklists presented below extend the basic checklist. • Workflow: This checklist is intended for research objects built with a scientific workflow at the core. It tests metadata such as workflow definition, workflow execution, input and output data (including format and size), and workflow documentation. • Data Product: This checklist addresses research ob- jects containing mainly data sets. It checks metadata such as the purpose of the data, editor, copyright owner, access level, data format and size. • Research Product, recommended for research ob- jects dedicated to the analysis of data processing out- comes. It tests metadata such as the purpose, process implementation and input and output data. • Bibliographic: This checklist is intended for research objects containing mainly bibliographic information such as bibligraphic references or documents that are a relevant to a specific topic. It tests metadata such as the copyright holder, the purpose and access level, and the existence of at least one resource of type Bibliographic resource. These checklists have been developed and made available in the Earth Science branch29 in the research object github repository, and can be applied in ROHub to any research object in the Earth Science Domain. 7. Leveraging Research Object Metadata for Search and Recommendation The research object metadata and text extracted from its payload can be leveraged by information retrieval tools that makes them visible to other researchers, thus improving their likelihood to be reused. Mainstream search engines are an important component since they reach a large number of users. ROHub allows web crawlers from Google and Bing indexing the research objects. In addition, ROHub provides is own faceted search en- gine that uses the lifecycle metadata, the user-genetared metadata, and the content metadata generated by the se- mantic enrichment to ease the browsing of the research object collection. Facets allow the user to filter the collec- tion by selecting specific values in properties (representing the facets) related to the research object (e.g., creator, or creation date). Some of these properties have values linked to a structured knowledge in the form of reference vocabu- lary (or ontology), such as research area, type of research object, state of the life cycle. Ontologies provides semantics to the property values, and enable semantic inference (e.g., a research object with research area astronomy, is also about space science). Basic information about research objects is provided to external services through a public search engine in- terface. It is implemented using the OpenSearch spec- ification http://www.opensearch.org/ which makes it easily adopted by different clients and frameworks. RO- Hub's OpenSearch interface supports full text search for keyword based scenarios. In order to support finding re- search objects relevant to specific geographic region a spa- tial search extension was implemented. It allows usage of spatial intersection queries and returns georss elements http://www.georss.org in the output document. Search engines are one of the tools of information re- trieval, but not the only ones. Recommender Systems, on the other hand, support exploratory processes and search by example that could help researchers to find research works related to their own. In the following we describe a new recommender system that we developed benefiting of text within research objects and the metadata generated by the semantic enrichment. 7.1. Recommender System A recommender system[30] supports exploration when users do not know exactly what to search but have a par- tial knowledge of e.g. desired characteristics and related examples. Our recommender is content-based[31], i.e. user interests are expressed as a collection of research objects and matched against other research objects based on their content. This leverages the research object social dimen- sion through forms of interaction among researchers such as research object coauthoring and citation. We implemented a new recommender30 based on the results of the experiments reported below, which ex- ploits the metadata generated by the research object semantic enrichment process. The user interface built on top of it is shown in Figure 5. The system is ac- cessible from http://everest.expertsystemlab.com/ spheres/index.html and from ROHub (menu Discover). The user interface follows a visual metaphor designed to facilitate research object sharing and reuse through goal- driven exploration of potentially large collections of research objects. It consists of a navigation panel and information card about the selected research object or scientist on the left-hand side, a set of concentric spheres on the right-hand side, and an authentication box and help option on the upper-right corner. Upon user authentication, the system produces personalized recommendations based on the col- lection of research objects (s)he authored. Through the navigation panel, the user can search for research objects or community members to be added to the recommendation context. The panel segments the collection of research objects in three subsets in decreasing order of proximity: the research objects authored by the user, those authored by collaborators, i.e. contributors to his or her research objects and the rest. Similarly for community members: collaborators, scientists related topic-wise and others. The spheres component serves as a container for both the recommendation context and the recommendation re- sults. Visually, the user is at the center of the spheres. The first sphere around it is an interactive area where the user can drag and drop up to three research objects, scientists (which, processing-wise, act as a proxy to their research objects), or a combination of both from the navigation panel in order to modify the recommendation context. The second and third concentric spheres display the recommen- dation results. The recommender assigns a score to each resulting research object, indicating its similarity with the recommendation context, which is used to sort the results. The higher the score, the closer to the center. The usability and user satisfaction of the approach was assessed previously in [32]. Evaluators answered 50 ques- 29https://github.com/wf4ever/ro/tree/earth-science/ 30API at http://everest.expertsystemlab.com/home/ checklists recommendation-api.html 10 Figure 5: Collaboration Spheres: Recommender system user interface. tions31 aimed at evaluating usability, user satisfaction, per- ceived usefulness and perceived ease of use. Average us- ability was 3.95 in a scale of 1 to 5, user satisfaction was 5.61 (1-7), and usefulness and ease of use scored 5.82 in the same scale. 7.2. Research Object Similarity Research object recommendation builds on a notion of similarity between research objects in the collection and the ones included in the recommendation context. To calculate this similarity we use the traditional vector space model[33], whereby documents (i.e. research objects) and interests are mapped to vectors in a multidimensional space where they can be compared using the cosine function as an indicator of similarity between them. Each dimension in this space is weighted according to a predefined weighting scheme[34] and corresponds to a keyword (or other kind of metadata) in the vocabulary that is used in the research object collection. We carried out different experiments to better character- ize the similarity measure, with different feature sets used to represent the research objects in the vector space model. The alternatives involved both the keywords extracted from the textual content in the research objects and the semantic metadata generated by the semantic enrichment process. We used the standard TF-IDF32 as our weighting scheme. Note that the number of research objects in the Earth Sci- ence domain is still limited in ROHub since the community is just adopting the paradigm. Therefore we resorted to Wikipedia, where there is a good coverage of articles on Earth Science topics. The belonging of such articles to the domain can be easily determined through the categories assigned to them by the editors. 7.3. Experimental Setup To generate the evaluation dataset we traversed the Wikipedia category graph starting in the Earth Science cat- 31Questions available spheresquestionnaire/ at https://sites.google.com/site/ 32TF-IDF stands for Term Frequency-Inverse Document Frequency. egory33, drilled down three levels in the subcategories, and collected all the articles annotated with these categories. We used DBpedia34, the structured version of Wikipedia, to easily traverse the category graph. In total we harvested 27019 articles that were annotated with 1210 categories. We use such categories as indicators of similarity between articles. For each article we extracted the article title and textual content, discarding all the Wikipedia markup language tags, tables, references, image captions, and in- foboxes. Then we created a research object for each article and proceeded to semantically enrich them. To evaluate the similarity measure we use precision at k, a commonly used evaluation metric of ranked results in information retrieval[35]. In our case, precision measures the fraction of research objects identified by the similarity measure that are actually similar to the reference research object. Precision at k is computed on the subset of similar research objects until the k position of the ranked list of similar research objects. We repeated the experiments 10 times and report average precision (p) at 1, 5, 10 and 20. 7.4. Experiment 1 In the first experiment we calculated the similarity be- tween a reference research object and the rest in the dataset. From our dataset we selected categories with at least 40 research objects, and randomly selected 10% of research objects in these categories. In total we assessed the sim- ilarity results regarding 2214 research objects under 250 categories. In addition to research objects in the same cat- egory, we used a relaxed definition of similarity where we considered as similar research objects also those in neighbor categories, i.e. subsumer (parent), siblings, and children categories. For example, the neighbor categories of Marine Biology are the subsumer Oceanography, the sibling Marine Geology, and the children Marine Botany, and Cetology. This similarity definition also indicates the variety of re- lated research objects identified by the similarity measure, a desired property in recommender systems. 33https://en.wikipedia.org/wiki/Category:Earth_sciences 34http://dbpedia.org 11 Table 3: Similarity Evaluation for one document Similarity evaluated on same category Similarty based on p@1 p@5 p@10 p@15 p@20 0,398 Concepts and text 0,571 0,493 0,448 0,396 Sem. metadata no NE and text 0,565 0,490 0,445 Sem. metadata and text 0,569 0,490 0,445 0,396 0,395 0,567 0,487 0,444 Concepts and NE and Text 0,394 0,568 0,490 0,445 Text (content+title) 0,339 0,480 0,415 0,378 Sem. metadata no NE 0,335 0,481 0,412 0,373 Sem. metadata 0,313 0,456 0,385 0,352 Concepts Concepts and NE 0,456 0,384 0,347 0,307 0,420 0,417 0,417 0,416 0,417 0,355 0,350 0,330 0,324 Similarity evaluated on neighbor categories Concepts and text 0,717 0,656 0,621 Sem. metadata no NE and text 0,718 0,654 0,620 0,718 0,657 0,620 Text (content+title) 0,718 0,654 0,617 Concepts and NE and Text Sem. metadata and text 0,718 0,654 0,617 0,643 0,590 0,559 Sem. metadata no NE 0,639 0,578 0,548 Sem. metadata 0,613 0,559 0,529 Concepts Concepts and NE 0,608 0,547 0,513 0,598 0,597 0,597 0,594 0,594 0,538 0,527 0,507 0,491 0,580 0,579 0,578 0,576 0,575 0,523 0,513 0,491 0,475 The experiment results are shown in Table 3, with the different approaches sorted in decreasing order by p@20. The best approach in both versions of the experiment was the combination of main concepts (top 10) generated by the semantic enrichment and textual content of the research object (concepts and text), followed by the combination of all the semantic metadata except named entities and textual content (semantic metadata no NE and text). In general, the combination of semantic metadata plus text seems to produce better results than semantic metadata alone. One interesting observation is that using only seman- tic metadata the precision values, albeit smaller, are close to other approaches using it in combination with text con- tent. This supports our claim that automatically generated semantic metadata can alleviate the lack of user-generated metadata like research object title or description. Finally, although precision can still be improved, the similarity values evaluated on neighbor categories are promising. 7.5. Experiment 2 While the first experiment addressed one-to-one similarity-based recommendation, the second experiment aims at evaluating the similarity measure when the rec- ommendation context includes the combined attributes of more than one research object. From the dataset, we ran- domly selected 1000 pairs of research objects where each pair was not annotated under the same category and the path between the categories in the category graph does not include the Earth Science category (since this would make the two resources barely related). We use the category graph to determine the similarity between research objects by identifying the path connecting the categories of each of the two reference research objects, with the categories in such path as a similarity indicator. For example, if one of the reference research objects falls in the category Oceanography and the other one in the category Marine Botany we consider as similar research objects those falling in these categories plus the category Marine Biology since there exists the path Oceanography ⇒ Marine Biology ⇒ Marine Botany, where "⇒" means hasSubcategory. We relaxed this definition by considering as similar ob- jects those annotated with a category falling in the subtree whose root is the least common subsummer LCS [36] of the categories associated with the reference research objects. The LCS35 is defined as the most specific common ancestor of two concepts found in a given ontology, and in our case it represents the semantic commonalities of the pair of cate- gories. For example, the LCS of Marine Biology and Ocean Exploration is Oceanography. Similarly to experiment 1 this relaxed definition of similarity is aimed as an indicator of the variety of related research objects that the similarity measure generates. The experiment results are reported in Table 4, where the different approaches are sorted in decreasing order by p@20. Results, in table 4 show that using text information alone is the best approach when two research objects are used as the basis to obtain similar research objects. Nevertheless, the use of semantic metadata and text does not seem to harm, to a large extent, the precision of the similarity measure. In this experiment we also validated that the use of the semantic metadata without text produces, although smaller, similar results to the ones that we obtain when we have textual descriptions. The precision values of the similarity metric based on the LCS subtree are a good indicator of the usefulness of the metric in the recommender system when there are more than one research object in the recommendation context. Table 4: Similarity Evaluation for context with two documents Similarity evaluated on categories in the path Similarty based on p@1 p@5 p@10 p@15 p@20 0,406 Text (content+title) 0,577 0,492 Sem. metadata no NE and text 0,567 0,490 0,403 0,401 0,571 0,489 Concepts and text 0,399 0,563 0,485 Sem. metadata and text 0,397 0,560 0,482 Concepts and NE and Text 0,309 0,458 0,388 Sem. metadata 0,308 0,448 0,387 Sem. metadata no NE Concepts 0,411 0,355 0,287 0,281 0,416 0,353 Concepts and NE 0,445 0,441 0,442 0,439 0,438 0,347 0,343 0,321 0,313 0,417 0,413 0,412 0,410 0,408 0,321 0,321 0,299 0,291 Similarity evaluated on categories in LCS subtree Text (content+title) 0,740 0,677 Sem. metadata no NE and text 0,732 0,677 0,736 0,678 Concepts and text 0,725 0,674 Sem. metadata and text Concepts and NE and Text 0,724 0,673 0,657 0,605 Sem. metadata no NE 0,655 0,600 Sem. metadata 0,617 0,583 Concepts Concepts and NE 0,614 0,576 0,643 0,641 0,641 0,637 0,636 0,573 0,571 0,549 0,535 0,626 0,623 0,621 0,618 0,615 0,555 0,546 0,530 0,515 0,618 0,616 0,613 0,610 0,607 0,543 0,539 0,520 0,506 8. Earth science interfaces for research objects Enhancing traditional research practices with FAIR- enabled capabilities based on research objects requires specialized user interfaces that integrate the governance capabilities provided by research objects with existing tools 35http://www.igi-global.com/dictionary/ least-common-subsumer-lcs/41765 12 already used by earth scientist in their daily work. In do- ing so, we need to keep a delicate balance, pushing the boundaries of what is now possible with the current tools (i.e. adding new functionalities) while maintaining the familiarity with current interfaces and user experience. In this section, we illustrate how this challenge has been addressed for different communities of scientists with spe- cific needs and goals. The user interfaces and applications selected to that purpose include: the ROHub portal, the main front end for domain-independent research object life- cycle management sitting on top of the RO API; a Virtual Research Environment for vertical communities of scien- tists, in disciplines like sea monitoring and volcanology; and domain-specific applications dealing with time series data in the ecology and biodiversity domain. 8.1. ROHub Portal The ROHub portal is the generic front-end for research object management that provides an advanced, life cycle management-oriented, tool exposing the full set of research object management capabilities to scientists. It is intended for users who are already familiar with research objects, or who would like to analyze and manage research objects in at a finer grain of detail. Hence, it provides great flexibility and access to all possible operations at a granular level. In contrast, Virtual Research Community (VRC) portals for example (see section 8.2), provide scientists with access to composite custom-built operations at a higher level of abstraction. So, while in ROHub portal, the user may need to perform multiple individual operations to build a research object (create, annotate, add resources, etc.), the VRC portals encapsulate all these operations in a single, custom-built process. The portal integrates and provides access to different re- search object services, including the core services provided by ROHub back-end for their creation, storage, access and maintenance, the management of their lifecycle, and their preservation, as well as added-value services like notifica- tion, transformation of workflows into research objects, quality and stability assessment, metadata enrichment, rat- ing and exploratory search. 8.2. Community-Oriented Virtual Research Portals Earth Science needs to address a variety of challenges. Among them, climate change is probably the most known topic because of its direct link to the increase of the aver- age global temperature, but many others exist, including marine litter, air pollution, flooding and volcanic erup- tions. This implies an increasing demand of data and information management capabilities to provide evidence, understand causes and monitor effects. The EVER-EST36 virtual research environment (VRE) provides the differ- ent communities of earth scientists with virtual research community (VRC) portals offering custom services and 36http://vre.ever-est.eu Figure 6: ROHub Portal tools targeted to ease work in community specific tasks. To support collaborative research across institutional and discipline boundaries, the VRE and VRC online portals use the innovative concept of research objects to draw to- gether research data, models, analysis tools and workflows as well as to manage and preserve the full research cycle. These interfaces abstract the research object vocabulary and details from the user, providing custom-built access to the core research object management capabilities in a simple and transparent manner. Currently there are four VRC portals - Land Monitoring37, Natural Hazards38, Sea Monitoring39 and GeoHazards Supersites40 - which can be accessed from the VRE, each pre-configured with the associated domain-specific data and services. The VRC portals design reflects the User Interface (UI) and User eXperience (UX) needs shared among the Earth science communities: the 3D virtual globe, the most natu- ral playground for an Earth Scientist to perform his/her activity, plays the central role and provides interactive tools to manage the full research cycle and enable direct interac- tion and visualization with research data. The toolbar on the right hand side (see figure 7) is the research pad that collects and enables features related to research objects and other tools that are commonly used by Earth scientists: • Research object services: include basic research 37http://vre.ever-est.eu/landmonitoring/ 38http://vre.ever-est.eu/naturalhazards/ 39http://vre.ever-est.eu/naturalhazards/ 40http://vre.ever-est.eu/supersites/ 13 sensors in NEON towers provide multiple types of data, e.g., wind speed, humidity, etc., at different time resolutions. Users can plot and download time series data by selecting the station, sensor type, and time range. Figure 8: Web application to view UNAVCO and NEON time series. Time series from UNAVCO and NEON are accessible from REST services. Since UNAVCO and NEON provide data in different formats, a workflow was developed in the Kepler Scientific Workflow System [37] to perform the REST queries and convert the results into GeoCSV [38]. A Kepler workflow consists of executable components, called "actors", linked together based on data dependencies to form an overall application. The workflow for this application includes the actor to perform REST queries, and the R actor to convert data into GeoCSV. After selecting time series from one or more sensors, a research object may be created to encapsulate the data and process used to create it. The research object includes a GeoCSV file containing the time series along with the instance of the Kepler workflow, which contains the param- eters used to create the GeoCSV such as sensor location and time range. This workflow may be re-executed to pro- duce the same time series data. The research object may either downloaded or shared on ROHub. 9. Community Adoption We are still in early stages of the process to build a FAIR community of earth scientists that leverage research objects for the management, sharing and publication of their research and/or operational work on a normal basis. Nonetheless, the infrastructure is solid and we count with a considerable international community of early adopters, fundamentally distributed over Europe and the USA but also with some participation from Australia. The different user interfaces built on top of the ROHub infrastructure presented in Section 8 have encouraged com- munity members to move their work practices to those inspired by research objects and the FAIR principles. As a matter of fact, our early adopters are already producing and exploiting high quality research objects in both manual Figure 7: Sea Monitoring VRC Portal object functionalities (e.g. create, edit, annotate, etc), research object lifecycle management, metadata man- agement or resource management. • Data discovery: provides a search box to define search criteria both for Earth Observation datasets (e.g. Sentinel data, Datacube, Co.CO.NET., etc) and Research Objects based on OGC Open Search stan- dard interface. • Cloud services: enable access to the private storage area (i.e. Seafile) and to three macro categories of processing services, namely -- Workflow services, to discover and execute scien- tific workflows by a generic workflow manager (e.g. Taverna server) -- Virtual Machines, to provide access to existing cloud resources, i.e. virtual machines, while enabling VRC administrators to manage them. -- Web Processing Services (WPS), to facilitate the integration and execution of existing geospatial processes available as web services. 8.3. Time Series Data Analysis in Ecology and Biodiversity Nowadays measuring the causes and effects of environ- mental change and how ecosystems are affected is a main concern for society and researchers. Scientists working on this problem often need to deal with data from different providers each of one serving the data they are special- ized on. Scientists need to compare slices of time series data of different sensors and systems, keeping track of the provenance information that enable others to reproduce the experiments and reuse the results. To support scientist interested in ecological processes we have developed and interactive web-based prototype application 41 (see Figure 8) that integrates time series from UNAVCO42 and National Ecological Observatory Network (NEON)43 sensors, and produces workflow-centric research objects. The UNAVCO stations record GPS positions while 41https://firemap.sdsc.edu/savi/map.html 42https://www.unavco.org/ 43https://www.neonscience.org/ 14 and automatic ways. As described in previous sections, research objects are indeed enabling these communities to adopt the FAIR principles in their scientific work: they are modeled based on interoperable ontologies, described with rich and expressive metadata, citable in scholarly com- munications, visible and discoverable from the Web and via recommendation systems, and ultimately, reusable (see Table 2). Yet, to better understand the use of the infrastructure by our community of scientists, to obtain a deeper insight and to facilitate the sustainability and continued growth of the community, we have implemented a number of mechanisms to monitor and measure performance. In this section, we provide an account of current progress stemming from quantitative data and related indicators. 9.1. Featured Research Objects Our early adopters increasingly use research objects and the associated infrastructure as part of their daily activities. After gaining a good understanding of the research object paradigm and the supporting technologies, key members of the community created a set of representative research objects for their area. We refer to the resulting research objects as Golden Exemplar Research Objects (GERO)44. These are particularly curated and representative research objects that allow demonstrating the feasibility and utility of research objects to manage and share data, models and results of the daily work in Earth Science. Next, we select some of these golden exemplars from two of these communities, to further illustrate this approach: Sea Monitoring • Detection of trends in the evolution of invasive jellyfish distribution, a workflow-centric research object that produces explicit geographical informa- tion concerning the evolution and distribution of alien species based on Jellyfish sightings. • Digitalization of historical Venice lagoon maps, a data-centric research object with information on natural environmental and anthropogenic changes. • Deep Sea Habitat Suitability Model, a workflow- centric research object to derive the Marine Strategy Framework Directive MSFD indicator 1.5 to assess the biodiversity descriptor. Geoscience Research • IPWV on Iceland, a workflow-centric research ob- ject that automatizes the generation of a map of the precipitable water content on Iceland by using MODIS satellite data. • March 2018 reports at Mt Etna, a bibliographic research object containing all reports from March 2018 describing the weekly volcanic activity of Mt Etna from the multi-parametric monitoring stations. • Volcano Source Modeling (VSM), a workflow- centric research object containing the VSM methods and related resources used to obtain results of the geodetic inversion of the 2011-2013 InSAR data at Campi Flegrei (Italy) due to the action of a deep magmatic source. • UNAVCO GPS Position Timeseries, a workflow- centric research object encapsulating a kepler workflow that calls a GPS position timeseries webservice pro- vided by UNAVCO, processes the stream of data, and plots the north, east, and vertical offsets relative to a reference position. In addition to these manually crafted, high-quality re- search objects, we also generated through an automatic process over 500 bibliographic research objects45 (AGROs - Automatically Generated Research Objects) exposing gray literature periodically released by these institutions, and bibliographic references of interest for the community. 9.2. Key Performance Indicators We have defined a set of key performance indicators (KPIs), consisting of measurable values, that allow us to: i) assess the success regarding the community adoption of research objects and related technologies; ii) estimate the extent to which this work is contributing to improve the currently limited compliance with the FAIR principles in Earth Science communities; and iii) to identify and analyze usage trends. For each of these KPIs, we defined a target for the six-month period Apr-Sep 2018. The targets were defined with the feedback of key community members regarding their experiences and expectations about research objects and their daily work. Thus, starting from April 2018, KPIs are measured monthly and compared against the targets to assess the progress and to draw conclusions. The KPIs are measurable via the ROHub platform, which integrates multiple added-value services and serves different client applications (see Section 8). Table (5) presents the KPIs, with the target values for the six-month period Apr- Sep 2018, and the last measured values (May 2018). As we can observe from the table, we have already reached a few targets, including number of GEROs, num- ber of AGROs and percentage of research object views. Reaching the targets in the number of golden and auto- matically generated research objects is a good indicator related to community adoption, even though the overall number (GEROs+AGROs+others) is still slightly below the target. More importantly, having already such signifi- cant number of research objects is an improvement in the FAIR level of these communities. Concretely, now over 3500 data and other research artifacts are FAIR enabled via almost 750 research objects (see discussion in Section 4). In fact, reaching the target in the percentage of views can be considered as an evidence indicating that resources are findable and accessible (first two rows in Table 2). 44http://everest.expertsystemlab.com/#GoldenExemplars 45http://everest.expertsystemlab.com/#Generated 15 Table 5 also shows that some KPIs are still below the target. However, in most cases the values measured are not so far from the targets and a steady increase has been observed; thus, we are confident that the targets will be reached by the end of September 2018. For example, having still four months to go (i.e., 66 % of the period Apr-Sep 2018), the number of resources managed by Earth Science communities through research objects is already at 36 % of the target, while the average quality of research objects is only between 2 and 17% below the target. Note that quality-related measurements take into account conditions like whether or not the data and associated research are well described (with rich, machine- readable metadata) or that resources are accessible, all of them key factors in terms of compliance with the FAIR principles (first three rows in Table 2). The fact that quality measures are almost aligned with the target values is a good indicator, showing evidence of convergence towards FAIR among the communities. Nonetheless, indicators of reuse (research objects down- loads and forks) are still far from the target and we have increased our efforts in analyzing how to raise such values. For instance, a better understanding is needed about how to encourage earth scientists to increase sharing by reusing or repurposing existing results rather than by carrying out their research from scratch. Limited reuse values also indicates the need to provide earth scientists with means to simplify such tasks, lowering the technical entry barrier. Tooling support to enable proper credit to previous work, i.e. through persistent identifiers and enforcing automatic citation, is also key in this regard (last row in Table 2). Although such mechanisms are already available in RO- Hub (e.g. release of research objects with DOIs, research object fork and automatic citation to the source), our anal- ysis seems to indicate some lack of awareness about such functionalities among user scientists. Furthermore, we have recently implemented in ROHub mechanisms that on the one hand enable scientists to ex- press a subjective notion of quality about particular re- search objects and on the other hand keep account of the social impact of a research object among the user com- munities. Although the amount of data available to this purpose is still limited, we observe a trend indicating a correlation between research object reuse and their pop- ularity. Frequently reused research objects have better ratings and reviews, and are favorited more frequently. As part of our awareness work, such features are now making their way into the user communities. Follow up work in this direction includes mechanisms to highlight or rank scientists depending on the reputation they earned based on the impact (rates, likes, views), reuse (downloads, forks) and quality of their research objects. 9.3. Web analytics Another mechanism that was put in place to monitor and to get insights about the adoption of research objects and related technologies is the tracking and reporting of 16 Table 5: Key performance indicators: targets (September 2018) against measures (May 2018) Key Performance Indicator (KPI) Target GEROs Number of research objects AGROs implemented in Earth Science Overall Number of Earth Science resources Total managed by the communities GEROs Average quality of AGROs Earth Science research objects Released GEROs AGROs GEROs AGROs Total Impact of Earth Science research objects Downloads Forks Views GEROs AGROs Overall 8 500 1000 10000 Total GEROs 95% AGROs 90% Released 85% 100% GEROs AGROs 40% GEROs 80% AGROs 25% 25% Total Measured 16 512 748 3563 93% 73% 72% 100% 99% 44% 2% 1% ROHub web traffic using Google Analytics. We started tracking the ROHub Web site since March 1st 2018, and have already collected enough information to discover some patterns. For instance, figure 9 depicts the number of users visiting ROHub per day, where we can observe multiple peaks. After analyzing these peaks, we see that many of them coincide with the dates of dissemination or demon- stration events, which indicates interest from the target communities, e.g., GeoVol (latin american workshop on vol- canology) 7th-9th March, or EGU (European Geosciences Union) 9th-12th April. It is worth noting that since the beginning of the track history (83 days including weekends) only one day did ROHub not get any visit: Sunday 1st April (Easter). Figure 9: ROHub web traffic: users per day since March 2018 Regarding the number of users per country, the USA is in first position, with about 23% of the share (see Figure 10). Although we have engaged some Earth Science communities there, this was an interesting finding. The second country is Poland (where ROHub is developed), followed by Italy (where two other important Earth Science communities are located), Spain (where another Earth Science community and a key technical partner are located), and the UK (where another Earth Science community is located). Though possibly anecdotic, it is interesting to point out that the busiest time of day is usually around noon, being 14:00 the busiest hour (based on the number of sessions), followed by 12:00, 11:00 and 15:00. This indicates that the busiest hour is right after lunch in Europe (CET time) and early morning in the United States (Eastern time), References References [1] P. E. Bourne, T. W. Clark, R. Dale, A. de Waard, I. Her- man, E. H. Hovy, D. Shotton, Improving The Future of Re- search Communications and e-Scholarship (Dagstuhl Perspec- tives Workshop 11331), Dagstuhl Manifestos 1 (1) (2012) 41 -- 60. doi:10.4230/DagMan.1.1.41. URL http://drops.dagstuhl.de/opus/volltexte/2012/3445 [2] A. M. Smith, D. S. Katz, K. E. a. Niemeyer, Software citation principles, PeerJ Computer Science 2 (2016) e86. doi:10.7717/ peerj-cs.86. URL https://doi.org/10.7717/peerj-cs.86 [3] H. Kitano, Artificial intelligence to win the nobel prize and beyond: Creating the engine for scientific discovery, AI Magazine 37 (1) (2016) 39 -- 49. URL article/view/2642 http://www.aaai.org/ojs/index.php/aimagazine/ [4] M. Stocker, Advancing the software systems of environmental knowledge infrastructures, in: A. Chabbi, H. W. Loescher (Eds.), Terrestrial Ecosystem Research Infrastructures: Challenges and Opportunities, CRC Press, Boca Raton, FL, 2017, Ch. 15, pp. 399 -- 423. doi:10.1201/9781315368252-16. [5] S. Bechhofer, I. Buchan, D. D. Roure, P. Missier, J. Ainsworth, J. Bhagat, P. Couch, D. Cruickshank, M. Delderfield, I. Dunlop, M. Gamble, D. Michaelides, S. Owen, D. Newman, S. Sufi, C. Goble, Why linked data is not enough for scientists, Future Generation Computer Systems 29 (2) (2013) 599 -- 611, special section: Recent advances in e-Science. doi:10.1016/j.future. 2011.08.004. URL http://www.sciencedirect.com/science/article/pii/ S0167739X11001439 [6] K. Belhajjame, O. Corcho, D. Garijo, J. Zhao, P. Missier, D. New- man, R. Palma, S. Bechhofer, E. Garcia-Cuesta, J. Gomez-Perez, G. Klyne, K. Page, M. Roos, J. Ruiz, S. Soiland-Reyes, L. Verdes- Montenegro, D. D. Roure, C. Goble, Workflow-centric research objects: A first class citizen in the scholarly discourse, in: 2nd Workshop on Semantic Publishing (SePublica), no. 903 in CEUR Workshop Proceedings, Aachen, 2012, pp. 1 -- 12. URL http://ceur-ws.org/Vol-903/paper-01.pdf [7] J. Zhao, J. Gomez-Perez, K. Belhajjame, G. Klyne, E. García- Cuesta, A. Garrido, K. Hettne, M. Roos, D. D. Roure, C. Goble, Why workflows break - understanding and combating decay in taverna workflows., in: 8th IEEE International Conference on E-Science, IEEE Computer Society, 2012, pp. 1 -- 9. doi: 10.1109/eScience.2012.6404482. URL https://doi.org/10.1109/eScience.2012.6404482 [8] S. Crouch, N. C. Hong, S. Hettrick, M. Jackson, A. Pawlik, S. Sufi, L. Carr, D. De Roure, C. Goble, M. Parsons, The software sustainability institute: Changing research software attitudes and practices, Computing in Science and Engg. 15 (6) (2013) 74 -- 80. doi:10.1109/MCSE.2013.133. URL https://doi.org/10.1109/MCSE.2013.133 [9] S. Hettrick, M. Antonioletti, L. Carr, N. Chue Hong, S. Crouch, D. De Roure, I. Emsley, C. Goble, A. Hay, D. Inupakutika, M. Jackson, A. Nenadic, T. Parkinson, M. I. Parsons, A. Pawlik, G. Peru, A. Proeme, J. Robinson, S. Sufi, Uk research software survey 2014 (Dec. 2014). doi:10.5281/zenodo.14809. URL https://doi.org/10.5281/zenodo.14809 [10] A.-L. Barabási, Network theory -- the creative enterprise, Science 308 (5722) doi:10.1126/science.1112554. URL 639 http://science.sciencemag.org/content/308/5722/ emergence of the (2005) 639 -- 641. [11] M. Wilkinson, et al, The fair guiding principles for scientific data management and stewardship, Nature Scientific Data (160018). URL http://www.nature.com/articles/sdata201618 [12] A. Dunning, M. de Smaele, J. Böhmer, Are the fair data princi- ples fair?, International Journal of digital curation 12 (2) (2018) 177 -- 194. doi:10.2218/ijdc.v12i2.567. URL https://doi.org/10.2218/ijdc.v12i2.567 Figure 10: ROHub web traffic: users per country since March 2018 which seems to indicate that scientists actually access the platform as part of their daily routine. Regarding the busiest day of the week, we found no significant difference between working days, also indicating usage of the platform as part of the daily work activities. 10. Conclusions In this paper we described the journey we went through to build a FAIR research environment for Earth Science around research objects. Transforming a data-intensive scientific community like this to use FAIR principles is a continuous and multidisciplinary effort that must be supported by methods, models and tools, while engaging early adopters from these communities to produce a critical mass of FAIR content that encourage their peers to adopt this new paradigm of work, leading to the establishment of a virtuous circle of FAIR data sharing and reuse. Our work aimed at building upon the research object model a set of tools that ease the generation of research objects while increasing their likelihood to be reused by other researchers. Therefore our focus was on vocabulary extensions, automatic generation of metadata and qual- ity assessment, search engines and recommender systems, digital object identifiers, and tailored user interfaces that incorporate earth science datasets, time-series data manage- ment and geolocalization. The key performance indicators to monitor the health of the research community of earth scientist working with research objects are in place. The challenge for the future is to enlarge the user community and leverage the experience gained with earth scientists to encourage other research communities to make the transi- tion to a FAIR data interchange. Acknowledgements We gratefully acknowledge EU Horizon 2020 for research infrastructures under grant EVER-EST-674907. 17 [13] R. Palma, P. Hołubowicz, O. Corcho, J. Gomez-Perez, C. Mazurek, Rohub -- a digital library of research objects sup- porting scientists towards reproducible science, in: Semantic Web Evaluation Challenge, Springer, 2014, pp. 77 -- 82. [14] C. Goble, D. De Roure, myexperiment: Social networking for workflow-using e-scientists, in: Proc. of the 2nd Workshop on Workflows in Support of Large-scale Science, WORKS '07, ACM, New York, NY, USA, 2007, pp. 1 -- 2. doi:10.1145/1273360. 1273361. URL http://doi.acm.org/10.1145/1273360.1273361 [15] W3C, Rdf 1.1 primer: W3c working group note 24 june 2014, [Online; accessed 25-May-2017] (2014). URL https://www.w3.org/TR/rdf11-primer/ [16] D. McGuinness, F. van Harmelen, Owl web ontology language overview: W3c recommendation 10 february 2004, [Online; ac- cessed 25-May-2017] (2004). URL http://www.w3.org/TR/owl-features/ [17] G. Robles, J. M. González-Barahona, A comprehensive study of software forks: Dates, reasons and outcomes, in: I. Hammouda, B. Lundell, T. Mikkonen, W. Scacchi (Eds.), Open Source Sys- tems: Long-Term Sustainability, Springer Berlin Heidelberg, Berlin, Heidelberg, 2012, pp. 1 -- 14. [18] K. Belhajjame, J. Zhao, D. Garijo, M. Gamble, K. Hettne, R. Palma, E. Mina, O. Corcho, J. Gomez-Perez, S. Bechhofer, G. Klyne, C. Goble, Using a suite of ontologies for preserving workflow-centric research objects, Web Semantics: Science, Ser- vices and Agents on the World Wide Web 32 (2015) 16 -- 42. doi:10.1016/j.websem.2015.01.003. URL http://www.sciencedirect.com/science/article/pii/ S1570826815000049 [19] J. Gomez-Perez, P. Alexopoulos, N. Garcia, R. Palma, D4.1 workflows and research objects in earth science -- concepts and definitions, Tech. rep., European Virtual Environment for Research -- Earth Science Themes (EVER-EST) (2016). [20] J. Gomez-Perez, R. Palma, N. Garcia, D4.2 workflows and re- search objects models in earth science, Tech. rep., European Vir- tual Environment for Research -- Earth Science Themes (EVER- EST) (2016). [21] P. Groth, A. Gibson, J. Velterop, The anatomy of a nanopubli- cation, Information Services & Use 30 (1-2) (2010) 51 -- 56. [22] V. Uren, P. Cimiano, J. Iria, S. Handschuh, M. Vargas-Vera, E. Motta, F. Ciravegna, Semantic annotation for knowledge management: Requirements and a survey of the state of the art, Web Semantics: Science, Services and Agents on the WWW 4 (1) (2006) 14 -- 28. doi:10.1016/j.websem.2005.10.002. URL http://www.sciencedirect.com/science/article/pii/ S1570826805000338 [23] L. Reeve, H. Han, Survey of semantic annotation platforms, in: Proc. of the 2005 ACM Symposium on Applied Computing, SAC '05, ACM, New York, NY, USA, 2005, pp. 1634 -- 1638. doi:10.1145/1066677.1067049. URL http://doi.acm.org/10.1145/1066677.1067049 [24] P. Mendes, M. Jakob, A. Garcia-Silva, C. Bizer, Dbpedia spot- light: Shedding light on the web of documents, in: Proc. of the 7th Intl. Conference on Semantic Systems, I-Semantics '11, ACM, New York, NY, USA, 2011, pp. 1 -- 8. doi:10.1145/2063518. 2063519. URL http://doi.acm.org/10.1145/2063518.2063519 [25] H. Cunningham, D. Maynard, K. Bontcheva, V. Tablan, N. Aswani, I. Roberts, G. Gorrell, A. Funk, A. Roberts, D. Daml- janovic, T. Heitz, M. Greenwood, H. Saggion, J. Petrak, Y. Li, W. Peters, Text Processing with GATE (Version 6), 2011. URL http://tinyurl.com/gatebook [26] J. M. Gomez-Perez, R. Palma, A. Garcia-Silva, Towards a human- machine scientific partnership based on semantically rich research objects, in: IEEE 13th International Conference on e-Science (e- Science), 2017, pp. 266 -- 275. doi:10.1109/eScience.2017.40. [27] B. M. Hales, P. J. Pronovost, The checklist -- a tool for error management and performance improvement, Journal of critical care 21 (3) (2006) 231 -- 235. [28] J. M. Gómez-Pérez, E. García-Cuesta, A. Garrido, J. E. Ruiz, J. Zhao, G. Klyne, When history matters-assessing reliability for the reuse of scientific workflows, in: International Semantic Web Conference, Springer, 2013, pp. 81 -- 97. [29] A. Garcia-Silva, J. Gomez-Perez, R. Palma, D4.3 design, imple- mentation and deployment of research objects components for earth science phase 1, Tech. rep., European Virtual Environment for Research -- Earth Science Themes (EVER-EST) (2016). [30] P. Resnick, H. Varian, Recommender systems, Communications of the ACM 40 (3) (1997) 56 -- 58. [31] P. Lops, M. De Gemmis, G. Semeraro, Content-based recom- mender systems: State of the art and trends, in: Recommender systems handbook, Springer, 2011, pp. 73 -- 105. [32] M. Rico, J. M. Gómez-Pérez, R. Gonzalez, A. Garrido, Ó. Corcho, Collaboration spheres: a visual metaphor to share and reuse research objects, CoRR abs/1710.05604. arXiv:1710.05604. URL http://arxiv.org/abs/1710.05604 [33] G. Salton, A. Wong, C. Yang, A vector space model for automatic indexing, Commun. ACM 18 (11) (1975) 613 -- 620. doi:10.1145/ 361219.361220. URL http://doi.acm.org/10.1145/361219.361220 [34] G. Salton, C. Buckley, Term-weighting approaches in automatic text retrieval, Information Processing & Management 24 (5) (1988) 513 -- 523. doi:10.1016/0306-4573(88)90021-0. URL http://www.sciencedirect.com/science/article/pii/ 0306457388900210 [35] C. Manning, P. Raghavan, H. Schütze, et al., Introduction to information retrieval, Vol. 1, Cambridge university press Cambridge, 2008. [36] Z. Wu, M. Palmer, Verbs semantics and lexical selection, in: Proc. of the 32nd annual meeting on Association for Computational Linguistics, Association for Computational Linguistics, 1994, pp. 133 -- 138. [37] I. Altintas, C. Berkley, E. Jaeger, M. Jones, B. Ludascher, S. Mock, Kepler: an extensible system for design and execution of scientific workflows, in: Proceedings of 16th International Conference on Scientific and Statistical Database Management, IEEE, 2004, pp. 423 -- 424. [38] GeoWS Project, GeoCSV -- Tabular text formatting for geo- science data (2015). URL http://geows.ds.iris.edu/documents/GeoCSV.pdf 18
1810.06351
1
1810
2018-10-15T13:52:35
(Self-Attentive) Autoencoder-based Universal Language Representation for Machine Translation
[ "cs.CL" ]
Universal language representation is the holy grail in machine translation (MT). Thanks to the new neural MT approach, it seems that there are good perspectives towards this goal. In this paper, we propose a new architecture based on combining variational autoencoders with encoder-decoders and introducing an interlingual loss as an additional training objective. By adding and forcing this interlingual loss, we are able to train multiple encoders and decoders for each language, sharing a common universal representation. Since the final objective of this universal representation is producing close results for similar input sentences (in any language), we propose to evaluate it by encoding the same sentence in two different languages, decoding both latent representations into the same language and comparing both outputs. Preliminary results on the WMT 2017 Turkish/English task shows that the proposed architecture is capable of learning a universal language representation and simultaneously training both translation directions with state-of-the-art results.
cs.CL
cs
(Self-Attentive) Autoencoder-based Universal Language Representation for Machine Translation Carlos Escolano, Marta R. Costa-juss`a and Jos´e A. R. Fonollosa TALP Research Center, Universitat Polit`ecnica de Catalunya, Barcelona {carlos.escolano,marta.ruiz,jose.fonollosa}@upc.edu 8 1 0 2 t c O 5 1 ] L C . s c [ 1 v 1 5 3 6 0 . 0 1 8 1 : v i X r a Abstract Universal language representation is the holy grail in machine translation (MT). Thanks to the new neural MT approach, it seems that there are good perspectives towards this goal. In this paper, we propose a new architecture based on combining variational autoencoders with encoder-decoders, and introducing an in- terlingual loss as an additional training objec- tive. By adding and forcing this interlingual loss, we are able to train multiple encoders and decoders for each language, sharing a common universal representation. Since the final ob- jective of this universal representation is pro- ducing close results for similar input sentences (in any language), we propose to evaluate it by encoding the same sentence in two differ- ent languages, decoding both latent represen- tations into the same language and comparing both outputs. Preliminary results on the WMT 2017 Turkish/English task shows that the pro- posed architecture is capable of learning a uni- versal language representation and simultane- ously training both translation directions with state-of-the-art results. Introduction 1 Neural Machine Translation (NMT) (Cho et al., 2014) has arisen as a completely new paradigm for MT outperforming previous statistical approaches (Koehn et al., 2003) in most of the tasks. One clear exception are low-resourced tasks (Koehn and Knowles, 2017), where SMT still can outper- form NMT. Among others, one clear advantage of NMT is that it opens news challenges in MT like multi- modal MT (Elliott et al., 2017) or unsupervised MT (Artetxe et al., 2017).NMT is progressing fast and it has high expectations, among which there is the finding of a universal language that allows to train single encoders and decoders for each lan- guage reducing the number of translation systems from a quadratic dependency on languages to lin- ear. As we will show in section 2, there are differ- ent approaches that have used the idea of universal language in NMT. However, recent research in this topic has been mainly on evaluating if the NMT ar- chitecture of encoder-decoder with recurrent neu- ral networks (RNNs), with or without attention mechanisms, is able to reach a universal language while training multiple languages (Johnson et al., 2016; Schwenk and Douze, 2017). In other words, these approaches have not explicitly designed an architecture with the objective of reaching a uni- versal language representation. Differently, in this paper, we specifically pur- sue towards training a universal language by proposing an architecture combining variational autoencoders and encoder-decoders based on self- attention mechanisms (Vaswani et al., 2017). Also, in the optimisation process, we are adding a loss term, which is the correlation between inter- mediate representations from different languages. Like this, we are forcing the system to learn the universal language while training multiple transla- tion systems. Results on the WMT 20171 Turkish- English show that our architecture can success- fully train the universal language while achieving state-of-the-art translation quality for all transla- tion directions. 2 Related Work Classical interlingua approaches (AlAnsary, 2011) aim at finding a universal language that involves a conceptual understanding of all languages over the world. This has been the case of Esperanto (Har- low, 2013) or Universal Networking Language (Kumar and Goel, 2016) and many others. Very differently, in this work, we are focusing on train- ing a universal language representation with deep 1http://www.statmt.org/wmt17/ learning techniques. The objective is to train an in- termediate representation that allows to use inde- pendent encoders and decoders for each language. Differently, from the classical approach, there is no requirement of semantics for this intermediate representation. Following a similar objective or methodology, most related works are the follow- ing ones. Shared Encoders/Decoders. Johnson et al. (2016) feed a single encoder and decoder with multiple input and output languages. With this approach, authors show that zero-shot learning is possible. Authors show by means of visualizing similar sentences in different languages that there is some hint that these appear somehow close in the common representation. Encoder/Decoder. These Dedicated ap- proaches vary from many encoders to one decoder (many-to-one) (Zoph and Knight, 2016), one encoder to many decoders (one-to-many) (Dong et al., 2015) and, finally, one encoder to one decoder (one-to-one), which we are focusing on because they are closest to our approach. Firat et al. 2016 propose to extend the classical recurrent NMT bilingual architecture (Bahdanau et al., 2015) to multilingual by designing a single encoder and decoder for each language with a Schwenk shared attention-based mechanism. et al. (2017) evaluate how a recurrent NMT architecture without attention is able to generate a common representation between languages. Authors use the inner product or cosine distance to evaluate the distance between sentence representations. Recently, Lu et al., (2018) train single encoders and decoders for each language generating in- terlingual embeddings which are agnostic to the input and output languages. (2017) and Espana-Bonet et al. Other related architectures. While unsuper- vised MT (Lample et al., 2017; Artetxe et al., 2017) is not directly pursuing a universal language representation, but it is somehow related with our approach. Artetxe et al. (2017) and Lample et al. (2017) propose a translation system that is able to translate trained only on monolingual corpus. The architecture is basically a shared encoder with pre-trained embeddings and two decoders (one of them includes an autoencoder). On the other hand, our work is also related to recent works on sen- tence representations (Conneau et al., 2017, 2018; Eriguchi et al., 2018). However, the main differ- ence is that these works aim at extending represen- tations to other natural language processing tasks, while we are aiming at finding the most suitable representation to make interlingual machine trans- lation feasible. It is left for further work the evalu- ation and adaptation of this intermediate represen- tation to multiple tasks. 3 Contribution While approaches mentioned in previous section consider the idea of a universal language repre- sentation with NMT, they do not really add it in the core training of their architectures. In our architec- ture, we are adding, as part of the loss function, the correlation between the universal representations. Additionally, we are for the first time proposing a universal language representation within an archi- tecture including self attention mechanisms. Another contribution is that we are proposing novel measures to evaluate the universal language: first, in training time, when using the correlation to compare two universal representations, and sec- ond, in inference, when using BLEU to compare decoding outputs of two universal representations of the same input sentences coming from two dif- ferent languages. 4 Background In this section, we report three techniques that are used for the development of the proposed ar- chitecture in this paper: variational autoencoders (Rumelhart et al., 1985), decomposed vector quan- tization (van den Oord et al., 2017) and correlated nets (Chandar, 2015). 4.1 Variational Autoencoders Autoencoders consist in a generative model that is able to generate its own input. This is use- ful to train an intermediate representation, which can be later employed as feature for another task or even as a dimensionality reduction technique. This is the case of traditional autoencoders that learn to produce an intermediate representation for an existing example. Variational autoencoders (Rumelhart et al., 1985; Kingma and Welling, 2013; Zhang et al., 2016) present a different ap- proach in which the objective is to learn the pa- rameters of a probability distribution that charac- terizes the intermediate representation. This al- lows to sample new synthetic instances from the distribution and generate them using the decoder part of the network. 4.2 Decomposed Vector Quantization One of the strategies to create variational autoen- coders is vector quantization (van den Oord et al., 2017). This consists in the addition of a table of dimension K · D where K is the number of pos- sible representations and D the dimension or set of dimensions of each of the representations. The closest vector to the output of the encoder of the network is fed to the decoder as a discrete latent representation to generate the output of the net- work. As proposed in (Kaiser et al., 2018) this ap- proach may produce a vector quantization in which only a small part of the vectors is em- ployed. To solve this, decomposed vector quan- tization uses a set of n tables in which each table is used to represent a portion of the representation that would be later concatenated and fed to the de- coder. This approach presents the advantage that by using n K · D n tables and optimizing the same number of parameters, Kn possible vectors of di- mension D can be generated. 4.3 Correlated Nets Chandar et al. (2015) focus on the objective of common representation learning. This work is inspired by the classical Canonical Correlation Analysis (Hotelling, 1936) and it proposes to use an autoencoder that uses the correlation informa- tion to learn the intermediate representation. In this paper, we use this correlation information to measure the distance among intermediate repre- sentations following the expression: (cid:80)n (cid:112)(cid:80)n (h(xi) − h(X))2(cid:80)n i=1 i (h(xi − h(X)))(h(yi − h(Y ))) (h(yi) − h(Y ))2 i (1) c(h(X), h(Y )) = Where X and Y are the data sources we are try- ing to represent, h(xi) and h(yi) are the interme- diate representations learned by the network for a given observation and h(X) and h(Y ) are the mean intermediate representation for X and Y , re- spectively. 5 Proposed Model Architecture Given a parallel corpus our objective is train- ing an encoder and decoder for each of the lan- guages that are compatibles with the other compo- nents through a common intermediate representa- tion generated by both encoders and understood by both decoders. For this, we propose a novel archi- tecture and within it, we experiment with different distance measures and both discrete and continu- ous intermediate representations. The architecture consists in an autoencoder for each of the languages to translate. Each network consists in a transformer network (Vaswani et al., 2017). The advantage of using this model instead of other alternatives such as recurrent or convo- lutional encoders is that this model is based only on self attention and traditional attention over the whole representation created by the encoder. This allows us to easily employ the different compo- nents of the networks (encoder and decoder) as modules that during inference it can be used with other parts of the network without the need of pre- vious step information as seen in Figure 1. In order to achieve the desired universal lan- guage that can be used by all the modules of the system, all the components have to be optimized simultaneously. This is a difference to traditional NMT systems in which translation is only con- sidered between the source and target language. In the proposed architecture, all languages are equally considered and both directions are gener- ated during the training process. To achieve it, we design the following loss function: Loss = LXX + LY Y + LXY + LY X + d(h(X), h(Y )) (2) Where LXX (LY Y ) is the reconstruction loss of the autoencoder X (Y ) and LXY (LY X) is the cross-entropy between the generated results from the encoder-decoder from language X (Y ) to lan- guage Y (X) and the target reference in language Y (X). The final term of the loss is the measure of the distance between the two intermediate representa- tions h(X) and h(Y ) of both autoencoders. For this distance, we propose: 1. Correlation distance which measures how correlated are the intermediate representa- tions of the autoencoders for each batch of the training process: d(h(X), h(Y )) = 1 − c(h(X), h(Y )) (3) 2. Maximum distance which measures the closeness of the intermediate representations as the maximum of the difference of the rep- resentation of a source and its target sentence: d(h(X), h(Y )) = max(h(X) − h(Y )) (4) Figure 1: Architecture example. Every module is com- patible with the intermediate representation. For scaling to more languages, we will add lan- guage Z training LXZ and LZX (over a pretrained system). This implies that we do not require a mul- tilingual parallel corpus on languages X, Y, Z but only parallel corpus on languages XY and XZ, for example. 6 Evaluation of the Universal Language Representation Our main objective is creating an internal rep- resentation that can be understood by all the different modules trained in the system, where the modules are the encoders and decoders of all the languages involved in training. Similar representations may not lead to compatible en- coder/decoders. Also different trainings can pro- duce representations with different mean distances in the representations that can generate similar translation outputs. In order to overcome those difficulties, we pro- pose a new measure for the task. Given a parallel set of sentences in the languages in which the sys- tem has been trained, we can generate the encond- ings EX and EY . Both encodings, coming from parallel test, have the same number of vectors each of them of the same dimensionality. Our proposed measure consists in infering one of the decoders in the system (X and Y ) using EX and EY as input. This generates two different out- puts: an autoencoding output and a machine trans- lation output. As we have parallel references for both languages we can measure the BLEU of each of the results against the reference to measure how the models perform. Additionally we can calculate a new BLEU score comparing the outputs of the autoencoding and the machine translation outputs. In the ideal case, encoders from two different languages have to produce the same representation for the same sentences. Therefore, the difference between the BLEU score obtained in the autoencoding out- put and the translation output shows how differ- ent are EX and EY representations in terms of how the decoder is able to generate accurate re- sults from them. Our measure consists in evaluat- ing the BLEU score using the autoencoding output as reference and the machine translation output as hypothesis. Figure 2 shows the full pipeline of this procedure. Figure 2: Pipeline of the Interlingua BLEU measure. 7 Experimental framework For experiments, we use the Turkish-Engish par- allel data from setimes2 (Tiedemann, 2009) which is used in WMT 2017 2. The preprocess proce- dure consisted in limiting sentence length to 50 words, tokenization, truecasing using Moses tools (Koehn et al., 2007) and segmentation of Byte Pair Encoding (BPE) (Sennrich et al., 2016). As de- velopment and test set we used newsdev2016 and newstest2016, respectively. All experiments were executed using the trans- former model (Vaswani et al., 2017) with default parameters, 6 blocks of multihead attention of 8 heads each, 12,000 words vocabulary, latent rep- resentation size of 128 and fixed learning rate of 0.0001 using Adam (Kingma and Ba, 2014) as op- timizer. 8 Results 8.1 Translation quality Table 1 shows the BLEU results in each transla- tion direction from English-to-Turkish (EN-TR) and from Turkish-to-English (TR-EN). Results of 2http://www.statmt.org/wmt17/ Table 2: Comparison of BLEU scores on the univ+corr architecture when performing as autoencoder and MT. The third column is the BLEU between autoencoder and translation outputs A-T 11.90 6.02 Decoder Autoencoder MT 12.00 EN TR 8.11 63.32 59.33 translation outputs (A-T), which is the measure that we are proposing to evaluate the quality of our universal language. Low BLEUs in A-T indicates that we are still far from being able to decode from the universal language. 9 Visualization In this section, we can visualize the relation be- tween the universal language representations. Using the tool proposed at (Ajenjo, 2018) we employ UMAP (McInnes and Healy, 2018). This technique computes a non linear dimensionality reduction of the data in order to be able to visu- alize the sentence representation space. Ideally if both encoders produce the same rep- resentation the visualization would show that both languages are no separable and that both dots for the same sentence would appear nearly in the same point in the plot. Figure 3 shows that languages appear to be located in different clusters. This dif- ference in the representation can also explain the results in the previous section. different configurations of the proposed architec- ture (Univ) are compared to the baseline trans- formers (both non variational and variational, dvq) with the same hyperparameters of our architecture. Variational vs non-variational autoencoder. The performance of the baseline transformer (non- variational) is almost competitive with the best system results from WMT 2017 (Garc´ıa-Mart´ınez et al., 2017). Note that we are comparing to the case of using only parallel data, without adding backtranslated monolingual data (which were 10.9 for EN-TR and 14.2 for TR-EN). When contrast- ing our proposed architectures, we see that the performance of non-variational autoencoders is higher than the variational autoencoder, with a dif- ference of more than 1 BLEU point in both direc- tions. Correlation vs Maximum distance loss. In re- gard to the distance loss, the correlation distance clearly provides better translation results by ap- proximately 1.5 BLEU in both directions. Using correlation distance in fact shows similar perfor- mance compared to the one direction transformer baseline transformer. Table 1: BLEU results for the different system alterna- tives, Transformer and different configurations of our architecture, Universal (Univ) with and without de- composed vector quatization (dvq), and correlation dis- tance(corr) and maximum of difference(max) EN-TR TR-EN 8.32 2.89 8.11 6.19 7.45 2.40 Transformer Transformer dvq Univ + corr Univ + max Univ + dvq + corr Univ + dvq + max 12.03 8.14 12.00 10.38 7.56 5.24 8.2 Universal language representation quality We have also studied the difference in perfor- mance of decoders when presented with the uni- versal representations of both encoders. This evaluation is performed in order to analyse if we can use an architecture of independent en- coder/decoders in the context of MT. The model used for these results is the univ+corr, which is the best performing model from Table 1. Table 2 shows that the quality of the output of the decoder is quite better when the input comes from the encoder of the same language (autoen- coder) than from another (MT). We also included the BLEU score between both autoencoder and Figure 3: Visualization of the sentence representa- tion space using UMAP. Turkish in yellow, English in green. Focusing on the representation of individual sentences in the space it can be observed that the distance between parallel sentences is not constant as shown in Figure 4. 10 Conclusions We propose a novel translation architecture which includes a common intermediate representation as Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Neural machine translation by CoRR, Bengio. 2015. jointly learning to align and translate. abs/1409.0473. Sarath Chandar. 2015. Correlational neural networks for common representation learning. Master's the- sis, Indian Institute of Technology Madras. Kyunghyun Cho, Bart van Merrienboer, C¸ aglar Gulc¸ehre, Dzmitry Bahdanau, Fethi Bougares, Hol- ger Schwenk, and Yoshua Bengio. 2014. Learning phrase representations using RNN encoder-decoder In Proc. of the for statistical machine translation. Conference on EMNLP, pages 1724 -- 1734. 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. Alexis Conneau, Guillaume Lample, Adina Williams Ruty Rinott, Samuel R. Bowman, Holger Schwenk, and Veselin Stoyanov. 2018. Xnli: Evaluating In Proc. of cross-lingual sentence representations. EMNLP. Daxiang Dong, Hua Wu, Wei He, Dianhai Yu, and Haifeng Wang. 2015. Multi-task learning for mul- tiple language translation. In Proc. of the ACL and the IJCNLP, pages 1723 -- 1732, Beijing, China. Desmond Elliott, Stella Frank, Loıc Barrault, Fethi Bougares, and Lucia Specia. 2017. Findings of the second shared task on multimodal machine transla- tion and multilingual image description. In Proc. of the 2nd Conference on Machine Translation, pages 215 -- 233, Copenhagen, Denmark. Akiko Eriguchi, Melvin Johnson, Orhan Firat, Hideto Kazawa, and Wolfgang Macherey. 2018. Zero-shot cross-lingual classification using multilingual neural machine translation. In arXiv:1809.04686. Cristina Espana-Bonet, ´Ad´am Csaba Varga, Alberto Barr´on-Cedeno, and Josef van Genabith. 2017. An empirical analysis of nmt-derived interlingual em- beddings and their use in parallel sentence identifi- IEEE Journal of Selected Topics in Signal cation. Processing, 11(8):1340 -- 1350. Orhan Firat, Kyunghyun Cho, Baskaran Sankaran, Fatos T. Yarman Vural, and Yoshua Bengio. 2017. Multi-Way, Multilingual Neural Machine Transla- tion. Computer Speech and Language, Special Issue in Deep learning for Machine Translation. Mercedes Garc´ıa-Mart´ınez, Ozan Caglayan, Walid Aransa, Adrien Bardet, Fethi Bougares, and Loıc Barrault. 2017. Lium machine translation systems In Proceedings for wmt17 news translation task. of the Second Conference on Machine Translation, Figure 4: Visualization of the sentence representa- tion space using UMAP. Turkish in yellow, English in green. training objective. We explore both self-attentive variational and non-variational autoencoders to generate the universal language representation. The results show that in terms of quality, the pro- posed architecture is similar to the baseline system but with the advantage of moving towards training an intermediate representation. Innovatively, measuring generated outputs with the same decoding but using two language encod- ings shows that more work is still needed in order to produce the desired universal language repre- sentation for interlingual MT. As further work, we are exploring the use of the proposed architecture to better exploit limited re- sources. Additional encoders and decoders could be trained using only parallel corpus to one of the languages of a previously trained system, and then use the learned universal language representation to translate to and from all the languages already in the system. Acknowledgements This work is supported in part by the Spanish Min- isterio de Econom´ıa y Competitividad, the Euro- pean Regional Development Fund and the Agen- cia Estatal de Investigaci´on, through the post- doctoral senior grant Ram´on y Cajal, the con- tract TEC2015-69266-P (MINECO/FEDER,EU) and the contract PCIN-2017-079 (AEI/MINECO). References Rubn Ajenjo. 2018. Visualizacion de representaciones intermedias en traducciones realizadas por redes neuronales. Sameh AlAnsary. 2011. Interlingua-based machine translation systems : Unl versus other. Mikel Artetxe, Gorka Labaka, Eneko Agirre, and Kyunghyun Cho. 2017. Unsupervised neural ma- chine translation. CoRR, abs/1710.11041. pages 288 -- 295, Copenhagen, Denmark. Association for Computational Linguistics. Don Harlow. 2013. Some basic information about es- peranto -- the international language. Harold Hotelling. 1936. Relations between two sets of variants. Biometrika, 28:321 -- 377. 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 system: Enabling zero-shot translation. CoRR, abs/1611.04558. Łukasz Kaiser, Aurko Roy, Ashish Vaswani, Niki Pa- mar, Samy Bengio, Jakob Uszkoreit, and Noam Shazeer. 2018. Fast decoding in sequence mod- els using discrete latent variables. arXiv preprint arXiv:1803.03382. Diederik P Kingma and Jimmy Ba. 2014. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980. Diederik P. Kingma and Max Welling. 2013. Auto- encoding variational bayes. CoRR, abs/1312.6114. Philipp Koehn, Hieu Hoang, Alexandra Birch, Chris Callison-Burch, Marcello Federico, Nicola Bertoldi, Brooke Cowan, Wade Shen, Christine Moran, Richard Zens, et al. 2007. Moses: Open source In Proc. toolkit for statistical machine translation. of ACL, pages 177 -- 180. Philipp Koehn and Rebecca Knowles. 2017. Six chal- lenges for neural machine translation. In Proc. of the 1st Workshop on Neural Machine Translation, pages 28 -- 39, Vancouver. Philipp Koehn, Franz Josef Och, and Daniel Marcu. 2003. Statistical phrase-based translation. In Proc. of the Conference of the NAACL, pages 48 -- 54. Parteek Kumar and Kanu Goel. 2016. Universal net- working language: A framework for emerging nlp applications. In 2016 1st India International Con- ference on Information Processing (IICIP), pages 1 -- 6. Guillaume Lample, Ludovic Denoyer, and Unsupervised Marc'Aurelio Ranzato. 2017. machine translation using monolingual corpora only. CoRR, abs/1711.00043. Yichao Lu, Phillip Keung, Faisal Ladhak, Vikas Bhard- waj, Shaonan Zhang, and Jason Sun. 2018. A neu- ral interlingua for multilingual machine translation. arxiv. Leland McInnes and John Healy. 2018. Umap: Uniform manifold approximation and projec- arXiv preprint tion for dimension reduction. arXiv:1802.03426. Aaron van den Oord, Oriol Vinyals, et al. 2017. Neu- In Advances ral discrete representation learning. in Neural Information Processing Systems, pages 6309 -- 6318. David E Rumelhart, Geoffrey E Hinton, and Ronald J Williams. 1985. Learning internal representations by error propagation. Technical report, California Univ San Diego La Jolla Inst for Cognitive Science. Holger Schwenk and Matthijs Douze. 2017. Learning joint multilingual sentence representations with neu- ral machine translation. In Proc. of the 2nd Work- shop on Representation Learning for NLP, pages 157 -- 167. Rico Sennrich, Barry Haddow, and Alexandra Birch. 2016. Neural machine translation of rare words with subword units. In Proceedings of the 54th An- nual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1715 -- 1725, Berlin, Germany. Association for Computa- tional Linguistics. 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. 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 6000 -- 6010. Biao Zhang, Deyi Xiong, jinsong su, Hong Duan, and Min Zhang. 2016. Variational neural machine trans- In Proceedings of the 2016 Conference on lation. Empirical Methods in Natural Language Process- ing, pages 521 -- 530, Austin, Texas. Association for Computational Linguistics. Barret Zoph and Kevin Knight. 2016. Multi-source neural translation. CoRR, abs/1601.00710.
1708.06025
1
1708
2017-08-20T21:21:37
Portuguese Word Embeddings: Evaluating on Word Analogies and Natural Language Tasks
[ "cs.CL" ]
Word embeddings have been found to provide meaningful representations for words in an efficient way; therefore, they have become common in Natural Language Processing sys- tems. In this paper, we evaluated different word embedding models trained on a large Portuguese corpus, including both Brazilian and European variants. We trained 31 word embedding models using FastText, GloVe, Wang2Vec and Word2Vec. We evaluated them intrinsically on syntactic and semantic analogies and extrinsically on POS tagging and sentence semantic similarity tasks. The obtained results suggest that word analogies are not appropriate for word embedding evaluation; task-specific evaluations appear to be a better option.
cs.CL
cs
Portuguese Word Embeddings: Evaluating on Word Analogies and Natural Language Tasks Nathan S. Hartmann1, Erick Fonseca1, Christopher D. Shulby1, Marcos V. Treviso1, J´essica S. Rodrigues2, Sandra M. Alu´ısio1 1University of Sao Paulo, Institute of Mathematics and Computer Sciences 2Federal University of Sao Carlos, Department of Computer Science {nathansh,erickrf,sandra}@icmc.usp.br {chrisshulby,marcosvtreviso,jsc}@gmail.com 7 1 0 2 g u A 0 2 ] L C . s c [ 1 v 5 2 0 6 0 . 8 0 7 1 : v i X r a Abstract. Word embeddings have been found to provide meaningful representations for words in an efficient way; therefore, they have become common in Natural Language Processing sys- tems. In this paper, we evaluated different word embedding models trained on a large Portuguese corpus, including both Brazilian and European variants. We trained 31 word embedding models using FastText, GloVe, Wang2Vec and Word2Vec. We evaluated them intrinsically on syntactic and semantic analogies and extrinsically on POS tagging and sentence semantic similarity tasks. The obtained results suggest that word analogies are not appropriate for word embedding evaluation; task-specific evaluations appear to be a better option. 1. Introduction Natural Language Processing (NLP) applications usually take words as basic input units; therefore, it is important that they be represented in a meaningful way. In recent years, word embeddings have been found to efficiently provide such representations, and consequently, have become common in modern NLP systems. They are vectors of real valued numbers, which represent words in an n-dimensional space, learned from large non-annotated corpora and able to capture syntactic, semantic and morphological knowledge. Different algorithms have been developed to generate embeddings [Bengio et al. 2003, Collobert et al. 2011, Mikolov et al. 2013, Ling et al. 2015, Lai et al. 2015, inter alia]. They can be roughly divided into two families of methods [Baroni et al. 2014]: the first is composed of methods that work with a co-occurrence word matrix, such as Latent Semantic Analysis (LSA) [Dumais et al. 1988], Hyperspace Analogue to Language (HAL) [Lund and Burgess 1996] and Global Vectors (GloVe) [Pennington et al. 2014]. The second is composed of predictive methods, which try to predict neighbor- ing words given one or more context words, such as Word2Vec [Mikolov et al. 2013]. Given this variety of word embedding models, methods for evaluating them becomes a topic of inter- est. [Mikolov et al. 2013] developed a benchmark for embedding evaluation based on a series of analogies. Each analogy is composed of two pairs of words that share some syntactic or semantic relationship, e.g., the names of two countries and their respective capitals, or two verbs in their present and past tense forms. In order to evaluate an embedding model, applying some vectorial algebra operation to the vectors of three of the words should yield the vector of the fourth one. A version of this dataset translated and adapted to Portuguese was created by [Rodrigues et al. 2016]. However, in spite of being popular and computationally cheap, [Faruqui et al. 2016] suggests that word analogies are not appropriate for evaluating embeddings. Instead, they suggest using task-specific evaluations, i.e., to compare word embedding models on how well they perform on downstream NLP tasks. In this paper, we evaluated different word embedding models trained on a large Portuguese corpus, including both Brazilian and European variants (Section 2). We trained our models using four different algorithms with varying dimensions (Section 3). We evaluated them on the aforementioned analogies as well as on POS tagging and sentence similarity, to assess both syntactic and semantic properties of the word embeddings (Section 4). Section 5 revises recent studies evaluating Portuguese word embeddings and compares literature results with ours. The contributions of this paper are: i) to make a set of 31 word embedding models publicly available1 as well as the script used for corpus preprocessing; and ii) an intrinsic 1Available at http://nilc.icmc.usp.br/embeddings and extrinsic evaluation of word embedding models, indicating the lack of correlation between performance in syntactic and semantic analogies and syntactic and semantic NLP tasks. 2. Training Corpus We collected a large corpus from several sources in order to obtain a multi-genre corpus, repre- sentative of the Portuguese language. We rely on the results found by [Rodrigues et al. 2016] and [Fonseca and Aluisio 2016] which indicate that the bigger a corpus is, the better the embeddings obtained, even if it is mixed with Brazilian and European texts. Table 1 presents all corpora collected in this work. 2.1. Preprocessing We tokenized and normalized our corpus in order to reduce the vocabulary size, under the premise that vocabulary reduction provides more representative vectors. Word types with less than five occurrences were replaced by a special UNKNOWN symbol. Numerals were normalized to zeros; URL's were mapped to a token URL and emails were mapped to a token EMAIL. Then, we tokenized the text relying on whitespaces and punctuation signs, paying special attention to hyphenation. Clitic pronouns like "machucou-se" are kept intact. Since it differs from the approach used in [Rodrigues et al. 2016] and their corpus is a subset of ours, we adapted their tokenization using our criteria. We also removed their Wikipedia section, and in all our subcorpora, we only used sentences with 5 or more tokens in order to reduce noisy content. This reduced the number of tokens of LX-Corpus from 1,723,693,241 to 714,286,638. Corpus Tokens Types Genre Description LX-Corpus [Rodrigues et al. 2016] 714,286,638 2,605,393 Mixed genres A huge collection of texts from 19 sources. Most of them are written in European Portuguese. 219,293,003 1,758,191 Encyclopedic Wikipedia dump of 10/20/16 160,396,456 664,320 Informative News crawled from GoogleNews service 129,975,149 500,302 Spoken language Subtitles crawled from IMDb website 105,341,070 392,635 Informative News crawled from G1 news portal between 2014 and 2015. 96,209 73,575 32,868 21,224 13,308 11,597 Didactic Texts for children between 3rd and 7th-grade years of elementary school 9,207 Informative 4,064 3,942 Informative Informative 3,293 Didactic News written for children, crawled in 2015 from Folhinha issue of Folha de Sao Paulo newspaper Texts written for children of 3rd and 4th-years of elementary school News written for children, from Zero Hora newspaper Text questions of Mathematics, Human Sciences, Nature Sciences and essay writing to evaluate students Total 1,395,926,282 3,827,725 Table 1. Sources and statistics of corpora collected. 3. Embedding Methods In this section, we describe the four methods we used to train 31 word embedding models: GloVe, Word2Vec, Wang2Vec, and FastText. The Global Vectors (GloVe) method was proposed by [Pennington et al. 2014], and obtained state- of-the-art results for syntactic and semantic analogies tasks. This method consists in a co-occurrence matrix M that is constructed by looking at context words. Each element Mij in the matrix represents the probability of the word i being close to the word j. In the matrix M , the rows (or vectors) are randomly generated and trained by obeying the equation P (wi, wj) = log(Mij) = wiwj + bi + bj , where wi and wj are word vectors, and bi and bj are biases. Portuguese e-books 1,299,008 66,706 Prose 31,196,395 259,762 Informative 23,750,521 381,697 Prose 8,962,718 196,077 Mixed genres 1,047,108 941,032 55,000 36,522 Informative Informative 499,008 31,746 Science Communication Large corpus of the PLN-BR Project with texts sampled from 1994 to 2005. It was also used by [Hartmann 2016] to train word embeddings models A collection of 138,268 literary works from the Dom´ınio P´ublico web- site Texts from various genres, e.g., literary and its subdivisions (prose, po- etry and drama), informative, scientific, law, didactic technical Collection of classical fiction books written in Brazilian Portuguese crawled from Literatura Brasileira website Texts crawled from Mundo Estranho magazine Texts crawled from Ciencia Hoje das Crianc¸as (CHC) website Brazilian science divulgation texts from Pesquisa FAPESP magazine Wikipedia GoogleNews SubIMDB-PT G1 PLN-Br [Bruckschen et al. 2008] Literacy works of public domain Lacio-web [Alu´ısio et al. 2003] Mundo Estranho CHC FAPESP Textbooks Folhinha NILC subcorpus Para Seu Filho Ler SARESP Word2Vec is a widely used method in NLP for generating word embeddings. It has two different training strategies: (i) Continuous Bag-of-Words (CBOW), in which the model is given a sequence of words without the middle one, and attempts to predict this omitted word; (ii) Skip-Gram, in which the model is given a word and attempts to predict its neighboring words. In both cases, the model consists of only a single weight matrix (apart from the word embeddings), which results in a fast log-linear training that is able to capture semantic information [Mikolov et al. 2013]. Wang2Vec is a modification of Word2Vec made in order to take into account the lack of word order in the original architecture. Two simple modifications were proposed in Wang2Vec expecting embeddings to better capture syntactic behavior of words [Ling et al. 2015]. In the Continuous Window architecture, the input is the concatenation of the context word embeddings in the order they occur. In Structured Skip-Gram, a different set of parameters is used to predict each context word, depending on its position relative to the target word. FastText is a recently developed method [Bojanowski et al. 2016, Joulin et al. 2016] in which em- beddings are associated to character n-grams, and words are represented as the summation of these rep- resentations. In this method, a word representation is induced by summing character n-gram vectors with vectors of surrounding words. Therefore, this method attempts to capture morphological information to induce word embeddings. 4. Evaluation In order to evaluate the robustness of the word embedding models we trained, we performed intrinsic and extrinsic evaluations. For the intrinsic evaluation, we used the set of syntactic and semantic analogies from [Rodrigues et al. 2016]. For extrinsic evaluation, we chose to apply the trained models on POS tagging and sentence similarity tasks. The tasks were chosen deliberately since they are linguistically aligned with the sets of analogies used in the first evaluation. POS tagging is by nature a morphosyntactic task, and although some analogies are traditionally regarded as syntactic, they are actually morphological - for example, suffix operations. Sentence similarity is a semantic task since it evaluates if two sentences have similar meaning. It is expected that the models that achieve the best results in syntactic (morphological) analogies also do so in POS tagging, and the same is true for semantic analogies and semantic similarity evaluation. We trained embeddings with the following dimensions numbers: 50, 100, 300, 600 and 1,000. 4.1. Intrinsic evaluation We evaluated our embeddings in the syntactic and semantic analogies provided by [Rodrigues et al. 2016]. Since our corpus is composed of both Brazilian (PT-BR) and European (PT-EU) Portuguese, we also eval- uated the models in the test sets for both variants, following [Rodrigues et al. 2016]. Table 2 shows the obtained results for the intrinsic evaluation. On average, GloVe was the best model for both Portuguese variants. The model which best performed on syntactic analogies was FastText, followed by Wang2Vec. This makes sense since FastText is a morphological model, and Wang2Vec uses word order, which provides some minimal syntactic knowledge. In semantic analogies, the model which best performed was GloVe, followed by Wang2Vec. GloVe is known for modeling semantic information well. Wang2Vec potentially captures semantics because it uses word order. The position of a negation in a sentence can totally change its semantics. If this negation is shuffled in a bag of words (Word2Vec CBOW), sentence semantic is diluted. All CBOW models, except for the Wang2Vec ones, achieved very low results in semantic analogies, similarly to the results from [Mikolov et al. 2013]. Wang2Vec CBOW differs from other CBOW methods in that it takes word order into account, and then we can speculate that an unordered bag-of-words is not able to capture a word's semantic so well. 4.2. Extrinsic Evaluation In this section we describe the experiments performed on POS tagging and Semantic Similarity tasks. Embedding Models Size PT-BR PT-EU Syntactic Semantic All Syntactic Semantic All CBOW FastText Skip-Gram GloVe Wang2Vec Word2Vec CBOW Skip-Gram CBOW Skip-Gram 50 100 300 600 1,000 50 100 300 600 1,000 50 100 300 600 1,000 50 100 300 600 1,000 50 100 300 600 1,000 50 100 300 600 1,000 50 100 300 600 1,000 35.2 45.0 52.0 52.6 50.6 36.8 50.8 58.7 55.1 45.1 28.7 39.7 45.8 42.3 39.4 28.4 40.9 49.9 46.1 44.8 30.6 43.9 53.3 52.9 47.3 9.8 16.2 24.7 25.8 26.2 17.0 25.2 33.0 35.6 34.1 4.2 6.1 8.4 5.9 4.8 18.4 30.0 32.2 24.3 14.6 13.7 28.7 45.8 48.5 45.9 9.2 26.2 40.3 22.2 21.9 12.2 22.2 33.9 35.0 33.2 2.2 3.6 4.6 5.2 4.9 5.4 8.0 15.6 20.0 21.3 19.6 25.5 30.1 29.2 27.7 27.6 40.4 45.4 39.6 29.8 27.4 34.2 46.7 45.4 42.7 18.8 33.5 45.1 34.1 33.3 21.3 33.0 42.8 43.9 40.2 6.0 9.9 23.9 23.1 22.9 11.2 16.6 29.2 33.4 32.6 35.2 45.1 52.0 52.4 50.4 36.5 50.7 58.5 55.0 45.2 28.5 39.9 45.9 42.3 39.8 28.4 40.8 50.0 46.0 44.7 30.6 44.0 53.4 53.0 47.6 9.7 16.0 24.5 25.4 26.2 16.9 24.8 32.2 35.3 33.6 4.6 6.4 9.1 6.5 5.4 17.1 28.9 31.1 23.9 13.8 12.8 26.6 42.3 43.8 42.5 8.9 24.4 36.9 21.1 20.5 11.5 21.2 32.3 33.2 30.9 1.9 3.5 4.5 5.1 4.5 4.8 7.4 14.1 17.6 18.1 19.8 25.7 30.5 29.4 27.9 26.8 39.8 44.8 39.4 29.4 27.7 33.2 46.2 43.1 41.1 18.6 32.6 43.5 33.5 32.6 21.0 32.6 43.6 43.1 39.2 5.8 9.7 23.6 22.9 22.7 10.8 16.1 29.8 33.5 31.9 Table 2. Intrinsic evaluation on syntactic and semantic analogies. POS Tagging POS tagging is a very suitable NLP task to evaluate how well the embeddings capture morphosyntactic properties. The two key difficulties here are: i) correctly classifying words that can have different tags depending on context; and ii) generalizing to previously unseen words. Our experiments were performed with the nlpnet POS tagger2 using the revised Mac-Morpho corpus and similar tagger configurations to those presented by [Fonseca et al. 2015] (20 epochs, 100 hidden neurons, learning rate starting at 0.01, capitalization, suffix and prefix features). We did not focus on optimizing hyperparameters; instead, we set a single configuration to compare embeddings. Table 3 presents the POS accuracy results3. As a rule of thumb, the larger the dimensionality, the better the performance. The exception is the 1,000 dimensions Word2Vec models, which performed slightly worse than those with 600. GloVe and FastText yielded the worst results, and Wang2Vec achieved the best. GloVe's poor performance may be explained by its focus on semantics rather than syntax, and FastText's performance was surprising in that despite its preference for morphology, something traditionally regarded as important for POS tagging, it yielded relatively poor results. Wang2Vec resulted in the best performance – actually, its 300 dimension Skip-Gram model was superior to Word2Vec's 1000 model. Concerning the CBOW and Skip-Gram strategies, in the case of FastText, the latter was considerably better. For Wang2Vec and Word2Vec, the gap between the two is less noticeable, where CBOW achieved slightly better performance on smaller dimensionalities. Semantic Similarity ASSIN (Avaliac¸ ao de Similaridade Semantica e Inferencia Textual) was a workshop co-located with PROPOR-2016. ASSIN made two shared-tasks available: i) semantic similarity; and ii) entailment. We chose the first one to evaluate our word embedding models extrinsically in a semantic task. ASSIN seman- tic similarity shared task required participants to assign similarity values between 1 and 5 to pairs of sen- tences. The workshop made training and test sets for Brazilian (PT-BR) and European (PT-EU) Portuguese available. [Hartmann 2016] obtained the best results for this task. The author calculated the semantic sim- ilarity of pairs of sentences training a linear regressor with two features: i) the cosine similarity between 2More info at http://nilc.icmc.usp.br/nlpnet/ 3Note that accuracies are well below those reported by [Fonseca et al. 2015]. The probable cause is that the embedding vocabularies used here did not have clitic pronouns split from verbs, resulting in a great amount of out of vocabulary words. Embedding Models Size Accuracy Embeddings model Size Accuracy FastText CBOW Skip-Gram CBOW Wang2Vec Skip-Gram 50 100 300 600 1000 50 100 300 600 1000 50 100 300 50 100 300 600 1,000 91.18% 92.57% 93.86% 93.86% 94.27% 93.15% 93.78% 94.82% 95.25% 95.49% 95.33% 95.59% 95.83% 95.07% 95.57% 95.89% 95.88% 95.94% GloVe Word2Vec CBOW Skip-Gram 50 100 300 600 1,000 50 100 300 600 1,000 50 100 300 600 1,000 93.13% 93.72% 94.76% 95.23% 95.57% 95.00% 95.27% 95.58% 95.65% 95.62% 94.79% 95.18% 95.66% 95.82% 95.81% Table 3. Extrinsic evaluation on POS tagging the TF-IDF of each sentence; and ii) the cosine similarity between the summation of the word embeddings of the sentences' words. We chose this work as a baseline for evaluation because we can replace its word embedding model with others and compare the results. Although the combination of TF-IDF and word embeddings produced better results than only using word embeddings, we chose to only use embeddings for ease of comparison. [Hartmann 2016] trained the word embedding model using Word2Vec Skip-Gram approach, with 600 dimensions, and a corpus composed of Wikipedia, G1 and PLN-Br. Only using embed- dings, [Hartmann 2016] achieved 0.58 in Pearson's Correlation (ρ) and a 0.50 Mean Squared Error (MSE) for PT-BR; and 0.55 ρ and 0.83 MSE for PT-EU evaluation. Table 4 shows the performance of our word embedding models for both PT-BR and PT-EU test sets. To our surprise, the word embedding models which achieved the best results on semantic analogies (see Table 2) were not the best in this semantic task. The best results for European Portuguese was achieved by Word2Vec CBOW model using 1,000 dimensions. CBOW models were the worst on semantic analogies and were not expected to achieve the best results in this task. The best result for Brazilian Portuguese was obtained by Wang2Vec Skip-Gram model using 1,000 dimensions. This model also achieved the best results for POS tagging. Neither FastText nor GloVe models beat the results achieved by [Hartmann 2016]. Embedding Models Size PT-BR PT-EU ρ MSE ρ MSE Embedding Models Size PT-BR PT-EU ρ MSE ρ MSE CBOW FastText Skip-Gram CBOW Skip-Gram Wang2Vec 50 100 300 600 1,000 50 100 300 600 1,000 50 100 300 600 1,000 50 100 300 600 1,000 0.36 0.37 0.38 0.33 0.39 0.45 0.49 0.55 0.40 0.52 0.53 0.56 0.53 0.49 0.50 0.51 0.54 0.58 0.59 0.60 0.66 0.66 0.65 0.68 0.64 0.61 0.58 0.53 0.64 0.56 0.55 0.52 0.55 0.58 0.57 0.56 0.54 0.50 0.49 0.49 0.34 0.36 0.37 0.38 0.41 0.43 0.47 0.40 0.40 0.54 0.51 0.54 0.51 0.53 0.53 0.47 0.50 0.53 0.54 0.54 1.05 1.04 1.03 1.02 0.99 0.98 0.94 1.02 1.01 0.86 0.89 0.85 0.89 0.87 0.87 0.92 0.89 0.85 0.83 0.85 GloVe Word2Vec CBOW Skip-Gram 50 100 300 600 1,000 50 100 300 600 1,000 50 100 300 600 1,000 0.42 0.45 0.49 0.50 0.51 0.47 0.50 0.55 0.57 0.58 0.46 0.48 0.52 0.53 0.54 0.62 0.60 0.58 0.57 0.56 0.59 0.57 0.53 0.51 0.50 0.60 0.58 0.56 0.54 0.54 0.38 0.42 0.45 0.45 0.46 0.46 0.49 0.54 0.55 0.55 0.43 0.45 0.48 0.50 0.50 1.01 0.98 0.95 0.94 0.94 0.95 0.91 0.87 0.86 0.86 0.97 0.95 0.93 0.92 0.91 Table 4. Extrinsic evaluation on Semantic Similarity task. 5. Related Work The research on evaluating unsupervised word embeddings can be divided into intrinsic and extrinsic eval- uations. The former relying mostly on word analogies (e.g. [Mikolov et al. 2013]) and measuring the semantic similarity between words (e.g. the WS-353 dataset [Finkelstein et al. 2002]), while extrinsic eval- uations focus on practical NLP tasks (e.g. [Nayak et al. 2016]). POS tagging, parsing, semantic similarity between sentences, and sentiment analysis are some commonly used tasks for this end. To the best of our knowledge, only a few works attempted to evaluate Portuguese word embed- dings. [Rodrigues et al. 2016] collected a corpus of Portuguese texts to train word embedding models using the Skip-Gram Word2Vec technique. The authors also translated the benchmark of word analogies devel- oped by [Mikolov et al. 2013] and made it available4 for both Brazilian and European Portuguese. The benchmark contains five types of semantic analogy: (i) common capitals and countries, (ii) all capitals and countries, (iii) currency and countries, (iv) cities and states, and (v) family relations. Moreover, nine types of syntactic analogy are also represented: adjectives and adverbs, opposite adjectives, base adjectives and comparatives, base adjectives and superlatives, verb infinitives and present participles, countries and nation- alities (adjectives), verb infinitives and past tense forms, nouns in plural and singular, and verbs in plural and singular. They report a 52.8% evaluation accuracy of their word embedding model in both syntactic and semantic analogies. [Sousa 2016] investigated whether Word2Vec (CBOW and Skip-Gram) or GloVe performed best on the benchmark in [Rodrigues et al. 2016]. The author compiled a sample of texts from Wikipedia in Portuguese, searching for articles related to teaching, education, academics, and institutions. The best results were obtained using Word2Vec CBOW to train vectors of 300 dimensions. This model achieved an accuracy of 21.7% on syntactic analogies, 17.2% on semantic analogies and 20.4% overall. [Fonseca et al. 2015] compared the performance of three different vector space models used for POS tagging with a neural tagger. They used Word2Vec Skip-Gram, HAL, and the neural method from [Collobert et al. 2011]; Skip-Gram obtained the best results in all tests. Concerning the differences between embeddings obtained from Brazilian and European Portuguese texts, [Fonseca and Aluisio 2016] present an extrinsic analysis on POS tagging. They trained different embedding models; one with only Brazilian texts, one with only European ones and another with mixed variants; and trained neural POS taggers which were evaluated on Brazilian and European datasets. One of their findings is that, as a rule of thumb, the bigger the corpus in which embeddings are obtained, the better. Additionally, mixing both variants in the embedding generation did not decrease tagger performance in any of the POS test sets. This supports the hypothesis that a single, large corpus comprising Brazilian and European texts can be useful for most NLP applications in Portuguese. 6. Conclusions and Future Work In this paper, we presented the word embeddings we trained using four different techniques and their eval- uation. All trained models are available for download, as well as the script used for corpus preprocessing. The results obtained from intrinsic and extrinsic evaluations were not aligned with each other, contrary to the expected. GloVe produced the best results for syntactic and semantic analogies, and the worst, together with FastText, for both POS tagging and sentence similarity. These results are aligned with those from [Faruqui et al. 2016], which suggest that word analogies are not appropriate for evaluating word embed- dings. Overall, Wang2Vec vectors yielded very good performance across our evaluations, suggesting they can be useful for a variety of NLP tasks. As future work, we intend to try different tokenization and nor- malization patterns, and also to lemmatize certain word categories like verbs, since this could significantly reduce vocabulary, allowing for more efficient processing. An evaluation with more NLP tasks would also be beneficial to our understanding of different model performances. Acknowledgements This work was supported by CNPq, CPqD and FAPESP (PIPE-PAPESP project no 2016/00500-1). References [Alu´ısio et al. 2003] Alu´ısio, S. M., Pinheiro, G. M., Finger, M., Nunes, M. G. V., and Tagnin, S. E. (2003). The LacioWeb Project: Overview and Issues in Brazilian Portuguese Corpora Creation. In Proceedings of Corpus Linguistics, pages 14–21. [Baroni et al. 2014] Baroni, M., Dinu, G., and Kruszewski, G. (2014). Don't count, predict! A systematic In Proceedings of the 52nd comparison of context-counting vs. context-predicting semantic vectors. Annual Meeting of the Association for Computational Linguistics, volume 1, pages 238–247. [Bengio et al. 2003] Bengio, Y., Ducharme, R., Vincent, P., and Jauvin, C. (2003). A neural probabilistic language model. Journal of machine learning research, 3:1137–1155. 4https://github.com/nlx-group/lx-dsemvectors [Bojanowski et al. 2016] Bojanowski, P., Grave, E., Joulin, A., and Mikolov, T. (2016). Enriching Word Vectors with Subword Information. arXiv preprint arXiv:1607.04606. [Bruckschen et al. 2008] Bruckschen, M., Muniz, F., Souza, J., Fuchs, J., Infante, K., Muniz, M., Gonc¸alves, Anotac¸ ao Lingu´ıstica em XML do Corpus PLN-BR. P., Vieira, R., and Alu´ısio, S. (2008). NILC–TR–09–08. Technical report, University of Sao Paulo, Brazil. [Collobert et al. 2011] Collobert, R., Weston, J., Bottou, L., Karlen, M., Kavukcuoglu, K., and Kuksa, P. (2011). Natural Language Processing (Almost) from Scratch. Journal of Machine Learning Research, 12:2493–2537. [Dumais et al. 1988] Dumais, S. T., Furnas, G. W., Landauer, T. K., Deerwester, S., and Harshman, R. (1988). Using latent semantic analysis to improve access to textual information. In Proceedings of the SIGCHI conference on Human factors in computing systems, pages 281–285. ACM. [Faruqui et al. 2016] Faruqui, M., Tsvetkov, Y., Rastogi, P., and Dyer, C. (2016). Problems With Evaluation of Word Embeddings Using Word Similarity Tasks. In Proc. of the 1st Workshop on Evaluating Vector Space Representations for NLP. [Finkelstein et al. 2002] Finkelstein, L., Gabrilovich, E., Matias, Y., Rivlin, E., Solan, Z., Wolfman, G., and Ruppin, E. (2002). Placing search in context: The concept revisited. ACM Transactions on Information Systems, 20(1). [Fonseca and Aluisio 2016] Fonseca, E. and Aluisio, S. (2016). Improving POS Tagging Across Portuguese Variants with Word Embeddings. In Proceedings of the Computational Processing of the Portuguese Language, pages 227–232. [Fonseca et al. 2015] Fonseca, E. R., Rosa, J. L. G., and Alu´ısio, S. M. (2015). Evaluating word embeddings and a revised corpus for part-of-speech tagging in portuguese. Journal of the Brazilian Computer Society. [Hartmann 2016] Hartmann, N. S. (2016). ASSIN Shared Task - Solo Queue Group: Mix of a Traditional and an Emerging Approaches. In Avaliac¸ ao de Similaridade Semantica e Inferencia Textual (ASSIN), Propor Workshop. [Joulin et al. 2016] Joulin, A., Grave, E., Bojanowski, P., and Mikolov, T. (2016). Bag of tricks for efficient text classification. arXiv preprint arXiv:1607.01759. [Lai et al. 2015] Lai, S., Xu, L., Liu, K., and Zhao, J. (2015). Recurrent convolutional neural networks for text classification. In AAAI, volume 333, pages 2267–2273. [Ling et al. 2015] Ling, W., Dyer, C., Black, A., and Trancoso, I. (2015). Two/too simple adaptations of word2vec for syntax problems. In Proceedings of the 2015 Conference of the North American Chap- ter of the Association for Computational Linguistics: Human Language Technologies. Association for Computational Linguistics. [Lund and Burgess 1996] Lund, K. and Burgess, C. (1996). Producing high-dimensional semantic spaces from lexical co-occurrence. Behavior Research Methods, Instruments, & Computers, 28(2):203–208. [Mikolov et al. 2013] Mikolov, T., Chen, K., Corrado, G., and Dean, J. (2013). Efficient estimation of word representations in vector space. In Proceedings of International Conference on Learning Representations Workshop (ICLR-2013). [Nayak et al. 2016] Nayak, N., Angeli, G., and Manning, C. D. (2016). Evaluating Word Embeddings Using a Representative Suite of Practical Tasks. In RepEval Workshop. [Pennington et al. 2014] Pennington, J., Socher, R., and Manning, C. D. (2014). Glove: Global vectors for word representation. Proceedings of the 2014 Conference on Empiricial Methods in Natural Language Processing (EMNLP-2014), 12:1532–1543. [Rodrigues et al. 2016] Rodrigues, J., Ant´onio, B., Steven, N., and Joao, S. (2016). LX-DSemVectors: Distri- butional Semantics Models for Portuguese. In Computational Processing of the Portuguese Language: 12th International Conference (PROPOR-2016). Springer International Publishing. [Sousa 2016] Sousa, S. (2016). Estudo de Modelos de Word Embeddings. Monograph (Bacharel em Computac¸ ao), UTFPR (Universidade Tecnol´ogica Federal do Paran´a), Paran´a, Brazil.
1709.00155
1
1709
2017-09-01T04:46:10
Order-Planning Neural Text Generation From Structured Data
[ "cs.CL", "cs.AI", "cs.IR", "cs.LG" ]
Generating texts from structured data (e.g., a table) is important for various natural language processing tasks such as question answering and dialog systems. In recent studies, researchers use neural language models and encoder-decoder frameworks for table-to-text generation. However, these neural network-based approaches do not model the order of contents during text generation. When a human writes a summary based on a given table, he or she would probably consider the content order before wording. In a biography, for example, the nationality of a person is typically mentioned before occupation in a biography. In this paper, we propose an order-planning text generation model to capture the relationship between different fields and use such relationship to make the generated text more fluent and smooth. We conducted experiments on the WikiBio dataset and achieve significantly higher performance than previous methods in terms of BLEU, ROUGE, and NIST scores.
cs.CL
cs
Order-Planning Neural Text Generation From Structured Data Lei Sha,1 Lili Mou,2 Tianyu Liu,1 Pascal Poupart,2 Sujian Li,1 Baobao Chang,1 Zhifang Sui1 1Key Laboratory of Computational Linguistics, Ministry of Education; School of EECS, Peking Univeristy 2David R. Cheriton School of Computer Science, University of Waterloo 1{shalei, tianyu0421, lisujian, chbb, szf}@pku.edu.cn [email protected], [email protected] 7 1 0 2 p e S 1 ] L C . s c [ 1 v 5 5 1 0 0 . 9 0 7 1 : v i X r a Abstract Generating texts from structured data (e.g., a table) is im- portant for various natural language processing tasks such as question answering and dialog systems. In recent studies, re- searchers use neural language models and encoder-decoder frameworks for table-to-text generation. However, these neu- ral network-based approaches do not model the order of con- tents during text generation. When a human writes a sum- mary based on a given table, he or she would probably con- sider the content order before wording. In a biography, for example, the nationality of a person is typically mentioned before occupation in a biography. In this paper, we propose an order-planning text generation model to capture the rela- tionship between different fields and use such relationship to make the generated text more fluent and smooth. We con- ducted experiments on the WIKIBIO dataset and achieve sig- nificantly higher performance than previous methods in terms of BLEU, ROUGE, and NIST scores. Introduction Generating texts from structured data (e.g., a table) is im- portant for various natural language processing tasks such as question answering and dialog systems. Table 1 shows an example of a Wikipedia infobox (containing fields and val- ues) and a text summary. In early years, text generation is usually accomplished by human-designed rules and templates (Green 2006; Turner, Sripada, and Reiter 2010), and hence the generated texts are not flexible. Recently, researchers apply neural networks to generate texts from structured data (Lebret, Grangier, and Auli 2016), where a neural encoder captures table informa- tion and a recurrent neural network (RNN) decodes these information to a natural language sentence. Although such neural network-based approach is capable of capturing complicated language and can be trained in an end-to-end fashion, it lacks explicit modeling of content or- der during text generation. That is to say, an RNN gener- ates a word at a time step conditioned on previous generated words as well as table information, which is more or less "shortsighted" and differs from how a human writer does. As suggested in the book The Elements of Style, A basic structural design underlies every kind of writ- ing . . . in most cases, planning must be a deliberate pre- lude to writing. (William and White 1999) Table: ID Field 1 Name 2 Born 3 Died 4 Occupation 5 Nationality 6 Alma mater 7 Genre 8 Notable work Stories of Sherlock Homes Content Arthur Ignatius Conan Doyle 22 May 1859 Edinburgh, Scotland 7 July 1930 (aged 71) Crowborough, England Author, writer, physician British University of Edinburgh Medical School Detective fiction fantasy Text: Sir Arthur Ignatius Conan Doyle (22 May 1859 – 7 July 1930) was a British writer best known for his detective fiction featuring the character Sherlock Holmes. Table 1: Example of a Wikipedia infobox and a reference text. This motivates order planning for neural text generation. In other words, a neural network should model not only word order (as has been well captured by RNN) but also the order of contents, i.e., fields in a table. We also observe from real summaries that table fields by themselves provide illuminating clues and constraints of text generation. In the biography domain, for example, the na- tionality of a person is typically mentioned before the occu- pation. This could benefit from explicit planning of content order during neural text generation. In this paper, we propose an order-planning method for table-to-text generation. Our model is built upon the encoder-decoder framework and use RNN for text synthe- sis with attention to table entries. Different from exiting neural models, we design a table field linking mechanism, inspired by temporal memory linkage in the Differentiable Neural Computer (Graves et al. 2016, DNC). Our field link- ing mechanism explicitly models the relationship between different fields, enabling our neural network to better plan what to say first and what next. Further, we incorporate a copy mechanism (Gu et al. 2016) into our model to cope with rare words. We evaluated our method on the WIKIBIO dataset (Le- bret, Grangier, and Auli 2016). Experimental results show that our order-planning approach significantly outperforms previous state-of-the-art results in terms of BLEU, ROUGE, and NIST metrics. Extensive ablation tests verify the ef- fectiveness of each component in our model; we also per- form visualization analysis to better understand the proposed order-planning mechanism. Approach Our model takes as input a table (e.g., a Wikipedia infobox) and generates a natural language summary describing the information based on an RNN. The neural network contains three main components: • An encoder captures table information; • A dispatcher-a hybrid content- and linkage-based atten- tion mechanism over table contents-plans what to gen- erate next; and • A decoder generates a natural language summary using RNN, where we also incorporate a copy mechanism (Gu et al. 2016) to cope with rare words. We elaborate these components in the rest of this section. Encoder: Table Representation We design a neural encoder to represent table information. As shown in Figure 1, the content of each field is split into separate words and the entire table is transformed into a large sequence. Then we use a recurrent neural network (RNN) with long short term memory (LSTM) units (Hochre- iter and Schmidhuber 1997) to read the contents as well as their corresponding field names. Concretely, let C be the number of content words in a table; let ci and fi be the embeddings of a content and its corresponding field, respectively (i = 1··· C). The input of LSTM-RNN is the concatenation of fi and ci, denoted as xi = [fi; ci], and the output, denoted as hi, is the encoded information corresponding to a content word, i.e., (cid:2)gin; gforget; gout (cid:3) = σ(Wgxi + Ughi−1) (cid:101)xi = tanh(Wxxi + Uxhi−1) (cid:101)hi = gin ◦(cid:101)xi + gforget ◦(cid:101)hi−1 hi = gout ◦ tanh((cid:101)hi) (1) (2) (3) (4) where ◦ denotes element-wise product, and σ denotes the sigmoid function. W 's and U's are weights, and bias terms are omitted in the equations for clarity. gin, gforget, and gout are known as input, forget, and output gates. Notice that, we have two separate embedding matrices for fields and content words. We observe the field names of dif- ferent data samples mostly come from a fixed set of candi- dates, which is reasonable in a particular domain. Therefore, we assign an embedding to a field, regardless of the number of words in the field name. For example, the field Notable work in Table 1 is represented by a single field embedding instead of the embeddings of notable and work. For content words, we represent them with conventional word embeddings (which are randomly initialized), and use LSTM-RNN to integrate information. In a table, some fields contain a sequence of words (e.g., Name="Arthur Ignatius (a) Encoder (b) Dispatcher Table Representation Planning What to Generate Next Figure 1: The (a) Encoder and (b) Dispatcher in our model. Conan Doyle"), whereas other fields contain a set of words (e.g., Occupation = "writer, physician"). We do not have much human engineering here, but let an RNN to capture such subtlety by itself. Dispatcher: Planning What to Generate Next After encoding table information, we use another RNN to decode a natural language summary (deferred to the next part). During the decoding process, the RNN is augmented with a dispatcher that plans what to generate next. Generally, a dispatcher is an attention mechanism over ta- ble contents. At each decoding time step t, the dispatcher computes a probabilistic distribution αt,i (i = 1··· C), which is further used for weighting content representa- tions hi. In our model, the dispatcher is a hybrid of content- and link-based attention, discussed in detail as follows. Content-Based Attention. Traditionally, the computation of attention αt,i is based on the content representation hi as well as some state during decoding (Bahdanau, Cho, and Bengio 2015; Mei, Bansal, and Walter 2016). We call this content-based attention, which is also one component in our dispatcher. Since both the field name and the content contain im- portant clues for text generation, we compute the attention weights based on not only the encoded vector of table con- tent hi but also the field embedding fi, thus obtaining the final attention αcontent by re-weighting one with the other. t,i NameArthurNameIgnatiusNameConanNameDoyleBorn22BornMayBorn1859OccupationwriterOccupationphysicianNationalityBritishLSTMLast step'sattentionLink (sub)matrixContent-basedattentionLink-basedattentionHybrid attentionWeightedsumAttentionvectorField Content Formally, we have(cid:101)α(f ) (cid:101)α(c) t,i = f (cid:62) i (cid:62) t,i = h i αcontent t,i = (cid:0)W (f )yt−1 + b(f )(cid:1) (cid:0)W (c)yt−1 + b(c)(cid:1) exp(cid:8)(cid:101)α(f ) (cid:9) t,i (cid:101)α(c) j=1 exp(cid:8)(cid:101)α(f ) (cid:9) (cid:80)C t,j(cid:101)α(c) t,j t,i (5) (6) (7) t,i where W (f ), b(f ), W (c), b(c) are learnable parameters; fi and hi are vector representations of the field name and en- coded content, respectively, for the ith row. αcontent is the content-based attention weights. Ideally, a larger content- based attention indicates a more relevant content to the last generated word. Link-Based Attention. We further propose a link-based attention mechanism that directly models the relationship between different fields. Our intuition stems from the observation that, a well- organized text typically has a reasonable order of its con- tents. As illustrated previously, the nationality of a person is often mentioned before his occupation (e.g., a British writer). Therefore, we propose an link-based attention to ex- plicitly model such order information. We construct a link matrix L ∈ Rnf×nf , where nf is the number possible field names in the dataset. An element L [fj, fi] is a real-valued score indicating how likely the field fj is mentioned after the field fi. (Here, [·,·] indexes a ma- trix.) The link matrix L is a part of model parameters and learned by backpropagation. Although the link matrix ap- pears to be large in size (1475×1475), a large number of its elements are not used because most fields do not co-occur in at least one data sample; in total, we have 53422 effective parameters here. In other scenarios, low-rank approximation may be used to reduce the number of parameters. Formally, let αt−1,i (i = 1 . . . C) be an attention proba- bility1 over table contents in the last time step during gener- ation. For a particular data sample whose content words are of fields f1, f2,··· , fC, we first weight the linking scores by the previous attention probability, and then normalize the weighted score to obtain link-based attention probabil- ity, given by αlink t,i = softmax (cid:26) C(cid:88) (cid:27) j=1 αt−1,j · L [fj, fi(cid:48)](cid:9) exp(cid:8)(cid:80)C i(cid:48)=1 exp(cid:8)(cid:80) j αt−1,j · L [fj, fi(cid:48)](cid:9) (cid:80)C αt−1,j · L [fj, fi] j=1 = (8) (9) (cid:80)C Intuitively, the link matrix is analogous to the transition matrix in a Markov chain (Karlin 2014), whereas the term j=1 αt−1,j · L [fj, fi] is similar to one step of transition in the Markov chain. However, in our scenario, a table in a particular data sample contains only a few fields, but a field may occur several times because it contains more than one 1Here, αt−1,i refers to the hybrid content- and link-based atten- tion, which will be introduced shortly. content words. Therefore, we do not require our link matrix L to be a probabilistic distribution in each row, but normal- ize the probability afterwards by Equation 9, which turns out to work well empirically. Besides, we would like to point out that the link-based attention is inspired by the Differentiable Neural Com- puter (Graves et al. 2016, DNC). DNC contains a "linkage- based addressing" mechanism to track consecutively used memory slots and thus to integrate order information during memory addressing. Likewise, we design the link-based at- tention to capture the temporal order of different fields. But different from the linking strength heuristically defined in DNC, the link matrix in our model is directly parameterized and trained in an end-to-end manner. Hybrid Attention. To combine the above two attention mechanisms, we use a self-adaptive gate zt ∈ (0, 1) by a sigmoid unit zt = σ(cid:0)w (cid:48) (cid:62)[h t−1; e(f ) ; yt−1](cid:1) (10) t where w is a parameter vector. h(cid:48) t−1 is the last step's hid- den state of the decoder RNN. yt−1 is the embedding of the word generated in the last step; e(f ) is the sum of field embeddings fi weighted by the current step's field attention t,i . As yt−1 and e(f ) αlink emphasize the content and link as- pects, respectively, the self-adaptive gate z is aware of both. In practice, we find z tends to address link-based attention too much and thus adjust it by(cid:101)zt = 0.2zt + 0.5 empirically. Finally, the hybrid attention, a probabilistic distribution t t over all content words, is given by =(cid:101)zt · αcontent t + (1 −(cid:101)zt) · αlink t hybrid t α (11) Decoder: Sentence Generation The decoder is an LSTM-RNN that predicts target words in sequence. We also have an attention mechanism (Bahdanau, Cho, and Bengio 2015) that summarizes source information, i.e., the table in our scenario, by weighted sum, yielding an attention vector at by C(cid:88) at = αhybrid t,i hi (12) i=1 t,i is the hidden representation obtained by the where hi table encoder. As αhybrid is a probabilistic distribution- determined by both content and link information-over con- tent words, it enables the decoder RNN to focus on relevant information at a time, serving as an order-planning mecha- nism for table-to-text generation. Then we concatenate the attention vector at and the em- bedding of the last step's generated word yt−1, and use a single-layer neural network to mix information before feed- ing to the decoder RNN. In other words, the decoder RNN's input (denoted as xt) is xt = tanh(Wd[at; yt−1] + bd) (13) where Wd and bd are weights. Similar to Equations 1–4, at a time step t during decoding, the decoder RNN yields a Decoder Sentence Generation Figure 2: The decoder RNN in our model, which is enhanced with a copy mechanism. sLSTM t hidden representation h(cid:48) t, based on which a score function sLSTM is computed suggesting the next word to generate. The score function is computed by (cid:48) = Wsh t + bs (14) where h(cid:48) t is the decoder RNN's state. (Ws and bs are weights.) The score function can be thought of as the input of a softmax layer for classification before being normalized to a probabilistic distribution. We incorporate a copy mech- anism (Gu et al. 2016) into our approach, and the normal- ization is accomplished after considering a copying score, introduced as follows. Copy Mechanism. The copy mechanism scores a content word ci by its hidden representation hi in the encoder side, indicating how likely the content word ci is directly copied during target generation. That is, (cid:62) (cid:48) i Wc)h t (15) and st,i is a real number for i = 1,··· , C (the number of content words). Here Wc is a parameter matrix, and h(cid:48) is the decoding state. st,i = σ(h In other words, when a word appears in the table content, it has a copying score computed as above. If a word w occurs multiple times in the table contents, the scores are added, given by scopy t (w) = st,i · 1{ci=w} (16) C(cid:88) i=1 J = − T(cid:88) t t (w) where 1{ci=w} is a Boolean variable indicating whether the content word ci is the same as the word w we are consider- ing. st(w) = sLSTM exp{st(w)} pt(w) = softmax (st(w)) = (cid:80) w(cid:48)∈V(cid:83) C Finally, the LSTM score and the copy score are added for a particular word and further normalized to obtain a proba- bilistic distribution, given by (w) + scopy (17) exp{st(w(cid:48))} (18) where V refers to the vocabulary list and C refers to the set of content words in a particular data sample. In this way, the copy mechanism can either generate a word from the vocabulary or directly copy a word from the source side. This is hepful in our scenario because some fields in a table (e.g., Name) may contain rare or unseen words and the copy mechanism can cope with them naturally. For simplicity, we use greedy search during inference, i.e., for each time step t, the word with the largest probability is chosen, given by yt = argmaxw pt(w). The decoding pro- cess terminates when a special symbol <eos> is generated, indicating the end of a sequence. Training Objective Our training objective is the negative log-likelihood of a sen- tence y1 ··· yT in the training set. t=1 log p(yty0 ··· yt−1) (19) where p(yt·) is computed by Equation 18. An (cid:96)2 penalty is also added as most other studies. Since all the components described above are differen- tiable, our entire model can be trained end-to-end by back- propagation, and we use Adam (Kingma and Ba 2015) for optimization. Experiments Dataset We used the newly published WIKIBIO dataset (Lebret, Grangier, and Auli 2016),2 which contains 728,321 biogra- phies from WikiProject Biography3 (originally from English Wikipedia, September 2015). Each data sample comprises an infobox table of field- content pairs, being the input of our system. The generation target is the first sentence in the biography, which follows the setting in previous work (Lebret, Grangier, and Auli 2016). Although only the first sentence is considered in the experi- ment, the sentence typically serves as a summary of the ar- ticle. In fact, the target sentence has 26.1 tokens on average, which is actually long. Also, the sentence contains informa- tion spanning multiple fields, and hence our order-planning mechanism is useful in this scenario. 2https://github.com/DavidGrangier/ wikipedia-biography-dataset 3https://en.wikipedia.org/wiki/Wikipedia: WikiProject_Biography Table contentLSTMLSTMLSTM<start> . . .LSTM . . . <eos>LSTM LastLSTMstateAttentionvector Embedding of thegenerated wordin last step Group Previous results Our results Model KN Template KN Table NLMl Content attention only Order planning (full model) BLEU ROUGE NIST 0.93 5.19 7.98 8.57 8.85 0.38 10.70 25.80 34.65 37.15 2.21 19.80 34.70 41.38 43.91 Table 2: Comparison of the overall performance between our model and previous methods. lBest results in Lebret, Grangier, and Auli (2016). We applied the standard data split: 80% for training and 10% for testing, except that model selection was performed on a validaton subset of 1000 samples (based on BLEU-4). Settings We decapitalized all words and kept a vocabulary size of 20,000 for content words and generation candidates, which also followed previous work (Lebret, Grangier, and Auli 2016). Even with this reasonably large vocabulary size, we had more than 900k out-of-vocabulary words. This rational- izes the use of the copy mechanism. For the names of table fields, we treated each as a spe- cial token. By removing nonsensical fields whose content is "none" and grouping fields occurring less than 100 times as an "Unknown" field, we had 1475 different field names in total. In our experiments, both words' and table fields' embed- dings were 400-dimensional and LSTM layers were 500- dimensional. Notice that, a field (e.g., "name") and a con- tent/generation word (e.g., also "name"), even with the same string, were considered as different tokens; hence, they had different embeddings. We randomly initialized all embed- dings, which are tuned during training. We used Adam (Kingma and Ba 2015) as the optimiza- tion algorithm with a batch size of 32; other hyperparame- ters were set to default values. Baselines We compared our model with previous results using either traditional language models or neural networks. • KN and Template KN (Heafield et al. 2013): Lebret, Grangier, and Auli (2016) train an interpolated Kneser- Ney (KN) language model for comparison with the KenLM toolkit. They also train a KN language model with templates. • Table NLM: Lebret, Grangier, and Auli (2016) propose an RNN-based model with attention and copy mechanisms. They have several model variants, and we quote the high- est reported results. We report model performance in terms of several met- rics, namely BLEU-4, ROUGE-4, and NIST-4, which are computed by standard software, NIST mteval-v13a.pl (for BLEU and NIST) and MSR rouge-1.5.5 (for ROUGE). We did not include the perplexity measure in Lebret, Grangier, Component Content att. Link att. Hybrid att. Copy+Content att. Copy+Link att. Copy+Hybrid att. BLEU ROUGE NIST 8.57 41.38 8.36 38.24 43.01 8.75 8.63 41.89 8.42 39.08 43.91 8.85 34.65 32.75 36.91 34.93 33.47 37.15 Table 3: Ablation test. and Auli (2016) because the copy mechanism makes the vo- cabulary size vary among data samples, and thus the per- plexity is not comparable among different approaches. Results Overall Performance. Table 2 compares the overall per- formance with previous work. We see that, modern neural networks are considerably better than traditional KN models with or without templates. Moreover, our base model (with content-attention only) outperforms Lebret, Grangier, and Auli (2016), showing our better engineering efforts. After adding up all proposed components, we obtain +2.5 BLEU and ROUGE improvement and +0.3 NIST improvement, achieving new state-of-the-art results. Ablation Test. Table 3 provides an extensive ablation test to verify the effectiveness of each component in our model. The top half of the table shows the results without the copy mechanism, and the bottom half incorporates the copying score as described previously. We observe that the copy mechasnim is consistently effective with different types of attention. We then compare content-based attention and link-based attention, as well as their hybrid (also Table 3). The results show that, link-based attention alone is not as effective as content-based attention. However, we achieve better perfor- mance if combining them together with an adaptive gate, i.e., the proposed hybrid attention. The results are consistent in both halves of Table 3 (with or without copying) and in terms of all metrics (BLEU, ROUGE, and NIST). This im- plies that content-based attention and link-based attention do capture different aspects of information, and their hybrid is more suited to the task of table-to-text generation. Effect of the gate. We are further interested in the effect of the gate z, which balances content-based attention αcontent Feeding field info to. . . None Computation of αcontent Decoder RNN's input Hybrid att. (proposed) BLEU ROUGE NIST 41.89 8.63 8.57 40.52 8.61 41.96 43.91 8.85 34.93 34.95 35.07 37.15 Table 4: Comparing different possible ways of using field information. "None": No field information is fed back to the network, i.e., content-based attention computed by Equa- tion 7 (with copying). word American is appropriate in the sentence, and corrupts the phrase former governor of the federal reserve system as appears in the reference. However, when link-based atten- tion is added, the network is more aware of the order be- tween fields "Nationality" and "Occupation," and generates the nationality American before the occupation economist. This process could also be visualized in Figure 4. Here, we plot our model's content-based attention, link-based atten- tion and their hybrid. (The content- and link-based attention probabilities may be different from those separately trained in the ablation test.) After generating "emmett john rice ( december 21, 1919 – march 10, 2011 ) was," content-based attention skips the nationality and focuses more on the oc- cupation. Link-based attention, on the other hand, provides a strong clue suggesting to generate the nationality first and then occupation. In this way, the obtained sentence is more compliant with conventions. Related Work Text generation has long aroused interest in the NLP com- munity due to is wide applications including automated nav- igation (Dale, Geldof, and Prost 2003) and weather forecast- ing (Reiter et al. 2005). Traditionally, text generation can be divided into several steps (Stent, Prassad, and Walker 2004): content planning defines what information should be con- veyed in the generated sentence; (2) sentence planning de- termines what to generate in each sentence; and (3) surface realization actually generates those sentences with words. In early years, surface realization is often accomplished by templates (Van Deemter, Theune, and Krahmer 2005) or statistically learned (shallow) models, e.g., probabilis- tic context-free grammar (Belz 2008) and language mod- els (Angeli, Liang, and Klein 2010), with hand-crafted fea- tures or rules. Therefore, these methods are weak in terms of the quality of generated sentences. For planning, researchers also apply (shallow) machine learning approaches. Barzilay and Lapata (2005), for example, model it as a collective clas- sification problem, whereas Liang, Jordan, and Klein (2009) use a generative semi-Markov model to align text segment and assigned meanings. Generally, planning and realization in the above work are separate and have difficulty in captur- ing the complexity of language due to the nature of shallow models. Recently, the recurrent neural network (RNN) is playing a key role in natural language generating. As RNN can au- Figure 3: Comparing the self-adaptive gate with interpola- tion of content- and link-based attention. z = 0 is link-based attention, z = 1 is content-based attention. and link-based attention αlink. As defined in Equation 11, the computation of z depends on the decoding state as well as table information; hence it is "self-adaptive." We would like to verify if such adaptiveness is useful. To verify this, we designed a controlled experiment where the gate z was manually assigned in advance and fixed during training. In other words, the setting was essentially a (fixed) interpola- tion between αcontent and αlink. Specifically, we tuned z from 0 to 1 with a granularity of 0.1, and plot BLEU scores as the comparison metric in Figure 3. As seen, interpolation of content- and link-based atten- tion is generally better than either single mechanism, which again shows the effectiveness of hybrid attention. However, the peak performance of simple interpolation (42.89 BLEU when z = 0.4) is worse than the self-adaptive gate, imply- ing that our gating mechanism can automatically adjust the importance of αcontent and αlink at a particular time based on the current state and input. Different Ways of Using Field Information. We are cu- rious whether the proposed order-planning mechanism is better than other possible ways of using field information. We conducted two controlled experiments as follows. Sim- ilar to the proposed approach, we multiplied the attention probability by a field matrix and thus obtained a weighted field embedding. We fed it to either (1) the computation of content-based attention, i.e., Equations 5–6, or (2) the RNN decoder's input, i.e., Equation 13. In both cases, the last step's weighted field embedding was concatenated with the embedding of the generated word yt−1. From Table 4, we see that feeding field information to the computation of αcontent interferes content attention and leads to performance degradation, and that feeding it to decoder RNN slightly improves model performance. However, both controlled experiments are worse than the proposed method. The results confirm that our order-planning mechanism is indeed useful in modeling the order of fields, outperforming several other approaches that use the same field information in a naıve fashion. Case Study and Visualization We showcase an example in Table 5. With only content- based attention, the network is confused about when the 0.00.20.40.60.81.0z30.035.040.045.050.0BLEUFixedzSelf-adaptivez Reference Content-based attention Hybrid attention emmett john rice ( december 21 , 1919 – march 10 , 2011 ) was a former governor of the federal reserve system , a Cornell university economics professor , expert in the monetary systems of developing countries and the father of the current national security advisor to president barack obama , susan e . rice . emmett john rice ( december 21 , 1919 – march 10 , 2011 ) was an economist , author , public official and the former american governor of the federal reserve system , the first african american UNK . emmett john rice ( december 21 , 1919 – march 10 , 2011 ) was an american economist , author , public official and the former governor of the federal reserve system , expert in the monetary systems of developing countries . Table 5: Case study. Left: Wikipedia infobox. Right: A reference and two generated sentences by different attention (both with the copy mechanism). Our paper proposes an order-planning approach by de- signing a hybrid of content- and link-based attention. The model is inspired by hybrid content- and location-based ad- dressing in the Differentiable Neural Computer (Graves et al. 2016, DNC), where the location-based addressing is de- fined heuristically. Instead, we propose a transition-like link matrix that models how likely a field is mentioned after an- other, which is more suited in our scenario. Moreover, our entire model is differentiable, and thus the planning and realization steps in traditional language gener- ation can be learned end-to-end in our model. Conclusion and Future Work In this paper, we propose an order-planning neural network that generates texts from a table (Wikipedia infobox). The text generation process is built upon an RNN with attention to table contents. Different from traditional content-based attention, we explicitly model the order of contents by a link matrix, based on which we compute a link-based at- tention. Then a self-adaptive gate balances the content- and link-based attention mechanisms. We further incorporate a copy mechanism to our model to cope with rare or unseen words. We evaluated our approach on a newly proposed large scale dataset, WIKIBIO. Experimental results show that we outperform previous results by a large margin in terms of BLEU, ROUGE, and NIST scores. We also had extensive ablation test showing the effectiveness of the copy mecha- nism, as well as the hybrid attention of content and linking information. We compared our order-planning mechanism with other possible ways of modeling field; the results con- firm that the proposed method is better than feeding field embedding to the network in a naıve fashion. Finally we pro- vide a case study and visualize the attention scores so as to better understand our model. In future work, we would like to deal with text genera- tion from multiple tables. In particular, we would design hi- erarchical attention mechanisms that can first select a table containing the information and then select a field for gen- eration, which would improve the attention efficiency. We would also like to apply the proposed method to text gener- ation from other structured data, e.g., a knowledge graph. Figure 4: Visualization of attention probabilities in our model. x-axis: generated words ". . . ) was an american economist . . . "; y-axis: (cid:104)field : content word(cid:105) pairs in the table. (a) Content-based attention. (b) Link-based attention. (c) Hybrid attention. Subplot (b) exhibits strips because, by definition, link-based attention will yield the same score for all content words with the same field. Please also note that the columns do not sum to 1 in the figure because we only plot a part of the attention probabilities. tomatically capture highly complicated patterns during end- to-end training, it has successful applications including ma- chine translation (Bahdanau, Cho, and Bengio 2015), dia- log systems (Shang, Lu, and Li 2015), and text summariza- tion (Tan, Wan, and Xiao 2017). Researchers are then beginning to use RNN for text gener- ation from structured data. Mei, Bansal, and Walter (2016) propose a coarse-to-fine grained attention mechanism that selects one or more records (e.g., a piece of weather forecast) by a precomputed but fixed probability and then dynamically attends to relevant contents during decoding. Lebret, Grang- ier, and Auli (2016) incorporate the copy mechanism (Gu et al. 2016) into the generation process. However, the above approaches do not explicitly model the order of contents. It is also nontrivial to combine traditional planning techniques to such end-to-end learned RNN. NameBirth dateBirth placeDeath dateDeath placeNationalityOccupationKnown forEmmett John RiceDecember 21, 1919Florence, South Carolina,United StatesMarch 10, 2011 (aged 91)Camas, Washington, United StatesAmericanGovernor of the Federal Reserve System, Economics ProfessorExpert in the Monetary System of Developing Countries, Father toSusan E. Rice)wasanamericaneconomistdeathplace:uniteddeathplace:statesnationality:americanoccupation:governoroccupation:ofoccupation:theoccupation:federaloccupation:reserveoccupation:systemoccupation:,occupation:economicsoccupation:professorknownfor:expert(a)αcontent)wasanamericaneconomist(b)αlink)wasanamericaneconomist(c)αhybrid [Liang, Jordan, and Klein 2009] Liang, P.; Jordan, M. I.; and Klein, D. 2009. Learning semantic correspondences with less supervision. In Proceedings of the Joint Conference of the 47th Annual Meeting of the ACL and the 4th Interna- tional Joint Conference on Natural Language Processing of the AFNLP, 91–99. [Mei, Bansal, and Walter 2016] Mei, H.; Bansal, M.; and Walter, M. R. 2016. What to talk about and how? Selec- tive generation using LSTMs with coarse-to-fine alignment. In Proceedings of the Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, 720–730. [Reiter et al. 2005] Reiter, E.; Sripada, S.; Hunter, J.; Yu, J.; and Davy, I. 2005. Choosing words in computer-generated weather forecasts. Artificial Intelligence 167(1-2):137–169. [Shang, Lu, and Li 2015] Shang, L.; Lu, Z.; and Li, H. 2015. Neural responding machine for short-text conversation. In Proceedings of the 53rd Annual Meeting of the Associa- tion for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing, 1577– 1586. [Stent, Prassad, and Walker 2004] Stent, A.; Prassad, R.; and Walker, M. 2004. Trainable sentence planning for complex information presentations in spoken dialog systems. In Pro- ceedings of the 42nd Meeting of the Association for Compu- tational Linguistics, 79–86. [Tan, Wan, and Xiao 2017] Tan, J.; Wan, X.; and Xiao, J. 2017. Abstractive document summarization with a graph- based attentional neural model. In Proceedings of the 55th Annual Meeting of the Association for Computational Lin- guistics, 1171–1181. [Turner, Sripada, and Reiter 2010] Turner, R.; Sripada, S.; and Reiter, E. 2010. Generating approximate geographic In Empirical Methods in Natural Language descriptions. Generation, 121–140. [Van Deemter, Theune, and Krahmer 2005] Van Deemter, K.; Theune, M.; and Krahmer, E. 2005. Real versus language generation: A false template-based natural opposition? Computational Linguistics 31(1):15–24. [William and White 1999] William, S., and White, E. B. 1999. The Element of Style. Pearson, 4th edition. Acknowledgments We thank Jing He from AdeptMind.ai for helpful discus- sions on different ways of using field information. References [Angeli, Liang, and Klein 2010] Angeli, G.; Liang, P.; and Klein, D. 2010. A simple domain-independent probabilistic approach to generation. In Proceedings of the Conference on Empirical Methods in Natural Language Processing, 502– 512. [Bahdanau, Cho, and Bengio 2015] Bahdanau, D.; Cho, K.; and Bengio, Y. 2015. Neural machine translation by jointly learning to align and translate. In Proceedings of the Inter- national Conference on Learning Representations. [Barzilay and Lapata 2005] Barzilay, R., and Lapata, M. 2005. Collective content selection for concept-to-text gener- ation. In Proceedings of Human Language Technology Con- ference and Conference on Empirical Methods in Natural Language Processing, 331–338. [Belz 2008] Belz, A. 2008. Automatic generation of weather forecast texts using comprehensive probabilistic generation- space models. Natural Language Engineering 14(4):431– 455. [Dale, Geldof, and Prost 2003] Dale, R.; Geldof, S.; and Prost, J.-P. 2003. CORAL: Using natural language genera- tion for navigational assistance. In Proceedings of the 26th Australasian Computer Science Conference, volume 16, 35– 44. [Graves et al. 2016] Graves, A.; Wayne, G.; Reynolds, M.; et al. 2016. Hybrid computing using a neural network with dynamic external memory. Nature 538(7626):471–476. [Green 2006] Green, N. 2006. Generation of biomedical ar- guments for lay readers. In Proceedings of the 4th Interna- tional Natural Language Generation Conference, 114–121. [Gu et al. 2016] Gu, J.; Lu, Z.; Li, H.; and Li, V. O. 2016. Incorporating copying mechanism in sequence-to-sequence learning. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, 1631–1640. [Heafield et al. 2013] Heafield, K.; Pouzyrevsky, I.; Clark, J. H.; and Koehn, P. 2013. Scalable modified Kneser-Ney language model estimation. In Proceedings of the 51st An- nual Meeting of the Association for Computational Linguis- tics, volume 2, 690–696. [Hochreiter and Schmidhuber 1997] Hochreiter, and Schmidhuber, J. 1997. Long short-term memory. Neural Computation 9(8):1735–1780. [Karlin 2014] Karlin, S. 2014. A First Course in Stochastic Processes. Academic Press. [Kingma and Ba 2015] Kingma, D., and Ba, J. 2015. Adam: A method for stochastic optimization. In Proceedings of the International Conference on Learning Representations. [Lebret, Grangier, and Auli 2016] Lebret, R.; Grangier, D.; and Auli, M. 2016. Neural text generation from structured data with application to the biography domain. In Proceed- ings of the Conference on Empirical Methods in Natural Language Processing, 1203–1213. S.,
1302.4813
1
1302
2013-02-20T05:47:32
Probabilistic Frame Induction
[ "cs.CL" ]
In natural-language discourse, related events tend to appear near each other to describe a larger scenario. Such structures can be formalized by the notion of a frame (a.k.a. template), which comprises a set of related events and prototypical participants and event transitions. Identifying frames is a prerequisite for information extraction and natural language generation, and is usually done manually. Methods for inducing frames have been proposed recently, but they typically use ad hoc procedures and are difficult to diagnose or extend. In this paper, we propose the first probabilistic approach to frame induction, which incorporates frames, events, participants as latent topics and learns those frame and event transitions that best explain the text. The number of frames is inferred by a novel application of a split-merge method from syntactic parsing. In end-to-end evaluations from text to induced frames and extracted facts, our method produced state-of-the-art results while substantially reducing engineering effort.
cs.CL
cs
Probabilistic Frame Induction∗ Jackie Chi Kit Cheung† Department of Computer Science University of Toronto Toronto, ON, M5S 3G4, Canada [email protected] Hoifung Poon One Microsoft Way Microsoft Research Redmond, WA 98052, USA [email protected] Lucy Vanderwende One Microsoft Way Microsoft Research Redmond, WA 98052, USA [email protected] Abstract In natural-language discourse, related events tend to appear near each other to describe a larger scenario. Such structures can be formal- ized by the notion of a frame (a.k.a. template), which comprises a set of related events and prototypical participants and event transitions. Identifying frames is a prerequisite for infor- mation extraction and natural language gen- eration, and is usually done manually. Meth- ods for inducing frames have been proposed recently, but they typically use ad hoc proce- dures and are difficult to diagnose or extend. In this paper, we propose the first probabilis- tic approach to frame induction, which incor- porates frames, events, participants as latent topics and learns those frame and event tran- sitions that best explain the text. The number of frames is inferred by a novel application of a split-merge method from syntactic parsing. In end-to-end evaluations from text to induced frames and extracted facts, our method pro- duced state-of-the-art results while substan- tially reducing engineering effort. 1 Introduction Events with causal or temporal relations tend to oc- cur near each other in text. For example, a bomb- ing scenario in an article on terrorism might begin with a DETONATION event, in which terrorists set ∗This is a postprint version of a paper to appear in the Pro- ceedings of the 2013 Conference of the North American Chap- ter of the Association for Computational Linguistics: Human Language Technologies (NAACL/HLT 2013). †This research was undertaken during the author’s internship at Microsoft Research. off a bomb. Then, a DAMAGE event might ensue to describe the resulting destruction and any casual- ties, followed by an INVESTIGATION event cov- ering subsequent police investigations. Afterwards, the bombing scenario may transition into a criminal- processing scenario, which begins with police catch- ing the terrorists, and proceeds to a trial, sentenc- ing, etc. A common set of participants serves as the event arguments; e.g., the agent (or subject) of DETONATION is often the same as the theme (or ob- ject) of INVESTIGATION and corresponds to the PERPETRATOR. Such structures can be formally captured by the notion of a frame (a.k.a. template), which consists of a set of events with prototypical transitions, as well as a set of slots representing the common par- ticipants. Identifying frames is an explicit or im- plicit prerequisite for many NLP tasks. Informa- tion extraction, for example, stipulates the types of events and slots that are extracted for a frame or template. Online applications such as dialogue sys- tems and personal-assistant applications also model users’ goals and subgoals using frame-like represen- tations, and in natural-language generation, frames are often used to represent content to be expressed as well as to support surface realization. Until recently, frames and related representations have been manually constructed, which has limited their applicability to a relatively small number of do- mains and a few slots within a domain. Furthermore, additional manual effort is needed after the frames are defined in order to extract frame components from text (e.g., in annotating examples and design- ing features to train a supervised learning model). This paradigm makes it hard to generalize across tasks and might suffer from annotator bias. Recently, there has been increasing interest in au- tomatically inducing frames from text. A notable example is Chambers and Jurafsky (2011), which first clusters related verbs to form frames, and then clusters the verbs’ syntactic arguments to identify slots. While Chambers and Jurafsky (2011) repre- sents a major step forward in frame induction, it is also limited in several aspects. The clustering used ad hoc steps and customized similarity metrics, as well as an additional retrieval step from a large ex- ternal text corpus for slot generation. This makes it hard to replicate their approach or adapt it to new domains. Lacking a coherent model, it is also diffi- cult to incorporate additional linguistic insights and prior knowledge. In this paper, we present ProFinder (PROba- bilistic Frame INDucER), which is the first proba- bilistic approach for frame induction. ProFinder defines a joint distribution over the words in a document and their frame assignments by model- ing frame and event transition, correlations among events and slots, and their surface realizations. Given a set of documents, ProFinder outputs a set of induced frames with learned parameters, as well as the most probable frame assignments that can be used for event and entity extraction. The numbers of events and slots are dynamically deter- mined by a novel application of the split-merge ap- proach from syntactic parsing (Petrov et al., 2006). In end-to-end evaluations from text to entity ex- traction using the standard MUC and TAC datasets, ProFinder achieved state-of-the-art results while sig- nificantly reducing engineering effort and requiring no external data. 2 Related Work In information extraction and other semantic pro- cessing tasks, the dominant paradigm requires two stages of manual effort. First, the target representa- tion is defined manually by domain experts. Then, manual effort is required to construct an extractor or annotate examples to train a machine-learning sys- tem. Recently, there has been a burgeoning body of work in alleviating such manual effort. For exam- ple, a popular approach to reduce annotation effort is bootstrapping from seed examples (Patwardhan and Riloff, 2007; Huang and Riloff, 2012). However, this still requires prespecified frames or templates, and selecting seed words is often a challenging task due to semantic drift (Curran et al., 2007). Open IE (Banko and Etzioni, 2008) reduces the manual effort to designing a few domain-independent rela- tion patterns, which can then be applied to extract relational triples from text. While extremely scal- able, this approach can only extract atomic factoids within a sentence, and the resulting triples are noisy, non-cannonicalized text fragments. More relevant to our approach is the recent work in unsupervised semantic induction, such as un- supervised semantic parsing (Poon and Domingos, 2009), unsupervised semantical role labeling (Swier and Stevenson, 2004) and induction (Lang and Lap- ata, 2011, e.g.), and slot induction from web search logs (Cheung and Li, 2012). As in ProFinder, they also model distributional contexts for slot or role induction. However, these approaches focus on semantics in independent sentences, and do not cap- ture discourse-level dependencies. The modeling component for frame and event transitions in ProFinder is similar to a sequen- tial topic model (Gruber et al., 2007), and is in- spired by the successful applications of such topic models in summarization (Barzilay and Lee, 2004; Daum ´e III and Marcu, 2006; Haghighi and Vander- wende, 2009, inter alia). There are, however, two main differences. First, ProFinder contains not a single sequential topic model, but two (for frames and events, respectively). In addition, it also mod- els the interdependencies among events, slots, and surface text, which is analogous to the USP model (Poon and Domingos, 2009). ProFinder can thus be viewed as a novel combination of state-of-the- art models in unsupervised semantics and discourse modeling. In terms of aim and capability, ProFinder is most similar to Chambers and Jurafsky (2011), which culminated from a series of work for iden- tifying correlated events and arguments in narrative (Chambers and Jurafsky, 2008; Chambers and Ju- rafsky, 2009). By adopting a probabilistic approach, ProFinder has a sound theoretical underpinning, and is easy to modify or extend. For example, in Section 3, we show how ProFinder can easily be augmented with additional linguistically-motivated features. Likewise, ProFinder can easily be used as a semi-supervised system if some slot designa- tions and labeled examples are available. The idea of representing and capturing stereotyp- ical knowledge has a long history in artificial in- telligence and psychology, and has assumed vari- ous names such as frames (Minsky, 1974), schemata (Rumelhart, 1975), and scripts (Schank and Abel- son, 1977). In the linguistics and computational linguistics communities, frame semantics (Fillmore, 1982) uses frames as the central representation of word meaning, culminating in the development of FrameNet (Baker et al., 1998), which contains over 1000 manually annotated frames. A similarly rich lexical resource is the MindNet project (Richard- son et al., 1998). Our notion of frame is related to these representations, but there are also subtle differences. For example, Minsky’s frame empha- sizes inheritance, which we do not model in this pa- per. (It should be a straightforward extension: us- ing the split-and-merge approach, ProFinder already produces a hierarchy of events and slots in learning, although currently, it simply discards the intermedi- ate levels.) As in semantic role labeling, FrameNet focuses on semantic roles and does not model event or frame transitions, so the scope of its frames is of- ten no more than an event in our model. Perhaps the most similar to our frame is Roger Schank’s scripts, which capture prototypical events and par- ticipants in a scenario such as restaurant dining. In their approach, however, scripts are manually de- fined, making it hard to generalize. In this regard, our work may be viewed as an attempt to revive a long tradition in AI and linguistics, by leveraging the recent advances in computational power, NLP, and machine learning. 3 Probabilistic Frame Induction In this section, we present ProFinder, a proba- bilistic model for frame induction. Let F be a set of frames, where each frame F = (EF , SF ) comprises a unique set of events EF and slots SF . Given a doc- ument D and a word w in D , Zw = (f , e) represents an assignment of w to frame f ∈ F and frame el- ement e ∈ Ef ∪ Sf . At the heart of ProFinder is a generative model Pθ (D , Z ) that defines a joint Pθ (D). distribution over document D and the frame assign- ment to its words Z . Given a set of documents D , frame induction in ProFinder amounts to determin- ing the number of frames, events and slots, as well as learning the parameters θ by summing out the la- (cid:89) tent assignments Z to maximize the likelihood of the document set D∈D The induced frames identify the key event structures in the document set. Additionally, ProFinder can also conduct event and entity extraction by computing the most probable frame assignment Z . In the remainder of the section, we first present the base model for ProFinder. We then intro- duce several linguistically motivated refinements, and efficient algorithms for learning and inference in ProFinder. 3.1 Base Model The probabilistic formulation of ProFinder makes it extremely flexible for incorporating lin- guistic intuition and prior knowledge. In this paper, we design our ProFinder model to capture three types of dependencies. Frame transitions between clauses A sentence contains one or more clauses, each of which is a minimal unit expressing a proposition. A clause is unlikely to straddle across different frames, so we stipulate that the words in a clause be assigned to the same frame. On the other hand, frame transitions can happen between clauses, and we adopt the com- mon Markov assumption that the frame of a clause only depends on the clause immediately to its left. Here, sentences are ordered sequentially as they ap- pear in the documents. Clauses are automatically extracted from the dependency parse and further de- composed into an event head and its syntactic argu- ments; see the experiment section for details. Event transitions within a frame Events tend to transition into related events in the same frame, as determined by their causal or temporal relations. Each clause is assigned an event compatible with its frame assignment (i.e., the event is in the given frame). As for frame transitions, we assume that the event assignment of a clause depends only on the event of the previous clause. Emission of event heads and slot words Similar to topics in topic models, each event determines a multinomial from which the event head is generated. E.g., a detonation event might use verbs such as det- onate, set off or nouns such as denotation, bombing as its event head. Additionally, as in USP (Poon and Domingos, 2009), an event also contains a multino- mial of slots for each of its argument types1 . E.g., the agent argument of a detonation event is generally the PERPETRATOR slot of the BOMBING frame. Fi- nally, each slot has its own multinomials for gener- ating the argument head and dependency label, re- gardless of the event. Formally, let D be a document and C1 , · · · , Cl be Pθ (D , Z ) = PF−INIT (F1 ) × (cid:89) its clauses, the ProFinder model is defined by × (cid:89) i × PE−INIT (E1 F1 ) PE−TRAN (Ei+1 Ei , Fi+1 , Fi ) × (cid:89) i PE−HEAD (ei Ei ) × (cid:89) i PSLOT (Si,j Ei,j , Ai,j ) × (cid:89) i,j × (cid:89) i,j i,j PA−DEP (depi,j Si,j ) PA−HEAD (ai,j Si,j ) PF−TRAN (Fi+1 Fi ) Here, Fi , Ei denote the frame and event assign- ment to clause Ci , respectively, and ei denotes the event head. For the j -th argument of clause i, Si,j denotes the slot assignment, Ai,j the argument type, ai,j the head word, and depi,j the dependency from the event head. PE−TRAN (Ei+1 Ei , Fi+1 , Fi ) = PE−INIT (Ei+1 Fi+1 ) if Fi+1 (cid:54)= Fi . Essentially, ProFinder combines a frame HMM with an event HMM, where the first mod- els frame transition and emits events, and the second models event transition within a frame and emits ar- gument slots. 1USP generates the argument types along with events from clustering. For simplicity, in ProFinder we simply classify a syntactic argument into subject, object, and prepositional ob- ject, according to its Stanford dependency to the event head. 3.2 Model refinements The base model captures the main dependencies in event narrative, but it can be easily extended to lever- age additional linguistic intuition. ProFinder in- corporates three such refinements. Background frame Event narratives often con- tain interjections of general content common to all frames. For example, in newswire articles, ATTR I - BUT ION is commonplace to describe who said or reported a particular quote or fact. To avoid con- taminating frames with generic content, we intro- duce a background frame with its own events, slots, and emission distributions, and a binary switch vari- able Bi ∈ {BKG, CN T } that determines whether clause i is generated from the actual content frame Fi (CN T ) or background (BKG). We also stipu- late that if background is chosen, the nominal frame stays the same as the previous clause. (1) if Bi+1 = BKG Stickiness in frame and event transitions Prior work has demonstrated that promoting topic coher- ence in natural-language discourse helps discourse modeling (Barzilay and Lee, 2004). We extend ProFinder to leverage this intuition by incorpo- rating a “stickiness” prior (Haghighi and Vander- wende, 2009) to encourage neighboring clauses to stay in the same frame. Specifically, along with in- troducing the background frame, the frame transi- tion component now becomes 1(Fi+1 = Fi ), PF−TRAN (Fi+1 Fi , Bi+1 ) = β1(Fi+1 = Fi )+ (1 − β )PF−TRAN (Fi+1 Fi ), where β is the stickiness parameter, and the event transition component correspondingly becomes 1(Ei+1 = Ei ), PE−TRAN (Ei+1 Ei , Fi+1 , Fi , Bi+1 ) = if Bi+1 = BKG PE−TRAN (Ei+1 Ei ), if Bi+1 = CN T , Fi = Fi+1 if Bi+1 = CN T , Fi (cid:54)= Fi+1 PE−INIT (Ei+1 ), Argument dependencies as caseframes As no- ticed in previous work such as Chambers and Ju- rafsky (2011), the combination of an event head if Bi+1 = CN T (2) slot Si,j from 5. For each clause in each document, generate the clause-internal structure. The clause-internal structure at clause i is gener- ated by the following steps: 1. Generate whether this clause is background (Bi ∈ {CN T , BKG} ∼ PBKG (B )) 2. Generate the frame Fi and event Ei from PF−INIT (F ), PE−INIT (E ), or according to equations 1 and 2 3. Generate the observed event head ei from PE−HEAD (ei Ei ). 4. For each event argument: (a) Generate the PSLOT (S E , A, B ). (b) Generate the dependency/caseframe emis- sion depi,j ∼ PA−DEP (depS ) and the lemma of the head word of the event ar- gument ai,j ∼ PA−HEAD (aS ). 3.4 Learning and Inference Our generative model admits efficient inference by dynamic programming. In particular, after collaps- ing the latent assignment of frame, event, and back- ground into a single hidden variable for each clause, the expectation and most probable assignment can be computed using standard forward-backward and Viterbi algorithms. Parameter learning can be done using EM by al- ternating the computation of expected counts and the maximization of multinomial parameters. In par- ticular, ProFinder used incremental EM, which has been shown to have better and faster con- vergence properties than standard EM (Liang and Klein, 2009). Determining the optimal number of events and slots is challenging. One solution is to adopt non- parametric Bayesian methods by incorporating a hi- erarchical prior over the parameters (e.g., a Dirich- let process). However, this approach can impose unrealistic restrictions on the model choice and re- sult in intractability which requires sampling or ap- proximate inference to overcome. Additionally, EM learning can suffer from local optima due to its non- convex learning objective, especially when dealing with a large number hidden states without a good initialization. To address these issues, we adopt a novel appli- cation of the split-merge method previously used in Figure 1: Graphical representation of our model. Hyper- parameters, the stickiness factor, and the frame and event initial and transition distributions are not shown for clar- ity. and a dependency relation often gives a strong sig- nal of the slot that is indicated. For example, bomb > nsubj often indicates a PERPETRATOR. Thus, rather than simply emitting the dependency from the event head to an event argument depi,j , our model instead emits the pair of event head and de- pendency relation, which we call a caseframe fol- lowing Bean and Riloff (2004). 3.3 Full generative story To summarize, the distributions that are learned by our model are the default distributions PBKG (B ), PF−INIT (F ), PE−INIT (E ), the transition distri- butions PF−TRAN (Fi+1 Fi ), PE−TRAN (Ei+1 Ei ), and the emission distributions PSLOT (S E , A, B ), PE−HEAD (eE , B ), PA−HEAD (aS ), PA−DEP (depS ). We used additive smoothing with uniform Dirich- let priors for all the multinomials. The overall generative story of our model is as follows: 1. Draw a Bernoulli distribution for PBKG (B ) 2. Draw the frame, event, and slot distributions 3. Draw an event head emission distribution PE−HEAD (eE , B ) for each frame including the background frame 4. Draw event argument lemma and caseframe emission distributions for each slot in each frame including the background frame Frame Event Background Event head 𝐶1 𝐵1 𝐹1 𝐸1 𝑒1 𝑆1 𝑑𝑒𝑝1 𝑎1 𝐷 𝐶𝑁 𝐵𝑁 𝐹𝑁 𝐸𝑁 𝑒𝑁 𝑆𝑁 𝑑𝑒𝑝𝑁 𝑎𝑁 . . . . . . 𝐹 𝑆 𝐸 𝑃𝐻𝐸𝐴𝐷𝐸− Arguments 𝑃𝐻𝐸𝐴𝐷𝐴− 𝑃𝐷𝐸𝑃𝐴− syntactic parsing for inferring refined latent syntac- tic categories (Petrov et al., 2006). Specifically, we initialize our model such that each frame is associ- ated with one event and two slots. Then, after a num- ber of iterations of EM, we split each event and slot in two along with their probability, and duplicate the associated emission distributions. We then add some perturbation to break symmetry. After splitting, we merge back a proportion of the newly split events and slots that result in the least improvement in the likelihood of the training data. For more details on split-merge, see (Petrov et al., 2006) By adjusting the number of split-merge cycles and the merge parameters, our model learns the number of events and slots in a dynamical fashion that is tai- lored to the data. Moreover, our model starts with a small number of frame elements, which reduces the number of local optima and make initial learn- ing easier. After each split, the subsequent learning starts with (a perturbed version of) the previously learned parameters, which makes a good initializa- tion that is crucial for EM. Finally, it is also compat- ible with the hierarchical nature of events and slots. For example, slots can first be coarsely split into per- sons versus locations, and later refined into subcate- gories such as perpetrators and victims. 4 MUC-4 Entity Extraction Experiments We first evaluate our model on a standard entity extraction task, using the evaluation settings from Chambers and Jurafsky (2011) to enable a head-to- head comparison. Specifically, we use the MUC-4 data set (muc, 1992), which contains 1300 training and development documents on terrorism in South America, with 200 additional documents for testing. MUC-4 contains four templates: attack, kidnapping, bombing, and arson.2 All templates share the same set of predefined slots, with the evaluation focusing on the following four: perpetrator, physical target, human target, and instrument. For each slot in a MUC template, the system first identified an induced slot that best maps to it by F1 on the development set. As in Chambers and Juraf- sky (2011), template is ignored in final evaluation. So the system merged the induced slots across all 2Two other templates have negligible counts and are ignored as in Chambers and Jurafsky (2011). (3) PF (w) = templates to calculate the final scores. Correctness is determined by matching head words, and slots marked as optional in MUC are ignored when com- puting recall. All hyper-parameters are tuned on the development set3 . Document classification The MUC-4 dataset contains many documents that contain words related to MUC slots (e.g., plane and aviation), but are not about terrorism. To reduce precision errors, Cham- bers and Jurafsky’s (2011) (henceforth, C&J) first filtered irrelevant documents based on the specificity of event heads to learned frames. To estimate the specificity, they used additional data retrieved from a large external corpus. In ProFinder, however, speci- ficity can be easily estimated using the probability distributions learned during training. In particular, we define the probability of an event head in a frame (cid:88) j : PE−HEAD (wE )/F , EF ∈F (cid:88) and the probability of a frame given an event head: P (F w) = PF (w)/ F (cid:48)∈F We then follow the rest of Chambers and Jurafsky (2011) to score each learned frame with each MUC document, mapping a document to a frame if the av- erage PF (w) in the document is above a threshold and the document contains at least one trigger word w (cid:48) with P (F w (cid:48) ) > 0.2. The threshold and the in- duced frame were determined on the development set, which were then used to filter irrelevant docu- ments in the test set. Results Compared to C&J, ProFinder is con- ceptually much simpler, involving a single proba- bilistic model, with standard learning and inference algorithms. In particular, it did not require multi- ple processing steps or customized similarity met- rics; rather, it only used the data within MUC-4. In contrast, C&J required additional text to be retrieved from a large external corpus (Gigaword (Graff et al., 2005)) for each event cluster, yet ProFinder nev- ertheless was able to outperform C&J on entity ex- traction, as shown in Table 1. Our system achieved 3We will make the parameter settings used in all experiments publicly available. PF (cid:48) (w). (4) Unsupervised methods ProFinder (This work) Chambers and Jurafsky (2011) With extra information ProFinder +doc. classification C&J 2011 +granularity P R F1 34 37 32 48 25 33 41 44 44 36 43 40 Table 1: Results on MUC-4 entity extraction. C&J 2011 +granularity refers to their experiment in which they mapped one of their templates to five learned clusters rather than one. Frame: Terrorism Event: Attack Event: Discussion hold, meeting, talk, dis- report, participate, kid- cuss, investigate nap, kill, release Slot: Perpetrator Slot: Victim P ER SON /ORG P ER SON /ORG Words: people, priest, Words: guerrilla, po- lice, source, person, leader, member, judge group Caseframes: report>nsubj, kidnap>nsubj, kill>nsubj, participate>nsubj, release>nsubj Caseframes: kill>dobj, murder>dobj, release>dobj, report>dobj, kidnap>dobj Figure 2: A partial frame learned by ProFinder from the MUC-4 data set, with the most probable emissions for each event and slot. Labels are assigned by the authors for readability. good recall but was hurt by the lower precision. We investigated the importance of document classifica- tion by only extracting from the gold-standard rele- vant documents (+doc. classification), which led to a substantial improvement in precision, suggesting possible further improvement by better document classification. Also unlike C&J, our system does not currently make use of coreference information. Figure 2 shows part of a frame that is learned by ProFinder, including some of the standard MUC slots and events. Our method also finds events not annotated in MUC, such as the discussion event. Other interesting events and slots that we noticed include an arrest event (call, arrest, express, meet, charge), a peace agreement slot (agreement, rights, law, proposal), and an authorities slot (police, gov- (a) Accidents and Natural Disasters: WHAT: what happened WHEN: date, time, other temporal markers WHERE: physical location WHY: reasons for accident/disaster WHO AFFECTED: casualties... DAMAGES: ... caused by the disaster COUNTERMEASURES: rescue efforts... (WH EN During the night of July 17,) (WHAT a 23-foot <WHAT tsunami) hit the north coast of Papua New Guinea (PNG)>, (WHY triggered by a 7.0 undersea earth- quake in the area). (c) WH EN: night WHY: earthquake WHAT: tsunami, coast (b) Figure 3: An example of (a) a frame from the TAC Guided Summarization task with abbreviated slot de- scriptions, (b) an annotated TAC contributor, and (c) the entities that are extracted for evaluation. ernment, force, command). The background frame was able to capture many verbs related to report- ing, such as say, continue, add, believe, although it missed report. 5 Evaluating Frame Induction Using Guided Summarization Templates One issue with the MUC-4 evaluation is the lim- ited variety of templates and entities that are avail- able. Moreover, this data set was specifically de- veloped for information extraction and questions re- main whether our approach can generalize beyond it. We thus conducted a novel evaluation using the TAC guided summarization data set, which contains a wide variety of frames and topics. Our evalua- tion corresponds to a view of summarization as ex- tracting structured information from the source text, and highlights the connection between summariza- tion and information extraction (White et al., 2001). Data preparation We use the TAC 2010 guided summarization data experiments for our set (Owczarzak and Dang, 2010). This data set pro- vides templates as defined by the task organizers and contains 46 document clusters in five domains, with each cluster comprising 20 documents on a specific topic. Eight human-written model sum- maries are provided for each document cluster. As part of the Pyramid evaluation method (Nenkova and Passonneau, 2004), these summaries have been manually segmented and labeled with slots from the corresponding template for each segment (Figure 3)4 . We first considered defining the task as extract- ing entities from the source text, but this annotation is not available in TAC, and pilot studies suggested that it required nontrivial effort to train average users to conduct high-quality annotation reliably. We thus defined our task as extracting entities from the model summaries instead. As mentioned earlier, TAC slot annotation is available for summaries. Furthermore, using the summary text has the advantage that slots that are considered important in the domain natu- rally appear more frequently, whereas unimportant text is filtered out. Each span that is labeled by a slot is called a con- tributor. We convert the contributors into a form that is more like the previous MUC evaluation, so that we can fairly compare against previous work like C&J that were designed to extract information into that form. Specifically, we extract the head lemma from all the maximal noun phrases found in the contrib- utor. Like in MUC-4, we count a system-extracted noun phrase as a match if this head word matches and is extracted from the same document (i.e., sum- mary). This process can lead to noise, as the mean- ing of some contributors depend on a larger phrasal unit than a noun phrase, but this heuristic normal- izes the representations of the contributors so that they are amenable to our evaluation. We leave the denoising of this process to future work, and believe it should be feasible by crowdsourcing. Method and experiments The induced entity clusters are mapped to the TAC slots in the TAC frames according to the best F1 achieved for each TAC slot. However, one issue is that many TAC slots are more general than the type of slots found in MUC. For example, slots like WHY and COUN - TERM EA SUR E S likely correspond to multiple slots at the granularity of MUC. Thus, we map the N -best induced slots to TAC slots rather than the 1-best, for 4The at http: available is slots of set full //www.nist.gov/tac/2010/Summarization/ Guided-Summ.2010.guidelines.html 1-to-1 Systems P R 25 ProFinder 24 58 C&J 6.1 5-to-1 F1 P R F1 27 38 24 21 50 11 12 20 Table 2: Results on TAC 2010 entity extraction with N - to-1 mapping for N = 1 and N = 5. Intermediate values of N produce intermediate results, and are not shown for brevity. N up to 5. We train ProFinder and a reimplemen- tation of C&J on the 920 full source texts of TAC 2010, and test them on the 368 model summaries. We do not provide C&J’s model with access to ex- ternal data, in order to create fair comparison con- ditions to our model. We also eliminate a sentence relevance classification step from C&J, and the doc- ument relevance classification step from both mod- els, because all sentences in the summary text are expected to be relevant. We tune C&J’s clustering thresholds and the parameters to our model by two- fold cross validation on the summaries, and assume gold summary classification into the five topic cate- gories defined by TAC. Results The results on TAC are shown in Table 2. The overall results are poorer than for the MUC-4 task, but this task is harder given the greater diversity in frames and slots to be induced. Like in the pre- vious evaluation, our system is able to outperform C&J in terms of recall and F1 , but not precision. C&J’s method produces many small clusters, which makes it easy to achieve high precision. The N -to-1 mapping procedure can also be seen to favor their method over ours, many small clusters with high precision can be selected to greatly improve recall, which is indeed the case. However, ProFinder with 1-to-1 mapping outperforms C&J even with 5- to-1 mapping. 6 Conclusion We have presented the first probabilistic approach to frame induction and shown that it achieves state- of-the-art results on end-to-end entity extraction in standard MUC and TAC data sets. Our model is in- spired by recent advances in unsupervised seman- tic induction and in content modeling in summariza- tion, and is easy to extend. We would like to further investigate frame induction evaluation, for example to evaluate event clustering in addition to the slots and entities. Acknowledgments We would like to thank Nate Chambers for answer- ing questions about his system. We would also like to thank Chris Quirk for help with preprocessing the MUC corpus, and the other members of the NLP group at Microsoft Research for useful discussions. References [Baker et al.1998] Collin F. Baker, Charles J. Fillmore, and John B. Lowe. 1998. The Berkeley FrameNet project. In Proceedings of the 17th International Con- ference on Computational linguistics. [Banko and Etzioni2008] Michele Banko and Oren Et- zioni. 2008. The tradeoffs between open and tra- ditional relation extraction. Proceedings of ACL-08: HLT, pages 28–36. [Barzilay and Lee2004] Regina Barzilay and Lillian Lee. 2004. Catching the drift: Probabilistic content mod- els, with applications to generation and summariza- In Proceedings of the Human Language Tech- tion. nology Conference of the North American Chapter of the Association for Computational Linguistics: HLT- NAACL 2004. [Bean and Riloff2004] David Bean and Ellen Riloff. 2004. Unsupervised learning of contextual role knowledge for coreference resolution. In Proceedings of the Human Language Technology Conference of the North American Chapter of the Association for Com- putational Linguistics: HLT-NAACL 2004. [Chambers and Jurafsky2008] Nathanael Chambers and Dan Jurafsky. 2008. Unsupervised learning of nar- rative event chains. In Proceedings of ACL-08: HLT, pages 789–797, Columbus, Ohio, June. Association for Computational Linguistics. [Chambers and Jurafsky2009] Nathanael Chambers and Dan Jurafsky. 2009. Unsupervised learning of nar- rative schemas and their participants. 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. Associa- tion for Computational Linguistics. [Chambers and Jurafsky2011] Nathanael Chambers and Dan Jurafsky. 2011. Template-based information ex- traction without the templates. In Proceedings of the 49th Annual Meeting of the Association for Compu- tational Linguistics: Human Language Technologies, pages 976–986, Portland, Oregon, USA, June. Associ- ation for Computational Linguistics. [Cheung and Li2012] Jackie C. K. Cheung and Xiao Li. 2012. Sequence clustering and labeling for unsuper- In Proceedings of the vised query intent discovery. 5th ACM International Conference on Web Search and Data Mining, pages 383–392. [Curran et al.2007] James R. Curran, Tara Murphy, and Bernhard Scholz. 2007. Minimising semantic drift with mutual exclusion bootstrapping. In Proceedings of the 10th Conference of the Pacific Association for Computational Linguistics. [Daum ´e III and Marcu2006] Hal Daum ´e III and Daniel Marcu. 2006. Bayesian Query-Focused summariza- tion. In Proceedings of the 21st International Confer- ence on Computational Linguistics and 44th Annual Meeting of the Association for Computational Linguis- tics, pages 305–312, Sydney, Australia, July. Associa- tion for Computational Linguistics. [Fillmore1982] Charles J. Fillmore. 1982. Frame seman- tics. Linguistics in the Morning Calm, pages 111–137. [Graff et al.2005] David Graff, Junbo Kong, Ke Chen, and Kazuaki Maeda. 2005. English gigaword second edi- tion. Linguistic Data Consortium, Philadelphia. [Gruber et al.2007] Amit Gruber, Michael Rosen-Zvi, and Yair Weiss. 2007. Hidden topic markov models. Artificial Intelligence and Statistics (AISTATS). [Haghighi and Vanderwende2009] Aria Haghighi and Lucy Vanderwende. 2009. Exploring content models In Proceedings for multi-document summarization. of Human Language Technologies: The 2009 Annual Conference of the North American Chapter of the Association for Computational Linguistics, pages 362–370, Boulder, Colorado, June. Association for Computational Linguistics. [Huang and Riloff2012] Ruihong Huang and Ellen Riloff. 2012. Bootstrapped training of event extraction classi- fiers. In Proceedings of the 13th Conference of the Eu- ropean Chapter of the Association for Computational Linguistics, pages 286–295, Avignon, France, April. Association for Computational Linguistics. [Lang and Lapata2011] Joel Lang and Mirella Lapata. 2011. Unsupervised semantic role induction via split- merge clustering. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguis- tics: Human Language Technologies, pages 1117– 1126, Portland, Oregon, USA, June. Association for Computational Linguistics. [Liang and Klein2009] Percy Liang and Dan Klein. 2009. Online EM for unsupervised models. In Proceedings of Human Language Technologies: The 2009 Annual Conference of the North American Chapter of the As- sociation for Computational Linguistics, pages 611– [Swier and Stevenson2004] Robert S. Swier and Suzanne Stevenson. 2004. Unsupervised semantic role la- belling. In Dekang Lin and Dekai Wu, editors, Pro- ceedings of EMNLP 2004, pages 95–102, Barcelona, Spain, July. Association for Computational Linguis- tics. [White et al.2001] Michael White, Tanya Korelsky, Claire Cardie, Vincent Ng, David Pierce, and Kiri Wagstaff. 2001. Multidocument summarization via informa- In Proceedings of the First Interna- tion extraction. tional Conference on Human Language Technology Research. Association for Computational Linguistics. 619, Boulder, Colorado, June. Association for Com- putational Linguistics. [Minsky1974] Marvin Minsky. 1974. A framework for representing knowledge. Technical report, Cam- bridge, MA, USA. [muc1992] 1992. Proceedings of the Fourth Message Understanding Conference (MUC-4). Morgan Kauf- mann. [Nenkova and Passonneau2004] Ani Nenkova and Re- becca Passonneau. 2004. Evaluating content selection in summarization: The pyramid method. In Proceed- ings of the Human Language Technology Conference of the North American Chapter of the Association for Computational Linguistics: HLT-NAACL 2004, vol- ume 2004, pages 145–152. [Owczarzak and Dang2010] Karolina Owczarzak and Hoa T. Dang. 2010. TAC 2010 guided summarization task guidelines. [Patwardhan and Riloff2007] Siddharth Patwardhan and Ellen Riloff. 2007. Effective information extrac- tion with semantic affinity patterns and relevant re- In Proceedings of the 2007 Joint Conference gions. on Empirical Methods in Natural Language Process- ing and Computational Natural Language Learning (EMNLP-CoNLL), pages 717–727, Prague, Czech Re- public, June. Association for Computational Linguis- tics. [Petrov et al.2006] Slav Petrov, Leon Barrett, Romain Thibaux, and Dan Klein. 2006. Learning accurate, In Pro- compact, and interpretable tree annotation. ceedings of the 21st International Conference on Com- putational Linguistics and 44th Annual Meeting of the Association for Computational Linguistics. [Poon and Domingos2009] Hoifung Poon and Pedro Domingos. 2009. Unsupervised semantic parsing. In Proceedings of the 2009 Conference on Empirical Methods in Natural Language Processing, pages 1–10. Richardson, [Richardson et al.1998] Stephen D. William B. Dolan, and Lucy Vanderwende. 1998. MindNet: Acquiring and structuring semantic in- In Proceedings of the 36th formation from text. Annual Meeting of the Association for Computational Linguistics and 17th International Conference on Computational Linguistics, Volume 2, pages 1098– 1102, Montreal, Quebec, Canada, August. Association for Computational Linguistics. [Rumelhart1975] David Rumelhart, 1975. Notes on a schema for stories, pages 211–236. Academic Press, Inc. [Schank and Abelson1977] Roger C. Schank and Robert P. Abelson. 1977. Scripts, Plans, Goals, and Understanding: An Inquiry Into Human Knowledge Structures. Lawrence Erlbaum, July.
1612.06139
1
1612
2016-12-19T11:50:58
Neural Machine Translation from Simplified Translations
[ "cs.CL" ]
Text simplification aims at reducing the lexical, grammatical and structural complexity of a text while keeping the same meaning. In the context of machine translation, we introduce the idea of simplified translations in order to boost the learning ability of deep neural translation models. We conduct preliminary experiments showing that translation complexity is actually reduced in a translation of a source bi-text compared to the target reference of the bi-text while using a neural machine translation (NMT) system learned on the exact same bi-text. Based on knowledge distillation idea, we then train an NMT system using the simplified bi-text, and show that it outperforms the initial system that was built over the reference data set. Performance is further boosted when both reference and automatic translations are used to learn the network. We perform an elementary analysis of the translated corpus and report accuracy results of the proposed approach on English-to-French and English-to-German translation tasks.
cs.CL
cs
Neural Machine Translation from Simplified Translations Josep Crego and Jean Senellart [email protected] SYSTRAN / 5 rue Feydeau, 75002 Paris, France 6 1 0 2 c e D 9 1 ] L C . s c [ 1 v 9 3 1 6 0 . 2 1 6 1 : v i X r a Abstract Text simplification aims at reducing the lexical, grammatical and structural com- plexity of a text while keeping the same meaning. In the context of machine trans- lation, we introduce the idea of simpli- fied translations in order to boost the learn- ing ability of deep neural translation mod- els. We conduct preliminary experiments showing that translation complexity is ac- tually reduced in a translation of a source bi-text compared to the target reference of the bi-text while using a neural machine translation (NMT) system learned on the exact same bi-text. Based on knowledge distillation idea, we then train an NMT system using the simplified bi-text, and show that it outperforms the initial system that was built over the reference data set. Performance is further boosted when both reference and automatic translations are used to learn the network. We perform an elementary analysis of the translated cor- pus and report accuracy results of the pro- posed approach on English-to-French and English-to-German translation tasks. 1 Introduction Neural machine translation (NMT) has recently achieved state-of-the-art results in several transla- tion tasks (Bojar et al., 2016) and for various lan- guage pairs. Its conceptual simplicity has attracted many researchers as well as a growing number of private entities that have begun to include NMT engines in their production systems. NMT networks are directly learned from paral- lel bi-texts, consisting of large amounts of human sentences together with their corresponding trans- lations. Even if all translations in a bi-text are con- sidered suitable, i.e. the meaning is preserved and the target language is fully correct, there is a large variability in these translations: in some cases the translations follow a more or less word-for-word pattern (literal translations), while in many others the translations are showing greater latitude of ex- pression (free translations). A good human trans- lation is often judged by this latitude of expres- sions. In contrast, machine translations are usu- ally "closer", in terms of syntactic structure and even word choices, to the input sentences. Hence, even when the translation output is very good, these translations are still generally closer to lit- eral translations because "free translations" are by definition more complicated and less easy to learn and model. It is also a rather intuitive idea that feeding more literal translation to a neural trans- lation engine training should facilitate the training process compared to same training with less literal translations. We report preliminary results of experiments where we automatically simplify a human transla- tion bi-text which is then used to train neural trans- lation engines. Thus, boosting the learning ability of neural translation models and we show that the resulting models are performing even better than a neural translation engine trained on the refer- ence dataset. The remaining of this paper is struc- tured as follows. Section 2 briefly surveys previ- ous work. Section 3 outlines our neural MT en- gine. Section 4 details the simplification approach presented in this paper. Section 5 reports experi- mental results and section 6 draws conclusion and proposes further work. 2 Related Work A neural encoder-decoder model performing text simplification at lexical and syntactic levels is re- ported in (Wang et al., 2016). The work intro- duces a model for text simplification. However, it differs from our work in that we use a neu- ral MT engine to simplify translations, which are further used to boost translation performance, while their end goal is text simplification. In (de Gispert et al., 2015), a phrase-based SMT sys- tem is presented that employs as preprocessing module a neural network that models source- side preordering, aiming at finding a permuta- tion of the source sentence that matches the tar- get sentence word order. Also, with the objec- tive of simplifying the translation task. The work by (Niehues et al., 2016) presents a technique to combine phrase-based and neural MT. The phrase- based system is initially used to produce a first hypothesis which is then considered together with the input sentence by a neural MT engine to pro- duce the final hypothesis. The authors claim that the combined approach shows the strength of both approaches, namely fluent translations and the ability to translate rare words. In this work we have used one of the knowledge distillation techniques detailed by (Kim and Rush, 2016) where the authors train a smaller student network to perform better by learning from a larger teacher network allowing to build more compact neural MT models. With a similar objective, (Hinton et al., 2015) claim that distillation works well for transferring knowledge from an ensemble or from a large highly regu- larised model into a smaller, distilled model. 3 Neural MT Our NMT system follows the architecture pre- sented in (Bahdanau et al., 2014). It is imple- mented as an encoder-decoder network with multi- ple layers of a RNN with Long Short-Term Mem- ory hidden units (Zaremba et al., 2014). The encoder is a bidirectional neural network that reads an input sequence s = (s1, ..., sJ ) and calculates a forward sequence of hidden −→ −→ states ( hJ ), and a backward sequence h1, ..., ←− ←− hJ ). The decoder is a RNN that predicts a ( h1, ..., target sequence t = (t1, ..., tI ), being J and I re- spectively the source and target sentence lengths. Each word ti is predicted based on a recurrent hid- den state hi, the previously predicted word ti−1, and a context vector ci. We employ the atten- tional architecture from (Luong et al., 2015). The framework is available on the open-source project seq2seq-attn1. Additional details are given in (Crego et al., 2016). 4 Translation Simplification Translation simplification is based on the idea that any sentence may have multiple translations, all being equally suitable. Following this idea, and despite the fact that deep neural networks have achieved excellent performance on many difficult tasks, we are interested in keeping the translation task as simple as possible. Hence, for a training bi-text we are interested in translations having a similar structure as source sentences. The follow- ing example shows an English sentence translated into two distinct French sentences: This deficiency discourages the practice. ⇓ Ce défaut a un effet dissuasif sur la pratique. Cette insuffisance décourage la pratique. Both French translations are suitable. However, the last French translation is closer in terms of sen- tence structure to its English counterpart. Producing "close" translations is the natural be- haviour of Machine Translation systems. Hence, we use a neural MT system to simplify a trans- lation bi-text. Similar to knowledge distillation, target language simplification is performed in 3 steps: 1. train a teacher model with reference transla- tions, 2. run beam search over the training set with the teacher model, 3. train the student network on this new dataset. In the next Section, we analyse the training data translated by beam search following step (2) using the models built in step (1). 4.1 Translated Language Analysis Based on the NMT system outlined in Section 3 and following the language simplification method previously outlined, we train English-to-French and English-to-German teacher networks as de- tailed in Section 5.1. Using such teacher mod- els we translate the English-side of both training sets producing respectively German and French translation hypotheses. Aiming for a better un- derstanding of the translated languages we con- duct an elementary human analysis of the French 1http://nlp.seas.harvard.edu and German hypotheses. We mainly observe that in many cases, translation hypotheses produced by the teacher systems consist of paraphrases of the reference translations. Such hypotheses are closer in terms of syntactic structure to the source sentences than reference translations. Examples in Table 1 illustrate this fact. While both, Ref and Hyp translations can be considered equally good, Hyp translations are syntactically closer to the source sentence. In the first example, the ref- erence translation replaces the verb receiving with the action of communicating, hence subject and in- direct objects are switched. In the second example several rephrasings are observed: [Si cette ratifi- cation n'a pas lieu ∼ En l'absence d'une telle rat- ification] and finally [la commission devrait être invitée ∼ il y aurait lieu d'inviter la commission]. In both examples meaning is fully preserved and both sentences are naturally good. We conduct several experiments in order to con- firm that translated hypotheses are closer to the in- put sentence than reference translations. We first measure the difference in length of Hyp and Ref translations with respect to the original source sen- tences S. Figure 1 shows the histogram for the English-to-French train set. The number of target sentences T with similar length than source sen- tences S is higher for translated hypotheses T = Hyp than for reference translations T = Ref . ments, we compute for each source word si the number of alignment crossings between the given source word and the rest of the source words. We consider that two alignments (i, j) and (i′, j ′) are crossed if (i − i′) ∗ (j − j ′) < 0. Figure 2 plots the difference in number of crossed alignments be- tween source-to-Hyp and source-to-Ref. As it can be seen, the source-to-hyp pair has a higher num- ber of non-crossed alignments (near 4%), while the number of words with crossed alignments is higher for the source-to-Ref pair. Statistics were computed over the same number of source words for both train pairs. Notice that translated hypothe- ses hyp are automatically generated. Hence, carry- ing an important number of translation errors that cannot be neglected. The next Section evaluates the suitability of source-to-hyp translations as a train set for our neural MT systems compared to source-to-ref translations. % 4 3.5 3 2.5 2 1.5 1 0.5 0 -0.5 -1 • • 1 • 2 • 3 0 • 4 • 5 • 6 • 7 • 8 • 9 Number of crossed alignments T = Hyp T = Ref ∗ • Figure 2: Difference in number of crossed align- ments between machine and reference transla- tions. 16 14 12 10 8 6 4 % 2 • ∗ ∗ ∗ ∗ ∗ ∗ ∗ • • • • • • 0 -10 -5 ∗ • ∗ • • ∗ ∗ ∗ • • ∗ • ∗ • • ∗ • ∗ • ∗ • ∗ • ∗ • ∗ • • • • • • • • • • • ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ 10 0 20 length(T ) − length(S) 15 5 Figure 1: English-to-French train set histogram representing difference in length between source S and target T sentences. Additionally, we compare the number of crossed alignments2 on both language pairs (source-to-Hyp and source-to-Ref) in order to val- idate the closeness (similarity) of syntactic struc- tures. Given a sentence pair with its set of align- 2word alignments computed using https://github.com/clab/fast_align 5 Experiments We evaluate the presented approach on English-to- French and English-to-German translation. 5.1 Training Details Experiments are performed using data made avail- able for the shared translation task of the WMT3. Corpora is initially filtered using standard tech- niques to discard noisy translation examples. To- kenisation is also performed with an in-house toolkit, using standard token separators (spaces, tabs, etc.) as well as a set of language-dependent linguistic rules. Corpora was split into three sepa- rate sets, Train, Validation and Test data sets. Fi- nally, a random subset of the entire training set is 3http://www.statmt.org/wmt16/ kept containing 1 million sentence pairs. Table 2 contains statistics for the data used in both transla- tion tasks. All experiments employ the NMT sys- tem detailed in Section 3 on our NVidia GeForce GTX 1080. We keep the most frequent 50, 000 words for source and target vocabularies with a word embedding size of 500 cells. During training we use stochastic gradient descent, a mini-batch size of 64 with dropout probability set to 0.3 and bidirectional RNN. We train our models for 18 epochs. Learning rate is set to 1 and start decay after epoch 10 by 0.5. For decoding, we always use a beam size of 5. En De En Fr 1M 1M 25.7M 25.2M 24.4M 27.6M 151k 224k 196k 249k 2,000 2,000 50.4k 9,837 208 48.9k 8,168 169 55.6k 8,773 202 51.2k 7,183 120 Train Lines Words Vocab. Validation Lines Words Vocab. OOV Test-intern Lines 52.3k Words 7,232 Vocab. 107 OOV newstest2014 Lines Words Vocab. OOV 69.7k 9,912 1,597 2,000 2,000 51.3k 8,868 195 48.2k 8,199 203 54.7k 8,623 222 3,003 3,003 86.9k 11,183 956 72.2k 9,978 856 70.1k 12,683 1,761 Table 2: Statistics of Train, Validation and Test data sets of English-to-German and English-to- French. M and k stand for millions and thousands. 5.2 Results Table 3 summarises translation accuracy re- sults.The first two rows of each translation task show teacher networks built using respectively 2 and 4 layers. Using 4 layers obtains slightly bet- ter results for the English-to-German task while no difference is observed for the French-to-English task. On the third row we see accuracy results of student networks, built by distillation of the net- works in the second row. Note that student net- works were built using half the number of lay- ers than their corresponding teacher networks. Fi- nally the last row show accuracies of networks built using both, reference (R) and automatic (A) translations. Note that this last configuration em- ploys double the number of training sentences than previous ones. Student networks outper- form their corresponding teacher networks in all cases. Difference in BLEU (Papineni et al., 2002) scores between student and teacher configurations are shown in parentheses. Performance is further boosted when using both reference and hypothesis translations to train the networks. Layers Data English-to-German R R A 2 x 800 4 x 800 2 x 800 R+A 4 x 800 English-to-French Test-intern newstest2014 33.05 33.40 33.91 (+0.51) 34.59 (+1.19) 19.25 19.40 20.26 (+0.86) 21.84 (+2.44) R R A 2 x 1000 4 x 1000 2 x 1000 R+A 4 x 1000 53.67 53.78 54.47 (+0.69) 55.24 (+1.46) 32.15 32.13 32.85 (+0.72) 33.47 (+1.34) Table 3: BLEU scores over Test-intern and new- stest2014 sets of both translation tasks according to different network configurations. BLEU scores were calculated using multi-bleu.perl. 6 Conclusions We have presented translation simplification ex- periments for neural machine translation. Results indicate the suitability of using simplified transla- tions to train neural MT systems. Higher accuracy results are obtained by the systems trained using simplified data. Further experiments need to be carried out to validate the presented approach on additional language pairs and under different data size conditions. Acknowledgments We would like to thank Yoon Kim and Prof. Alexander Rush for their valuable insights with knowledge distillation experiments. References [Bahdanau et al.2014] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. 2014. Neural machine translation by jointly learning to align and trans- late. CoRR, abs/1409.0473. Demoed at NIPS 2014: http://lisa.iro.umontreal.ca/mt-demo/. [Bojar et al.2016] Ondrej Bojar, Yvette Graham, Amir Kamran, and Miloš Stanojevi´c. 2016. Results of the wmt16 metrics shared task. In Proceedings of the First Conference on Machine Translation, Berlin, Germany, August. [Crego et al.2016] Josep Crego, Jungi Kim, Guillaume Klein, Anabel Rebollo, Kathy Yang, Jean Senel- lart, Egor Akhanov, Patrice Brunelle, Aurelien Co- quard, Yongchao Deng, Satoshi Enoue, Chiyo Geiss, Joshua Johanson, Ardas Khalsa, Raoum Khiari, Byeongil Ko, Catherine Kobus, Jean Lorieux, Leid- iana Martins, Dang-Chuan Nguyen, Alexandra Pri- ori, Thomas Riccardi, Natalia Segal, Christophe Ser- van, Cyril Tiquet, Bo Wang, Jin Yang, Dakun Zhang, Jing Zhou, and Peter Zoldan. 2016. Systran's pure neural machine translation systems. CoRR, abs/1610.05540. [de Gispert et al.2015] Adrià de Gispert, Gonzalo Igle- sias, and Bill Byrne. 2015. Fast and accurate pre- ordering for smt using neural networks. In Proceed- ings of the 2015 Conference of the North Ameri- can Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1012 -- 1017, Denver, Colorado, May -- June. Associa- tion for Computational Linguistics. [Hinton et al.2015] G. Hinton, O. Vinyals, and J. Dean. 2015. Distilling the Knowledge in a Neural Net- work. ArXiv e-prints, March. [Kim and Rush2016] Y Kim and Alexander M. Rush. 2016. Sequence-level knowledge distillation. Pro- ceedings of the 2016 Conference on Empirical Meth- ods in Natural Language Processing, pages 1317 -- 1327, November. [Luong et al.2015] Thang Luong, Hieu Pham, and Christopher D. Manning. Effective ap- proaches to attention-based neural machine trans- lation. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Process- ing, pages 1412 -- 1421, Lisbon, Portugal, September. Association for Computational Linguistics. 2015. [Niehues et al.2016] Jan Niehues, Eunah Cho, Thanh- Le Ha, and Alex Waibel. 2016. Pre-translation for neural machine translation. To appear in Proceed- ings of COLING 2016, the 27th International Con- ference on Computational Linguistics, pages 1828 -- 1836, December. [Papineni et al.2002] Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002. Bleu: A method for automatic evaluation of machine trans- lation. In Proceedings of the 40th Annual Meeting on Association for Computational Linguistics, ACL '02, pages 311 -- 318, Stroudsburg, PA, USA. Associ- ation for Computational Linguistics. [Wang et al.2016] Tong Wang, Chen, Kevin Michael Amaral, and Jipeng Qiang. 2016. An experimental study of LSTM encoder- decoder model for text simplification. CoRR, abs/1609.03663. Ping [Zaremba et al.2014] Wojciech Ilya Sutskever, and Oriol Vinyals. 2014. Recurrent neu- ral network regularization. CoRR, abs/1409.2329. Zaremba, [Le Danemark et le Kazakhstan]subj ont communiqué leurs vues au [Secrétaire général]ind. [Le Secrétaire général]ind a reçu les vues du [Danemark et du Kazakhstan]subj . If this ratification does not take place , the Commission should be called. Src: The Secretary-General has received views from Denmark and Kazakhstan. Ref: Hyp Src: Ref: En l'absence d'une telle ratification , il y aurait lieu d'inviter la Commission. Hyp: Si cette ratification n'a pas lieu , la Commission devrait être invitée. Table 1: Examples of English-to-French translation simplification.
1808.04961
5
1808
2019-09-15T19:18:13
Putting the Horse Before the Cart:A Generator-Evaluator Framework for Question Generation from Text
[ "cs.CL" ]
Automatic question generation (QG) is a useful yet challenging task in NLP. Recent neural network-based approaches represent the state-of-the-art in this task. In this work, we attempt to strengthen them significantly by adopting a holistic and novel generator-evaluator framework that directly optimizes objectives that reward semantics and structure. The {\it generator} is a sequence-to-sequence model that incorporates the {\it structure} and {\it semantics} of the question being generated. The generator predicts an answer in the passage that the question can pivot on. Employing the copy and coverage mechanisms, it also acknowledges other contextually important (and possibly rare) keywords in the passage that the question needs to conform to, while not redundantly repeating words. The {\it evaluator} model evaluates and assigns a reward to each predicted question based on its conformity to the {\it structure} of ground-truth questions. We propose two novel QG-specific reward functions for text conformity and answer conformity of the generated question. The evaluator also employs structure-sensitive rewards based on evaluation measures such as BLEU, GLEU, and ROUGE-L, which are suitable for QG. In contrast, most of the previous works only optimize the cross-entropy loss, which can induce inconsistencies between training (objective) and testing (evaluation) measures. Our evaluation shows that our approach significantly outperforms state-of-the-art systems on the widely-used SQuAD benchmark as per both automatic and human evaluation.
cs.CL
cs
A Generator-Evaluator Framework for Question Generation from Text Putting the Horse Before the Cart: Vishwajeet Kumar1,2,3, Ganesh Ramakrishnan2, and Yuan-Fang Li3 1IITB-Monash Research Academy, Mumbai, India 2IIT Bombay, Mumbai, India 3Monash University, Melbourne, Australia 9 1 0 2 p e S 5 1 ] L C . s c [ 5 v 1 6 9 4 0 . 8 0 8 1 : v i X r a Abstract Automatic question generation (QG) is a use- ful yet challenging task in NLP. Recent neural network-based approaches represent the state- of-the-art in this task. In this work, we attempt to strengthen them significantly by adopting a holistic and novel generator-evaluator frame- work that directly optimizes objectives that re- ward semantics and structure. The generator is a sequence-to-sequence model that incorpo- rates the structure and semantics of the ques- tion being generated. The generator predicts an answer in the passage that the question can pivot on. Employing the copy and coverage mechanisms, it also acknowledges other con- textually important (and possibly rare) key- words in the passage that the question needs to conform to, while not redundantly repeat- ing words. The evaluator model evaluates and assigns a reward to each predicted ques- tion based on its conformity to the structure of ground-truth questions. We propose two novel QG-specific reward functions for text conformity and answer conformity of the gen- erated question. The evaluator also employs structure-sensitive rewards based on evalua- tion measures such as BLEU, GLEU, and ROUGE-L, which are suitable for QG. In con- trast, most of the previous works only optimize the cross-entropy loss, which can induce in- consistencies between training (objective) and testing (evaluation) measures. Our evaluation shows that our approach significantly outper- forms state-of-the-art systems on the widely- used SQuAD benchmark as per both automatic and human evaluation. Introduction 1 Automatic question generation (QG) is a very im- portant yet challenging problem in NLP. It is de- fined as the task of generating syntactically cor- rect, semantically sound and relevant questions from various input formats such as text, a struc- tured database or a knowledge base (Mannem et al., 2010). More recently, neural network based techniques such as sequence-to-sequence (Seq2Seq) learning have achieved remarkable suc- cess on various NLP tasks, including question generation. A recent deep learning approach to question generation (Serban et al., 2016) in- vestigates a simpler task of generating questions only from a triplet of subject, relation and ob- ject. Learning to ask (referred to as L2A here- inafter) (Du et al., 2017) proposes a Seq2Seq model with attention for question generation from text. (Song et al., 2018) (in an approach re- ferred to as NQGLC hereafter) encoded ground- truth answers and employed bi-directional LSTMs in a Seq2Seq setting. In addition, they use the copy mechanism (See et al., 2017) and context matching to capture interactions between the given ground-truth answer and its context within the pas- sage. In the context of QG from paragraphs, (Zhao et al., 2018) proposed maxout pointer network to keep track of word coverage. Our previous work (Kumar et al., 2018) (referred to as AutoQG here- inafter) generates candidate answers from text us- ing Pointer Networks (Vinyals et al., 2015) and en- codes the answer in the question decoder for im- proved performance. We first present a framework in which a gen- erator mechanism (the horse) that is employed for generating a question-answer pair invokes or pulls the evaluator mechanism (the cart) that is employed for evaluating the generated pair. Our clearly delineated generator-evaluator framework lets us (a) easily incorporate several best practices from the above referred previous models in the generator while (b) also letting us employ in the evaluator, other complex non-decomposable re- wards that are consistent with performance mea- sures (such as BLEU and ROUGE) on test data. We also propose some novel reward functions that evaluate the syntax of the question and semantics of the question-answer pair in its entirety. More specifically, since the generated question is in an- ticipation of some specific answer, we find it most natural to incorporate candidate answer genera- tion (using Pointer Networks) alongside QG right in our generator module, so that the evaluator can optionally take into cognizance the conformity of the generated answer to the ground-truth an- swer, along with text conformity. Likewise, we also incorporate copy and coverage mechanisms for QG into the generator module so that they can be specifically trained by leveraging a suite of holistically designed and structure-sensitive re- ward functions in the evaluator module. The Generator In Table 1, in rows 1 through 4, we illustrate through examples, the incremental benefits of in- troducing answer prediction and the copy and cov- erage mechanisms (See et al., 2017) in the genera- tor. The evaluator associated with the correspond- ing three generator models employs the conven- tional and simplistic cross-entropy loss. The moti- vation for answer prediction in the generator mod- ule is obvious and will be further discussed in Sec- tion 2.1. In row 3 we illustrate the influence of our copy mechanism, where a rare phrase 'new ams- terdam' has been rightly picked up in association with the name of the city. We however note that the word 'new' has been erroneously repeated twice, since an encoder-decoder based model could generate questions with meaningless repetitions. in row 3, We introduce a mechanism for discouraging such repetitions in our generator by quantitatively emphasizing the coverage of sentence words while decoding. Row 4 shows the improved and relevant question generated by our model trained by incor- porating both the copy and coverage mechanisms. Evaluator In row 5 of Table 1, we observe the high-quality question that is generated when the simplistic cross-entropy loss in the evaluator is replaced with the more complex and non-decomposable (across words) BLEU reward that accounts for proximity of 'founded' to 'new york'. In Table 2, we further illustrate the effect of em- ploying other reward functions (described in Sec- tion 2.2) in the evaluator. As can be seen, the model that incorporates QG-specific reward func- tions (QSS and ANSS) generates a significantly better question when compared to the question generated without these rewards. Limitations of simple decomposable losses: A Seq2Seq model trained using a vanilla cross- entropy loss function (decomposable over words in the question) generates the question "what year was new york named ?" (row 1 in Table 1), which is not addressed in the sentence. The passage talks only about the founding of the city and its naming two years later. The inaccuracy of the question is possibly caused by the use of a loss that is agnos- tic to sequence information. In other words, given its decomposable nature, the cross-entropy loss on the ground-truth question or any of its (syntacti- cally invalid) anagrams will be the same. More- over, use of the cross-entropy loss in the sequence prediction model could make the process brittle, since the model trained on a specific distribution over words is used on a test dataset with a possi- bly different distribution to predict the next word given the current predicted word. This creates ex- posure bias (Ranzato et al., 2015) during training, since the model is only exposed to the data dis- tribution and not the model distribution. Thus, performance suffers due to inadequately evaluat- ing the structure of the generated question against the ground-truth question. The standard metrics for evaluating the per- formance of question generation models such as BLEU (Papineni et al., 2002), GLEU, and ROUGE-L (Lin, 2004) are based on degree of n- gram overlaps between a generated question and the ground-truth question. It would be desir- able to be able to directly optimize these task- specific metrics. However, these n-gram based metrics do not decompose over individual words and are therefore hard to optimize. We explic- itly employ an evaluator that rewards each gen- erated question based on its conformance to one (or more than one using decomposable attention) questions in the ground-truth set using these pos- sibly non-decomposable reward functions. We find such learning to be a natural instance of rein- forcement learning (RL) (Sutton and Barto, 1998) that allows us to use policy gradient to directly optimize task-specific rewards (such as BLEU, GLEU and ROUGE-L), which are otherwise non- differentiable and hard to optimize. In Table 2 we illustrate questions generated using different reward functions. It can be observed that ques- Text: "new york city traces its roots to its 1624 founding as a trading post by colonists of the dutch republic and was named new amsterdam in 1626 ." Row Model 1 2 3 4 5 Seq2Seq model optimized on vanilla (cross entropy) loss without answer prediction Seq2Seq model optimized on vanilla (cross entropy) loss with answer prediction Copy aware Seq2Seq model Coverage and copy aware Seq2Seq model Seq2Seq model optimized on BLEU (using RL) Question generated in what 1624 did new york city traces its roots ? what year was new york named ? what year was new new amsterdam named ? in what year was new amsterdam named ? what year was new york founded ? Table 1: Sample text and questions generated using variants of our model. Text: "even with the five largest cities in sichuan suffering only minor damage from the quake , some estimates of the economic loss run higher than us $ 75 billion , making the earthquake one of the costliest natural disasters in chinese history ." Expected answer: five Row Model GEBLEU 1 GEBLEU+QSS+ANSS 2 GEDAS 3 GEDAS+QSS+ANSS 4 4 GEROUGE GEROUGE+QSS+ANSS what is the largest cities in sichuan ? 5 Question generated how much did it making for the earthquake of the economic ? how many largest cities in sichuan experience only minor damage from the quake ? how many cities were in sichuan ? how many largest cities in sichuan suffering only minor damage from the quake ? how much did the economic loss run in sichuan ? Table 2: Sample text and questions generated using different reward functions, with and without our new QG- specific rewards QSS+ANSS. tions generated using combination of standard re- ward functions with reward functions specific to QG quality (QSS+ANSS) exhibit higher quality. Contributions We summarize our main contri- butions as follows: • A comprehensive, end-to-end generator- evaluator framework naturally suited for automated question generation. Whereas earlier approaches employ some mechanism (the horse) for generating the question, in- tertwined with an evaluation mechanism (the cart), we show that these approaches can ben- efit from a much clearer separation of the generator of the question from its evaluator. • A generator founded on the semantics and structure of the question by (a) identify- ing target/pivotal answers (Pointer Network), (b) recognizing contextually important key- words in the answer (copy mechanism), and (c) avoiding redundancy (repeated words) in the question (coverage mechanism). • An evaluator that (a) directly optimizes for conformity to the structure of ground-truth sequences (BLEU, GLEU, etc.), and (b) matches against appropriate questions from a set of ground-truth questions (Decomposable Attention). • Novel reward functions that ensure that the generated question is relevant to the text and conforms to the encoded answer. When evaluated on the benchmark SQuAD dataset (Rajpurkar et al., 2016), our system considerably outperforms state-of-the-art question generation models (Du et al., 2017; Kumar et al., 2018; Song et al., 2018) in automatic and human evaluation. 2 Our Approach Our framework for question generation consists of a generator and an evaluator. From the reinforce- ment learning (RL) point of view, the generator is the agent and the generation of the next word is an action. The probability of decoding a word Pθ(word) gives a stochastic policy. On every to- ken that is output, an evaluator assigns a reward for the output sequence predicted so far using the cur- rent policy of the generator. Based on the reward assigned by the evaluator, the generator updates and improves its current policy. Let us denote the reward (return) at time step t by rt. The cumula- tive reward, computed at the end of the generated t=0 rt. The goal of our framework is to determine a generator sequence is represented by R = (cid:80)T ←− ht = −−→ ht−1) and Sentence Encoder: Each word in the input text is fed sequentially into the encoder along with its linguistic features as well as with the en- coded pivotal answer (identified by the bound- ary pointer network). Our encoder is a two-layer −→ bidirectional LSTM network, consisting of ←−− ←−−−−− −−−−−→ ht = ht−1), LST M2(xt, LST M2(xt, which generates a sequence of hidden states. Here −→ xt is the given input word at time step t, and ←− ht and ht are the hidden states at time step t for the forward and backward passes respectively. Question Decoder: Our question decoder is a single-layer LSTM network, initialized with the ←− state s = [ ht], which is concatenation of hid- den state from forward and backward passes. −→ ht; We also model the attention (Bahdanau et al., 2014) distribution over words in the source text. We calculate the attention (at i) over the ith source word as at i = sof tmax(et i), where et i = vttanh(Wehhi + Wshst + batt) (2) t = (cid:80) Here vt, Weh, Wsh and batt are model param- eters to be learned, and hi is the concatenation of forward and backward hidden states of the encoder. We use this attention at to generate i the context vector c∗ t as a weighted sum of en- coder hidden states: c∗ ihi. We further use the c∗ t vector to obtain a probability distribu- tion over the words in the vocabulary as: P = sof max(Wv[st, c∗ t ] + bv), where Wv and bv are model parameters. Thus during decoding, the probability of a word is P (qword). During the training process for each timestamp, the loss is calculated as Lt = − log P (qwordt). The loss associated with the generated question is: i at Loss = 1 T Lt = − 1 T log P (qwordt) t=0 (3) 2.1.1 The Copy and Coverage Mechanisms: The copy mechanism facilitates the copying of im- portant entities and words from the source sen- tence to the question. We calculate pcg ∈ [0, 1] as the decision of a binary classifier that determines whether to generate (sample) a word from the vo- cabulary or to copy the word directly from the in- i: put text, based on attention distribution at pcg = sigmoid(W T ehc∗ t + W T shst + Wxxt + bcg) (4) T(cid:88) t=0 T(cid:88) Figure 1: Our generator-evaluator framework for ques- tion generation. pcg is the probability which determines whether to copy a word from source text or sample it from vocabulary distribution. T(cid:88) (policy) that maximizes the expected return: LossRL(θ) = −EPθ(Y0:T X) rt(Yt; X, Y0:t−1) t=0 (1) where X is the current input and Y0:t−1 is the predicted sequence until time t − 1. This super- vised learning framework allows us to directly op- timize task-specific evaluation metrics (rt) such as BLEU. The generator is a sequence-to-sequence model, augmented with (i) an encoding for the potentially best pivotal answer, (ii) the copy mechanism (Gu et al., 2016) to help generate contextually impor- tant words, and (iii) the coverage mechanism (Tu et al., 2016) to discourage word repetitions. The evaluator provides rewards to fine-tune the gen- erator. The reward function can be chosen to be a combination of one or more metrics. The high-level architecture of our question generation framework is presented in Figure 1. 2.1 Generator Similar to AutoQG (Kumar et al., 2018), we em- ploy attention and boundary pointer network to identify pivotal answer spans in the input sentence. The generator then takes as input the sequence of words in the sentence, each augmented with encoding of most probable pivotal answer, along with a set of linguistic features such as POS tag, NER tag, etc. At each step, the generator out- puts a word with the highest probability, to eventu- ally produce a word sequence. Additionally, as we will see, the generator employs copy and coverage mechanisms. GeneratorLSTM Question DecoderBi-LSTM Answer Encoded Sentence EncoderPcgAttention distributionVocabulary DistributionContext VectorWord Coverage VectorFinal DistributionEvaluatorYGold RewardYsamples Training data...Pointer NetworkAnswer Encoder (cid:88) Here Weh, Wsh, Wx and bcg are trainable model parameters. The final probability of decoding a word is specified by the mixture model: p∗(qword) = pcg i+(1−pcg)p(qword) at (5) Where p∗(qword) is the final distribution over the union of the vocabulary and the input sentence. i:wi=qword As discussed earlier, Equation (5) addresses the rare words issue, since a word not in vocabulary will have probability p(qword) = 0. Therefore, in such cases, our model will replace the <unk> token for out-of-vocabulary words with a word in the input sentence having the highest attention ob- tained using attention distribution at i. To discourage meaningless multiple repetitions of words in the question (as illustrated in row 3 of Table 1), we maintain a word coverage vec- tor (wcv) for the words already predicted as the sum of all the attention distributions ranging over timesteps 0 until t − 1. Specifically, at time step t, wcv =(cid:80)t−1 t(cid:48)=0 at(cid:48) . No word is generated before timestep 0, and hence wcv will be a zero vector then. After stor- ing the word coverage vector until t − 1, while attending to the next word, we will need to inform our attention mechanism about words covered un- til then. Hence, equation (2) is now modified to be: i = vttanh(Wwcvwcvt et i + Wehhi + Wshst + batt) (6) Here Wwcv are trainable parameters that inform the attention mechanism about words that have been previously covered while choosing to attend over the next word. Following the incorporation of the copy and coverage mechanism in our gen- erator, the generator's final loss function will be: T(cid:88) t=0 (cid:88) Losscopy+cov = 1 T log P ∗(wt)− λcLcov (7) where λc is the coverage hyperparameter and the coverage loss Lcov is defined as: Lcov = min(at i, wcvt i) (8) i We note that this cross-entropy based loss function still does not include task-specific metrics such as BLEU that were motivated earlier. We employ an evaluator to refine the model pre-trained on this loss function to directly optimize the task specific reward. We also empirically show that the refine- ment of maximum likelihood models using task- specific rewards such as BLEU improves results considerably. In the next subsection we describe our evaluator. 2.2 Evaluator The evaluator fine-tunes the parameters of the gen- erator network by optimizing task-specific reward functions through policy gradient. It takes as in- put the predicted sequence and the gold sequence, evaluates a policy, and returns a reward (a score between 0 and 1) that reflects the quality of the question generated. For question generation, the choice of reward functions include task-specific metrics BLEU, GLEU and ROUGE-L (Du et al., 2017; Kumar et al., 2018), as well as the decom- posable attention (Parikh et al., 2016) described below. More importantly, we present two new re- ward functions that are specifically designed for question generation, QSS and ANSS, for the con- formity of questions and answers respectively. Combining Equation (7) with a reward func- tion R (BLEU, GLEU, ROUGE, DAS, QSS and ANSS), we obtain the overall loss function using the expected reward objective as follows: Loverall =α ∗ Losscopy+cov + β ∗ N(cid:88) i=0 (cid:88) y∈Y Pθ(yX (i))R(y, y∗(i)) (9) where R(y, y∗(i)) denotes per sentence score (re- ward), Y is a set of sequences sampled from the final distribution, and α and β are tunable hyper- paramters. 2.2.1 Decomposable attention based evaluator The use of a lexical similarity based reward func- tion such as BLEU or ROUGE does not provide the flexibility to handle multiple possible versions of the ground truth. For example, the questions "who is the widow of ray croc?" and "ray croc was married to whom?" have almost the same meaning, but due to word order mismatch with the gold question, at most one of them can be re- warded using the BLEU score at the cost of the other(s). Empirically, we find this restriction lead- ing to models that often synthesize questions with poor quality. We therefore, design a novel reward function, a decomposable attention (Parikh et al., 2016) based similarity scorer (DAS). Denoting by q a generated question and by q the ground-truth question, we compute a cross attention based sim- ilarity using the following steps: Cross Attention: The generated question q and the ground-truth question q are inter-attended as: Lq(cid:88) Lq(cid:88) j=0 i=0 q∗ i = q∗ j = ajie(qj), aji = bjie(qi), bji = (cid:80)Lq (cid:80)Lq exp(e(qi)T e(qj)) k=0 exp(e(qi)T e(qk)) , exp(e(qi)T e(qj)) k=0 exp(e(qk)T e(qj)) (10) where e(.) is the word embedding of dimension size d, q∗ is the cross attention vector for a gener- ated question q, and q∗ is the cross attention vector for a question q in the ground truth. Comparison: Each n-gram qi in the generated question (through its embedding e(qi)) is com- pared with its associated cross-attention vector q∗ using a feed forward neural network N1. Simi- larly, each n-gram qj in the ground-truth question (through its embedding e(qj)) is compared with its associated attention vector q∗ using another net- work N2 having the same architecture as N1. The motivation for this comparison is that we would like to determine the soft alignment between n- grams in the generated question and the gold ques- tion. As an illustration, while comparing the gold question "why do rockets look white?" with a generated question "why are rockets and boosters painted white?", we find that an n-gram "rockets and boosters" is softly aligned to "rockets" while "look" is softly aligned to "painted". q1,i = N1([e(qi), q∗]), q2,j = N2([e(qj), q∗]) (11) where q1,i and q2,j are vectors containing com- parison scores of aligned phrases in generated question and gold question respectively and N1 and N2 are the feed forward neural nets. Matching Score: The vectors q1,i and q2,j are aggregated over each word or phrase in the pre- dicted question and gold question respectively be- fore feeding them to a linear function (L): Lq(cid:88) Lq(cid:88) DAS = L( q1,i, i=1 j=1 q2,j) (12) 1https://github.com/huggingface/ pytorch-pretrained-BERT This matching score between the predicted ques- tion and the gold question is the reward returned by the decomposable attention based evaluator. 2.2.2 QG quality specific reward functions We introduce two new reward functions that specifically designed to evaluate the conformity of the generated question (QSS) and answer (ANSS) against the ground truth. Question sentence overlap score (QSS): This reward function is specific to QG. We compute the sentence overlap score as the number of com- mon n-grams between predicted question and the source sentence. This reward ensures that gen- erated question is relevant to the given sentence. Thus, if precisionn(s, q) computes the n−gram precision match between sentence and question, QSS = ( precisioni(sentence, question)) 1 n (13) Predicted and encoded answer overlap score (ANSS): In order to ensure that the generated question is about the pivotal answer/ground truth answer we calculate answer overlap score. An- swer overlap score is the number of common n- grams between the encoded answer and the answer predicted (ansqa) for the generated question us- ing the best performing question answering model over SQuAD1 n(cid:89) i=1 n(cid:89) AN SS = ( precisioni(ansqa, pivotal answer)) 1 n i=1 (14) 3 Experimental Setup In this section, we present our evaluation frame- work on the publicly available SQuAD (Rajpurkar et al., 2016) dataset. We first explain various reward functions employed in our experiments. We then describe our baseline and the evaluation methods. Reward Functions: We experimented with the five reward functions discussed in Section 2.2: (1) BLEU, (2) GLEU, (3) ROUGE-L, (4) DAS, and (5) the QG-specific reward QSS+ANSS. In our experiments we considered BLEU for up to 4- grams. For the GLEU score, we recorded all sub- sequences of up to 4-grams. Baselines and Evaluation Methods: We reim- plemented two state-of-the-art question generation models as baselines for comparison: L2A (Du et al., 2017) and AutoQG (Kumar et al., 2018). A direct (and fair) comparison with another recent technique, NQGLC (Song et al., 2018), is not fea- sible, as unlike us, NQGLC requires ground-truth answers, whereas both AutoQG and our model predict pivotal answers. L2A does not consider answers. Moreover, their context (input is some- times more than one sentence) is different also the train/test split is different from ours. Hence, we only report the original numbers reported in their paper. We also did not perform human evaluation on NQGLC as their source code has not been made available for reimplementation. We also use an existing implementation of a recent RL-based abstractive summarization tech- nique (Paulus et al., 2018) to train baseline mod- els SUMBLEU (with BLEU as reward function) and SUMROUGE (with ROUGE as reward func- tion). This comparison studies the effectiveness of state-of-the-art abstractive summarization tech- niques applied to question generation as-is, as the two are conceptually similar tasks. We report automatic and human evaluation re- sults on eight variants of our model, each of which is equipped with the copy and coverage mecha- nism, the pointer network, as well as one of the four reward functions: BLEU, GLEU, ROUGE- L, DAS or one of the four rewards in combination with QG quality specific rewards (QSS+ANSS). Hence, our models are named GEBLEU, etc. For automatic evaluation, we employ BLEU, ROUGE-L and METEOR, which are standard evaluation measures used to evaluate sequence prediction tasks. We use the evaluation scripts re- leased by (Chen et al., 2015) that was originally used to evaluate the image captioning task. We also performed human evaluation to fur- ther analyze the quality of questions generated for their syntactic correctness, semantic correct- ness and relevance. Syntactic correctness mea- sures the grammatical correctness of a generated question, semantic correctness measures meaning- fulness and naturalness of the question, and rel- evance measures how relevant the question is to the text. We perform human evaluation for each model on a randomly selected subset of 100 sen- tences. Each of the three judges is presented the 100 sentence-question pairs for each model and asked for a binary response on each quality param- eter. The responses from all the judges for each parameter is then averaged for each model. 3.1 Ablation Analysis We conducted an ablation analysis to study the ef- fect of removing the copy and coverage mecha- nisms. Table 4 summarizes the drop in perfor- mance for GEROUGE. Without the copy mecha- nism, there is a drop overall in every evaluation measure, with BLEU-4 registering the largest drop of 13.8% as against 13.4%, 6.9% and 4.7% in BLEU-3, BLEU-2 and BLEU-1 respectively. On the other hand, without the coverage mechanism, we see a consistent but sufficiently lower drop (1- 2%) in each evaluation measure for GEROUGE. 4 Results and Discussion We show and compare results on automatic evalu- ation in Table 3. Note the numbers in parentheses for L2A (Du et al., 2017), AutoQG (Kumar et al., 2018), and NQGLC (Song et al., 2018) are those reported in their original papers. The slight dif- ference of up to 1.7% in the original and repro- duced numbers can be attributed to reimplemen- tation and different versions of various libraries used. As can be seen, all our eight models out- perform L2A and AutoQG on all evaluation met- rics. Two of our models, GEGLEU and GEROUGE, also outperform NQGLC. Hence, using evaluation metrics as the reward function during reinforce- ment based learning improves performance for all metrics. We also observe that GEROUGE+QSS+ANSS, the model reinforced with ROUGE-L (that mea- sures the longest common sequence between the ground-truth question and the generated question) as the reward function in combination with QG quality specific rewards(QSS+ANSS), is the best performing model on all metrics, outperforming existing baselines considerably. For example, it improves over AutoQG on BLEU-4 by 29.98%, on METEOR by 13.15%, and on ROUGE-L by 8.67%. In Table 5 we present human evaluation results for the models evaluated on three quality parame- ters (a) syntactic correctness, (b) semantic correct- ness, and (c) relevance. Consistent with automatic evaluation results Model L2A (Du et al., 2017) AutoQG (Kumar et al., 2018) NQGLC (Song et al., 2018) SUMBLEU (Paulus et al., 2018) SUMROUGE (Paulus et al., 2018) GEBLEU GEBLEU+QSS+ANSS GEDAS GEDAS+QSS+ANSS GEGLEU GEGLEU+QSS+ANSS GEROUGE GEROUGE+QSS+ANSS BLEU-1 BLEU-2 BLEU-3 43.21 (43.09) 44.68 (46.32) 24.77 (25.96) 26.96 (28.81) 15.93 (17.50) 18.18 (19.67) - 11.20- 11.94- 46.84 46.59 44.64 46.07 45.20 47.04 47.01 48.13 - 3.50- 3.95- 29.38 29.68 28.25 29.78 29.22 30.03 30.67 31.15 - 1.21- 1.65- 20.33 20.79 19.63 21.43 20.79 21.15 21.95 22.01 BLEU-4 10.60 (12.28) 12.68 (13.85) - (13.98) METEOR 16.39 (16.62) 17.86 (18.51) - (18.77) 0.45- 0.082- 14.47 15.04 14.07 16.22 15.26 15.92 16.17 16.48 6.68- 6.61- 19.08 19.32 18.12 19.44 18.98 19.05 19.85 20.21 ROUGE-L 38.98 (39.75) 40.59 (41.75) - (42.72) 15.25- 16.17- 41.07 41.73 42.07 42.84 43.47 43.55 43.90 44.11 Table 3: Experimental results on the test set on automatic evaluation metrics. Best results for each metric (column) are bolded. The numbers in parentheses for L2A, AutoQG and NQGLC are those from the best models reported in their respective original papers. The slight difference of up to 1.7% from our reproduced numbers can be attributed to reimplementation and different versions of various libraries used. Models with new QG-specific reward functions (QSS+ANSS) are highlighted in gray for easy comparison. Model (GEROUGE) W/o copy W/o coverage ∆ BLEU-1 (47.01) 2.09 (4.7%) 0.31 (0.7%) ∆ BLEU-2 (30.67) 2.13 (6.9%) 0.57 (1.9%) ∆ BLEU-3 (21.95) 2.94 (13.4%) 0.94 (4.2%) ∆ BLEU-4 (16.17) 2.23 (13.8%) 0.28 (1.7%) ∆ METEOR ∆ ROUGE-L (43.90) 2.58 (5.9%) 1.01 (2.3%) (19.85) 2.21 (11.1%) 0.84 (4.2%) Table 4: Ablation analysis results after removing (a) copy mechanism and (b) coverage mechanism from the system (GEROUGE). Both absolute performance drop and percentage of drop (in parentheses) are reported. shown in Table 3, seven of our eight models out- perform the two baselines, with GEDAS+QSS+ANSS being the best model on syntactic correctness and semantic correctness quality metrics, outperform- ing all the other models by a large margin. How- ever, model GEBLEU+QSS+ANSS generates highly relevant questions and is the best model on rele- vance metrics. It is noteworthy that for each of our models (e.g. GEBLEU), adding QG-specific rewards (e.g. GEBLEU+QSS+ANSS) significantly improves ques- tion quality in human evaluation, even though there is less noticeable improvements in automatic evaluation. This clearly demonstrates the effec- tivess of our new QG-specific reward functions. We measure inter-rater agreement using Ran- dolph's free-marginal multirater kappa (Randolph, 2005). This helps in analyzing level of consistency among observational responses provided by mul- tiple judges. It can be observed that our quality metrics for all our models are rated as moderate agreement (Viera et al., 2005). 4.1 Analyzing Choice of Reward Function BLEU(Papineni et al., 2002) measures precision and ROUGE(Lin, 2004) measures recall, we be- lieve that cross-entropy loss was already account- ing for precision to some extent and using it in conjunction with ROUGE (which improves recall) therefore gives best performance. Model L2A AutoQG GEBLEU GEBLEU+QSS+ANSS GEDAS GEDAS+QSS+ANSS GEGLEU GEGLEU+QSS+ANSS GEROUGE GEROUGE+QSS+ANSS Syntax Score Kappa 0.49 39.2 0.49 51.5 47.5 0.52 0.63 82 0.40 68 84 0.57 0.50 60.5 0.68 78.3 69.5 0.56 0.52 79.3 Semantics Score Kappa 0.49 0.78 0.45 0.68 0.33 0.60 0.52 0.71 0.58 0.41 39 48 49 75.3 63 81.3 62 74.6 68 72 Relevance Score Kappa 0.40 0.50 0.44 0.46 0.40 0.47 0.41 0.40 0.43 0.41 29 48 41.5 78.33 41 74 44 72 53 67 Table 5: Human evaluation results (column "Score") as well as inter-rater agreement (column "Kappa") for each model on the test set. The scores are between 0- 100, 0 being the worst and 100 being the best. Best results for each metric (column) are bolded. The three evaluation criteria are: (1) syntactically correct (Syn- tax), (2) semantically correct (Semantics), and (3) rel- evant to the text (Relevance). Models with new QG- specific reward functions (QSS+ANSS) are highlighted in gray for easy comparison. DAS calculates semantic similarity between generated question and the gound-truth question. As discussed in section 2.2.1 DAS will give high reward even though the generated question has low BLEU score. Thus, the performance of the model on automatic evaluation metrics does not improve with DAS as the reward function, though the quality of questions certainly improves. Fur- ther, ROUGE in conjunction with the cross en- tropy loss improves on recall as well as precision whereas every other combination overly focuses only on precision. Error analysis of our best model reveals that most errors can be attributed to intra-sentence de- pendencies such as co-references, concept depen- dencies etc. In a camera ready version of the pa- per, we will share link to a detailed report con- taining extensive experiments that include ablation tests. Also link to the source code will be provided then. 5 Related Work Neural network-based methods represent the state- of-the-art in automatic question generation (QG) from text. Motivated by neural machine trans- lation, Du et al (2017) proposed a sequence-to- sequence (Seq2Seq) architecture for QG. In our previous work, we (2018) proposed to augment each word with linguistic features and encode the most relevant pivotal answer to the text while gen- erating questions. Similarly, Song et al (2018) encode ground-truth answers (given in the train- ing data), use the copy mechanism and addition- ally employ context matching to capture interac- tions between the answer and its context within the passage. They encode ground truth answer for generating questions which might not be available for test set in contrast we train a Pointer Network based model to predict the pivotal answer to gen- erate question about. In our work (Kumar et al., 2019a) we proposed a transformer based archi- tecture to automatically generate complex multi- hop questions from knowledge graphs. In (Kumar et al., 2019b) we proposed a cross lingual train- ing method for automatically generating questions from text in low resource languages. Very recently deep reinforcement learning has been successfully applied to natural language generation tasks such as abstractive summariza- tion (Paulus et al., 2018; Celikyilmaz et al., 2018) and dialogue generation (Li et al., 2016). In sum- marization, one generates and paraphrases sen- tences that capture salient points of the text. On the other hand, generating questions additionally involves determining question type such as what, when, etc., being selective on which keywords to copy from the input into the question, leaving re- maining keywords for the answer. This also re- quires the development of a specific probabilis- tic generative model. (Yao et al., 2018) proposed generative adversarial network (GAN) framework with modified discriminator to predict question type. Recently Fan et al (2018) proposed a bi- discriminator framework for visual question gen- eration. They formulate the task of visual ques- tion generation as a language generation task with some linguistic and content specific attributes. 6 Conclusion We presented a novel, holistic treatment of ques- tion generation (QG) using a generator-evaluator framework. Our generator provisions for explic- itly factoring in question syntax and semantics, identifies pivotal answers, recognizes contextually important words and avoids meaningless repeti- tions. Our evaluator allows us to directly op- timize for conformity towards the structure of ground-truth question(s). We propose two novel reward functions account for conformity with re- spect to ground-truth questions and predicted an- swers respectively. In conjunction, the evalua- tor makes use of task-specific scores, including BLEU, GLEU, ROUGE-L, and decomposable at- tention (DAS) that are naturally suited to QG and other seq2seq problems. Experimental results on automatic evaluation and human evaluation on the standard benchmark dataset show that our frame- work, especially with the incorporation of the new reward functions, considerably outperforms state- of-the-art systems. References Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Ben- gio. 2014. Neural machine translation by jointly arXiv preprint learning to align and translate. arXiv:1409.0473. Asli Celikyilmaz, Antoine Bosselut, Xiaodong He, and Yejin Choi. 2018. Deep communicating agents for abstractive summarization. In NAACL 2016, pages 1662 -- 1675. ACL. Xinlei Chen, Hao Fang, Tsung-Yi Lin, Ramakr- ishna Vedantam, Saurabh Gupta, Piotr Doll´ar, and C Lawrence Zitnick. 2015. Microsoft COCO cap- tions: Data collection and evaluation server. arXiv preprint arXiv:1504.00325. Xinya Du, Junru Shao, and Claire Cardie. 2017. Learn- ing to ask: Neural question generation for reading Justus J Randolph. 2005. Free-marginal multirater kappa (multirater k [free]): An alternative to fleiss' fixed-marginal multirater kappa. Online submission. Marc'Aurelio Ranzato, Sumit Chopra, Michael Auli, and Wojciech Zaremba. 2015. Sequence level train- ing with recurrent neural networks. arXiv preprint arXiv:1511.06732. Abigail See, Peter J Liu, and Christopher D Manning. 2017. Get to the point: Summarization with pointer- generator networks. In Proceedings of the 55th An- nual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), volume 1, pages 1073 -- 1083. Iulian Vlad Serban, Alberto Garc´ıa-Dur´an, Caglar Gulcehre, Sungjin Ahn, Sarath Chandar, Aaron Courville, and Yoshua Bengio. 2016. Generating factoid questions with recurrent neural networks: arXiv The 30m factoid question-answer corpus. preprint arXiv:1603.06807. Linfeng Song, Zhiguo Wang, Wael Hamza, Yue Zhang, and Daniel Gildea. 2018. Leveraging context infor- mation for natural question generation. In NAACL (Short Papers), volume 2, pages 569 -- 574. Richard S Sutton and Andrew G Barto. 1998. Introduc- tion to reinforcement learning, volume 135. MIT press Cambridge. Zhaopeng Tu, Zhengdong Lu, Yang Liu, Xiaohua Liu, and Hang Li. 2016. Modeling coverage for neural In ACL 2016, pages 76 -- 85. machine translation. The Association for Computer Linguistics. Anthony J Viera, Joanne M Garrett, et al. 2005. Under- standing interobserver agreement: the kappa statis- tic. Fam Med, 37(5):360 -- 363. Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. 2015. Pointer networks. In Advances in Neural In- formation Processing Systems, pages 2692 -- 2700. Kaichun Yao, Libo Zhang, Tiejian Luo, Lili Tao, and Yanjun Wu. 2018. Teaching machines to ask ques- tions. In IJCAI, pages 4546 -- 4552. Yao Zhao, Xiaochuan Ni, Yuanyuan Ding, and Qifa Ke. 2018. Paragraph-level neural question gener- ation with maxout pointer and gated self-attention networks. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Process- ing, pages 3901 -- 3910. comprehension. 1352. In ACL, volume 1, pages 1342 -- Zhihao Fan, Zhongyu Wei, Siyuan Wang, Yang Liu, and Xuanjing Huang. 2018. A reinforcement learn- ing framework for natural question generation us- In 27th International Con- ing bi-discriminators. ference on Computational Linguistics (COLING), pages 1763 -- 1774. Jiatao Gu, Zhengdong Lu, Hang Li, and Victor OK Li. 2016. Incorporating copying mechanism in sequence-to-sequence learning. In ACL, volume 1, pages 1631 -- 1640. Vishwajeet Kumar, Kireeti Boorla, Yogesh Meena, Ganesh Ramakrishnan, and Yuan-Fang Li. 2018. Automating reading comprehension by generating In 22nd Pacific-Asia question and answer pairs. Conference on Knowledge Discovery and Data Min- ing (PAKDD). Vishwajeet Kumar, Yuncheng Hua, Ganesh Ramakr- ishnan, Guilin Qi, Lianli Gao, and Yuan-Fang Li. 2019a. Difficulty-controllable multi-hop question generation from knowledge graphs. In ISWC. Vishwajeet Kumar, N. Joshi, Arijit Mukherjee, Ganesh Ramakrishnan, and Preethi Jyothi. 2019b. Cross- lingual training for automatic question generation. In ACL. Jiwei Li, Will Monroe, Alan Ritter, Dan Jurafsky, Michel Galley, and Jianfeng Gao. 2016. Deep re- inforcement learning for dialogue generation. In EMNLP 2016, pages 1192 -- 1202. ACL. Chin-Yew Lin. 2004. Rouge: A package for auto- matic evaluation of summaries. Text Summarization Branches Out. Prashanth Mannem, Rashmi Prasad, and Aravind Joshi. 2010. Question generation from paragraphs at In Third UPenn: QGSTEC system description. Workshop on Question Generation (QG 2000), pages 84 -- 91. Kishore Papineni, Salim Roukos, Todd Ward, and Wei- Jing Zhu. 2002. Bleu: a method for automatic eval- uation of machine translation. In ACL, pages 311 -- 318. ACL. Ankur Parikh, Oscar Tackstrom, Dipanjan Das, and Jakob Uszkoreit. 2016. A decomposable attention In EMNLP model for natural language inference. 2016, pages 2249 -- 2255. Romain Paulus, Caiming Xiong, and Richard Socher. 2018. A deep reinforced model for abstractive sum- marization. In ICLR. Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. SQuAD: 100,000+ questions for machine comprehension of text. In EMNLP 2016, pages 2383 -- 2392. ACL.
1609.01594
1
1609
2016-09-06T15:05:25
An Information Extraction Approach to Prescreen Heart Failure Patients for Clinical Trials
[ "cs.CL", "cs.CY" ]
To reduce the large amount of time spent screening, identifying, and recruiting patients into clinical trials, we need prescreening systems that are able to automate the data extraction and decision-making tasks that are typically relegated to clinical research study coordinators. However, a major obstacle is the vast amount of patient data available as unstructured free-form text in electronic health records. Here we propose an information extraction-based approach that first automatically converts unstructured text into a structured form. The structured data are then compared against a list of eligibility criteria using a rule-based system to determine which patients qualify for enrollment in a heart failure clinical trial. We show that we can achieve highly accurate results, with recall and precision values of 0.95 and 0.86, respectively. Our system allowed us to significantly reduce the time needed for prescreening patients from a few weeks to a few minutes. Our open-source information extraction modules are available for researchers and could be tested and validated in other cardiovascular trials. An approach such as the one we demonstrate here may decrease costs and expedite clinical trials, and could enhance the reproducibility of trials across institutions and populations.
cs.CL
cs
AN INFORMATION EXTRACTION APPROACH TO PRESCREEN HEART FAILURE PATIENTS FOR CLINICAL TRIALS ABHISHEK KALYAN ADUPA1, RAVI PRAKASH GARG1, JESSICA CORONA-COX2, SANJIV J. SHAH2, SIDDHARTHA JONNALAGADDA1 1Division of Health and Biomedical Informatics, Department of Preventive Medicine, Northwestern University Feinberg School of Medicine, Chicago, IL 60611, USA Email: [email protected] 2Division of Cardiology, Department of Medicine, Northwestern University Feinberg School of Medicine, Chicago, IL 60611, USA To reduce the large amount of time spent screening, identifying, and recruiting patients into clinical trials, we need prescreening systems that are able to automate the data extraction and decision-making tasks that are typically relegated to clinical research study coordinators. However, a major obstacle is the vast amount of patient data available as unstructured free-form text in electronic health records. Here we propose an information extraction-based approach that first automatically converts unstructured text into a structured form. The structured data are then compared against a list of eligibility criteria using a rule-based system to determine which patients qualify for enrollment in a heart failure clinical trial. We show that we can achieve highly accurate results, with recall and precision values of 0.95 and 0.86, respectively. Our system allowed us to significantly reduce the time needed for prescreening patients from a few weeks to a few minutes. Our open-source information extraction modules are available for researchers and could be tested and validated in other cardiovascular trials. An approach such as the one we demonstrate here may decrease costs and expedite clinical trials, and could enhance the reproducibility of trials across institutions and populations. 1. Introduction The creation and acceptance of electronic health records (EHRs) has ignited widespread interest in the use of clinical data for secondary purposes and research [1]. One such application that can greatly benefit from an EHR-based approach is clinical trial screening and recruitment. Clinical trial screening is a process that helps medical practitioners and researchers determine whether a particular patient is suitable for trial based on certain eligibility criteria. The eligibility criteria are generally divided into two parts: inclusion criteria and exclusion criteria. Inclusion criteria are characteristics that the prospective subjects must have if they are to be included in the study, while exclusion criteria are those characteristics that disqualify prospective subjects from inclusion in the study. In general, screening for clinical trial recruitment is done manually. Clinicians and study coordinators go through each of the eligibility criteria, determine data elements relevant to the clinical trial, extract the data elements from structured and unstructured EHR of each patient, and match the data elements with the eligibility criteria to decide whether the patient qualifies for the trial. Not only this process is slow, it is also prone to errors. It typically takes approximately 15 to 20 minutes for a study coordinator to examine each patient's data. Because of the subjectivity involved in human decision-making, domain knowledge, which patients are considered for initial search and other factors [2], there is always a possibility of type-1 and type-2 errors in the 1 prescreening process and biases in the overall recruitment. Furthermore, clinicians and study coordinators typically rely on patients identified in their own specialty clinics or in certain defined patient care settings, thereby missing out on the advantage of screening an entire healthcare system. We hypothesize that an automated process for prescreening would be quicker and serve as an independent judge of inclusion/exclusion criteria free of human bias. If the prescreening algorithm also has a high recall (sensitivity), it would potentially reduce recruitment bias because it would be possible to consider patients from a larger pool. Thus, an algorithm that can prescreen eligible patients efficiently could provide a proficient and robust approach to clinical trial recruitment. Therefore, we sought to develop a high recall (sensitivity) prescreening algorithm for recruiting patients into a multicenter, randomized, double-blind, parallel group, active-controlled study to evaluate the efficacy and safety of LCZ696 compared to valsartan, on morbidity and mortality in heart failure patients with preserved ejection fraction (PARAGON). Our approach involves development of information extraction modules that can be reused not only for other EHRs but also for other trials using similar data elements. 2. Background Heart failure (HF) occurs when the heart muscle is no longer able to meet the demands of the body either due to reduced cardiac output or increased ventricular filling pressures. It is one of the most common reasons for hospital admissions among those aged 65 years and older. In 2010 alone, HF affected 6.6 million Americans at a cost of $34.4 billion [3, 4]. Many clinical trials have been undertaken to find efficient solutions to the condition. However, it has been found that 86% of all clinical trials are delayed in patient recruitment from 1 to 6 months, and 13% are delayed by longer than 6 months [2]. A major cause of delay in HF clinical trials is the inability to efficiently screen for and identify eligible patients. An automated system is therefore needed to accelerate the process of prescreening patients for clinical trials. The surge of the use of EHRs in the United States has created abundant opportunities for clinical and translational research. As Friedman et al noted, the extensive use of clinical data provides great potential to transform our healthcare system into a "Self-learning Health System" [5, 6]. In addition to its primary purpose of providing improved clinical practice, the use of EHRs offers means for the identification of participants who satisfy predefined criteria. This can be used for a variety of applications, including clinical trial recruitment, outcome prediction, survival analysis, and other retrospective studies [7-10]. EHRs contain patient data in both structured and unstructured formats. The structured data generally encompass a patient's demographic data, physical characteristics (e.g., body mass index [BMI], blood pressure), laboratory data, and diagnoses. Structured data are not only the best representation of knowledge but also easier to process. However, there is a vast amount of medical knowledge that is locked in the unstructured format. The unstructured data are typically text clinical narratives present in progress notes, imaging reports (e.g., echocardiographic reports), and discharge summaries, for example. Thus, a module that can automatically and efficiently extract information from unstructured clinical text and convert it into a structured form is needed. 2 The syndromic nature of HF presents unique challenges for the identification of patients from EHR data for research [11]. HF with preserved ejection fraction, in which the global pumping function of the heart is normal, is particularly challenging to identify during prescreening activities. The presence of large amounts of unstructured data in patient medical reports aggravates the challenges. Previous studies have shown that clinicians often prefer free text entry to coded options, in order to fully explain the health conditions of each patients [12- 14]. It has also been noted that unstructured data are essential because of the information they contain [15]; therefore, unstructured data are likely to persist in the future. There is an immediate need for an automated data extraction system to transform unstructured clinical reports into a structured form, which is much easier to process and handle [16-18]. There has been considerable research in identifying patient cohorts from EHRs [19]. These approaches can be categorized into three general types: (1) rule-based approaches [20-24], (2) machine learning–based approaches [25-28], and (3) information retrieval–based approaches [29-32]. All these approaches use either pattern matching (regular expressions) or language modeling–based methods [33-36] to extract features for their system to work on. Rule-based systems are stringent and binary (either yes or no) in nature. On the other hand, machine learning– and information retrieval–based methods provide output as probability or a score. Machine learning techniques, however, require a large amount of training data to give accurate results. Input Patient Record Pattern Matching (Regular Expressions) Language Modeling Based Methods Rule--‐Based Techniques Features Machine Learning–Based Techniques Information Retrieval–Based Techniques Figure 1. Summary of techniques for patient cohort identification. Our proposed system is different from these approaches in various ways. A majority of the reported systems aim to identify whether a patient shows a certain phenotype. Therefore, the number of criteria required is less than that which are necessary for clinical trial screening. For example, a majority of the systems only use a variation of disease names, medications used, or treatments taken as their eligibility criteria [21, 23]. Ours is a more diverse application. Our goal is to check whether a particular patient qualifies for a certain clinical trial. Clinical trials usually have a large number of eligibility criteria that need to be checked. Therefore, a large amount of information related to the eligibility criteria needs to be extracted. Our study goal is similar to that of the plethora of approaches proposed in computer-based clinical trial recruitment systems [37]. However, a majority of these approaches either lack EHRs as data source or are not equipped to handle unstructured data. We, on the other hand, obtain patient data from EHRs and handle unstructured data through information extraction methods, as opposed to the "bag of terms" or "bag of concepts" suggested in other methods 3 [38]. The main contributions of our study are to (1) show that automated recruitment systems can only serve as prescreening tools and to (2) develop and validate a clinical trial screening system based on information extracted from EHRs. Here, we demonstrate how our system processes a set of eligibility criteria, extracts information from patient records automatically into a structured format, and finally prescreens the patients who could qualify for the trial by matching the structured patient document with the eligibility criteria. Section 3 describes the data and the algorithm used to convert the data into a structured form. We present our results in Section 4, discuss our experience and the challenges faced in Section 5, and then conclude in Section 6. Patient Before Demographics, Lab Values, etc. (Structured Data) Pathology Reports, Echo Report, Encounter Notes, Discharge Summaries, etc. (Unstructured Data) Information Extraction Modules Patient After Demographics Lab Values Pathology Report Information Echo Report Information Encounter Notes Information (All Structured Form) Eligibility Criteria OUTPUT Figure 2. Overview of our clinical trial recruitment system architecture. We have analyzed different HF- related patient medical reports and derived pattern-based Information extraction modules that provide output of structured data to compare against eligibility criteria for clinical trial recruitment 3. Methods 3.1. Patient Records and Eligibility Criteria – Data Description The patient records used in this study come from the EPIC EHR used by Northwestern Memorial Group. The initial cohort of patients we have considered for our experiments was very broad to ensure we were not missing any patients that could be included – patients that currently have been documented to have HF with the ICD-9-CM Diagnosis Code 428.0 or had an echocardiogram within the past year. We selected 198 of these patients for development and 3002 patients for validation. Each patient's data consists of five list, echocardiography reports, lab reports, and current medication list. Encounters contain two types of files: encounter diagnosis name and encounter progress notes. The characteristics of the patient records for both datasets are summarized in Table 1. We have 40 eligibility criteria – 7 for inclusion and 33 for exclusion – for the PARAGON clinical trial [39]. However, we currently evaluate our approach based on a subset of these criteria (Figure 3). types of reports: encounters, problem 4 Table 1. Characteristics of the development and validation patient datasets. Total number of patients Encounters Echocardiography reports Lab reports Current medication entries Problem lists Development set 198 54,173 96,281 52,393 4490 3521 Validation set 3002 393,482 883,385 371,879 41,947 33,089 Patient Records Data Encounter Progress Notes Encounter Diagnosis Names Problem List Lab Report Echo Report Medication List Structured data normalizer Structured data extractor Unstructured data extractor Age BMI Hb GFR BP LVEF a. Heart failure b. Angioedema c. Pancreatitis d. Organ transplant e. ICD f. Malignant cancer g. Valvular heart disease h. Pericardial constriction. Cardiomyopathy IC: Age ≥ 55 y, EC: BMI > 40 kg/m2 IC: Number of HF terms ≥1 IC: LVEF value ≥45% EC: Number of angioedema or pancreatitis or bilateral renal artery stenosis terms ≥1 EC: Number of "transplant" or "ICD" terms ≥1 EC: Sentences with "malignant" term and absence of "basal" and "prostrate" terms ≥1 EC: Hb < 10 g/dl, GFR < 30 EC: SBP value > 150 mm Hg and number of antihypertensive drugs > 3 EC: Number of "pericardial constriction" or "genetic hypertrophic cardiomyopathy" or "infiltrative cardiomyopathy" terms ≥ 1 Figure 3. Algorithm. Each patient's data parsed through three types of extraction module. The modules extract the appropriate information and create a patient profile. This profile is then checked against the clinical trial eligibility criteria to check the patient's qualification. (BMI=Body Mass Index, Hb = Hemoglobin, GFR=Glomerular Filtration Rate, BP = Blood Pressure, LVEF= left ventricular ejection fraction, ICD= implantable cardioverter defibrillators, IC=Inclusion criteria, EC=Exclusion criteria) 5 3.2 Algorithm The information from the patient data is extracted as part of separate modules. These modules are designed to extract the data elements relevant to PARAGON but are reusable individually for other clinical trials. After extraction, a rule-based system matches the eligibility criteria and discards patients who do not satisfy any of the inclusion criteria or satisfies one of the exclusion criteria. Figure 3 describes the system's architecture in finer detail. We broadly categorize the modules as: (1) structured data normalizer, (2) unstructured data extractor, and (3) unstructured data classifier. Structured data normalizer is used for the extraction of data elements whose values are already present in the structured form. This module is further divided into two submodules. In submodule 1, we extract the values for age, BMI, hemoglobin, GFR and blood pressure from structured fields. In submodule 2, we extract the number of medications a patient belong to different drug classes. The reports are in structured form with mapping of the medication to the patient. This submodule requires external information resources, which we provide as databases to our system. Table 2 and Table 3 list the drug classes that we incorporated for the PARAGON clinical trial. Table 2. Types of antihypertensive drugs Beta (β)--‐ blockers Acebutolol Atenolol Betaxolol Bisoprolol Carvedilol Esmolol Dihydropyridines Amlodipine Felodipine Nicardipine Nifedipine Nisoldipine Nondihydropyridines: class IV antiarrhythmics Diltiazem Verapamil Antihypertensives (others) Aliskiren Fenoldopam Hydralazine Hydralazine/HCTZ Methyldopa/HCTZ Minoxidil Table 3. Common angiotensin-converting enzyme (ACE) inhibitors and angiotensin II receptor blockers (ARBs) Common ACE Inhibitors Benazepril Captopril Enalapril Fosinopril Lisinopril Common ARBs Candesartan Eprosartan Irbesartan Losartan Olmesartan Unstructured data extractor is used for the extraction of values of data elements present in unstructured text. This module also accepts input and provides output just as the previous module but uses a complex set of regular expressions to extract the exact value. For example, we currently extract the left ventricular ejection fraction (LVEF) value for our clinical trial. For this, we first use a set of regular expressions to extract sentences where the LVEF value may be present and then another set of regular expressions to extract the definite values as shown in Table 4. Regular expressions 1 through 4 extract the sentences that can contain LVEF values. Then, the sentences are parsed through regular expressions 5 and 6. Regular expression 5 extracts the values present in 6 range format: for example, "40% to/- 45%." Regular expression 6 extracts the freely available values: for example, "40%." Table 4. Regular expressions for extracting LVEF-containing sentences and values. S/N Regular Expression 1 2 3 4 5 6 decreasedmarkedly reducedseverely globally preservedseverely reducedmoderately (left ventricular ejection fractionlveflv ejection fractionleft ventricle ejection fractionejection fraction ef ejection fraction)[^_%\\.]*?([\\d--‐\\.]+)\\s*'?% (left ventricular systolic functionleft ventricular functionsystolic function of the left ventriclelv systolic functionleft ventricular ejection fractionejection fractionleft ventricle)(normalnormal globallow normalwell depressedseverely decreasedseveremarkedly reducedmildly decreasedmildly depressedseverely depressed) (normalnormal globallow normalwell preservedseverely reducedmoderately decreasedmoderately depressedseverely globally reducedmildly decreasedmildly depressedseverely depressed) .*(moderatemarkedsevere) (lv systolic dysfunctionleft ventricular dysfunctionleft ventricular systolic dysfunction).* ((\\d+\\s*(\\--‐to)\\s*\\d+)(\\d*\\.\\d*\\s*(\\--‐to)\\s*\\d*\\.\\d*)(\\d*\\.\\d+)(\\d+))(?=(\\s*(\\%))) \\d+(\\.\\d+)? decreasedseveremarkedly decreasedmoderately decreasedmarkedly reducedseverely Unstructured data classifier is used for classifying whether certain data elements are present or absent in relation to the context of the patient. Currently in this module, we extract all the instances of a given data element (diagnosis, medication, treatment, or tests) and its synonyms in the input report(s). For this, the module first checks for synonyms of the input term using UMLS Metathesaurus [40], builds automatically a set of regular expressions, and then applies them to the input report text to extract all the instances. For example, to extract HF-related terms the module compiles a failure," "HF," "diastolic dysfunction," and "cardiomyopathy." Next, a set of regular expressions are automatically generated (Table 5) and used to extract all the instances of HF-related terms. For PARAGON, the other data elements processed in this category are "angioedema", "pancreatitis", "valvular heart disease," etc. We adapt existing rule-based systems to make sure the data elements are not in their negated form using a rule-based negation detection algorithm, the data elements refer to the current status (as opposed to historical condition or a hypothesis for conducting a test) and the data elements correspond to the patient (as opposed to a family member or relative) [41, 42]. list of synonyms: "heart Table 5. Regular expressions to extract HF-related terms. Regular Expression [^\w]+(hH)eart\s+(fF)ailure[^\w]+ [^\w]+(dD)iastolic\s+(dD)ysfunction[^\w]+ [^\w]+(cC)ardiomyopathy[^\w]+ 7 [^\w]+HF[^\w]+ 4. Evaluation and Results We first evaluated our methods iteratively using the development set of 198 patient reports. A study coordinator read each patient record, extracted data elements of relevance to PARAGON, and matched against the eligibility criteria. For the 198 patient reports, our experienced research coordinator took two weeks (80 hours) to generate the gold standard data. Finally, we had 40 of the 198 patients (20%) prescreened for further analysis according to the eligibility criteria. After consulting a cardiologist, the number of patients finally found eligible was 12. The sheer size of the data that the clinical investigator or research coordinator has to read through is time consuming as well as tedious (Table 1). The number of patients finally qualifying for any clinical trial is always small. This is mostly due to the large number of stringent eligibility criteria. Therefore, it becomes important for an automated system to give more importance to retrieving nearly all the qualifying patients; in other words, the recall of the system should be close to 100%. We tuned our system in order to achieve a high recall (i.e., high sensitivity) so as not to have too many false negatives (which would result in missing potentially eligible patients). On the experiments run on the development dataset, we achieved close to 95% recall with a precision of 86% (F-score of 90%). Table 6 presents further details. Table 6. Outputs for the development dataset. Prescreening Gold Standard (Manual) Patients Included Patients Excluded Classification outcome (algorithmic) Patients included Patients excluded On the validation dataset, we prescreened 113 (3.7%) patients for the PARAGON clinical trial. Our clinical trial study coordinator went through these records and found that 21 of the patients fully qualify for the clinical trial. Twenty-five of the patients require consultation with a cardiologist. However, 67 of the patients do not qualify for the trial. In most cases, this is not because of errors in the prescreening system but due to certain other criteria that have either been not included in the algorithm (for example, certain specific allergies to medication, pregnancy, patient not present in the country, etc.) or are beyond the scope of any system to check due to lack of data (for example, type of cancer or cancer is malignant or benign when the details are not present). We detail some these issues in the Discussion section. 38 2 6 152 8 Table 7 lists the number of patients we discard based on each criteria for both the development and validation dataset. It can be seen that each information extraction module played a major role in screening out large proportions of patients without human involvement. For example, module 2, which extracts LVEF values, discarded 90 patients from the 198-patient development dataset and 672 patients from the 3002-patient validation dataset. This would not have been captured by any methods that aim to prioritize patients using information retrieval approaches without first extracting the values of the relevant data elements from unstructured reports. Table 7. Number of patients discarded at each step for the 198- and 3002-patient datasets Criterion based on Report Type Number of Patients Discarded 1071 1597 672 218 806 600 507 522 314 22 3 90 44 50 49 42 6 23 Encounter report Encounter report/problem list Echo report Encounter report Encounter report/problem list Encounter report/problem list Lab value report Encounter report Echo report Age + BMI HF related term LVEF Angioedema, Pancreatitis or Bilateral Renal Artery stenosis Organ Transplant or ICD Malignant organ system Hb + GFR Blood Pressure and Hypertensive drugs Pericardial constriction or genetic hypertrophic cardiomyopathy or infiltrative cardiomyopathy The time taken by our system to successfully parse and extract the required information from different data reports is just 2 minutes (for the whole 198-patient dataset). For 3002 patients, we are able to do so in approximately 20 minutes. Our clinical trial coordinator took almost two weeks to go through each of 198 patients' reports. Thus, the time required for her to go through 3002 patients would have been several months. Instead, she only had to examine the 113 prescreened patients from our system, which only took one week. This demonstrates the usefulness of our system in practical application. However, from these results and observations, we also understand that the system can only be used for prescreening, and further validation by the clinical trial study coordinator or clinical investigator is still required. 5. Discussion We achieved high recall with reasonable precision on our development dataset and were able to replicate the performance on a larger dataset. As with any automated system, there are certain limitations to our proposed architecture, which can be broadly categorized into (1) data processing and (2) data-handling issues. We briefly describe some of these issues. The precision of the system suffers from the complexity of text data. In some cases current unstructured data extractor module is unable to extract terms correctly. For example, the module fails to identify certain HF or ICD related terms. This is due to large number of synonyms and spelling mistakes for the relevant data elements. As mentioned earlier, there are some cases where a patient has certain allergies or may show a certain adverse reaction to a medication, both of which are difficult to extract from unstructured 9 notes because they are not always reported in a standard format within the EHR. There are also cases where the patient has moved out of the hospital's geographic area and therefore cannot provide consent for the clinical trial. These are details that are too patient-specific for automated extraction and can only be checked manually. In some cases, the LVEF value (which is an important factor for inclusion in HF clinical trials) is present in the form of a range or qualitative description. This created a problem while checking for eligibility according to the criterion given. For example, in our clinical trial, we have set the lower limit of LVEF at 45% based on the inclusion criteria. This creates a problem when the value is contained within the range extracted (40% to 45% or 30% to 50%, for example). Our initial approach was to take the average value and compare it with the threshold. However, after consultation with the cardiologist, our approach was deemed inappropriate. Therefore, we subsequently modified our algorithm to include these patients but with a warning regarding their LVEF value. This then served as an indication to the study coordinators to recheck the echocardiogram report (and review the echocardiographic images with the clinical investigator) in order to make further decisions about the patient's eligibility for the clinical trial. There are also some cases where the clinicians are just screening the patient for a particular diagnosis but the patient may not actually have the disease, such as a "malignancy of organ system" check of exclusion criteria. To handle this, we do not discard those patients if we find the "screening" term in the sentences extracted for eligibility check. In similar cases, we also see the term "cancer" instead of "malignancy." However, we cannot discard all patients with the "cancer" term present since some can have a benign diagnosis and not be malignant, and it is impossible for our system to decide if the cancer is malignant or relatively benign. To mitigate these issues, we currently just display a warning in these cases, as we did for LVEF. The coordinator can then perform further checks and decide the classification. In other exclusion criterion where we have to check the B-type natriuretic peptide and glomerular filtration rate values, we face the issues of non-availability and potential outliers in the data. For such cases too, we currently report them as a warning to coordinators for further checking. We also had to deal with data-handling issues in some cases. For example, in criteria where we have to perform a check for recent hemoglobin values, we found that the value may also be present in reports other than just blood reports. To mitigate this issue, we check for hemoglobin values in all reports and then extract the most recent one. Similarly, there were also cases where "end-date" of medication and "department-name" for encounter reports were missing or misplaced. We handled such cases following discussions with the data warehouse coordinator. To summarize, we can deduce that the patient data records are noisy due to various reasons and a preprocessing module is required to handle these issues. 6. Conclusions and Future Work We have presented here a new method for automated clinical trial recruitment system. We have shown, through our results and discussion, that any automated recruitment system suffices as a prescreening process that significantly reduces the workload in recruiting patients, even if it cannot completely replace manual intervention. Our system works on the hypothesis that the performance can be greatly enhanced by converting unstructured free clinical text into a structured 10 form. To validate our hypothesis, we built modules that extract key data elements from the unstructured text on the basis of given eligibility criteria. We evaluated our system on two datasets: one of 198 patients and one of 3002 patients. Our experiments show highly favorable results and affirm our hypothesis. For future research, we aim to evaluate the reproducibility of our system for PARAGON trial at other institutions. We also intend to build further modules to use the framework for other clinical trials. Acknowledgments This work was made possible by funding from the National Library of Medicine: R00LM011389 and R01LM011416 and Novartis. Dr. Sanjiv Shah is supported by grants from the National Institutes of Health (R01 HL107577 and R01 HL127028). The authors acknowledge Prasanth Nannapaneni for his valuable ideas on extracting information from EHR. Disclosures: Dr. Shah reports receiving consulting fees from Novartis, Bayer, AstraZeneca, and Alnylam. References 1. Jensen, P.B., L.J. Jensen, and S. Brunak, Mining electronic health records: towards better research applications and clinical care. Nat Rev Genet, 2012. 13(6): p. 395--‐405. Sullivan, J. Subject Recruitment and Retention: Barrier to Success. 2004 [cited 2015 27 July]; Available from: http://www.appliedclinicaltrialsonline.com/subject--‐recruitment--‐and--‐retention--‐ barriers--‐success. Heidenreich, P.A., et al., Forecasting the future of cardiovascular disease in the United States: a policy statement from the American Heart Association. Circulation, 2011. 123(8): p. 933--‐44. Mozaffarian, D., et al., Heart disease and stroke statistics--‐--‐2015 update: a report from the American Heart Association. Circulation, 2015. 131(4): p. e29--‐322. Friedman, C.P., A.K. Wong, and D. Blumenthal, Achieving a Nationwide Learning Health System. Science Translational Medicine, 2010. 2(57): p. 57cm29--‐57cm29. Friedman, C. and M. Rigby, Conceptualising and creating a global learning health system. Int J Med Inform, 2013. 82(4): p. e63--‐71. Ma, X.--‐J., et al., A two--‐gene expression ratio predicts clinical outcome in breast cancer patients treated with tamoxifen. Cancer Cell, 2004. 5(6): p. 607--‐616. Strom, B.L., et al., Detecting pregnancy use of non--‐hormonal category X medications in electronic medical records. Vol. 18. 2011. i81--‐i86. Mathias, J.S., D. Gossett, and D.W. Baker, Use of electronic health record data to evaluate overuse of cervical cancer screening. Vol. 19. 2012. e96--‐e101. De Pauw, R., et al., Identifying prognostic factors predicting outcome in patients with chronic neck pain after multimodal treatment: A retrospective study. Man Ther, 2015. 20(4): p. 592--‐7. Onofrei, M., et al., A first step towards translating evidence into practice: heart failure in a community practice--‐based research network. Inform Prim Care, 2004. 12(3): p. 139--‐45. Johnson, S.B., et al., An Electronic Health Record Based on Structured Narrative. Journal of the American Medical Informatics Association : JAMIA, 2008. 15(1): p. 54--‐64. Zhou, L., et al., How many medication orders are entered through free--‐text in EHRs?--‐--‐a study on hypoglycemic agents. AMIA Annu Symp Proc, 2012. 2012: p. 1079--‐88. Zheng, K., et al., Handling anticipated exceptions in clinical care: investigating clinician use of 'exit strategies' in an electronic health records system. Vol. 18. 2011. 883--‐889. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 11 Raghavan, P., et al., How essential are unstructured clinical narratives and information fusion to clinical trial recruitment? AMIA Summits on Translational Science Proceedings, 2014. 2014: p. 218--‐223. Stanfill, M.H., et al., A systematic literature review of automated clinical coding and classification systems. Vol. 17. 2010. 646--‐651. Jha, A.K., The promise of electronic records: around the corner or down the road? JAMA, 2011. 306(8): p. 880--‐1. Friedman, C., T.C. Rindflesch, and M. Corn, Natural language processing: State of the art and prospects for significant progress, a workshop sponsored by the National Library of Medicine. Journal of Biomedical Informatics, 2013. 46(5): p. 765--‐773. Shivade, C., et al., A review of approaches to identifying patient phenotype cohorts using electronic health records. Vol. 21. 2014. 221--‐230. Nguyen, A.N., et al., Symbolic rule--‐based classification of lung cancer stages from free--‐text pathology reports. Vol. 17. 2010. 440--‐445. Mia Schmiedeskamp, P.P., et al., Use of International Classification of Diseases, Ninth Revision, Clinical Modification Codes and Medication Use Data to Identify Nosocomial Clostridium difficile Infection • Infection Control and Hospital Epidemiology, 2009. 30(11): p. 1070--‐1076. Penberthy, L., et al., Automated matching software for clinical trials eligibility: Measuring efficiency and flexibility. Contemporary Clinical Trials, 2010. 31(3): p. 207--‐217. Kho, A.N., et al., Use of diverse electronic medical record systems to identify genetic risk for type 2 diabetes within a genome--‐wide association study. J Am Med Inform Assoc, 2012. 19(2): p. 212--‐8. Klompas, M., et al., Automated identification of acute hepatitis B using electronic medical record data to facilitate public health surveillance. PLoS One, 2008. 3(7): p. e2626. Mani, S., et al., Early prediction of the response of breast tumors to neoadjuvant chemotherapy using quantitative MRI and machine learning. AMIA Annu Symp Proc, 2011. 2011: p. 868--‐77. Van den Bulcke, T., et al., Data mining methods for classification of Medium--‐Chain Acyl--‐CoA dehydrogenase deficiency (MCADD) using non--‐derivatized tandem MS neonatal screening data. J Biomed Inform, 2011. 44(2): p. 319--‐25. Zhao, D. and C. Weng, Combining PubMed knowledge and EHR data to develop a weighted bayesian network for pancreatic cancer prediction. J Biomed Inform, 2011. 44(5): p. 859--‐68. Kawaler, E., et al., Learning to predict post--‐hospitalization VTE risk from EHR data. AMIA Annu Symp Proc, 2012. 2012: p. 436--‐45. Lowe, H.J., et al., STRIDE--‐--‐An integrated standards--‐based translational research informatics platform. AMIA ... Annual Symposium proceedings / AMIA Symposium. AMIA Symposium, 2009. 2009: p. 391--‐395. Gregg, W., et al., StarTracker: an integrated, web--‐based clinical search engine. AMIA ... Annual Symposium proceedings / AMIA Symposium. AMIA Symposium, 2003: p. 855. Hanauer, D.A., et al., Supporting information retrieval from electronic health records: A report of University of Michigan's nine--‐year experience in developing and using the Electronic Medical Record Search Engine (EMERSE). Journal of Biomedical Informatics, 2015. 55: p. 290--‐300. Zalis, M. and M. Harris, Advanced Search of the Electronic Medical Record: Augmenting Safety and Efficiency in Radiology. Journal of the American College of Radiology, 2010. 7(8): p. 625--‐633. Lehman, L.W., et al., Risk stratification of ICU patients using topic models inferred from unstructured progress notes. AMIA Annu Symp Proc, 2012. 2012: p. 505--‐11. Carroll, R.J., A.E. Eyler, and J.C. Denny, Naive Electronic Health Record phenotype identification for Rheumatoid arthritis. AMIA Annu Symp Proc, 2011. 2011: p. 189--‐96. Liao, K.P., et al., Electronic medical records for discovery research in rheumatoid arthritis. Arthritis Care & Research, 2010. 62(8): p. 1120--‐1127. Bejan, C.A., et al., Pneumonia identification using statistical feature selection. Vol. 19. 2012. 817--‐ 823. Kopcke, F. and H.U. Prokosch, Employing computers for the recruitment into clinical trials: a comprehensive systematic review. J Med Internet Res, 2014. 16(7): p. e161. 12 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. Inclusion/Exclusion Criteria. 2015 integrating biomedical Ni, Y., et al., Automated clinical trial eligibility prescreening: increasing the efficiency of patient identification for clinical trials in the emergency department. J Am Med Inform Assoc, 2015. 22(1): p. 166--‐78. PARAGON https://sjonnalagadda.files.wordpress.com/2015/08/paragon_ie--‐criteria_10--‐01--‐2014.pdf. Bodenreider, O., The Unified Medical Language System (UMLS): terminology. Nucleic Acids Res, 2004. 32(Database issue): p. D267--‐70. Harkema, H., et al., ConText: an algorithm for determining negation, experiencer, and temporal status from clinical reports. J Biomed Inform, 2009. 42(5): p. 839--‐51. Mitchell, K.J., et al., Implementation and evaluation of a negation tagger in a pipeline--‐based system for information extract from pathology reports. Stud Health Technol Inform, 2004. 107(Pt 1): p. 663--‐7. [cited 2015 10th August]; Available from: 13
1606.08140
3
1606
2017-03-08T16:57:40
STransE: a novel embedding model of entities and relationships in knowledge bases
[ "cs.CL", "cs.AI" ]
Knowledge bases of real-world facts about entities and their relationships are useful resources for a variety of natural language processing tasks. However, because knowledge bases are typically incomplete, it is useful to be able to perform link prediction or knowledge base completion, i.e., predict whether a relationship not in the knowledge base is likely to be true. This paper combines insights from several previous link prediction models into a new embedding model STransE that represents each entity as a low-dimensional vector, and each relation by two matrices and a translation vector. STransE is a simple combination of the SE and TransE models, but it obtains better link prediction performance on two benchmark datasets than previous embedding models. Thus, STransE can serve as a new baseline for the more complex models in the link prediction task.
cs.CL
cs
STransE: a novel embedding model of entities and relationships in knowledge bases∗ Dat Quoc Nguyen1, Kairit Sirts1, Lizhen Qu2 and Mark Johnson1 1 Department of Computing, Macquarie University, Sydney, Australia [email protected], {kairit.sirts, mark.johnson}@mq.edu.au 2 NICTA, ACT 2601, Australia [email protected] Abstract Knowledge bases of real-world facts about entities and their relationships are useful re- sources for a variety of natural language pro- cessing tasks. However, because knowledge bases are typically incomplete, it is useful to be able to perform link prediction or knowl- edge base completion, i.e., predict whether a relationship not in the knowledge base is likely to be true. This paper combines insights from several previous link prediction models into a new embedding model STransE that represents each entity as a low-dimensional vector, and each relation by two matrices and a translation vector. STransE is a simple com- bination of the SE and TransE models, but it obtains better link prediction performance on two benchmark datasets than previous embed- ding models. Thus, STransE can serve as a new baseline for the more complex models in the link prediction task. Introduction 1 Knowledge bases (KBs), such as WordNet (Fell- baum, 1998), YAGO (Suchanek et al., 2007), Free- base (Bollacker et al., 2008) and DBpedia (Lehmann et al., 2015), represent relationships between entities as triples (head entity, relation, tail entity). Even very large knowledge bases are still far from com- plete (Socher et al., 2013; West et al., 2014). Link prediction or knowledge base completion systems (Nickel et al., 2016a) predict which triples not in a knowledge base are likely to be true (Taskar et ∗ A revised version of our NAACL-HLT 2016 paper with additional experimental results and latest related work. al., 2004; Bordes et al., 2011). A variety of differ- ent kinds of information is potentially useful here, including information extracted from external cor- pora (Riedel et al., 2013; Wang et al., 2014a) and the other relationships that hold between the enti- ties (Angeli and Manning, 2013; Zhao et al., 2015). For example, Toutanova et al. (2015) used informa- tion from the external ClueWeb-12 corpus to signif- icantly enhance performance. While integrating a wide variety of information sources can produce excellent results (Das et al., 2017), there are several reasons for studying sim- pler models that directly optimize a score function for the triples in a knowledge base, such as the one presented here. First, additional information sources might not be available, e.g., for knowledge bases for specialized domains. Second, models that don't exploit external resources are simpler and thus typically much faster to train than the more com- plex models using additional information. Third, the more complex models that exploit external in- formation are typically extensions of these simpler models, and are often initialized with parameters es- timated by such simpler models, so improvements to the simpler models should yield corresponding im- provements to the more complex models as well. Embedding models for KB completion associate entities and/or relations with dense feature vectors or matrices. Such models obtain state-of-the-art per- formance (Nickel et al., 2011; Bordes et al., 2011; Bordes et al., 2012; Bordes et al., 2013; Socher et al., 2013; Wang et al., 2014b; Guu et al., 2015) and generalize to large KBs (Krompass et al., 2015). Ta- ble 1 summarizes a number of prominent embedding Model SE Unstructured TransE DISTMULT NTN TransH TransD TransR TranSparse Our STransE Score function fr(h, t) (cid:107)Wr,1h − Wr,2t(cid:107)(cid:96)1/2 ; Wr,1, Wr,2 ∈ Rk×k (cid:107)h − t(cid:107)(cid:96)1/2 (cid:107)h + r − t(cid:107)(cid:96)1/2 ; r ∈ Rk h(cid:62)Wrt ; Wr is a diagonal matrix ∈ Rk×k r tanh(h(cid:62)Mrt + Wr,1h + Wr,2t + br) ; ur, br ∈ Rd; Mr ∈ Rk×k×d; Wr,1, Wr,2 ∈ Rd×k u(cid:62) (cid:107)(I − rpr(cid:62) (cid:107)(I + rph(cid:62) (cid:107)Wrh + r − Wrt(cid:107)(cid:96)1/2 ; Wr ∈ Rd×k ; r ∈ Rd (cid:107)Wh r ∈ Rd×k; θh r , θt (cid:107)Wr,1h + r − Wr,2t(cid:107)(cid:96)1/2 ; Wr,1, Wr,2 ∈ Rk×k; r ∈ Rk p )h + r − (I − rpr(cid:62) p )h + r − (I + rpt(cid:62) p )t(cid:107)(cid:96)1/2 ; rp, r ∈ Rk ; I: Identity matrix size k × k p )t(cid:107)(cid:96)1/2 ; rp, r ∈ Rd ; hp, tp ∈ Rk ; I: Identity matrix size d × k AdaDelta Opt. SGD SGD SGD AdaGrad L-BFGS SGD r)t(cid:107)(cid:96)1/2 ; Wh r , Wt SGD SGD SGD r )h + r − Wt r (θh r(θt r ∈ R ; r ∈ Rd Table 1: The score functions fr(h, t) and the optimization methods (Opt.) of several prominent embedding models for KB completion. In all of these the entities h and t are represented by vectors h and t ∈ Rk respectively. models for KB completion. Let (h, r, t) represent a triple. In all of the models discussed here, the head entity h and the tail entity t are represented by vectors h and t ∈ Rk respec- tively. The Unstructured model (Bordes et al., 2012) assumes that h ≈ t. As the Unstructured model does not take the relationship r into account, it can- not distinguish different relation types. The Struc- tured Embedding (SE) model (Bordes et al., 2011) extends the unstructured model by assuming that h and t are similar only in a relation-dependent sub- space. It represents each relation r with two matri- ces Wr,1 and Wr,2 ∈ Rk×k, which are chosen so that Wr,1h ≈ Wr,2t. The TransE model (Bordes et al., 2013) is inspired by models such as Word2Vec (Mikolov et al., 2013) where relationships between words often correspond to translations in latent fea- ture space. The TransE model represents each rela- tion r by a translation vector r ∈ Rk, which is cho- sen so that h + r ≈ t. The primary contribution of this paper is that two very simple relation-prediction models, SE and TransE, can be combined into a single model, which we call STransE.1 Specifically, we use relation- specific matrices Wr,1 and Wr,2 as in the SE model to identify the relation-dependent aspects of both h and t, and use a vector r as in the TransE model to describe the relationship between h and t in this subspace. Specifically, our new KB completion model STransE chooses Wr,1, Wr,2 and r so that Wr,1h + r ≈ Wr,2t. That is, a TransE-style rela- tionship holds in some relation-dependent subspace, and crucially, this subspace may involve very dif- ferent projections of the head h and tail t. So Wr,1 and Wr,2 can highlight, suppress, or even change the sign of, relation-specific attributes of h and t. For example, for the "purchases" relationship, certain attributes of individuals h (e.g., age, gender, mari- tal status) are presumably strongly correlated with very different attributes of objects t (e.g., sports car, washing machine and the like). As we show below, STransE performs better than the SE and TransE models and other state-of-the-art link prediction models on two standard link predic- tion datasets WN18 and FB15k, so it can serve as a new baseline for KB completion. We expect that the STransE will also be able to serve as the basis for extended models that exploit a wider variety of information sources, just as TransE does. 2 Our approach Let E denote the set of entities and R the set of re- lation types. For each triple (h, r, t), where h, t ∈ E and r ∈ R, the STransE model defines a score func- tion fr(h, t) of its implausibility. Our goal is to choose f such that the score fr(h, t) of a plausi- ble triple (h, r, t) is smaller than the score fr(cid:48)(h(cid:48), t(cid:48)) of an implausible triple (h(cid:48), r(cid:48), t(cid:48)). We define the STransE score function f as follows: fr(h, t) = (cid:107)Wr,1h + r − Wr,2t(cid:107)(cid:96)1/2 1Source code: https://github.com/datquocnguyen/STransE using either the (cid:96)1 or the (cid:96)2-norm (the choice is made using validation data; in our experiments we found that the (cid:96)1 norm gave slightly better results). To learn the vectors and matrices we minimize the fol- lowing margin-based objective function: L = [γ + fr(h, t) − fr(h(cid:48), t(cid:48))]+ (cid:88) (h,r,t)∈G (h(cid:48),r,t(cid:48))∈G(cid:48) (h,r,t) where [x]+ = max(0, x), γ is the margin hyper- parameter, G is the training set consisting of correct triples, and G(cid:48) (h,r,t) = {(h(cid:48), r, t) h(cid:48) ∈ E, (h(cid:48), r, t) /∈ G} ∪ {(h, r, t(cid:48)) t(cid:48) ∈ E, (h, r, t(cid:48)) /∈ G} is the set of incorrect triples generated by corrupting a correct triple (h, r, t) ∈ G. We use Stochastic Gradient Descent (SGD) to minimize L, and impose the following constraints during training: (cid:107)h(cid:107)2 (cid:54) 1, (cid:107)r(cid:107)2 (cid:54) 1, (cid:107)t(cid:107)2 (cid:54) 1, (cid:107)Wr,1h(cid:107)2 (cid:54) 1 and (cid:107)Wr,2t(cid:107)2 (cid:54) 1. 3 Related work Table 1 summarizes related embedding models for link prediction and KB completion. The models differ in the score functions fr(h, t) and the algo- rithms used to optimize the margin-based objective function, e.g., SGD, AdaGrad (Duchi et al., 2011), AdaDelta (Zeiler, 2012) and L-BFGS (Liu and No- cedal, 1989). DISTMULT (Yang et al., 2015) is based on a Bilinear model (Nickel et al., 2011; Bordes et al., 2012; Jenatton et al., 2012) where each relation is represented by a diagonal rather than a full matrix. The neural tensor network (NTN) model (Socher et al., 2013) uses a bilinear tensor operator to represent each relation while ProjE (Shi and Weninger, 2017) could be viewed as a simplified version of NTN with diagonal matrices. Similar quadratic forms are used to model entities and relations in KG2E (He et al., 2015), ComplEx (Trouillon et al., 2016), TATEC (Garc´ıa-Dur´an et al., 2016) and RSTE (Tay et al., 2017). In addition, HolE (Nickel et al., 2016b) uses circular correlation-a compositional operator-which could be interpreted as a compres- sion of the tensor product. The TransH model (Wang et al., 2014b) asso- ciates each relation with a relation-specific hyper- plane and uses a projection vector to project en- tity vectors onto that hyperplane. TransD (Ji et al., 2015) and TransR/CTransR (Lin et al., 2015b) ex- tend the TransH model using two projection vec- tors and a matrix to project entity vectors into a relation-specific space, respectively. TransD learns a relation-role specific mapping just as STransE, but represents this mapping by projection vectors rather than full matrices, as in STransE. The lppTransD model (Yoon et al., 2016) extends TransD to ad- ditionally use two projection vectors for represent- ing each relation. In fact, our STransE model and TranSparse (Ji et al., 2016) can be viewed as direct extensions of the TransR model, where head and tail entities are associated with their own projection ma- trices, rather than using the same matrix for both, as in TransR and CTransR. Recently, several authors have shown that relation paths between entities in KBs provide richer infor- mation and improve the relationship prediction (Lin et al., 2015a; Garc´ıa-Dur´an et al., 2015; Guu et al., 2015; Wang et al., 2016; Feng et al., 2016; Liu et al., 2016; Niepert, 2016; Wei et al., 2016; Toutanova et al., 2016; Nguyen et al., 2016). In addition, Nickel et al. (2016a) reviews other approaches for learning from KBs and multi-relational data. 4 Experiments For link prediction evaluation, we conduct experi- ments and compare the performance of our STransE model with published results on the benchmark WN18 and FB15k datasets (Bordes et al., 2013). In- formation about these datasets is given in Table 2. Dataset WN18 FB15k #E 40,943 14,951 #R 18 1,345 #Train 141,442 483,142 #Valid #Test 5,000 5,000 59,071 50,000 Table 2: Statistics of the experimental datasets used in this study (and previous works). #E is the number of entities, #R is the number of relation types, and #Train, #Valid and #Test are the numbers of triples in the training, validation and test sets, respectively. 4.1 Task and evaluation protocol The link prediction task (Bordes et al., 2011; Bordes et al., 2012; Bordes et al., 2013) predicts the head or tail entity given the relation type and the other entity, i.e. predicting h given (?, r, t) or predicting t given (h, r, ?) where ? denotes the missing element. The Method SE (Bordes et al., 2011) Unstructured (Bordes et al., 2012) TransE (Bordes et al., 2013) TransH (Wang et al., 2014b) TransR (Lin et al., 2015b) CTransR (Lin et al., 2015b) KG2E (He et al., 2015) TransD (Ji et al., 2015) lppTransD (Yoon et al., 2016) TranSparse (Ji et al., 2016) TATEC (Garc´ıa-Dur´an et al., 2016) NTN (Socher et al., 2013) DISTMULT (Yang et al., 2015) HolE (Nickel et al., 2016b) Our STransE RTransE (Garc´ıa-Dur´an et al., 2015) PTransE (Lin et al., 2015a) GAKE (Feng et al., 2016) Gaifman (Niepert, 2016) Hiri (Liu et al., 2016) NLFeat (Toutanova and Chen, 2015) TEKE H (Wang and Li, 2016) SSP (Xiao et al., 2017) MR 1011 315 263 401 238 231 342 224 283 223 - - - - 217 - - - - - - 127 168 Raw WN18 H10 MRR MR 273 68.5 1074 35.3 75.4 243 212 73.0 198 79.8 199 79.4 174 80.2 79.6 194 195 80.5 187 80.1 - - - - - - - - 80.9 219 - - - 207 228 - - - - - - - 80.3 212 163 81.2 - - - - - - - - - - - - - 0.616 0.469 - - - - - - - - Filtered WN18 FB15k FB15k H10 MRR MR H10 MRR MR H10 MRR 28.8 4.5 34.9 45.7 48.2 48.4 48.9 53.4 53.0 53.5 - - - - 51.6 - 51.4 44.5 - - - 51.2 57.2 - - - - - - - - - - - - - 0.232 0.252 - - - - - - - - - - - - - - - - - - - 0.53 0.83 0.938 0.657 - - - - 0.691 0.940 - - - - - - - - - - - - - 0.25 0.35 0.524 0.543 - - - - 0.603 0.822 - - 80.5 38.2 89.2 86.7 92.0 92.3 92.8 92.2 94.3 93.2 - 66.1 94.2 94.9 93.4 - - - 93.9 90.8 94.3 92.9 93.2 985 304 251 303 225 218 331 212 270 211 - - - - 206 - - - 352 - - 114 156 162 979 125 87 77 75 59 91 78 82 58 - - - 69 50 58 119 75 - - 108 82 39.8 6.3 47.1 64.4 68.7 70.2 74.0 77.3 78.7 79.5 76.7 41.4 57.7 73.9 79.7 76.2 84.6 64.8 84.2 70.3 87.0 73.0 79.0 Table 3: Link prediction results. MR, H10 and MRR denote evaluation metrics of mean rank, Hits@10 (in %) and mean reciprocal rank, respectively. "NLFeat" abbreviates Node+LinkFeat. The results for NTN (Socher et al., 2013) listed in this table are taken from Yang et al. (2015) since NTN was originally evaluated on different datasets. results are evaluated using the ranking induced by the score function fr(h, t) on test triples. For each test triple (h, r, t), we corrupted it by re- placing either h or t by each of the possible entities in turn, and then rank these candidates in ascend- ing order of their implausibility value computed by the score function. This is called as the "Raw" set- ting protocol. For the "Filtered" setting protocol de- scribed in Bordes et al. (2013), we removed any cor- rupted triples that appear in the knowledge base, to avoid cases where a correct corrupted triple might be ranked higher than the test triple. The "Filtered" setting thus provides a clearer view on the ranking performance. Following Bordes et al. (2013), we re- port the mean rank and the Hits@10 (i.e., the pro- portion of test triples in which the target entity was ranked in the top 10 predictions) for each model. In addition, we report the mean reciprocal rank, which is commonly used in information retrieval. In both "Raw" and "Filtered" settings, lower mean rank, higher mean reciprocal rank or higher Hits@10 in- dicates better link prediction performance. Following TransR (Lin et al., 2015b), TransD (Ji et al., 2015), RTransE (Garc´ıa-Dur´an et al., 2015), PTransE (Lin et al., 2015a), TATEC (Garc´ıa-Dur´an et al., 2016) and TranSparse (Ji et al., 2016), we used the entity and relation vectors produced by TransE (Bordes et al., 2013) to initialize the entity and re- lation vectors in STransE, and we initialized the re- lation matrices with identity matrices. We applied the "Bernoulli" trick used also in previous work for generating head or tail entities when sampling incor- rect triples (Wang et al., 2014b; Lin et al., 2015b; He et al., 2015; Ji et al., 2015; Lin et al., 2015a; Yoon et al., 2016; Ji et al., 2016). We ran SGD for 2,000 epochs to estimate the model parameters. Following Bordes et al. (2013) we used a grid search on vali- dation set to choose either the l1 or l2 norm in the score function f, as well as to set the SGD learning rate λ ∈ {0.0001, 0.0005, 0.001, 0.005, 0.01}, the margin hyper-parameter γ ∈ {1, 3, 5} and the vector size k ∈ {50, 100}. The lowest filtered mean rank on the validation set was obtained when using the l1 norm in f on both WN18 and FB15k, and when λ = 0.0005, γ = 5, and k = 50 for WN18, and λ = 0.0001, γ = 1, and k = 100 for FB15k. 4.2 Main results Table 3 compares the link prediction results of our STransE model with results reported in prior work, using the same experimental setup. The first 15 rows report the performance of the models that do not exploit information about alternative paths between head and tail entities. The next 5 rows report results of the models that exploit information about relation paths. The last 3 rows present results for the models which make use of textual mentions derived from a large external corpus. It is clear that the models with the additional ex- ternal corpus information obtained best results. In future work we plan to extend the STransE model to incorporate such additional information. Table 3 also shows that the models employing path infor- mation generally achieve better results than mod- els that do not use such information. In terms of models not exploiting path information or exter- nal information, the STransE model produces the highest filtered mean rank on WN18 and the high- est filtered Hits@10 and mean reciprocal rank on FB15k. Compared to the closely related models SE, TransE, TransR, CTransR, TransD and TranSparse, our STransE model does better than these models on both WN18 and FB15k. Following Bordes et al. (2013), Table 4 analyzes Hits@10 results on FB15k with respect to the re- lation categories defined as follows: for each rela- tion type r, we computed the averaged number ah of heads h for a pair (r, t) and the averaged number at of tails t for a pair (h, r). If ah < 1.5 and at < 1.5, then r is labeled 1-1. If ah ≥ 1.5 and at < 1.5, then r is labeled M-1. If ah < 1.5 and at ≥ 1.5, then r is labeled as 1-M. If ah ≥ 1.5 and at ≥ 1.5, then r is labeled as M-M. 1.4%, 8.9%, 14.6% and 75.1% of the test triples belong to a relation type classified as 1-1, 1-M, M-1 and M-M, respectively. Table 4 shows that in comparison to prior mod- els not using path information, STransE obtains the second highest Hits@10 result for M-M relation cat- egory at (80.1% + 83.1%)/2 = 81.6% which is 0.5% smaller than the Hits@10 result of TranSparse for M-M. However, STransE obtains 2.5% higher Hits@10 result than TranSparse for M-1. In addi- Method Predicting head h Predicting tail t 6.1 6.6 1.9 34.3 4.2 1-1 1-M M-1 M-M 1-1 1-M M-1 M-M 35.6 62.6 17.2 37.5 34.9 14.6 68.3 41.3 SE 34.5 2.5 6.6 Unstr. 43.7 65.7 18.2 47.2 43.7 19.7 66.7 50.0 TransE TransH 66.8 87.6 28.7 64.5 65.5 39.8 83.3 67.2 78.8 89.2 34.1 69.2 79.2 37.4 90.4 72.1 TransR 81.5 89.0 34.7 71.2 80.8 38.6 90.1 73.8 CTransR 92.3 94.6 66.0 69.6 92.6 67.9 94.4 73.4 KG2E TATEC 79.3 93.2 42.3 77.2 78.5 51.5 92.7 80.7 86.1 95.5 39.8 78.5 85.4 50.6 94.4 81.2 TransD lppTransD 86.0 94.2 54.4 82.2 79.7 43.2 95.3 79.7 TranSparse 86.8 95.5 44.3 80.9 86.6 56.6 94.4 83.3 STransE 82.8 94.2 50.4 80.1 82.4 56.9 93.4 83.1 Table 4: Hits@10 (in %) by the relation category on FB15k. "Unstr." abbreviates Unstructured. tion, STransE also performs better than TransD for 1-M and M-1 relation categories. We believe the improved performance of the STransE model is due to its use of full matrices, rather than just projection vectors as in TransD. This permits STransE to model diverse and complex relation categories (such as 1- M, M-1 and especially M-M) better than TransD and other similiar models. However, STransE is not as good as TransD for the 1-1 relations. Perhaps the extra parameters in STransE hurt performance in this case (note that 1-1 relations are relatively rare, so STransE does better overall). 5 Conclusion and future work This paper presented a new embedding model for link prediction and KB completion. Our STransE combines insights from several simpler embed- ding models, specifically the Structured Embedding model (Bordes et al., 2011) and the TransE model (Bordes et al., 2013), by using a low-dimensional vector and two projection matrices to represent each relation. STransE, while being conceptually sim- ple, produces highly competitive results on standard link prediction evaluations, and scores better than the embedding-based models it builds on. Thus it is a suitable candidate for serving as future baseline for more complex models in the link prediction task. In future work we plan to extend STransE to ex- ploit relation path information in knowledge bases, in a manner similar to Lin et al. (2015a), Guu et al. (2015) or Nguyen et al. (2016). Acknowledgments This research was supported by a Google award through the Natural Language Understanding Fo- cused Program, and under the Australian Re- search Council's Discovery Projects funding scheme (project number DP160102156). NICTA is funded by the Australian Government through the Department of Communications and the Australian Research Council through the ICT Centre of Excellence Program. The first author is supported by an International Postgraduate Research Scholar- ship and a NICTA NRPA Top-Up Scholarship. References [Angeli and Manning2013] Gabor Angeli and Christo- pher Manning. 2013. Philosophers are Mortal: In- ferring the Truth of Unseen Facts. In Proceedings of the Seventeenth Conference on Computational Natural Language Learning, pages 133–142. [Bollacker et al.2008] Kurt Bollacker, Colin Evans, Praveen Paritosh, Tim Sturge, and Jamie Taylor. 2008. Freebase: A Collaboratively Created Graph Database for Structuring Human Knowledge. In Proceedings of the 2008 ACM SIGMOD Interna- tional Conference on Management of Data, pages 1247–1250. [Bordes et al.2011] Antoine Bordes, Jason Weston, Ro- nan Collobert, and Yoshua Bengio. 2011. Learning Structured Embeddings of Knowledge Bases. In Pro- ceedings of the Twenty-Fifth AAAI Conference on Ar- tificial Intelligence, pages 301–306. [Bordes et al.2012] Antoine Bordes, Xavier Glorot, Ja- son Weston, and Yoshua Bengio. 2012. A Semantic Matching Energy Function for Learning with Multi- relational Data. Machine Learning, 94(2):233–259. [Bordes et al.2013] Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. 2013. Translating Embeddings for Mod- eling Multi-relational Data. In Advances in Neural In- formation Processing Systems 26, pages 2787–2795. [Das et al.2017] Rajarshi Das, Arvind Neelakantan, David Belanger, and Andrew McCallum. 2017. Chains of reasoning over entities, relations, and text In Proceedings of using recurrent neural networks. the 15th Conference of the European Chapter of the Association for Computational Linguistics. [Duchi et al.2011] John Duchi, Elad Hazan, and Yoram Singer. 2011. Adaptive Subgradient Methods for On- line Learning and Stochastic Optimization. The Jour- nal of Machine Learning Research, 12:2121–2159. [Fellbaum1998] Christiane D. Fellbaum. 1998. WordNet: An Electronic Lexical Database. MIT Press. [Feng et al.2016] Jun Feng, Minlie Huang, Yang Yang, and xiaoyan zhu. 2016. GAKE: Graph Aware Knowl- In Proceedings of COLING 2016, edge Embedding. the 26th International Conference on Computational Linguistics: Technical Papers, pages 641–651. [Garc´ıa-Dur´an et al.2015] Alberto Garc´ıa-Dur´an, An- toine Bordes, and Nicolas Usunier. 2015. Composing Relationships with Translations. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 286–290. [Garc´ıa-Dur´an et al.2016] Alberto Garc´ıa-Dur´an, An- toine Bordes, Nicolas Usunier, and Yves Grandvalet. 2016. Combining Two and Three-Way Embed- ding Models for Link Prediction in Knowledge Journal of Artificial Intelligence Research, Bases. 55:715–742. [Guu et al.2015] Kelvin Guu, John Miller, and Percy Liang. 2015. Traversing Knowledge Graphs in Vec- tor Space. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 318–327. [He et al.2015] Shizhu He, Kang Liu, Guoliang Ji, and Jun Zhao. 2015. Learning to Represent Knowledge Graphs with Gaussian Embedding. In Proceedings of the 24th ACM International on Conference on Infor- mation and Knowledge Management, pages 623–632. Jenatton, Nicolas L. Roux, Antoine Bordes, and Guillaume R Obozinski. 2012. A latent factor model for highly multi-relational data. In Advances in Neural Information Processing Systems 25, pages 3167–3175. [Jenatton et al.2012] Rodolphe [Ji et al.2015] Guoliang Ji, Shizhu He, Liheng Xu, Kang Liu, and Jun Zhao. 2015. Knowledge Graph Embed- ding via Dynamic Mapping Matrix. In Proceedings of the 53rd Annual Meeting of the Association for Com- putational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 687–696. [Ji et al.2016] Guoliang Ji, Kang Liu, Shizhu He, and Jun 2016. Knowledge Graph Completion with Zhao. In Proceedings of Adaptive Sparse Transfer Matrix. the Thirtieth AAAI Conference on Artificial Intelli- gence, pages 985–991. [Krompass et al.2015] Denis Krompass, Stephan Baier, and Volker Tresp. 2015. Type-Constrained Represen- tation Learning in Knowledge Graphs. In Proceedings of the 14th International Semantic Web Conference, pages 640–655. [Lehmann et al.2015] Jens Lehmann, Robert Isele, Max Jakob, Anja Jentzsch, Dimitris Kontokostas, Pablo N. Mendes, Sebastian Hellmann, Mohamed Morsey, Patrick van Kleef, Soren Auer, and Christian Bizer. 2015. DBpedia - A Large-scale, Multilingual Knowl- edge Base Extracted from Wikipedia. Semantic Web, 6(2):167–195. [Lin et al.2015a] Yankai Lin, Zhiyuan Liu, Huanbo Luan, Maosong Sun, Siwei Rao, and Song Liu. 2015a. Mod- eling Relation Paths for Representation Learning of Knowledge Bases. In Proceedings of the 2015 Con- ference on Empirical Methods in Natural Language Processing, pages 705–714. [Lin et al.2015b] Yankai Lin, Zhiyuan Liu, Maosong Sun, Yang Liu, and Xuan Zhu. 2015b. Learning Entity and Relation Embeddings for Knowledge Graph Com- In Proceedings of the Twenty-Ninth AAAI pletion. Conference on Artificial Intelligence Learning, pages 2181–2187. [Liu and Nocedal1989] D. C. Liu and J. Nocedal. 1989. On the Limited Memory BFGS Method for Large Scale Optimization. Mathematical Programming, 45(3):503–528. [Liu et al.2016] Qiao Liu, Liuyi Jiang, Minghao Han, Yao Liu, and Zhiguang Qin. 2016. Hierarchical Random Walk Inference in Knowledge Graphs. In Proceedings of the 39th International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 445–454. [Mikolov et al.2013] Tomas Mikolov, Wen-tau Yih, and Geoffrey Zweig. 2013. Linguistic Regularities in Continuous Space Word Representations. In Proceed- ings of the 2013 Conference of the North American Chapter of the Association for Computational Linguis- tics: Human Language Technologies, pages 746–751. [Nguyen et al.2016] Dat Quoc Nguyen, Kairit Sirts, Lizhen Qu, and Mark Johnson. 2016. Neighborhood Mixture Model for Knowledge Base Completion. In Proceedings of The 20th SIGNLL Conference on Com- putational Natural Language Learning, pages 40–50. [Nickel et al.2011] Maximilian Nickel, Volker Tresp, and Hans-Peter Kriegel. 2011. A Three-Way Model for Collective Learning on Multi-Relational Data. In Pro- ceedings of the 28th International Conference on Ma- chine Learning, pages 809–816. [Nickel et al.2016a] Maximilian Nickel, Kevin Murphy, Volker Tresp, and Evgeniy Gabrilovich. 2016a. A Re- view of Relational Machine Learning for Knowledge Graphs. Proceedings of the IEEE, 104(1):11–33. [Nickel et al.2016b] Maximilian Nickel, Lorenzo Holo- In the Thirtieth AAAI Conference on Rosasco, and Tomaso Poggio. graphic embeddings of knowledge graphs. Proceedings of Artificial Intelligence, pages 1955–1961. 2016b. [Riedel et al.2013] Sebastian Riedel, Limin Yao, Andrew McCallum, and Benjamin M. Marlin. 2013. Rela- tion Extraction with Matrix Factorization and Univer- sal Schemas. In Proceedings of the 2013 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Tech- nologies, pages 74–84. [Shi and Weninger2017] Baoxu Shi and Tim Weninger. 2017. ProjE: Embedding Projection for Knowledge Graph Completion. In Proceedings of the 31st AAAI Conference on Artificial Intelligence. [Socher et al.2013] Richard Socher, Danqi Chen, Christo- pher D Manning, and Andrew Ng. 2013. Reason- ing With Neural Tensor Networks for Knowledge Base Completion. In Advances in Neural Information Pro- cessing Systems 26, pages 926–934. [Suchanek et al.2007] Fabian M. Suchanek, Gjergji Kas- neci, and Gerhard Weikum. 2007. YAGO: A Core of Semantic Knowledge. In Proceedings of the 16th International Conference on World Wide Web, pages 697–706. [Taskar et al.2004] Ben Taskar, Ming fai Wong, Pieter Abbeel, and Daphne Koller. 2004. Link Prediction in In Advances in Neural Information Relational Data. Processing Systems 16, pages 659–666. [Tay et al.2017] Yi Tay, Anh Tuan Luu, Siu Cheung Hui, and Falk Brauer. 2017. Random Semantic Tensor Ensemble for Scalable Knowledge Graph Link Predic- tion. In Proceedings of the Tenth ACM International Conference on Web Search and Data Mining, pages 751–760. [Toutanova and Chen2015] Kristina Toutanova and Danqi Chen. 2015. Observed Versus Latent Features for Knowledge Base and Text Inference. In Proceedings of the 3rd Workshop on Continuous Vector Space Mod- els and their Compositionality, pages 57–66. [Toutanova et al.2015] Kristina Toutanova, Danqi Chen, Patrick Pantel, Hoifung Poon, Pallavi Choudhury, and Michael Gamon. 2015. Representing Text for Joint In Pro- Embedding of Text and Knowledge Bases. ceedings of the 2015 Conference on Empirical Meth- ods in Natural Language Processing, pages 1499– 1509. [Toutanova et al.2016] Kristina Toutanova, Victoria Lin, Wen-tau Yih, Hoifung Poon, and Chris Quirk. 2016. Compositional Learning of Embeddings for Relation Paths in Knowledge Base and Text. In Proceedings of the 54th Annual Meeting of the Association for Com- putational Linguistics (Volume 1: Long Papers), pages 1434–1444. [Niepert2016] Mathias Niepert. 2016. Discriminative Gaifman Models. In Advances in Neural Information Processing Systems 29, pages 3405–3413. [Trouillon et al.2016] Th´eo Trouillon, Johannes Welbl, ´Eric Gaussier, and Guillaume Sebastian Riedel, Bouchard. 2016. Complex Embeddings for Simple [Zeiler2012] Matthew D. Zeiler. 2012. ADADELTA: CoRR, An Adaptive Learning Rate Method. abs/1212.5701. [Zhao et al.2015] Yu Zhao, Sheng Gao, Patrick Gallinari, and Jun Guo. 2015. Knowledge Base Completion by Learning Pairwise-Interaction Differentiated Em- beddings. Data Mining and Knowledge Discovery, 29(5):1486–1504. Link Prediction. In Proceedings of the 33nd Interna- tional Conference on Machine Learning, pages 2071– 2080. [Wang and Li2016] Zhigang Wang and Juan-Zi Li. 2016. Text-Enhanced Representation Learning for Knowl- In Proceedings of the Twenty-Fifth In- edge Graph. ternational Joint Conference on Artificial Intelligence, pages 1293–1299. [Wang et al.2014a] Zhen Wang, Jianwen Zhang, Jianlin Feng, and Zheng Chen. 2014a. Knowledge Graph In Proceedings of the and Text Jointly Embedding. 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1591–1601. [Wang et al.2014b] Zhen Wang, Jianwen Zhang, Jianlin Feng, and Zheng Chen. 2014b. Knowledge Graph In Pro- Embedding by Translating on Hyperplanes. ceedings of the Twenty-Eighth AAAI Conference on Artificial Intelligence, pages 1112–1119. [Wang et al.2016] Quan Wang, Jing Liu, Yuanfei Luo, Bin Wang, and Chin-Yew Lin. 2016. Knowledge Base In Proceed- Completion via Coupled Path Ranking. ings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1308–1318. [Wei et al.2016] Zhuoyu Wei, Jun Zhao, and Kang Liu. 2016. Mining Inference Formulas by Goal-Directed Random Walks. In Proceedings of the 2016 Confer- ence on Empirical Methods in Natural Language Pro- cessing, pages 1379–1388. [West et al.2014] Robert West, Evgeniy Gabrilovich, Kevin Murphy, Shaohua Sun, Rahul Gupta, and Dekang Lin. 2014. Knowledge Base Completion via Search-based Question Answering. In Proceedings of the 23rd International Conference on World Wide Web, pages 515–526. [Xiao et al.2017] Han Xiao, Minlie Huang, and Xiaoyan Zhu. 2017. SSP: semantic space projection for knowl- edge graph embedding with text descriptions. In Pro- ceedings of the 31st AAAI Conference on Artificial In- telligence. [Yang et al.2015] Bishan Yang, Wen-tau Yih, Xiaodong He, Jianfeng Gao, and Li Deng. 2015. Embedding Entities and Relations for Learning and Inference in Knowledge Bases. In Proceedings of the International Conference on Learning Representations. [Yoon et al.2016] Hee-Geun Yoon, Hyun-Je Song, Seong- Bae Park, and Se-Young Park. 2016. A Translation- Based Knowledge Graph Embedding Preserving Log- ical Property of Relations. In Proceedings of the 2016 Conference of the North American Chapter of the As- sociation for Computational Linguistics: Human Lan- guage Technologies, pages 907–916.
1805.11535
1
1805
2018-05-29T15:14:41
CoupleNet: Paying Attention to Couples with Coupled Attention for Relationship Recommendation
[ "cs.CL", "cs.AI", "cs.IR", "cs.NE" ]
Dating and romantic relationships not only play a huge role in our personal lives but also collectively influence and shape society. Today, many romantic partnerships originate from the Internet, signifying the importance of technology and the web in modern dating. In this paper, we present a text-based computational approach for estimating the relationship compatibility of two users on social media. Unlike many previous works that propose reciprocal recommender systems for online dating websites, we devise a distant supervision heuristic to obtain real world couples from social platforms such as Twitter. Our approach, the CoupleNet is an end-to-end deep learning based estimator that analyzes the social profiles of two users and subsequently performs a similarity match between the users. Intuitively, our approach performs both user profiling and match-making within a unified end-to-end framework. CoupleNet utilizes hierarchical recurrent neural models for learning representations of user profiles and subsequently coupled attention mechanisms to fuse information aggregated from two users. To the best of our knowledge, our approach is the first data-driven deep learning approach for our novel relationship recommendation problem. We benchmark our CoupleNet against several machine learning and deep learning baselines. Experimental results show that our approach outperforms all approaches significantly in terms of precision. Qualitative analysis shows that our model is capable of also producing explainable results to users.
cs.CL
cs
COUPLENET: Paying Attention to Couples with Coupled Attention for Relationship Recommendation Yi Tay1, Luu Anh Tuan2 and Siu Cheung Hui3 1, 3 Nanyang Technological University School of Computer Science and Engineering, Singapore 2 Institute for Infocomm Research, Singapore 8 1 0 2 y a M 9 2 ] L C . s c [ 1 v 5 3 5 1 1 . 5 0 8 1 : v i X r a Abstract Dating and romantic relationships not only play a huge role in our personal lives but also collectively influence and shape society. Today, many romantic partnerships originate from the Internet, signifying the importance of technology and the web in modern dating. In this paper, we present a text-based computational approach for estimating the relationship com- patibility of two users on social media. Unlike many pre- vious works that propose reciprocal recommender systems for online dating websites, we devise a distant supervision heuristic to obtain real world couples from social platforms such as Twitter. Our approach, the COUPLENET is an end- to-end deep learning based estimator that analyzes the social profiles of two users and subsequently performs a similarity match between the users. Intuitively, our approach performs both user profiling and match-making within a unified end- to-end framework. COUPLENET utilizes hierarchical recur- rent neural models for learning representations of user pro- files and subsequently coupled attention mechanisms to fuse information aggregated from two users. To the best of our knowledge, our approach is the first data-driven deep learning approach for our novel relationship recommendation prob- lem. We benchmark our COUPLENET against several ma- chine learning and deep learning baselines. Experimental re- sults show that our approach outperforms all approaches sig- nificantly in terms of precision. Qualitative analysis shows that our model is capable of also producing explainable re- sults to users. Introduction The social web has become a common means for seeking romantic companionship, made evident by the wide assort- ment of online dating sites that are available on the Internet. As such, the notion of relationship recommendation systems is not only interesting but also highly applicable. This paper investigates the possibility and effectiveness of a deep learn- ing based relationship recommendation system. An overar- ching research question is whether modern artificial intel- ligence (AI) techniques, given social profiles, can success- fully approximate successful relationships and measure the relationship compatibility of two users. Prior works in this area (Xia et al. 2015; Xia et al. 2014; Krzywicki et al. 2014; Xia et al. 2015) have been mainly Copyright c(cid:13) 2018, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. considered the 'online dating recommendation' problem, i.e., focusing on the reciprocal domain of dating social net- works (DSN) such as Tinder and OKCupid. While the func- tionality and mechanics of dating sites differ across the spec- trum, the main objective is usually to facilitate communica- tion between users, who are explicitly seeking relationships. Another key characteristic of many DSNs is the function- ality that enables a user to express interest to another user, e.g., swiping right on Tinder. Therefore, many of prior work in this area focus on reciprocal recommendation, i.e., pre- dicting if two users will like or text each other. Intuitively, we note that likes and replies on DSNs are not any concrete statements of compatibility nor evidence of any long-term relationship. For instance, a user may have many reciprocal matches on Tinder but eventually form meaningful friend- ships or relationships with only a small fraction. Our work, however, focuses on a seemingly similar but vastly different problem. Instead of relying on reciprocal sig- nals from DSNs, our work proposes a novel distant supervi- sion scheme, constructing a dataset of real world couples from regular1 social networks (RSN). Our distant supervi- sion scheme is based on Twitter, searching for tweets such as 'good night baby love you ' and 'darling i love you so ' to indicate that two users are in a stable and loving much relationship (at least at that time). Using this labeled dataset, we train a distant supervision based learning to rank model to predict relationship compatibility between two users us- ing their social profiles. The key idea is that social profiles contain cues pertaining to personality and interests that may be a predictor if whether two people are romantically com- patible. Moreover, unlike many prior works that operate on propriety datasets (Xia et al. 2014; Krzywicki et al. 2014; Xia et al. 2015), our dataset is publicly and legally obtain- able via the official Twitter API. In this work, we construct the first public dataset of approximately 2 million tweets for the task of relationship recommendation. Another key advantage is that our method trains on reg- ular social networks, which spares itself from the inherent problems faced by DSNs, e.g., deceptive self-presentation, harassment, bots, etc. (Masden and Edwards 2015). More specifically, self-presented information on DSNs might be 1We define regular social networks (RSN) as any social network that is not primarily a DSN, e.g., Facebook, Twitter. inaccurate with the sole motivation of appearing more attrac- tive (Toma and Hancock 2010; Hancock, Toma, and Ellison 2007). In our work, we argue that measuring the compatibil- ity of two users on RSN might be more suitable, eliminat- ing any potential explicit self-presentation bias. Intuitively, social posts such as tweets can reveal information regard- ing personality, interests and attributes (Arnoux et al. 2017; Wei et al. 2017). Finally, we propose COUPLENET, an end-to-end deep learning based architecture for estimating the compatibility of two users on RSNs. COUPLENET takes the social profiles of two users as an input and computes a compatibility score. This score can then be used to serve a ranked list to users and subsequently embedded in some kind of 'who to follow' service. COUPLENET is characterized by its Coupled Atten- tion, which learns to pay attention to parts of a user's pro- file dynamically based on the current candidate user. COU- PLENET also does not require any feature engineering and is a proof-of-concept of a completely text-based relationship recommender system. Additionally, COUPLENET is also ca- pable of providing explainable recommendations which we further elaborate in our qualitative experiments. Our Contributions This section provides an overview of the main contributions of this work. • We propose a novel problem of relationship recommen- dation (RSR). Different from the reciprocal recommenda- tion problem on DSNs, our RSR task operates on regular social networks (RSN), estimating long-term and serious relationship compatibility based on social posts such as tweets. • We propose a novel distant supervision scheme to con- struct the first publicly available (distributable in the form of tweet ids) dataset for the RSR task. Our dataset, which we call the LOVEBIRDS2M dataset consists of approxi- mately 2 million tweets. • We propose a novel deep learning model for the task of RSR. Our model, the COUPLENET uses hierarchical Gated Recurrent Units (GRUs) and coupled attention lay- ers to model the interactions between two users. To the best of our knowledge, this is the first deep learning model for both RSR and reciprocal recommendation problems. • We evaluate several strong machine learning and neural baselines on the RSR task. This includes the recently pro- posed DeepCoNN (Deep Co-operative Neural Networks) (Zheng, Noroozi, and Yu 2017) for item recommendation. COUPLENET significantly outperforms DeepCoNN with a 200% relative improvement in precision metrics such as Hit Ratio (HR@N). Overall findings show that a text- only deep learning system for RSR task is plausible and reasonably effective. • We show that COUPLENET produces explainable recom- mendation by analyzing the attention maps of the coupled attention layers. Related Work In this section, we review existing literature that is related to our work. Reciprocal and Dating Recommendation Prior works on online dating recommendation (Xia et al. 2015; Tu et al. 2014; Krzywicki et al. 2014; Akehurst et al. 2011) mainly focus on designing systems for dating social networks (DSN), i.e., websites whereby users are on for the specific purpose of finding a potential partner. Moreover, all existing works have primarily focused on the notion of re- ciprocal relationships, e.g., a successful signal implied a two way signal (likes or replies) between two users. Tu et al. (Tu et al. 2014) proposed a recommendation sys- tem based on Latent Dirichlet Allocation (LDA) to match users based on messaging and conversational history be- tween users. Xia et al. (Xia et al. 2015; Xia et al. 2014) cast the dating recommendation problem into a link prediction task, proposing a graph-based approach based on user inter- actions. The CCR (Content-Collaborative Reciprocal Rec- ommender System) (Akehurst et al. 2011) was proposed by Akehurtst et al. for the task of reciprocal recommenda- tion, utilizing content-based features (user profile similar- ity) and collaborative filtering features (user-user interac- tions). However, all of their approaches operate on a pro- priety dataset obtained via collaboration with online dating sites. This hinders research efforts in this domain. Our work proposes a different direction from the standard reciprocal recommendation (RR) models. The objective of our work is fundamentally different, i.e., instead of finding users that might reciprocate to each other, we learn to func- tionally approximate the essence of a good (possibly stable and serious) relationship, learning a compatibility score for two users given their regular social profiles (e.g., Twitter). To the best of our knowledge, our work is the first to build a relationship recommendation model based on a distant su- pervision signal on real world relationships. Hence, we dis- tinguish our work from all existing works on online dating recommendation. Moreover, our dataset is obtained legally via the official twitter API and can be distributed for future research. Un- like prior work (Xia et al. 2015) which might invoke privacy concerns especially with the usage of conversation history, the users employed in our study have public twitter feeds. We note that publicly available twitter datasets have been the cornerstone of many scientific studies especially in the fields of social science and natural language processing (NLP). Across scientific literature, several other aspects of online dating have been extensively studied. Nagarajan and Hearst (Nagarajan and Hearst 2009) studied self-presentation on online dating sites by specifically examining language on dating profiles. Hancock et al. presented an analysis on de- ception and lying on online dating profiles (Hancock, Toma, and Ellison 2007), reporting that at least 50% of participants provide deceptive information pertaining to physical at- tributes such as height, weight or age. Toma et al. (Toma and Hancock 2010) investigated the correlation between linguis- tic cues and deception on online dating profiles. Maldeniya et al. (Maldeniya et al. 2017) studied how textual similar- ity between user profiles impacts the likelihood of recipro- cal behavior. A recent work by Cobb and Kohno (Cobb and Kohno ) provided an extensive study which tries to under- stand users' privacy preferences and practices in online dat- ing. Finally, (Garimella, Weber, and Dal Cin 2014) studied the impacts of relationship breakups on Twitter, revealing many crucial insights pertaining to the social and linguis- tic behaviour of couples that have just broken up. In order to do so, they collect likely couple pairs and monitor them over a period of time. Notably, our data collection procedure is reminscent of theirs, i.e., using keyword-based filters to find highly likely couple pairs. However, their work utilizes a second stage crowdworker based evaluation to check for breakups. User Profiling and Friend Recommendation Our work is a cross between user profiling and user match- making systems. An earlier work, (Diaz, Metzler, and Amer- Yahia ) proposed a gradient-boosted learning-to-rank model for match-making users on a dating forum. While the au- thors ran experiments on a dating service website, the au- thors drew parallels with other match-making services such as job-seeking forums. The user profiling aspect in our work comes from the fact that we use social networks to learn user representations. As such, our approach performs both user profiling and then match-making within an end-to-end framework. (Wei et al. 2017) proposed a deep learning per- sonality detection system which is trained on social posts on Weibo and Twitter. (Arnoux et al. 2017) proposed a Twit- ter personality detection system based on machine learning models. (Benton, Arora, and Dredze 2016) learned multi- view embeddings of Twitter users using canonical correla- tion analysis for friend recommendation. From an applica- tion perspective, our work is also highly related to 'Peo- ple you might know' or 'who to follow' (WTF) services on RSNs (Gupta et al. 2013) albeit taking a romantic twist. In practical applications, our RSN based relationship recom- mender can either be deployed as part of a WTF service, or to increase the visibility of the content of users with high compatibility score. Deep Learning and Collaborative Ranking One-class collaborative filtering (also known as collabo- rative ranking) (Hu, Koren, and Volinsky 2008) is a cen- tral research problem in IR. In general, deep learning (He et al. 2017; Tay, Anh Tuan, and Hui 2018; Zhang et al. 2018) has also been recently very popular for collabora- tive ranking problems today. However, to the best of our knowledge, our work is the first deep learning based ap- proach for the online dating domain. (Zhang, Yao, and Sun 2017) provides a comprehensive overview of deep learn- ing methods for CF. Notably, our approach also follows the neural IR approach which is mainly concerned with mod- eling document-query pairs (Severyn and Moschitti 2015; Tay et al. 2017; Tay, Tuan, and Hui 2017) or user-item pairs (Zheng, Noroozi, and Yu 2017; Tay, Tuan, and Hui 2018) since we deal with the textual domain. Finally, our work leverages recent advances in deep learning, namely Gated Recurrent Units (Cho et al. 2014) and Neural Atten- tion (Yang et al. 2016; Luong, Pham, and Manning 2015; Bahdanau, Cho, and Bengio 2014). The key idea of neu- ral attention is to learn to attend to various segments of a document, eliminating noise and emphasizing the important segments for prediction. Problem Definition and Notation In this section, we introduce the formal problem definition of this work. Definition 0.1. Let U be the set of Users. Let si be the social profile of user i which is denoted by ui ∈ U. Each social pro- file si ∈ S contains η documents. Each document di ∈ si contains a maximum of L words. Given a user ui and his or her social profile si, the task of the Relationship Recom- mendation problem is to produce a ranked list of candidates based on a computed relevance score F (si, sj) where sj is the social profile of the candidate user uj. F (.) is a param- eterized function. There are mainly three types of learning to rank methods, namely pointwise, pairwise and list-wise. Pointwise con- siders each user pair individually, computing a relevance score solely based on the current sample, i.e., binary clas- sification. Pairwise trains via noise constrastive estimation, which often minimizes a loss function like the margin based hinge loss. List-wise considers an entire list of candidates and is seldom employed due to the cumbersome constraints that stem from implementation efforts. Our proposed COU- PLENET employs a pairwise paradigm. The intuition for this is that, relationship recommendation is considered very sparse and has very imbalanced classes (for each user, only one ground truth exists). Hence, training binary classifica- tion models suffers from class imbalance. Moreover, the good performance of pairwise learning to rank is also mo- tivated by our early experiments. The Love Birds Dataset Since there are no publicly available datasets for training re- lationship recommendation models, we construct our own. The goal is to construct a list of user pairs in which both users are in relationship. Our dataset is constructed via dis- tant supervision from Twitter. We call this dataset the Love Birds dataset. This not only references the metaphorical meaning of the phrase 'love birds' but also deliberately ref- erences the fact that the Twitter icon is a bird. This section describes the construction of our dataset2. Figure 1 describes the overall process of our distant supervision framework. Distant Supervision Using the Twitter public API, we collected tweets with emo- jis contains the keyword 'heart' in its description. The key is to find tweets where a user expresses love to another user. 2To facilitate further research, our dataset will be released at https://github.com/vanzytay/ICWSM18_LB2M. Dis- tribution will come in the form of tweet IDs and labels, to adhere to the regulations of the Twitter public API. For each user on this list, we crawled their timeline and col- lected 200 latest tweets from their timeline. Subsequently, we applied further preprocessing to remove explicit couple information. Notably, we do not differentiate between male and female users (since twitter API does not provide this in- formation either). The signal for distant supervision can be thought of as an explicit signal which is commonplace in recommendation problems that are based on explicit feed- back (user ratings, reviews, etc.). In this case, an act (tweet) of love / affection is the signal used. We call this explicit couple information. Removing Additional Explicit Couple Information To ensure that there are no additional explicit couple informa- tion in each user's timeline, we removed all tweets with any words of affection (heart-related emojis, 'love', 'dear', etc.). We also masked all mentions with the @USER symbol. This is to ensure that there is no explicit leak of signals in the final dataset. Naturally, a more accurate method is to determine the date in which users got to know each other and then sub- sequently construct timelines based on tweets prior to that date. Unfortunately, there is no automatic and trivial way to easily determine this information. Consequently, a fraction of their timeline would possibly have been tweeted when the users have already been together in a relationship. As such, in order to remove as much 'couple' signals, we try our best to mask such information. Why Twitter? Finally, we answer the question of why Twitter was cho- sen as our primary data source. One key desiderata was that the data should be public, differentiating ourselves from other works that use proprietary datasets (Xia et al. 2015; Tu et al. 2014). In designing our experiments, we considered two other popular social platforms, i.e., Facebook and In- stagram. Firstly, while Facebook provides explicit relation- ship information, we found that there is a lack of personal, personality-revealing posts on Facebook. For a large major- ity of users, the only signals on Facebook mainly consist of shares and likes of articles. The amount of original con- tent created per user is extremely low compared to Twitter whereby it is trivial to obtain more than 200 tweets per user. Pertaining to Instagram, we found that posts are also gener- ally much sparser especially in regards to frequency, making it difficult to amass large amounts of data per user. More- over, Instagram adds a layer of difficulty as Instagram is pri- marily multi-modal. In our Twitter dataset, we can easily mask explicit couple information by keyword filters. How- ever, it is non-trivial to mask a user's face on an image. Nev- ertheless, we would like to consider Instagram as an inter- esting line of future work. Dataset Statistics Our final dataset consists of 1.858M tweets (200 tweets per user). The total number of users is 9290 and 4645 cou- ple pairs. The couple pairs are split into training, testing and development with a 80/10/10 split. The total vocabulary size (after lowercasing) is 2.33M. Ideally, more user pairs could be included in the dataset. However, we also note that Figure 1: Overview of our distant supervision and deep learning approach for relationship recommendation. , , We observed that there are countless tweets such as 'good night baby love you ' and 'darling i love you so much ' on Twitter. As such, the initial list of tweets is crawled by watching heart and love-related emojis, e.g., etc. By collecting tweets containing these emojis, we form our initial candidate list of couple tweets (tweets in which two people in a relationship send to each other). Through this process, we collected 10 million tweets over a span of a couple of days. Each tweet will contain a sender and a target (the user mentioned and also the target of affection). Keyword Filtering We also noticed that the love related emojis do not necessarily imply a romantic relationship be- tween two users. For instance, we noticed that a large per- centage of such tweets are affection towards family mem- bers. Given the large corpus of candidates, we can apply a stricter filtering rule to obtain true couples. To this end, we use a ban list of words such as 'bro', 'sis', 'dad', 'mum' and apply regular expression based filtering on the candidates. We also observed a huge amount of music related tweets, !'. Hence, we also included e.g., 'I love this song so much music-related keywords such as 'perform', 'music', 'offi- cial' and 'song'. Finally, we also noticed that people use the heart emoji frequently when asking for someone to follow them back. As such, we also ban the word 'follow'. User-based Filtering We further restricted tweets to con- tain only a single mention. Intuitively, mentioning more than one person implies a group message rather than a couple tweet. We also checked if one user has a much higher fol- lower count over the other user. In this case, we found that this is because people send love messages to popular pop idols (we found that a huge bulk of crawled tweets came from fangirls sending love message to @harrystylesofficial). Any tweet with a user containing more than 5K followers is being removed from the candidate list. Forming Couple Pairs Finally, we arrive at 12K tweets after aggressive filtering. Using the 12K 'cleaned' couple tweets, we formed a list of couples. We sorted couples in alphabetical order, i.e., (clara, ben) becomes (ben, clara) and removed duplicate couples to ensure that there are no 'bidirectional' pairs in the dataset. Search for Tweets!Filtering TweetsForming Couples "@#I love you darling$Extracting ProfilesCoupleNet!#Trained CoupleNet0.76DistantSupervision the dataset is quite large (almost 2 million tweets) already, posing a challenge for standard hardware with mid-range graphic cards. Since this is the first dataset created for this novel problem, we leave the construction of a larger bench- mark for future work. Our Proposed Approach In this section, we introduce our deep learning architec- ture - the COUPLENET. Overall, our neural architecture is a hierarchical recurrent model (Yang et al. 2016), utilizing multi-layered attentions at different hierarchical levels. An overview of the model architecture is illustrated in Figure 2. There are two sides of the network, one for each user. Our network follows a 'Siamese' architecture, with shared pa- rameters for each side of the network. A single data input to our model comprises user pairs (U 1, U 2) (couples) and (U 1, U 3) (negative samples). Each user has K tweets each with a maximum length of L. The value of K and L are tunnable hyperparameters. Figure 2: Overview of COUPLENET model architecture il- lustrating the computation of similarity score for User 1 and User 2. Negative sampling side of the network is omitted due to lack of space. Embedding Layer For each user, the inputs to our network are a matrix of in- dices, each corresponding to a specific word in the dictio- nary. The embedding matrix W ∈ Rd×V acts as a look-up whereby each index selects a d dimensional vector, i.e., the word representation. Thus, for each user, we have K × L vectors of dimension size d. The embedding layer is shared for all users and is initialized with pretrained word vectors. Learning Tweet Representations For each user, the output of the embedding layer is a tensor of shape K × L× d. We pass each tweet through a recurrent neural network. More specifically, we use Gated Recurrent Units (GRU) encoders with attentional pooling to learn a n dimensional vector for each tweet. Gated Recurrent Units (GRU) The GRU accepts a se- quence of vectors and recursively composes each input vec- tor into a hidden state. The recursive operation of the GRU is defined as follows: zt = σ(Wzxt + Uzht−1 + bz) rt = σ(Wrxt + Urht−1 + br) ht = tanh(Wh xt + Uh(rtht−1) + bh) ht = zt ht−1 + (1 − zt) ht where ht is the hidden state at time step t, zt and rt are the update gate and reset gate at time step t respectively. σ is the sigmoid function. xt is the input to the GRU unit at time step t. Note that time step is analogous to parsing a sequence of words sequentially in this context. Wz, Wr ∈ Rd×n, Wh ∈ Rn×n are parameters of the GRU layer. Tweet-level Attention The output of each GRU is a se- quence of hidden vectors h1, h2 ··· hL ∈ H, where H ∈ RL×n. Each hidden vector is n dimensions, which corre- sponds to the parameter size of the GRU. To learn a single n dimensional vector, the last hidden vector hL is typically considered. However, a variety of pooling functions such as the average pooling, max pooling or attentional pooling can be adopted to learn more informative representations. More specifically, neural attention mechanisms are applied across the matrix H, learning a weighted representation of all hid- den vectors. Intuitively, this learns to select more informa- tive words to be passed to subsequent layers, potentially re- ducing noise and improving model performance. Y = tanh(Wy H) ; a = softmax(w(cid:62) Y) ; r = H a(cid:62) 1, ti 2 ··· ti where Wy ∈ Rn×n, w ∈ Rn are the parameters of the at- tention pooling layer. The output r ∈ Rn is the final vec- tor representation of the tweet. Note that the parameters of the attentional pooling layer are shared across all tweets and across both users. Learning User Representations Recall that each user is represented by K tweets and for each K be tweet we have a n dimensional vector. Let ti all the tweets for a given user i. In order to learn a fixed n dimensional vector for each user, we require a pooling func- tion across each user's tweet embeddings. In order to do so, we use a Coupled Attention Layer that learns to attend to U1 based on U2 (and vice versa). Similarly, for the nega- tive sample, coupled attention is applied to (U1, U3) instead. However, we only describe the operation of (U1, U2) for the sake of brevity. Coupled Attention The key intuition behind the coupled attention layer is to learn attentional representations of U1 with respect to U2 (and vice versa). Intuitively, this com- pares each tweet of U1 with each tweet of U2 and learns to weight each tweet based on this grid-wise comparison scheme. Let U1 and U2 be represented by a sequence of K tweets (each of which is a n dimensional vector) and let T1, T2 ∈ Rk×n be the tweet matrix for U1 and U2 re- spectively. For each tweet pair (t1 j), we utilize a feed- forward neural network to learn a similarity score between each tweet. As such, each value of the similarity grid is com- puted: i , t2 sij = Wc [t1 i ; t2 j ] + bc (1) ………………User 1 TweetsCoupled AttentionTweet RepresentationTweet RepresentationWordEmbeddingsGRULayerAttentionUser 1 RepresentationUser 2 RepresentationAttentionalRepresentationSum PoolingSum PoolingCosineSimilarityUser 2Tweets…………………………Word Embeddings where Wc ∈ Rn×1 and bc ∈ R1 are parameters of the feed-forward neural network. Note that these parameters are shared across all tweet pair comparisons. The score sij is a scalar value indicating the similarity between tweet i of U1 and tweet j of U2. Aggregating Strong Signals Given the similarity matrix S ∈ RK×K, the strongest signals across each dimension are aggregated using max pooling. For example, by taking a max over the columns of S, we regard the importance of tweet i of U1 as the strongest influence it has over all tweets of U2. The result of this aggregation is two K length vectors which are used to attend over the original sequence of tweets. The following operations describe the aggregation functions: arow = smax(max row S) and acol = smax(max col (2) where arow, acol ∈ RK and smax is the softmax function. Subsequently, both of these vectors are used to attentively pool the tweet vectors of each user. S) u1 = T1 acol and u2 = T2 arow where u1, u2 ∈ Rn are the final user representations for U1 and U2. Learning to Rank and Training Procedure Given embeddings u1, u2, u3, we introduce our similarity modeling layer and learning to rank objective. Given u1 and u2, the similarity between each user pair is modeled as fol- lows: s(u1, u2) = ui · u2 u1u2 (3) which is the cosine similarity function. Subsequently, the pairwise ranking loss is optimized. We use the margin-based hinge loss to optimize our model. J = max{0, λ − s(u1, u2) + s(u1, u3)} (4) where λ is the margin hyperparameter, s(u1, u2) is the simi- larity score for the ground truth (true couples) and s(u1, u3) is the similarity score for the negative sample. This function aims to discriminate between couples and non-couples by increasing the margin between the ranking scores of these user pairs. Parameters of the network can be optimized effi- ciently with stochastic gradient descent (SGD). Empirical Evaluation Our experiments are designed to answer the following Re- search Questions (RQs). • RQ1 - How well are machine learning and deep learning methods able to learn, predict, recommend relationships just based on linguistic information from social profiles? Are the romantic compatibility of two people predictable just based on textual information? • RQ2 - Does the amount of information (number of tweets per user) affect the ability to recommend relationships? • RQ3 - Are we able to derive any insight on how these models are learning to recommend relationships? Are at- tention models able to produce explainable relationship recommendations? Experimental Setup All empirical evaluation is conducted on our LoveBirds dataset which has been described earlier. This section de- scribes the evaluation metrics used and evaluation proce- dure. Evaluation Metrics Our problem is posed as a learning- to-rank problem. As such, the evaluation metrics used are as follows: • Hit Ratio @N is the ratio of test samples which are cor- rectly retrieved within the top N users. We evaluate on N = 10, 5, 3. • Accuracy is the number of test samples that have been 1 i=1 ranki correctly ranked in the top position. . • Mean Reciprocal Rank (MRR) is a commonly used in- formation retrieval metric. The reciprocal rank of a single test sample is the multiplicative inverse of the rank. The MRR is computed by 1 Q (cid:80)Q • Mean Rank is the average rank of all test samples. Evaluation Procedure Our experimental procedure sam- ples 100 users per test sample and ranks the golden sample amongst the 100 negative samples. Algorithms Compared In this section, we discuss the al- gorithms and baselines compared. Notably, there are no es- tablished benchmarks for this new problem. As such, we create 6 baselines to compare against our proposed COU- PLENET. • RankSVM (Tf-idf) - This model is a RankSVM (Support Vector Machine) trained on tf-idf vectors. This model is known to be a powerful vector space model (VSM) base- line. The feature vector of each user is a k dimensional vector, representing the top-k most common n-grams. The n-gram range is set to (1,3) and k is set to 5000 in our experiments. Following the original implementation, the kernel of RankSVM is a linear kernel. • RankSVM (Embed) - This model is a RankSVM model trained on pretrained (static, un-tuned) word embeddings. For each user pair, the feature vector is the sum of all words of both users. • MLP (Embed) - This is a Multi-layered Perceptron (MLP) model that learns to non-linearly project static word embedding. Each word embedding is projected us- ing 2 layered MLP with ReLU activations. The user repre- sentation is the sum of all transformed word embeddings. • DeepCoNN (Deep Co-operative Neural Networks) (Zheng, Noroozi, and Yu 2017) is a convolutional neu- ral network (CNN). CNNs learn n-gram features by slid- ing weights across an input. In this model, all of a user's tweets are concatenated and encoded into a d dimensional vector via a convolutional encoder. We use a fixed filter width of 3. DeepCoNN was originally proposed for item recommendation task using reviews. In our context, we adapt the DeepCoNN for our RSR task (tweets are analo- gous to reviews). Given the different objectives (MSE vs ranking), we also switch3 the factorization machine (FM) layer for the cosine similarity. The number of filters is 100. A max pooling layer is used to aggregate features. • Baseline Gated Recurrent Unit (GRU) - We compare with a baseline GRU model. Similar to the DeepCoNN model, the baseline GRU considers a user to be a concate- nation of all the user's tweets. The size of the recurrent cell is 100 dimensions. • Hierarchical GRU (H-GRU) - This model learns user representations by first encoding each tweet with a GRU encoder. The tweet embedding is the last hidden state of the GRU. Subsequently, all tweet embeddings are summed. This model serves as an ablation baseline of our model, i.e., removing all attentional pooling functions. Implementation Details All models were implemented in Tensorflow on a Linux machine. For all neural network mod- els, we follow a Siamese architecture (shared parameters for both users) and mainly vary the neural encoder. The cosine ranking function and hinge loss are then used to optimize all models. We train all models with the Adam (Kingma and Ba 2014) optimizer with a learning rate of 10−3 since this learning rate consistently produced the best results across all models. The batch size is tuned amongst {16, 32, 64} and models are trained for 10 epochs. We report the result based on the best performance on the development set. The margin is tuned amongst {0.1, 0.2, 0.5}. All model parame- ters are initialized with Gaussian distributions with a mean of 0 and standard deviation of 0.1. The L2 regularization is set to 10−8. We use a dropout of 0.5 after the convolution or recurrent layers. A dropout of 0.8 is set after the Cou- pled Attention layer in our model. Text is tokenized with NLTK's tweet tokenizer. We initialize the word embedding matrix with Glove (Pennington, Socher, and Manning 2014) trained on Twitter corpus. All words that do not appear more than 5 times are assigned unknown tokens. All tweets are truncated at a fixed length of 10 tokens. Early experiments found that raising the number of tokens per tweet does not improve the performance. The number of tweets per user is tuned amongst {10, 20, 50, 100, 150, 200} and reported in our experimental results. Discussion and Analysis Figure 3 reports the experimental results on the Love- Birds2M dataset. For all baselines and evaluation metrics, we compare across different settings of η, the number of tweets per user that is used to train the model. Firstly, we observe that COUPLENET significantly outper- forms most of the baselines. Across most metrics, there is almost a 180% − 200% relative improvement over Deep- CoNN, the state-of-the-art model for item recommendation with text data. The performance improvement over the base- line GRU model is also extremely large, i.e., with a rela- tive improvement of approximately 4 times across all met- rics. This shows that concatenating all of a user's tweets into a single document severely hurts performance. We believe 3In our problem, we found that the FM layer significantly de- graded performance. (a) HR@10 Results (b) HR@5 Results (c) HR@3 Results (d) Accuracy Results (e) MRR Results (f) Mean Rank Results Figure 3: Experimental Results on the LoveBirds2M dataset. Results are plotted against number of tweets. Best viewed in color. CoupleNet (red) outperforms all baselines. that this is due to the inability of recurrent models to handle long sequences. Moreover, the DeepCoNN performs about 2 times better than the baseline GRU model. On the other hand, we observe that H-GRU significantly improves the baseline GRU model. In the H-GRU model, se- quences are only L = 10 long but are encoded K times with shared parameters. On the other hand, the GRU model has to process K × L words, which inevitably causes performance to drop significantly. While the performance of the H-GRU model is reasonable, it is still significantly outperformed by our COUPLENET. We believe this is due to the incorporation of the attentional pooling layers in our model, which allows it to eliminate noise and focus on the important keywords. A surprising and notable strong baseline is the MLP (Em- bed) model which outperforms DeepCoNN but still per- forms much worse than COUPLENET. On the other hand, RankSVM (Embed) performs poorly. We believe that this is attributed to the insufficiency of the linear kernel of the SVM. Since RankSVM and MLP are trained on the same features, we believe that nonlinear ReLU transformations of the MLP improve the performance significantly. Moreover, the MLP model has 2 layers, which learn different levels of abstractions. Finally, the performance of RankSVM (Tf- idf) is also poor. However, we observe that RankSVM (Tf- idf) slightly outperforms RankSVM (Embed) occasionally. While other models display a clear trend in performance with respect to the number of tweets, the performance of RankSVM (Tf-idf) and RankSVM (Embed) seem to fluctu- ate across the number of user tweets. Finally, we observe a clear trend in performance gain with respect to the number of user tweets. This is intuitive be- cause more tweets provide the model with greater insight into the user's interest and personality, allowing a better match to be made. The improvement seems to follow a log- arithmic scale which suggests diminishing returns beyond a certain number of tweets. Finally, we report the time cost of COUPLENET. With 200 tweets per user, the cost of training is approximately ≈ 2 mins per epoch on a medium grade GPU. This is much faster than expected because GRUs ben- efit from parallism as they can process multiple tweets si- multaneously. Ablation Study In this section, we study the component-wise effectiveness of COUPLENET. We removed layers from COUPLENET in order to empirically motivate the design of each component. Firstly, we switched CoupleNet to a pointwise classification model, minimizing a cross entropy loss. We found that this halves the performance. As such, we observe the importance of pairwise ranking. Secondly, we swapped cosine similar- ity for a MLP layer with scalar sigmoid activation (to en- sure inputs lie within [0, 1]). We also found that the perfor- mance drops significantly. Finally, we also observe that the attention layers of COUPLENET contribute substantially to the performance of the model. More specifically, removing both the GRU attention and coupled attention layers cause performance to drop by 13.9%. Removing the couple atten- tion suffers a performance degrade of 2.5% while remov- ing the GRU attention drops performance by 3.9%. It also seems that dropping both degrades performance more than expected (not a straightforward summation of performance degradation). Model COUPLENET w/o couple attention w/o GRU attention w/o GRU attention and couple attention w/o cosine similarity w/o pairwise (using pointwise) HR@10 64.1 61.6 (-2.5%) 60.2 (-3.9%) 50.2 (-13.9%) 33.8 (-30.3%) 36.1 (-28.0%) Table 1: Component-wise ablation study with η = 200. Overall Quantitative Findings In this subsection, we describe the overall findings of our quantitative experiments. • Overall, the best HR@10 score for COUPLENET is about 64%, i.e., if an application would to recommend the top 10 prospective partners to a user, then the ground truth will appear in this list 64% of the time. Moreover, the ac- curacy is 25% (ranking out of 100 candidates) which is also reasonably high. Given the intrinsic difficulty of the problem, we believe that the performance of COUPLENET on this new problem is encouraging and promising. To answer RQ1, we believe that text-based deep learning systems for relationship recommendation are plausible. However, special care has to be taken, i.e., model selec- tion matters. • The performance significantly improves when we include more tweets per user. This answers RQ2. This is intuitive since more tweets would enable better and more infor- mative user representations, leading to a better matching performance. Qualitative Analysis In this section, we describe several insights and observations based on real4 examples from our LoveBirds20 dataset. One key advantage of COUPLENET is a greater extent of explain- ability due to the coupled attention mechanism. More specif- ically, we are able to obtain which of each user's tweets con- tributed the most to the user representation and the overall prediction. By analyzing the attention output of user pairs, we are able to derive qualitative insights. As an overall con- clusion to answer RQ3 (which will be elaborated by in the subsequent subsections), we found that COUPLENET is ca- pable of explainable recommendations if there are explicit matching signals such as user interest and demographic sim- ilarity between user pairs. Finally, we discuss some caveats and limitations of our approach. Mutual Interest between Couples is Captured in COUPLENET We observed the COUPLENET is able to capture the mutual interest between couples. Table 2 shows an example from the LoveBirds2M dataset. In general, we found that most user pairs have noisy tweets. However, we also observed that whenever couple pairs have mutual interest, COUPLENET is able to assign a high attention weight to the relevant tweets. For example, in Table 2, both couples are fans of BTS5, a Korean pop idol group. As such, tweets related to BTS are surfaced to the top via coupled attention. In the first tweet of User 1, tweets related to two entities, seokjin and hoseok, are ranked high (both entities are members of the pop idol group). This ascertains that COUPLENET is able to, to some extent, explain why two users are matched. This also val- idates the usage of our coupled attention mechanism. For 4We do not explicitly report the actual user accounts in this paper because this might violate their privacy. Actual tweets are slightly modified to protect identities from search. 5https://en.wikipedia.org/wiki/BTS_(band) instance, we could infer that User1 and User2 are matched because of their mutual interest in BTS. A limitation is that it is difficult to interpret why the other tweets (such as a thank you without much context, or supporting your family) were ranked highly. Rank User A 1 2 3 4 5 i apologize to seokjin and hoseok thank you! bts memes mayo @user @user your family! welcome hun paramore! support User B that's meant to say bts but imma too tired to more sorry for making such a mess i'm not sure if I shld post this the last couple of days have been shitty for me blur pic effects are the best Table 2: Example of top-ranked tweets from user pair (ground truth is 1) in which mutual interests have the highest attention weight. Interest specific keywords are highlighted in red. COUPLENET successfully ranks this pair at the top position. COUPLENET Infers User Attribute and Demographic by Word Usage We also discovered that COUPLENET learns to match users with similar attributes and demographics. For example, high school students will be recommended high school students at a higher probability. Note that location, age or any other information is not provided to COUPLENET. In other words, user attribute and demographic are solely inferred via a user's tweets. In Table 3, we report an example in which the top-ranked tweets (via coupled attention) are high school related tweets (homecoming, high school reception). This shows two things: (1) the coupled attention shows that the following 3 tweets were the most important tweets for pre- diction and (2) COUPLENET learns to infer user attribute and demographic without being explicitly provided with such information. We also note that both users seem to have strongly positive tweets being ranked highly in their atten- tion scores which might hint at the role of sentiment and mood in making prediction. Rank User C 1 2 3 homecoming! taking meds for sports so pumped for homecoming senior school User D high was a blast preview will be out soon this is my life homie reception Table 3: Example of top-ranked tweets from user pair (ground truth is 1) which are ranked by the Coupled Atten- tion layer. COUPLENET places school related tweets on the top. COUPLENET Ranks Successfully Even Without Explicit Signals It is intuitive that not every user will post interest or de- mographic revealing tweets. For instance, some users might exclusively post about their emotions. When analyzing the ranking outputs of COUPLENET, we found that, interest- ingly, COUPLENET can successfully rank couple pairs even when there seem to be no explicit matching signal in the so- cial profiles of both users. Table 4 shows an example where two user profiles do not share any explicit matching signals. User E and User F are a ground truth couple pair and the prediction of COUPLENET ranks User E with User F at the top position. The top tweets of User E and User F are mostly emotional tweets that are non-matching. Through this case, we understand that COU- PLENET does not simply match people with similar emo- tions together. Notably, relationship recommendation is also a problem that humans may struggle with. Many times, the reason why two people are in a relationship may be implicit or unclear (even to humans). As such, the fact that COU- PLENET ranks couple pairs correctly even when there is no explicit matching signals hints at its ability to go beyond simple keyword matching. In this case, we believe 'hidden' (latent) patterns (such as emotions and personality) of the users are being learned and modeled in order to make rec- ommendations. This shows that COUPLENET is not simply acting as a text-matching algorithm and learning features be- yond that. Rank User E 1 2 3 4 5 wanna be treated like a princess in bed with cosy clothes and fluffy socks rt if you are currently in a mess so much regret lmao some girls are just so nat- urally pretty User F can't deal with this for- ever my diet is screwed feel too sick life is shit, home is shit still care about my grades Table 4: Example of top-ranked tweets (from attention) from user pair (ground truth is 1) in which there is no explicit sig- nal. COUPLENET correctly ranks this user pair at top posi- tion. Side Note, Caveats and Limitations While we show that our approach is capable of producing interpretable results (especially when explicit signals exist), the usefulness of its explainability may still have limitations, e.g., consider Table 4 where it is clear that the results are not explainable. Firstly, there might be a complete absence of any interpretable content in two user's profiles in the first place. Secondly, explaining relationships are also challeng- ing for humans. As such, we recommend that the outputs of COUPLENET to be only used as a reference. Given that a user's profile may contain easily a hundreds to thousands of tweets, one posssible use is to use this ranked list to enable more efficient analysis by humans (such as social scientist or linguists). We believe our work provides a starting point of explainable relationship recommendation. Conclusion We introduced a new problem of relationship recommenda- tion. In order to construct a dataset, we employ a novel dis- tant supervision scheme to obtain real world couples from social media. We proposed the first deep learning model for text-based relationship recommendation. Our deep learning model, COUPLENET is characterized by its usage of hierar- chical attention-based GRUs and coupled attention layers. Performance evaluation is overall optimistic and promis- ing. Despite huge class imbalance, our approach is able to recommend at a reasonable precision (64% at HR@10 and 25% accuracy while being ranked against 100 negative sam- ples). Finally, our qualitative analysis shows three key find- ings: (1) COUPLENET finds mutual interests between users for match-making, (2) COUPLENET infers user attributes and demographics in order to make recommendations, and (3) COUPLENET can successfully match-make couples even when there is no explicit matching signals in their social pro- files, possibly leveraging emotion and personality based la- tent features for prediction. References [Akehurst et al. 2011] Akehurst, J.; Koprinska, I.; Yacef, K.; Piz- zato, L. A. S.; Kay, J.; and Rej, T. 2011. CCR - A content- collaborative reciprocal recommender for online dating. In IJCAI 2011, Proceedings of the 22nd International Joint Conference on Artificial Intelligence. [Arnoux et al. 2017] Arnoux, P.-H.; Xu, A.; Boyette, N.; Mahmud, J.; Akkiraju, R.; and Sinha, V. 2017. 25 tweets to know you: A new model to predict personality with social media. [Bahdanau, Cho, and Bengio 2014] Bahdanau, D.; Cho, K.; and Bengio, Y. 2014. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473. [Benton, Arora, and Dredze 2016] Benton, A.; Arora, R.; and Dredze, M. 2016. Learning multiview embeddings of twitter users. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, ACL 2016. [Cho et al. 2014] Cho, K.; van Merrienboer, B.; Gulc¸ehrse, C¸ .; Bougares, F.; Schwenk, H.; and Bengio, Y. 2014. Learning phrase representations using RNN encoder-decoder for statistical machine translation. CoRR abs/1406.1078. [Cobb and Kohno ] Cobb, C., and Kohno, T. How public is my pri- In Proceedings of the 26th vate life?: Privacy in online dating. International Conference on World Wide Web,WWW 2017. [Diaz, Metzler, and Amer-Yahia ] Diaz, F.; Metzler, D.; and Amer- Yahia, S. Relevance and ranking in online dating systems. In Proceeding of the 33rd International ACM SIGIR Conference on Research and Development in Information Retrieval, SIGIR 2010. [Garimella, Weber, and Dal Cin 2014] Garimella, V. R. K.; Weber, I.; and Dal Cin, S. 2014. From "i love you babe" to "leave me alone"-romantic relationship breakups on twitter. In International Conference on Social Informatics, 199–215. Springer. [Gupta et al. 2013] Gupta, P.; Goel, A.; Lin, J.; Sharma, A.; Wang, D.; and Zadeh, R. 2013. Wtf: The who to follow service at twit- ter. In Proceedings of the 22Nd International Conference on World Wide Web, WWW '13, 505–514. New York, NY, USA: ACM. [Hancock, Toma, and Ellison 2007] Hancock, J. T.; Toma, C.; and Ellison, N. 2007. The truth about lying in online dating profiles. In Proceedings of the SIGCHI conference on Human factors in com- puting systems, 449–452. ACM. [He et al. 2017] He, X.; Liao, L.; Zhang, H.; Nie, L.; Hu, X.; and Chua, T.-S. 2017. Neural collaborative filtering. In Proceedings of the 26th International Conference on World Wide Web, WWW '17. [Hu, Koren, and Volinsky 2008] Hu, Y.; Koren, Y.; and Volinsky, C. 2008. Collaborative filtering for implicit feedback datasets. In Data Mining, 2008. ICDM'08. Eighth IEEE International Conference on, 263–272. Ieee. [Kingma and Ba 2014] Kingma, D. P., and Ba, J. 2014. Adam: A method for stochastic optimization. CoRR abs/1412.6980. [Krzywicki et al. 2014] Krzywicki, A.; Wobcke, W.; Kim, Y. S.; Cai, X.; Bain, M.; Compton, P.; and Mahidadia, A. 2014. Evalua- tion and deployment of a people-to-people recommender in online dating. [Luong, Pham, and Manning 2015] Luong, M.-T.; Pham, H.; and Manning, C. D. 2015. Effective approaches to attention-based neural machine translation. arXiv preprint arXiv:1508.04025. [Maldeniya et al. 2017] Maldeniya, D.; Varghese, A.; Stuart, T.; and Romero, D. 2017. The role of optimal distinctiveness and ho- mophily in online dating. [Masden and Edwards 2015] Masden, C., and Edwards, W. K. 2015. Understanding the role of community in online dating. In Proceedings of the 33rd Annual ACM Conference on Human Fac- tors in Computing Systems, CHI '15, 535–544. New York, NY, USA: ACM. [Nagarajan and Hearst 2009] Nagarajan, M., and Hearst, M. A. 2009. An examination of language use in online dating profiles. In Proceedings of the Third International Conference on Weblogs and Social Media, ICWSM 2009, San Jose, California, USA, May 17-20, 2009. [Pennington, Socher, and Manning 2014] Pennington, J.; Socher, R.; and Manning, C. D. 2014. Glove: Global vectors for word representation. In Proceedings of the 2014 Conference on Empiri- cal Methods in Natural Language Processing, EMNLP. [Severyn and Moschitti 2015] Severyn, A., and Moschitti, A. 2015. Learning to rank short text pairs with convolutional deep neu- In Proceedings of the 38th International ACM SI- ral networks. GIR Conference on Research and Development in Information Re- trieval. [Tay, Anh Tuan, and Hui 2018] Tay, Y.; Anh Tuan, L.; and Hui, S. C. 2018. Latent relational metric learning via memory-based at- tention for collaborative ranking. In Proceedings of the 2018 World Wide Web Conference, WWW '18, 729–739. Republic and Can- ton of Geneva, Switzerland: International World Wide Web Con- ferences Steering Committee. [Tay et al. 2017] Tay, Y.; Phan, M. C.; Luu, A. T.; and Hui, S. C. 2017. Learning to rank question answer pairs with holographic dual LSTM architecture. In Proceedings of the 40th International ACM SIGIR Conference on Research and Development in Informa- tion Retrieval, 2017. [Tay, Tuan, and Hui 2017] Tay, Y.; Tuan, L. A.; and Hui, S. C. 2017. Cross temporal recurrent networks for ranking question answer pairs. arXiv preprint arXiv:1711.07656. [Tay, Tuan, and Hui 2018] Tay, Y.; Tuan, L. A.; and Hui, S. C. 2018. Multi-pointer co-attention networks for recommendation. CoRR abs/1801.09251. [Toma and Hancock 2010] Toma, C. L., and Hancock, J. T. 2010. Reading between the lines: Linguistic cues to deception in online dating profiles. In Proceedings of the CSCW, 2010. [Tu et al. 2014] Tu, K.; Ribeiro, B.; Jensen, D.; Towsley, D.; Liu, B.; Jiang, H.; and Wang, X. 2014. Online dating recommenda- tions: Matching markets and learning preferences. In Proceedings of the 23rd International Conference on World Wide Web, WWW '14 Companion, 787–792. New York, NY, USA: ACM. [Wei et al. 2017] Wei, H.; Zhang, F.; Yuan, N. J.; Cao, C.; Fu, H.; Xie, X.; Rui, Y.; and Ma, W.-Y. 2017. Beyond the words: Predict- ing user personality from heterogeneous information. In Proceed- ings of the Tenth ACM International Conference on Web Search and Data Mining, WSDM '17, 305–314. New York, NY, USA: ACM. [Xia et al. 2014] Xia, P.; Jiang, H.; Wang, X.; Chen, C.; and Liu, B. 2014. Predicting user replying behavior on a large online dating site. [Xia et al. 2015] Xia, P.; Liu, B.; Sun, Y.; and Chen, C. 2015. Re- ciprocal recommendation system for online dating. In Proceedings of the 2015 IEEE/ACM International Conference on Advances in Social Networks Analysis and Mining 2015. [Yang et al. 2016] Yang, Z.; Yang, D.; Dyer, C.; He, X.; Smola, A. J.; and Hovy, E. H. 2016. Hierarchical attention networks for document classification. [Zhang et al. 2018] Zhang, S.; Yao, L.; Sun, A.; Wang, S.; Long, G.; and Dong, M. 2018. Neurec: On nonlinear transformation for personalized ranking. arXiv preprint arXiv:1805.03002. [Zhang, Yao, and Sun 2017] Zhang, S.; Yao, L.; and Sun, A. 2017. Deep learning based recommender system: A survey and new per- spectives. arXiv preprint arXiv:1707.07435. [Zheng, Noroozi, and Yu 2017] Zheng, L.; Noroozi, V.; and Yu, P. S. 2017. Joint deep modeling of users and items using re- views for recommendation. In Proceedings of the Tenth ACM In- ternational Conference on Web Search and Data Mining, 425–434. ACM.
1808.09479
1
1808
2018-08-28T18:23:56
Residualized Factor Adaptation for Community Social Media Prediction Tasks
[ "cs.CL" ]
Predictive models over social media language have shown promise in capturing community outcomes, but approaches thus far largely neglect the socio-demographic context (e.g. age, education rates, race) of the community from which the language originates. For example, it may be inaccurate to assume people in Mobile, Alabama, where the population is relatively older, will use words the same way as those from San Francisco, where the median age is younger with a higher rate of college education. In this paper, we present residualized factor adaptation, a novel approach to community prediction tasks which both (a) effectively integrates community attributes, as well as (b) adapts linguistic features to community attributes (factors). We use eleven demographic and socioeconomic attributes, and evaluate our approach over five different community-level predictive tasks, spanning health (heart disease mortality, percent fair/poor health), psychology (life satisfaction), and economics (percent housing price increase, foreclosure rate). Our evaluation shows that residualized factor adaptation significantly improves 4 out of 5 community-level outcome predictions over prior state-of-the-art for incorporating socio-demographic contexts.
cs.CL
cs
Residualized Factor Adaptation for Community Social Media Prediction Tasks Mohammadzaman Zamani,1 H. Andrew Schwartz,1 Veronica E. Lynn,1 Salvatore Giorgi,2 and Niranjan Balasubramanian1 1 Computer Science Department, Stony Brook University 2Department of Psychology, University of Pennsylvania [email protected] 8 1 0 2 g u A 8 2 ] L C . s c [ 1 v 9 7 4 9 0 . 8 0 8 1 : v i X r a Abstract Predictive models over social media language have shown promise in capturing community outcomes, but approaches thus far largely ne- glect the socio-demographic context (e.g. age, education rates, race) of the community from which the language originates. For example, it may be inaccurate to assume people in Mobile, Alabama, where the population is relatively older, will use words the same way as those from San Francisco, where the median age is younger with a higher rate of college educa- tion. In this paper, we present residualized fac- tor adaptation, a novel approach to commu- nity prediction tasks which both (a) effectively integrates community attributes, as well as (b) adapts linguistic features to community at- tributes (factors). We use eleven demographic and socioeconomic attributes, and evaluate our approach over five different community-level predictive tasks, spanning health (heart disease mortality, percent fair/poor health), psychol- ogy (life satisfaction), and economics (per- cent housing price increase, foreclosure rate). Our evaluation shows that residualized fac- tor adaptation significantly improves 4 out of 5 community-level outcome predictions over prior state-of-the-art for incorporating socio- demographic contexts. Introduction 1 Adapting to human factors has been shown to ben- efit NLP tasks, especially in tasks that involve pre- dictions over individual social media posts (e.g., sentiment (Hovy, 2015), sarcasm, and stance de- tection (Lynn et al., 2017)). The main idea be- hind these approaches is that knowing who wrote a piece of text can help models better understand how to process it. This paper develops methods that apply this idea to community-level prediction tasks, which require making decisions over posts from a community of users. Many community- level outcomes and community-wide language are linked to socio-demographic factors (age, gender, race, education, income levels) with many so- cial scientific studies supporting their predictive value (Cohen et al., 2003), and should therefore affect how a model treats social media-based lan- guage features. For example, a high prevalence of the word "bike" in San Francisco, CA might be a signal that exercise is common in the area, while its high prevalence in Mobile, Alabama might in- dicate greater interest in motor bikes. We present a method for building language-based predictive models which integrate in and adapt to attributes of the communities generating the language. This work aims to unify two different ap- proaches developed for adapting to human fac- tors and use them for incorporating community at- tributes in community-level prediction tasks: (1) residualized controls: whereby a model is trained in two steps: first over the factors/controls and then fitting the language to the residuals of the control model (Zamani and Schwartz, 2017), and (2) user-factor adaptation: whereby linguistic features are adapted, or treated differently, based on the continuous-valued factors of the authors of the features (Lynn et al., 2017). Combining factor adaptation (FA) and residu- alized control (RC) into RFA is a non-trivial task. The intent behind both methods are quite different: whereas RC attempts to address the inherent het- erogeneity between robust control variables and noisy linguistic variables, FA enables a model to treat linguistic features differently depending on the factors. From a statistical learning perspec- tive, RC separates inference over controls from in- ference over language (model level integration), while FA brings controls and language together and makes the inference as one single step (data level integration). Additionally, FA has stricter bounds in the number of factors it can accommo- date because each new factor has a multiplicative effect on the number of learned parameters. On the other hand, each new factor for RC typically only adds one new parameter. Here, we endeavour to develop RFA such that it achieves the benefits of both approaches with little lost to the limitations. RFA inherits the challenges of the FA method with feature explosion. We address this through a sys- tematic exploration of both feature and factor se- lection. The main contributions of this work include: (1) the introduction of residualized factor adaptation which effectively combines extra-linguistic and language features, (2) the first empirical evalua- tion of applying factor adaptation for community- level prediction tasks, (3) analysis of the impact of the size of factors and factor selection in adapta- tion, and (4) state-of-the-art accuracies for each of the five tasks for which we evaluate RFA. 2 Background Social media provides easy access to a vast amount of language written by a diverse group of users, making it an increasingly popular resource for measuring community health, psychology, and economics (Coppersmith et al., 2015; Eichstaedt et al., 2015; Weeg et al., 2015; Mowery et al., 2016; Haimson and Hayes, 2017). (Coppersmith et al., 2015), for instance, examine trends in lan- guage use among Twitter users who self-reported one of ten mental health diagnoses. (Eichstaedt et al., 2015) and (Weeg et al., 2015) use Twitter to predict the prevalence rates of various health out- comes, such as heart disease mortality and depres- sion, at the county level. (Haimson and Hayes, 2017) tracked changes in the emotional well-being of transgender communities on Tumblr between 2015 and 2016. Socio-demographics are often correlated with health outcomes (such as age and heart disease), which is why such variables are often used as con- trols during analysis (Coppersmith et al., 2015; Dos Reis and Culotta, 2015; Eichstaedt et al., 2015; Weeg et al., 2015). Because of their predic- tive power, socio-demographics and other extra- linguistic information can additionally be lever- aged when building the model itself. However, a central challenge in integrating community attributes is that they have very differ- ent properties than linguistic features and can be lost, in essence, like a needle in a haystack. For example, linguistic features like n-grams are high dimensional, with each dimension having high co- variance with other dimensions and likely very lit- tle relationship with the outcome. On the other hand community features may be measured more robustly and are relatively low dimensional, of- ten obtained through well-defined measurements. Not surprisingly, (Zamani and Schwartz, 2017) showed a naive combination that simply concate- nates these two sets of features risks losing the ef- fective extra-linguistic features in a sea of weak linguistic features. They go on to show a resid- ualized control approach achieves significantly greater accuracy at economic prediction by first learning a model using extra-linguistic features (i.e. controls or community factors) and then train a language model on top of the residual error of the previous model. It is possible that even when extra-linguistic features are not directly beneficial for prediction, they can still affect people's language. Other re- lated works consider how the meaning of lan- guage changes depending on who states it. For instance, when an NLP PhD student says the word 'paper' he/she usually means something different than when a 5th grade student uses the same word (i.e. 'research paper' versus 'piece of paper'). (Hu et al., 2017) noted the same words can have different meanings if different people say them. This idea of contextualizing language with extra- linguistic information has been the basis for mul- tiple models: (Hovy, 2015) learn age- and gender- specific word embeddings, leading to significant improvements for three text classification tasks. (Volkova et al., 2013) found that using gender- specific features lead to improvements in senti- ment analysis over a gender-agnostic model. Most recently, (Lynn et al., 2017) proposed a domain adaptation-inspired method for composing user- level, extra-linguistic information with message- level features, leading to improvements for mul- tiple text classification tasks; we build off of this approach and that of (Zamani and Schwartz, 2017) in this paper. While (Lynn et al., 2017) injected user-level info into message-level tasks, we are investigat- ing whether same-level adaptation techniques are similarly useful. We also try to find the circumstances under which each of the adaptation and residualized con- trol approaches are more powerful, and we take on the non-trivial task of exploiting concepts from both the adaptation and the residualized control techniques at the same time, finding that they add even more power when combined with one an- other. 3 Method We describe residualized factor adaptation (RFA), an approach to text-based prediction utilizing extra-linguistic factors (also called controls -- often demographic or socioeconomic information). The key challenge for RFA lies in effectively combin- ing two different types of features. The language- based features, extracted from the tweets, are nu- merous but are only weak indicators of the out- comes. The socioeconomic and demographic fea- tures, on the other hand, are strong indicators but fewer in number. Naively combining both sets of features ignores this crucial difference in their pre- dictive abilities, potentially resulting in important features getting drowned out. We first describe two methods that effectively combine extra-linguistic factors at two different levels: 1) Residualized control is a model-level combination method which builds different mod- els for each type of feature, then combines the re- sults of these models to make the final outcome prediction. 2) Factor adaptation is a feature-level combination method that composes the two fea- ture sets with one another to produce a trans- formed feature space over which a single model may be built. Finally, we present our combined method of Residualized Factor Adaptation which takes advantage of both concepts without explod- ing model parameters. 3.1 Residualized Control Prediction Language-based features and community-level at- tributes are qualitatively different modalities. The extra-linguistic variables, while few in number, are mostly unbiased and follow a normal distribution, which can be used to build a strong outcome pre- dictor. However, without special treatment, the signal in extra-linguistic variables can be over- whelmed when combined with a large number of language-based features. The residualized control approach (Zamani and Schwartz, 2017) avoids this issue by building two models. The first is a prediction model built over the extra-linguistic variables (or controls) alone. The error, or residuals, produced by this first model represents the information that was unable to be predicted using the extra-linguistic variables alone. The language-based features are there- fore brought in to improve upon the initial predic- tions by using the residuals as training labels for a model based on the linguistic features. In this way, the language-based features are able to account for additional information not captured by the initial extra-linguistic feature-only model. At test time, each instance is fed to both prediction models, and the final outcome is given as a sum of the predic- tions from both models -- the outcome predicted by the extra-linguistic model adjusted for error by the language-based model. Formally, given extra-linguistic features XEL and language features XL, the residualized control models are built as follows:  = Y − Y Y = α × XEL + β  (cid:39) γ × XL + λ (1) (2) (3) The extra-linguistic control model is parameter- ized by α weights and the β bias term.  denotes the residual, i.e., the error of the extra-linguistic model. The language-based model aims to predict the  residuals, with γ weights and the λ bias term as parameters. The motivation for this approach is that extra- linguistic features are more informative and less noisy than the language ones. By exploiting this two-stage learning procedure, the model is biased toward favoring the role of extra-linguistics over language features, which prevents the powerful but rare extra-linguistic features from being lost among thousands of noisy language features. 3.2 Factor Adaptation (Lynn et al., 2017) introduced user-factor adap- tation, a technique for combining message-level features with user-level information (or factors) at the feature level. User-factor adaptation, which is based on the feature augmentation approach for domain adaptation (Daum´e III, 2007), uses the extra-linguistic features to transform the language- based features. Each of the language-based fea- tures has additional, corresponding features that are a composite of itself and an extra-linguistic factor. In this way, the model is able to capture both factor-specific and factor-general properties of each of the language-based features. Following the work of (Lynn et al., 2017), we use a multiplicative composition function for com- bining the linguistic and extra-linguistic features. Instead of using user-level factors, we use extra- linguistic variables obtained at the community level, as described below. More formally, let Vj be a matrix such that: ∀j ∈ {0, d} : Vj = vj (cid:12) 1l (4) where d is the number of extra-linguistic fac- tors. With n as the number of data instances, let vj be a column vector of height n where element vj,i is the score of extra-linguistic feature j for in- stance i. Having l as the number of language vari- ables, in Eq. 4 for each factor j we make a matrix of size n × l, named Vj, in which every column is equal to vj, and Vj has the same dimensions as language feature matrix XL. Now for each factor j we use the Hadamard product to multiply Vj with XL. In this way each row of XL will be multi- plied by the corresponding row in Vj, which is also equal to the corresponding value in vj. We there- fore can write the factor adaptation as follows: XA = [V1 (cid:12) XL, V2 (cid:12) XL,··· , Vd (cid:12) XL] (5) The adapted features together with the original language-based features are used for building a single prediction model: Y = α × [XL, XA] + β (6) 3.3 Residualized Factor Adaptation Even though both the residualized control and fac- tor adaptation approaches exploit extra-linguistics, they combine these in very different ways. The former does it at the model level by learning dif- ferent models for different types of features and combining those models together. The latter does it at the data level by first combining both sets of features into a transformed feature set and then learning a single model on the obtained features. In addition, these approaches have different moti- vations and aim to accomplish different objectives. These modeling differences suggest that the two approaches could have complementary ben- efits. Residualized factor adaptation (RFA), our proposed method, inherits the advantages of both the residualized control and adaptation techniques, and is depicted in Fig. 1. There are four main steps: Step 1: Extra-linguistic control model. We build a regression model solely based on the extra- linguistics, as shown in Equation 1, and then com- Figure 1: Components of residualized factor adapta- tion. XL is language data (topic and n-gram features) and XA is adapted language data. pute the residual error of that model as in Equa- tion 2. This error is ultimately used as the outcome label in the final step of RFA. Step 2: Factor selection. Adaptation to many fac- tors can increase the model parameters drastically. We explore multiple options for selecting a subset of factors from the available extra-linguistic vari- ables. First, we consider manually selected extra- linguistic factors that are known to influence lan- guage use more than others. Second, we use the correlation of the factors with the outcome. Last, we use PCA, an unsupervised method to gener- ate new, lower-dimensional factors from the orig- inals. The purpose of factor selection is to reduce the variance and chance of overfitting. Step 3: Factor adaptation. We modify the orig- inal factor adaptation approach to account for the larger number of factors and features in this task. First, we normalize selected factors by min-max scaling and then multiply the language features by these selected factors as shown in Eq. 5. As we describe later on in Section 4.2, we use n- grams and topics as separate feature sets of lan- guage data, so adaptation gives us two correspond- ing sets of features: adapted n-grams and adapted topics. We then standardize the adapted features using Z-scores and perform feature reduction on each of the four sets of features separately. These reduced features sets are concatenated into a single large set and fed as input to a learning algorithm in the next step. Step 4: Residual Prediction. The final step, as shown in Eq. 7, is to learn the residual errors of the extra-linguistic control model, using language and adapted language features. Here, we first ap- ply feature selection and reduction on each lan- guage feature set: topics, n-grams, adapted-topics and adapted-n-grams. Then we put all of them into a single feature space on which we learn a model to predict the residual error from Step 1. To produce the final outcome predictions, the pre- dicted error from this model is combined with the predicted outcomes of the extra-linguistic control model from Step 1. The choice of feature selection is vital for RFA, both due to the fact that it multiplies the number of language features by the number of extra-linguistic features, and because it uses extra- linguistic features at two levels, one separately and one in integration with language features, poten- tially leading to overfitting. In Section 5.2, we in- vestigate different methods for feature selection to improve RFA's performance. As Fig. 1 shows, RFA is structured similarly to residualized control. However, residualized con- trol uses language data at its final step, whereas RFA uses both language and adapted language, which is obtained using the factor adaptation tech- nique. This helps RFA to benefit from the ad- vantages of both residualized control and factor adaptation. In other words, RFA combines lin- guistic and extra-linguistic features on both the feature/data level and the model level. Eq. 7 for- mulates the RFA method, in which  comes from Eq. 2 and XA is defined in Eq. 5.  (cid:39) γ × [XL, XA] + λ (7) 4 Evaluation Setup Our task is to predict various community-level outcomes based on publicly available data, in- cluding social media and other extra-linguistic data such as socioeconomic and demographic in- formation. We focus on two health-related out- comes: heart disease mortality rate (Eichstaedt et al., 2015) and percent fair/poor health life (Cu- lotta, 2014); one psychology-related outcome: life satisfaction (Schwartz et al., 2013a); and two economy outcomes: Increased real estate price rate and foreclosure rate (Zamani and Schwartz, 2017). Our high-level approach is to train sep- arate regression models for each outcome. For each county, the input is a set of tweets posted by users from that county as well as aggregate val- ues of socioeconomic and demographic variables for the county, including median income, percent- age with bachelors degrees and median age. The full list of socioeconomic/demographic variables are given in Section 4.1. The open-source Differ- ential Language Analysis ToolKit was used for the entire analysis pipeline (feature extraction through modeling) (Schwartz et al., 2017)1. 4.1 Data Set Our evaluation dataset includes information from (1) language data from Twitter three sources: messages, (2) extra-linguistic data consisting of 11 socioeconomic and demographic variables, and (3) outcome data consisting of 5 county-wise out- comes from 3 categories: Health, Psychology, and Economy. Our language data can be divided into two groups, (1) for Health and Psychological out- comes and (2) for Economical outcomes. The lan- guage data we use for Health- and Psychology- related outcomes was derived from Twitter's 10% random stream collected from July 2009 to Febru- ary 2015 and includes 1.64 billion tweets (Giorgi et al., 2018)2. For Economy outcomes, we used the language data from (Zamani and Schwartz, 2017). This data was derived from Twitter's 1% random stream collected from 2011 to 2013 and includes 131 million tweets. In both cases, the tweets were mapped to counties based on users' self-reported location strings using the procedure proposed by (Schwartz et al., 2013a). The extra-linguistic data consists of 11 variables used in previous work: 4 socioeconomic vari- ables including median income, unemployment rate, percentage of bachelors degrees, and per- centage of high school degree, as well as 7 de- mographic variables including median age; per- centage: female, black, Hispanic, foreign-born, married; and population density (Census Bureau, 2010). All variables were obtained from the US Census (Census Bureau, 2010), and we hence- forth refer to them collectively as extra-linguistic features. This dataset is only collected every 10 years, so the 2010 US Census is the most recent dataset for all of the socioeconomic and demo- graphic variables at the county level. We consider 5 county-wise measurements as outcomes, 2 health-related (heart disease mor- tality rate, fair/poor health life), 1 psychologi- cal (life satisfaction), and 2 economic (yearly in- creased real estate price rate, yearly foreclosure rate). Health and psychological data was gath- ered from the Centers for Disease Control and Pre- vention (2010b) and contains between 1,630 to 1,749 counties, depending on the outcome. The 1Available at https://github.com/dlatk 2Available at https://github.com/wwbp Domain Lang. Health Psych. Econ. HD FP LS IP FC Avg. 0.585 0.602 0.214 0.245 0.153 0.360 Controls Only 0.423 0.434 0.148 0.072 0.128 0.241 RC 3 Socio-Demographic Factors Added- Controls 0.590 0.606 0.219 0.243 0.156 0.362 0.620 0.619 0.292 0.266 0.197 0.398 FA 0.628 0.647 0.308 0.274 0.218 0.415 All Factors RFA 0.638 0.647 0.338 0.307 0.238 0.434 Controls Only 0.515 0.609 0.326 0.240 0.160 0.370 Added- Controls 0.597 0.632 0.352 0.226 0.161 0.394 RC 0.630 0.657 0.376 0.330 0.209 0.440 FA 0.636 0.685 0.353 0.344 0.240 0.452 RFA 0.657 * 0.680 0.396 * 0.402 * 0.276 * 0.482 * Table 1: R2 (variance explained) of residualized factor adaptation (RFA) versus baseline models. Results are shown for 3 hand-picked factors (age, race, education) as well as all factors. RC is residualized control and FA is factor adaptation. Each row is color-coded separately, from red (lowest value) to green (highest values). Bold and * indicate a significant (p < .05) reduction in error over the next best model (bold) and FA (*), respectively, according to paired t-tests. Lang. 0.765 0.776 0.463 0.496 0.391 0.578 Controls Only 0.718 0.781 0.571 0.490 0.401 0.592 Added- Controls 0.773 0.795 0.594 0.476 0.401 0.608 Psych. Econ. Health HD FP LS IP FC Avg. RC 0.794 0.811 0.614 0.575 0.457 0.650 FA 0.798 0.828 0.595 0.587 0.490 0.659 RFA 0.811 * 0.825 0.630 * 0.634 * 0.526 * 0.685 * Table 2: Pearson-r of residualized factor adaptation (RFA) versus baseline models (for comparison to other work which uses Pearson-r as the accuracy metric). Results are only shown for all factors. RC is residualized control and FA is factor adaptation. Each row is color-coded separately, from red (lowest value) to green (highest values). Bold and * indicate a significant (p < .05) reduction in error over the next best model (bold) and over FA (*), respectively, according to paired t-tests. economic outcomes, which have been used previ- ously in (Zamani and Schwartz, 2017), were gath- ered for the year 2013 from Zillow3. They contain 427 counties' foreclosure rate and 717 counties' increased real estate price rate. 4.2 Baselines Our baselines consist of a controls-only prediction model and a language-only prediction model. Controls-only. The controls-only model is a sim- ple regression model trained over all the 11 extra- linguistic features. Language-only. Building this baseline consists of three main steps: extracting linguistic features, performing feature reduction, and running ridge- regression (Goeman et al., 2016). Our linguis- tic features are n-gram features (1-3 grams) and topic features which include mentions of 2,000 LDA (Blei et al., 2003) derived topics previously estimated from social media (Schwartz et al., 2013b). For language data, we first pruned the sparse n-gram features to only include those that were 3http://www.zillow.com/research/data/ mentioned in at lease a percentage of the counties, then due to the importance of word count in per- formance of language predictive models(Zamani et al., 2018) we exploit a word count thresh- old and drop counties with fewer words. Then we run a correlation threshold to only keep the highest correlated features and finally we per- form a randomized principal components analysis (RPCA), an approximate PCA based on stochastic re-sampling (Rokhlin et al., 2009). We apply the correlation threshold and RPCA steps for n-grams and topics independently. For language data associated with health and psychology outcomes, we pruned the sparse n- gram features to only include those that were men- tioned in at least 95% of the counties, and used 20,000 as the word count threshold, resulting in 27,250 n-grams total. With only 1,749 training instances (one per county), feature selection and dimensionality re- duction become necessary for avoiding overfitting. We first limit the features to the top 10,000 n- grams with the highest linear relationships to each outcome. As the topic features are more informa- tive than a single n-gram, we choose to retain all 2,000 topics at this step. Then after performing RPCA we only keep 100 features for each group of ngrams and topcs. For the language data associated with economy outcomes, we pruned the n-gram features to only include those that were mentioned in at least 10% of the counties, and used 10,000 as the word-count threshold, resulting in 8,897 n-grams across 717 training instances. We use the top 8,000 n-grams and the top 1,500 topic features with the highest linear relationships to each outcome. at the end by applying RPCA we limit the dimension of each feature set to 100. We compare performances of residualized con- factor adaptation and residualized factor trol, adaptation (RFA). For all these models, we use the same settings as above to generate language fea- tures. 5 Results 5.1 Comparison of RC, FA, and RFA We first compare factor adaptation (FA), residual- ized control (RC), and residualized factor adapta- tion (RFA) using three manually selected factors: age, race (percentage of black population), and ed- ucation (percentage with bachelor's degree) rates. These three factors are often used as "controls" in prior work (Schwartz et al., 2013a; Culotta, 2014; Eichstaedt et al., 2015; Curtis et al., 2018)4 and also represent examples of demographic and so- cioeconomic measurements. In order to ensure a fair comparison, we use the same extra-linguistic features for all models. As mentioned earlier, a naive method is to di- rectly combine the extra-linguistic features with language ones in a single feature set. Here, we also compare this simple model, which we call added-controls, with the other three models. In addition, we consider a linear model solely us- ing extra-linguistics, which we call controls only. Evaluation is done using 10-fold cross-validation. R2, or variance explained, is used to measure ac- curacy. Table 1 compares results in terms of variance explained, when using the three hand-picked fac- tors vs. using all 11 extra-linguistic factors (Since past work has also used the Pearson-r metric, Ta- ble 2 shows the same results for all factors in terms 4Income has also been used frequently but it has been shown to correlate strongly with education rates. No FS 0.656 HD 0.678 FP 0.364 LS 0.425 IP 0.187 FC AVG 0.462 Separated FS 0.657 0.68 0.396 0.402 0.276 0.482 Combined FS 0.65 0.676 0.391 0.392 0.268 0.475 Early FS 0.639 0.661 0.401 0.336 0.241 0.456 Table 3: Comparing R2 using different methods of feature selection. Outcomes are heart disease (HD), fair/poor health (FP), life satisfaction (LS), increased price (IP), and foreclosure rate (FC). FS stands for fea- ture selection. Bold cells have the highest R2 for each outcome. of Pearson-r). As the table shows, FA outper- forms controls only, added-controls, and residu- alized control. RFA does even better and out- performs FA on both the hand-picked factors and when using the entire set of factors. These re- sults demonstrate the complementary nature of the residualized control and factor adaptation ap- proaches and the benefits of combining them. Even though adding controls directly, as in the "added-controls" column, works better than language-only and controls-only models, is worse than any other model that exploits both lan- guage and extra-linguistic data. This motivates the need for combining different types of features in both an additive (residualized control) and multi- plicative (factor adaptation) style. it Overall, these results show the power of RFA over the other models. RFA's improvement over FA was statistically significant for 4 out of 5 out- comes, and 3 out of 5 for residualized control. Recall that added-controls, residualized control, FA, and RFA all have access to the same set of information. The gains of RFA over FA show that RFA's structure utilizing residualized control is better suited for combining extra-linguistic and language-only features. 5.2 Feature Selection Here we investigate the impact of feature selec- tion on the overall performance of RFA. We con- sider three different combination of adaptation and feature selection, as well as adaptation without any feature selection: (1) SeparatedFS: apply fea- ture selection separately on language features and adapted language features; (2) CombinedFS: com- bine language features and adapted language fea- tures into one feature set and then apply feature selection; (3) EarlyFS: apply feature selection on Figure 2: Effect of increasing the number of selected features in univariate feature selection on both fac- tor adaptation (FA) and residualized factor adaptation (RFA) by looking at the average R2 among health and psychological outcomes. All 11 factors are used in all cases. language features, then apply adaptation on the se- lected features; and (4) NoFS: perform adaptation without any feature selection. Table 3 shows the performance of each method on all 5 outcomes, as well as the the average. SeparatedFS performs better than the others in 3 out of 5 cases, as well as leading the average R2 across all 5 outcomes. In addition, it produces the most stable results in comparison to the other methods. We therefore use this method for RFA. We perform another experiment to find the best parameter for the univariate feature selection, that is, the value of k when selecting the k-best n- gram features. Figure 2 shows the results of vary- ing the number of features used for FA and RFA. We report the average R2 across the 3 health- and psychology-related outcomes. In general, select- ing more features leads to better results, though eventually performance does begin to suffer. Re- call that our feature selection approach is to first select the k-best n-gram features based on their linear relationship with the outcome, then do a PCA on these k features to obtain a reduced- dimension vector. Even though the feature selec- tion doesn't directly increase the size of our mod- els, it effectively increases the amount of informa- tion available to the models, leading to the positive trends we see in Figure 2. Increasing Factors and Factor Selection 5.3 This experiment has two objectives: first to find out how the number of factors affects perfor- mance, and second to find an automated way to select a good subset from the extra-linguistic fac- tors. Here we vary the number of factors from 1 to 11 (i.e. all factors) and compare the effects on Figure 3: Effect of increasing number of factors on R2 of residualized factor adaptation (RFA), factor adapta- tion (FA) and residualized controls (RC) for heart dis- ease outcome. Factors are obtained through Recursive Feature Elimination (RFE) or PCA. Left plot is with original factors, and right plot is with interaction fac- tors (the product from pairing factors). RFA, FA, and RC. Factor selection in this exper- iment is done in two ways, supervised and unsu- pervised. For the supervised selection we use Re- cursive Feature Elimination, in which for each k, the least significant factors are recursively dropped until only k factors remain. For unsupervised se- lection, we use PCA to build k new factors with the highest variance. The left of Figure 3 shows how the performance of RFA, FA and RC change for heart disease out- come as the number of factors increase, using both PCA and RFE as factor selection methods. RFA outperforms FA at every factor number, and begins to outperform RC as the number of factors increases. RFA's performance, in general, tends to increase as we add more factors. Using PCA, RFA reaches close to its best performance very quickly, requiring only 5 or 6 factors; adding more factors results in longer runtimes for mini- mal gain. However, in the case of RFE, using more factors appears to be worthwhile. FA and RC both quickly plateau, or even decline, as more features are added. Since performance generally improved as more factors were added, we explored adding more fac- tors beyond the 11 that are available to us. To this end we create new factors by multiplying the exist- ing factors with one another. To account for vari- ance in the factor ranges, we first min-max nor- malize each factor. Then we consider every pair of factors and multiply their normalized values to- gether and re-normalize these new values to create a new factor. This gives a total of 55 new factors in addition to the original 11. We rerun our exper- iments with this new pool of 66 factors. The right of Figure 3 shows the results of using this expanded pool of factors. Here, the perfor- mance begins to taper off beyond 15 factors for both FA and RFA. Overall, PCA obtains its best performance with only a few factors, but then be- gins to suffer as more factors are added. RFE, on the other hand, tends to perform worse than PCA initially but remains relatively stable as more factors are added. These newly-created features turned out to be less effective than the original eleven, suggesting that the trade-off in increasing factors via combination is not worthwhile. Overall, even though reducing the number of factors through PCA-based factor selection could not beat the best accuracy, it is still very com- petitive. Given the potentially huge number of features obtained through factor adaptation, this slight decrease in performance may be worth po- tential increases in runtime. RFE-based factor se- lection, however, helps with neither the runtime nor the performance. 6 Conclusions Language-based prediction tasks involving com- munities can benefit from both socio-demographic factors and linguistic features. Because this in- formation comes from different sources and has different distributions, effective mechanisms are needed for combining them. In this paper, we present residualized factor adaptation, a method that unites two ways of approaching this prob- lem, one where strong community attributes are augmented (i.e. additive use of factors) with weak but noisy language features, and the other where the contextual differences in language use are me- diated via community attributes (i.e. adaptation to community factors). The proposed method ef- fectively combines the complementary benefits of both residualized control and factor adaptation ap- proaches to yield substantial gains over differing community-level prediction tasks across three do- mains. We see this work as part of a growing need for application-oriented approaches that not only leverage large data effectively by themselves, but do so in the context of other social scientific infor- mation that is already available and valuable. Acknowledgments This work was supported, in part, by a grant from the Templeton Religion Trust (ID #TRT0048). The funders had no role in study design, data col- lection and analysis, decision to publish, or prepa- ration of the manuscript. References Centers for disease control and prevention. (2010). underlying cause of death 1999-2010. cdc wonder online database [data set]. retrieved from http: //wonder.cdc.gov/ucd-icd10.html. David M Blei, Andrew Y Ng, and Michael I Jordan. 2003. Latent dirichlet allocation. Journal of ma- chine Learning research, 3(Jan):993 -- 1022. United States Census Bureau. 2010. Profile of general population and housing characteristics: 2010 demo- graphic profile data. https://factfinder. census.gov/faces/tableservices/ jsf/pages/productview.xhtml?pid= DEC_10_DP_DPDP1&prodType=table. Deborah A. Cohen, Thomas A. Farley, and Karen Ma- son. 2003. Why is poverty unhealthy? social and Social Science & Medicine, physical mediators. 57(9):1631 -- 1641. Glen Coppersmith, Mark Dredze, Craig Harman, and Kristy Hollingshead. 2015. From ADHD to SAD: Analyzing the language of mental health on Twitter through self-reported diagnoses. In Proceedings of the 2nd Workshop on Computational Linguistics and Clinical Psychology, pages 1 -- 10. Aron Culotta. 2014. Estimating county health statis- In Proceedings of the 32nd an- tics with twitter. nual ACM conference on Human factors in comput- ing systems, pages 1335 -- 1344. ACM. Brenda Curtis, Salvatore Giorgi, Anneke E. K. Buf- fone, Lyle H. Ungar, Robert D. Ashford, Jessie Hemmons, Dan Summers, Casey Hamilton, and H. Andrew Schwartz. 2018. Can twitter be used to predict county excessive alcohol consumption rates? PLOS ONE, 13(4):1 -- 16. Hal Daum´e III. 2007. Frustratingly easy domain adap- tation. In Proceedings of ACL. Virgile Landeiro Dos Reis and Aron Culotta. 2015. Us- ing matched samples to estimate the effects of exer- cise on mental health from Twitter. In Proceedings of the Twenty-Ninth AAAI Conference on Artificial Intelligence, pages 182 -- 188. Johannes C. Eichstaedt, H. Andrew Schwartz, Mar- garet L. Kern, Gregory Park, Darwin R. Labarthe, Raina M. Merchant, Sneha Jha, Megha Agrawal, Lukasz A. Dziurzynski, Maarten Sap, et al. 2015. Psychological language on twitter predicts county- level heart disease mortality. Psychological Science, 26(2):159 -- 169. Salvatore Giorgi, Daniel Preotiuc-Pietro, Anneke Buf- fone, Daniel Rieman, Lyle Ungar, and H. Andrew Svitlana Volkova, Theresa Wilson, and David Yarowsky. 2013. Exploring demographic lan- guage variations to improve multilingual sentiment analysis in social media. In Proceedings of EMNLP. Christopher Weeg, H Andrew Schwartz, Shawndra Hill, Raina M Merchant, Catalina Arango, and Lyle Ungar. 2015. Using Twitter to measure public dis- JMIR Public cussion of diseases: A case study. Health and Surveillance, 1(1). Mohammadzaman Zamani, Anneke Buffone, and H Andrew Schwartz. 2018. Predicting human trust- In Proceedings fulness from facebook language. of the Fifth Workshop on Computational Linguistics and Clinical Psychology: From Keyboard to Clinic, pages 174 -- 181. Mohammadzaman Zamani and H Andrew Schwartz. 2017. Using twitter language to predict the real es- tate market. In Proceedings of the 15th Conference of the European Chapter of the Association for Com- putational Linguistics: Volume 2, Short Papers, vol- ume 2, pages 28 -- 33. Schwartz. 2018. The remarkable benefit of user- level aggregation for lexical-based population-level predictions. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Pro- cessing. Association for Computational Linguistics. Jelle Goeman, Rosa Meijer, and Nimisha Chaturvedi. 2016. L1 and l2 penalized regression models. Oliver L Haimson and Gillian R Hayes. 2017. Changes in social media affect, disclosure, and sociality for a sample of transgender americans in 2016's political climate. In ICWSM, pages 72 -- 81. Dirk Hovy. 2015. Demographic factors improve clas- sification performance. In Proceedings of ACL. Tianran Hu, Ruihua Song, Maya Abtahian, Philip Ding, Xing Xie, and Jiebo Luo. 2017. A world of difference: Divergent word interpretations among people. In ICWSM. Veronica E. Lynn, Youngseo Son, Vivek Kulkarni, Ni- ranjan Balasubramanian, and H. Andrew Schwartz. 2017. Human centered NLP with user-factor adap- In Proceedings of the 2017 Conference on tation. Empirical Methods in Natural Language Process- ing, pages 1157 -- 1166. Danielle Mowery, Albert Park, Mike Conway, and Craig Bryan. 2016. Towards automatically classi- fying depressive symptoms from Twitter data for population health. Proceedings of the Workshop on Computational Modeling of People's Opinions, Per- sonality, and Emotions in Social Media, page 182. Vladimir Rokhlin, Arthur Szlam, and Mark Tygert. 2009. A randomized algorithm for principal com- ponent analysis. SIAM Journal on Matrix Analysis and Applications, 31(3):1100 -- 1124. H Andrew Schwartz, Johannes C Eichstaedt, Mar- garet L Kern, Lukasz Dziurzynski, Richard E Lucas, Megha Agrawal, Gregory J Park, Shrinidhi K Lak- shmikanth, Sneha Jha, Martin EP Seligman, et al. 2013a. Characterizing geographic variation in well- being using tweets. In ICWSM. H. Andrew Schwartz, Johannes C. Eichstaedt, Mar- garet L. Kern, Lukasz Dziurzynski, Stephanie M. Ramones, Megha Agrawal, Achal Shah, Michal Kosinski, David Stillwell, Martin E. P. Seligman, et al. 2013b. Personality, gender, and age in the language of social media: The open-vocabulary ap- proach. PloS one, 8(9):e73791. H. Andrew Schwartz, Salvatore Giorgi, Maarten Sap, Patrick Crutchley, Johannes Eichstaedt, and Lyle Ungar. 2017. Dlatk: Differential language analysis toolkit. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Process- ing: System Demonstrations, pages 55 -- 60. Associa- tion for Computational Linguistics.
1810.03581
1
1810
2018-10-08T17:09:10
Improving the Transformer Translation Model with Document-Level Context
[ "cs.CL" ]
Although the Transformer translation model (Vaswani et al., 2017) has achieved state-of-the-art performance in a variety of translation tasks, how to use document-level context to deal with discourse phenomena problematic for Transformer still remains a challenge. In this work, we extend the Transformer model with a new context encoder to represent document-level context, which is then incorporated into the original encoder and decoder. As large-scale document-level parallel corpora are usually not available, we introduce a two-step training method to take full advantage of abundant sentence-level parallel corpora and limited document-level parallel corpora. Experiments on the NIST Chinese-English datasets and the IWSLT French-English datasets show that our approach improves over Transformer significantly.
cs.CL
cs
Improving the Transformer Translation Model with Document-Level Context Jiacheng Zhang†, Huanbo Luan†, Maosong Sun†, FeiFei Zhai#, Jingfang Xu#, Min Zhang§ and Yang Liu†‡∗ †Institute for Artificial Intelligence State Key Laboratory of Intelligent Technology and Systems Department of Computer Science and Technology, Tsinghua University, Beijing, China ‡Beijing National Research Center for Information Science and Technology #Sogou Inc., Beijing, China §Soochow University, Suzhou, China 8 1 0 2 t c O 8 ] L C . s c [ 1 v 1 8 5 3 0 . 0 1 8 1 : v i X r a Abstract Although the Transformer translation model (Vaswani et al., 2017) has achieved state-of- the-art performance in a variety of transla- tion tasks, how to use document-level con- text to deal with discourse phenomena prob- lematic for Transformer still remains a chal- lenge. In this work, we extend the Transformer model with a new context encoder to repre- sent document-level context, which is then in- corporated into the original encoder and de- coder. As large-scale document-level paral- lel corpora are usually not available, we intro- duce a two-step training method to take full advantage of abundant sentence-level parallel corpora and limited document-level parallel corpora. Experiments on the NIST Chinese- English datasets and the IWSLT French- English datasets show that our approach im- proves over Transformer significantly. 1 1 Introduction The past several years have witnessed the rapid de- velopment of neural machine translation (NMT) (Sutskever et al., 2014; Bahdanau et al., 2015), which investigates the use of neural networks to model the translation process. Showing re- markable superiority over conventional statisti- cal machine translation (SMT), NMT has been recognized as the new de facto method and is widely used in commercial MT systems (Wu et al., 2016). A variety of NMT models have been pro- posed to map between natural languages such as RNNencdec (Sutskever et al., 2014), RNNsearch (Bahdanau et al., 2015), ConvS2S (Gehring et al., 2017), and Transformer (Vaswani et al., 2017). Among them, the Transformer model has achieved state-of-the-art translation performance. The ca- ∗Corresponding author: Yang Liu. 1The source code is available at https://github. com/Glaceon31/Document-Transformer pability to minimize the path length between long- distance dependencies in neural networks con- tributes to its exceptional performance. However, the Transformer model still suffers from a major drawback: it performs translation only at the sentence level and ignores document- level context. Document-level context has proven to be beneficial for improving translation perfor- mance, not only for conventional SMT (Gong et al., 2011; Hardmeier et al., 2012), but also for NMT (Wang et al., 2017; Tu et al., 2018). Baw- den et al. (2018) indicate that it is important to ex- ploit document-level context to deal with context- dependent phenomena which are problematic for machine translation such as coreference, lexical cohesion, and lexical disambiguation. While document-level NMT has attracted in- creasing attention from the community in the past two years (Jean et al., 2017; Kuang et al., 2017; Tiedemann and Scherrer, 2017; Wang et al., 2017; Maruf and Haffari, 2018; Bawden et al., 2018; Tu et al., 2018; Voita et al., 2018), to the best of our knowledge, only one existing work has en- deavored to model document-level context for the Transformer model (Voita et al., 2018). Previous approaches to document-level NMT have concen- trated on the RNNsearch model (Bahdanau et al., 2015). It is challenging to adapt these approaches to Transformer because they are designed specifi- cally for RNNsearch. In this work, we propose to extend the Trans- former model to take advantage of document- level context. The basic idea is to use multi- head self-attention (Vaswani et al., 2017) to com- pute the representation of document-level context, which is then incorporated into the encoder and decoder using multi-head attention. Since large- scale document-level parallel corpora are usually hard to acquire, we propose to train sentence- level model parameters on sentence-level paral- Figure 1: (a) The original Transformer translation model (Vaswani et al., 2017) and (b) the extended Transformer translation model that exploits document-level context. The newly introduced modules are highlighted in red. lel corpora first and then estimate document-level model parameters on document-level parallel cor- pora while keeping the learned original sentence- level Transformer model parameters fixed. Our approach has the following advantages: 2 Approach 2.1 Problem Statement Our goal is to enable the Transformer translation model (Vaswani et al., 2017) as shown in Figure 1(a) to exploit document-level context. 1. Increased capability to capture context: the use of multi-head attention, which signifi- cantly reduces the path length between long- range dependencies, helps to improve the ca- pability to capture document-level context; 2. Small computational overhead: as all newly introduced modules are based on highly par- allelizable multi-head attention, there is no significant slowdown in both training and de- coding; 3. Better use of limited labeled data: our ap- proach is capable of maintaining the superi- ority over the sentence-level counterpart even when only small-scale document-level paral- lel corpora are available. Experiments show that our approach achieves an improvement of 1.96 and 0.89 BLEU points over Transformer on Chinese-English and French- English translation respectively by exploiting document-level context. It also outperforms a state-of-the-art cache-based method (Kuang et al., 2017) adapted for Transformer. x(k) i 1 , . . . , x(k) Formally, let X = x(1), . . . , x(k), . . . , x(K) be a source-language document composed of K source sentences. We use x(k) = x(k) , . . . , x(k) to denote the k-th source sentence containing denotes the i-th word in the I words. the corre- k-th source sentence. Likewise, sponding target-language document is denoted by Y = y(1), . . . , y(k), . . . , y(K) and y(k) = y(k) 1 , . . . , y(k) represents the k-th target sentence containing J words. y(k) denotes the j-th word in the k-th target sentence. We assume that (cid:104)X, Y(cid:105) constitutes a parallel document and each (cid:104)x(k), y(k)(cid:105) forms a parallel sentence. , . . . , y(k) J j i I j Therefore, the document-level translation prob- ability is given by P (YX; θ) = K(cid:89) k=1 P (y(k)X, Y<k; θ), (1) where Y<k = y(1), . . . , y(k−1) is a partial trans- lation. For generating y(k), the source document X can be divided into three parts: (1) the k-th source sen- tence X=k = x(k), (2) the source-side document- TargetEmbeddingSelf-AttentionEncoder-DecoderAttentionFeed-ForwardSelf-AttentionSourceEmbeddingFeed-ForwardSoftmaxSourceEmbeddingSelf-AttentionContext AttentionFeed-ForwardSelf-AttentionContextEmbeddingFeed-ForwardTargetEmbeddingSelf-AttentionContext AttentionFeed-ForwardEncoder-Decoder AttentionSoftmax(a)(b) level context on the left X<k = x(1), . . . , x(k−1), and (3) the source-side document-level context on the right X>k = x(k+1), . . . , x(K). As the lan- guages used in our experiments (i.e., Chinese and English) are written left to right, we omit X>k for simplicity. We also omit the target-side document-level context Y<k due to the translation error propaga- tion problem (Wang et al., 2017): errors made in translating one sentence will be propagated to the translation process of subsequent sentences. Inter- estingly, we find that using source-side document- level context X<k, which conveys the same infor- mation with Y<k, helps to compute better repre- sentations on the target side (see Table 8). As a result, the document-level translation prob- ability can be approximated as P (YX; θ) ≈ K(cid:89) K(cid:89) k=1 = J(cid:89) P (y(k)X<k, x(k); θ), (2) P (y(k) j X<k, x(k), y(k) <j ; θ), (3) k=1 j=1 where y(k) tion. <j = y(k) 1 , . . . , y(k) j−1 is a partial transla- In this way, the document-level translation model can still be defined at the sentence level without sacrificing efficiency except the source-side document-level context X<k (or con- text for short) is taken into account. that In the following, we will introduce how to rep- resent the context (Section 2.2), how to integrate the context (Section 2.3), and how to train the model especially when only limited training data is available (Section 2.4). 2.2 Document-level Context Representation As document-level context often includes several sentences, it is important to capture long-range dependencies and identify relevant information. We use multi-head self-attention (Vaswani et al., 2017) to compute the representation of document- level context because it is capable of reducing the maximum path length between long-range depen- dencies to O(1) (Vaswani et al., 2017) and deter- mining the relative importance of different loca- tions in the context (Bahdanau et al., 2015). Be- cause of this property, multi-head self-attention has proven to be effective in other NLP tasks such as constituency parsing (Kitaev and Klein, 2018). As shown in Figure 1(b), we use a self-attentive encoder to compute the representation of X<k. The input to the self-attentive encoder is a se- quence of context word embeddings, represented as a matrix. Suppose X<k is composed of M source words: X<k = x1, . . . , xm, . . . , xM . We use xm ∈ RD×1 to denote the vector representa- tion of xm that is the sum of word embedding and positional encoding (Vaswani et al., 2017). There- fore, the matrix representation of X<k is given by Xc = [x1; . . . ; xM ], (4) where Xc ∈ RD×M is the concatenation of all vector representations of all source contextual words. The self-attentive encoder is composed of a stack of Nc identical layers. Each layer has two sub-layers. The first sub-layer is a multi-head self- attention: A(1) = MultiHead(Xc, Xc, Xc), (5) where A(1) ∈ RD×M is the hidden state calcu- lated by the multi-head self-attention at the first layer, MultiHead(Q, K, V) is a multi-head self- attention function that takes a query matrix Q, a key matrix K, and a value matrix V as inputs. In this case, Q = K = V = Xc. This is why it is called self-attention. Please refer to (Vaswani et al., 2017) for more details. Note that we follow Vaswani et al. (2017) to use residual connection and layer normalization in each sub-layer, which are omitted in the presenta- tion for simplicity. For example, the actual output of the first sub-layer is: LayerNorm(A(1) + Xc). (6) The second sub-layer is a simple, position-wise fully connected feed-forward network: C(1) = FNN(A(1)·,1 ); . . . ; FNN(A(1)·,M ) (7) where C(1) ∈ RD×M is the annotation of X<k af- ter the first layer, A(1)·,m ∈ RD×1 is the column vec- tor for the m-th contextual word, and FNN(·) is a position-wise fully connected feed-forward net- work (Vaswani et al., 2017). This process iterates Nc times as follows: (cid:16) C(n−1), C(n−1), C(n−1)(cid:17) A(n) = MultiHead (cid:105) (cid:104) (cid:104) C(n) = FNN(A(n)·,1 ); . . . ; FNN(A(n)·,M ) , (cid:105) , (8) (9) where A(n) and C(n) (n = 1, . . . , Nc) are the hid- den state and annotation at the n-th layer, respec- tively. Note that C(0) = Xc. 0 ∈ RD×1 is the vector representation of where y(k) a begin-of-sentence token and Y ∈ RD×j is the concatenation of all vectors. 2.3 Document-level Context Integration We use multi-head attention to integrate C(Nc), which is the representation of X<k, into both the encoder and the decoder. 2.3.1 i ∈ Given the k-th source sentence x(k), we use x(k) RD×1 to denote the vector representation of the i- th source word x(k) , which is a sum of word em- bedding and positional encoding. Therefore, the initial matrix representation of x(k) is Integration into the Encoder i X = [x(k) 1 ; . . . ; x(k) (10) where X ∈ RD×I is the concatenation of all vec- tor representations of source words. ], I As shown in Figure 1(b), we follow (Vaswani et al., 2017) to use a stack of Ns identical lay- ers to encode x(k). Each layer consists of three sub-layers. The first sub-layer is a multi-head self- attention: (cid:16) S(n−1), S(n−1), S(n−1)(cid:17) B(n) = MultiHead , (11) where S(0) = X. The second sub-layer is con- text attention that integrates document-level con- text into the encoder: D(n) = MultiHead . (12) (cid:16) B(n), C(Nc), C(Nc)(cid:17) (cid:105) (cid:104) The third sub-layer is a position-wise fully con- nected feed-forward neural network: S(n) = FNN(D(n)·,1 ); . . . ; FNN(D(n)·,I ) , (13) Integration into the Decoder where S(n) ∈ RD×I is the representation of the source sentence x(k) at the n-th layer (n = 1, . . . , Ns). 2.3.2 When generating the j-th target word y(k) , translation is denoted by y(k) the partial <j = y(k) 1 , . . . , y(k) j−1. We follow Vaswani et al. (2017) to offset the target word embeddings by one position, resulting in the following matrix representation of y(k) <j : j Y = [y(k) 0 , . . . , y(k) j−1], (14) As shown in Figure 1(b), we follow (Vaswani et al., 2017) to use a stack of Nt identical layers to compute target-side representations. Each layer is composed of four sub-layers. The first sub-layer is a multi-head self-attention: T(n−1), T(n−1), T(n−1)(cid:17) E(n) = MultiHead (cid:16) , (15) where T(0) = Y . The second sub-layer is con- text attention that integrates document-level con- text into the decoder: (cid:16) E(n), C(Nc), C(Nc)(cid:17) F(n) = MultiHead . (16) The third sub-layer is encoder-decoder attention that integrates the representation of the corre- sponding source sentence: (cid:16) F(n), S(Ns), S(Ns)(cid:17) (cid:105) . G(n) = MultiHead (17) (cid:104) The fourth sub-layer is a position-wise fully con- nected feed-forward neural network: , T(n) = FNN(G(n)·,1 ); . . . ; FNN(G(n)·,j ), (18) where T(n) ∈ RD×j is the representation at the n-th layer (n = 1, . . . , Nt). Note that T(0) = Y . Finally, the probability distribution of generat- is defined using a ing the next target word y(k) softmax layer: j j X<k, x(k), y(k) <j ; θ) ∝ exp(WoT(Nt) ·,j P (y(k) ) (19) where Wo ∈ RVy×D is a model parameter, Vy ·,j ∈ RD×1 is a is the target vocabulary, and T(Nt) column vector for predicting the j-th target word. 2.3.3 Context Gating In our model, we follow Vaswani et al. (2017) to use residual connections (He et al., 2016) around each sub-layer to shortcut its input to its output: Residual(H) = H + SubLayer(H), (20) where H is the input of the sub-layer. While residual connections prove to be effective for building deep architectures, there is one poten- tial problem for our model: the residual connec- tions after the context attention sub-layer might increase the influence of document-level context X<k in an uncontrolled way. This is undesirable because the source sentence x(k) usually plays a more important role in target word generation. To address this problem, we replace the residual connections after the context attention sub-layer with a position-wise context gating sub-layer: Gating(H) = λH + (1 − λ)SubLayer(H). (21) The gating weight is given by λ = σ(WiH + WsSubLayer(H)), (22) where σ(·) is a sigmoid function, Wi and Ws are model parameters. 2.4 Training Given a document-level parallel corpus Dd, the standard training objective is to maximize the log- likelihood of the training data: θ = argmax θ log P (YX; θ) . (23) (cid:40) (cid:88) (cid:104)X,Y(cid:105)∈Dd (cid:41) Unfortunately, large-scale document-level par- allel corpora are usually unavailable, even for resource-rich languages such as English and Chi- nese. Under small-data training conditions, document-level NMT is prone to underperform sentence-level NMT because of poor estimates of low-frequency events. To address this problem, we adopt the idea of freezing some parameters while tuning the re- maining part of the model (Jean et al., 2015; Zoph et al., 2016). We propose a two-step training strat- egy that uses an additional sentence-level paral- lel corpus Ds, which can be larger than Dd. We divide model parameters into two subsets: θ = θs ∪ θd, where θs is a set of original sentence- level model parameters (highlighted in blue in Figure 1(b)) and θd is a set of newly-introduced document-level model parameters (highlighted in red in Figure 1(b)). In the first step, sentence-level parameters θs are estimated on the combined sentence-level par- allel corpus Ds ∪ Dd: 2 θs = argmax log P (yx; θs). (cid:88) (24) θs (cid:104)x,y(cid:105)∈Ds∪Dd Note that the newly introduced modules (high- lighted in red in Figure 1(b)) are inactivated in 2It is easy to create a sentence-level parallel corpus from Dd. this step. P (yx; θs) is identical to the original Transformer model, which is a special case of our model. In the second step, document-level parameters θd are estimated on the document-level parallel corpus Dd only: θd = argmax θd (cid:104)X,Y(cid:105)∈Dd log P (YX; θs, θd). (25) (cid:88) Our approach is also similar to pre-training which has been widely used in NMT (Shen et al., 2016; Tu et al., 2018). The major difference is that our approach keeps θs fixed when estimating θd to prevent the model from overfitting on the rela- tively smaller document-level parallel corpora. 3 Experiments 3.1 Setup We evaluate our approach on Chinese-English and French-English translation tasks. In Chinese- English translation task, the training set contains 2M Chinese-English sentence pairs with 54.8M Chinese words and 60.8M English words. 3 The document-level parallel corpus is a subset of the full training set, including 41K documents with 940K sentence pairs. On average, each document in the training set contains 22.9 sentences. We use the NIST 2006 dataset as the development set and the NIST 2002, 2003, 2004, 2005, 2008 datasets as test sets. The development and test sets contain 588 documents with 5,833 sentences. On average, each document contains 9.9 sentences. In French-English translation task, we use the IWSLT bilingual training data (Mauro et al., 2012) which contains 1,824 documents with 220K sen- tence pairs as training set. For development and testing, we use the IWSLT 2010 development and test sets, which contains 8 documents with 887 sentence pairs and 11 documents with 1,664 sen- tence pairs respectively. The evaluation metric for both tasks is case-insensitive BLEU score as cal- culated by the multi-bleu.perl script. In preprocessing, we use byte pair encoding (Sennrich et al., 2016) with 32K merges to seg- ment words into sub-word units for all languages. For the original Transformer model and our ex- tended model, the hidden size is set to 512 and the 3The training set consists of sentence-level parallel cor- pora LDC2002E18, LDC2003E07, LDC2003E14, news part of LDC2004T08 and document-level parallel corpora LDC2002T01, LDC2004T07, LDC2005T06, LDC2005T10, LDC2009T02, LDC2009T15, LDC2010T03. # sent. MT06 1 2 3 49.38 49.69 49.49 Table 1: Effect of context length on translation quality. The BLEU scores are calculated on the development set. # Layer MT06 49.69 49.38 49.54 49.59 49.31 49.43 1 2 3 4 5 6 Table 2: Effect of self-attention layer number (i.e., Nc) on translation quality. The BLEU scores are calculated on the development set. filter size is set to 2,048. The multi-head atten- tion has 8 individual attention heads. We set N = Ns = Nt = 6. In training, we use Adam (Kingma and Ba, 2015) for optimization. Each mini-batch contains approximately 24K words. We use the learning rate decay policy described by Vaswani et al. (2017). In decoding, the beam size is set to 4. We use the length penalty (Wu et al., 2016) and set the hyper-parameter α to 0.6. We use four Tesla P40 GPUs for training and one Tesla P40 GPU for decoding. We implement our approach on top of the open-source toolkit THUMT (Zhang et al., 2017). 4 3.2 Effect of Context Length We first investigate the effect of context length (i.e., the number of preceding sentences) on our approach. As shown in Table 1, using two pre- ceding source sentences as document-level context achieves the best translation performance on the development set. Using more preceding sentences does not bring any improvement and increases computational cost. This confirms the finding of Tu et al. (2018) that long-distance context only has limited influence. Therefore, we set the number of preceding sentences to 2 in the following experi- ments. 5 3.3 Effect of Self-Attention Layer Number Table 2 shows self-attention layer number for computing representations of the effect of 4https://github.com/thumt/THUMT 5If there is no preceding sentence, we simply use a single begin-of-sentence token. document-level context (see Section 2.2) on trans- lation quality. Surprisingly, using only one self- attention layer suffices to achieve good perfor- mance. Increasing the number of self-attention layers does not lead to any improvements. There- fore, we set Nc to 1 for efficiency. 3.4 Comparison with Previous Work In Chinese-English translation task, we compare our approach with the following previous meth- ods: 1. (Wang et al., 2017): using a hierarchical RNN to integrate document-level context into the RNNsearch model. They use a document- level parallel corpus containing 1M sentence pairs. Table 3 gives the BLEU scores re- ported in their paper. 2. (Kuang et al., 2017): using a cache which stores previous translated words and topi- cal words to incorporate document-level con- text into the RNNsearch model. They use a document-level parallel corpus containing 2.8M sentence pairs. Table 3 gives the BLEU scores reported in their paper. 3. (Vaswani et al., 2017): the state-of-the-art NMT model that does not exploit document- level context. We use the open-source toolkit THUMT (Zhang et al., 2017) to train and evaluate the model. The training dataset is our sentence-level parallel corpus containing 2M sentence pairs. 4. (Kuang et al., 2017)*: adapting the cache- based method to the Transformer model. We implement it on top of the open-source toolkit THUMT. We also use the same training data (i.e., 2M sentence pairs) and the same two- step training strategy to estimate sentence- and document-level parameters separately. As shown in Table 3, using the same data, our approach achieves significant improvements over the original Transformer model (Vaswani et al., 2017) (p < 0.01). The gain on the concate- nated test set (i.e., "All") is 1.96 BLEU points. It also outperforms the cache-based method (Kuang et al., 2017) adapted for Transformer significantly (p < 0.01), which also uses the two-step train- ing strategy. Table 4 shows that our model also outperforms Transformer by 0.89 BLEU points on French-English translation task. Method Model RNNsearch (Wang et al., 2017) (Kuang et al., 2017) RNNsearch (Vaswani et al., 2017) Transformer (Kuang et al., 2017)* Transformer Transformer this work MT06 MT02 MT03 MT04 MT05 MT08 37.76 27.57 31.86 38.31 38.38 39.69 36.89 32.90 48.34 48.53 49.46 34.41 48.63 48.97 50.96 - 38.40 47.79 47.91 49.73 - 48.09 48.14 49.69 - - - 47.54 48.05 50.21 All - - 45.97 46.37 47.93 Table 3: Comparison with previous works on Chinese-English translation task. The evaluation metric is case- insensitive BLEU score. (Wang et al., 2017) use a hierarchical RNN to incorporate document-level context into RNNsearch. (Kuang et al., 2017) use a cache to exploit document-level context for RNNsearch. (Kuang et al., 2017)* is an adapted version of the cache-based method for Transformer. Note that "MT06" is not included in "All". Method Transformer this work Dev 29.42 30.40 Test 35.15 36.04 Method Training Decoding Transformer this work 41K 31K 872 364 Table 4: Comparison with Transformer on French- English translation task. The evaluation metric is case- insensitive BLEU score. Table 6: Evaluation of training and decoding speed. The speed is measured in terms of word/second (wps). Human 1 Human 2 Human 3 Overall = > < 24% 45% 31% 20% 55% 25% 12% 52% 36% 19% 51% 31% Table 5: Subjective evaluation of the comparison be- tween the original Transformer model and our model. ">" means that Transformer is better than our model, "=" means equal, and "<" means worse. 3.5 Subjective Evaluation We also conducted a subjective evaluation to vali- date the benefit of exploiting document-level con- text. All three human evaluators were asked to compare the outputs of the original Transformer model and our model of 20 documents contain- ing 198 sentences, which were randomly sampled from the test sets. Table 5 shows the results of subjective evalu- ation. Three human evaluators generally made consistent judgements. On average, around 19% of Transformer's translations are better than that of our model, 51% are equal, and 31% are worse. This evaluation confirms that exploiting document-level context helps to improve transla- tion quality. 3.6 Evaluation of Efficiency We evaluated the efficiency of our approach. It takes the original Transformer model about 6.7 hours to converge during training and the training speed is 41K words/second. The decoding speed is 872 words/second. In contrast, it takes our model about 7.8 hours to converge in the second step of training. The training speed is 31K words/second. The decoding speed is 364 words/second. Therefore, the training speed is only reduced by 25% thanks to the high parallelism of multi-head attention used to incorporate document-level con- text. The gap is larger in decoding because target words are generated in an autoregressive way in Transformer. 3.7 Effect of Two-Step Training Table 7 shows the effect of the proposed two- step training strategy. The first two rows only use sentence-level parallel corpus to train the origi- nal Transformer model (see Eq. 24) and achieve BLEU scores of 39.53 and 45.97. The third row only uses the document-level parallel corpus to di- rectly train our model (see Eq. 23) and achieves a BLEU score of 36.52. The fourth and fifth rows use the two-step strategy to take advantage of both sentence- and document-level parallel corpora and achieve BLEU scores of 40.22 and 47.93, respec- tively. We find that document-level NMT achieves much worse results than sentence-level NMT (i.e., 36.52 vs. 39.53) when only small-scale document- level parallel corpora are available. Our two-step training method is capable of addressing this prob- lem by exploiting sentence-level corpora, which - - sent. 940K 2M - doc. MT06 MT02 MT03 MT04 MT05 MT08 31.49 38.31 29.38 32.36 39.69 36.20 48.09 940K 34.00 940K 940K 37.12 2M 940K 49.69 42.41 48.63 38.83 43.29 50.96 40.93 48.34 36.69 41.84 49.46 41.02 47.79 38.30 41.42 49.73 43.12 47.54 40.51 43.70 50.21 All 39.53 45.97 36.52 40.22 47.93 Table 7: Effect of two-step training. "sent." denotes sentence-level parallel corpus and "doc." denotes document- level parallel corpus. none Integration MT06 MT02 MT03 MT04 MT05 MT08 38.31 39.55 39.07 39.69 48.09 48.88 49.10 49.69 48.63 50.30 50.31 50.96 47.79 48.81 49.35 49.73 47.54 49.34 49.83 50.21 48.34 49.75 49.29 49.46 encoder decoder both All 45.97 47.51 47.48 47.93 Table 8: Effect of context integration. "none" means that no document-level context is integrated, "encoder" means that the document-level context is integrated only into the encoder, "decoder" means that the document- level context is integrated only into the decoder, and "both" means that the context is integrated into both the encoder and the decoder. Gating MT06 MT02 MT03 MT04 MT05 MT08 39.02 39.69 49.33 49.69 50.56 50.96 49.74 50.21 49.29 49.73 w/o w/ 50.11 49.46 All 47.55 47.93 Table 9: Effect of context gating. leads to significant improvements across all test sets. It that is clear 3.8 Effect of Context Integration Table 8 shows the effect of integrating document- level context to the encoder and decoder (see Section 2.3). integrating document-level context into the encoder (Eq. 12) brings significant improvements (i.e., 45.97 vs. 47.51). Similarly, it is also beneficial to inte- grate document-level context into the decoder (Eq. 16). Combining both leads to further improve- ments. This observation suggests that document- level context does help to improve Transformer. 3.9 Effect of Context Gating As shown in Table 9, we also validated the effec- tiveness of context gating (see Section 2.3.3). We find that replacing residual connections with con- text gating leads to an overall improvement of 0.38 BLEU point. 3.10 Analysis We use an example to illustrate how document- level context helps translation (Table 10). In order to translate the source sentence, NMT has to disambiguate the multi-sense word "yun- dong", which is actually impossible without the document-level context. The exact meaning of "rezhong" is also highly context dependent. For- the sense of "yundong" can be in- tunately, ferred from the word "saiche" (car racing) in the document-level context and "rezhong" is the antonym of "yanjuan" (tired of). This example shows that our model learns to resolve word sense ambiguity and lexical cohesion problems by inte- grating document-level context. 4 Related Work Developing document-level models for machine translation has been an important research direc- tion, both for conventional SMT (Gong et al., 2011; Hardmeier et al., 2012; Xiong et al., 2013a,b; Garcia et al., 2014) and NMT (Jean et al., 2017; Kuang et al., 2017; Tiedemann and Scher- rer, 2017; Wang et al., 2017; Maruf and Haffari, 2018; Bawden et al., 2018; Tu et al., 2018; Voita et al., 2018). Most existing work on document-level NMT has focused on integrating document-level con- text into the RNNsearch model (Bahdanau et al., Context Source Reference Transformer Our work ···ziji ye yinwei queshao jingzheng duishou er dui saiche youxie yanjuan shi··· wo rengran feichang rezhong yu zhexiang yundong. I'm still very fond of the sport. I am still very enthusiastic about this movement. I am still very keen on this sport. Table 10: An example of Chinese-English translation. In the source sentence, "yundong" (sport or political move- ment) is a multi-sense word and "rezhong" (fond of) is an emotional word whose meaning is dependent on its context. Our model takes advantage of the words "saiche" (car racing) and "yanjuan" (tired of) in the document- level context to translate the source words correctly. 2015). These approaches can be roughly divided into two broad categories: computing the repre- sentation of the full document-level context (Jean et al., 2017; Tiedemann and Scherrer, 2017; Wang et al., 2017; Maruf and Haffari, 2018; Voita et al., 2018) and using a cache to memorize most rel- evant information in the document-level context (Kuang et al., 2017; Tu et al., 2018). Our approach falls into the first category. We use multi-head at- tention to represent and integrate document-level context. Voita et al. (2018) also extended Transformer to model document-level context, but our work is dif- ferent in modeling and training strategies. The ex- perimental part is also different. While Voita et al. (2018) focus on anaphora resolution, our model is able to improve the overall translation quality by integrating document-level context. 5 Conclusion translation model Transformer. We have presented a method for exploiting document-level context inside the state-of-the-art neural Exper- iments on Chinese-English and French-English translation tasks show that our method is able to improve over Transformer significantly. In the fu- ture, we plan to further validate the effectiveness of our approach on more language pairs. Acknowledgments Yang Liu is supported by the National Natural Science Foundation of China (No. 61432013), National Key R&D Program of China (No. 2017YFB0202204), National Natural Science Foundation of China (No. 61761166008), Ad- vanced Innovation Center for Language Resources (TYR17002), and the NExT++ project supported by the National Research Foundation, Prime Min- isters Office, Singapore under its IRC@Singapore Funding Initiative. This research is also supported by Sogou Inc. References Dzmitry Bahdanau, KyungHyun Cho, and Yoshua Bengio. 2015. Sequence to sequence learning with neural networks. In Proceedings of ICLR. Rachel Bawden, Rico Sennrich, Alexandra Birch, and Barry Haddow. 2018. Evaluating discourse phe- nomena in neural machine translation. In Proceed- ings of NAACL. Eva Mart´ınez Garcia, Cristina Espana Bonet, and Llu´ız M`arquez. 2014. Document-level machine transla- In Proceedings of tion with word vector models. EACL. Jonas Gehring, Michael Auli, David Grangier, De- nis Yarats, and Yann N Dauphin. 2017. Convo- lutional sequence to sequence learning. CoRR, abs/1705.03122. Zhengxian Gong, Min Zhang, and Guodong Zhou. 2011. Cache-based document-level statistical ma- chine translation. In Proceedings of EMNLP. Christian Hardmeier, Joakim Nivre, and Jorg Tiede- mann. 2012. Document-wide decoding for phrase- In Proceed- based statistical machine translation. ings of EMNLP. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. 2016. Deep residual learning for image recog- nition. In Proceedings of CVPR. 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 ACL. Sebastien Jean, Stanislas Lauly, Orhan Firat, and Does neural machine CoRR, Kyunghyun Cho. 2017. translation benefit from larger context? abs/1704.05135. Diederik P Kingma and Jimmy Ba. 2015. Adam: A method for stochastic optimization. Deyi Xiong, Yang Ding, Min Zhang, and Chew Lim Tan. 2013b. Lexical chain based cohesion models for document-level statistical machine translation. In Proceedings of EMNLP. Jiacheng Zhang, Yanzhuo Ding, Shiqi Shen, Yong Cheng, Maosong Sun, Huanbo Luan, and Yang Liu. 2017. Thumt: An open source toolkit for neural ma- chine translation. arXiv preprint arXiv:1706.06415. Barret Zoph, Deniz Yuret, Jonathan May, and Kevin Knight. 2016. Transfer learning for low-resource In Proceedings of neural machine translation. EMNLP. Nikita Kitaev and Dan Klein. 2018. Constituency pars- ing with a self-attentive encoder. Shaohui Kuang, Deyi Xiong, Weihua Luo, and Guodong Zhou. 2017. Cache-based document-level neural machine translation. CoRR, abs/1711.11221. Sameen Maruf and Gholamreza Haffari. 2018. Docu- ment context neural machine translation with mem- ory networks. In Proceedings of ACL. Cettolo Mauro, Girardi Christian, and Federico Mar- cello. 2012. Wit3: Web inventory of transcribed and translated talks. In Proceedings of EAMT. Rico Sennrich, Barry Haddow, and Alexandra Birch. 2016. Neural machine translation of rare words with subword units. In Proceedings of ACL. Shiqi Shen, Yong Cheng, Zhongjun He, Wei He, Hua Wu, Maosong Sun, and Yang Liu. 2016. Minimum risk training for neural machine translation. In Pro- ceedings of ACL. Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. 2014. Sequence to sequence learning with neural net- works. In Proceedings of NIPS. Jorg Tiedemann and Yves Scherrer. 2017. Neural ma- chine translation with extended context. In Proceed- ings of the Third Workshop on Discourse in Machine Translation. Zhaopeng Tu, Yang Liu, Shuming Shi, and Tong Zhang. 2018. Learning to remember translation his- tory with a continuous cache. Transactions of the Association for Computational Linguistics. 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 Proceedings of NIPS. Elena Voita, Pavel Serdyukov, Rico Sennrich, and Ivan Titov. 2018. Context-aware neural machine transla- tion learns anaphora resolution. In Proceedings of ACL. Longyue Wang, Zhaopeng Tu, Andy Way, and Liu Qun. 2017. Exploiting cross-sentence context for In Proceedings of neural machine translation. EMNLP. Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, et al. 2016. Google's neural ma- chine translation system: Bridging the gap between arXiv preprint human and machine translation. arXiv:1609.08144. Deyi Xiong, Guosheng Ben, Min Zhang, Yajuan Lv, and Qun Liu. 2013a. Modeling lexical cohesion for document-level machine translation. In Proceedings of IJCAI.
1710.10574
1
1710
2017-10-29T08:04:24
Personalized word representations Carrying Personalized Semantics Learned from Social Network Posts
[ "cs.CL" ]
Distributed word representations have been shown to be very useful in various natural language processing (NLP) application tasks. These word vectors learned from huge corpora very often carry both semantic and syntactic information of words. However, it is well known that each individual user has his own language patterns because of different factors such as interested topics, friend groups, social activities, wording habits, etc., which may imply some kind of personalized semantics. With such personalized semantics, the same word may imply slightly differently for different users. For example, the word "Cappuccino" may imply "Leisure", "Joy", "Excellent" for a user enjoying coffee, by only a kind of drink for someone else. Such personalized semantics of course cannot be carried by the standard universal word vectors trained with huge corpora produced by many people. In this paper, we propose a framework to train different personalized word vectors for different users based on the very successful continuous skip-gram model using the social network data posted by many individual users. In this framework, universal background word vectors are first learned from the background corpora, and then adapted by the personalized corpus for each individual user to learn the personalized word vectors. We use two application tasks to evaluate the quality of the personalized word vectors obtained in this way, the user prediction task and the sentence completion task. These personalized word vectors were shown to carry some personalized semantics and offer improved performance on these two evaluation tasks.
cs.CL
cs
PERSONALIZED WORD REPRESENTATIONS CARRYING PERSONALIZED SEMANTICS LEARNED FROM SOCIAL NETWORK POSTS Zih-Wei Lin∗, Tzu-Wei Sung∗, Hung-Yi Lee, and Lin-Shan Lee {r04942111, b03902042, hungyilee}@ntu.edu.tw, [email protected] National Taiwan University ABSTRACT Distributed word representations have been shown to be very useful in various natural language processing (NLP) appli- cation tasks. These word vectors learned from huge corpora very often carry both semantic and syntactic information of words. However, it is well known that each individual user has his own language patterns because of different factors such as interested topics, friend groups, social activities, wording habits, etc., which may imply some kind of per- sonalized semantics. With such personalized semantics, the same word may imply slightly differently for different users. For example, the word "Cappuccino" may imply "Leisure", "Joy", "Excellent" for a user enjoying coffee, by only a kind of drink for someone else. Such personalized semantics of course cannot be carried by the standard universal word vec- tors trained with huge corpora produced by many people. In this paper, we propose a framework to train different person- alized word vectors for different users based on the very suc- cessful continuous skip-gram model using the social network data posted by many individual users. In this framework, universal background word vectors are first learned from the background corpora, and then adapted by the personalized corpus for each individual user to learn the personalized word vectors. We use two application tasks to evaluate the quality of the personalized word vectors obtained in this way, the user prediction task and the sentence completion task. These personalized word vectors were shown to carry some person- alized semantics and offer improved performance on these two evaluation tasks. Index Terms -- Distributed Word Representation, Per- sonalized Word Vectors, Skip-gram Model, Social Network Data 1. INTRODUCTION In many natural language processing tasks, a word is a dis- crete token and usually represented as a vector with one-hot encoding, where the dimensionality of the vector is the vo- cabulary size and the position of one corresponds to the index ∗Fist author and second author are equal in contribution. of the word in the vocabulary. One well-known limitation of such one-hot encoding method is that it says nothing re- garding the semantic relationship between words. Various ap- proaches to learn distributed word representations have been proposed to partly solve this problem [1 -- 7]. Word2vec [8, 9] is an unsupervised approach which has been shown to offer word representations carrying plenty of syntactic and seman- tic information, and found very useful in many applications such as identifying words with given semantics [10 -- 12]. On the other hand, it is well known that each individ- ual user has his own language patterns because of different factors such as interested topics, friend groups, social activi- ties, wording habits, etc., which may imply some kind of per- sonalized semantics. With such personalized semantics, the same word may imply slightly differently for different users. For example, the word "Cappuccino" may imply "Leisure", "Joy", "Excellent" for a user enjoying coffee, by only kind of drink for someone else. Such personalized semantics will certainly be helpful in improving the performance of the vari- ous natural language processing applications for each individ- ual user. In fact personalization has been an important trend for many Internet services today, for example personalized retrieval [13 -- 17], personalized learning [18, 19], and person- alized recommendation systems [20 -- 25]. An important step towards such personalized services is the personalized lan- guage processing [26 -- 33]. However, the standard universal word representations learned from huge corpora produced by many people are certainly not able to describe personalized semantics. As a result, word representations adapted to dif- ferent users is definitely a good step toward such a direction. Substantial works have been reported on different ways for representing words as vectors to deal with different natural language processing problems [34 -- 41], but much less works were reported to investigate the mismatch between the univer- sal word representations learned from general corpora and the personalized corpus produced by different individual users. One good reason for this is perhaps the difficulty in collecting personalized corpus. However, this situation has changed in recent years. Nowadays, many individuals post large quanti- ties of texts over social networks, which can be a good source for constructing personalized corpus. In a series of efforts to- wards this direction, we implemented a cloud-based applica- tion to collect personalized linguistic data produced by many individual users from the social media. The data collected in this way are usually casual and short, but may carry plenty of personalized semantics. In this paper, we proposed two approaches based on the skip-gram model of Word2vec to obtain personalized word vectors using individual social posts. The first approach sim- ply tries to retrain the universal Word2vec model with the per- sonalized corpus, while the second approach tries to insert an adaptive linear transformation layer within the skip-gram model. In both approaches, an universal Word2vec model was first trained with the background corpora produced by many people, then this Word2vec model was fine-tuned to be adapted to the personalized corpus. We used two different tasks to evaluate the quality of the obtained personalized word vectors, with which improved performance was obtained. We also found the second approach of inserting an adaptive linear transformation layer performed better. 2. PROPOSED APPROACH Fig. 1. Scenario of personalized word vectors. We first illustrate the scenario of personalized word vectors in Subsection 2.1, and briefly summarize the training criterion of skip-gram model in Subsection 2.2. We then describe the two proposed approaches to train personalized word vectors for each individual user in Subsections 2.3 and 2.4. 2.1. Scenario of Personalized Word Vectors The scenario of personalized word vectors is shown in Fig. 1. Universal background corpora including numerous articles collected from different domains are first used to train a set of universal background word vectors using the skip-gram model. For each individual user, we then collect his (or her) social posts from the social media taken as the personalized corpus, with which we tune the universal background word vectors to obtain the personalized word vectors. The person- alized word vectors are based on the same lexicon as used in the background corpora, but they are different in vector representations. These personalized word vectors are then used in various natural language processing applications. 2.2. Skip-gram Model In this work, we choose the skip-gram model to train the word vectors. Given a sequence of training words w1, w2, ..., wT , and the contexts wj for each word wt, t−b ≤ j ≤ t+b, b (cid:54)= 0, where the context window length is 2b + 1, the goal of the skip-gram model as shown in Fig. 2 (a) is to find the parame- ters W,W(cid:48) so as to maximize the log of the conditional prob- ability log p(wjwt;W,W(cid:48)) . (1) T(cid:88) t+b(cid:88) arg max W,W(cid:48) t=1 j=t−b,b(cid:54)=0 To approximate the conditional probability p(wjwt;W,W(cid:48)) in Eq.(1), negative sampling can be used to optimize the model parameters W,W(cid:48) so as to minimize the objective function for each word wt, J(wt), defined as J(wt) = − log ( ) −(cid:80) log (1 − ), (2) −v(cid:48) 1 wneg ·vwt 1+e 1 −v(cid:48) wj ·vwt 1+e neg where vwt and v(cid:48) wj are the vector representations for the tar- get word wt and contexts wj, and v(cid:48) wj is also called positive example. neg is a function which randomly samples words wneg from the whole corpus, which are different from wj and called negative examples, according to their word fre- quencies. Empirically, wneg is picked from the distribution U (w) 3 4 /Z, where U (w) is the unigram distribution of the cor- pora, and Z is a normalization constant. The goal of this ob- jective function J(wt) in Eq.(2) is to increase the quantity · vwt of v(cid:48) for randomly sampled irrelevant pairs. Therefore, vectors of words that share many contexts will be clustered together, and as a result these vectors can exhibit some semantics including the linear structure that makes analogical reasoning possible. · vwt for word-context pairs, and decrease v(cid:48) wneg wj 2.3. Approach 1 - Retrain the Model With the universal background word vectors trained with the skip-gram model as mentioned above using the universal background corpora, for each user, we retrain the background word vectors with the personalized corpus for each user with the same model, but simply fine-tune the parameters of the model to fit the personalized corpus. The fine-tuned word vectors are the personalized word vectors. (a) Skip-gram model (b) Inserting a user adaptive layer to the skip-gram model Fig. 2. Skip-gram model and inserting a user adaptive layer to the skip-gram model. 2.4. Approach 2 - Inserting a User Adaptive Layer This approach is shown in Fig. 2 (b), which is very similar to the skip-gram model in Fig. 2 (a), except we insert a user adaptive layer, which is a linear layer, between the original hidden and output layers. As shown in Fig. 2 (b), we first train the background word vectors with the standard skip-gram model. This includes the input layer weights Wh×V and output layer weights W(cid:48) V ×h, where h is the dimensionality of the word vectors, and V is the vocabulary size. These weights are trained with the uni- versal background corpora. Then the additional user adaptive layer is inserted into the model with weights Ah×h, where the weights Ah×h are randomly initialized. We now fix the parameters for the universal background model, Wh×V and W(cid:48) V ×h, but only Ah×h, or the user adaptive matrix, is fine- tuned for each user based on the personalized corpus. The training algorithm is the same as that in Section 2.2. We wish to find the best parameters A to maximize the condi- tional probability T(cid:88) t+b(cid:88) arg max A t=1 j=t−b,b(cid:54)=0 log p(wjwt;A,W,W(cid:48)) (3) goal is to evaluate whether M is a "good" representation, or a "good" set of embeddings. We introduce here two tasks to perform the evaluation. 3.1. User Prediction Assume a user produces a document of N sentences, D = {s1, s2, . . . , sN}, where sn is the n-th sentence, 1 ≤ n ≤ N. We wish to predict the user producing this document out of a group of users U = {u1, u2, . . .}, each user u having a personalized word representation or mapping Mu. 3.1.1. Document Classification Approach The approach proposed to perform document classification with respect to different domains using Word2vec [42] by maximizing the log likelihoods of words and their contexts can be used here, except each domain corresponds to a user. This is parallel to the objective function defined in Subsec- tions 2.2 and 2.4. Consider a sentence sn with L words, sn = [wn1, . . . , wnL ], the log likelihood of sn based on the mapping or word repre- sentation M = {(w1, . . . , wV ) : (v1, . . . , vV )} is L(cid:88) t+b(cid:88) t=1 j=t−b,b(cid:54)=0 log pM (wnjwnt) , (4) for each individual user. We finally multiply the background word vectors Wh×V by the adaptive weights Ah×h to obtain the personalized word vectors for each individual user. log pM (sn) = 3. EVALUATION TASKS Given a set of word representations or embeddings {v1, . . . , vV } for the corresponding vocabulary {w1, . . . , wV }, where the vector representation of wi is vi, where V is the vocabulary size, so M = {(w1, w2, . . . , wV ) : (v1, v2, . . . , vV )} is a mapping or the word representation being considered. Our where wnt is the nt-th word and wnj is its context word, and pM (wjwt) can be obtained with the mapping M, pM (wjwt) = , (5) j·vt(cid:80)V ev(cid:48) i=1 ev(cid:48) i·vt where vt is the representation of wt and so on, and the sum- mation in the denominator is over all words in the vocabulary. So the document D, D = {s1, . . . , sN}, has log likelihood log pM (D) = log pM (si) . (6) The posterior probability p(uD) that D is produced by user u can be derived from Bayes rule as follows: N(cid:88) i=1 p(uD) = (cid:80) pMu (D)πu u(cid:48)∈U pMu(cid:48) (D)πu(cid:48) (7) where πu is the prior probability of user u, Mu is the per- sonalized word vectors for user u, and the summation in the denominator is over all users considered. Finally, the predicted user is u: u = arg max u p(uD) . (8) 3.1.2. Evaluation measure Two measures are used here: 1. Prediction accuracy: Percentage of documents for which the corresponding user is correctly predicted. 2. Mean reciprocal rank (MRR): If the correct user is pre- r . dicted as the r-th candidate, the reciprocal rank is 1 The mean reciprocal rank is the average of the recip- rocal ranks so MRR should be less than 1.0, and the closer to 1.0 the better. 3.2. Sentence Completion In this task, from each test sentence we scoop the word with maximum TF-IDF, and then use the semantics from the word vectors to find the best word to fill up the blank. This can be achieved by taking the average of embeddings of the remaining words in the sentence, then ranking all words based on the cosine similarity with respect to this average. The scooped word is taken as the correct answer and the mean reciprocal rank (MRR) is used in the evaluation. Higher MRR implies the word embedding is better. 4. EXPERIMENTAL SETUP 4.1. Corpus First of all, 2.6M sentences including 42,558 distinct words in lexicon were collected from Plurk, a popular social net- working site. These data from Plurk were used as the univer- sal background corpora for training the universal background word vectors. The testing experiments were conducted on a set of personalized corpus crawled from Facebook. In or- der to obtain the personalize Facebook posts, we implemented a cloud-based application capable of helping users to access their social network via voice. Each user can log in his Face- book account and grant our application the authority to col- lect his linguistic data for experiment purposes. A total of 40 users did so. As a result, all data accessible to the accounts of these 40 target users were collected. This resulted in a to- tal of 67,656 sentences. The number of sentences for each user ranged from 308 to 5,140, with 10.6 words (Chinese or English or mixed) per sentence in average. For each target user, 3/5 of his corpus is taken as the training set, 1/5 as the validation set, and the rest 1/5 for testing. The code-mixing phenomenon appears in the sentences collected from both Plurk and Facebook. Most sentences were produced in Chinese, but some words or phrases were naturally produced in English and embedded in the Chinese sentences. The mix ratio for the Chinese characters to English words in the Facebook data is roughly 10.5:1. 4.2. User Prediction & Sentence Completion In the user prediction task, we divide each target user's test- ing set into smaller documents, each containing at most 30 sentences, and the total number of documents is 473. Each testing document is labeled with the user who produced the document. The user prior probabilities πu in Eq.(7) is taken as uniform for all users. In the sentence completion task, we preprocessed all users' testing set by means of scooping words as mentioned in Subsection 3.2. In total, there are 13,512 sentences for testing. 5. EXPERIMENTAL RESULTS 5.1. User Prediction This is for the tests mentioned in Subsection 3.1. Table 1 shows the MRR and prediction accuracy averaged over the testing set for the two approaches discussed in Sub- sections 2.3, 2.4 compared to a baseline. The first section (A) (No Background) is for the results when all personalized word vectors were trained directly with the personalized cor- pus only, without using the background corpora. The second section (B) (Retrain) and third section (C) (Adaptive Layer) are respectively for the two proposed approaches summarized in Subsections 2.3 and 2.4, all with word vector dimensional- ity of 128, 192 and 256. We see from section (A) the word vectors trained with personalized corpus only without background corpora got the worst MRR and accuracy in the table, obviously because the personalized corpus is too sparse to offer reasonably good word vectors. With the help of the background corpora and the universal background word vectors, we see the MRR and accuracy were significantly better and increased as the em- bedding size went bigger in sections (B)(C). Comparing the two proposed methods, we see Adaptive Layer (section (C)) was clearly better than Retrain (section (B)) with the same Approaches (A) No Background (B) Retrain (C) Adaptive Layer Embedding Size 128 192 256 128 192 256 128 192 256 MRR 0.256 0.296 0.336 0.402 0.424 0.430 0.580 0.610 0.630 Prediction Accuracy 0.140 0.204 0.226 0.309 0.340 0.340 0.485 0.523 0.512 Table 1. Evaluation results for the user prediction task using different approaches, all with the personalized data. embedding size. There can be at least two reasons for this. First, there are much more parameters to be trained for the Retrain approach, i.e., there are V × h × 2 parameters to be trained for the matrices Wh×V and W(cid:48) V ×h, where V is vocabulary size and h is the embedding size. In contrast, in Adaptive Layer approach only h×h parameters for the matrix Ah×h are to be trained. The former is much larger because the vocabulary size V is usually at the order of ten thousands and the embedding size is at the order of hundreds. So much more personalized data are needed for the Retrain approach to learn high quality personalized word vectors. Second, in Retrain approach, the vectors for those words appearing in the personalized corpus were fine-tuned to fit the personal- ized corpus. However, for those words not appearing in the personalized corpus, the corresponding word vectors were al- most never trained and simply remained primarily unchanged from those learned from the universal background corpora. So the words were in fact divided into two separate groups, the unseen words trained with the background corpora and the observed words trained with the personalized corpus. In con- trast, the Adaptive Layer approach used an additional linear transformation layer to adapt the whole set of word vectors according to the personalized corpus. In other words, the lin- ear adaptive layer learned a full transformation matrix Ah×h, although small, which mapped the whole set of background word vectors to a new space of personalized semantics. This linear transformation also prevented the word vectors from overfitting to the personalized corpus. Since the averages didn't actually tell how the different approaches compared with each other for each individual user, we plot in addition the differences in MRR and predic- tion accuracy across all the 40 target users in Figs. 3 and 4. Each bar in the figures represents the score obtained with one approach minus that with another, all with embedding size of 256. Fig. 3 is for the Retrain approach minus No Background, while Fig. 4 is for the Adaptive Layer approach minus the Retrain approach. From Figs. 3 and 4, we see the differences are quite apparent for most target users. (Retrain) - (No Background) (Retrain) - (No Background) R R M n i e c n e r e f f i D 0.5 0 −0.5 −1 Target users y c a r u c c A n i e c n e r e f f i D 0.5 0 −0.5 −1 Target users (a) MRR Differences (b) Prediction Accuracy Differences Fig. 3. For the user prediction task: difference in (a) MRR and (b) Prediction Accuracy for each individual user for those obtained with Retrain approach minus No Background ap- proach, all at embedding size of 256. (Adaptive Layer) - (Retrain) R R M n i e c n e r e f f i D 1 0.8 0.6 0.4 0.2 0 −0.2 −0.4 (Adaptive Layer) - (Retrain) y c a r u c c A n i e c n e r e f f i D 1 0.8 0.6 0.4 0.2 0 −0.2 −0.4 Target users Target users (a) MRR Differences (b) Prediction Accuracy Differences Fig. 4. For the user prediction task: difference in (a) MRR and (b) Prediction Accuracy for each individual user for those obtained with Adaptive Layer approach minus Retrain ap- proach, all at embedding size of 256. 5.2. Sentence Completion Table 2 reports the MRR for four different approaches. The sections (A)(C)(D) are for exactly the same cases as those in Table 1, respectively for using personalized corpus alone, and the personalized word vectors by the proposed two ap- proaches. The extra section (B) (Background) is for the word vectors trained with the background corpora only. Column (1) (Percentage within Top 500) lists the percentages of the test sentences for which the correct words for the blanks were ranked within the top 500 words found by the word vectors, and column (2) (MRR within (1)) reports the MRR values averaged over those sentences with the correct words ranked within 500. It can be found that the two proposed approaches (sections (C)(D)) performed significantly better with trends consistent with those observed in Table 1. Also, because many of the test sentences are very short with only a few words, so the sentence completion task is actually a very dif- ficult tasks here. As a result, only 4.49% - 5.18% of them had correct words within 500, and the MRR obtained was not high. 煩(annoying) 排球 排球 棒球 羽球 無聊(boring) 無聊(boring) 討厭(dislike) 籃球(basketball) 喜歡(enjoy) 煩(annoying) 唱歌(singing) 足球(soccer) 開心(happy) 電動 跳舞 煩(annoying) 桌球 讀書 討厭(dislike) 討厭(dislike) 讀書 喜歡(enjoy) 唱歌(singing) 跳舞 足球(soccer) 最愛(favorite) 棒球 排球 籃球(basketball) 桌球 無聊(boring) 最愛(favorite) 足球(soccer) 桌球 棒球 喜歡(enjoy) 開心(happy) 籃球(basketball) 跳舞 讀書 唱歌(singing) 電動 羽球 開心 (happy) Positive Negative Interest Others 最愛(favorite) 羽球 電動 (a) User A with interest in soccer (b) User B with interest in basketball (c) User C with interest in singing Fig. 5. Personalized word vectors visualization of three different users. Approaches Embedding Size (A) No Background (B) Background (C) Retrain (D) Adaptive Layer 128 192 256 128 192 256 128 192 256 128 192 256 (1) Percentage within Top 500 (%) 4.49 4.50 4.57 4.70 4.73 4.72 4.76 4.77 4.85 4.93 4.98 5.18 (2) MRR within (1) 0.178 0.168 0.186 0.182 0.194 0.188 0.186 0.196 0.201 0.198 0.210 0.224 Table 2. Results for the sentence completion task: (1) per- centage of test sentences with correct answer within top 500 and (2) MRR averaged for those sentences in (1). 5.3. An Example We tried to visualize the personalized word vectors for three example users trained with the second approach of adaptive layer with dimensionality of 256, and plot small subsets of them with t-sne in Fig. 5 (a)(b)(c) respectively. The black points marked by "•" are Chinese words representing human activities such as singing(唱歌), dancing(跳舞), studying(讀 書), basketball(籃球) and soccer(足球). The red triangle is a positive emotion triangle defined by three red points marked by "♦" for words indicating positive emotion: happy(開心), favorite(最愛), enjoy(喜歡), while the blue triangle is a neg- ative emotion triangle defined by three blue points marked by "(cid:3)" for words indicating negative emotion: dislike(討厭), boring(無 聊), annoying(煩). Fig. 5 (a)(b)(c) are the word vectors for three different users A, B, C with different per- sonal interests respectively in soccer(足球), basketball(籃球) and singing(唱歌), word vectors for which are respectively marked by "⊗" in the subfigures (a)(b)(c). In Fig. 5 (a), user A is interested in soccer(足球). We can see his word vector for soccer(足球) is close to the positive triangle but far from the negative triangle. However, in Fig. 5 (b)(c) for users B and C with different interests, the word soccer(足球) is more or less neutral in emotion. Similarly user B in Fig. 5 (b) is in- terested in basketball(籃球), so the word basketball(籃球) in Fig. 5 (b) is close to the positive emotion triangle but far from negative triangle, but is more or less neutral in Fig. 5 (a)(c). Same in Fig. 5 (c) for user C who is interested in singing(唱 歌). These results demonstrate the approach proposed here is able to actually extract some personalized semantics as dis- cussed earlier in this paper. 6. CONCLUSIONS In this paper, we proposed a new framework for training per- sonalized word vectors carrying personalized semantics using personalized data crawled from social networks. The word vectors are first trained with universal background corpora to learn the general knowledge, and then adapted towards the personalized data by fine-tuning the background word vec- tors. Two approaches were proposed for the adaptation, one by retraining the word vectors while the other by inserting an adaptation layer. Experimental results over a user predic- tion task and a sentence completion task showed that both ap- proaches offered consistently better results, and the adaptive layer approach is better than the retrain approach. 7. REFERENCES [1] Yoshua Bengio, R´ejean Ducharme, Pascal Vincent, and "A neural probabilistic language Christian Jauvin, model," Journal of machine learning research, vol. 3, no. Feb, pp. 1137 -- 1155, 2003. [2] Ronan Collobert and Jason Weston, "A unified archi- tecture for natural language processing: Deep neural networks with multitask learning," in Proceedings of the 25th international conference on Machine learning. ACM, 2008, pp. 160 -- 167. [3] Joseph Turian, Lev 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 linguis- tics. Association for Computational Linguistics, 2010, pp. 384 -- 394. [4] Eric H Huang, Richard Socher, Christopher D Manning, and Andrew Y Ng, "Improving word representations via global context and multiple word prototypes," in Pro- ceedings of the 50th Annual Meeting of the Association for Computational Linguistics: Long Papers-Volume 1. Association for Computational Linguistics, 2012, pp. 873 -- 882. [5] Tomas Mikolov, Martin Karafi´at, Lukas Burget, Jan Cer- nock`y, and Sanjeev Khudanpur, "Recurrent neural net- in Interspeech, 2010, work based language model.," vol. 2, p. 3. [6] Omer Levy and Yoav Goldberg, "Dependency-based word embeddings.," in ACL (2), 2014, pp. 302 -- 308. [7] Jeffrey Pennington, Richard Socher, and Christopher D Manning, "Glove: Global vectors for word representa- tion.," in EMNLP, 2014, vol. 14, pp. 1532 -- 1543. [8] Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean, "Efficient estimation of word representations in vector space," arXiv preprint arXiv:1301.3781, 2013. [9] Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Cor- "Distributed representations of rado, and Jeff Dean, words and phrases and their compositionality," in Ad- vances in neural information processing systems, 2013, pp. 3111 -- 3119. [10] Tomas Mikolov, Wen-tau Yih, and Geoffrey Zweig, "Linguistic regularities in continuous space word rep- resentations.," in hlt-Naacl, 2013, vol. 13, pp. 746 -- 751. [11] Marco Baroni, Georgiana Dinu, "Don't count, predict! and Germ´an Kruszewski, a systematic comparison of context-counting vs. context-predicting semantic vectors.," in ACL (1), 2014, pp. 238 -- 247. [13] Mirco Speretta and Susan Gauch, "Personalized search in Web Intelligence, based on user search histories," 2005. Proceedings. The 2005 IEEE/WIC/ACM Interna- tional Conference on. IEEE, 2005, pp. 622 -- 628. [14] Zhangjie Fu, Kui Ren, Jiangang Shu, Xingming Sun, and Fengxiao Huang, "Enabling personalized search over encrypted outsourced data with efficiency improve- ment," IEEE transactions on parallel and distributed systems, vol. 27, no. 9, pp. 2546 -- 2559, 2016. [15] Xuehua Shen, Bin Tan, and ChengXiang Zhai, "Implicit user modeling for personalized search," in Proceedings of the 14th ACM international conference on Informa- tion and knowledge management. ACM, 2005, pp. 824 -- 831. [16] Gui-Rong Xue, Jie Han, Yong Yu, and Qiang Yang, "User language model for collaborative personalized search," ACM Transactions on Information Systems (TOIS), vol. 27, no. 2, pp. 11, 2009. [17] Paul-Alexandru Chirita, Claudiu S Firan, and Wolfgang Nejdl, "Personalized query expansion for the web," in Proceedings of the 30th annual international ACM SI- GIR conference on Research and development in infor- mation retrieval. ACM, 2007, pp. 7 -- 14. [18] Pei-Hao Su, Chuan-Hsun Wu, and Lin-Shan Lee, "A re- cursive dialogue game for personalized computer-aided IEEE/ACM Transactions on pronunciation training," Audio, Speech and Language Processing (TASLP), vol. 23, no. 1, pp. 127 -- 141, 2015. [19] Chih-Ming Chen and Yi-Lun Li, "Personalised context- aware ubiquitous learning system for supporting effec- tive english vocabulary learning," Interactive Learning Environments, vol. 18, no. 4, pp. 341 -- 364, 2010. [20] Yehuda Koren, Robert Bell, and Chris Volinsky, "Ma- trix factorization techniques for recommender systems," Computer, vol. 42, no. 8, 2009. [21] Frank Edward Walter, Stefano Battiston, and Frank Schweitzer, "A model of a trust-based recommendation system on a social network," Autonomous Agents and Multi-Agent Systems, vol. 16, no. 1, pp. 57 -- 74, 2008. [22] Xiwang Yang, Yang Guo, Yong Liu, and Harald Steck, "A survey of collaborative filtering based social recom- mender systems," Computer Communications, vol. 41, pp. 1 -- 10, 2014. [12] Omer Levy and Yoav Goldberg, "Neural word embed- ding as implicit matrix factorization," in Advances in neural information processing systems, 2014, pp. 2177 -- 2185. [23] Shuiguang Deng, Longtao Huang, and Guandong Xu, "Social network-based service recommendation with trust enhancement," Expert Systems with Applications, vol. 41, no. 18, pp. 8075 -- 8084, 2014. [34] Xinxiong Chen, Zhiyuan Liu, and Maosong Sun, "A unified model for word sense representation and disam- biguation.," in EMNLP, 2014, pp. 1025 -- 1035. [35] Thang Luong, Richard Socher, and Christopher D Man- ning, "Better word representations with recursive neural networks for morphology.," in CoNLL, 2013, pp. 104 -- 113. [36] Cicero D Santos and Bianca Zadrozny, "Learning character-level representations for part-of-speech tag- ging," in Proceedings of the 31st International Confer- ence on Machine Learning (ICML-14), 2014, pp. 1818 -- 1826. [37] Andrew L Maas, Raymond E Daly, Peter T Pham, Dan Huang, Andrew Y Ng, and Christopher Potts, "Learn- ing word vectors for sentiment analysis," in Proceedings of the 49th Annual Meeting of the Association for Com- putational Linguistics: Human Language Technologies- Volume 1. Association for Computational Linguistics, 2011, pp. 142 -- 150. [38] Kyunghyun Cho, Bart Van Merrienboer, Caglar Gul- cehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio, "Learning phrase rep- resentations using rnn encoder-decoder for statistical machine translation," arXiv preprint arXiv:1406.1078, 2014. [39] Duyu Tang, Furu Wei, Nan Yang, Ming Zhou, Ting Liu, and Bing Qin, "Learning sentiment-specific word em- bedding for twitter sentiment classification.," in ACL (1), 2014, pp. 1555 -- 1565. [40] Wang Ling, Tiago Lu´ıs, Lu´ıs Marujo, Ram´on Fernandez Astudillo, Silvio Amir, Chris Dyer, Alan W Black, and Isabel Trancoso, "Finding function in form: Composi- tional character models for open vocabulary word rep- resentation," arXiv preprint arXiv:1508.02096, 2015. [41] Armand Joulin, Edouard Grave, Piotr Bojanowski, and Tomas Mikolov, "Bag of tricks for efficient text classi- fication," arXiv preprint arXiv:1607.01759, 2016. [42] Matt Taddy, "Document classification by inversion of distributed language representations," CoRR, vol. abs/1504.07295, 2015. [24] Moon-Hee Park, Jin-Hyuk Hong, and Sung-Bae Cho, "Location-based recommendation system using bayesian user's preference model in mobile devices," in International Conference on Ubiquitous Intelligence and Computing. Springer, 2007, pp. 1130 -- 1139. [25] Yoon Ho Cho, Jae Kyeong Kim, and Soung Hie Kim, "A personalized recommender system based on web us- age mining and decision tree induction," Expert systems with Applications, vol. 23, no. 3, pp. 329 -- 342, 2002. [26] Yu-Yang Huang, Rui Yan, Tsung-Ting Kuo, and Shou- De Lin, "Enriching cold start personalized language model using social network information.," in ACL (2), 2014, pp. 611 -- 617. [27] Arjumand Younus, Colm O'Riordan, and Gabriella Pasi, "A language modeling approach to personalized search based on users' microblog behavior.," in ECIR. Springer, 2014, pp. 727 -- 732. [28] Tsung-Hsien Wen, Hung-Yi Lee, Tai-Yuan Chen, and Lin-Shan Lee, "Personalized language modeling by crowd sourcing with social network data for voice ac- cess of cloud applications," in Spoken Language Tech- nology Workshop (SLT), 2012 IEEE. IEEE, 2012, pp. 188 -- 193. [29] Tsung-Hsien Wen, Aaron Heidel, Hung-yi Lee, Yu Tsao, and Lin-Shan Lee, "Recurrent neural network based language model personalization by social network crowdsourcing.," in INTERSPEECH, 2013, pp. 2703 -- 2707. [30] Bo-Hsiang Tseng, Hung-yi Lee, and Lin-Shan Lee, "Personalizing universal recurrent neural network lan- guage model with user characteristic features by social network crowdsourcing," in Automatic Speech Recogni- tion and Understanding (ASRU), 2015 IEEE Workshop on. IEEE, 2015, pp. 84 -- 91. [31] Hung-Yi Lee, Bo-Hsiang Tseng, Tsung-Hsien Wen, and Yu Tsao, "Personalizing recurrent-neural-network- based language model by social network," IEEE/ACM Transactions on Audio, Speech and Language Process- ing (TASLP), vol. 25, no. 3, pp. 519 -- 530, 2017. [32] Hans van Halteren, "Linguistic profiling for authorship recognition and verification," in ACL, 2004. [33] Efstathios Stamatatos, Walter Daelemans, Ben Verho- even, Patrick Juola, Aurelio L´opez-L´opez, Martin Pot- thast, and Benno Stein, "Overview of the author iden- tification task at pan 2015," in CLEF 2015 Evaluation Labs and Workshop -- Working Notes Papers, Toulouse, France, 09/2015 2015, CEUR, CEUR.
1904.05255
1
1904
2019-04-10T15:52:13
Simple BERT Models for Relation Extraction and Semantic Role Labeling
[ "cs.CL" ]
We present simple BERT-based models for relation extraction and semantic role labeling. In recent years, state-of-the-art performance has been achieved using neural models by incorporating lexical and syntactic features such as part-of-speech tags and dependency trees. In this paper, extensive experiments on datasets for these two tasks show that without using any external features, a simple BERT-based model can achieve state-of-the-art performance. To our knowledge, we are the first to successfully apply BERT in this manner. Our models provide strong baselines for future research.
cs.CL
cs
Simple BERT Models for Relation Extraction and Semantic Role Labeling Peng Shi and Jimmy Lin David R. Cheriton School of Computer Science {peng.shi, jimmylin}@uwaterloo.ca University of Waterloo 9 1 0 2 r p A 0 1 ] L C . s c [ 1 v 5 5 2 5 0 . 4 0 9 1 : v i X r a Abstract We present simple BERT-based models for re- lation extraction and semantic role labeling. In recent years, state-of-the-art performance has been achieved using neural models by incor- porating lexical and syntactic features such as part-of-speech tags and dependency trees. In this paper, extensive experiments on datasets for these two tasks show that without using any external features, a simple BERT-based model can achieve state-of-the-art performance. To our knowledge, we are the first to successfully apply BERT in this manner. Our models pro- vide strong baselines for future research. 1 Introduction Relation extraction and semantic role label- ing (SRL) are two fundamental tasks in natural language understanding. The task of relation ex- traction is to discern whether a relation exists be- tween two entities in a sentence. For example, in the sentence "Obama was born in Honolulu", "Obama" is the subject entity and "Honolulu" is the object entity. The task of a relation extrac- tion model is to identify the relation between the entities, which is per:city of birth (birth city for a person). For SRL, the task is to extract the predicate -- argument structure of a sentence, determining "who did what to whom", "when", "where", etc. Both capabilities are useful in sev- eral downstream tasks such as question answer- ing (Shen and Lapata, 2007) and open information extraction (Fader et al., 2011). State-of-the-art neural models for both tasks typically rely on lexical and syntactic features, such as part-of-speech tags (Marcheggiani et al., 2017), syntactic trees (Roth and Lapata, 2016; Zhang et al., 2018; Li et al., 2018), and global decoding constraints (Li et al., 2019). In partic- ular, Roth and Lapata (2016) argue that syntactic features are necessary to achieve competitive per- formance in dependency-based SRL. Zhang et al. (2018) also showed that dependency tree features can further improve relation extraction perfor- mance. Although syntactic features are no doubt helpful, a known challenge is that parsers are not available for every language, and even when avail- able, they may not be sufficiently robust, espe- cially for out-of-domain text, which may even hurt performance (He et al., 2017). Recently, the NLP community has seen excite- ment around neural models that make heavy use of pretraining based on language modeling (Peters et al., 2018; Radford et al., 2018). The latest de- velopment is BERT (Devlin et al., 2018), which has shown impressive gains in a wide variety of natural language tasks ranging from sentence clas- sification to sequence labeling. A natural question follows: can we leverage these pretrained models to further push the state of the art in relation ex- traction and semantic role labeling, without rely- ing on lexical or syntactic features? The answer is yes. We show that simple neural architectures built on top of BERT yields state-of-the-art perfor- mance on a variety of benchmark datasets for these two tasks. The remainder of this paper describes our models and experimental results for relation extraction and semantic role labeling in turn. 2 BERT for Relation Extraction 2.1 Model For relation extraction, the task is to predict the re- lation between two entities, given a sentence and two non-overlapping entity spans. In order to en- code the sentence in an entity-aware manner, we propose the BERT-based model shown in Figure 1. First, we construct the input sequence [[CLS] sen- tence [SEP] subject [SEP] object [SEP]]. To pre- vent overfitting, we replace the entity mentions in Model Zhang et al. (2017) Zhang et al. (2018) Wu et al. (2019) Alt et al. (2019) BERT-LSTM-base Zhang et al. (2018) (ensemble) P 65.7 69.9 - 70.1 73.3 71.3 R 64.5 63.33 - 65.0 63.10 65.4 F1 65.1 66.4 67.0 67.4 67.8 68.2 Table 1: Results on the TACRED test set. 2.2 Experiments We evaluate our model on the TAC Relation Ex- traction Dataset (TACRED) (Zhang et al., 2017), a standard benchmark dataset for relation extrac- tion. In our experiments, the hidden sizes of the LSTM and MLP are 768 and 300, respectively, and the position embedding size is 20. The learn- ing rate is 5 × 10−5. The BERT base-cased model is used in our experiments. Embeddings for the masks (e.g., SUBJ-LOC) are randomly initialized and fine-tuned during the training process, as well as the position embeddings. Results on the TACRED test set are shown in Table 1. Our model outperforms the works of Zhang et al. (2018) and Wu et al. (2019), which use GCNs (Kipf and Welling, 2016) and variants to encode syntactic tree information as external features. Alt et al. (2019) leverage the pretrained language model GPT (Radford et al., 2018) and achieves better recall than our system. In terms of F1, our system obtains the best known score among individual models, but our score is still be- low that of the interpolation model of Zhang et al. (2018) because of lower recall. 3 BERT for Semantic Role Labeling 3.1 Model The standard formulation of semantic role la- beling decomposes into four subtasks: predicate detection, predicate sense disambiguation, argu- ment identification, and argument classification. There are two representations for argument anno- tation: span-based and dependency-based. Seman- tic banks such as PropBank usually represent argu- ments as syntactic constituents (spans), whereas the CoNLL 2008 and 2009 shared tasks propose dependency-based SRL, where the goal is to iden- tify the syntactic heads of arguments rather than the entire span. Here, we follow Li et al. (2019) to unify these two annotation schemes into one framework, without any declarative constraints for Figure 1: Architecture of our relation extraction model. (a) denotes the concatenation of BERT contextual em- bedding and position embedding. The final prediction is based on the concatenation of the final hidden state in each direction from the BiLSTM, fed through an MLP. the sentence with masks, comprised of argument type (subject or object) and entity type (such as lo- cation and person), e.g., SUBJ-LOC, denoting that the subject entity is a location. The input is then tokenized by the WordPiece tokenizer (Sennrich et al., 2016) and fed into the BERT encoder. After obtaining the contextual rep- resentation, we discard the sequence after the first [SEP] for the following operations. We use H = [h0, h1, ..., hn, hn+1] to denote the BERT contextual representation for [[CLS] sen- tence [SEP]]. Note that n can be different from the length of the sentence because the tokenizer might split words into sub-tokens. The subject entity span is denoted Hs = [hs1, hs1+1, ..., hs2] and similarly the object entity span is Ho = [ho1, ho1+1, ..., ho2]. Following Zhang et al. (2017), we define a position sequence relative to the subject entity span [ps n+1], where 0, ..., ps i − s1, 0, i − s2, ps i = i < s1 s1 < i < s2 i > s2 (1) 0, ..., po Here s1 and s2 are the starting and ending posi- tions of the subject entity (after tokenization), and i ∈ Z is the relative distance (in tokens) to the ps subject entity. A position sequence relative to the object [po n+1] can be obtained in a similar way. To incorporate the position information into the model, the position sequences are converted into position embeddings, which are then concate- nated to the contextual representation H, followed by a one-layer BiLSTM. The final hidden states in each direction of the BiLSTM are used for predic- tion with a one-hidden-layer MLP. [CLS] [S-PER] was born in [O-LOC] [SEP] Obama [SEP] Honolulu[SEP] BERTper:city_of_birtha Model Shi and Zhang (2017) Roth and Lapata (2016) He et al. (2018b) BERT-base Dev - 94.77 95.01 96.32 Test 93.43 95.47 95.58 96.88 Brown 82.36 - - 90.63 Table 2: Predicate disambiguation accuracy on the CoNLL 2009 dataset. Model Marcheggiani and Titov (2017) He et al. (2018b) Shi and Zhang (2017) BERT-LSTM-base BERT-LSTM-large Dev 83.3 84.2 85.6 88.7 89.3 Test Brown - - 87.1 89.8 90.3 - - 77.4 82.7 83.5 Table 3: Comparison of F1 scores for argument identi- fication and classification on the CoNLL 2009 dataset, excluding predicate sense disambiguation. where the label set draws from the cross of the standard BIO tagging scheme and the arguments of the predicate (e.g., B-ARG1). The model ar- chitecture is illustrated in Figure 2, at the point in the inference process where it is outputting a tag for the token "Barack". In order to encode the sentence in a predicate-aware manner, we de- sign the input as [[CLS] sentence [SEP] predicate [SEP]], allowing the representation of the predi- cate to interact with the entire sentence via ap- propriate attention mechanisms. The input se- quence as described above is fed into the BERT encoder. The contextual representation of the sen- tence ([CLS] sentence [SEP]) from BERT is then concatenated to predicate indicator embeddings, followed by a one-layer BiLSTM to obtain hidden states G = [g1, g2, ..., gn]. For the final prediction on each token gi, the hidden state of predicate gp is concatenated to the hidden state of the token gi, and then fed into a one-hidden-layer MLP classi- fier over the label set. 3.2 Experimental Setup We conduct experiments on two SRL tasks: span- based and dependency-based. For span-based SRL, the CoNLL 2005 (Carreras and M`arquez, 2004) and 2012 (Pradhan et al., 2013) datasets are used. For dependency-based SRL, the CoNLL 2009 (Hajic et al., 2009) dataset is used. We fol- low standard splits for the training, development, and test sets. In our experiments, the hidden sizes of the LSTM and MLP are 768 and 300, respectively, Figure 2: Architecture of our predicate identification and classification model, at the point where the model is making a prediction for the token "Barack". (b) de- notes the concatenation of BERT contextual embed- ding and predicate indicator embedding. The final pre- diction is based on the concatenation of the hidden state of the predicate ("went") and the hidden state of the current token, fed through an MLP. decoding. For several SRL benchmarks, such as CoNLL 2005, 2009, and 2012, the predicate is given during both training and testing. Thus, in this paper, we only discuss predicate disambigua- tion and argument identification and classification. Predicate sense disambiguation. The predi- cate disambiguation task is to identify the correct meaning of a predicate in a given context. As an example, for the sentence "Barack Obama went to Paris", the predicate went has sense "motion" and has sense label 01. We formulate this task as sequence labeling. The input sentence is fed into the WordPiece to- kenizer, which splits some words into sub-tokens. The predicate token is tagged with the sense la- bel. Following the original BERT paper, two la- bels are used for the remaining tokens: 'O' for the first (sub-)token of any word and 'X' for any re- maining fragments. We feed the sequences into the BERT encoder to obtain the contextual repre- sentation H. A "predicate indicator" embedding is then concatenated to the contextual representa- tion to distinguish the predicate tokens from non- predicate ones. The final prediction is made using a one-hidden-layer MLP over the label set. Argument identification and classification. This task is to detect the argument spans or argument syntactic heads and assign them the correct se- mantic role labels. In the above example, "Barack Obama" is the ARG1 of the predicate went, mean- ing the entity in motion. Formally, our task is to predict a sequence z given a sentence -- predicate pair (X , v) as input, [CLS] Barack Obama went to Paris [SEP] went[SEP]BERTbB-ARG1 Single Model He et al. (2018b) Li et al. (2018) Li et al. (2019) BERT-LSTM-base BERT-LSTM-large Ensemble Roth and Lapata (2016) Marcheggiani and Titov (2017) CoNLL 09 (In-domain) Out-of-domain (Brown) P 89.7 90.3 89.6 92.1 92.4 90.3 90.5 R 76.9 79.0 81.4 84.7 85.8 73.6 77.1 R 89.3 89.3 91.2 91.9 92.3 85.7 87.7 P 81.9 80.6 81.7 85.6 85.7 79.7 80.8 F1 79.3 79.8 81.5 85.1 85.7 76.5 78.9 F1 89.5 89.8 90.4 92.0 92.4 87.9 89.1 Table 4: Performance comparison on dependency-based SRL. CoNLL 05 (In-domain) Out-of-domain (Brown) P 86.0 P 76.7 R 86.0 R 76.4 Model Strubell et al. (2018) He et al. (2018a) Ouchi et al. (2018) Li et al. (2019) BERT-LSTM-base BERT-LSTM-large Ouchi et al. (2018) (ensemble) - 88.2 87.9 87.8 88.6 89.2 - 87.0 87.5 88.4 89.0 87.9 F1 86.0 87.4 87.6 87.7 88.1 88.8 88.5 CoNLL 12 (In-domain) P - - F1 - R - - 87.1 85.7 85.7 85.9 88.5 85.3 86.3 86.7 87.0 85.5 85.5 86.2 86.0 86.2 86.5 87.0 F1 76.5 80.4 78.7 80.5 80.9 82.0 79.6 - 79.9 80.6 80.7 81.9 81.0 - 77.5 80.4 81.2 82.1 78.4 Table 5: Performance comparison on span-based SRL. and the predicate indicator embedding size is 10. The learning rate is 5 × 10−5. BERT base-cased and large-cased models are used in our experi- ments. The position embeddings are randomly ini- tialized and fine-tuned during the training process. 3.3 Dependency-Based SRL Results Predicate sense disambiguation. The predicate sense disambiguation subtask applies only to the CoNLL 2009 benchmark. In this line of research on dependency-based SRL, previous papers sel- dom report the accuracy of predicate disambigua- tion separately (results are often mixed with argu- ment identification and classification), causing dif- ficulty in determining the source of gains. Here, we report predicate disambiguation accuracy in Table 2 for the development set, test set, and the out-of-domain test set (Brown). The state-of-the- art model (He et al., 2018b) is based on a Bi- LSTM and linguistic features such as POS tag embeddings and lemma embeddings. Instead of using linguistic features, our simple MLP model achieves better accuracy with the help of powerful contextual embeddings. These predicate sense dis- ambiguation results are used in the dependency- based SRL end-to-end evaluation. Argument identification and classification. We provide SRL performance excluding predicate sense disambiguation to validate the source of im- provements: results are shown in Table 3. Figures from some systems are missing because they only report end-to-end results. Our end-to-end results are shown in Table 4. We see that the BERT-LSTM-large model (using the predicate sense disambiguation results from above) yields large F1 score improvements over the existing state of the art (Li et al., 2019), and beats existing ensemble models as well. This is achieved without using any linguistic features and declarative decoding constraints. 3.4 Span-Based SRL Results Our span-based SRL results are shown in Ta- ble 5. We see that the BERT-LSTM-large model achieves the state-of-the-art F1 score among sin- gle models and outperforms the Ouchi et al. (2018) ensemble model on the CoNLL 2005 in-domain and out-of-domain tests. However, it falls short on the CoNLL 2012 benchmark because the model of Ouchi et al. (2018) obtains very high precision. They are able to achieve this with a more complex decoding layer, with human-designed constraints such as the "Overlap Constraint" and "Number Constraint". 4 Conclusions Based on this preliminary study, we show that BERT can be adapted to relation extraction and semantic role labeling without syntactic features and human-designed constraints. While we con- cede that our model is quite simple, we argue this is a feature, as the power of BERT is able to sim- plify neural architectures tailored to specific tasks. Nevertheless, these results provide strong base- lines and foundations for future research. Many natural follow-up questions emerge: Can syntac- tic features be re-introduced to further improve re- sults? Can multitask learning be used to simul- taneously benefit relation extraction and semantic role labeling? We are actively working on answer- ing these and additional questions. Acknowledgments supported by the Natu- research was This ral Sciences and Engineering Research Council (NSERC) of Canada. References Christoph Alt, Marc Hubner, and Leonhard Hennig. 2019. Improving relation extraction by pre-trained language representations. In AKBC. Xavier Carreras and Llu´ıs M`arquez. 2004. Introduc- tion to the CoNLL-2004 shared task: Semantic role In Proceedings of the Eighth Confer- labeling. ence on Computational Natural Language Learning (CoNLL-2004) at HLT-NAACL 2004. Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. BERT: Pre-training of deep bidirectional transformers for language under- standing. arXiv:1810.04805. Anthony Fader, Stephen Soderland, and Oren Etzioni. 2011. Identifying relations for open information ex- traction. In Proceedings of the 2011 Conference on Empirical Methods in Natural Language Process- ing, pages 1535 -- 1545. Jan Hajic, Massimiliano Ciaramita, Richard Johans- son, Daisuke Kawahara, Maria Ant`onia Mart´ı, Llu´ıs M`arquez, Adam Meyers, Joakim Nivre, Sebastian Pad´o, Jan Step´anek, et al. 2009. The CoNLL-2009 shared task: Syntactic and semantic dependencies in multiple languages. In Proceedings of the Thir- teenth Conference on Computational Natural Lan- guage Learning: Shared Task, pages 1 -- 18. Luheng He, Kenton Lee, Omer Levy, and Luke Zettle- moyer. 2018a. Jointly predicting predicates and ar- In Pro- guments in neural semantic role labeling. ceedings of the 56th Annual Meeting of the Associa- tion for Computational Linguistics (Volume 2: Short Papers), pages 364 -- 369. Luheng He, Kenton Lee, Mike Lewis, and Luke Zettle- moyer. 2017. Deep semantic role labeling: What works and what's next. In Proceedings of the 55th Annual Meeting of the Association for Computa- tional Linguistics (Volume 1: Long Papers), pages 473 -- 483. Shexia He, Zuchao Li, Hai Zhao, and Hongxiao Bai. 2018b. Syntax for semantic role labeling, to be, or not to be. In Proceedings of the 56th Annual Meet- ing of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2061 -- 2071. Thomas N. Kipf and Max Welling. 2016. Semi- supervised classification with graph convolutional In Proceedings of the 5th International networks. Conference on Learning Representations. Zuchao Li, Shexia He, Jiaxun Cai, Zhuosheng Zhang, Hai Zhao, Gongshen Liu, Linlin Li, and Luo Si. 2018. A unified syntax-aware framework for seman- tic role labeling. In Proceedings of the 2018 Con- ference on Empirical Methods in Natural Language Processing, pages 2401 -- 2411. Zuchao Li, Shexia He, Hai Zhao, Yiqing Zhang, Zhu- osheng Zhang, Xi Zhou, and Xiang Zhou. 2019. De- pendency or span, end-to-end uniform semantic role labeling. In Proceedings of the 33rd AAAI Confer- ence on Artificial Intelligence. Diego Marcheggiani, Anton Frolov, and Ivan Titov. 2017. A simple and accurate syntax-agnostic neural model for dependency-based semantic role labeling. In Proceedings of the 21st Conference on Computa- tional Natural Language Learning (CoNLL 2017), pages 411 -- 420. Diego Marcheggiani and Ivan Titov. 2017. Encoding sentences with graph convolutional networks for se- In Proceedings of the 2017 mantic role labeling. Conference on Empirical Methods in Natural Lan- guage Processing, pages 1506 -- 1515. Hiroki Ouchi, Hiroyuki Shindo, and Yuji Matsumoto. 2018. A span selection model for semantic role la- beling. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Process- ing, pages 1630 -- 1642. Matthew 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 Asso- ciation for Computational Linguistics: Human Lan- guage Technologies, Volume 1 (Long Papers), pages 2227 -- 2237. Sameer Pradhan, Alessandro Moschitti, Nianwen Xue, Hwee Tou Ng, Anders Bjorkelund, Olga Uryupina, Yuchen Zhang, and Zhi Zhong. 2013. Towards ro- In Pro- bust linguistic analysis using OntoNotes. ceedings of the Seventeenth Conference on Com- putational Natural Language Learning, pages 143 -- 152. Alec Radford, Karthik Narasimhan, Tim Salimans, and Improving language under- Ilya Sutskever. 2018. standing by generative pre-training. Michael Roth and Mirella Lapata. 2016. Neural se- mantic role labeling with dependency path embed- dings. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Vol- ume 1: Long Papers), pages 1192 -- 1202. Rico Sennrich, Barry Haddow, and Alexandra Birch. 2016. Neural machine translation of rare words with subword units. In Proceedings of the 54th An- nual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1715 -- 1725. Dan Shen and Mirella Lapata. 2007. Using seman- In Pro- tic roles to improve question answering. ceedings of the 2007 Joint Conference on Empirical Methods in Natural Language Processing and Com- putational Natural Language Learning (EMNLP- CoNLL), pages 12 -- 21. Peng Shi and Yue Zhang. 2017. Joint bi-affine parsing In Proceedings of the and semantic role labeling. 2017 International Conference on Asian Language Processing (IALP), pages 338 -- 341. Patrick Verga, Daniel Andor, Emma Strubell, David Weiss, and Andrew McCallum. 2018. Linguistically-informed self-attention for semantic In Proceedings of the 2018 Confer- role labeling. ence on Empirical Methods in Natural Language Processing, pages 5027 -- 5038. Felix Wu, Tianyi Zhang, Amauri Holanda de Souza Jr, Christopher Fifty, Tao Yu, and Kilian Q. Weinberger. 2019. Simplifying graph convolutional networks. arXiv:1902.07153. 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 Nat- ural Language Processing, pages 2205 -- 2215. Yuhao Zhang, Victor Zhong, Danqi Chen, Gabor An- geli, and Christopher D. Manning. 2017. Position- aware attention and supervised data improve slot fill- ing. In Proceedings of the 2017 Conference on Em- pirical Methods in Natural Language Processing, pages 35 -- 45.
1709.04849
5
1709
2018-10-01T09:16:57
Self-Attentive Residual Decoder for Neural Machine Translation
[ "cs.CL" ]
Neural sequence-to-sequence networks with attention have achieved remarkable performance for machine translation. One of the reasons for their effectiveness is their ability to capture relevant source-side contextual information at each time-step prediction through an attention mechanism. However, the target-side context is solely based on the sequence model which, in practice, is prone to a recency bias and lacks the ability to capture effectively non-sequential dependencies among words. To address this limitation, we propose a target-side-attentive residual recurrent network for decoding, where attention over previous words contributes directly to the prediction of the next word. The residual learning facilitates the flow of information from the distant past and is able to emphasize any of the previously translated words, hence it gains access to a wider context. The proposed model outperforms a neural MT baseline as well as a memory and self-attention network on three language pairs. The analysis of the attention learned by the decoder confirms that it emphasizes a wider context, and that it captures syntactic-like structures.
cs.CL
cs
Self-Attentive Residual Decoder for Neural Machine Translation Lesly Miculicich Werlen*,†, Nikolaos Pappas*, Dhananjay Ram*,†, Andrei Popescu-Belis‡ *Idiap Research Institute, Switzerland, † ´Ecole polytechnique f´ed´erale de Lausanne (EPFL), Switzerland, ‡HEIG-VD / HES-SO, Switzerland {lmiculicich, npappas, dram}@idiap.ch [email protected] 8 1 0 2 t c O 1 ] L C . s c [ 5 v 9 4 8 4 0 . 9 0 7 1 : v i X r a Abstract Neural sequence-to-sequence networks with attention have achieved remarkable perfor- mance for machine translation. One of the rea- sons for their effectiveness is their ability to capture relevant source-side contextual infor- mation at each time-step prediction through an attention mechanism. However, the target-side context is solely based on the sequence model which, in practice, is prone to a recency bias and lacks the ability to capture effectively non- sequential dependencies among words. To ad- dress this limitation, we propose a target-side- attentive residual recurrent network for decod- ing, where attention over previous words con- tributes directly to the prediction of the next word. The residual learning facilitates the flow of information from the distant past and is able to emphasize any of the previously translated words, hence it gains access to a wider context. The proposed model outperforms a neural MT baseline as well as a memory and self-attention network on three language pairs. The analysis of the attention learned by the decoder con- firms that it emphasizes a wider context, and that it captures syntactic-like structures. 1 Introduction Neural machine translation (NMT) has recently become the state-of-the-art approach to machine translation (Bojar et al., 2016). Several architec- tures have been proposed for this task (Kalchbren- ner and Blunsom, 2013; Sutskever et al., 2014; Cho et al., 2014; Gehring et al., 2017; Vaswani et al., 2017), but the attention-based NMT model designed by Bahdanau et al. (2015) is still con- sidered the de-facto baseline. This architecture is composed of two recurrent neural networks (RNNs), an encoder and a decoder, and an at- tention mechanism between them for modeling a (a) Baseline NMT decoder (b) Self-attentive residual dec. Figure 1: Comparison between the decoder of the base- line NMT and the proposed decoder with self-attentive residual connections. soft word-alignment. First, the model encodes the complete source sentence, and then decodes one word at a time. The decoder has access to all the context on the source side through the attention mechanism. However, on the target side, the con- textual information is represented only through a fixed-length vector, namely the hidden state of the decoder. As observed by Bahdanau et al. (2015), this creates a bottleneck which hinders the ability of the sequential model to learn longer-term infor- mation effectively. As pointed out by Cheng et al. (2016), sequen- tial models present two main problems for natural language processing. First, the memory of the en- coder is shared across multiple words and is prone to bias towards the recent past. Second, such mod- els do not fully capture the structural composition of language. To address these limitations, several recent models have been proposed, namely mem- ory networks (Cheng et al., 2016; Tran et al., 2016; Wang et al., 2016) and self-attention networks (Daniluk et al., 2016; Liu and Lapata, 2018). We experimented with these methods, applying them to NMT: memory RNN (Cheng et al., 2016) and self-attentive RNN (Daniluk et al., 2016). How- ever, we observed no significant gains in perfor- mance over the baseline architecture. In this paper, we propose a self-attentive resid- ual recurrent decoder, presented in Figure 1b, which, if unfolded over time, represents a densely- connected residual network. The self-attentive residual connections focus selectively on previ- ously translated words and propagate useful in- formation to the output of the decoder, within an attention-based NMT architecture. The at- tention paid to the previously predicted words is analogous to a read-only memory operation, and enables the learning of syntactic-like structures which are useful for the translation task. Our evaluation on three language pairs shows that the proposed model improves over several baselines, with only a small increase in compu- tational overhead. In contrast, other similar ap- proaches have lower scores but a higher compu- tational overhead. The contributions of this paper can be summarized as follows: • We propose and compare several options for using self-attentive residual learning within a standard decoder, which facilitates the flow of contextual information on the target side. • We demonstrate consistent improvements over a standard baseline, and two advanced variants, which make use of memory and self-attention on three language pairs (English-to-Chinese, Spanish-to-English, and English-to-German). • We perform an ablation study and analyze the learned attention function, providing additional insights on its actual contributions. 2 Related Work Several studies have been proposed to enhance sequential models by capturing longer contexts. Long short-term memory (LSTM) (Hochreiter and Schmidhuber, 1997) is the most commonly used recurrent neural network (RNN), because its in- ternal memory allows to retain information from a more distant past than a vanilla RNN. Several studies attempt to increase the memory capacity of LSTMs by using memory networks (Weston et al., 2015; Sukhbaatar et al., 2015). For instance, Cheng et al. (2016) incorporate different mem- ory cells for each previous output representation, which are later accessed by an attention mecha- nism. Tran et al. (2016) include a memory block to access recent input words in a selective manner. Both methods show improvements on language modeling. For NMT, Wang et al. (2016) presented a decoder enhanced with an external shared mem- ory. Memory networks extend the capacity of the network and have the potential to read, write, and forget information. Our method, which attends over previously predicted words, can be seen as a read-only memory, which is simpler but computa- tionally more efficient because it does not require additional memory space. Other studies aim to improve the modeling of source-side contextual information, for exam- ple through a context-aware encoder using self- attention (Zhang et al., 2017), or a recurrent atten- tion NMT (Yang et al., 2017) that is aware of pre- viously attended words on the source-side in or- der to better predict which words will be attended in future. Additionally, variational NMT (Zhang et al., 2016a) introduces a latent variable to model the underlying semantics of source sentences. In contrast to these studies, we focus instead on the contextual information on the target side. The application of self-attention mechanisms to RNNs have been previously studied, and in gen- eral, they seem to capture syntactic dependen- cies among distant words (Liu and Lapata, 2018; Soltani and Jiang, 2016; Lee et al., 2017; Lin et al., 2017). Daniluk et al. (2016) explore different ap- proaches to self-attention for language modeling, leading to improvements over a baseline LSTM and over memory-augmented methods. However, the methods do not fully utilize a longer context. The main difference with our approach is that we apply attention on the output embeddings rather than the hidden states. Thus, the connections are independent of the recurrent layer representations, which is beneficial to NMT, as we show below. Our model relies on residual connections, which have been shown to improve the learning process of deep neural networks by addressing the vanishing gradient problem (He et al., 2016). These connections create a direct path from pre- vious layers, helping the transmission of informa- tion. Recently, several architectures using resid- ual connections with LSTMs have been proposed for sequence prediction (Zhang et al., 2016b; Kim et al., 2017; Zilly et al., 2017; Wang and Tian, 2016). To our knowledge, our study is the first one to use self-attentive residual connections within residual RNNs for NMT. In parallel to our study, a similar method was recently proposed for senti- ment analysis (Wang, 2017). 3 Background: Neural Machine Translation Neural machine translation aims to compute the conditional distribution of emitting a sentence in a target language given a sentence in a source language, denoted by pΘ(yx), where Θ is the set of parameters of the neural model, and y = {y1, ..., yn} and x = {x1, ..., xm} are respectively the representations of source and target sentences as sequences of words. The parameters Θ are learned by training a sequence-to-sequence neural model on a corpus of parallel sentences. In par- ticular, the learning objective is to maximize the following conditional log-likelihood: N(cid:88) n=1 max Θ 1 N log(pΘ(yx)) (1) The models typically use gated recurrent units (GRUs) (Cho et al., 2014) or LSTMs (Hochreiter and Schmidhuber, 1997). Their architecture has three main components: an encoder, a decoder, and an attention mechanism. The goal of the encoder is to build meaningful representations of the source sentences. It consists of a bidirectional RNN which includes contextual information from past and future words into the vector representation hi of a particular word vector xi, formally defined as follows: ←− hi ] ←− Here, hi = f (xi, hi+1) are the hidden states of the forward and backward passes of the bidirectional RNN respectively, and f is a non-linear function. −→ hi = f (xi, hi−1) and −→ hi , hi = [ (2) The decoder (see Figure 1a) is in essence a re- current language model. At each time step, it pre- dicts a target word yt conditioned over the previ- ous words and the information from the encoder using the following posterior probability: p(yty1, ..., yt−1, ct) ≈ g(st, yt−1, ct) (3) where g is a non-linear multilayer function. The hidden state of the decoder st is defined as: st = f (st−1, yt−1, ct) (4) and depends on a context vector ct that is com- puted by the attention mechanism. The attention mechanism allows the decoder to select which parts of the source sentence are more m(cid:88) useful to predict the next output word. This goal is achieved by considering a weighted sum over all hidden states of the encoder as follows: ct = αt ihi (5) i=1 where αt i is a weight calculated using a normalized exponential function a, also known as alignment function, which computes how good is the match between the input at position i ∈ {1, ..., n} and the output at position t: i = sof tmax(et αt i) et i = a(st−1, hi) (6) (7) Different types of alignment functions have been used for NMT, as investigated by Luong et al. (2015). Here, we use the one originally defined by Bahdanau et al. (2015). 4 Self-Attentive Residual Decoder The decoder of the attention-based NMT model uses a skip connection from the previously pre- dicted word to the output classifier in order to en- hance the performance of translation. As we can see in Eq. (3), the probability of a particular word is calculated by a function g which takes as input the hidden state of the recurrent layer st, the rep- resentation of the previously predicted word yt−1, and the context vector ct. Within g, these quanti- ties are typically summed up after going through simple linear transformations, hence the addition of yt−1 is indeed a skip connection as in residual networks (He et al., 2016). In theory, st should be sufficient for predicting the next word given that it is dependent on the other two local-context com- ponents according to Eq. (4). However, the yt−1 quantity makes the model emphasize the last pre- dicted word for generating the next word. How can we make the model consider a broader con- text? To answer this question, we propose to include into the decoder's formula skip connections not only from the previous time step yt−1, but from all previous time steps from y0 to yt−1. This defines a residual recurrent network which, unfolded over time, can be seen as a densely connected residual network. These connections are applied to all pre- viously predicted words, and reinforce the mem- ory of the recurrent layer towards what has been translated so far. At each time step, the model decides which of the previously predicted words should be emphasized to predict the next one. In order to deal with the dynamic length of this new input, we use a target-side summary vector dt that can be interpreted as the representation of the de- coded sentence until the time t in the word embed- ding space. We therefore modify Eq. (3) replacing yt−1 with dt: p(yty1, ..., yt−1, ct) ≈ g(st, dt, ct) (8) The replacement of yt−1 with dt means that the number of parameters added to the model is de- pendent only on the calculation of dt. Figure 1b illustrates the change made to the decoder. We de- fine two methods for summarizing the context into dt, which are described in the following sections. 4.1 Mean Residual Connections One simple way to aggregate information from multiple word embeddings is by averaging them. This average can be seen as the sentence represen- tation until time t. We hypothesize that this repre- sentation is more informative than using only the embedding of the previous word. Formally: davg t = 1 t − 1 yi (9) 4.2 Self-Attentive Residual Connections Averaging is a simple and cheap way to aggregate information from multiple words, but may not be sufficient for all kinds of dependencies. Instead, we propose a dynamic way to aggregate informa- tion in each sentence, such that different words have different importance according to their re- lation with the prediction of the next word. We propose to use a shared self-attention mechanism to obtain a summary representation of the transla- tion, i.e. a weighted average representation of the words translated from y0 to yt−1. This mechanism aims to model, in part, important non-sequential dependencies among words, and serves as a com- plementary memory to the recurrent layer. t−1(cid:88) i=1 t−1(cid:88) dcavg t = αt iyi i=1 i = sof tmax(et αt i) (10) (11) The weights of the attention model are computed by a scoring function et i that predicts how impor- tant each previous word (y0, ..., or yt−1) is for the current prediction yt. We experiment with two different scoring func- tions, as follows: (cid:124) et i = v tanh(Wyyi + Wsst) (content+scope) (12) (cid:124) or et i = v tanh(Wyyi) (content) (13) where v ∈ Re, Wy ∈ Re×e, and Ws ∈ Re×d are weight matrices, e and d are the dimensions of the embeddings and hidden states respectively. Firstly, we study the scoring function noted con- tent+scope, as proposed by Bahdanau et al. (2015) for NMT. Secondly, we explore a scoring func- tion noted as content, which is calculated based only on the previous hidden states of the decoder, as proposed by Pappas and Popescu-Belis (2017). In contrast to the first attention function, which makes use of the hidden vector st, the second one is based only on the previous word representa- tions, therefore, it is independent of the current prediction representation. However, the normal- ization of this function still depends on t. 5 Other Self-Attentive Networks To compare our approach with similar studies, we adapted two representative self-attentive networks for application to NMT. 5.1 Memory RNN The Memory RNN decoder is based on the pro- posal by Cheng et al. (2016) to modify an LSTM layer to include a memory with different cells for each previous output representation. Thus at each time step, the hidden layer can select past infor- mation dynamically from the memory. To adapt it to our framework, we modify Eq. (4) as: st = f (st, yt−1, ct) t−1(cid:88) where st = αt isi i=1 αt i = sof tmax(et i) et i = a(hi, yt−1, st−1) (14) (15) (16) (17) 5.2 Self-Attentive RNN The Self-Attentive RNN is the simplest one pro- posed by Daniluk et al. (2016), and incorporates a summary vector from past predictions calculated with an attention mechanism. Here, the attention is applied over previous hidden states. This de- coder is formulated as follows: p(yty1, ..., yt−1, ct) ≈ g(st, yt−1, ct, st) (18) where st = t−1(cid:88) i=1 αt isi i = sof tmax(et αt i) et i = a(si, st) (19) (20) (21) Additional details of the formulations in Sec- tions 3, 4, and 5 are described in the Appendix ??. 6 Experimental Settings 6.1 Datasets To evaluate the proposed MT models in differ- ent conditions, we select three language pairs with increasing amounts of training data: English- Chinese (0.5M sentence pairs), Spanish-English (2.1M), and English-German (4.5M). For English-to-Chinese, we use a subset of the UN parallel corpus (Rafalovitch and Dale, 2009)1, with 0.5M sentence pairs for training, 2K for development, and 2K for testing. For training Spanish-to-English MT, we use a subset of WMT 2013 (Bojar et al., 2013), corresponding to Eu- roparl v7 and News Commentary v11 with ca. 2.1M sentence pairs. Newstest2012 and New- stest2013 were used for development and test- ing respectively. Finally, we use the complete English-to-German set from WMT 2016 (Bojar et al., 2016) with a total of ca. 4.5M sentence pairs. The development set is Newstest2013, and the testing set is Newstest2014. Additionally, we include as testing sets Newstest2015 and New- stest2016, for comparison with the state of the art. We report translation quality using (a) BLEU over tokenized and truecased texts, and (b) NIST BLEU over detokenized and detruecased texts2. 6.2 Model Configuration We use the implementation of the attention-based NMT baseline provided in team2016theano3 developed in Python using Theano (?). The sys- tem implements an attention-based NMT model, described above, using one layer of GRUs (Cho et al., 2014). The vocabulary size is 25K for English-to-Chinese NMT, and 50K for Spanish- to-English and English-German. We use the byte pair encoding (BPE) strategy for out-of- vocabulary words (Sennrich et al., 2016b). For all 1http://www.uncorpora.org/ 2Scrips from Moses toolkit (Koehn et al., 2007): BLEU multi-bleu, NIST BLEU mteval-v13a.pl, tokenizer.perl, truecase.perl. 3https://github.com/nyu-dl/dl4mt-tutorial Θ Θ Θ BLEU En -- Zh Es -- En Models 25.2 21.6 SMT baseline 25.4 108.7M 22.6 NMT baseline 25.5 109.7M 22.5 + Memory RNN 110.2M 22.0 25.1 + Self-attentive RNN 25.7 + Mean residual connections 108.7M 23.6 + Self-attentive residual connections 108.9M 24.0 26.3 -- Table 1: BLEU score (multi-bleu) on tokenized text. The highest score per dataset is marked in bold. The self-attentive residual connections make use of the con- tent attention function. Θ indicates the number of pa- rameters per model. cases, the maximum sentence length of the train- ing samples is 50, the dimension of the word em- beddings is 500, and the dimension of the hidden layers is 1,024. We use dropout with a probabil- ity of 0.5 after each layer. The parameters of the models are initialized randomly from a standard normal distribution scaled to a factor of 0.01. The loss function is optimized using Adadelta (Zeiler, 2012) with  = 10−6 and ρ = 0.95 as in the origi- nal paper. The systems were trained in 7 -- 12 days for each model on a Tesla K40 GPU at the speed of about 1,000 words/sec. 7 Analysis of the Results Table 1 shows the BLEU scores and the number of parameters used by the different NMT models. Along with the NMT baseline, we included a sta- tistical machine translation (SMT) model based on Moses (Koehn et al., 2007) with the same train- ing/tuning/test data as the NMT. The performance of memory RNN is similar to the baseline and, as confirmed later, its focus of attention is mainly on the prediction at t − 1. The self-attentive RNN method is inferior to the baseline, which can be attributed to the overhead on the hidden vectors that have to learn the recurrent representations and the attention simultaneously. The proposed mod- els outperform the baseline, and the best scores are obtained by the NMT model with self-attentive residual connections. Despite their simplicity, the mean residual connections already improve the translation, without increasing the number of pa- rameters. Tables 2 and 3 show further experiments with the proposed methods on various English-German test sets, compared to several previous systems. Table 2 shows BLEU values calculated by multi- BLEU -- -- NT14 NT15 Models NMT (unk. word repl.) (Luong et al., 2015) 20.9 Context-aware NMT (Zhang et al., 2017) 22.57 Recurrent attention NMT (Yang et al., 2017) 22.1 25.0 Variational NMT (Zhang et al., 2016a) 25.49 22.3 24.8 NMT baseline 22.6 24.9 + Memory RNN 22.0 24.3 + Self-attentive RNN + Mean residual connections 22.9 24.9 23.2 25.5 + Self-attentive residual connections -- Table 2: BLEU score (multi-bleu) on tokenized text for English-to-German on Newstest (NT) 2014, and 2015. The highest score per dataset is marked in bold. The self-attentive residual connections makes use of the content attention function. BLEU (NIST) Models Winning WMT NMT (BPE) (Sennrich et al., 2016b) 29.0 Syntax NMT (Nadejde et al., 2017) 21.0 24.4 28.8 NMT Baseline + Mean residual connections* 21.4 24.7 29.6 + Self-attentive residual connections** 21.7 25.0 29.7 NT14 NT15 NT16 20.1 24.4 34.2 -- -- -- 22.8 -- Table 3: NIST BLEU scores on detokenized and de- truecased text for English-to-German on Newstest (NT) 2014, 2015, 2016. Significance test: * p < 0.05, ** p < 0.01. The Winning WMT systems are listed in the text below. bleu, and includes the NMT system proposed by Luong et al. (2015) which replaces unknown pre- dicted words with the most strongly aligned word on the source sentence. Also, the table includes other systems described in Section 2. Addition- ally, Table 3 shows values calculated by the NIST BLEU scorer, as well as results reported by the "Winning WMT" systems for each test set re- spectively: UEDIN-SYNTAX (Williams et al., 2014), UEDIN-SYNTAX (Williams et al., 2015), and UEDIN-NMT (Sennrich et al., 2016a). Also, we include the results reported by Sennrich et al. (2016b) for a baseline encoder-decoder NMT with BPE for unknown words similar to our configu- ration, and finally the system proposed by Nade- jde et al. (2017), an explicit syntax-aware NMT that introduces combinatory categorial grammar (CCG) supertags on the target side by predicting words and tags alternately. The comparison with this work is relevant for the analysis described later in Section 8.2. The results confirm that the BLEU Attention function En-Zh Es-En Content+Scope 25.6 26.3 Content 23.1 24.0 Table 4: BLEU scores for two scoring variants of the attention function of the proposed decoder. self-attentive residual connections improve signif- icantly the translations. To evaluate the signifi- cance of the improvements against the NMT base- line, we performed a one-tailed paired t-test. Impact of the Attention Function 7.1 We now examine the two scoring functions that can be used for the self-attentive residual con- nections model presented in Eq. (12), considering English-to-Chinese and Spanish-to-English. The BLEU scores are presented in Table 4: the best option is the content matching function, which de- pends only on the word embeddings. The con- tent+scope function, which depends additionally on the hidden representation of the current pre- diction is better than the baseline but scores lower than content. The idea that the importance of the context depends on the current prediction is ap- pealing, because it can be interpreted as learning internal dependencies among words. However, the experimental results show that it does not neces- sarily lead to the best translation. On the contrary, the content attention function may be extracting representations of the whole sentence which are easier to learn and generalize. 7.2 Performance According to Human Evaluation Manual evaluation on samples of 50 sentences for each language pair helped to corroborate the conclusions obtained from the BLEU scores, and to provide a qualitative understanding of the im- provements brought by our model. For each lan- guage, we employed one evaluator who was a na- tive speaker of the target language and had good knowledge of the source language. The evalua- tors ranked three translations of the same source sentence -- one from each of our models: base- line, mean residual connections, and self-attentive residual connections -- according to their transla- tion quality. The three translations were presented in a random order, so that the system that had gen- erated them could not be identified. To integrate the judgments, we proceed in pairs, and count the Ranking (%) Es -- En System En -- De En -- Zh > = < > = < > = < Mean vs. Baseline 26 56 18 20 64 16 28 58 24 Self-attentive vs. Baseline 28 60 12 28 56 16 32 54 14 Self-attentive vs. Mean 24 62 14 28 58 14 32 56 12 Table 5: Human evaluation of sentence-level transla- tion quality on three language pairs. We compare the models in pairs, indicating the percentages of sentences that were ranked higher (>), equal to (=), or lower (<) for the first system with respect to the second one. The values correspond to percentages (%). d Perplexity Systems 300 LSTM (Daniluk et al., 2016) 296 LSTM + Attention (Daniluk et al., 2016) 968 LSTM + 4-gram (Daniluk et al., 2016) 296 LSTM + Mean residual connections LSTM + Self-attentive residual connections 296 85.2 82.0 75.9 80.2 80.4 Table 6: Evaluation of the proposed methods on lan- guage modeling. The number of parameter for all mod- els is 47M. number of times each system was ranked higher, equal to, or lower than another competing sys- tem. The results shown in Table 5 indicate that the self-attentive residual connections model out- performs the one with mean residual connections, and both outperform the baseline, for all three lan- guage pairs. The rankings are thus identical to those obtained using BLEU in Tables 1 and 3. 7.3 Performance on Language Modeling To examine whether language modeling (LM) can benefit from the proposed method, we incorporate the residual connections into a neural LM. We use the same setting as Daniluk et al. (2016) for a cor- pus of Wikipedia articles (22.5M words), and we compare with two methods proposed in the same paper, namely attention LSTM and 4-gram LSTM. As shown in Table 6, the proposed models out- perform the LSTM baseline as well as the self- attention model, but not the 4-gram LSTM. Ex- periments using 4-gram LSTM for NMT showed poor performance (13.9 BLEU points for English- Chinese) which can be attributed to the difference between the LM and NMT tasks. Both tasks pre- dict one word at a time conditioned over previ- ous words, however, in NMT the previous target- word-inputs are not given, they have to be gener- ated by the decoder. Thus, the output could be conditioned over previous erroneous predictions affecting in higher proportion the 4-gram LSTM Figure 2: Percentage of words that received maximum attention at a given relative position, ranging from −1 to −50 (maximum length). model. This shows that even if a model improves language modeling, it does not necessarily im- prove machine translation. 8 Qualitative Analysis 8.1 Distribution of Attention Figure 2 shows a comparison of the distribution of attention of the different self-attentive models de- scribed in this paper, on Spanish-to-English NMT (the other two language pairs exhibit similar distri- butions). The values correspond to the number of words which received maximal attention for each relative position (x-axis). We selected, at each pre- diction, the preceding word with maximal weight, and counted its relative position. We normalized the count by the number of previous words at the time of each prediction. We observe that the memory RNN almost al- ways selects the immediately previous word (t−1) and ignores the rest of the context. On the con- trary, the other two models distribute attention more evenly among all previous words. In partic- ular, the self-attentive RNN uses a longer context than the self-attentive residual connections but, as the performance on BLEU score shows, this fact does not necessarily mean better translation. Figure 3 shows the attention to previous words generated by each model for one sentence trans- lated from Spanish to English. The matrices present the target-side attention weights, with the vertical axis indicating the previous words, and the color shades at each position (cell) representing the attention weights. The weights of the mem- ory RNN are concentrated on the diagonal, indi- cating that the attention is generally located on the previous word, which makes the model al- (a) Memory RNN (b) Self-attentive RNN (c) Self-attentive residual connections Figure 3: Matrix of distribution of the attention weights to previous words. The vertical axis represents the previous words. A darker shade indicates a higher attention weight. n ← length(s) i ← 0 while max(A[:][i]) = 0 or i < n do Algorithm 1 Binary Parse Tree Require: A matrix of attention of size N × N Require: s sentence as list of words of size N 1: function SPLIT(tree, A, s) 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: end function 14: tree ← newT ree(); SPLIT(tree, A, s) subtree ← newT ree() SPLIT(subtree, A[i : n][i : n], s[i : n])) tree.addChild(subtree) i ← i + 1 end while tree.addChild(s[0 : i]) if i < n then end if most equivalent to the baseline. The weights of the self-attentive RNN show that attention is more distributed towards the distant past, and they vary for each word because the attention function de- pends on the current prediction. This model tries to find dependencies among words, although com- plex relations seem difficult to learn. On the con- trary, the proposed self-attentive residual connec- tions model strongly focuses on particular words, and we present a wider analysis of it in the follow- ing section. 8.2 Structures Learned by the Model When visualizing the matrix of attention weights generated by our model (Figure 3c), we observed the formation of sub-phrases which are grouped depending on their attention to previous words. To build the sub-phrases in a deterministic fash- ion, we implemented Algorithm 1, which itera- tively splits the sentence into two sub-phrases ev- ery time the focus of attention changes to a new word, from left-to-right. The results are binary tree structures containing the sub-phrases, exem- plified in Figure 4. Figure 4: Examples of hypothesized syntactic struc- tures obtained with Algorithm 1. We formally evaluate the syntactic properties of the binary tree structures by comparing them with the results of an automatic constituent parser (Manning et al., 2014), using the ParsEval ap- proach (Black et al., 1991), i.e. by counting the precision and recall of constituents, excluding sin- gle words. Our models reaches a precision of 0.56, which is better than the precision of 0.45 obtained by a trivial right-branched tree model4. Note that these structures were neither optimized for pars- ing nor learned using part-of-speech tagging as most parsers do. Our interpretation of the results is that they are "syntactic-like" structures. How- ever, given the simplicity of the model, they could also be viewed as more limited structures, similar 4A model constructed by dividing iteratively one word and the rest of the sentence, from left-to-right. Better than baseline S: Estudiantes y profesores se est´an tomando a la ligera la fecha. R: Students and teachers are taking the date lightly. B: Students and teachers are being taken lightly to the date. O: Students and teachers are taking the date lightly. S: No porque compartiera su ideolog´ıa, sino porque para ´el los Derechos Humanos son indivisibles. R: Not because he shared their world view, but because for him, human rights are indivisible. B: Not because I share his ideology, but because he is in- divisible by human rights. O: Not because he shared his ideology, but because for him human rights are indivisible. Worse than baseline S: El gobierno intenta que no se construyan tantas casas pequenas. R: The Government is trying not to build so many small houses. B: The government is trying not to build so many small houses. O: The government is trying to ensure that so many small houses are not built. S: Otras personas pueden tener ninos . R: Other people can have children. B: Other people can have children. O: Others may have children. Table 7: Examples from Spanish to English. to sentence chunks. 8.3 Translation Examples Table 7 shows examples of translations produced with the baseline and the self-attentive residual connections model. The first part shows examples for which the proposed model reached a higher BLEU score than the baseline. Here, the structure of the sentences, or at least the word order, are im- proved. The second part contains examples where the baseline achieved better BLEU score than our model. In the first example, the structure of the sentence is different but the content and quality are similar, while in the second one lexical choices differ from the reference. 9 Conclusion We presented a novel decoder which uses self- attentive residual connections to previously trans- lated words in order to enrich the target-side con- textual information in NMT. To cope with the vari- able lengths of previous predictions, we proposed two methods for context summarization: mean residual connections and self-attentive residual connections. Additionally, we showed how sim- ilar previous proposals, designed for language modeling, can be adapted to NMT. We evaluated the methods over three language pairs: Chinese- to-English, Spanish-to-English, and English-to- German. In each case, we improved the BLEU score compared to the NMT baseline and two vari- ants with memory-augmented decoders. A man- ual evaluation over a small set of sentences for each language pair confirmed the improvement. Finally, a qualitative analysis showed that the pro- posed model distributes weights throughout an entire sentence, and learns structures resembling syntactic ones. As future work, we plan to enrich the present at- tention mechanism with the key-value-prediction technique (Daniluk et al., 2016; Miller et al., 2016) which was shown to be useful for language mod- eling. Moreover, we will incorporate relative po- sitional information to the attention function. To encourage further research in self-attentive resid- ual connections for NMT an other similar tasks, our code is made publicly available5. This work is part of the project Towards Document-Level Neural Machine Translation (Miculicich Werlen, 2017). Acknowledgments We are grateful for support to the European Union under the Horizon 2020 SUMMA project (grant n. 688139, see www.summa-project.eu). We would also like to thank James Henderson for his valuable feedback and suggestions. References Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Ben- gio. 2015. Neural machine translation by jointly In Proceedings of learning to align and translate. the International Conference on Learning Represen- tations, San Diego, USA. Ezra W. Black, Steven Abney, Daniel P. Flickenger, Claudia Gdaniec, Ralph Grishman, Philip Harri- son, Donald Hindle, Robert J. P. Ingria, Freder- ick Jelinek, Judith L. Klavans, Mark Y. Liberman, Mitchell P. Marcus, Salim Roukos, Beatrice San- torini, and Tomek Strzalkowski. 1991. A procedure for quantitatively comparing the syntactic coverage of English grammars. In Speech and Natural Lan- guage: Proceedings of a Workshop Held at Pacific Grove, California, USA. 5https://github.com/idiap/Attentive_Residual_ Connections_NMT 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. As- sociation for Computational Linguistics. Ondrej Bojar, Rajen Chatterjee, Christian Federmann, Yvette Graham, Barry Haddow, Matthias Huck, Antonio Jimeno Yepes, Philipp Koehn, Varvara Logacheva, Christof Monz, Matteo Negri, Aure- lie Neveol, Mariana Neves, Martin Popel, Matt Post, Raphael Rubino, Carolina Scarton, Lucia Spe- cia, Marco Turchi, Karin Verspoor, and Marcos Zampieri. 2016. Findings of the 2016 Conference on Machine Translation. In Proceedings of the First Conference on Machine Translation, pages 131 -- 198, Berlin, Germany. Association for Computa- tional Linguistics. Jianpeng Cheng, Li Dong, and Mirella Lapata. 2016. Long short-term memory-networks for machine reading. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Process- ing, pages 551 -- 561, Austin, Texas. Association for Computational Linguistics. 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, pages 1724 -- 1734, Doha, Qatar. Association for Computational Linguistics. Michał Daniluk, Tim Rocktaschel, Johannes Welbl, and Sebastian Riedel. 2016. Frustratingly short at- tention spans in neural language modeling. In Pro- ceedings of the International Conference on Learn- ing Representations, San Juan, Puerto Rico. Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N. Dauphin. 2017. Convolutional In Proceedings sequence to sequence learning. of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 1243 -- 1252, International Convention Centre, Sydney, Australia. PMLR. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. 2016. Deep residual learning for image recog- nition. In 2016 IEEE Conference on Computer Vi- sion and Pattern Recognition (CVPR), volume 00, pages 770 -- 778. Sepp Hochreiter and Jurgen Schmidhuber. 1997. Long short-term memory. Neural Computation, 9(8):1735 -- 1780. Nal Kalchbrenner and Phil Blunsom. 2013. Recurrent In Proceedings of continuous translation models. the 2013 Conference on Empirical Methods in Natu- ral Language Processing, pages 1700 -- 1709, Seattle, Washington, USA. Association for Computational Linguistics. Jaeyoung Kim, Mostafa El-Khamy, and Jungwon Lee. 2017. Residual lstm: Design of a deep recurrent architecture for distant speech recognition. arXiv preprint arXiv:1701.03360. 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 Annual Meeting of the As- sociation for Computational Linguistics Companion Volume Proceedings of the Demo and Poster Ses- sions, pages 177 -- 180, Prague, Czech Republic. As- sociation for Computational Linguistics. Kenton Lee, Omer Levy, and Luke Zettlemoyer. 2017. Recurrent additive networks. arXiv preprint arXiv:1705.07393. Zhouhan Lin, Minwei Feng, Cicero Nogueira dos San- tos, Mo Yu, Bing Xiang, Bowen Zhou, and Yoshua Bengio. 2017. A structured self-attentive sentence In Proceedings of the International embedding. Conference on Learning Representations, Toulon, France. Yang Liu and Mirella Lapata. 2018. Learning struc- tured text representations. Transactions of the Asso- ciation for Computational Linguistics, 6:63 -- 75. Thang Luong, Hieu Pham, and D. Christopher Man- ning. 2015. Effective approaches to attention-based In Proceedings of the neural machine translation. 2015 Conference on Empirical Methods in Natural Language Processing, pages 1412 -- 1421. Associa- tion for Computational Linguistics. Christopher Manning, Mihai Surdeanu, John Bauer, Jenny Finkel, Steven Bethard, and David McClosky. 2014. The Stanford CoreNLP natural language pro- In Proceedings of 52nd Annual cessing toolkit. Meeting of the Association for Computational Lin- guistics: System Demonstrations, pages 55 -- 60, Bal- timore, Maryland. Association for Computational Linguistics. Lesly Miculicich Werlen. 2017. Towards document- level neural machine translation. Technical report, Idiap. Alexander Miller, Adam Fisch, Jesse Dodge, Amir- Hossein Karimi, Antoine Bordes, and Jason We- ston. 2016. Key-value memory networks for directly In Proceedings of the 2016 reading documents. Conference on Empirical Methods in Natural Lan- guage Processing, pages 1400 -- 1409, Austin, Texas. Association for Computational Linguistics. Maria Nadejde, Siva Reddy, Rico Sennrich, Tomasz Dwojak, Marcin Junczys-Dowmunt, Philipp Koehn, and Alexandra Birch. 2017. Predicting target lan- guage CCG supertags improves neural machine In Proceedings of the Second Confer- translation. ence on Machine Translation, pages 68 -- 79, Copen- hagen, Denmark. Association for Computational Linguistics. Nikolaos Pappas and Andrei Popescu-Belis. 2017. Explicit document modeling through weighted multiple-instance learning. Journal of Artificial In- telligence Research, 58:591 -- 626. Alexandre Rafalovitch and Robert Dale. 2009. United Nations General Assembly resolutions: A six- language parallel corpus. In Proceedings of the MT Summit, volume 12, pages 292 -- 299. Rico Sennrich, Barry Haddow, and Alexandra Birch. 2016a. Edinburgh Neural Machine Translation Sys- In Proceedings of the First tems for WMT 16. Conference on Machine Translation, pages 371 -- 376, Berlin, Germany. Association for Computa- tional Linguistics. Rico Sennrich, Barry Haddow, and Alexandra Birch. 2016b. Neural machine translation of rare words In Proceedings of the 54th with subword units. Annual Meeting of the ACL (Vol. 1: Long Papers), pages 1715 -- 1725, Berlin, Germany. Association for Computational Linguistics. Rohollah Soltani and Hui Jiang. 2016. Higher or- arXiv preprint der recurrent neural networks. arXiv:1605.00064. 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 Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger, editors, Ad- vances in Neural Information Processing Systems 27, pages 3104 -- 3112. Curran Associates, Inc. Ke Tran, Arianna Bisazza, and Christof Monz. 2016. Recurrent memory networks for language modeling. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computa- tional Linguistics: Human Language Technologies, pages 321 -- 331, San Diego, California. Association for Computational Linguistics. 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 I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Gar- nett, editors, Advances in Neural Information Pro- cessing Systems 30, pages 5998 -- 6008. Curran As- sociates, Inc. Cheng Wang. 2017. tention for sequence learning. arXiv:1709.03714. Rra: Recurrent residual at- arXiv preprint Mingxuan Wang, Zhengdong Lu, Hang Li, and Qun Liu. 2016. Memory-enhanced decoder for neural In Proceedings of the 2016 machine translation. Conference on Empirical Methods in Natural Lan- guage Processing, pages 278 -- 286, Austin, Texas. Association for Computational Linguistics. Yiren Wang and Fei Tian. 2016. Recurrent residual In Proceed- learning for sequence classification. ings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 938 -- 943, Austin, Texas. Association for Computational Lin- guistics. Jason Weston, Sumit Chopra, and Antoine Bordes. In Proceedings of the 2015. Memory networks. International Conference on Learning Representa- tions, San Diego, USA. Philip Williams, Rico Sennrich, Maria Nadejde, Matthias Huck, Eva Hasler, and Philipp Koehn. 2014. Edinburgh's Syntax-Based Systems at WMT 2014. In Proceedings of the Ninth Workshop on Sta- tistical Machine Translation, pages 207 -- 214, Bal- timore, Maryland, USA. Association for Computa- tional Linguistics. Philip Williams, Rico Sennrich, Maria Nadejde, Matthias Huck, and Philipp Koehn. 2015. Edin- burgh's Syntax-Based Systems at WMT 2015. In Proceedings of the Tenth Workshop on Statistical Machine Translation, pages 199 -- 209, Lisbon, Por- tugal. Association for Computational Linguistics. Zichao Yang, Zhiting Hu, Yuntian Deng, Chris Dyer, and Alex Smola. 2017. Neural machine translation with recurrent attention modeling. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 2, Short Papers, pages 383 -- 387, Valencia, Spain. Association for Computational Linguistics. Matthew D Zeiler. 2012. ADADELTA: An adap- arXiv preprint tive learning rate method. arXiv:1212.5701. Biao Zhang, Deyi Xiong, Jinsong Su, and Hong Duan. 2017. A context-aware recurrent encoder for IEEE/ACM Transac- neural machine translation. tions on Audio, Speech, and Language Processing, 25(12):2424 -- 2432. Biao Zhang, Deyi Xiong, jinsong su, Hong Duan, and Min Zhang. 2016a. Variational neural machine translation. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Pro- cessing, pages 521 -- 530, Austin, Texas. Association for Computational Linguistics. Yu Zhang, Guoguo Chen, Dong Yu, Kaisheng Yaco, Sanjeev Khudanpur, and James Glass. 2016b. High- way long short-term memory RNNs for distant In 2016 IEEE International speech recognition. Conference on Acoustics, Speech and Signal Pro- cessing (ICASSP), pages 5755 -- 5759. Julian Georg Zilly, Rupesh Kumar Srivastava, Jan Koutn´ık, and Jurgen Schmidhuber. 2017. Recurrent In Proceedings of the 34th In- highway networks. ternational Conference on Machine Learning, vol- ume 70 of Proceedings of Machine Learning Re- search, pages 4189 -- 4198, International Convention Centre, Sydney, Australia. PMLR.