diff --git a/acomprehensivecomparisonofwordembeddingsinevententitycoreferenceresolution/bfb93e37-ebe9-4a41-a3d3-d2562c21f9ce_content_list.json b/acomprehensivecomparisonofwordembeddingsinevententitycoreferenceresolution/bfb93e37-ebe9-4a41-a3d3-d2562c21f9ce_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..1fd0575221f7b82fa598fbb8a0f8d8c95ac132b4 --- /dev/null +++ b/acomprehensivecomparisonofwordembeddingsinevententitycoreferenceresolution/bfb93e37-ebe9-4a41-a3d3-d2562c21f9ce_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ad7d22ed5f8b38c7cbac5065fe06abcac8762dc58b9760f9a2b76e69f6d9e82 +size 67684 diff --git a/acomprehensivecomparisonofwordembeddingsinevententitycoreferenceresolution/bfb93e37-ebe9-4a41-a3d3-d2562c21f9ce_model.json b/acomprehensivecomparisonofwordembeddingsinevententitycoreferenceresolution/bfb93e37-ebe9-4a41-a3d3-d2562c21f9ce_model.json new file mode 100644 index 0000000000000000000000000000000000000000..7e5661b01ee48436d217adac3b0275b23471fb8b --- /dev/null +++ b/acomprehensivecomparisonofwordembeddingsinevententitycoreferenceresolution/bfb93e37-ebe9-4a41-a3d3-d2562c21f9ce_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9076ccec24527d03023cafd8283151dd851ba4cbfbb58d74e31517886f3961f +size 82633 diff --git a/acomprehensivecomparisonofwordembeddingsinevententitycoreferenceresolution/bfb93e37-ebe9-4a41-a3d3-d2562c21f9ce_origin.pdf b/acomprehensivecomparisonofwordembeddingsinevententitycoreferenceresolution/bfb93e37-ebe9-4a41-a3d3-d2562c21f9ce_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2bac49d5232770609b4a6ea47b28f95ad4afbcc5 --- /dev/null +++ b/acomprehensivecomparisonofwordembeddingsinevententitycoreferenceresolution/bfb93e37-ebe9-4a41-a3d3-d2562c21f9ce_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:443bfaf7a7f3ac4d582e5272ab29083b16c48590973835930b1dacfab137f038 +size 435987 diff --git a/acomprehensivecomparisonofwordembeddingsinevententitycoreferenceresolution/full.md b/acomprehensivecomparisonofwordembeddingsinevententitycoreferenceresolution/full.md new file mode 100644 index 0000000000000000000000000000000000000000..f8d546337915bd126bde801cc1c6ec237a35d29e --- /dev/null +++ b/acomprehensivecomparisonofwordembeddingsinevententitycoreferenceresolution/full.md @@ -0,0 +1,285 @@ +# A Comprehensive Comparison of Word Embeddings in Event & Entity Coreference Resolution. + +Judicael Poumay + +ULiege/HEC Liege + +Rue Louvrex 14, 4000 Liege, Belgium + +judicael.poumay@uliege.be + +Ashwin Ittoo + +ULiege/HEC Liege + +Rue louvrex 14, 4000 Liege, Belgium + +ashwin.ittoo@uliege.be + +# Abstract + +Coreference Resolution is an important NLP task and most state-of-the-art methods rely on word embeddings for word representation. However, one issue that has been largely overlooked in literature is that of comparing the performance of different embeddings across and within families in this task. Therefore, we frame our study in the context of Event and Entity Coreference Resolution (EvCR & EnCR), and address two questions: 1) Is there a trade-off between performance (predictive & run-time) and embedding size? 2) How do the embeddings' performance compare within and across families? Our experiments reveal several interesting findings. First, we observe diminishing returns in performance with respect to embedding size. E.g. a model using solely a character embedding achieves $86\%$ of the performance of the largest model (Elmo, GloVe, Character) while being $1.2\%$ of its size. Second, the larger model using multiple embeddings learns faster overall despite being slower per epoch. However, it is still slower at test time. Finally, Elmo performs best on both EvCR and EnCR, while GloVe and FastText perform best in EvCR and EnCR respectively. + +# 1 Introduction + +Coreference Resolution (CR) is an important NLP task. It can be subdivided into Event and Entity Coreference Resolution (EvCR and EnCR). These tasks serves as the basis for several downstream applications such as information extraction, text summarization, machine translation and text mining (Humphreys et al., 1997; Azzam et al., 1999; Miculicich Werlen and Popescu-Belis, 2017; Su et al., 2008). + +State-of-the-art methods for CR(Barhom et al., 2019; Lee et al., 2017; Joshi et al., 2019) rely on various word embeddings for word representation. These embeddings are organized into three families: static, contextual and character embeddings + +(Almeida and Xexéo, 2019; Liu et al., 2020; dos Santos and Zadrozny, 2014), each differing in size. Contextual embeddings are larger (1024) compared to the other families (usually 300 for static and 50 for character). They also tend to outperform the other families in most tasks but lead to larger and heavier models (Devlin et al., 2019; Peters et al., 2018). We are thus confronted with a trade-off of performance (predictive & run-time) vs. dimensionality. Moreover, embeddings also differ within families which also leads to differences in predictive performance. + +Several studies investigated how different embeddings influence the predictive performance in different tasks (Berardi et al., 2015; Gromann and Declerck, 2018; Joshi et al., 2019; Li et al., 2018). However, the two aforementioned issues of the performance vs. dimensionality trade-off and performance variations within and across embedding families have been overlooked to a large extent, especially in coreference resolution. Literature is still unclear about which embeddings perform best in which tasks, and whether larger, more expressive embeddings should also be preferred or whether some predictive performance can be compromised for improved run time. + +Thus, we seek to address two questions in the context of CR: 1) Is there a trade-off between performance (predictive & run-time) and embedding size? 2) How do the embeddings' performance compare within and across families? The current state-of-the-art in EvCR (Barhom et al., 2019) rely on three families of embeddings for word representation, and thus provides a suitable frameworks for addressing our research questions. Starting from the original model of Barhom et al. (2019), we performed various experiments and ablative studies across and within each family of embeddings, resulting in 16 different models. We compared + +their predictive performance, size (number of parameters), run-time and memory usage. + +We discovered high level of diminishing returns in term of predictive performance per embedding. The smallest model (using solely a character embedding (dos Santos and Zadrozny, 2014)) achieves $86\%$ of the performance of the largest model (GloVe (Pennington et al., 2014), ELMo (Peters et al., 2018), Character embedding) with $1.2\%$ of its size. Hence, incorporating additional embeddings leads to diminishing returns in terms of predictive performance. In addition, we found that size and run-time are weakly correlated: larger (more complex) models can converge faster (number of epochs and total training time) than smaller ones. In terms of predictive performance, we found GloVe and FastText perform best in EvCR and EnCR respectively in their family with ELMo being the best overall. Moreover, we found that the smallest aforementioned model outperforms Word2Vec ( $\sim +10$ F1), yielding predictive performance close to the previous state-of-the-art (Kenyon-Dean et al., 2018) in EvCR (68.43 vs 69 F1). Our results can have important implications for practitioners in implementing CR and other NLP models in real-life applications. + +# 2 Background and Related work + +# 2.1 Word embeddings families + +Literature generally distinguishes between three families: static, contextual and character embeddings (Almeida and Xexéo, 2019; Liu et al., 2020; dos Santos and Zadrozny, 2014). + +Static embeddings, such as word2vec, FastText, and GloVe, create a one-to-one mapping between words and their vector representations. Word2vec (Mikolov et al., 2013) learns through a language modelling task by either learning to predict a word given its context (CBOW) or predict the context given a word (Skip-gram). FastText (Bojanowski et al., 2017) learns sub-words embeddings which are then combined for each word. Finally, GloVe (Pennington et al., 2014) relies on word cooccurrence information. Both Glove and FastText are trained on a Skip-gram task. + +Contextual embeddings take into account the context of a given word, i.e. their vector representations changes depending on surrounding words. ELMo is a Bi-LSTM trained on a language modelling task. GPT-2 is similar except that it is unidirectional. Finally, BERT is based on a transformer + +architecture and trained on a masked language modelling task. + +Lastly, character embeddings learn vectors based on character sequences (dos Santos and Zadrozny, 2014). + +Since their development, word embeddings have been very largely studied (Tan et al., 2015; Chen et al., 2018; Wang et al., 2018; Clark et al., 2019; Tenney et al., 2019) and a complete literature review is out of the scope of our work. Hence, we will focus on studies closest to ours. First, we will review studies on embeddings' performance regardless of the task. Then, we move to our task of interest which is coreference resolution. + +# 2.2 Studies on Embeddings' Performance + +Gromann and Declerck (2018) found that FastText (0.812 F1) outperformed Polyglot (0.675 F1) and Word2Vec (0.750 F1) for ontology alignment. They used two ontologies: Global Industry Classification Standard and Industry Classification Benchmark. They also demonstrated the ability of FastText to better handle out-of-vocabulary words. + +Berardi et al. (2015) found that Word2Vec (Accuracy (ACC) $43.63\%$ ) outperformed polyglot (ACC $4\%$ ) and GloVe (ACC $30.21\%$ ) on a word analogy test using Wikipedia and a collection of Italian books (mostly novels) as datasets. + +Joshi et al. (2019) found that BERT significantly outperformed ELMo on EnCR (+11.5 F1) on the GAP and OntoNotes datasets. + +Li et al. (2018) found that GloVe outperformed FastText and Word2Vec on a tweet classification task, especially when trained on specific corpora, viz.CrisisLexT6, CrisisLexT26, and 2CTweets. + +# 2.3 Word embeddings in Coreference Resolution. + +Event Coreference Resolution and Entity Coreference Resolution (EvCR and EnCR respectively) are concerned with clustering Event and Entity mentions that refer to the same reality (Barhom et al., 2019; Lee et al., 2017). Figure 1 depicts two event mentions with the same meaning. + +SpaceX launched a South Korean Military satellite + +South Korea's first military satellite was delivered by SpaceX + +Figure 1: Two coreferent event mentions with colors indicating associated coreferent entity mentions. + +Events mentions refer to textual representations + +of real-life events. As can be seen from Figure 1, events generally consist of a trigger word (most often a verb), such as "launched", and a set of arguments, such as "SpaceX" and "a South Korean Military satellite". Four argument types are generally distinguished: Arg0, Arg1, location, and time, as defined in Barhom et al. (2019), where Arg0 (resp. Arg1) is the closest entity on the left (resp. right) of the trigger word. These arguments are optional and often referred to as entities. The goal of EvCR (and EnCR) is to identify which events (and entities) are coreferent with each other and to cluster them. + +We now briefly review studies using word embeddings for EnCR and EvCR. + +EnCR: Lee et al. (2017) used GloVe as word representation allied with a Bi-LSTM and attention mechanisms. Their model achieved state-of-the-art (68.8 F1) on the the CoNLL-2012 corpus. As already mentioned, Joshi et al. (2019) reported higher EnCR performance when using BERT compared to ELMo: +3.9 F1 in OntoNotes and +11.5 F1 in GAP. + +EvCR : Choubey and Huang (2017) relied on GloVe for EvCR using the ECB+ corpus (Cybulska and Vossen, 2014). They used a joint modelling approach to perform within and cross document EvCR and achieved state-of-the-art performance. The same corpus was employed by Barhom et al. (2019), who proposed an EvCR/EnCR model based on ELMo (Peters et al., 2018), GloVe (Pennington et al., 2014) as well as a fine-tuned character embedding. Similarly, it jointly performs EnCR and EvCR. Their model yielded performance of 79.5 F1 in EvCR. + +# 3 Methodology + +# 3.1 Original model + +Our approach is based on the state-of-the-art model of Barhom et al. (2019), which we refer to as the ORIGINAL ${}^{2}$ model. This model consists of two neural networks, which jointly resolve entities and events coreferences. Figure 2 shows the input of both networks. The two event (resp. entity) mentions embeddings are in blue and the green box represents an element-wise multiplication of the mentions. Finally, binary features indicate whether the two encoded mentions have coreferent arguments. The constituents of each mention, i.e. trigger, Arg0, Arg1, Location and time, are represented + +by a static (GloVe) and a character embedding. The trigger is also represented by a contextual embedding (ELMo). Furthermore, the character embedding is fine tuned during training while the contextual and static embeddings are not. + +![](images/aa4405ec70275e31eac32d0fef08a2d4792cba2a20a148c6a964f406db654c0a.jpg) +Figure 2: Original input structure of Barhom et al. (2019)'s model. + +The input dimensionality is $3^{*}(1024 + 5^{*}(300 + 50)) + 200 = 8522$ , where 1024, 300 and 50 are the dimensions of ELMo, GloVe and the character embeddings, and 200 corresponds to the size of the binary features. This input is then fed into two subsequent ReLU layers with dimensions equal to half the input dimension (4261 neurons each). Since the number of parameters is proportional to the square of the input dimension, we have a model size exceeding 54 million parameters, computed as $\left(\frac{\text{input}^2}{2} + \left(\frac{\text{input}}{2}\right)^2 + \frac{\text{input}}{2}\right)$ . + +# 3.2 Derived models + +The gist of our methodology involves substituting and/or removing specific embeddings from Barhom et al. (2019)'s original model (which uses 3 embeddings : static=GloVe, contextual=ELMo and character), resulting in 16 different models shown in Table 1. In the first group of models, one, two, or three (of the three) embeddings are removed from the original model. In the second group, the static embedding is changed to Word2Vec (Skip-gram) or FastText (other embeddings are either left unchanged or removed). Similarly, in the third group the contextual embedding is changed to BERT or GPT-2 (other embeddings are either left unchanged or removed). Note: in Table 1, gray rows denote identical models. + +We implemented our models using Pytorch. Models were trained and tested following Barhom et al. (2019)'s procedure. Pre-trained vectors and models were used for the embeddings. Our code is + +available online ${}^{3}$ . + +
ModelStat.Ctx.Char.
Group 1: Across family study
Original (2019)GloVeELMo
Contextual/StaticGloVeELMoX
Contextual/CharXELMo
Static/CharGloVeX
StaticGloVeXX
ContextualXELMoX
CharXX
No word embedXXX
Group 2: Within family study: Static
GloVeGloVeELMo
Word2VecWord2VecELMo
FastTextFastTextELMo
Only GloVeGloVeXX
Only FastTextWord2VecXX
Only Word2VecFastTextXX
Group 3: Within family study: Contextual
ELMoGloVeELMo
BERTGloVeBERT
GPT-2GloVeGPT-2
Only ELMoXELMoX
Only BERTXBERTX
Only GPT-2XGPT-2X
+ +Table 1: List of trained and tested model and their components. Ctx. = Contextual; Stat. = Static; Char. = Character; X/√ indicate absence/presence of an input. + +# 4 Experimentation setup + +# 4.1 Dataset + +The dataset we use for our study is ECB+ (Cybulska and Vossen, 2014). Together with EECB (Lee et al., 2012), it is one of the largest datasets for within and cross document EvCR and EnCR (Lee et al., 2012; Barhom et al., 2019). Both EECB and $\mathrm{ECB + }$ are extensions of ECB (Bejan and Harabagiu, 2010) and consist of English Google News documents clustered into topics and annotated for coreference. For more details on the $\mathrm{ECB + }$ corpus statistics, please refer to Barhom et al. (2019). + +Other dataset for coreference resolution exist: GAP, OntoNotes, CoNLL 2012, ACE, TAC KBP and MUC. However, the definition of coreference resolution in these corpora do not suits our study + +and model. For example, GAP is a corpus of ambiguous pronoun-name pairs while ECB+ defines mentions cluster for events and their entities (Joshi et al., 2019). OntoNotes annotates coreferences but does not indicate which mentions is an event and which is an entity. MUC, ACE, and TAC KBP do not provide cross document coreferences(Lu and Ng, 2018). Finally, while CoNLL 2012 defines an event coreference task, events represent only a small portion of the all the coreferent mentions and again it does not provide cross document coreferences (Pradhan et al., 2012). In-depth reviews of the listed datasets are provided in (Stylianou and Vlahavas, 2021; Lu and Ng, 2018; Sukthanker et al., 2018). + +# 4.2 Experiments + +We performed three sets of experiments. The first set concerns models of Group 1 (see Table 1). We investigated the impact of removing one, two, or three (of the three) embeddings from the original model. Our aim was to determine the contribution of the different embeddings (static, contextual and character) on the predictive performance of the ORIGINAL model. Thus, the models will have varying sizes, translating into varying run-time and memory requirements. Therefore, for this set of experiments, we also report on model size (number of parameters), run-time (seconds) and memory usage (RAM). + +The second (third) set concerns models of Group 2 (Group 3) (see Table 1) and aim at investigating the contributions of static (contextual) embeddings. + +For the latter two experiments, we do not consider model size as all possible sizes would have been investigated in group 1. For all experiments, we will report the predictive performance achieved by the various models with the CoNLL F1 and MUC F1 metrics (Moosavi and Strube, 2016). + +Following Barhom et al. (2019)'s original paper, we can claim that a difference of 1 point between any two models is significant with a p-value $< 0.001$ . This confirms that our results are statistically sound and not due to randomness. + +# 5 Results + +# 5.1 Results 1: All Embedding Families + +As mentioned earlier, our aim was to investigate the contributions of the static (Glove), contextual (ELMo) and character embedding to the original model's performance via an ablative study. The + +predictive performance scores (CoNLL/MUC F1) of Group 1 models are in Figure 3, respectively from left to right. + +A first observation is that the baseline performance differs between the two measures (CoNLL & MUC F1). This is due to the mention identification effect (Moosavi and Strube, 2016) which makes CoNLL F1 more optimistic than it should be for low performing models. Interestingly, CoNLL seems more pessimistic than MUC for high performing models. Moreover, Barhom et al. (2019)'s model is helped by using gold cluster for within-document entity coreference. This explains the non-zero MUC F1 performance of the baseline on the entity coreference resolution task. + +Another important observation is that, when using only two embedding, the STATIC/CHAR model is the one experiencing the largest drop in performance (CoNLL & Event MUC). At the same time, when using only one embedding, the CONTEXTAL model performs best. It even outperforms the aforementioned model with two embeddings: STATIC/CHAR. These results lead us to conclude that the contextual embeddings is the most expressive for this task. This is not surprising since contextual embeddings take context into account while static and character do not. + +More interestingly, we note that removing either the static or contextual embedding results in an average performance drop of $\sim 2.5$ and $\sim 4$ CoNLL points respectively (see model CONTEXTUAL/CHAR and STATIC/CHAR). However, when both are removed simultaneously, the performance drops by $\sim 10$ CoNLL points (see model CHAR). That is, the sum of the losses incurred by removing either one of these embeddings ( $\sim 6.5$ ) is smaller than the loss ( $\sim 10$ ) incurred when both are simultaneously removed. Similarly, adding any one embedding to the baseline NO WORD EMBEDDING model significantly improves the latter's performance, in the range of $\sim [+27,5$ to $+34,7]$ . However, if any one embedding is removed from the ORIGINAL model, then the latter's performance drops by a much smaller amount, $\sim [-1,1$ to $-4]$ . That is, removing an embedding from the ORIGINAL model does not impact performance in a comparable way as adding an embedding to the baseline model. But performance does drop significantly when all embeddings are removed. In other words, we face diminishing returns in terms of performance per embeddings. + +# Impact of Dimensionality on Model Size + +As mentioned earlier, the model size is related to the square of the input, resulting in more than 54 million parameters in the ORIGINAL model. Thus, an important question is that of whether the gains in performance of such large models outweigh the corresponding increase in size. Our observations in this respect are in Figure 4, depicting the model's respective size and predictive performance. We observed similar diminishing returns when considering performance relative to size, i.e. increasing the model size by incorporating larger, more complex embeddings results in modest performance gains. + +The CONTEXTUAL and CHAR models are particularly interesting. The former achieves $96\%$ of the performance of the ORIGINAL model with $14.7\%$ of its size. While the latter, i.e. CHAR, achieves $86\%$ of the performance of the ORIGINAL model's performance, with only $1.2\%$ of its size. Its performance (68.43 F1) is even comparable to that of the previous event coreference resolution state-of-the-art in EvCR (69 F1) (Kenyon-Dean et al., 2018). + +# Model Size & Run-Time + +Our investigations on the influence of model size on run-time and memory usage revealed paradoxical results. They are presented in Figure 5. For the run-time and memory analysis, we focus only on the largest and smallest models to have a better idea of the magnitude of differences and to avoid overcrowding the Figures. + +As can be seen, the huge difference in model size (54 Million vs. 0.67 Million), does not translate into equally large the differences in run-time (training & testing) - the run-time reductions afforded by the CHAR model are relatively modest. While the actual reasons deserve further investigation, we can posit that this could be attributed to hardware and software optimization, enabling a high level of parallelization such that larger models run comparably to smaller ones. + +Paradoxically, however, the larger ORIGINAL model trains in fewer epochs than the smaller CHAR model (14 vs. 24 respectively). In consequence, it is $21\%$ faster to train overall (68924.8 sec. vs 87587.28 sec. or about 19h9 vs 24h19). These results confirm the observation of Li et al. (2020) + +![](images/86c3271a6219e383688b3635ce546d0d878145ea4ef44c3840d34bfa2291053b.jpg) +Ablative study +Figure 3: Comparing the predictive performance of the original model (using 3 embeddings) with models where we removed one, two or all three embeddings. + +![](images/61630e71d70977eae7082a6d0a8bcb1b882d2b05806e1ab1907becd7f43a01a3.jpg) +Ablative study : Model size +Figure 4: Comparing the size and predictive performance of the original model (using 3 embeddings) with models where we removed one, two or all three embeddings. The size of each model is the number of neural connections. + +that larger models tend to converge faster. One possible explanation could be that larger models have to optimize a error surface of higher dimensionality, leading to more possible paths for gradient descent, some of which might lead to convergence more rapidly. Thus, although adding more embedding in the model results in diminishing returns in term of predictive performance, it can lead to faster training. However, more experiments are needed to investigate this issue. + +Concerning memory usage, we found that, as expected, the smaller CHAR model required substantially smaller amounts of memory, especially during training as evidence by Figure 6. Note that, the RAM usage of the ORIGINAL model is mostly due to GloVe pre-trained vectors. + +# 5.2 Results 2: Static Embeddings + +We now focus on the second set of experiments, focusing our attention to static embeddings. The models concerned are from Group 2 of Table 1. + +First, we varied the static embedding (GloVe, Word2Vec, FastText), while keeping the same contextual embedding and character embedding as in the ORIGINAL model. It can be seen in Figure 7 that, when used with other embeddings (contextual and character), all static embeddings show comparable performance. The average performance rang- + +![](images/e9cfbe33ec4112e0b7626dcbefac0c9c353c7b0f81b835683dc0cce77a844495.jpg) +Figure 5: Run-time between the largest (54M weights) and smallest (677k weights) models. The total training time is associated with the right axis while the other measures are associated with the left axis. + +ing from 77.12 (GLOVE) to 75.59 (WORD2VEC). This corroborates with our earlier findings of section 5.1 whereby the model with only contextual and character embeddings, i.e. CONTEXTUAL/CHAR, achieved comparable performance to the ORIGINAL (static/contextual/char) model, indicating that the specific static embedding chosen contribute only marginally to the model's performance. + +However, when used alone (see Figure 8), we see a drastic difference in performance between them; with the average performance ranging from 72.73 (GLOVE) to 51.56 (WORD2VEC). + +Thus, it is only when studied alone that static embeddings show their differences. Once we iso + +![](images/f961b289964e2b8ba2aada2f63ded8195c691d094f66a56a6ab0e8136f3bd8bb.jpg) +Figure 6: Memory usage between the largest (54M weights) and smallest (677k weights) models. + +![](images/f9ededface23c3fb02a30f25a7b43a45e79c3b34d6736bb2a62fce9d9a463b06.jpg) +Figure 7: Comparing the predictive performance of static embeddings when used with other embeddings (ELMo and Character) + +late static embeddings, we see GloVe works best for EvCR. However, for EnCR, the FASTTEXT model shows significantly higher MUC. The better performance of GloVe and FastText with respect to word2vec can be explained by their construction. Compared to Word2Vec, GloVe takes words co-occurrence information into account. If coreferent event mentions are more likely to share co-occurring words, it would explain parts of the performance gain. FastText also outperforms Word2Vec; here the difference is that FastText takes sub-word information into account which can be advantageous for coreferent entity mentions. E.g. in Figure 1, "Korea" and "Korean" have similar sub-word information. + +What is most surprising is that Word2Vec is significantly outperformed by a simple character embedding as we can see on Figure 9. Moreover, in term of dimension Word2Vec has 300 and the character embedding has 50. Thus, the resulting model is not only more accurate but also $\sim 24$ times smaller (Figure 9). This could indicate that the internal structure of a word (char embedding) contains more information about possible coreferences than its usual entourage (Word2Vec). + +![](images/8f114007d33c6094f9627d43cb55594009a56b80ba863a5b2f1fc775df247229.jpg) +Figure 8: Comparing the predictive performance of static embeddings when used alone + +![](images/ffc90b47f0c02d3df6627e08b9a7eb80c4135cf0ca8b3ec3171d45cc54af14c7.jpg) +Figure 9: Comparing the predictive performance of solely Word2Vec vs solely a character embedding + +# 5.3 Results 3: Contextual Embeddings + +We now focus on the third set of experiments about contextual embeddings. The models concerned are from Group 3 of Table 1. + +Similarly to the previous section, we present the performance of different contextual embeddings when used in tandem with the static (GloVe) and character embedding of the original model (Figure 10) or when used alone (Figure 11). We see the same as in the previous section, i.e. the difference in performance between the contextual embeddings is clearer when they are used alone versus when they are used with GloVe and a character embedding. Thus, we will only focus on the Figure 11 which better represent the differences between ELMo, BERT, and GPT-2. + +A first observation is that BERT both outperforms and is outperformed by GPT-2 on both tasks. Specifically, BERT performs better in EvCR while GPT-2 performs better in EnCR. + +A second observation is that ELMo clearly outperforms GPT-2 and BERT on both tasks. This result contradicts Joshi et al. (2019) who found that BERT greatly outperforms ELMo on EnCR (+11.5 F1 on the GAP benchmark). Such disparity may be indicative of differences in the model and dataset. + +![](images/a791991aa1628797feb67fcd245ec840dcfe15924175a60ccbe2ac60047f45b4.jpg) +Figure 10: Comparing the predictive performance of contextual embeddings when used with other embeddings (GloVe and Character embedding) + +![](images/4350dc20397b95bd459b2f6061ab66f80aa617be7605558635ee513b7354a493.jpg) +Figure 11: Comparing the predictive performance of contextual embeddings when used alone + +Joshi et al. (2019) uses a span ranking approach which asks, for each mention, which is the most likely antecedent. This implicitly produces a tree which clusters coreferent mentions. Such method only takes local information between two mention into account while the method used in Barhom et al. (2019) uses global information between two entity clusters and related event clusters. Moreover, $\mathrm{ECB + }$ or EventCorefBank $^+$ is an EvCR dataset first and foremost and only defines EnCR to support EvCR; you could argue that the EnCR tasks is more about argument than entities. GAP on the other hand is a corpus of ambiguous pronoun-name pairs (Joshi et al., 2019). + +Thus, while an EnCR task is defined by both dataset, they are significantly different. We argue that both the task definition and the use of global versus local information play a major role in the disparity between the performance reported by Joshi et al. (2019) and our study. Further confirming these findings would require evaluating Barhom et al. (2019)'s model on GAP and Joshi et al. (2019)'s on $\mathrm{ECB + }$ . However, these models are not interchangeable because the datasets and the task they define differs. + +# 6 Conclusion + +We used the state-of-the-art in EvCR (Barhom et al., 2019) as a framework to investigate the complexity-performance trade-off and compare the predictive performance of word embeddings across and within the three families. + +We observed that the smallest model using solely a character embedding yielded $86\%$ of the performance of the original (largest) model (using Elmo, GloVe and a character embeddings) despite being only $1.2\%$ of its size. In fact, that smallest model achieves similar performance (68.43 F1) to the previous state-of-the-art in EvCR (69 F1) (Kenyon-Dean et al., 2018). + +Paradoxically, we found that the largest model converged faster during training (by $21\%$ in overall run-time) as it took only 14 epochs vs 24 for the character model. Overall, we found size and runtime to be weakly correlated. + +In addition, our experiments revealed that augmenting the model with additional embeddings does not substantially improve the performance, leading to diminishing returns in term of predictive performance per embedding. + +Concerning predictive performance, one of our most interesting result is that the model using solely a character embedding significantly outperformed $(\sim +10$ F1) a larger model using solely a static embedding (Word2Vec) while being radically smaller (4% of its size). Hence, while character embeddings have often been used as supplementary embeddings, they can actually compete with other embeddings' families in terms of predictive performance per size. + +Finally, our experiments lead us to conclude that for the task of Event and Entity Coreference Resolution, GloVe, FastText and Elmo yielded the best predictive performance. GloVe and FastText performed best in EvCR and EnCR respectively in their family while Elmo performs best overall. + +Future directions include working on other comprehensive study of embeddings in other tasks and experimenting with CR models using different embeddings for different tasks to improve performance. E.g. GloVe and FastText in EvCR and EnCR respectively. + +# 7 Ethical considerations + +We trained 16 models over a two months period, estimated cost ranges from $350\mathrm{kWh}$ to $400\mathrm{kWh}$ . The estimated carbon impact ranges from $105\mathrm{Kg}$ + +to $120\mathrm{Kg}$ of CO2 based on local data (300g CO2/kWh). We believe no other ethical considerations are raised by the content of this paper. + +# Acknowledgments + +This research was funded by KPMG Belgium & Luxembourg through the HEC Digital Lab/HEC-Liège/ULiège. + +# References + +Felipe Almeida and Geraldo Xexéo. 2019. Word embeddings: A survey. CoRR, abs/1901.09069. +Saliha Azzam, Kevin Humphreys, and Robert Gaizauskas. 1999. Using coreference chains for text summarization. In Coreference and Its Applications. +Shany Barhom, Vered Shwartz, Alon Eirew, Michael Bugert, Nils Reimers, and Ido Dagan. 2019. Revisiting joint modeling of cross-document entity and event coreference resolution. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4179-4189, Florence, Italy. Association for Computational Linguistics. +Cosmin Bejan and Sanda Harabagiu. 2010. Unsupervised event coreference resolution with rich linguistic features. In Proceedings of the 48th Annual Meeting of the Association for Computational Linguistics, pages 1412-1422, Uppsala, Sweden. Association for Computational Linguistics. +Giacomo Berardi, Andrea Esuli, and Diego Marcheggiani. 2015. Word embeddings go to italy: A comparison of models and training datasets. In IIR. +Piotr Bojanowski, Edouard Grave, Armand Joulin, and Tomas Mikolov. 2017. Enriching word vectors with subword information. Transactions of the Association for Computational Linguistics, 5:135-146. +Juntian Chen, Yubo Tao, and Hai Lin. 2018. Visual exploration and comparison of word embeddings. Journal of Visual Languages & Computing, 48:178 - 186. +Prafulla Kumar Choubey and Ruihong Huang. 2017. Event coreference resolution by iteratively unfolding inter-dependencies among events. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 2124-2133, Copenhagen, Denmark. Association for Computational Linguistics. +Kevin Clark, Urvashi Khandelwal, Omer Levy, and Christopher D. Manning. 2019. What does BERT look at? an analysis of BERT's attention. In Proceedings of the 2019 ACL Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pages 276-286, Florence, Italy. Association for Computational Linguistics. + +Agata Cybulska and Piek Vossen. 2014. Using a sledgehammer to crack a nut? lexical diversity and event coreference resolution. In Proceedings of the Ninth International Conference on Language Resources and Evaluation (LREC'14), pages 4545-4552, Reykjavik, Iceland. European Language Resources Association (ELRA). +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 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, Volume 1 (Long and Short Papers), pages 4171-4186, Minneapolis, Minnesota. Association for Computational Linguistics. +Cicero Nogueira dos Santos and Bianca Zadrozny. 2014. Learning character-level representations for part-of-speech tagging. In Proceedings of the 31th International Conference on Machine Learning, ICML 2014, Beijing, China, 21-26 June 2014, volume 32 of JMLR Workshop and Conference Proceedings, pages 1818-1826. JMLR.org. +Dagmar Gromann and Thierry Declerck. 2018. Comparing pretrained multilingual word embeddings on an ontology alignment task. In Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018), Miyazaki, Japan. European Language Resources Association (ELRA). +Kevin Humphreys, Robert Gaizauskas, and Saliha Azzam. 1997. Event coreference for information extraction. In *Operational Factors in Practical, Robust Anaphora Resolution* for Unrestricted Texts. +Mandar Joshi, Omer Levy, Luke Zettlemoyer, and Daniel Weld. 2019. BERT for coreference resolution: Baselines and analysis. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 5803-5808, Hong Kong, China. Association for Computational Linguistics. +Kian Kenyon-Dean, Jackie Chi Kit Cheung, and Doina Precup. 2018. Resolving event coreference with supervised representation learning and clustering-oriented regularization. In Proceedings of the Seventh Joint Conference on Lexical and Computational Semantics, pages 1-10, New Orleans, Louisiana. Association for Computational Linguistics. +Heeyoung Lee, Marta Recasens, Angel Chang, Mihai Surdeanu, and Dan Jurafsky. 2012. Joint entity and event coreference resolution across documents. In Proceedings of the 2012 Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning, pages 489-500, Jeju Island, Korea. Association for Computational Linguistics. + +Kenton Lee, Luheng He, Mike Lewis, and Luke Zettle-moyer. 2017. End-to-end neural coreference resolution. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 188-197, Copenhagen, Denmark. Association for Computational Linguistics. +Hongmin Li, Xukun Li, Doina Caragea, and Cornelia Caragea. 2018. Comparison of word embeddings and sentence encodings as generalized representations for crisis tweet classification tasks. Proceedings of ISCRAM Asia Pacific. +Zhuohan Li, Eric Wallace, Sheng Shen, Kevin Lin, Kurt Keutzer, Dan Klein, and Joseph E. Gonzalez. 2020. Train large, then compress: Rethinking model size for efficient training and inference of transformers. +Qi Liu, Matt J. Kusner, and Phil Blunsom. 2020. A survey on contextual embeddings. +Jing Lu and Vincent Ng. 2018. Event coreference resolution: A survey of two decades of research. In Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, IJCAI 2018, July 13-19, 2018, Stockholm, Sweden, pages 5479-5486. ijcai.org. +Lesly Miculicich Werlen and Andrei Popescu-Belis. 2017. Using coreference links to improve Spanish-to-English machine translation. In Proceedings of the 2nd Workshop on Coreference Resolution Beyond OntoNotes (CORBON 2017), pages 30-40, Valencia, Spain. Association for Computational Linguistics. +Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. 2013. Efficient estimation of word representations in vector space. +Nafise Sadat Moosavi and Michael Strube. 2016. Which coreference evaluation metric do you trust? a proposal for a link-based entity aware metric. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 632-642, Berlin, Germany. Association for Computational Linguistics. +Jeffrey Pennington, Richard Socher, and Christopher Manning. 2014. GloVe: Global vectors for word representation. In Proceedings of the 2014 Conference 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 representations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 2227-2237, New Orleans, Louisiana. Association for Computational Linguistics. + +Sameer Pradhan, Alessandro Moschitti, Nianwen Xue, Olga Uryupina, and Yuchen Zhang. 2012. CoNLL-2012 shared task: Modeling multilingual unrestricted coreference in OntoNotes. In Joint Conference on EMNLP and CoNLL - Shared Task, pages 1-40, Jeju Island, Korea. Association for Computational Linguistics. +Nikolaos Stylianou and Ioannis Vlahavas. 2021. A neural entity coreference resolution review. Expert Systems with Applications, 168:114466. +Jian Su, Xiaofeng Yang, Huaqing Hong, Yuka Tateisi, and Jun'ichi Tsujii. 2008. Coreference Resolution in Biomedical Texts: a Machine Learning Approach. In Ontologies and Text Mining for Life Sciences: Current Status and Future Perspectives, number 08131 in Dagstuhl Seminar Proceedings, Dagstuhl, Germany. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, Germany. +Rhea Sukthanker, Soujanya Poria, Erik Cambria, and Ramkumar Thirunavukarasu. 2018. Anaphora and coreference resolution: A review. +Luchen Tan, Haotian Zhang, Charles Clarke, and Mark Smucker. 2015. Lexical comparison between Wikipedia and Twitter corpora by using word embeddings. 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), pages 657-661, Beijing, China. Association for Computational Linguistics. +Ian Tenney, Dipanjan Das, and Ellie Pavlick. 2019. BERT rediscovers the classical NLP pipeline. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4593-4601, Florence, Italy. Association for Computational Linguistics. +Yanshan Wang, Sijia Liu, Naveed Afzal, Majid Rastegar-Mojarad, Liwei Wang, Feichen Shen, Paul Kingsbury, and Hongfang Liu. 2018. A comparison of word embeddings for the biomedical natural language processing. Journal of Biomedical Informatics, 87:12-20. \ No newline at end of file diff --git a/acomprehensivecomparisonofwordembeddingsinevententitycoreferenceresolution/images.zip b/acomprehensivecomparisonofwordembeddingsinevententitycoreferenceresolution/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..61e3cbc2ac255e1c5a23d2d6e338334aa1f626e5 --- /dev/null +++ b/acomprehensivecomparisonofwordembeddingsinevententitycoreferenceresolution/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e7367cf2972093a78ede49fcc5cd3e37968587747966aba45cd2848145261987 +size 335262 diff --git a/acomprehensivecomparisonofwordembeddingsinevententitycoreferenceresolution/layout.json b/acomprehensivecomparisonofwordembeddingsinevententitycoreferenceresolution/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2d85f0cd90819f07dfe5779d806277c85c49d62a --- /dev/null +++ b/acomprehensivecomparisonofwordembeddingsinevententitycoreferenceresolution/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b80e4b66394d2d28c43e70bbcf6950b9b05d627a4e6ba36f818ab72ff57a66f9 +size 303910 diff --git a/acomputationalexplorationofpejorativelanguageinsocialmedia/d49c7cbd-60a9-4972-933e-dbbe723e6ed5_content_list.json b/acomputationalexplorationofpejorativelanguageinsocialmedia/d49c7cbd-60a9-4972-933e-dbbe723e6ed5_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a0ea63391438565f5c5a1f77bb9563f7eda48a27 --- /dev/null +++ b/acomputationalexplorationofpejorativelanguageinsocialmedia/d49c7cbd-60a9-4972-933e-dbbe723e6ed5_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ffa44dd631b3d74b990f202a850ea9a6f09074607ec161b423f651183f6163d +size 41310 diff --git a/acomputationalexplorationofpejorativelanguageinsocialmedia/d49c7cbd-60a9-4972-933e-dbbe723e6ed5_model.json b/acomputationalexplorationofpejorativelanguageinsocialmedia/d49c7cbd-60a9-4972-933e-dbbe723e6ed5_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e8b5fb39a9682b29f2d48325b07f94df9b9b1534 --- /dev/null +++ b/acomputationalexplorationofpejorativelanguageinsocialmedia/d49c7cbd-60a9-4972-933e-dbbe723e6ed5_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c4914b472fa9a6b67129ec6bf2ade7cbb1723e49e68ab942c2b27dc76a7d48e6 +size 51073 diff --git a/acomputationalexplorationofpejorativelanguageinsocialmedia/d49c7cbd-60a9-4972-933e-dbbe723e6ed5_origin.pdf b/acomputationalexplorationofpejorativelanguageinsocialmedia/d49c7cbd-60a9-4972-933e-dbbe723e6ed5_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..293e3949ec3f08c51f1512042c5c175b95bcb501 --- /dev/null +++ b/acomputationalexplorationofpejorativelanguageinsocialmedia/d49c7cbd-60a9-4972-933e-dbbe723e6ed5_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1cce81c502d6e955421066cc93b91400df8c88841ad9da3575cd7af428731f47 +size 191388 diff --git a/acomputationalexplorationofpejorativelanguageinsocialmedia/full.md b/acomputationalexplorationofpejorativelanguageinsocialmedia/full.md new file mode 100644 index 0000000000000000000000000000000000000000..a0d0be292daa299ce7d103b2a822708781a2db59 --- /dev/null +++ b/acomputationalexplorationofpejorativelanguageinsocialmedia/full.md @@ -0,0 +1,161 @@ +# A Computational Exploration of Pejorative Language in Social Media + +Liviu P. Dinu1, Ioan-Bogdan Iordache1, Ana Sabina Uban1, Marcos Zampieri2 + +1University of Bucharest, Romania + +$^{2}$ Rochester Institute of Technology, USA + +ldinu@fmi.unibuc.ro, iordache.bogdan1998@gmail.com + +ana.uban@gmail.com, mazgla@rit.edu + +# Abstract + +In this paper we study pejorative language, an under-explored topic in computational linguistics. Unlike existing models of offensive language and hate speech, pejorative language manifests itself primarily at the lexical level, and describes a word that is used with a negative connotation, making it different from offensive language or other more studied categories. Pejorativity is also context-dependent: the same word can be used with or without pejorative connotations, thus pejorativity detection is essentially a problem similar to word sense disambiguation. We leverage online dictionaries to build a multilingual lexicon of pejorative terms for English, Spanish, Italian, and Romanian. We additionally release a dataset of tweets annotated for pejorative use. Based on these resources, we present an analysis of the usage and occurrence of pejorative words in social media, and present an attempt to automatically disambiguate pejorative usage in our dataset. + +# 1 Introduction + +With the increase of social media usage, the issue of toxic language has become an important problem in our society. Automatic methods are needed to help mitigate this problem, and for this reason the study of toxic speech in NLP has become very popularity in recent years. Different categories and definitions have been proposed, including hate speech (Schmidt and Wiegand, 2017; Vashistha and Zubiaga, 2021), offensive language (Zampieri et al., 2019; Bucur et al., 2021), aggression (Kumar et al., 2018, 2020), as well as further sub-categories depending on the targets, such as women, migrants, etc. (Basile et al., 2019). From a computational perspective, the problem is usually approached as a classification task at the post level, where a classifier is trained to predict whether a social media post contains offensive/toxic language. + +In this paper we address the question of pejorative words. Pejorative words are words or phrases that have negative connotations or that are intended to disparage or belittle1. Pejorativity is closely related to the notion of slurs or insults: “as noun phrases, ‘insult’ and ‘slur’ refer to symbolic vehicles designed by convention to derogate targeted individuals or groups” (Anderson and Lepore, 2013). While pejorative language is often used in offensive speech (Castroviejo et al., 2020), they are not identical categories. There are offensive posts that do not use pejorative words (e.g. “Women belong in the kitchen”), and pejorative uses of words that are not harmful (“What a shitty chair”) because the offensive content is not targeted at a person or a group as described in the popular annotation taxonomy of the Offensive Language Identification Dataset (OLID) (Zampieri et al., 2019). + +Words can have a negative meaning in one context and not in others (such as the figurative meanings of "trash" or "pussy"); or be pejorative in one language or culture, and not in others (such as the Romanian "cioara" (literally, "crow") - a slur for people of color). Slurs can also lose their pejorative meaning through semantic change (e.g. the word "queer" went through semantic amelioration over the years - it used to be a slur and is losing its negative connotation (Brontsema, 2004)). Recognizing the complexity of the phenomenon, with its linguistic subtleties as well as the variability related to culture and context, are important to successfully recognize pejorative words and by extension offensive posts and hate speech. + +Pejorative language is still largely underexplored in computational linguistics. There are very few studies addressing or taking pejorative language into account (Wiegand et al., 2018; Mendelsohn et al., 2020; Palmer et al., 2017; Eder et al., 2019; Castroviejo et al., 2020). A few related works + +to ours include Palmer et al. (2017) who focused on pejorative connotations for nominalized adjectives and Mendelsohn et al. (2020) who built a lexicon of vulgar terms (and vulgarity scores) for German based on derogatory terms found in Wiktionary. + +In this study, we address this important gap by leveraging dictionaries to build a multilingual lexicon of pejorative language for four languages. We compare the occurrence of pejorativity in social media with other established categories of toxic language, relying on existing hate speech corpora. Unlike most existing studies in hate speech and offensive language identification, our paper focuses on the lexical level and approaches the issue of ambiguity in toxic language, formulating the problem of pejorativity detection as a word sense disambiguation (WSD) task. The main contributions of this work are the following: + +1. We create a multilingual lexicon of pejorative words in four languages: English, Spanish, Italian, and Romanian. +2. We present several experiments to automatically distinguish pejorative from nonpejorative uses of words relying on state-of-the-art word sense representations based on contextual embeddings. +3. We release annotated datasets containing pejorative words in English and Spanish tweets. + +# 2 Pejorative Lexicon + +# 2.1 Data Collection + +We started by gathering a pejorative lexicon for four languages: English, Spanish, Italian and Romanian. For each language, we assembled a list of words that can be used with a pejorative sense according to existing language resources. We focused on providing a lexicon consisting of words that can be used pejoratively on their own, rather than words that are part of pejorative expressions or idioms. In order to collect these terms for English, Spanish, and Italian we used Wiktionary $^2$ , and collected the terms that were part of the "derogatory terms" category. For Romanian, we used another online-available dictionary, dexonline $^3$ , and selected all of the words that had a pejorative definition and where the definition was intended for the word not for an expression built around the word. + +# 2.2 Lexicon Description + +For each language's lexicon, we computed the frequency of each word, based on occurrence across different large corpora including Wikipedia and social media datasets, using the wordfreq Python library (Speer et al., 2018). We used the WordNet (Miller, 1995) to count the number of senses a word can have (by counting the number of synsets that they are contained in) as well as their parts of speech. Statistics are shown in Table 1. The distribution across parts of speech is illustrated in Figure 1. For a given word, we counted all its possible parts of speech according to WordNet. + +
Lang.WordsWF cover.WN cover.Senses
EN290328.97%25.56%3.07
ES88151.99%18.05%3.05
IT14953.02%49.66%1.87
RO77012.34%32.21%2.41
+ +Table 1: Number of words for each language, coverage in wordfreq, WordNet coverage, and average number of senses for words in WordNet. + +![](images/3be3eeb4b0d594bb549a3e70413c8e1da66b72ba5c20add0ac375aac1a4d0389.jpg) +Figure 1: Distribution of parts of speech for the collected words for each language in WordNet. + +# 3 Pejorative Tweet Dataset + +For building a data set of English texts containing words that are used pejoratively, we started by looking at three datasets of hate speech on Twitter: (Davidson et al., 2017), (Basile et al., 2019). (Waseem and Hovy, 2016), and selected the tweets that contain words from our pejorative lexicon (after normalizing words to their stems). For each data set, we extracted pairs of words and tweets where they occur. + +The dataset published by Davidson et al. (2017) contains tweets annotated with one of three classes (hateful, offensive and neither). For each label, the + +number of pejorative words found in the tweets is the following: 1, 114 out of 1, 430 hateful tweets, 8, 358 out of 19, 190 offensive tweets, and 2, 221 among the remaining 4, 163 tweets were found to contain pejorative words. The hate speech dataset published as part of the HatEval shared task (Basile et al., 2019) contains tweets annotated with labels for hateful and aggressive speech. Out of the 4, 210 hateful tweets, 1, 985 contain words from our lexicon, while from 1, 763 aggressive tweets, 822 were selected. Finally, the dataset by Waseem and Hovy (2016) contains tweets annotated for racist and sexist speech. 8 tweets out of the 1, 970 racist tweets, and 897 from 3, 378 sexist tweets, contain pejorative words. + +For Spanish, we employed the same technique of filtering tweets. We looked at the Spanish tweets data set provided by Basile et al. (2019) and considered only the binary label for hate speech classification. Out of the total of 5,000 tweets, we have extracted 1,621 hateful examples and 1,667 non-hateful examples that contain words from our Spanish pejorative lexicon. + +# 3.1 Annotation + +We then built a data set of English tweets annotated for pejorative usage of words, by selecting tweets from the HatEval data set (Davidson et al., 2017), which we chose given the large number of unique pejorative words it contains (1, 77 for hate, 3, 95 for offensiveness and 2, 77 for none). We extracted two separate data sets in two different ways. + +The first data set (PEJOR1) was built by selecting a fixed percentage of tweets from each class, in order to obtain a balanced dataset with respect to the three labels (keeping only words that are represented at least once in each class). In this way, we attempt to conserve the relative distribution of the pejorative stems across the three classes. + +The second data set (PEJOR2) was built to be balanced with regard to both the words' distribution and the original labels. For each pejorative stem we extracted a fixed number of pairs from each of the three classes. + +The selected tweet-word pairs extracted for both of the data sets were then annotated with binary valued labels, denoting whether the word in the pair is used pejoratively (label 1) or not (label 0) in the tweet. We used the Wiktionary definitions in order to label words as pejorative only when used with senses marked as "derogatory" in Wiktionary. + +The Table 2 shows statistics for the two datasets, while Figure 2 illustrates the distribution of labels for words in PEJOR2. Data was annotated by specialists in linguistics. We used two annotators for each datapoint, and used a third one where there was disagreement. The obtained Cohen's $k$ agreement score was 0.933. + +![](images/5ad5d33848efdeea45bbd566a12ad90a79965f7b34f8fc3c3714cd6c2714099d.jpg) +Figure 2: Distribution of labels for the PEJOR2 English dataset. + +
PEJOR1PEJOR2
pairs 944words 23label 1 49.7%pairs 313words 11label 1 51.4%
hateoffensiveneitherhateoffensiveneither
08.04%21.59%20.74%012.46%15.34%20.77%
127.20%14.07%8.36%121.09%17.89%12.46%
+ +Table 2: Number of tweet-word pairs in the datasets, number of unique words, and the frequency of the 1 label. Overlap with (Davidson et al., 2017) labels. + +For Spanish, we built a pejorative data set by selecting tweets from the (Basile et al., 2019) data set, following the same approach used for extracting the PEJOR2 English examples. We annotated a small subset of the tweets, consisting of 12 pejorative words with 10 tweets each (balanced between hateful and non-hateful tweets). + +# 4 Classification Experiments + +The classification task we approached was inferring the 0/1 label for tweet-word pairs. Namely, given a word and a tweet, where the word appears in the tweet, we want to be able to say if the word was used pejoratively or not in that tweet. + +In order to prepare our data, for each tweet-word pair, the tweet was tokenized and the position of the occurrence of the word was found among the tokens. Then, we generated a contextual embedding (Devlin et al., 2019) for that occurrence, by employing various BERT models, pre-trained on + +English texts, provided by the huggingface Python library (Wolf et al., 2019). The embedding obtained for the specified position is computed by summing the 768-dimensional hidden states generated for that position by each of the 12 layers of the BERT architecture. We note that, for out-of-vocabulary words, the BERT tokenizer provided by the huggingface library splits them into sub-words. In this case we chose to generate the embeddings for each of the sub-words of our word occurrence and then average them to obtain the final 768-dimensional embedding. + +Figure 3 illustrates an example of uses of a pejorative word ("cracker") in the PEJOR2 dataset, by representing its embeddings reduced to two dimensions using PCA. We can see that most of the similar labelled examples are clustered together. + +![](images/c9989ad05d665b239abc781c58bfcc7d30f1c02a167bc500aa4ba5ef0b97c022.jpg) +Figure 3: 2D plot of the contextual embeddings generated for the word 'cracker' in the PEJOR2 data set, for each of its occurrences in the tweets, using a pretrained BERT model. Embeddings were reduced to two dimensions using PCA. + +For classification on our English data set, we grouped the pairs by the pejorative word contained in the tweet, and independently for each group, we fitted a classifier on the contextual embeddings (Liu et al., 2020). For extracting the embeddings we used various transformer models (BERT base (Devlin et al., 2019), BERTweet (Nguyen et al., 2020), RoBERTa (Liu et al., 2019), Multilingual BERT (Devlin et al., 2019)) and for the classification algorithm we used K-Nearest Neighbors, Support Vector Machines (SVM), Multilayer Perceptron (MLP). For K-Nearest Neighbors, we considered the cosine similarity as the distance function and found through hyper-parameter tuning that neighborhoods of size 4 were the best performing setting. + +For evaluation, we employed a 5-fold cross-validation. Performance metrics were computed for + +each word independently, measuring the capacity of distinguishing the pejorative and non-pejorative usage of the word in different contexts. We report, for each metric, the value resulted by averaging over the scores obtained for all of the word groups. We leave out from this averaging the words that appear with only one label in the whole data set (only pejorative or only non-pejorative), since they will be always classified correctly regardless of the contextual embeddings. We also employed a baseline that based on the training data it learns to predict only the most frequent label. Table 3 shows the obtained results. The appendix contains a table with nearest neighbors found for example tweets. + +We notice a promising performance of the classifiers in distinguishing pejorative usage, of up to 0.86 F1-score. Following the best performing models for each data set, overall 107 samples were misclassified in the PEJOR1 dataset, while for PEJOR2 there were 37. Words in PEJOR2 seem slightly easier to classify, which might be expected given the dataset is more balanced in positive and negative examples. + +
Dataset EmbeddingsClassifierPEJOR1PEJOR2
AccF1AccF1
baseline67.7%0.60467.3%0.694
BERT base4-NN76.9%0.77681.1%0.841
BERT baseSVM79.2%0.76880.3%0.837
BERT baseMLP79.8%0.80182.5%0.864
RoBERTa4-NN72.6%0.72467.7%0.716
RoBERTaSVM72.1%0.65468.9%0.692
RoBERTaMLP76.4%0.78177.2%0.802
BERTweet4-NN80.4%0.79775.4%0.776
BERTweetSVM78.0%0.76077.9%0.793
BERTweetMLP81.9%0.80278.1%0.803
Multilg. BERT4-NN71.0%0.71474.2%0.784
Multilg. BERTSVM73.0%0.65774.3%0.786
Multilg. BERTMLP76.9%0.75075.1%0.796
+ +Table 3: Performance scores for various contextual embeddings and classifiers on the PEJOR1 and PEJOR2 English data sets + +For the Spanish pejorative data set, since most of the examples were not labelled, we tried an unsupervised clustering approach. For each group of example pairs defined by the common pejorative word, we extracted contextual embeddings using the same previously explained method. Using KMeans clustering, we grouped those embeddings into two classes. We then computed, using the annotated examples, the amount of overlap between those two clusters and the pejorative la + +bels. The overlap was computed as the accuracy and the macro-F1 score of the clusters when used for predicting the labels. We averaged the scores computed for all of the groups where there was at least one positively and one negatively labelled example. The results obtained using various embeddings (BETO (Cañete et al., 2020) and Multilingual BERT (Devlin et al., 2019)) can be found in table 4. For reference, we have used the random chance of assigning the clusters as a baseline. + +
MethodAccuracyF1 score
random chance50.0%0.488
BETO68.9%0.573
Multilingual BERT65.0%0.503
+ +Table 4: Overlap score for unsupervised clustering on the Spanish pejorative data set + +# 5 Conclusions + +We have addressed an important but under-explored lexical category in the intersection of lexical semantics and toxic speech: pejorativity. We released a public lexicon of pejorative words in four languages (including a low-resource language), as well as dataset of tweets annotated for pejorative uses of words.4 We have modelled pejorativity detection as a problem of disambiguation, and performed experiments using state-of-the-art contextual embeddings in order to automatically distinguish pejorative from non-pejorative uses of words, obtaining promising results. In the future, we would like to explore modelling the problem of pejorativity detection as a sequence labelling task. + +At the application level, integrating pejorativity detection into hate speech detection systems, for example, would be a promising area for future research. From a linguistic perspective, it would be interesting to analyze occurrence and pejorative value cross-lingually taking advantage of large pretrained cross-lingual models as in Ranasinghe and Zampieri (2020, 2021) for offensive language identification. We expect pejorative connotations to be difficult to translate and not transfer well across languages, which could also have practical implications. We would also like to extend our dataset of social media posts to cover more pejorative terms, as well as other languages. + +# Ethical Considerations + +Our dataset of tweets was obtained by sampling existing hate and offensive speech datasets cited in this paper, complying with the terms of use of each of these datasets. All datasets were anonymized, no usernames or any of their demographics are included in the data used to train our models. + +# Acknowledgments + +We warmly thank our annotators Laurentia Nodit and Laurentiu Zoicaş for their time. We would like to thank the anonymous EMNLP reviewers for their insightful feedback. + +This research is supported in part by the Romanian Ministry of Research, Innovation and Digitization, CNCS/CCCDI UEFISCDI, project number 411PED/2020 and project number 108PCE/2021, within PNCDI III. + +# References + +Luvell Anderson and Ernie Lepore. 2013. What did you call me? slurs as prohibited words setting things up. Analytic Philosophy, 54(3):350-63. +Valerio Basile, Cristina Bosco, Elisabetta Fersini, Nozza Debora, Viviana Patti, Francisco Manuel Rangel Pardo, Paolo Rosso, Manuela Sanguinetti, et al. 2019. SemEval-2019 task 5: Multilingual detection of hate speech against immigrants and women in twitter. In Proceedings of SemEval. +Robin Brontsema. 2004. A queer revolution: Reconceptualizing the debate over linguistic reclamation. Colorado Research in Linguistics, 17. +Ana-Maria Bucur, Marcos Zampieri, and Liviu P. Dinu. 2021. An exploratory analysis of the relation between offensive language and mental health. In Findings of the ACL. +Elena Castroviejo, Katherine Fraser, and Agustín Vicente. 2020. More on pejorative language: Insults that go beyond their extension. Synthese, pages 1-26. +Jose Cañete, Gabriel Chaperon, Rodrigo Fuentes, JouHui Ho, Hojin Kang, and Jorge Pérez. 2020. Spanish pre-trained bert model and evaluation data. In PML4DC at ICLR 2020. +Thomas Davidson, Dana Warmsley, Michael Macy, and Ingmar Weber. 2017. Automated hate speech detection and the problem of offensive language. In Proceedings ICWSM. + +bidirectional transformers for language understanding. In Proceedings of NAACL. +Elisabeth Eder, Ulrike Krieg-Holz, and Udo Hahn. 2019. At the lower end of Language—Exploring the vulgar and obscene side of German. In Proceedings of the ALW. +Ritesh Kumar, Atul Kr Ojha, Shervin Malmasi, and Marcos Zampieri. 2018. Benchmarking aggression identification in social media. In Proceedings of TRAC. +Ritesh Kumar, Atul Kr. Ojha, Shervin Malmasi, and Marcos Zampieri. 2020. Evaluating aggression identification in social media. In Proceedings of TRAC. +Jerry Liu, Nathan O'Hara, Alexander Rubin, Rachel Draelos, and Cynthia Rudin. 2020. Metaphor detection using contextual word embeddings from transformers. In Proceedings of Fig-Lang. +Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019. RoBERTa: A Robustly Optimized BERT Pretraining Approach. arXiv preprint arXiv:1907.11692. +Julia Mendelsohn, Yulia Tsvetkov, and Dan Jurafsky. 2020. A framework for the computational linguistic analysis of dehumanization. Frontiers in Artificial Intelligence, 3:55. +George A Miller. 1995. Wordnet: a lexical database for english. Communications of the ACM, 38(11):39-41. +Dat Quoc Nguyen, Thanh Vu, and Anh Tuan Nguyen. 2020. Bertweet: A pre-trained language model for english tweets. arXiv preprint arXiv:2005.10200. +Alexis Palmer, Melissa Robinson, and Kristy K. Phillips. 2017. Illegal is not a noun: Linguistic form for detection of pejorative nominalizations. In Proceedings of ALW. +Tharindu Ranasinghe and Marcos Zampieri. 2020. Multilingual Offensive Language Identification with Cross-lingual Embeddings. In Proceedings of EMNLP. +Tharindu Ranasinghe and Marcos Zampieri. 2021. MUDES: Multilingual Detection of Offensive Spans. In Proceedings of NAACL. +Anna Schmidt and Michael Wiegand. 2017. A survey on hate speech detection using natural language processing. In Proceedings of SocialNLP. +Robyn Speer, Joshua Chin, Andrew Lin, Sara Jewett, and Lance Nathan. 2018. Luminosoin-sight/wordfreq: v2.2. +Neeraj Vashistha and Arkaitz Zubiaga. 2021. Online multilingual hate speech detection: experimenting with Hindi and english social media. Information, 12(1):5. + +Zeerak Waseem and Dirk Hovy. 2016. Hateful symbols or hateful people? predictive features for hate speech detection on twitter. In Proceedings of NAACL SRW. +Michael Wiegand, Josef Ruppenhofer, Anna Schmidt, and Clayton Greenberg. 2018. Inducing a lexicon of abusive words - a feature-based approach. In Proceedings of NAACL. +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumont, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Remi Louf, Morgan Fun-towicz, et al. 2019. Huggingface's transformers: State-of-the-art natural language processing. arXiv preprint arXiv:1910.03771. +Marcos Zampieri, Shervin Malmasi, Preslav Nakov, Sara Rosenthal, Noura Farra, and Ritesh Kumar. 2019. Predicting the type and target of offensive posts in social media. In Proceedings of NAACL. \ No newline at end of file diff --git a/acomputationalexplorationofpejorativelanguageinsocialmedia/images.zip b/acomputationalexplorationofpejorativelanguageinsocialmedia/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b2a3ccfdcb17fdcdf337b3cf525cc8263e12bcaa --- /dev/null +++ b/acomputationalexplorationofpejorativelanguageinsocialmedia/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d71a27c27126cfc0f790dfd61d35dbd6c8dee5b395aee1fe128c2c19d8f0f44 +size 153010 diff --git a/acomputationalexplorationofpejorativelanguageinsocialmedia/layout.json b/acomputationalexplorationofpejorativelanguageinsocialmedia/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..674a09ededee9498f82ab74ea93727ab15e5751a --- /dev/null +++ b/acomputationalexplorationofpejorativelanguageinsocialmedia/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1749f302523dbc3a52e6a9e5c290e6b0fcf89e8717ac1a9bdbb78cc52d70ba0d +size 167001 diff --git a/aconditionalgenerativematchingmodelformultilingualreplysuggestion/ba86f020-96cc-42e7-b587-426a976040ea_content_list.json b/aconditionalgenerativematchingmodelformultilingualreplysuggestion/ba86f020-96cc-42e7-b587-426a976040ea_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..2e896f01693aed9ba8304381b0d12e46f890b0dc --- /dev/null +++ b/aconditionalgenerativematchingmodelformultilingualreplysuggestion/ba86f020-96cc-42e7-b587-426a976040ea_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9e8ae34d206f7a84b2ab31b66eac27e80e0c34fa60fc9fb7879f7e9ba72a3ed +size 145360 diff --git a/aconditionalgenerativematchingmodelformultilingualreplysuggestion/ba86f020-96cc-42e7-b587-426a976040ea_model.json b/aconditionalgenerativematchingmodelformultilingualreplysuggestion/ba86f020-96cc-42e7-b587-426a976040ea_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a45b6074a9dc64dc27adfdab7503503b6c056da6 --- /dev/null +++ b/aconditionalgenerativematchingmodelformultilingualreplysuggestion/ba86f020-96cc-42e7-b587-426a976040ea_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:acd1bfc04d8f338653ac6da8a362fe5b94106b3e8fc8d8fcda4296e12d0ac732 +size 164751 diff --git a/aconditionalgenerativematchingmodelformultilingualreplysuggestion/ba86f020-96cc-42e7-b587-426a976040ea_origin.pdf b/aconditionalgenerativematchingmodelformultilingualreplysuggestion/ba86f020-96cc-42e7-b587-426a976040ea_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fed0d6ca0314c15cc497387b9f1c6ef9fe519a07 --- /dev/null +++ b/aconditionalgenerativematchingmodelformultilingualreplysuggestion/ba86f020-96cc-42e7-b587-426a976040ea_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b322ab188ee76cdb88fc3618887d9c809dfdd1ac208862d6f620cdc6554fdcaa +size 3895236 diff --git a/aconditionalgenerativematchingmodelformultilingualreplysuggestion/full.md b/aconditionalgenerativematchingmodelformultilingualreplysuggestion/full.md new file mode 100644 index 0000000000000000000000000000000000000000..87d9191b33463567374230a06d4982850bef78cb --- /dev/null +++ b/aconditionalgenerativematchingmodelformultilingualreplysuggestion/full.md @@ -0,0 +1,440 @@ +# A Conditional Generative Matching Model for Multi-lingual Reply Suggestion + +Budhaditya Deb† Guoqing Zheng‡ Milad Shokouhi† Ahmed Hassan Awadallah‡ + +Microsoft AI Microsoft Research + +{budev, zheng, milads, hassanam}@microsoft.com + +# Abstract + +We study the problem of multilingual automated reply suggestions (RS) model serving many languages simultaneously. Multilingual models are often challenged by model capacity and severe data distribution skew across languages. While prior works largely focus on monolingual models, we propose Conditional Generative Matching models (CGM), optimized within a Variational Autoencoder framework to address challenges arising from multilingual RS. CGM does so with expressive message conditional priors, mixture densities to enhance multi-lingual data representation, latent alignment for language discrimination, and effective variational optimization techniques for training multi-lingual RS. The enhancements result in performance that exceed competitive baselines in relevance (ROUGE score) by more than $10\%$ on average, and $16\%$ for low resource languages. CGM also shows remarkable improvements in diversity $(80\%)$ illustrating its expressiveness in representation of multi-lingual data. + +# 1 Introduction + +Automated reply suggestion (RS) helps users quickly process Email and chats, in popular applications like Gmail, Outlook, Microsoft Teams, and Facebook Messenger, by selecting a relevant reply generated by the system, without having to type in the response. Most existing RS systems are English mono-lingual models (Kannan et al., 2016; Henderson et al., 2017; Deb et al., 2019; Shang et al., 2015). We study the problem of creating multilingual RS models serving many languages simultaneously. Compared to mono-lingual models, a universal multilingual model offers several interesting research questions and practical advantages. + +Universal models can save compute resources and maintenance overhead for commercial systems supporting many regions. In addition it can benefit languages with insufficient data by informa + +tion sharing from high resource languages and thus enhance experiences for users especially in low-language resource regions. We investigate if a single multilingual RS model can replace multiple mono-lingual models with better performance, while overcoming the challenges in model capacity, data skew, and training complexities. + +Trivially extending existing mono-lingual RS models to the multilingual setting (e.g. by jointly training with pre-trained multi-lingual encoders) tends to be sub-optimal, as multilingual models suffer from capacity dilution issue (Lample and Conneau, 2019), where it improves performance on low resource languages while hurting the high resource ones. This arises, not only due to the severe data imbalance and distribution skew across languages, but also due to insufficient capacity and lack of inductive biases in models to represent the multi-modal distribution of languages. We postulate that deep generative latent variable models with variational auto-encoders (VAE) (Kingma and Welling, 2014) are better suited to model the complex distribution of multi-lingual data, and be more data efficient for low resource languages. + +To this end, we propose the Conditional Generative Matching Model (CGM), a VAE based retrieval architecture for RS to solve the above challenges. CGM enhances multilingual representation through: 1) expressive message conditional priors, 2) multi-component mixture density to represent different modalities of languages, and 3) alignment of latent components for language discrimination. In addition CGM incorporates training optimizations in the form of 1) loss regularizer, 2) learnable weights for loss components, 3) multi-sample loss estimation with variance scaling, and 4) focal loss, all of which lead to balanced representation and smooth convergence, a key challenge for variational training in multilingual settings. + +We conducted extensive ablation studies and comparisons with two competitive baselines to + +![](images/e2cb80066e0b0aa6b874fdb8d2feeac83406e666bb27d61ea6a48bd6232cca92.jpg) +(a) Generative model for MCVAE + +![](images/20ff0ca5b2ade17da6698389a5bc95dc67b7d3927c09d3bcfd248e9a99ca090e.jpg) +(b) Generative model for CGM +Figure 1: RS generative models in the continuous space. Text M-R pairs (in discrete space) are encoded into a common continuous space $(\Theta_M \sim \Theta_R)$ , where the encoders outputting $\Theta_M, \Theta_R$ are considered extraneous to the generative model. The generative process is in the continuous space, with $\Theta_R$ generated conditioned on the input $\Theta_M$ and a Gaussian prior $z$ . The figures show three variations of this generative process. In prior work MCVAE, $z$ is sampled independently, while in CGM, it is conditional on $\Theta_M$ . CGM-M extends the message conditional prior with a Gaussian Mixture prior $z_c$ and a categorical prior $c$ . + +![](images/d1933dd6677ca90b7036eccc5e29706a308e3d27af02d75293beff93931a18b4.jpg) +(c) Generative model for CGM-M + +show the impact of the above optimizations. Universal CGM models improve the relevance of RS (up to $13\%$ excluding English) with even higher gains coming for low resource languages $(16\%)$ , and when using CGM in a monolingual setting $(19\%)$ . CGM also dramatically increases the diversity of suggested replies by $80\%$ which is more illustrative of the improved representational capability of CGM in the multi-lingual landscape. CGM achieves this with relatively small increase in model sizes compared to the large pre-trained transformer stacks on which it is built, showing the modeling efficiencies that can be achieved through efficient training of latent variable models in a multi-lingual setting. + +# 2 Background and Preliminaries + +While RS has been modeled as a sequence to sequence model (Kannan et al., 2016), it more commonly appears as an information retrieval (IR) system by ranking responses from a fixed set (Henderson et al., 2017, 2019; Ying et al., 2021; Swanson et al., 2019; Zhou et al., 2016, 2018) due to better control over quality and relevance for practical systems. We briefly describe two retrieval architectures from prior literature which serves as the baselines for our multilingual RS model. + +Matching model (Henderson et al., 2017; Ying et al., 2021) consists of two parallel encoders $[f_{\varphi_M}, f_{\varphi_R}]$ to encode message and reply (M-R) pairs into a common encoding space, $[\Theta_M, \Theta_R]$ and trained to maximize a normalized dot product $D = \Theta_M^\top \Theta_R$ between the M-R encodings. During prediction, the model finds the nearest neighbors of $\Theta_M$ with precomputed encodings from a fixed response set $R_{[s]}$ . A language model bias is typically added to promote more common responses. The matching architecture is summarized as: + +$$ +\mathcal {L} \left(\Theta_ {R} \mid \Theta_ {M}\right) = \log \frac {e ^ {D \left(\Theta_ {M} , \Theta_ {R}\right)}}{\sum_ {r \in R _ {[ s ]}} e ^ {D \left(\Theta_ {M} , \Theta_ {r}\right)}} \tag {1} +$$ + +Prediction: $Top_{k}\{\Theta_{M}^{\top}\Theta_{r} + \alpha LM(r)|r\in R_{[s]}\}$ (2) + +Matching Conditional VAE (MCVAE) (Deb et al., 2019) induces a deep generative latent variable model on the matching architecture, where a candidate response encoding is generated with $\Theta_{R'} = g_w(\Theta_M, z)$ conditioned on a latent prior $z \sim \mathcal{N}(0, I)$ . The generated $\Theta_{R'}$ is used to match an actual response vector $\Theta_R$ from the fixed response set. The generative model of MCVAE is shown in figure 1a. In MCVAE, the encoders $[f_{\varphi_M}, f_{\varphi_R}]$ are pretrained using the matching formulation and kept frozen during the training. For prediction, MCVAE samples response vectors from $g_w$ followed by scoring (eq 2) and a voting technique to rank replies over a fixed response set. MCVAE is trained in the variational framework by minimizing the negative evidence lower-bound (ELBO) in equation 3 with a Gaussian posterior $q_\phi$ (mean and co-variance parameterized from $(\Theta_M, \Theta_R)$ ) and the reconstruction loss $\mathcal{L}_M$ defined by Eq. (1). + +$$ +\ell_ {E L B O} = K L \left(q _ {\phi} | | p (z)\right) - \mathcal {L} _ {M} \left(\Theta_ {R} \mid \Theta_ {R ^ {\prime}}\right) \tag {3} +$$ + +We extend the Matching and MCVAE models to a multi-lingual setting by using pretrained multilingual BERT (MBERT) (Devlin et al., 2019) for $[f_{\varphi_M}, f_{\varphi_R}]$ similar to (Ying et al., 2021) and jointly training the models for all languages. + +# 3 CGM: A Conditional Generative Matching Model for Reply Suggestion + +Our initial analysis with universal models (jointly training models with all languages), reveals that the universal MCVAE performs better than Matching. However, simply training models jointly is + +not sufficient to achieve a models with high performance. First, the highly imbalanced nature of multi-lingual data leads to over- or under-fitting across languages resulting in performance worse than separately trained mono-lingual models. Second, training multi-lingual MCVAE proved is due to the reliance on a pretrained Matching model: it is not clear how to find a suitable Matching model checkpoint for initializing the MCVAE. Finally, since the text encoders for MCVAE are frozen during training, there is limited cross lingual transfer and improvement for low resource languages. Unfreezing the layers led to divergence of the model. + +To address the limitations of MCVAE, we propose an enhanced Conditional Generative Matching (CGM) model, for the retrieval based RS with inductive biases for the multi-lingual data and effective training techniques for creating high quality universal models. + +# 3.1 Message Conditional Prior + +The implied generative process in MCVAE (Fig. 1a), is $p(z) \to p(\Theta_M|z) \to p(\Theta_R|\Theta_M,z)$ , where the latent prior $z$ is sampled independent of the message encoding $\Theta_M$ . However, in RS since $\Theta_M$ is always observed, ideally one would like to sample from $p(z|\Theta_M)$ to capture message-dependent information as well as rich multi-modality of the input space, particularly for multi-lingual data. In addition, although MCVAE works well empirically in the mono-lingual setting (Deb et al., 2019), the samples from $p(z)$ in general are not the same as $p(z|\Theta_M) \propto p(z)p(\Theta_M|z)$ , unless $p(\Theta_M|z)$ is uniform across the space of $\Theta_M$ . This is a restrictive assumption, which motivates us to consider a prior conditioned on the input $\Theta_M$ for the generative model, by decomposing + +$$ +p (\Theta_ {R}, z | \Theta_ {M}) = p (z | \Theta_ {M}) p (\Theta_ {R} | \Theta_ {M}, z) \tag {4} +$$ + +as shown in Figure 1b. The conditional prior $p(z|\Theta_M)$ is posed to encode message dependent information which can facilitate matching more relevant and diverse set of responses. We define the message-conditional prior $p(z|\Theta_M) = \mathcal{N}(\mu (\Theta_M),\Sigma (\Theta_M))$ , where the prior parameters are learnt from data during training and used for prediction, to maximally capture the multiple modalities of intents and intrinsically complex distribution of multi-lingual data. + +# 3.2 Prior with Mixture Density (CGM-M) + +We postulate that a more expressive conditional prior, such as a mixture density, can better capture the multi-lingual data in contrast to the single prior density as used above. I.e., the different components of a mixture density can represent different languages and allow independent representation across languages. To this end we extend the message conditional prior with a Gaussian Mixture model (GMM) as, + +$$ +p (z | \Theta_ {M}) = \sum_ {k = 1} ^ {K} \pi_ {k} (\Theta_ {M}) \mathcal {N} \left(\mu_ {k} (\Theta_ {M}), \Sigma_ {k} (\Theta_ {M})\right) \tag {5} +$$ + +where $\mu_{k}(\Theta_{M}),\Sigma_{k}(\Theta_{M})$ are the message dependent means and diagonal covariances for the $k$ th component of the GMM, and $\pi_k(\Theta_M)$ are the message dependent prior mixing coefficients. We hypothesize that components would correspond to different intents and languages, thus providing additional inductive bias for multi-lingual data. We refer to the mixture variant as CGM-M (Figure 1c). + +# 3.3 Aligning Latent Space to Language + +To further reinforce the notion that the CGM-M latent components encode language specific information from M-R pairs, we pose an additional constraint that the language of the message be inferred from the prior mixture coefficient. This is instantiated by building a simple classifier network with loss $\ell_{LC}(l|\Theta_M,\pi)$ to map the prior mixture coefficient $\pi (\Theta_M)$ onto the language $l$ of the message. We also tested with mapping the 1) means and variances $[\mu_k(\Theta_M),\Sigma_k(\Theta_M)]$ , and 2) samples $z_{k}$ of the GMM, and found that mapping the $\pi (\Theta_M)$ leads to the best results. The classifier is learned jointly with the rest of the components. + +# 3.4 Variational Training Architecture + +The CGM models are formulated as a VAE in the continuous space of $\Theta_M, \Theta_R$ . CGM includes two multi-lingual text encoders $[f_{\varphi_M}, f_{\varphi_R}]$ , to convert the raw text of M-R into the common encoding space (encoders may be considered extraneous to the VAE but are learnt jointly with VAE layers), and a VAE with prior, posterior, and generation networks $[p_\psi(\mu, \Sigma), q_\phi(\mu, \Sigma), g_\theta]$ . + +The CGM-M extends the CGM version with category specific Gaussian components $[p_{\psi_c},q_{\phi_c}]$ In addition it also includes a categorical prior and posterior $[\pi_c,\rho_c]$ , and a language classifier $l_{c}$ to + +discriminate between languages. We use the standard reparameterization trick for the Gaussian variables and the Gumbel-Softmax trick (Jang et al., 2017) with hard sampling for the categorical variable. CGM-M (CGM is a special case with $K = 1$ ) is summarized as follows. + +Generative Model: $p_{\psi}(\mu, \Sigma), g_{\theta}$ + +$$ +\pi = \operatorname {S o f t m a x} \left(\mathrm {F F N} _ {1} \left(\Theta_ {M}\right)\right) \tag {6} +$$ + +$$ +c = \operatorname {G u m b e l S o f t m a x} \left(\mathrm {F F N} _ {1} \left(\Theta_ {M}\right)\right) \tag {7} +$$ + +$$ +\mu_ {\phi} = \operatorname {F F N} _ {2} \left(\Theta_ {M}\right), \Sigma_ {\phi} = \operatorname {S o f t p l u s} \left(\operatorname {F F N} _ {3} \left(\Theta_ {M}\right)\right) \tag {8} +$$ + +$$ +z _ {c} = \mu_ {\phi_ {c}} + \varepsilon \Sigma_ {\phi_ {c}}, \text {w h e r e} \varepsilon \sim \mathcal {N} (0, I) \tag {9} +$$ + +$$ +\Theta_ {R ^ {\prime}} = \operatorname {F F N} _ {4} \left(\overleftrightarrow {z _ {c} \Theta_ {M}}\right) \tag {10} +$$ + +Variational Posterior: $q_{\phi}(\mu, \Sigma)$ + +$$ +\rho = \operatorname {S o f t m a x} \left(\overleftrightarrow {\mathrm {F F N} _ {5}} \left(\overrightarrow {\Theta_ {M} \Theta_ {R}}\right)\right) \tag {11} +$$ + +$$ +v = \operatorname {G u m b e l S o f t m a x} \left(\overleftrightarrow {\Theta_ {M} \Theta_ {R}}\right) \tag {12} +$$ + +$$ +\mu_ {\psi} = \mathrm {F F N} _ {6} (\overleftrightarrow {\Theta_ {M} \Theta_ {R}}) \tag {13} +$$ + +$$ +\Sigma_ {\psi} = \operatorname {S o f t p l u s} \left(\mathrm {F F N} _ {7} \left(\overleftrightarrow {\Theta_ {M} \Theta_ {R}}\right)\right) \tag {14} +$$ + +$$ +z _ {v} = \mu_ {\psi_ {v}} + \xi \Sigma_ {\psi_ {v}}, \text {w h e r e} \xi \sim \mathcal {N} (0, I) \tag {15} +$$ + +Above, we expand the dimensions of projection vectors to $\mu : [h \times K], \Sigma : [h \times K]$ where $h$ is the dimension of the forward projections and $K$ is the number of categories in the mixture. After the category is selected (using Gumbel Softmax), we use the category index to select part of the expanded projections, as the $k^{th}$ component of the means and variances $(\mu_k, \Sigma_k)$ . Each $\mathsf{FFN}_i$ denotes a two-layer feed-forward network (except $\mathsf{FFN}_4$ which has 3 layers) with tanh activation and $\leftrightarrow$ denotes vector concatenation. + +Note that the posteriors are conditioned on both $\Theta_{M}$ and $\Theta_{R}$ . This theoretically provides a richer representation of the M-R pairs and during inference allows us to score the combination of message and the selected response vectors. However, during training, it can lead to leakage through the network where the model simply ignores the message and uses the response vector for generation. We mitigate the leakage by applying a low-dimensional projection of response vector $\Theta_{R}$ before feeding into the variational network. + +Following standard stochastic gradient variational bayes (SGVB) training, we minimize the negative ELBO to train the network. CGM-M adds the classifier loss to enforce alignment between latent vectors and language types. The training objectives for each are given as follows, + +$$ +\ell_ {\mathrm {C G M}} = K ^ {\prime} L \left(q _ {\phi} \| p _ {\psi}\right) - \mathcal {L} \left(\Theta_ {R} \mid \Theta_ {R ^ {\prime}}\right) \tag {16} +$$ + +$$ +\ell_ {\mathrm {C G M - M}} = K L _ {M} \left(q _ {\phi} \| p _ {\psi}\right) - \mathcal {L} \left(\Theta_ {R} \mid \Theta_ {R ^ {\prime}}\right) + \ell_ {L C} \tag {17} +$$ + +where the reconstruction log-loss, $\mathcal{L}(\Theta_R|\Theta_{R'})$ is given by Eq. (1). For CGM, the KL divergence between the two multivariate Gaussian densities can be computed in closed form. However, for CGM-M, the KL divergence between two Gaussian mixtures does not admit a closed form. We estimate it with a variational approximation method described in (Hershey and Olsen, 2007) $^1$ . + +$$ +K L _ {M} (q \| p) \approx \sum_ {i = 1} ^ {K} \pi_ {i} \log \frac {\sum_ {j = 1} ^ {K} \pi_ {j} e ^ {K L \left(p _ {\phi_ {i}} \| q _ {\psi_ {j}}\right)}}{\sum_ {k = 1} ^ {K} \rho_ {k} e ^ {K L \left(p _ {\phi_ {i}} \| q _ {\psi_ {k}}\right)}} \tag {18} +$$ + +# 3.5 Training Optimizations + +Training deep generative models with SGVB has been known to be notoriously tricky (Bowman et al., 2016; Fu et al., 2019). Our multilingual setting, and joint training of text encoders with VAE layers makes it even more challenging. We employed several optimizations to improve the convergence of the models. + +1) Matching loss regularization: In CGM, the encoders for $\Theta_{M},\Theta_{R}$ are learnt jointly with the VAE layers in order to maximize richness of shared latent representation across languages. Thus $\Theta_R$ is a moving target for the VAE generator outputting $\Theta_{R^{\prime}}$ and causes the training to diverge without additional constraints. In MCVAE, this was mitigated by initializing and freezing the text encoders from a trained Matching model, but can be counterproductive in the multilingual scenario. To enable joint training of text encoders and the VAE layers, and mitigate the issue of a moving target for reconstruction, we introduce a regularization in the form of a matching score between $\Theta_M$ and $\Theta_R$ + +$$ +\ell_ {\mathrm {C G M - M}} = K L _ {M} \left(q _ {\phi} \mid \mid p _ {\psi}\right) - \mathcal {L} \left(\Theta_ {R} \mid \Theta_ {R ^ {\prime}}\right) + \ell_ {L C} - \mathcal {L} \left(\Theta_ {R} \mid \Theta_ {M}\right) \tag {19} +$$ + +which constrains the response vector to have a representation close to the message vector. This provides an independent anchor for the reconstruction and allows the end-to-end training of the model utilizing the full parameter space of the encoders for enhanced representation. + +2) Multi-sample variance scaling: In SGVB, using a single sample of $z$ usually results in high variance in the ELBO estimate. One remedy is to estimate the ELBO with multiple samples, either in the non-weighted and or importance + +weighted (Burda et al., 2016) versions. However, these led to only minor improvements. + +In multi-sample training we take the expectation of the ELBO over the samples. We found that if instead we first take the expectation of the samples $z' = \sum_{i=1}^{k} z_i / k$ before computing the ELBO loss, we can reduce the variance and stabilize the training. Since $z'$ follows an equivalent distribution $z' \sim \mathcal{N}(\mu, \frac{\Sigma}{k})$ , we can estimate ELBO with multiple samples drawn from the scaled distribution and compute the expectation as follows. The adjustment provides significant improvements in training convergence and metrics. + +$$ +\ell_ {C G M} = \mathbb {E} _ {z ^ {\prime}} [ - K L _ {z ^ {\prime}} (q _ {\phi} \| p _ {\psi}) + \mathcal {L} (\Theta_ {R} | \Theta_ {R ^ {\prime}}) ] \tag {20} +$$ + +3) Weighting loss components with Homoscedastic Uncertainty (HSU): The final loss formulations for both CGM and CGM-M have several components. For finer control of training, we introduce learnable weights $w_{i}$ for each of the components. Weighting different components of the ELBO loss has shown to improve performance (Higgins et al., 2017) in SGVB and thus even without additional components, such a weighting process is recommended. + +Following (Cipolla et al., 2018), we view the loss formulation as a multi-task learning objective with different homo-scedastic uncertainties (HSU) for each task. Assuming the components factorize to Gaussian (continuous) and discrete (cross-entropy) likelihoods, the loss with HSU can be viewed as: + +$$ +\begin{array}{l} \ell_ {H S U} = \frac {1}{2 \sigma_ {1} ^ {2}} K L (q _ {\phi} | | p _ {\psi}) - \frac {1}{2 \sigma_ {2} ^ {2}} \mathcal {L} (\Theta_ {R} | \Theta_ {R ^ {\prime}}) \\ - \frac {1}{2 \sigma_ {3} ^ {2}} \mathcal {L} \left(\Theta_ {R} \mid \Theta_ {M}\right) + \frac {1}{2 \sigma_ {4} ^ {2}} \ell_ {L C} \tag {21} \\ + \log (\sigma_ {1}) + \log (\sigma_ {2}) + \log (\sigma_ {3}) + \log (\sigma_ {4}) \\ \end{array} +$$ + +Equating the uncertainties with the weights in our loss equation, this can be seen as learning the relative weights for each component where $w_{i} \sim 1 / \sigma_{i}^{2}$ and provides a smooth, regularized and differentiable interpretation of weights. We introduce the weights as parameters in the model and learn them jointly with rest of the network. + +4) Handling data skew with Focal Loss (FL): Multilingual training can have different convergence rates across languages and akin to behaviors observed in multi-modal training (Wang et al., 2020b). Carefully configured sampling ratios for different languages can alleviate this problem but requires costly hyper-parameter search. Instead we + +employ a popular technique for handling skewed data distribution: the focal loss (FL) (Lin et al., 2020). + +$$ +\mathcal {L} _ {F L} \left(\Theta_ {R} \mid \Theta_ {R ^ {\prime}}\right) = \left(1 - e ^ {\mathcal {L} \left(\Theta_ {R} \mid \Theta_ {R ^ {\prime}}\right)}\right) ^ {\alpha} \mathcal {L} \left(\Theta_ {R} \mid \Theta_ {R ^ {\prime}}\right) \tag {22} +$$ + +The FL (with $\alpha = 1$ ) is applied on the reconstruction log-probability component of ELBO, such that strongly reconstructed vectors are given lower weights than the weakly reconstructed ones which balances the convergence across languages. + +# 3.6 Prediction and Ranking Responses + +During prediction, we rank and select responses from a fixed response set $R_{[s]}$ . Since the models generate response vectors in the continuous space, the prediction process needs to convert the samples into ranking in the discrete space of responses. The process is described as follows. + +$$ +\begin{array}{l} \log p _ {i} \left(\Theta_ {R _ {[ s ]}} | \Theta_ {M}\right) = \mathcal {L} \left(\Theta_ {R _ {i} ^ {\prime}} \mid \Theta_ {R _ {[ s ]}}\right) - K L _ {z} (q \| p) (23) \\ M R R \left(R _ {[ s ]}\right) = \frac {1}{N} \sum_ {i} ^ {N} \left[ \operatorname {R a n k} _ {R _ {[ s ]}} \log p _ {i} \left(\Theta_ {R _ {[ s ]}} \mid \Theta_ {M}\right) \right] ^ {- 1} (24) \\ \end{array} +$$ + +For each message we generate 1000 samples of latent conditional priors from $z \sim \mathcal{N}(\mu_{\phi}, \Sigma_{\phi})$ and from categorical prior for CGM-M. Next, we generate samples of the response vectors using the generator network, $\Theta_{R_i'} \sim g_\theta(\Theta_{R_i'}|\Theta_M, z_i)$ . We compute the scores for the $i^{th}$ generated sample w.r.t to the fixed response set $\log p_i(\Theta_{R_{[s]}}|\Theta_M)$ in eq. 23, where the KL divergence is directly computed on the samples $z$ under a Normal or GMM distribution for the prior and posterior. To reduce the scoring overhead over 40k responses with 1000 samples, we pre-select top $k$ ( $k = 100$ provides sufficiently diverse candidates) using the matching score (eq. 2). Finally, the mean reciprocal ranks (MRR) over all the samples (eq. 24) are used to select the top 3 as our predicted responses. + +# 4 Experiments + +Multi-lingual data: We use the MRS (Multilingual Reply Suggestions) data set (Zhang et al., 2021) for our experiments. MRS consists of message-reply (M-R) pairs separated into different languages from Reddit conversations (Baumgartner et al., 2020) using the FastText detector (Joulin et al., 2016). We select the top 15 languages for experimentation (data volume was insufficient for + +
Latent FactorsCond. PriorMix. DensityLanguage alignmentMultilingual training opts
Matching-----
MCVAE----
CGM--
CGM-M
+ +Table 1: Comparison of components of Matching, MCVAE (Sec 2), CGM, and CGM-M (Sec 3) + +![](images/79b75228184ebc568c817ee3f2b1627c028efe59ce4efda4c17338e7a900f606.jpg) +Figure 2: Main results. With the Matching monolingual models as baseline, the figures show the $\%$ changes in metrics for model variants (see Sec 4 for model description and Sec 4.1 for discussion). For each model variant, we show the metrics across three languages groups (All, w/o-EN and bottom 10 low resource languages. (Left) Relevance (Right) Diversity. + +![](images/c452f00eb0d381a40b8d8211e83a380a87755c415909f34d246b373a6242d80c.jpg) + +others) with $80\%$ split for training (2nd column in Table 4) and the rest for validation and test. We create response sets with most frequent responses $(>20$ frequency) in the m-r pairs. For low resource languages, we augment this natural set with machine translated responses from EN, resulting in $\sim 40\mathrm{k}$ responses for each language. + +Metrics: We use ROUGE (Lin, 2004) for scoring the relevance of the 3 predicted responses against the reference response. We also compute the self-ROUGE (Celikyilmaz et al., 2020) within the 3 responses as a measure of diversity. For both, we report the average of the ROUGE-F1 for $1/2/3$ -grams across the three responses. + +Train parameters: We use the multi-lingual version of the pretrained BERT model (MBERT) (Devlin et al., 2019) as out text encoders for which we use the Huggingface's transformers library (Wolf et al., 2020). We freeze the embedding layer of MBERT encoders, which reduces training overhead, and preserves cross-lingual representation without impacting performance (Lee et al., 2019; Peters et al., 2019). We use dimension size of 512 for the VAE layers. For CGM-M we set the number of categories to $K = 20$ . + +We train with the Adam optimizer (peak rate: $1e - 5$ , exp. decay: 0.999 after warm up of 1000 steps), batch size of 256, and m-r pairs truncated to length 64 and 32 respectively. We add language + +tokens (e.g. EN, PT) before m-r pairs as additional language identifier. All the model sizes are relatively similar (1.3GB to 1.5GB) since most parameters are in the two MBERT encoders with 12 transformer layers (each around 700MB). + +Multilingual training: We uniformly sample languages such that models have equal exposure to each language during training. This leads to good performance across all languages except EN. Alternatively, sampling proportionate to data volumes, had good performance for EN but led to severe under-fitting for most languages other than EN as EN dominates the training with orders of magnitude more data. The ideal sampling is somewhere in between, but requires extensive search to optimize. On single NVidia V100 GPUs, models converge within 1-2 epochs $\sim 48hrs$ over the entire data (i.e., 1-2 epochs for EN and multiple epochs for others). Joint training amortizes the training costs, and can be used even when targeting monolingual models, by saving per-language checkpoints. + +Model variants: We analyze 4 models: Matching, MCVAE, CGM and CGM-M (Table 1). For each we consider 3 multilingual model variants. [Mono]: individually trained monolingual models on each language. [Uni]: jointly trained universal model with a single checkpoint for evaluation. [Mono*]: jointly trained model with per language + +checkpoints (saved when the validation metrics peak for each language) for evaluation. Since models peak at different points for each language, Mono* is expected to have a better performance than the Universal counterpart with a single checkpoint. + +# 4.1 Main Results + +Figure 2 shows the relevance and diversity metrics for different model variants. With Matching-Mono models (trained individually per language) as the baseline, we plot the $\%$ changes in metrics for the other model variants. Models are trained on all languages, with relevance metrics shown in 3 language groups: 1) All, 2) All w/o EN, and 3) Bottom 10 low resource languages, to highlight the differences from data volumes in languages. $^{2}$ + +Relevance (Figure 2-Left): Compared to individually trained monolingual Matching model, the universally trained Matching-Uni regresses on all the three language group while MCVAE-Uni improves for latter two groups (w/o EN and bottom 10 languages). The CGM-Mono improves the metrics across all three languages. Thus even without joint training, CGM by itself is better than the baselines and thus raises the bar which the universal models needs to match or overcome. + +The CGM and CGM-M universal models improve on all the language groups although for the CGM-uni, there is regression in the All-languages group compared to the CGM-mono (more discussion later). However, CGM-M-Uni with around $5\%$ increase is actually slightly better than CGM-mono, showing that we can replace the monolingual models with a single universal model. Next, the Mono* models (universally trained but with best per-language checkpoints saved) can achieve even bigger gains and CGM-M-Mono* surpasses other models in every language group. + +Within language groups, we observe increase upto $16\%$ without EN and upto $19\%$ for bottom 10 languages. EN with two orders of magnitude more data, remains severely under-fitted in all the jointly trained model, due to which the metrics improvements in All languages group remains low. + +Diversity (Figure 2-Right): The CGM performance is most striking for diversity metrics where we see $80\%$ improvements. Diversity improvements more than the relevance gains, illustrate that deep generative modeling enhancements in CGM + +
Line #Baselines (Uni w/o EN)ROUGE (Rel)ROUGE (Div)
1Matching0.0353 (0%)0.3940 (0%)
2MCVAE0.0369 (+4.80%)0.289 (-26.65%)
CGM (Uni w/o EN)
3Basic CGM0.0378 (+7.25%)0.354 (-10.16%)
4+Variance Scaling (100 Samples)0.0393 (+11.50%)0.171 (-56.44%)
5+Focal Loss, HSU0.0398 (+12.78%)0.161 (-59.08%)
6+Rsp Vector in Posterior0.0399 (+13.23%)0.081 (-79.42%)
CGM-M (Uni w/o EN)
7Basic CGM-M0.0386 (+9.52%)0.299 (-24.10%)
8+Variance Scaling (100 Samples)0.0396 (+12.23%)0.189 (-51.96%)
9+Focal Loss, HSU0.04017(+13.87%)0.172 (-56.30%)
10+Lang Classifier0.04043 (+14.60%)0.164 (-58.33%)
11+Rsp Vector in Posterior0.0406 (+14.98%)0.082 (-79.18%)
+ +Figure 3: Ablation studies for different training optimizations (Sec 3.5) with results discussed in Sec 4.2. + +leads to richer representation of multilingual data with improved discrimination and disentanglement of language and latent intents in M-R pairs. CGMM achieves high diversity on top of the best relevance metrics, showing the enhanced representation through mixture models. + +# 4.2 Ablation Studies + +We conducted extensive ablation studies with the different model variants, and training optimizations and summarize the results in Figure 3. For ablations we report the metrics for language group without EN, as the significantly higher data volume in EN can conflate the results. + +Baselines: We use the Matching-uni model (line 1) as the baseline. MCVAE (line 2) improves both relevance $(4.8\%)$ and diversity $(27\%)$ which shows the potential of deep generative models. + +Training optimizations with CGM: The basic CGM-Uni model (line 3) and CGM-M (Line 7) shows modest relevance gains compared to MCVAE. We attribute the modest gains due to complexities with end-to-end training of the CGM. Through training optimizations of variance scaling, and FL and HSU (lines 4, 5), CGM can comfortably surpass MCVAE in relevance $(12.8\%)$ and double the diversity $(59\%)$ . CGM-M, shows similar increase $(13.87\%)$ with variance scaling (line 8), and FL and HSU (line 9) outperforming the best achieved with CGM. The biggest improvements come from multi-sample variance scaling (lines 4, 8) with additional improvements from FL and HSU (lines 5, 9). Overall, the optimizations lead to more stable training, and faster convergence across languages. They also alleviate the need for manual tuning for skewed data and loss component weights, making the training process virtually hyper-parameter free. + +Language Mapping in CGM-M: One key reason for improved performance with CGM-M is the potential inductive bias for languages through + +
Language & SizeMatching MonoCGM MonoMatching UniMCVAE UniCGM UniCGM-M UniCGM Mono*CGM-M Mono*
EN (49M)0.1177.89%-28.37%-27.64%-38.53%-29.26%-28.94%-19.99%
ES (1.86M)0.0354.55%-3.45%1.29%5.59%7.92%6.57%9.24%
DE (1.49M)0.0348.30%-7.86%-1.83%-8.26%-1.71%2.57%8.97%
PT (1.45M)0.0710.96%-6.60%-4.22%1.85%1.21%3.78%3.22%
FR (1.12M)0.0366.86%-3.69%3.03%6.49%6.37%9.02%12.43%
SV (590K)0.0328.32%0.51%5.15%13.05%16.51%13.05%20.88%
IT (589K)0.0363.62%-5.04%-2.34%16.30%18.57%17.24%18.57%
JA (582K)0.031-7.35%-5.89%-0.44%-8.20%-5.66%-6.38%-3.90%
NL (510K)0.0326.70%-0.42%3.59%8.80%8.42%8.80%11.14%
RU (413K)0.02512.32%4.10%11.63%18.45%18.14%18.72%21.95%
FI (308K)0.0189.76%-0.18%6.56%16.82%17.35%18.49%19.59%
DA (301K)0.03211.47%5.11%11.10%22.31%23.54%22.31%28.41%
RO (250K)0.0309.19%7.12%2.51%12.83%16.57%17.83%21.35%
TR (173K)0.0630.63%1.03%8.95%35.51%40.30%39.31%40.30%
PL (136K)0.0284.50%-5.05%1.56%6.22%2.69%6.22%9.20%
Avg (All)0.0415.41%-6.90%-2.94%1.71%4.86%5.37%9.30%
Avg (w/o EN)1.0414.83%-1.90%2.81%11.08%12.80%13.36%16.12%
Avg (Bottom10)2.0414.84%-1.19%3.67%13.08%15.49%15.76%18.86%
+ +Figure 4: Relevance metrics across 15 languages. (Model description in Sec 4 and discussion in Sec 4.3) + +the mixture components, which can be further boosted by explicit mapping of latent vectors to languages. Language mapping improves the relevance to $14.6\%$ (line 10) over the baseline. We also see a slight boost in diversity showing the improved modeling of the multi-lingual distribution using this approach. + +Posterior conditioned on both message and response: The joint conditioning of the posterior with both the $\Theta_{M},\Theta_{R}$ vectors gives the best relevance for both CGM and CGM-M (lines 6, 11) with CGM-M exceeding all other variants. More interesting is the substantial improvement in diversity $(80\%)$ , which illustrates that it encourages a richer representation in the prior by perhaps disentangling latent intents and language characteristics better. We note here that, in CGM-M, using the full $\Theta_{R}$ dimension (768) led to high level of leakage through the posterior (multiple components of the mixture further aids the leakage). We use a low dimensional projection of size 16 in CGM-M to mitigate the issue. + +# 4.3 Analysis across Languages Groups + +Next, we discuss the performance breakdown of models across individual languages. Figure 4 expands the Relevance metrics from Figure 2 for all languages. As before, we use the Matching-Mono as the baseline, and list the $\%$ changes over this baseline for each model and language. + +We see that, all jointly trained variants (Uni and Mono*) have severe under fitting for EN. In fact if we simply remove EN from the metrics the CGM variants vastly improve upon the monolingual versions. With almost two orders of magnitude more + +data in EN (49M), it remains challenging to have good performance simultaneously for EN and other languages without additional tricks. In general the improvements are less for the top 5 high-resource languages which can be attributed to lesser impact from information sharing and lower exposure of these languages due to uniform sampling. Such issues have been reported in prior literature as capacity dilution (Johnson et al., 2017; Conneau et al., 2020; Wang et al., 2020a) where there is always a trade-off between low and high resource languages. CGM while not completely eliminating it, largely mitigates the issue. + +The impact of CGM with joint training is more pronounced for the bottom 10 language group. For example we see $15.49\%$ improvement for CGMM compared to only $3.67\%$ for MCVAE-Uni. Finally, we see improvements of $15.76\%$ for CGMMono* and $18.86\%$ for CGM-M Mono* models, illustrating that even if we target mono-lingual models, CGM can take advantage of shared learning through joint training while saving compute. + +The improvements for low resource languages, show that CGM is more data efficient due to model enhancements, while the prevention of regressions for high resource languages show a more balanced learning through training optimizations. The fact that these relevance improvements come in addition to $80\%$ improvements in diversity, shows the remarkable effectiveness of CGM to represent the multi-modal landscape of multi-lingual RS. + +# 5 Related Work + +VAEs have been used in retrieval based Q&A (Yu et al., 2020), document matching (Chaidaroon and Fang, 2017), and recommendations (Chen and + +de Rijke, 2018). CGM for RS is most closely related to MCVAE (Deb et al., 2019) but differs in the expressive conditional priors, multi-component mixture density priors, language alignment, and training optimizations which makes it effective in a multi-lingual setting. + +For multi-task scenarios, VAEs can offer significant modeling efficiencies (Cao and Yogatama, 2020; Rao et al., 2019) with additional improvements through mixture model priors, e.g. in (Dilokthanakul et al., 2017; Yang et al., 2019) for unsupervised clustering, in (Lee et al., 2021) for unsupervised meta-learning, and in (Shi et al., 2019) as a multi-modal variational mixture-of-experts. + +VAEs can also improve multilingual representation for low resource languages, e.g. in models like BERT (Li et al., 2020), in (Wei and Deng, 2017) for document classification, in (Chorowski et al., 2019) for disentangling phonemes for speech synthesis, and in (Zhang et al., 2016; Eikema and Aziz, 2019) for neural machine translation. VAEs can improve diversity in language generation and retrieval tasks (Zhao et al., 2017; Tran et al., 2017; Shen et al., 2017; Deb et al., 2019) through better modeling efficiencies. Such results motivated us to apply VAEs for multilingual RS. + +We may also consider alternative to VAEs such as training auxiliary tasks with adapters (Houlsby et al., 2019), adversarial learning (Chen et al., 2018, 2019; Huang et al., 2019), and mixing pre-training and fine-tuning (Phang et al., 2020) to improve modeling in multilingual setting. This is subject of future work. We also plan to experiment with higher capacity multilingual encoders such XLM-R (Lample and Conneau, 2019) and InfoXLM (Chi et al., 2021) to further improve the performance. However, the choice of the base encoder is orthogonal to the improvements (especially on diversification) shown in this paper. + +As noted in prior work, multilingual training can have capacity dilution issues (Johnson et al., 2017; Conneau et al., 2020; Wang et al., 2020a). Overall, multilingual models are closing the gap with monolingual counterparts for wide range of tasks (Ying et al., 2021; Ranasinghe and Zampieri, 2020; Yang et al., 2020), and as shown in this paper, even surpass them. Careful sampling strategies, and techniques such as Translation Language Model (TLM) can alleviate the "curse of multilinguality" (Lample and Conneau, 2019) but we show improvements without additional data augmentation (translation + +pairs), and with simple uniform sampling. + +# 6 Conclusions + +In this paper we present a conditional generative Matching model (CGM) for retrieval based suggested replies. CGM not only provides relevance gains $(15\%)$ , but also substantial improvements in diversity $(80\%)$ . While CGM clearly advances the state of art for modeling multi-lingual RS systems, it also illustrates that through proper model choices and training optimizations, we can surpass and replace monolingual models. This is important for both industry and academia and suggests similar strategies to be applied across diverse tasks. This is subject of future work. + +# References + +Jason Baumgartner, Savvas Zannettou, Brian Keegan, Megan Squire, and Jeremy Blackburn. 2020. The pushshift reddit dataset. In Proceedings of the international AAAI conference on web and social media, volume 14, pages 830-839. +Samuel R. Bowman, Luke Vilnis, Oriol Vinyals, Andrew M. Dai, Rafal Jozefowicz, and Samy Bengio. 2016. Generating sentences from a continuous space. In CoNLL. +Yuri Burda, Roger Grosse, and Ruslan Salakhutdinov. 2016. Importance weighted autoencoders. In ICLR. +Kris Cao and Dani Yogatama. 2020. Modelling latent skills for multitask language generation. arXiv preprint arXiv:2002.09543. +Asli Celikyilmaz, Elizabeth Clark, and Jianfeng Gao. 2020. Evaluation of text generation: A survey. arXiv preprint arXiv:2006.14799. +Suthee Chaidaroon and Yi Fang. 2017. Variational deep semantic hashing for text documents. In Proceedings of the 40th International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 75-84. +Xilun Chen, Ahmed Hassan, Hany Hassan, Wei Wang, and Claire Cardie. 2019. Multi-source cross-lingual model transfer: Learning what to share. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3098-3112. +Xilun Chen, Yu Sun, Ben Athiwaratkun, Claire Cardie, and Kilian Weinberger. 2018. Adversarial deep averaging networks for cross-lingual sentiment classification. Transactions of the Association for Computational Linguistics, 6:557-570. +Yifan Chen and Maarten de Rijke. 2018. A collective variational autoencoder for top-n recommendation with side information. In Proceedings of the + +3rd Workshop on Deep Learning for Recommender Systems, pages 3-9. +Zewen Chi, Li Dong, Furu Wei, Nan Yang, Saksham Singhal, Wenhui Wang, Xia Song, Xian-Ling Mao, He-Yan Huang, and Ming Zhou. 2021. Infoxlm: An information-theoretic framework for cross-lingual language model pre-training. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 3576-3588. +Jan Chorowski, Ron J. Weiss, Samy Bengio, and Aaron van den Oord. 2019. Unsupervised speech representation learning using wavenet autoencoders. In IEEE/ACM Transactions on Audio, Speech, and Language Processing. +R. Cipolla, Y. Gal, and A. Kendall. 2018. Multi-task learning using uncertainty to weigh losses for scene geometry and semantics. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 7482-7491. +Alexis Conneau, Kartikay Khandelwal, Naman Goyal, Vishrav Chaudhary, Guillaume Wenzek, Francisco Guzmán, Edouard Grave, Myle Ott, Luke Zettlemoyer, and Veselin Stoyanov. 2020. Unsupervised cross-lingual representation learning at scale. +Budhaditya Deb, P. Bailey, and M. Shokouhi. 2019. Diversifying reply suggestions using a matching-conditional variational autoencoder. In NAACL-HLT. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 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, Volume 1 (Long and Short Papers), pages 4171-4186. +Nat Dilokthanakul, Pedro A. M. Mediano, Marta Garnelo, Matthew C. H. Lee, Hugh Salimbeni, Kai Arulkumaran, and Murray Shanahan. 2017. Deep unsupervised clustering with gaussian mixture variational autoencoders. +Bryan Eikema and Wilker Aziz. 2019. Auto-encoding variational neural machine translation. In Proceedings of the 4th Workshop on Representation Learning for NLP (RepL4NLP-2019), pages 124–141, Florence, Italy. Association for Computational Linguistics. +Hao Fu, Chunyuan Li, Xiaodong Liu, Jianfeng Gao, Asli Celikyilmaz, and Lawrence Carin. 2019. Cyclic annealing schedule: A simple approach to mitigating KL vanishing. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 240-250, Minneapolis, Minnesota. Association for Computational Linguistics. + +Matthew Henderson, Rami Al-Rfou, Brian Strope, Yun-Hsuan Sung, László Lukács, Ruiqi Guo, Sanjiv Kumar, Balint Miklos, and Ray Kurzweil. 2017. Efficient natural language response suggestion for smart reply. arXiv preprint arXiv:1705.00652. +Matthew Henderson, Ivan Vulic, Daniela Gerz, Inigo Casanueva, Paweł Budzianowski, Sam Coope, Georgios Spithourakis, Tsung-Hsien Wen, Nikola Mrkšić, and Pei-Hao Su. 2019. Training neural response selection for task-oriented dialogue systems. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 5392-5404. +J. R. Hershey and P. A. Olsen. 2007. Approximating the kullback leibler divergence between gaussian mixture models. In 2007 IEEE International Conference on Acoustics, Speech and Signal Processing - ICASSP '07, volume 4, pages IV-317-IV-320. +Irina Higgins, Loic Matthew adnd Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. 2017. beta-vae: Learning basic visual concepts with a constrained variational framework. In ICLR. +Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin De Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. 2019. Parameter-efficient transfer learning for NLP. In Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 2790-2799. PMLR. +Lifu Huang, Heng Ji, and Jonathan May. 2019. Crosslingual multi-level adversarial transfer to enhance low-resource name tagging. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 3823-3833. +Eric Jang, Shixiang Gu, and Ben Poole. 2017. Categorical reparameterization with gumbel-softmax. In ICLR. +Melvin Johnson, Mike Schuster, Quoc V Le, Maxim Krikun, Yonghui Wu, Zhifeng Chen, Nikhil Thorat, Fernanda Viégas, Martin Wattenberg, Greg Corrado, et al. 2017. Google's multilingual neural machine translation system: Enabling zero-shot translation. Transactions of the Association for Computational Linguistics, 5:339-351. +Armand Joulin, Edouard Grave, Piotr Bojanowski, Matthijs Douze, Herve Jégou, and Tomas Mikolov. 2016. FastText.zip: Compressing text classification models. arXiv preprint arXiv:1612.03651. +Anjuli Kannan, Karol Kurach, Sujith Ravi, Tobias Kaufmann, Andrew Tomkins, Balint Miklos, Gregory S. Corrado, Laszlo Lukacs, Marina Ganea, Peter Young, and Vivek Ramavajjala. 2016. Smart Reply: Automated Response Suggestion for Email. In KDD. + +Diederik P. Kingma and Max Welling. 2014. Auto-Encoding Variational Bayes. ICLR. +Guillaume Lample and Alexis Conneau. 2019. Crosslingual language model pretraining. arXiv preprint arXiv:1901.07291. +Dong Bok Lee, Dongchan Min, Seanie Lee, and Sung Ju Hwang. 2021. Meta-gmvae: Mixture of gaussian vae for unsupervised meta-learning. In ICLR. +Jaejun Lee, Raphael Tang, and Jimmy Lin. 2019. What would elsa do? freezing layers during transformer fine-tuning. arXiv preprint arXiv:1911.03090. +Chunyuan Li, Xiang Gao, Yuan Li, Xiujun Li, Baolin Peng, Yizhe Zhang, and Jianfeng Gao. 2020. Optimus: Organizing sentences via pre-trained modeling of a latent space. +Chin-Yew Lin. 2004. ROUGE: A package for automatic evaluation of summaries. In Text Summarization Branches Out, pages 74-81, Barcelona, Spain. Association for Computational Linguistics. +T. Lin, P. Goyal, R. Girshick, K. He, and P. Dollar. 2020. Focal loss for dense object detection. IEEE Transactions on Pattern Analysis and Machine Intelligence, 42(2):318-327. +Matthew E Peters, Sebastian Ruder, and Noah A Smith. 2019. To tune or not to tune? adapting pretrained representations to diverse tasks. In Proceedings of the 4th Workshop on Representation Learning for NLP (RepL4NLP-2019), pages 7-14. +Jason Phang, Iacer Calixto, Phu Mon Htut, Yada Pruksachatkun, Haokun Liu, Clara Vania, Katharina Kann, and Samuel Bowman. 2020. English intermediate-task training improves zero-shot crosslingual transfer too. In Proceedings of the 1st Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 10th International Joint Conference on Natural Language Processing, pages 557-575. +Tharindu Ranasinghe and Marcos Zampieri. 2020. Multilingual offensive language identification with cross-lingual embeddings. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 5838-5844. +Dushyant Rao, Francesco Visin, Andrei A. Rush, Yee Whye Teh, Razvan Pascanu, and Raia Hadsell. 2019. Continual unsupervised representation learning. In NeurIPS. +Lifeng Shang, Zhengdong Lu, and Hang Li. 2015. Neural responding machine for short-text conversation. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 1577-1586. + +Xiaoyu Shen, Hui Su, Yanran Li, Wenjie Li, Shuzi Niu, Yang Zhao, Akiko Aizawa, and Guoping Long. 2017. A Conditional Variational Framework for Dialog Generation. In ACL. +Yuge Shi, Siddharth N ad Brooks Paige, and Philip Torr. 2019. Variational mixture-of-experts autoencoders for multi-modal deep generative models. In NeurIPS. +Kyle Swanson, Lili Yu, Christopher Fox, Jeremy Wohlwend, and Tao Lei. 2019. Building a production model for retrieval-based chatbots. In Proceedings of the First Workshop on NLP for Conversational AI, pages 32-41, Florence, Italy. Association for Computational Linguistics. +Quan Hung Tran, Gholamreza Haffari, and Ingrid Zukerman. 2017. A Generative Attentional Neural Network Model for Dialogue Act Classification. In ACL. +Zirui Wang, Zachary C Lipton, and Yulia Tsvetkov. 2020a. On negative interference in multilingual language models. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4438-4450. +Zirui Wang, Yulia Tsvetkov, Orhan First, and Yuan Cao. 2020b. Gradient vaccine: Investigating and improving multi-task optimization in massively multilingual models. In ICLR. +Liangchen Wei and Zhi-Hong Deng. 2017. A variational autoencoding approach for inducing crosslingual word embeddings. In *IJCAI*. +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz, Joe Davison, Sam Shleifer, Patrick von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lhoest, and Alexander M. Rush. 2020. Transformers: State-of-the-art natural language processing. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 38-45, Online. Association for Computational Linguistics. +Linxiao Yang, Ngai-Man Cheung, Jiaying Li, and Jun Fang. 2019. Deep clustering by gaussian mixture variational autoencoders with graph embedding. In ICCV. +Yinfei Yang, Daniel Cer, Amin Ahmad, Mandy Guo, Jax Law, Noah Constant, Gustavo Hernandez Abrego, Steve Yuan, Chris Tar, Yun-Hsuan Sung, Brian Strope, and Ray Kurzweil. 2020. Multilingual universal sentence encoder for semantic retrieval. In ACL. +Qianlan Ying, Payal Bajaj, Budhaditya Deb, Yu Yang, Wei Wang, Bojia Lin, Milad Shokouhi, Xia Song, Yang Yang, and Daxin Jiang. 2021. Language scaling for universal suggested replies model. In NAACL-HLT, Industrial Track. + +Wenhao Yu, Lingfei Wu, Qingkai Zeng, Shu Tao, Yu Deng, and Meng Jiang. 2020. Crossing variational autoencoders for answer retrieval. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5635-5641, Online. Association for Computational Linguistics. + +Biao Zhang, Deyi Xiong, Jinsong Su, Hong Duan, and Min Zhang. 2016. Variational neural machine translation. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 521-530. + +Mozhi Zhang, Wei Wang, Budhaditya Deb, Guoqing Zheng, Milad Shokouhi, and Ahmed Hassan Awadallah. 2021. A dataset and baselines for multilingual reply suggestion. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 1207-1220, Online. Association for Computational Linguistics. + +Tiancheng Zhao, Ran Zhao, and Maxine Eskenazi. 2017. Learning Discourse-level Diversity for Neural Dialog Models using Conditional Variational Autoencoders. In ACL. + +Xiangyang Zhou, Daxiang Dong, Hua Wu, Shiqi Zhao, Dianhai Yu, Hao Tian, Xuan Liu, and Rui Yan. 2016. Multi-view response selection for human-computer conversation. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 372-381, Austin, Texas. Association for Computational Linguistics. + +Xiangyang Zhou, Lu Li, Daxiang Dong, Yi Liu, Ying Chen, Wayne Xin Zhao, Dianhai Yu, and Hua Wu. 2018. Multi-turn response selection for chatbots with deep attention matching network. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1118-1127, Melbourne, Australia. Association for Computational Linguistics. + +# A Text Samples from Model Predictions + +# A.1 Relevance and Diversity + +We created sample messages in EN manually, and predict the responses from different models: Matching in Figure 5, CGM in Figure 6 and CGM-M in Figure 7. + +We see that in terms of relevance while it is hard to notice the differences on such a small sample, overall the predictions from the Matching model are less relevant than CGM. However, we can clearly distinguish the diversity of responses: predictions from Matching have a high level of duplicates where some of the responses differ by just a punctuation. While this can be easily de-duplicated + +using simple heuristics, the results show that inherently the Matching model ranks very similar responses at the top. The CGM models in contrast, show a lot of diversity in responses without reducing the relevance of the responses. + +We also see that some of the responses are quite specific and not relevant, with some responses being rude or mildly inappropriate. It shows the issues with using responses from the Reddit dataset without careful curation (the MRS dataset does clean up for inappropriate responses but cannot completely eliminate them without human curation). Production systems usually have human curated response sets which can tackle these issues. + +# A.2 Multi-lingual Behavior + +Next we look at the multilingual ability of CGM. We translate the same set of messages used for EN for predicting responses, so as to have better comparative understanding of the quality different languages. + +We present the predictions for ES in Fig. 8 and JA in Fig. 9. We see that the responses are relevant and diverse in these languages and thus CGM performs adequately in languages other than EN. + +# A.3 Cross-lingual Behavior + +Finally we investigate the cross lingual nature of the CGM model, in order to understand if the multilingual models share representations and learnings across languages. + +In Figure 10 we use EN messages and force the model to predict responses from the ES set. Surprisingly such a system is able to select relevant results in the target language. While the quality here is not as good, but it is interesting to see that such cross lingual prediction works quite well. + +In Figure 11 we use messages in German and predict with English responses. Again the results are quite acceptable. This may be expected as English and German are closely related languages. To see slightly different pairs of languages, we look at Japanese messages with predictions in English in Figure 12. Here the quality is actually much worse, but we still see some match with the overall intent of the messages showing good cross lingual representation even for weakly related languages. + +
MessagesMatching-1Matching-2Matching-3
Good morning! How was last night's party? Had fun?It was great!It was funIt was awesome!
Did you see the new movie? It was really funny! Wish we saw it togetherIt was awesome!What movie is it?Which movie?
Please have a look and review. Its the latest update I in put last night.Thanks for the update!Thanks for the update.Thank you for the update!
I am not feeling very well. Will try to get some sleep.Sleep is for the weakHope you feel better soon.Hope you feel better soon!
I have solved the issue with out of memory. That was some bug!What bug?It's not a bug, it's a feature!How did you solve it?
It is so nice outside! I think will go fishing in the lake today.I'll be there too!Awesome! Good luck!Good luck tomorrow!!
Did you hear the latest album. Its simply awesome, blown away!!!What album?Great albumThe project was famous. good sales program, congratulations!
Stunning win today, what a goal!! He is a genius :DHe really is!He really isHe really is.
The new netflix show, just watch the 1st season. Rest is not too goodWhat series?What show is it?What show?
Did you know that tomato is fruit, not a vegetable? I don't really careWhat is a potato?I can't believe it's not butterWhat's a potato?
I am soo looking forward to the holiday! I am planning to take a few days off in July.Good luck tomorrow!!Good luck tomorrow!Good luck tomorrow.
Augmented Reality is so awesome! I filled my room with virtual confetti!Project updates continuously, team work actively. congratulations!Project updates continuously, team work actively. congratulations!Congrats to you as well!
A new bookshop opened down the road. I plan to go there for a reading.What book?What bookWhich book?
It was pretty shocking what happened. It was all over the news. Had nightmaresI'm glad I wasn't the only one.Glad I wasn't the only one.Glad I wasn't the only one
Forrest Gump has an amazing soundtrack. Been listening to since childhood, and see it in new light as i grow up.I love it too!Love it too.What song is it?
I am pretty bored these days. Need a new vocation.What career?What do you want to do?What field are you in?
The new wired article is pretty revealing about corporate politicsWhat article?Could you keep it down please? This is a public forum.What section?
Christmas has come early. Enjoy while it lasts!Thanks! Good luck to you too!Congrats to you too!Congrats to you!
Did some slow roasting in the oven yesterday. The stuff came out pretty tender and juicy.How did it taste?What did it taste like?What size did you get?
+ +Figure 5: Some samples of English message predicted with English replies using the Matching Model. The replies marked in red shows the duplicate responses. + +
MessagesCGM-1CGM-2CGM-3
Good morning! How was last night's party? Had fun?It was deliciousToday was a good dayWas great!
Did you see the new movie? It was really funny! Wish we saw it togetherI'd love to see it!No I didn't.No, it was Ex Machina
Please have a look and review. Its the latest update I in put last night.I think it looks great!I don't see anything I need. +Sorry.What's the app?
I am not feeling very well. Will try to get some sleep.SleepSleep is for the weakHope you are too.
I have solved the issue with out of memory. That was some bug!Happened to me tooThanks! It worked!Where did you find it?
It is so nice outside! I think will go fishing in the lake today.Do you like fish sticks?There's always a bigger fish.I think it looks great!
Did you hear the latest album. Its simply awesome, blown away!!!Glad you think so!What are you listening to?Great album
Stunning win today, what a goal!! He is a genius :DGood for him!He's so good x4A surprise, to be sure, but a welcome one!
The new netflix show, just watch the 1st season. Rest is not too goodBreaking BadWhat series?What episode was this?
Did you know that tomato is fruit, not a vegetable? I dont really careNo I didn't.No, it is not.I'm vegan
I am soo looking forward to the holiday! I am planning to take a few days off in July.What's your budget?Mind if I check with you at 10 weeks?What year is this?
Augmented Reality is so awesome! I filled my room with virtual confetti!It really ties the room together.It was delicious!This will make a fine addition to my collection! (/r/GrievousCollection)
A new bookshop opened down the road. I plan to go there for a reading.This is libraryWhich store?Still open?
It was pretty shocking what happened. It was all over the news. Had nightmaresWhat news?I'm glad I wasn't the only one.What was so bad about it?
Forrest Gump has an amazing soundtrack. Been listening to since childhood, and see it in new light as i grow up.Lil PumpForrest GumpThanks for listening!
I am pretty bored these days. Need a new vocation.What field are you in?You need new friendsYou can do it! I believe in you!
The new wired article is pretty revealing about corporate politicsWhat shower thought has a source?Wallpaper?What kind of business?
Christmas has come early. Enjoy while it lasts!And to you!Better late than never!Thanks! Enjoy!
Did some slow roasting in the oven yesterday. The stuff came out pretty interesting.How much were they?How did it turn out?I'll try spinning, that's a good idea!
+ +Figure 6: Some samples of English message predicted with English replies using the CGM Model. + +
MessagesCGM-M-1CGM-M-2CGM-M-3
Good morning! How was last night's party? Had fun?It was okToday was a good dayPretty good!
Did you see the new movie? It was really funny! Wish we saw it togetherWe did!What movie is it?I saw it!
Please have a look and review. Its the latest update I in put last night.Done check your inbox :)Added an update to the OPWill do! Good luck!
I am not feeling very well. Will try to get some sleep.Have a good time!Sleep is for the weakI hope you feel better soon.
I have solved the issue with out of memory. That was some bug!I did the same thing!Thanks! It worked!Did you try it?
It is so nice outside! I think will go fishing in the lake today.We all float down here.Go fishSounds like a good time!
Did you hear the latest album. Its simply awesome, blown away!!!Thank you for checking it out!I heard it tooIt did!
Stunning win today, what a goal! He is a genius :DAbsolutely incredible!Goals!Thanks for playing!
The new netflix show, just watch the 1st season. Rest is not too goodWhat's the first?You get the show.I'd watch it
Did you know that tomato is fruit, not a vegetable? I dont really careIt's what plants crave.What is a potato?r/contagiouslaughter
I am soo looking forward to the holiday! I am planning to take a few days off in July.Hope to see you there!RemindMe! 3 weeksSounds like a good time!
Augmented Reality is so awesome! I filled my room with virtual confetti!How did you like it?So exciting!I really like it!
A new bookshop opened down the road. I plan to go there for a reading.What book is this?What are you reading?Way to go!
It was pretty shocking what happened. It was all over the news. Had nightmaresWhat news?What story?I'm sorry to hear that :(
Forrest Gump has an amazing soundtrack. Been listening to since childhood, and see it in new light as i grow up.Great albumI like it too.And I love it.
I am pretty bored these days. Need a new vocation.What do you want to do?We will watch your career with great interest!Teacher?
The new wired article is pretty revealing about corporate politicsSo business as usual?Facts are facts.The project has great potential success.
Christmas has come early. Enjoy while it lasts!I hope you're right!It never endsThanks, same to you!
Did some slow roasting in the oven yesterday. The stuff came out pretty tender and juicy.That's awesome to hear!It was delicious!How did it turn out?
+ +Figure 7: Some samples of English message predicted with English replies using the CGM-M Model. + +
MessageCGM-1CGM-2CGM-3
|Buenos días! ¿Cóme estuve la fiesta de anoche? ¿Te divertidas?Fui a ir de compras :)Muy bien.|Buenos días!
|Viste laewsuela? |Fue muy gracioso! Ojalalovimos+juntos.Estuve bien.|Me encanta especlula!Vi
|Bienvenido! Me alegra tenerte de vuelta en el trabajo.|Gracias por las amablespalabras!|Gracias! Te lo :)|Gracias! |le har:)
|Me voy de vacaciones! Necesitaba un descanso. Nosvemos en un par de semanas :-)Vacaciones|Impresionante! |Disfrutar!|Viajes seguros!
|Puede enviarme el enlace aldocumento? Parece que noencuentro el enlace.Imposible. Tal vez los archivos estanincompletos.Claro que puedes.|Si no lo he enviado,avsame!
No me siento muchien. Trataré de dormir un poco.Me alegro de no estar solo.|Depresión?Yo también lo siento.
El tráfico esbastante malo. Debería serothora, pero noestoy seguro.Siempre es soleado en Filadelfia|Qué te hace estar tan seguro?Ningún lugar es seguro.
He resuelto el problema con fauna de la memoria. |Eso fueun bicho!|Besaste atu madre con这么大oca?Hecho.. Reciprocate bikoNo es un error,esunacharacteristica.
|Es tan agradable afuera! Creo que hoy pescaré en el lago.Siempre hay un pezmás grande.|Especialmente más tardenel verano!Espero que también sea:)
|Oiste elultimatealbum? Es simplemente impressionante,impresionado!!!Por elmomento no, lo siento.Me alegra escucharlo!!|Ese es! |Muchasgracias!
Impresionante victoria hoy, ¡qué gol! Es un genio :DEspero que también sea:)Goles tbhAbsolutamente increlble
La neue série deNetflix,sole mira laprimera temporada.El descanso no esdemasiado buenaEsa es la mordaza de la temporada|De qué episodios esese?|Este buena?
Una newulibería abrió el camino. Planeir allípara unalectura.Voy a echarle un vistazoHecho por favor, vuelavolver a:)He estado alli,hechoeso.
Acabodeminiter supresentación a la conferencia, a lesespera de escuchar al revisor #2.Se ha superado la llamada deprueba. Comenzando la primeraetapa|Tiene un enlace?|Cuál fue su reacción?
Fue bastante impactante lo que pasó. Estaba en todas lasnoticias. Tuvo pesadillasDiferentes golpes para diferentespersonas.|Noticias - Fox#NAME?
Estoy bastante aburrido thesezlos días. Necesito unaueva VOCACION.Negociado,disfrutar!|Necesitas nuevos amigos.Aprendes algo nuevo todos los días
+ +Figure 8: Some samples of Spanish messages and predicted with Spanish replies using the CGM-M Model. + +
MessageCGM-1CGM-2CGM3
おはようご safelyお願いいたします!昨夜のバーニアはようお願いいたします。楽にしてた。きたとバーニアは乗ります。やらなかたくださいます。バーニアは乗りますと/swいむよ。
新鮮映画を見まいたします。それは本当に面白ったestrupに見た欲ります。私も同様にして。楽にしてた。知て良かいいただけます!感謝!
再びようお願い!仕事に resumesたようお願いいたします。COMNTを付けうようお願いいたします。聞てくLETのはんだいき*再び
ドキメトへのリンクを送て.Down。��はリンクを見APPINGこ上が能不能ようお願いいたします。リンクを手に接入いたします。リンクをクリックします。imgur
��はあまり気分かようお願いいたします。睡眠を取るうとります。睡眠は弱者的たけ夢を夢にentlyはいきせん!笑、%=う。
トラフィットは-Calle悪です。う1時間に再生能源はすすが、わかりまSEN。トラリフはガイです。イデトはまむなさ始まります。TSにご参加くださいます!長標準を。読みまSENにmitted
外はとてま素敵です!今日は湖で釣り行うと思ります。寒いです。アドバイスのつかけて、行ります!気に入て+kるといばすね!
最新アルバムを聞きましえったか?その単に素晴)=(1)、吹き飛ば)=(2)私の見た+(\1)は不定。心。吹き飛ばさ。私は生き残った!
新鮮Netflixシャーヤフは、まうと第1シャーニングを見ARDS。休息はままリ良(<2)SHINARAFILANTRAPSONSHIPPRAFLIBTOLIRAM無料2018年ONLANTRLEVを見る私はそのシャーが大好き!ネットFIリツスに載ったる?
何年起过的のstral衝撃のleted。那是BUNUSのんだとthisにiteit。恶夢を見た私也同じてを言うとこ標了。皆さん良好広語!事實は事実.cz
FFORISTGANPは素晴)=(1)、サウンドトロックを持てります。子供の頃から耳を傾け、私が成長するに)/(2)、新鮮光の中でそのを見て+(3)。FFORISTGANP私は、そのシャットを与える、%=う。*彼の
新鮮有線記事は、企業政治に)/(4)、企業政治に)/(5)、企業政治に)/(6)、企業政治に)/(7)、企業政治に)/(8)、企業政治に)/(9)、企業政治に)/(10)、企業政治に)/(11)、企業政治に)/(12)、企業政治に)/(13)、企業政治に)/(14)、企業政治に)/(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)、企業政治に)/(43)、企業政治に)/(44)、企業政治に)/(45)、企業政治に)/(46)、企業政治に)/(47)、企業政治に)/(48)、企業政治に)/(49)、企業政治に)/(50)、企業政治に)/(51)、企業政治に)/(52)、企業政治に)/(53)、企業政治に)/(54)、企業政治に)/(55)、企業政治に)/(56)、企業政治に)/(57)、企業政治に)/(58)、企業政治に)/(59)、企業政治に)/(60)、企業政治に)/(61)、企業政治に)/(62)、企業政治に)/(63)、企業政治に)/(64)、企業政治に)/(65)、企業政治に)/(66)、企業政治に)/(67)、企業政治に)/(68)、企業政治に)/(69)、企業政治に)/(70)、企業政治に)/(71)、企業政治に)/(72)、企業政治に)/(73)、企業政治に)/(74)、企業政治に)/(75)、企業政治に)/(76)、企業政治に)/(77)、企業政治に)/(78)、企業政治に)/(79)、企業政治に)/(80)、企業政治に)/(81)、企業政治に)/(82)、企業政治に)/(83)、企業政治に)/(84)、企業政治に)/(85)、企業政治に)/(86)、企業政治に)/(87)、企業政治に)/(88)、企業政治に)/(89)、企業政治に)/(90)、企業政治に)/(91)、企業政治に)/(92)、企業政治に)/(93)、企業政治に)/(94)、企業政治に)/(95)、企業政治に)/(96)、企業政治に)/(97)、企業政治に)/(98)、企業政治に)/(99)、企業政治に)/(100)、企業政治に)/(101)、企業政治に)/(102)、企業政治に)/(103)、企業政治に)/(104)、企業政治に)/(105)、企業政治に)/(106)、企業政治に)/(107)、企業政治に)/(108)、企業政治に)/(109)、企業政治に)/(110)、企業政治に)/(111)、企業政治に)/(112)、企業政治に)/(113)、企業政治に)/(114)、企業政治に)/(115)、企業政治に)/(116)、企業政治に)/(117)、企業政治に)/(118)、企業政治に)/(119)、企業政治に)/(120)、企業政治に)/(121)、企業政治に)/(122)、企業政治に)/(123)、企業政治に)/(124)、企業政治に)/(125)、企業政治に)/(126)、企業政治に)/(127)、企業政治に)/(128)、企業政治に)/(129)、企業政治に)/(130)、企業政治に)/(131)、企業政治に)/(132)、企業政治に)/(133)、企業政治に)/(134)、企業政治に)/(135)、企業政治に)/(136)、企業政治に)/(137)、企業政治に)/(138)、企業政治に)/(139)、企業政治に)/(140)、企業政治に)/(141)、企業政治に)/(142)、企業政治に)/(143)、企業政治に)/(144)、企業政治に)/(145)、企業政治に)/(146)、企業政治に)/(147)、企業政治に)/(148)、企業政治に)/(149)、企業政治に)/(150)、企業政治に)/(151)、企業政治に)/(152)、企業政治に)/(153)、企業政治に)/(154)、企業政治に)/(155)、企業政治に)/(156)、企業政治に)/(157)、企業政治に)/(158)、企業政治に)/(159)、企業政治に)/(160)、企業政治に)/(161)、企業政治に)/(162)、企業政治に)/(163)、企業政治に)/(164)、企業政治に)/(165)、企業政治に)/(166)、企業政治に)/(167)、企業政治に)/(168)、企業政治に)/(169)、企業政治に)/(170)、企業政治に)/(171)、企業政治に)/(172)、企業政治に)/(173)、企業政治に)/(174)、企業政治に)/(175)、企業政治に)/(176)、企業政治に)/(177)、企業政治に)/(178)、企業政治に)/(179)、企業政治に)/(180)、企業政治に)/(181)、企業政治に)/(182)、企業政治に)/(183)、企業政治に)/(184)、企業政治に)/(185)、企業政治に)/(186)、企業政治に)/(187)、企業政治に)/(188)、企業政治に)/(189)、企業政治に)/(190)、企業政治に)/(191)、企業政治に)/(192)、企業政治に)/(193)、企業政治に)/(194)、企業政治に)/(195)、企業政治に)/(196)、企業政治に)/(197)、企業政治に)/(198)、企業政治に)/(199)、企業政治に)/(200)、企業政治に)/(201)、企業政治に)/(202)、企業政治に)/(203)、企業政治に)/(204)、企業政治に)/(205)、企業政治に)/(206)、企業政治に)/(207)、企業政治に)/(208)、企業政治に)/(209)、企業政治に)/(210)、企業政治に)/(211)、企業政治に)/(212)、企業政治に)/(213)、企業政治に)/(214)、企業政治に)/(215)、企業政治に)/(216)、企業政治に)/(217)、企業政治に)/(218)、企業政治に)/(219)、企業政治に)/(220)、企業政治に)/(221)、企業政治に)/(222)、企業政治に)/(223)、企業政治に)/(224)、企業政治に)/(225)、企業政治に)/(226)、企業政治に)/(227)、企業政治に)/(228)、企業政治に)/(229)、企業政治に)/(230)、企業政治に)/(231)、企業政治に)/(232)、企業政治に)/(233)、企業政治に)/(234)、企業政治に)/(235)、企業政治に)/(236)、企業政治に)/(237)、企業政治に)/(238)、企業政治に)/(239)、企業政治に)/(240)、企業政治に)/(241)、企業政治に)/(242)、企業政治に)/(243)、企業政治に)/(244)、企業政治に)/(245)、企業政治に)/(246)、企業政治に)/(247)、企業政治に)/(248)、企業政治に)/(249)、企業政治に)/(250)、企業政治に)/(251)、企業政治に)/(252)、企業政治に)/(253)、企業政治に)/(254)、企業政治に)/(255)、企業政治に)/(256)、企業政治に)/(257)、企業政治に)/(258)、企業政治に)/(259)、企業政治に)/(260)、企業政治に)/(261)、企業政治に)/(262)、企業政治に)/(263)、企業政治に)/(264)、企業政治に)/(265)、企業政治に)/(266)、企業政治に)/(267)、企業政治に)/(268)、企業政治に)/(269)、企業政治に)/(270)、企業政治に)/(271)、企業政治に)/(272)、企業政治に)/(273)、企業政治に)/(274)、企業政治に)/(275)、企業政治に)/(276)、企業政治に)/(277)、企業政治に)/(278)、企業政治に)/(279)、企業政治に)/(280)、企業政治に)/(281)、企業政治に)/(282)、企業政治に)/(283)、企業政治に)/(284)、企業政治に)/(285)、企業政治に)/(286)、企業政治に)/(287)、企業政治に)/(288)、企業政治に)/(289)、企業政治に)/(290)、企業政治に)/(291)、企業政治に)/(292)、企業政治に)/(293)、企業政治に)/(294)、企業政治に)/(295)、企業政治に)/(296)、企業政治に)/(297)、企業政治に)/(298)、企業政治に)/(299)、企業政治に)/(300)、企業政治に)/(301)、企業政治に)/(302)、企業政治に)/(303)、企業政治に)/(304)、企業政治に)/(305)、企業政治に)/(306)、企業政治に)/(307)、企業政治に)/(308)、企業政治に)/(309)、企業政治に)/(310)、企業政治に)/(311)、企業政治に)/(312)、企業政治に)/(313)、企業政治に)/(314)、企業政治に)/(315)、企業政治に)/(316)、企業政治に)/(317)、企業政治に)/(318)、企業政治に)/(319)、企業政治に)/(320)、企業政治に)/(321)、企業政治に)/(322)、企業政治に)/(323)、企業政治に)/(324)、企業政治に)/(325)、企業政治に)/(326)、企業政治に)/(327)、企業政治に)/(328)、企業政治に)/(329)、企業政治に)/(330)、企業政治に)/(331)、企業政治に)/(332)、企業政治に)/(333)、企業政治に)/(334)、企業政治に)/(335)、企業政治に)/(336)、企業政治に)/(337)、企業政治に)/(338)、企業政治に)/(339)、企業政治に)/(340)、企業政治に)/(341)、企業政治に)/(342)、企業政治に)/(343)、企業政治に)/(344)、企業政治に)/(345)、企業政治に)/(346)、企業政治に)/(347)、企業政治に)/(348)、企業政治に)/(349)、企業政治に)/(350)、企業政治に)/(351)、企業政治に)/(352)、企業政治に)/(353)、企業政治に)/(354)、企業政治に)/(355)、企業政治に)/(356)、企業政治に)/(357)、企業政治に)/(358)、企業政治に)/(359)、企業政治に)/(360)、企業政治に)/(361)、企業政治に)/(362)、企業政治に)/(363)、企業政治に)/(364)、企業政治に)/(365)、企業政治に)/(366)、企業政治に)/(367)、企業政治に)/(368)、企業政治に)/(369)、企業政治に)/(370)、企業政治に)/(371)、企業政治に)/(372)、企業政治に)/(373)、企業政治に)/(374)、企業政治に)/(375)、企業政治に)/(376)、企業政治に)/(377)、企業政治に)/(378)、企業政治に)/(379)、企業政治に)/(380)、企業政治に)/(381)、企業政治に)/(382)、企業政治に)/(383)、企業政治に)/(384)、企業政治に)/(385)、企業政治に)/(386)、企業政治に)/(387)、企業政治に)/(388)、企業政治に)/(389)、企業政治に)/(390)、企業政治に)/(391)、企業政治に)/(392)、企業政治に)/(393)、企業政治に)/(394)、企業政治に)/(395)、企業政治に)/(396)、企業政治に)/(397)、企業政治に)/(398)、企業政治に)/(399)、企業政治に)/(400)、企業政治に)/(401)、企業政治に)/(402)、企業政治に)/(403)、企業政治に)/(404)、企業政治に)/(405)、企業政治に)/(406)、企業政治に)/(407)、企業政治に)/(408)、企業政治に)/(409)、企業政治に)/(410)、企業政治に)/(411)、企業政治に)/(412)、企業政治に)/(413)、企業政治に)/(414)、企業政治に)/(415)、企業政治に)/(416)、企業政治に)/(417)、企業政治に)/(418)、企業政治に)/(419)、企業政治に)/(420)、企業政治に)/(421)、企業政治に)/(422)、企業政治に)/(423)、企業政治に)/(424)、企業政治に)/(425)、企業政治に)/(426)、企業政治に)/(427)、企業政治に)/(428)、企業政治に)/(429)、企業政治に)/(430)、企業政治に)/(431)、企業政治に)/(432)、企業政治に)/(433)、企業政治に)/(434)、企業政治に)/(435)、企業政治に)/(436)、企業政治に)/(437)、企業政治に)/(438)、企業政治に)/(439)、企業政治に)/(440)、企業政治に)/(441)、企業政治に)/(442)、企業政治に)/(443)、企業政治に)/(444)、企業政治に)/(445)、企業政治に)/(446)、企業政治に)/(447)、企業政治に)/(448)、企業政治に)/(449)、企業政治に)/(450)、企業政治に)/(451)、企業政治に)/(452)、企業政治に)/(453)、企業政治に)/(454)、企業政治に)/(455)、企業政治に)/(456)、企業政治に)/(457)、企業政治に)/(458)、企業政治に)/(459)、企業政治に)/(460)、企業政治に)/(461)、企業政治に)/(462)、企業政治に)/(463)、企業政治に)/(464)、企業政治に)/(465)、企業政治に)/(466)、企業政治に)/(467)、企業政治に)/(468)、企業政治に)/(469)、企業政治に)/(470)、企業政治に)/(471)、企業政治に)/(472)、企業政治に)/(473)、企業政治に)/(474)、企業政治に)/(475)、企業政治に)/(476)、企業政治に)/(477)、企業政治に)/(478)、企業政治に)/(479)、企業政治に)/(480)、企業政治に)/(481)、企業政治に)/(482)、企業政治に)/(483)、企業政治に)/(484)、企業政治に)/(485)、企業政治に)/(486)、企業政治に)/(487)、企業政治に)/(488)、企業政治に)/(489)、企業政治に)/(490)、企業政治に)/(491)、企業政治に)/(492)、企業政治に)/(493)、企業政治に)/(494)、企業政治に)/(495)、企業政治に)/(496)、企業政治に)/(497)、企業政治に)/(498)、企業政治に)/(499)、企業政治に)/(500)、企業政治に)/(501)、企業政治に)/(502)、企業政治に)/(503)、企業政治に)/(504)、企業政治に)/(505)、企業政治に)/(506)、企業政治に)/(507)、企業政治に)/(508)、企業政治に)/(509)、企業政治に)/(510)、企業政治に)/(511)、企業政治に)/(512)、企業政治に)/(513)、企業政治に)/(514)、企業政治に)/(515)、企業政治に)/(516)、企業政治に)/(517)、企業政治に)/(518)、企業政治に)/(519)、企業政治に)/(520)、企業政治に)/(521)、企業政治に)/(522)、企業政治に)/(523)、企業政治に)/(524)、企業政治に)/(525)、企業政治に)/(526)、企業政治に)/(527)、企業政治に)/(528)、企業政治に)/(529)、企業政治に)/(530)、企業政治に)/(531)、企業政治に)/(532)、企業政治に)/(533)、企業政治に)/(534)、企業政治に)/(535)、企業政治に)/(536)、企業政治に)/(537)、企業政治に)/(538)、企業政治に)/(539)、企業政治に)/(540)、企業政治に)/(541)、企業政治に)/(542)、企業政治に)/(543)、企業政治に)/(544)、企業政治に)/(545)、企業政治に)/(546)、企業政治に)/(547)、企業政治に)/(548)、企業政治に)/(549)、企業政治に)/(550)、企業政治に)/(551)、企業政治に)/(552)、企業政治に)/(553)、企業政治に)/(554)、企業政治に)/(555)、企業政治に)/(556)、企業政治に)/(557)、企業政治に)/(558)、企業政治に)/(559)、企業政治に)/(560)、企業政治に)/(561)、企業政治に)/(562)、企業政治に)/(563)、企業政治に)/(564)、企業政治に)/(565)、企業政治に)/(566)、企業政治に)/(567)、企業政治に)/(568)、企業政治に)/(569)、企業政治に)/(570)、企業政治に)/(571)、企業政治に)/(572)、企業政治に)/(573)、企業政治に)/(574)、企業政治に)/(575)、企業政治に)/(576)、企業政治に)/(577)、企業政治に)/(578)、企業政治に)/(579)、企業政治に)/(580)、企業政治に)/(581)、企業政治に)/(582)、企業政治に)/(583)、企業政治に)/(584)、企業政治に)/(585)、企業政治に)/(586)、企業政治に)/(587)、企業政治に)/(588)、企業政治に)/(589)、企業政治に)/(590)、企業政治に)/(591)、企業政治に)/(592)、企業政治に)/(593)、企業政治に)/(594)、企業政治に)/(595)、企業政治に)/(596)、企業政治に)/(597)、企業政治に)/(598)、企業政治に)/(599)、企業政治に)/(600)、企業政治に)/(601)、企業政治に)/(602)、企業政治に)/(603)、企業政治に)/(604)、企業政治に)/(605)、企業政治に)/(606)、企業政治に)/(607)、企業政治に)/(608)、企業政治に)/(609)、企業政治に)/(610)、企業政治に)/(611)、企業政治に)/(612)、企業政治に)/(613)、企業政治に)/(614)、企業政治に)/(615)、企業政治に)/(616)、企業政治に)/(617)、企業政治に)/(618)、企業政治に)/(619)、企業政治に)/(620)、企業政治に)/(621)、企業政治に)/(622)、企業政治に)/(623)、企業政治に)/(624)、企業政治に)/(625)、企業政治に)/(626)、企業政治に)/(627)、企業政治に)/(628)、企業政治に)/(629)、企業政治に)/(630)、企業政治に)/(631)、企業政治に)/(632)、企業政治に)/(633)、企業政治に)/(634)、企業政治に)/(635)、企業政治に)/(636)、企業政治に)/(637)、企業政治に)/(638)、企業政治に)/(639)、企業政治に)/(640)、企業政治に)/(641)、企業政治に)/(642)、企業政治に)/(643)、企業政治に)/(644)、企業政治に)/(645)、企業政治に)/(646)、企業政治に)/(647)、企業政治に)/(648)、企業政治に)/(649)、企業政治に)/(650)、企業政治に)/(651)、企業政治に)/(652)、企業政治に)/(653)、企業政治に)/(654)、企業政治に)/(655)、企業政治に)/(656)、企業政治に)/(657)、企業政治に)/(658)、企業政治に)/(659)、企業政治に)/(660)、企業政治に)/(661)、企業政治に)/(662)、企業政治に)/(663)、企業政治に)/(664)、企業政治に)/(665)、企業政治に)/(666)、企業政治に)/(667)、企業政治に)/(668)、企業政治に)/(669)、企業政治に)/(670)、企業政治に)/(671)、企業政治に)/(672)、企業政治に)/(673)、企業政治に)/(674)、企業政治に)/(675)、企業政治に)/(676)、企業政治に)/(677)、企業政治に)/(678)、企業政治に)/(679)、企業政治に)/(680)、企業政治に)/(681)、企業政治に)/(682)、企業政治に)/(683)、企業政治に)/(684)、企業政治に)/(685)、企業政治に)/(686)、企業政治に)/(687)、企業政治に)/(688)、企業政治に)/(689)、企業政治に)/(690)、企業政治に)/(691)、企業政治に)/(692)、企業政治に)/(693)、企業政治に)/(694)、企業政治に)/(695)、企業政治に)/(696)、企業政治に)/(697)、企業政治に)/(698)、企業政治に)/(700)
+ +Figure 9: Some samples of Japanese messages and predicted with Japanese replies using the CGM-M Model. + +
MessageCGM-1CGM-2CGM-3
Good morning! How was last night's party? Had fun?¿Cómo duermes por la noche?Sí, fueiBuenos días!
Did you see the new movie? It was really funny! Wish we saw it together.¿Por qué no se me occurrá?iLa mejor de las suertes para ti!iUno de nosotros!
Welcome back! Glad to have you back at work.iGracias! iGracias! iGracias!iGracias, buena suerte!iGracias por tu tiempo!
Can you send me the link to the document? I can seem to find the link.iYo también neceses to saberlo!Bien, ¡quieres partager un enlace porqué?iPor qué noDICES!
I am not feeling very well. Will try to get some sleep.iQué salvación!iMe能把DICAS!iPor qué estamos aquí? iSólo para satisfir?
The traffic is pretty bad. Should be another an hour, but not sure.iHay alguna posibiliad de que la pista se doble?iPor qué es un problema?iPor qué esta es una casa
I have solved the issue with out of memory. That was some bug!iEliminar! iEliminar! iEliminar!iQuizás los ARCHivos está incompletos?iHas hecho comprobar tu bandeja de entrada ):
It is so nice outside! I think will go fishing in the lake today.iMucho espacio paraactividades!iCómo duermes por la noche?Hasta luigo yDICAS por todos los peces.
Did you hear the latest album. Its simply awesome, blown away!!!iQué salvación!iBuenos días!iMe alegro de oírlo, DICAS!
Stunning win today, what a goal!! He is a genius :DiSuficientemente buena para mí!iEs un hombre increible!iLos jugadores se levantan!
The new netflix show, just watch the 1st season. Rest is not too goodiQué salvación!iPor qué no los 3?iMe gusta mucho!
A new bookshop opened down the road. I plan to go there for a reading.Tienesmuch que hacer sobre esta Ciudad, carío.iQué libro es este?iCuál es tu direccion?
It was pretty shocking what happened. It was all over the news. Had nightmaresNuestras vidas comienzan a terminar el día en que nos quedenamos callados sobre las cosas que importan.iQuéDICAS?iUno de nosotros!
Forrest Gump has an amazing soundtrack. Been listening to since childhood, and see it in new light as i grow up.iQué tipo de música te gusta?iUno de nosotros!iLa mejor de las suertes para ti!
I am pretty bored these days. Need a new vocation.iQué es lo mejor que ser genial?iQué es lo que queres?iCuál es tu especialidad?
The new wired article is pretty revealing about corporate politicsiAsí que losNegocios como siempre?iGracias porlerle!Sus ideas son intrigantes para mi ydeo scombírase a su boletín de notices.
+ +Figure 10: Some samples of English messages and predicted with Spanish replies using the CGM-M Model. While the quality is not as good as when the input message is in Spanish, the general close match of intents of the message and responses illustrates the cross lingual ability of the model. + +
MessageCG-1CGM-2CGM-3
Guten Morgen! Wie war die Party gestern Abend? Hatten Sie Spaß?Really good.Today was a good dayIt was ok
Haben Sie den neuen Film gesehen? Es war wirklich lustig! Wunsch, dass wir es zusammen gesehen habenThis film is older.Yes I did!It was awesome!
Willkommen zusück! Froh, Sie wieder bei der Arbeit zu haben.Thank you. (:You're back!Thanks, same to you!
Kommen Sie mir den Link zum Dokument zusenden? Ich kann den Link nicht finden.Video is up on this sub!you can edit since I gave new infoInfowars.com
Mir Goes es nicht sehr gut. Wird versuchen, etwas Schlaf zu besteht.Freudian slipTry it!Courage
Der Verkehr ist ziemlich schlecht. Sollte eine weitere Stunde sein, aber nicht sicher.Even a broken clock is right twice a day.What time zone are you in?Gotta go fast!
Ich habe das Problem mit unzusamten gelöst. Das war ein Fehler!Not a problem!You're not my supervisor!Thank you for your service!
Es ist so schon drauß! Ich denke, ich wurde heute im See angeln geben.To the moon!You will!Go fish.
Hast du das neue Album gehört? Es ist einfach genial, wegbeblasen!!!r/fakealbumcoversIt really was!What was the original?
Attemberaubende Sieg heute, was für ein Ziel!! Er ist ein Genie :DHe really does!He deserves it.Thanks for playing!
Die neue Netflix-Show, schauen Sie sich einfach die 1. Staffel an. Ruhe ist nicht zu gutWhat series?Season 2I'd watch it.
Eine neue Buchhandlung wurde eröffnet. Ich habe vor, Dort für eine Lesung zu geben.What book is this?I want to go to there.Where was it?
Es war ziemlich schockierend, was passiert ist. Es war alles über die Nachrichten. Hatte AlpträumeOur lives begin to end the day we become silent about things that matter.What news?Patrolling the Mojave almost makes you wish for a nuclear winter.
Forrest Gump hat einen erstunlichen Soundtrack. Habe seit seiner Kindheit zugehört und sie in neuem Licht gesehen, wenn ich erwachsen bin.This film is older.I love it too.Movie?
Ich bin ziemlich gelangweilt in diesen Tagen. Brauchen Sie eine neue Berufung.r/stoppedworkingBe the change you want to see!Becoming?
Der neue verkabelte Antikel ist ziemlich aufschlussreich über UnternehmenspolitikSo business as usual?The project has great potential success.Satire?
+ +Figure 11: Some samples of German messages and predicted with English replies using the CGM-M Model. While the quality is not as good as when the input message is in German, the general close match of intents of the message and responses illustrates the cross lingual ability of the model. + +
MessageCGM-1CGM-2CGM-3
おはようお願いいたします!昨夜のバーダイローのはんだか。楽 Hautた?Absolutely nothing!What did you not like about it?Today was a good day
新鮮映画を見まいたか。それは本当之面白ったAVIS!一緒に 見欲習Thank you! I'm glad you enjoyed it.It was amazing!It was awesome!
再びようお願い!仕事に resumesてうれしてる。Have a great time!Thank you! I definitely will!Glad to hear it! :)
ドバイメSENTへのリングクを送てくださいます。私はリングクを見,Thoutるこが付けますようです。Please, read and follow the instructions at the top of the page. Thanks!clickedDone. Check your inbox!
トラフィックはなか悪,ID係。う1時間に約はす係が、わからません。Thank you for your positive feedback ! :)Thank you, I will.I will :)
私はモリ不足的问题を解決いたします。そのはくっ嵬はんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだはんだは molecuoはういはういはういはういはういはういはういはういはういはういはういはういはういはういはういはういはういはういはういはういはういはういはういはういはういはういはういはういはういはういはういはういはういはうい是Appreciated!Good project, congratulations!Great work
Another!Yes I did :)
外面はて moistな爽い!今日は湖で釣りに行くと思ります。最新アルバムを聞きま没了か?その単に素晴らし、吹き飛ばさた !!Thank you! I definitely will!Love him!So much winning!
r/fakealbumcoversr/nhlstreamsSix seasons and a movie!
今日の見事な勝利、何ガートIL彼は天才:DHe sure is!
最新Netflixシャーフは、まうと第1シーダンを見ます。休息は 像まり良胆固醇。Wabbit season!
道の下に新鮮書店が開った。私自読書のたにその行う予 定です。You're going down a path I can't follow!Thank you! !translatedFreedom!
何が起ったかが強御験い的て。それはモードのたに上ご了か。悪夢を見たr/notinterestingWhat evidence?What was his reaction?
フィレストガングは素晴らし、サウンドトラックを持ていま ま。子供の頃から耳を傾け、私が成長するにしいて新鮮光の 中でそのを見て+(\)^$。Recorded!Love it! Thank you!Thank you so very much.
私の最近icerical退屈です。新鮮職業が必要です。Yes you are!You are!That means a lot, thank you!
新鮮有線記事は、企業政治にしいてかわり明かですYour ideas are intriguing to me and I wish to subscribe to your newsletter.Please lower your voice. This is a public forum.Please, read and follow the instructions at the top of the page. Thanks!
+ +Figure 12: Some samples of Japanese messages and predicted with English replies using the CGM-M Model. The quality here is definitely poorer than German to English, perhaps since EN and JA are not as closely related. However we still get the general close match of intents of the message and responses. \ No newline at end of file diff --git a/aconditionalgenerativematchingmodelformultilingualreplysuggestion/images.zip b/aconditionalgenerativematchingmodelformultilingualreplysuggestion/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..0f0a4790048bb9fe216b4880c3a092c64feb1dea --- /dev/null +++ b/aconditionalgenerativematchingmodelformultilingualreplysuggestion/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cff5e0e2e9f07fbcda6f522ddc7774d1d6d4996b8e00ba5d870feaea2face68d +size 1693367 diff --git a/aconditionalgenerativematchingmodelformultilingualreplysuggestion/layout.json b/aconditionalgenerativematchingmodelformultilingualreplysuggestion/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..719328cd24533f0e58555d6a5f5dd843dc41f6dd --- /dev/null +++ b/aconditionalgenerativematchingmodelformultilingualreplysuggestion/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:630456bf5c0ffed4bd6d22e72ebdc7e19b127e6f904877ccae096ee7c83d96e8 +size 530876 diff --git a/acorpusbasedsyntacticanalysisoftwotermedunlikecoordination/d08cbc6b-abd4-494d-889b-908ee6cbc4ae_content_list.json b/acorpusbasedsyntacticanalysisoftwotermedunlikecoordination/d08cbc6b-abd4-494d-889b-908ee6cbc4ae_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..0b5fabeae05843476a26735800afc796fe008dba --- /dev/null +++ b/acorpusbasedsyntacticanalysisoftwotermedunlikecoordination/d08cbc6b-abd4-494d-889b-908ee6cbc4ae_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:644cd35a31afcfdc23dc9b27132a5e82bc8392066d1b89a57809e0892fb1825f +size 75727 diff --git a/acorpusbasedsyntacticanalysisoftwotermedunlikecoordination/d08cbc6b-abd4-494d-889b-908ee6cbc4ae_model.json b/acorpusbasedsyntacticanalysisoftwotermedunlikecoordination/d08cbc6b-abd4-494d-889b-908ee6cbc4ae_model.json new file mode 100644 index 0000000000000000000000000000000000000000..97a12107d3f9edfdeda728cbd78e9d2d1b8c35bf --- /dev/null +++ b/acorpusbasedsyntacticanalysisoftwotermedunlikecoordination/d08cbc6b-abd4-494d-889b-908ee6cbc4ae_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0ebcaa1ef183befa03f13df1131b2f31f369d12213252e028c59a33fa2be134e +size 97631 diff --git a/acorpusbasedsyntacticanalysisoftwotermedunlikecoordination/d08cbc6b-abd4-494d-889b-908ee6cbc4ae_origin.pdf b/acorpusbasedsyntacticanalysisoftwotermedunlikecoordination/d08cbc6b-abd4-494d-889b-908ee6cbc4ae_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6ee183c2dd4847644d3652cff9f6a8f496c88ab8 --- /dev/null +++ b/acorpusbasedsyntacticanalysisoftwotermedunlikecoordination/d08cbc6b-abd4-494d-889b-908ee6cbc4ae_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8da80caae55dcbc001170635d95aaf2b0ace40fdb26d380e30095b28a4c6697c +size 419705 diff --git a/acorpusbasedsyntacticanalysisoftwotermedunlikecoordination/full.md b/acorpusbasedsyntacticanalysisoftwotermedunlikecoordination/full.md new file mode 100644 index 0000000000000000000000000000000000000000..7837431a059e3db253f60909d123239852e8d686 --- /dev/null +++ b/acorpusbasedsyntacticanalysisoftwotermedunlikecoordination/full.md @@ -0,0 +1,367 @@ +# A Corpus-based Syntactic Analysis of Two-termed Unlike Coordination + +Julie Kallini and Christiane Fellbaum + +Department of Computer Science + +Princeton University + +{jkallini, fellbaum}@princeton.edu + +# Abstract + +Coordination is a phenomenon of language that conjoins two or more terms or phrases using a coordinating conjunction. Although coordination has been explored extensively in the linguistics literature, the rules and constraints that govern its structure are still largely elusive and widely debated amongst linguists. This paper presents a study of two-termed unlike co-ordinations in particular, where the two conjuncts of the coordination phrase form valid constituents but have distinct categories. We conducted a syntactic analysis of the phrasal categories that can be conjoined in such unlike co-ordinations through a computational corpus-based approach, utilizing the Corpus of Contemporary American English (COCA) as the main data source, as well as the Penn Treebank (PTB). The results show that the two conjuncts within unlike co-ordinations display different properties based on their position, supporting an antisymmetric view of the structure of coordination. This research provides new data and perspectives through the use of statistical techniques that can help shape future theories and models of coordination. + +# 1 Introduction + +# 1.1 Motivation + +Coordination is a phenomenon of language that conjoins two or more terms or phrases. The terms or phrases that are grouped in coordination phrases are normally called conjuncts, and they are often conjoined by a coordinating conjunction, such as and, or, but, or nor. A common assumption in the linguistics literature is that two elements may only be coordinated if they share the same syntactic category, as in (1). + +(1) a. [NP The chicken] and [NP the rice] go well together. +b. The president will $[\mathrm{VP}$ understand the criticism] and $[\mathrm{VP}$ take action]. + +For example, in (1a), the two conjuncts being coordinated are "the chicken" and "the rice," which share the same syntactic category of noun phrase (NP). The assumption that the conjuncts of a coordination phrase will always have the same category is known as the Law of the Coordination of Likes (LCL) (Williams, 1981). The LCL explains why many instances of coordination are ungrammatical, such as the coordination of a prepositional phrase (PP) and a clause (CP) shown in (2) (Prazmowska, 2015). + +(2) a. The scene of the movie was in Chicago. +b. The scene that I wrote was in Chicago. +c. *The scene [PP of the movie] and [CP that I wrote] was in Chicago. + +Even though the prepositional phrase and the clause are both grammatical when standing alone within the context sentence, as in (2a) and (2b), their co-ordination in (2c) is ungrammatical, supposedly because of the LCL. + +However, several examples of syntactically unlike coordination can be found in English, such as the examples in (3) (Sag et al., 1985). + +(3) a. Pat is [NP a Republican] and [AP proud of it]. +b. John is [AP healthy] and [PP in good shape]. +c. That was [NP a rude remark] and [PP in very bad taste]. + +In the above examples, the two conjuncts within each coordination phrase do not share the same syntactic category. In these cases, the LCL seems to be too restrictive. + +Yet, there are also cases in which the LCL is not restrictive enough—a coordination phrase can still be ungrammatical even if its conjuncts have the same syntactic category (Prazmowska, 2015). + +(4) a. *John ate [PP with his mother] and [PP with good appetite]. +b. \*John [AdvP probably] and [AdvP unwillingly] went to bed. + +Example (4a) contains the coordination of two prepositional phrases, and (4b) contains the coordination of two adverbs. Despite the two conjuncts having like categories, these examples result in ungrammatical sentences. Semantics seems to play a role in the acceptability of coordinations as well; a stronger version of the LCL requires that conjuncts must also be alike in their semantic function. For example, in (4a), the first prepositional phrase "with his mother" expresses accompaniment, whereas the second "with good appetite" expresses manner (Prazmowska, 2015). However, identifying and articulating rigorous rules that predict all grammatical possibilities of coordination has been a difficult task for linguists, and as a result, the underlying syntactic structure of coordination phrases has been elusive. + +# 1.2 Goal + +The goal of this project is to explore and answer questions about the syntax of coordination phrases through a quantitative corpus analysis. By analyzing a large corpus of naturally-occurring spoken and written language using natural language processing and statistical techniques, we will investigate the patterns of syntactic categories found in unlike coordinations. An overarching goal for this project is to share data that may inform linguistic hypotheses about the underlying structure of coordination. + +By taking a computational approach, we can explore a larger and deeper set of questions regarding coordination, such as: + +- What combinations of syntactic categories are attested in English data, and which appear most frequently? +- Does this depend on the genre of the text or the type of conjunction (and, or, but, nor)? + +This paper begins by introducing the relevant problem background and related work. We then detail our corpus-based approach and implementation, which utilizes the Corpus of Contemporary American English (COCA), the Penn Treebank (PTB), and the Berkeley Neural Parser. We then follow with a presentation of the results and provide an in-depth discussion of the significant findings. + +![](images/bfd0c0c97618ecdf605e200fbb61638a153471d4b1b4724f120f525d6081d57e.jpg) +Figure 1: Flat multi-headed proposal for the structure of coordination. + +# 2 Background and Related Work + +Capturing the structure of coordination has been a difficult problem in many theories of syntax. A flat, multi-headed structure was proposed in earlier theories, in which two or more lexical heads share the same phrase-level projection, as in the templates shown in Figure 1 (Progovac, 1998a; Chomsky, 1981). This theory captures the intuitive idea that the coordination of two NPs is an NP, that the coordination of two VPs is a VP, etc. An example of a two-termed coordination of NPs is provided in (5). We use $CC$ as the name for the functional category of coordinating conjunctions, which is also the label used in the PTB. + +(5) [NP the cat] and [NP the dog] + +![](images/3229fb228b91e860f539de5272867a50c731efa6924d7e45d4b5f24deba7eb31.jpg) + +There are several problems with this view, but the problem we are most concerned with relates to the aforementioned counterexamples to the LCL, restated below in (6). + +(6) a. Pat is [NP a Republican] and [AP proud of it]. +b. John is [AP healthy] and [PP in good shape]. +c. That was [NP a rude remark] and [PP in very bad taste]. + +In fact, the LCL was formulated due to this proposal for the syntax of coordination. Coordination was said to denote a relation between two (or more) elements that are "hierarchically equal" in that neither of the elements is more prominent than the + +other, leading to a symmetrical and flat vision of coordination structures (Prazmowska, 2015). Since conjuncts were assumed to be symmetrical and equal in status, it followed that they must share the same syntactic category to be grammatically coordinated. + +One proposal that seems to address the existence of the unlike category coordinations seen in (6) is Bowers's Pred (predicate) functional category (Bowers, 1993). On top of the NPs, APs, and PPs being coordinated in these sentences, there is another level of structure. Bowers suggests that a null Pred head selects an NP, AP, or PP as its complement, forming a predicate phrase (PredP). Thus, unlike coordinations are actually like coordinations in disguise—all conjuncts have the category of PredP. PredPs are complements of the copula $be$ in these sentences, as made apparent in (7). + +(7) a. Pat is $\left[\mathrm{PredP}\emptyset\right]$ [NP a Republican] and $\left[\mathrm{PredP}\emptyset\right]$ [AP proud of it]. +b. John is $\left[\mathrm{PredP}\emptyset \left[\mathrm{AP}\right.\right]$ healthy] and $\left[\mathrm{PredP}\emptyset \right.$ [pp in good shape] ]. +c. That was $[\mathrm{PredP}\emptyset [\mathrm{NP}$ a rude remark] and $[\mathrm{PredP}\emptyset [\mathrm{PP}$ in very bad taste] ]. + +However, Bowers's proposal does not account for cases where the coordinated strings are not predicates, such as in (8). In each of these examples, the coordination phrase is an adjunct of VP rather than a predicate complement of VP, and the conjuncts semantically serve the purpose of adverbial modification. + +(8) a. The surgeon operated [AdvP slowly] and [PP with great care]. +b. Alice will visit home [AdvP tomorrow] or [PP on the weekend]. + +Other proposals dodge the problem of unlike coordination entirely by making the coordinating conjunction the head of its own coordination phrase (CCP). One example of such a theory is shown in (9). + +(9) [NP a Republican] and [AP proud of it] + +![](images/5efe41d68b0df6e5d3e8fc23808f9d573414764da01cc8d71b47eec15a3c3e5a.jpg) + +Here, conjuncts are specifiers and complements of the head conjunction (Johannessen, 1998; Zoerner, 1995). With such a construction, the categories of the conjuncts by themselves do not pose a restriction on the possibility of coordination. Thus, such theories do not have anything to say about the LCL, but they are still problematic in that they over-generate; no combinations of categories are prohibited. + +# 3 Approach + +We approached the task of capturing the structure of two-termed coordination by conducting a computational syntactic analysis on a large quantity of corpus data. Our primary data source is the Corpus of Contemporary American English (COCA) (Davies, 2015), and our additional data source is the Penn Treebank (PTB) augmented with Ficler and Goldberg's PTB coordination annotation extension (Ficler and Goldberg, 2016). We extracted coordination phrases from both of these datasets and performed a quantitative syntactic analysis using the constituency parses of the sentences within both texts. + +This approach has a few advantages over previous work. Much of the research that has shaped current theories of coordination have relied on the acceptability judgments of a few individuals, usually the author(s). By using corpus data, we gain an understanding of coordination on a much larger scale and emphasize empirical rather than intuitive judgments. We can also investigate differences in the patterns we identify based on the genre from which a coordination was found or the conjunction it contains. + +# 3.1 Corpus Data + +The Corpus of Contemporary American English (COCA) is a large, genre-balanced corpus of American English containing more than 450 million words of text (Davies, 2015). The COCA contains text from five genres: academic, fiction, magazine, newspaper, and spoken texts. Each genre includes 20 million words each year from 1990-2012. A balanced corpus, especially one that includes spoken data, was important for this project, as there may be variations in the coordinations found across different genres. + +In addition to COCA data, we use the Penn Treebank (PTB), a collection of 2,499 stories from the Wall Street Journal gathered over a three-year pe + +riod (Marcus et al., 1993). Sentences from the PTB are already tokenized and annotated with phrase structure, unlike the COCA. However, coordination annotations in the PTB are often inconsistent, include errors, and lack internal structure in many cases. For this reason, we make use of Ficler and Goldberg's PTB coordination annotation extension, which improves the coordination annotation in the PTB (Ficler and Goldberg, 2016). This extension provides an annotation that explicitly marks coordination phrases and the role of each element in coordination structures (i.e., conjuncts, markers, connectives, and shared elements are all identified and marked). + +# 3.2 Syntactic Analysis + +The main task of our syntactic analysis involves the detection and extraction of coordination phrases from our corpus data. Since the COCA is provided in a raw text format, we use the Berkeley Neural Parser to produce syntax trees of sentences in the COCA. This is a state-of-the-art constituency parser that generates syntax trees in the style of the Penn Treebank (Kitaev and Klein, 2018). To implement a good search algorithm for coordinations within parsed COCA data, we studied several sentence parse trees containing coordinations and identified three patterns in the way that the Berkeley Neural Parser most often represents the structure of coordination phrases, as shown in Figure 2. + +Since the PTB is already annotated as phrase structure trees, the possible problems of using a constituency parser on novel text are eliminated. The identification of coordination phrases is made much simpler here with the help of the coordination annotation extension. The explicit function markers allow for the straightforward detection and isolation of conjuncts and conjunctions from other tangential elements that may be contained within a coordination phrase, such as modifiers and connectives. Figure 3 shows an example of a PTB phrase structure tree with the extension's additional function marking. + +For our syntactic analysis, we include coordinations of six types of PTB phrasal category labels: noun phrases (NP), verb phrases (VP), prepositional phrases (PP), adjective phrases (ADJP), adverb phrases (ADVP), and subordinate clauses (SBAR, often called complementizer phrases (CP) in more recent syntax literature). We have chosen this set of labels because they correspond to the + +![](images/2d0a3371918177e086c21e3d2b6ef3d980edd77fa616e78f11ca8cdf80c0c2e4.jpg) +(a) Simple ternary-branching pattern. + +![](images/552582ea7058e3bd60166faa0138c175e4f97165e1e2dba8595b7bcf2d0f81a3.jpg) +(b) Neither-nor pattern. + +![](images/4225a4908c84ff1b3b1d819a69f5e4af3e4f05bba5a4a79f9a3a277781a007a3.jpg) +(c) Verb-complement pattern. +Figure 2: Three patterns used to detect two-termed co-ordination phrases in parsed COCA data. X, Y, and Z may be any PTB constituent tags. + +most frequent phrasal categories in the data. Once coordination phrases have been identified, we run statistical tests on the frequencies of their different attributes, such as the categories of the conjuncts, the type of conjunction used, and the genre from which the coordination was found. + +# 4 Results + +In our analyses, we employ the chi-square $(\chi^2)$ tests, which determine whether a set of observed frequencies deviate significantly from a set of expected frequencies. We consider $p$ -values less than 0.05 to be statistically significant. Since our sam + +![](images/53403b07356ae5274d8973b8354f4da5ed9bc4f42639b0ee53c3d98353450b51.jpg) +Figure 3: A tree containing the explicit function marking from the PTB coordination annotation extension. + +
VAssociation
0.00–0.05negligible
0.05–0.10weak
0.10–0.15moderate
0.15–0.25strong
0.25–1.00very strong
+ +![](images/110ea757b0f4fb5fa7b6d5715f1db1d5f5c20e28c4385e2a6cfe7f822001440c.jpg) +Figure 4: Most frequent unlike category combinations in the COCA data. Frequencies are relative to all unlike coordinations. + +ple sizes are very large, we conduct additional posttests to accompany any statistically significant results. We use Cramer's $V$ to measure strength of association (Table 1) (Akoglu, 2018). + +# 4.1 Most Frequent Unlike Coordinations + +We performed an analysis of the most frequent unlike coordinations in the COCA data. Figure 4 displays the top ten most common unlike coordinations found in all of the COCA data we parsed along with their relative frequencies, and Table 2 contains examples. We found a significant difference in the distribution of unlike category coordinations, with a moderate tendency toward the most common coordination combination, $\mathsf{NP} + \mathsf{SBAR}$ , $\chi^2 (9,N = 24456) = 3142.0$ , $p < .001$ , $V = .119$ . + +# 4.1.1 By COCA Genre + +We also performed an analysis of the most frequent unlike coordinations in each of the five COCA genres. In each genre, a significant difference was found in the distribution of unlike category coordinations. Table 3 summarizes the results of the chi-square tests and Cramer's $V$ for each COCA genre, and Appendix B contains figures displaying the top + +Table 1: Interpretation of strength of association/tendency based on Cramer's $V$ + +
CoordinationExample Sentence
NP+SBAR*You'd get to watch two adults talk about [NP America] and [SBAR what they would do to lead it].
NP+VPVoids are [NP a nightmare] and [VP initialed by the employee and his supervisor].
ADJP+VP*It was [ADJP emotionally manipulative] and [VP designed to scare people into faith].
ADVP+PP*The phenomenon fell into place [ADVP organically] and [PF with ease].
NP+ADJP*He's [NP a free spirit] and [ADJP playful], prompting managers and teammates to shake their heads and proclaim he's Manny being Manny.
PP+VPIn Gaza, meanwhile, Hamas leaders insist that they are still [PP in charge] and [VP leading the Palestinian authority].
PP+ADVP*A big question many taxpayers face is whether to file [PF by paper] or [ADVP electronically].
NP+PPI called him a liar again, and then I punched him [NP a lot of times] and [PP with all my might].
PP+NPMore Americans work [PP out of the house] and [NP longer hours], so we've become more dependent on meals we don't cook ourselves.
VP+NPErosion and years of neglect have left the brick structure [VP crumbling] and [NP a clear safety hazard].
+ +* Also in the top ten unlike coordinations in the PTB. + +Table 2: Examples extracted from the COCA for each of the top ten most common unlike coordinations. + +
Genreχ2NpV
Academic450.595105< .001.099
Fiction693.224358< .001.133
Magazine583.695324< .001.110
Newspaper616.914851< .001.118
Spoken2391.35095< .001.228
+ +Table 3: Summary of chi-square test and Cramer's $V$ results for the frequency difference among the top ten unlike category combinations in each COCA genre. + +unlike coordinations in each genre. In the academic genre, there was a weak tendency toward the most common combination, NP+SBAR (Figure 7). In the fiction genre, a moderate tendency was found toward the most common combination, ADJP+VP (Figure 8). In the magazine genre, we also found a moderate tendency toward the most common combination, which was again NP+SBAR, as in the academic genre (Figure 9). In the newspaper genre, an indication of a moderate tendency toward the most common combination was found once again, with NP+VP being the most common combination (Figure 10). In the spoken genre, there is a notable indication of a strong tendency toward the most common combination, which was NP+SBAR, as in the academic and magazine genres (Figure 11). + +
ConjunctionNpV
and2933.019621<.001.129
or752.874317<.001.139
but73.8931042<.001.089
nor14.33345.111-
+ +# 4.1.2 By Conjunction + +We also performed an analysis of the most frequent unlike category combinations based on the type of coordinating conjunction used to conjoin them. Table 4 summarizes the results of the chi-square tests and Cramer's $V$ for each type of conjunction, and Appendix B again contains figures displaying the top unlike coordinations for each conjunction. For the conjunctions and, or, and but, a significant difference was found in the distribution of unlike category coordinations. For unlike coordinations containing and, there was a moderate tendency toward the most common combination, which was $\mathrm{NP + SBAR}$ (Figure 12). For unlike coordinations containing or, we also found a moderate tendency toward the most common combination, which was again $\mathrm{NP + SBAR}$ (Figure 13). For unlike coordinations containing but, there was a weak tendency toward the most common combination, ADJP+VP (Figure 14). For unlike coordinations containing nor, no significant difference was found in the distribution of unlike category coordinations (Figure 15). + +# 4.1.3 In the PTB + +We performed an analysis of the most frequent unlike coordinates in the PTB as well. Figure 5 displays the top ten most common unlike coordinates in the PTB data, along with their relative frequencies. We found a significant difference in the distribution of unlike category coordinations with a moderate tendency toward the most common combinations, $\chi^2 (9,N = 216) = 22.981$ , $p = .006$ , $V = .109$ . The most common unlike coordination in the PTB was ADVP+PP. + +# 4.2 Differences Between Conjunct Positions + +In addition to the most frequent combinations of categories, we conducted an analysis of the categories for each conjunct independently. We first + +![](images/d2acc96adafec52cf079975f0aa9a94b853523b354cd0877f56106142d8f72e3.jpg) +Figure 5: Most frequent unlike category combinations in the PTB. Frequencies are relative to all unlike co-ordinations. + +Table 4: Summary of chi-square test and Cramer's $V$ results for the frequency difference among the most common unlike coordinations based on the coordinating conjunction used to conjoin them (from COCA data). + +
Category1st Conjunct2nd ConjunctNpV
NP70.75%29.24%3200.718582< .001.415
VP32.42%67.58%1764.414277< .001.352
PP53.47%46.53%68.78914248< .001.069
ADJP55.73%44.27%125.579566< .001.114
ADVP48.71%51.29%5.0767645.024.026
SBAR23.97%76.03%2385.88800< .001.521
+ +Table 5: Summary of chi-square test and Cramer's $V$ results for the frequency difference between the two conjunct positions for each type of phrasal category from COCA data. + +report the results based on frequencies from the COCA. Table 5 summarizes the results of the chi-square tests and Cramer's $V$ for each of the six phrasal categories. For NPs, a very strong tendency was found toward the first conjunct position; for VPs, a very strong tendency was found toward the second conjunct position; for PPs, only a weak tendency was found toward the first conjunct position; for ADJPs, a moderate tendency was found toward the first conjunct position; for ADVPs, only a negligible tendency was found toward the second conjunct position; and for SBARs, a very strong tendency was found toward the second conjunct position. + +Next, we report the results based on frequencies from the PTB. Table 6 summarizes the results of the chi-square tests and Cramer's $V$ for each of the six phrasal categories. For NPs, a very strong tendency was found toward the first conjunct position; for VPs, PPs, ADJPs, and ADVPs, no significant difference was found in the distribution of conjunct positions; and for SBARs, a very strong tendency was found toward the second conjunct position. + +
Category1st Conjunct2nd ConjunctNpV
NP65.57%34.43%11.836122<.001.311
VP38.18%61.82%3.07355.080-
PP50.34%49.66%.0069145.934-
ADJP54.17%45.83%.8333120.361-
ADVP44.25%55.75%1.496113.221-
SBAR26.09%73.91%10.52246.001.478
+ +Table 6: Summary of chi-square test and Cramer's $V$ results for the frequency difference between the two conjunct positions for each type of phrasal category from the PTB data. + +# 5 Evaluation + +A portion of the data we have presented in the previous section was gathered through the use of a constituency parser to identify coordination phrases. While the Berkeley Neural Parser is state-of-the-art, no parser is perfect, especially concerning coordination disambiguation. Furthermore, there are additional types of coordination structures that we do not consider, including non-constituent coordination and gapping. In non-constituent coordination, each conjunct in a coordination phrase does not form its own constituent under traditional theories of clause structure, as shown in example (10). + +(10) The girl from California walked [into the room at 9 PM] and [out of the room at 10 PM]. + +Gapping is the phenomenon in which a phrase is coordinated with another phrase that seems to be missing some material, as shown in (11). + +(11) [Mary ate beans] and [John potatoes]. + +While this paper only seeks to analyze the coordination of constituents and does not consider these additional types of coordination, they still pose challenges in the identification and labeling of coordination phrases by parsers. We have conducted an evaluation plan in which human raters manually assessed a random sample of unlike coordinations to estimate an error rate for each type of category combination. + +Each type of unlike coordination was assigned a score based on the judgments of three independent raters. A single rater contributes to the score by providing the percentage of samples in which they agreed with the parser's labels. The overall score for that type of coordination is then assigned by taking the mean of the three raters' scores. The scores for each type of unlike coordination are enumerated in Table 7, along with the sample size, confidence level, and margin of error used for sampling. + +
NPVPPPADJPADVPSBAR
NP-50.9% (103)72.3% (100)72.4% (101)61.2% (96)83.4% (103)
VP61.7% (99)-69.0% (96)70.3% (95)62.0% (85)63.0% (105)
PP61.7% (100)64.4% (101)-80.0% (90)80.3% (101)70.7% (97)
ADJP77.6% (97)80.0% (102)89.6% (97)-66.6% (78)65.5% (64)
ADVP55.5% (86)66.0% (89)85.3% (101)56.5% (76)-63.7% (96)
SBAR79.5% (96)50.0% (93)75.3% (81)58.0% (36)56.5% (46)-
+ +Table 7: Average agreement with the Berkeley Neural Parser's labeling of each type of unlike coordination phrase, based on the judgments of the three raters. Rows correspond to the first conjunct's category, and columns correspond to the second conjunct's category. A $90\%$ confidence level and $\pm 8\%$ margin of error were used for sampling each category combination. The sample size, $n$ , is reported in parentheses. + +
κAgreement
0.00–0.20poor
0.20–0.40fair
0.40–0.60moderate
0.60–0.80substantial
0.80–1.00near perfect
+ +Table 8: Interpretation of strength of agreement based on the Cohen's Kappa Coefficient. + +Fleiss' Kappa showed that, among the three raters, there was fair agreement in their judgments, $\kappa = .291$ (95% CI [.271, .312]), $p < .001$ . The strength of agreement is determined based on the Cohen's Kappa Coefficient (Table 8) (McHugh, 2015). + +# 6 Discussion + +# 6.1 Most Frequent Unlike Coordinations + +The results of the analysis of the most frequent unlike coordinations in the COCA data indicate that NP+SBAR is the most common unlike coordination. It was also the most frequent unlike coordination in three of the five genres (academic, magazine, and spoken). Some examples from the COCA are shown in (12) below. + +(12) a. Be sure to tell us $[\mathrm{NP}$ your full name] and [SBAR where you live]. +b. I support [NP the president] and [SBAR what he did]. + +c. The zone's size depends on [NP the weather] and [SBAR how much flow the Mississippi brings each year]. + +One possible explanation for the high frequency of NP+SBAR coqindinations is that subordinate clauses have very similar syntactic distributions to noun phrases in other contexts as well. In particular, subordinate clauses, which are called complementizer phrases (CP) in the syntax literature, can be the subjects of sentences. When a CP occupies the subject position of a sentence, it is called a sentential subject (Lohndal, 2014). Sentential subjects can be headed by a variety of different complementizers; (13) shows a few examples using that, whether, what, and how. + +(13) a. [CP That Joe fell asleep in the meeting] disappointed us. +b. [CP Whether she shows up or not] doesn't matter. +c. [CP What a huge scandal it was] didn't emerge until later. +d. [CP How we got here] is a total mystery. + +Some linguists have theorized that sentential subjects and more typical nominal subjects have the same syntactic category. Much like Bowers's predicate phrase analysis discussed in Section 2, sentential subjects may be analyzed as having a null determiner head that forms a determiner phrase (DP) from a CP (Lohndal, 2014). + +(14) $[\mathrm{DP}\emptyset [\mathrm{CP}\mathrm{That}\mathrm{Mary}\mathrm{left}\mathrm{early}]]$ disappointed us. + +Although we do not expound on the arguments for DPs, most of the constituents that we have been treating as noun phrases for simplicity in this paper are often analyzed as DPs instead. The heads of determiner phrases may be overt, such as the determiners the and $a$ in phrases like [DP the dog] or [DP a child], or they may be null, as in the case of plural nouns like [DP $\varnothing$ dogs] or [DP $\varnothing$ children]. The argument for clauses as DPs would posit that the same null determiner head that plays a role in the formation of plural DPs could also play a role in the formation of DPs from subordinate clauses. The data collected in this project provide more evidence through coordination that DPs and CPs have very similar syntactic distributions. + +While NP+SBAR was also within the top ten unlike coordinations in the PTB, ADVP+PP and + +PP+ADVP were the most common in the PTB. Examples from the PTB are presented in (15). + +(15) a. Beauregard was mentioned twice—although [ADVP very briefly] and [PP in passing]. +b. A huge production system built [PP in the sea off Santa Barbara] and [ADVP ashore] is sitting idle. + +ADVP+PP and PP+ADVP were within the top co-ocbinations from the COCA data as well. Their frequent co-occurrence likely has to do with ADVP's and PP's shared purpose of adverbial modification in adjunct position. A null functional morpheme could be used to explain this coordination, and this idea would be quite similar to Bowers's Pred (predicate) proposal but applied to adjuncts of verbs instead of complements. + +# 6.2 Differences Between Conjunct Positions + +When considering each phrasal category in isolation and controlling for their different total frequencies, in both the COCA and the PTB, NPs had a very strong tendency toward being in the first conjunct position, and SBARs had a very strong tendency toward the second conjunct position. In the COCA data, VPs had a very strong tendency toward the second conjunct position, and ADJPs had a moderate tendency toward the first conjunct position. + +It seems like phrasal categories that can be very short, like NPs, are more likely to appear as the first conjunct, but longer phrases, like CPs or VPs, are more likely to be the second conjunct. This may be related to a phenomenon called heavy NP shift, in which a noun phrase appears to the right of its expected canonical position due to its "weight" (Kayne, 1994, Chapter 7). Example (16) explores heavy NP shift through prepositional dative constructions, where the recipient of a ditransitive verb (in this case, "Jen") is the object of the preposition to (Colleman et al., 2010). + +(16) a. I gave [NP the large book of poems] [PP to Jen]. +b. I gave [PP to Jen] [NP the large book of poems]. + +All of the constituents in (16a) appear in their canonical, expected positions; the direct object noun phrase appears closest to the verb, and the prepositional phrase containing the recipient is after the NP. In (16b), heavy NP shift moves the direct + +object NP into a position after the PP. Shifting can only occur if the NP is long and complex; when it is short, shifting is prohibited, as (17) shows. + +(17) a. I gave [NP it] [PP to Jen]. +b. * I gave [PP to Jen] [NP it]. + +Shifting can also target syntactic categories other than noun phrases. In (18a), the complement and adjunct of the noun "statue" appear in their expected positions, with the complement $\left[\mathrm{PP}\right.$ of him] closer to the noun. In (18b), the complement is heavier than the adjunct and thus appears further to the right. + +(18) a. the statue [PP of him] [PP in the park] +b. the statue [pp in the park] [PP of that old musician from the 19th century] + +The main idea behind shifting can be applied to coordination and the trends that we observed in the results section regarding asymmetry in conjunct positions. If heavier constituents undergo shifting to appear after lighter constituents within phrases, this would explain why longer and more complex conjuncts tend to appear in the second conjunct position of coordination phrases. Example (19) shows this intuition through the like coordination of two NPs with different lengths. + +(19) a. I bought [NP apples] and [NP some strange looking fruits I found in the produce aisle]. +b. ? I bought [NP some strange looking fruits I found in the produce aisle] and [NP apples]. + +We can also observe heavier constituents appearing in the second conjunct position in unlike coordinations, as shown by example (20). Although (20b) is not ungrammatical, (20a) sounds a bit more natural. + +(20) a. John is [AP healthy] and [PP in the best shape of his life]. +b. John is [PP in the best shape of his life] and [AP healthy]. + +# 6.3 Limitations + +One shortcoming of this paper lies in the evaluation plan: the human reviewers were not blind to the labels given to coordination phrases by the parser. With more resources, a future iteration of this project could include the creation of a small gold standard dataset of coordinations and use the + +more formal precision, recall, and F1 metrics to gauge the parser's accuracy in the identification of coordinations. Still, the raters' evaluations reveal the limitations of an analysis that utilizes an existing constituency-based parser on raw COCA data, which includes a size of parse errors. We acknowledge the drawbacks of such an approach and have supplemented the analysis of COCA data with data from the Penn Treebank for this purpose, which is not processed using a parser. These data sources together provide more concrete examples of the possibilities of unlike constituent coordination. + +# 7 Conclusion + +This paper approached the problem of understanding the syntax of two-termed coordination phrases through a computational corpus analysis. Previous research has not attempted a thorough analysis of coordination based on English corpora, instead relying on intuitive acceptability judgments to inform their theories. We conducted a syntactic analysis by extracting coordination phrases from the Corpus of Contemporary American English and the Penn Treebank, and we investigated the most common unlike coordinations and the syntactic categories that appeared in either of the two conjunct positions. + +Some of the findings from this project have interesting implications for coordination and syntax as a whole. The high frequency of coordinations of noun phrases with subordinate clauses provides further proof that noun phrases and clauses share similar syntactic distributions and may be structurally defined as determiner phrases. The tendency for first conjuncts to be shorter constituents and second conjuncts to be longer ones might suggest that shifting occurs in coordination structures as well. One of the main takeaways from these results is that there are evident syntactic distinctions between the two conjuncts of a coordination phrase, which support theories that posit an antisymmetric account for the structure of coordination. + +# Acknowledgments + +We would like to thank Srinivas Bangalore for his suggestions and feedback as the second reader of this paper, as well as the students of his Introduction to Machine Translation class, who helped complete the project's evaluation plan. We also appreciate the three anonymous reviewers' careful reading of our paper and their constructive comments. + +# References + +Haldun Akoglu. 2018. User's guide to correlation coefficients. Turkish Journal of Emergency Medicine, 18. +John Bowers. 1993. The syntax of predication. Linguistic Inquiry, 24(4):591-656. +Noam Chomsky. 1981. Lectures On Government and Binding. Foris Publications. +Timothy Colleman, Bernard De Clerck, and Magda Devos. 2010. Prepositional dative constructions in english and dutch: A contrastive semantic analysis. Neophilologische Mitteilungen, 111(2):131-152. +Mark Davies. 2015. Corpus of Contemporary American English (COCA). +Jessica Ficler and Y. Goldberg. 2016. Coordination annotation extension in the penn tree bank. ArXiv, abs/1606.02529. +Janne Bondi Johannessen. 1998. Coordination. Oxford University Press. +Richard Kayne. 1994. The Antisymmetry of Syntax. MIT Press. +Nikita Kitaev and Dan Klein. 2018. Constituency parsing with a self-attentive encoder. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), Melbourne, Australia. Association for Computational Linguistics. +Terje Lohndal. 2014. Sentential subjects in english and norwegian. Syntax and Semantics, 15:81-113. +Mitchell P. Marcus, Mary Ann Marcinkiewicz, and Beatrice Santorini. 1993. Building a large annotated corpus of english: The penn treebank. Comput. Linguist., 19(2):313-330. +Mary L. McHugh. 2015. Interrater reliability: the kappa statistic. Biochemia medica, 22(3):276-282. +Anna Prazmowska. 2015. Is unlike coordination against the law (of the coordination of likes)? +Ljiljana Progovac. 1998a. Structure for coordination: Part 1. In GLOT International 3.7. +Ivan Sag, Gerald Gazdar, Thomas Wasow, and Steven Weisler. 1985. Coordination and how to distinguish categories. *Natural Language and Linguistic Theory*, 3:117-171. +Edwin S. Williams. 1981. Transformationless grammar. In Linguistic Inquiry 12, pages 645-653. +Cyril Edward Zoerner. 1995. Coordination: The Syntax of & P. UCI dissertations in linguistics. University of California, Irvine. + +![](images/c2d1c9199d7400df98da0cae49a926badb0dc7e1b82c008258d37bd81435312e.jpg) +Figure 6: Heatmap displaying raw frequencies of all unlike category combinations (from COCA data). + +# A Heatmap of Unlike Coordinations in COCA + +For completion, we include the frequency distribution of unlike coordinations for all 30 combinations of categories in the COCA data. Figure 6 visualizes these data in the form of a heatmap. + +# B Top Unlike Coordinations by Genre and Conjunction + +The figures is in this appendix display the most frequent unlike category coordinations for each COCA genre and for each type of coordinating conjunction (and, or, but, nor) from the COCA data. Figures 7, 8, 9, 10, and 11 correspond to each of the five COCA genres, and the coordination frequencies are taken relative to all unlike coordinations within that genre. Figures 12, 13, 14, and 15 correspond to each of the four coordinating conjunctions, and the coordination frequencies are taken relative to all unlike coordinations that use the given conjunction. + +![](images/e0aaac6aab53d64574523dc03b33f87716f6c93318decc317b9a68edcd64f214.jpg) +Figure 7: Academic genre. + +![](images/3f091bdbea1b375e4ef934542046636022c946ec7ab72d2d4f468a20a3edbc2c.jpg) +Most Common Unlike Coordinations in Fiction Genre + +![](images/690e89ba7c1a80be2ddc22134a1b3df8bedb1d87a464983e7406fb7966895455.jpg) +Figure 8: Fiction genre. +Most Common Unlike Coordinations in Magazine Genre +Figure 9: Magazine genre. + +![](images/f290cb7303fc647c460e5e53c147c7edcfa19c23aa7ad1e014975434c3804bfb.jpg) +Most Common Unlike Coordinations in Newspaper Gen +Figure 10: Newspaper genre. + +![](images/f13cc17b8e43e171ec3bbca29ce07132a9832b3e18572a00f55fd5fe468b1599.jpg) +Most Common Unlike Coordinations in Spoken Genre +Figure 11: Spoken genre. + +![](images/2a949aa39329c93c6a69bea4d0351827499e3574ff089c58229fc5ce1594c377.jpg) +Most Common Unlike Coordinations Containing 'and' +Figure 12: Unlike coordinations using and. + +![](images/479df33c217c507d77e852eb8ad37527ba907c087619b7bf25e8b40d80db23a9.jpg) +Most Common Unlike Coordinations Containing 'or' +Figure 13: Unlike coordinations using or. + +![](images/805bbed6b54906fa2f92efa2d32752119eb4339e2a2ea4c72bc9e2ed05a7f98c.jpg) +Most Common Unlike Coordinations Containing 'but' +Figure 14: Unlike coordinations using but. + +![](images/c94c27ef8c172a727b302197973111f9b74742aa8f4b56cc41599e1cd49df99d.jpg) +Most Common Unlike Coordinations Containing 'nor' +Figure 15: Unlike coordinations using nor. \ No newline at end of file diff --git a/acorpusbasedsyntacticanalysisoftwotermedunlikecoordination/images.zip b/acorpusbasedsyntacticanalysisoftwotermedunlikecoordination/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..9e22a3cbf4b7bd15611a390a3ce248bf1c76f93c --- /dev/null +++ b/acorpusbasedsyntacticanalysisoftwotermedunlikecoordination/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da17db397b0c69f54c1ddd94f4a2e014f1ea610f9f14ba59aaca3d92640a0271 +size 615432 diff --git a/acorpusbasedsyntacticanalysisoftwotermedunlikecoordination/layout.json b/acorpusbasedsyntacticanalysisoftwotermedunlikecoordination/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d3b55c4050617b6347a9e96d19545bbf721b26cb --- /dev/null +++ b/acorpusbasedsyntacticanalysisoftwotermedunlikecoordination/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1910131a3afb8d6bc6e4c9607c0933cf1f79b8a992d80e9897aee2581e106166 +size 389525 diff --git a/activelearningforrumoridentificationonsocialmedia/03db8d81-f471-42d6-8235-95dc7714b4f7_content_list.json b/activelearningforrumoridentificationonsocialmedia/03db8d81-f471-42d6-8235-95dc7714b4f7_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..9dfbbab4b8920264ee93779f599acbfe6e9302eb --- /dev/null +++ b/activelearningforrumoridentificationonsocialmedia/03db8d81-f471-42d6-8235-95dc7714b4f7_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7273985444ef32d3dc16b237a67f61fdae13bddcd83b5615fd2a2b4039874389 +size 67098 diff --git a/activelearningforrumoridentificationonsocialmedia/03db8d81-f471-42d6-8235-95dc7714b4f7_model.json b/activelearningforrumoridentificationonsocialmedia/03db8d81-f471-42d6-8235-95dc7714b4f7_model.json new file mode 100644 index 0000000000000000000000000000000000000000..9f43ea194e5302c93b4ddbac2db72ebdd3455a20 --- /dev/null +++ b/activelearningforrumoridentificationonsocialmedia/03db8d81-f471-42d6-8235-95dc7714b4f7_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3413034734a9e17b1b35698bcd4934c05526a8754ea30a550db23e3c548cb00 +size 78532 diff --git a/activelearningforrumoridentificationonsocialmedia/03db8d81-f471-42d6-8235-95dc7714b4f7_origin.pdf b/activelearningforrumoridentificationonsocialmedia/03db8d81-f471-42d6-8235-95dc7714b4f7_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f6e0e6bb40900464f1febdbf887e37d1113062e0 --- /dev/null +++ b/activelearningforrumoridentificationonsocialmedia/03db8d81-f471-42d6-8235-95dc7714b4f7_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:56fdc22be6ae113c9ddb796ce8c3d97c0c09354f28056704bdab9ff28c030d1b +size 345083 diff --git a/activelearningforrumoridentificationonsocialmedia/full.md b/activelearningforrumoridentificationonsocialmedia/full.md new file mode 100644 index 0000000000000000000000000000000000000000..60fb3aa2e1d459b46cc7360568910e35e771128a --- /dev/null +++ b/activelearningforrumoridentificationonsocialmedia/full.md @@ -0,0 +1,255 @@ +# Active Learning for Rumor Identification on Social Media + +Parsa Farinneya1, Mohammad Mahdi Abdollah Pour1, Sardar Hamidian2 and Mona Diab2,3 + +1Dep. of Computer Engineering, Amirkabir University of Technology + +$^{2}$ Dep. of Computer Science, The George Washington University + +$^{3}$ Facebook AI Research + +{p FAR, mabdollahpour}@aut.ac.ir, sardar@gwu.edu, mdiab@fb.com + +# Abstract + +Social media has emerged as a key channel for seeking information. Online users spend several hours reading, posting, and searching for news on microblogging platforms daily. However, this could act as a double-edged sword especially when not all information online is reliable. Moreover, the inherently unmoderated nature of social media renders identifying unverified information ever more challenging. Most of the existing approaches for rumor tracking are not scalable because of their dependency on a significant amount of labeled data. In this work, we investigate this problem from different angles. We design an Active-Transfer Learning (ATL) strategy to identify rumors with a limited amount of annotated data. We go beyond that and investigate the impact of leveraging various machine learning approaches in addition to different contextual representations. We discuss the impact of multiple classifiers on a limited amount of annotated data followed by an interactive approach to gradually update the models by adding the least certain samples (LCS) from the pool of unlabeled data. Our proposed Active Learning (AL) strategy achieves faster convergence in terms of the F-score while requiring fewer annotated samples (42% of the whole dataset for the best model). + +# 1 Introduction + +Rumor detection in social networks is the task of identifying if a post's remark is unverifiable. This detection can help stop the spread of misinformation/dis-information that could potentially cause harm and distress. When a rumor about a subject emerges, there are thousands of posts shared about that subject. Ahsan (2019) show that having abundant in-domain labeled data can significantly impact the accuracy of the rumor detection model on Tweets by more than $30\%$ improvement. This also points to the impact of out-of-domain/topic training on rumor detection per + +formance. However in a real world scenarios for rumor detection, in domain human-annotated data is typically missing in early stages of rumor propagation, resulting in mediocre accuracy levels for such models. A viable solution for this problem would ideally be a framework that yields decent accuracy despite the absence of in-domain manually annotated training data. To this end, this paper proposes a semi-supervised framework based ATL for rumor detection in social media, specifically for Twitter data. There are three main variables for the proposed framework: the representation of the Tweets, the estimator, and the Active Learning strategy. Other experimental variables will be discussed in the following sections. As we evaluate all the different variables, we observe that TweetBERT, linear regression and least confidence strategy yield comparable results as non-Active Learning methods yet with a fraction of human-annotated data needed in non-Active Learning based methods. Further for robustness of our proposed models, we experiment with using an exploration method by choosing some random queries in each loop to prevent the model from overfitting. We also reach an approximation of the minimum labeled data needed for a decent classification in this task with the proposed method. + +# 2 Related Work + +Qazvinian et al. (2011) ran experiments to examine the effect of in-domain labeled data on rumor detection accuracy. They conducted learning curve experiments injecting their training models with labeled data, going from 400 to almost 2000 training examples. The experiments exhibit rapid performance improvement plateauing at an accuracy of $80\%$ . Hamidian and Diab (2016) introduced the Tweet Latent Vector (TLV) feature, which is a 100-d vector that was created by a mixing Twitter features and network-specific features such as Hashtags, URL, Re-Tweets, and Content features such + +as POS and content n-grams, as well as pragmatic features representing Named Entities, Sentiment. In 2019 ACL RumorEval shared task on rumor detection and verification, Derczynski et al. (2017) used a subset of the PHEME dataset in two subtask to identify the stance of comments as well as measure the veracity of the subset of rumor posts. The best models for this task utilized contextualized word embedding such as BERT. Additionally, the models used were mostly deep neural networks with the exception of the best performing model (Li et al., 2019), which was an ensemble of Support Vector Machine, Random Forrest and Logistic Regression. Bhattacharjee et al. (2017) proposed a simple, yet efficient, learning method for fake news detection in a weakly supervised scenario. The proposed method in this work improved generalization ability through interactive human participation by annotating a small amount of relevant samples that provide the most insightful information on the data. Their model was based on GloVe word embeddings and a CNN-based embedding model on the character level with fully connected layers for classification. They evaluated their models on the KDnugget's Fake News dataset1, Liar Dataset, (Wang, 2017) and Harvard Dataverse Twitter Collection. Hasan et al. (2020) proposed an Active Learning framework for fake news detection based on entropy sampling. In this approach, by using just $4\%$ to $28\%$ of available training data, the model achieves a comparable performance to supervised learning with all available labeled training data. Inspired by this latter work, despite inherent differences in the task at hand (rumor detection vs. fake news detection), we believe that similar principles would hold for rumor detection. Accordingly, we propose a novel method for rumor detection that will reduce the need for human annotation in this task. + +# 3 Problem Definition and Approach + +# 3.1 Problem Definition + +We cast the problem of rumor detection as a binary classification task. Tweets are classified as either rumors or non-rumor. We propose a human in the loop annotation strategy. When Tweets about a subject start spreading, and it is not clear whether it is a rumor, the proposed human-in-loop framework gradually trains a classification model specific for the emerged Tweet's subject. We propose a + +framework combining Active Learning with Transfer Learning. In each iteration of the proposed ATL pipeline, a batch of unlabeled Tweets that are the most informative for the model are passed to a human for annotation (similar to an Oracle in the Active Learning literature). This loop continues until the annotation budget is exhausted. + +# 3.2 Active Learning + +In this work, we leverage the most common Active Learning scenario that is the unlabeled pool scenario. This approach is also the most similar to real-life problems. In this scenario, there is a large pool of unlabeled data. The model is at first trained on a small subset of pre-annotated data. Then the framework queries for a batch of unlabeled data to be labeled by a human (oracle) and added to the train set on each iteration. Since annotation may be expensive or time-consuming, it is preferable to run this process as few times as possible. The sample queries are chosen among unused unlabelled data based on their score, and the scoring function is called the strategy in the Active Learning literature. This step is repeated until the annotation budget is exhausted. The algorithm is described in Algorithm1. + +Various strategies are proposed in the literature for data selection in an Active Learning pipeline. Selection based on prediction uncertainty is the most popular approach, which is also applied in this work. + +Least Confidence (LC) Least Confidence (LC) is a strategy based on prediction uncertainty. LC tries to find data samples that the model is not certain about, as a proxy for the model having trouble classifying that data. Certainty is measured as confidence in most likely label as defined in the equation 1 by $\max(y)$ . $y$ is probabilities predicted by the model given $x$ as input and $score(x)$ is the uncertainty measure. + +$$ +\operatorname {s c o r e} (x) = 1 - \max (y) \tag {1} +$$ + +Query by Committee (QBC) In Query by Committee (QBC) strategy, instead of measuring the uncertainty of a single model, we train an ensemble of models. For a given sample, disagreement between models is taken as a measure of uncertainty. There are also two special cases of QBC: bagging (BAG) and boosting (BOOST). In BOOST, we bootstrap random samples with replacement from the available initial data for the committee members. In + +# Algorithm 1: Pool-based Active Learning + +Input: $D_{i}, D_{p}, D_{te}$ , batch size, strategy, estimator, annotation budget + +Output: Model, metrics + +$D_{i}$ Initial data; + +$D_{p}$ Pool data; + +$D_{te}$ Test data; + +Instantiate $D_{tr}$ as empty, Train data; + +Instantiate model; + +Add $D_{i}$ to $D_{tr}$ + +model $=$ estimator.train $(D_{tr})$ + +while annotation budget is not over do + +$D_{q} = \mathrm{Query}(D_{p},\mathrm{batch}$ size,strategy, model); + +Remove $D_q$ from $D_p$ ; + +Annotate $D_q$ ; + +Add $D_{q}$ to $D_{tr}$ ; + +train model on $D_{tr}$ from scratch; + +Compute and save metrics; + +end + +BAG, we perform bootstrapping for both initial and train data. + +Ranked Batch (Batch-LC) We also use the Ranked Batch strategy (Batch-LC) as proposed in Cardoso et al. (2017) which uses a scoring function as in Equation 2 to find a ranked list of query data. + +$$ +\operatorname {s c o r e} = \alpha (1 - \Phi (x, X _ {\text {l a b e l e d}})) + (1 - \alpha) U (x) \tag {2} +$$ + +In Equation 2, $X_{\text{labeled}}$ is the labeled dataset, $U(x)$ is the uncertainty of predictions for $x$ , and $\Phi$ is a similarity function, for instance, cosine similarity. This latter function measures how well the feature space is explored near $x$ . $\alpha$ is also computed by Equation 3. + +$$ +\alpha = \frac {\left| X _ {u n l a b e l e d} \right|}{\left| X _ {l a b e l e d} \right| + \left| X _ {u n l a b e l e d} \right|} \tag {3} +$$ + +After score computation for each sample, the highest scoring sample is removed, and scores are recalculated until the desired number of examples are available to send for the query. + +Epsilon-Greedy (EG) In order to find a balance between exploration and exploitation, we use a method inspired by $\epsilon$ -greedy (EG) strategy in Reinforcement Learning. We implement this approach in two ways: inter-batch and intra-batch. Inter-batch EG (EG-inter) selects query data at each iteration randomly with probability $\epsilon$ otherwise chooses + +the data based on LC $(1 - \epsilon)$ . Intra-batch (EG-Intra) dedicates $\epsilon \%$ of query data to RND and $1 - \epsilon \%$ of that to LC. We use $\epsilon = 0.2$ (20% in EG-intra) in our experiments. + +# 3.3 Cross Topic Transfer + +Data from other domains can be beneficial to improve performance on the target domain. Therefore, we design another type of experiment in which Tweets from other topics are considered in the initial feed to the model (zero shot). The model queries the pooled data at each iteration from the target topic. This is the setting that usually appears in real-world problems. There are datasets from previous topics that can not generalize well to the target topic. However, by choosing a minimum number of data through Active Learning, the model can adapt to the target domain. + +# 4 Experimental Setup + +We compare each experiment with Least Confidence (LC) and random strategy (RND) leveraging different representations, and learning algorithms. In random strategy, data samples are chosen uniformly random at each iteration. To mitigate the effect of randomness in both strategies, training algorithms and data splits, for each experiment, we randomly split the dataset into two sections, first one for initial and pool data and the second one as test data. We do this 5 times, and average the results (in a cross validation type evaluation strategy). For each of these 5 runs, the splits are the same among different experiments. + +At each iteration, Multi-Layer Perceptron (MLP) is retrained on the batch of data annotated in the current iteration since training from scratch would be computationally expensive. However, other models are trained from scratch on data that was obtained in the current and previous iterations. In all experiments, we train the models on 20 randomly chosen samples as the initial dataset and query for 50 samples at each iteration, i.e. batch size $= 50$ . + +After examining all the models and representation settings with LC and RND strategy, the best setting is utilized for further experiments leveraging other sampling strategies such as Query batched committee (QBC), Epsilon-Greedy (EG), and Ranked Batch (Batch-LC). + +# 4.1 Representation + +We use SOTA representations for this task, such as BERT (Devlin et al., 2019) and TweetBERT (Qudar and Mago, 2020). TweetBERT, a domain-specific BERT based language model trained specifically on social media data. TweetBERT was trained on about 680 million Tweets. We also use earlier representations such as GloVe (Pennington et al., 2014). For each sentence, we average the GloVe vector representation of all tokens in the sentence and use it as the input to the models. We use Twitter GloVe, which is consistent with the domain of our work. Twitter GloVe was trained over by 2B Tweets, 27B tokens, and 1.2M vocab. A dimensionality of 200 was determined empirically to yield best results. The representations are frozen during training. + +# 4.2 Model + +We also examine different models that have been mainly used for short text classification tasks, namely, MLP (Hinton, 1990), Support Vector Machines (SVM) (Platt et al., 1999), Random Forests (RF) (Breiman, 2001), Logistic Regression (LR) (Cramer, 2002), Ada boosted decision trees (Ada) (Freund and Schapire, 1997), K-Nearest Neighbors (KNN) (Fix, 1985), Gaussian Process Classifier (GP) (Rasmussen, 2003), Linear Discriminant Analysis (LDA) (Cohen et al., 2003), and Quadratic Discriminant Analysis (QDA) (Tharwat, 2016). + +We used Radial Basis Function (RBF) kernel for SVM with inverse regularization term $C = 1$ . For Random Forest, we used 100 estimators and a max depth of 1000 with the Gini criterion. For Logistic Regression, we used $l_{2}$ penalty and LBFGS (Liu and Nocedal, 1989) solver with a maximum of 100 iterations. For Ada boosted decision tree, we used an ensemble of 50 trees with SAMME.R real boosting (Freund and Schapire, 1997). The MLP had a hidden layer of size 128 and a drop-out layer after the hidden layer with $p = 0.3$ and it was trained by adam optimizer (Kingma and Ba, 2015). We use two KNN models: one with 5 neighbors (KNN5) and the other with 3 neighbors (KNN3). GP is used with an RBF kernel and optimized with the L-BFGS-B (Byrd et al., 1995) algorithm. An SVD solver was used for both LDA and QDA. + +Machine Learning Tools There are some tools and libraries used to build the experimental pipeline. MLP was implemented in Tensorflow $^4$ and for other models (RF, SVM, LR, Ada, KNN, GP, LDA and QDA) we used Scikit-Learn (Pedregosa et al., 2011) package. Active Learning workflows were developed using modAL (Danka and Horvath, 2018) framework. + +# 4.3 Data + +The PHEME dataset is curated from highly retweeted Tweets associated with newsworthy events (Zubiaga et al., 2016). It includes five cases of breaking news: Ferguson unrest, Ottawa shooting, Sydney Siege, Charlie Hebdo shooting, and Germanwings plane crash. It also includes four specific rumors: Prince to play in Toronto, Gurlitt collection, Putin missing, and Michael Essien contracted Ebola. This dataset consists of 6425 Tweets comprising 2402 rumors, and 4023 non-rumors. In this study, we work on Charlie Hebdo, Ferguson, and Sydney Siege since they have the highest number of annotated Tweets in the dataset (more than 1000 Tweets each). In topics with a small number of Tweets, it is not possible to have an unbiased test set and examine the effect of AL on choosing a minimum number of data. For example for a topic with only 100 labeled tweets in dataset, we can not have a reliable test set (at least 1000 samples) and a big pool dataset (100 samples are consumed by AL in 2 iterations) + +Preprocessing The texts of Tweets were processed by changing ""t" to "not", for privacy and generalization changing usernames to "Username", removing punctuation except question marks, removing special characters, removing trailing white space, and changing URLs to "Link". Table 1 shows some samples of this data set. + +# 4.4 Metrics + +We evaluate the performance of models by F1 score instead of accuracy since the test data does not come from a distribution with balanced labels. Moreover, we examine the effectiveness of Active Learning through some additional metrics. For each setting, we compute the F1 score variation in Active Learning loops. Namely, we compute F1 score on points which account for using $0\%$ , $25\%$ , $50\%$ , $75\%$ , and $100\%$ of the pool data. + +
Charlie Hebdo
RumorsNon-rumors
#Charlie Hebdo witness - Gunmen told me to tell the media they were Al-Qaeda in YemenJust arrived at scene of massacre +#Paris #charliehebdo
According to #Charlie Hebdo\u2019s lawyer four well-known French cartoonists were killed by the masked gunmen: Cabu, Wolinski, Charb et Tignous.Anybody who wants to talk about what Charlie Hebdo might have done to \''provoke\" this should probably shut up, forever
+ +Table 1: Tweet samples of PHEME dataset + +In order to determine the minimum amount of data needed for each experiment to achieve a promising result, we consider a minimum number of data samples needed to achieve at least $f_{max} - 1\%$ where $f_{max}$ is the maximum F1 score reached in that experiment. + +# 5 Experimental Results + +# 5.1 Baselines + +We compare the models against two baselines: RANDOM and Majority based on training data observations. RANDOM is simply random prediction. Majority is simply the majority of labels observed in the training data at each iteration are predicted for all samples in the test set. + +# 5.2 Estimator selection + +The proposed method of Active Learning has a base estimator that estimates pool data and predicts the test set. Topics that weren't used in Active Learning loops due to having few Tweets, Ottawa shooting, Germanwings, were used for hyper-parameter tuning in a greedy search base method. + +# 5.3 Results + +Tables 2 shows F1 score at points of using $0\%$ , $25\%$ , $50\%$ , $75\%$ , and $100\%$ of pool data for each experiment. In each column scores go from red to white and green as models consume more data showing how rapidly the model improves. + +# 5.3.1 Model and Representation Comparison + +By examining the results, Logistic Regression yields the best performance among our models, and TweetBERT is the best representation. This is expected since TweetBERT is pretrained on the tweets genre. Interestingly, GloVe representations outperform BERT representations, despite the fact that BERT is known for its more sophisticated architecture yielding contextualized embed + +dings. However, our version of GloVe embeddings is trained on Twitter data. This observation suggests that the genre of the training data has a larger impact on performance than the representation model complexity. TweetBERT+LR with LC strategy achieves the best scores. Experiments with LC strategy perform better than RND. TweetBERT+LR with LC strategy also achieves the best performance with only $25\%$ of data. + +# 5.3.2 Strategy Comparison + +We examine the performance gain of LC in more detail by comparing the difference of F1 score for RND strategy and LC strategy of a fixed setting at points of using $0\%$ , $25\%$ , $50\%$ , $75\%$ , and $100\%$ of pool data for each experiment. Table 2 illustrates some of these observations. For instance, rows $0\%$ and $100\%$ in the table shows where the model has access to same portion of data, whether using LC or RND. Subtracting values in RND column from LC column for LR with TweetBERT yields 0, 2.07, 2.2, 1.33 and 0.03 for each row, respectively. Similarly for rows $25\%$ , $50\%$ , and $75\%$ , we observe the effect of Active Learning such that the differences for most of model-representation pairs would be positive, indicating an improvement over the RND strategy. RF, SVM, and GP get the benefit the most from LC strategy. + +Table 4 compares the performance of uncertainty strategies using best representation-model pairs. Except for QBC, other strategies are very close. Based on our results, Ranked Batch (Batch-LC), boosting (BOOST), and bagging (BAG) yield the best performance, respectively. QBC fails to make a diverse ensemble but when used with BOOST and BAG there are more diverse voters. In each row scores go from red to white and green as models consume more data showing improvement of models. + +Figure 1, 2 and 3 show F1 score for Tweet- + +
ModelAdaGPKNN3KNN5LDA
Stra.LCRNDLCRNDLCRNDLCRNDLCRND
TweetBERT0%58.658.8360.660.664.364.362.7362.7359.8359.83
25%70.3770.4372.5763.570.26971.5770.2768.867.83
50%72.272.676.8768.273.673.3375.0374.368.467
75%74.173.675.3770.6775.3374.9776.174.9364.5362.6
100%74.1774.0772.372.2375.8775.8376.27663.9363.77
GloVe0%60.3759.5358.3358.3364.764.764.2364.2363.663.6
25%70.270.5373.4766.3372.371.2773.0370.964.761.23
50%73.472.977.9771.8375.575.3375.8775.0366.167.23
75%74.773.7776.274.3776.337676.6776.3373.3773.1
100%73.974.0775.3775.476.8376.9777.3777.5376.876.67
BERT0%56.9357.5358.6758.6755.7355.7352.2752.2755.6755.67
25%67.665.9764.6366.9766.4766.7765.866.7370.5771.07
50%70.4368.9368.168.2369.8769.6770.2769.8770.6769.43
75%71.2370.9771.470.0371.0370.5771.6371.5369.5366.5
100%70.571.6771.3371.2771.5771.3371.8371.7763.563.33
ModelLRMLPQDARFSVM
Stra.LCRNDLCRNDLCRNDLCRNDLCRND
TweetBERT0%60.7760.7741.7741.7750.1750.1756.356.343.143.1
25%76.674.5356.4755.6343.8340.274.3367.7343.5341.73
50%78.676.475.6369.4328.1332.7375.1370.2754.5355.17
75%78.9377.669.5771.8734.9335.8373.571.3763.761.03
100%78.578.4771.6774.1737.4338.1372.0372.465.9366.03
GloVe0%59.459.445.3742.9751.6751.6758.8758.8750.1750.17
25%75.973.1356.9357.7747.544.1774.467.6769.1761.37
50%78.4776.17470.3738.946.0376.2371.1375.8371.2
75%78.277.5375.0774.1342.2742.3374.6772.776.375.43
100%78.2778.2776.8376.747.9747.774.374.0377.4777.3
BERT0%58.2758.2746.6343.8349.749.753.4753.4743.143.1
25%73.3372.564.7365.7351.950.577058.365.0745.53
50%76.8774.5772.0369.9750.651.5368.8763.2762.754.87
75%76.7775.5373.572.9352.3752.3766.964.863.260.67
100%76.8376.7773.473.5749.250.0366.666.5764.1364.1
+ +Table 2: F1 score at points of using $0\%$ , $25\%$ , $50\%$ , $75\%$ , and $100\%$ of pool data for each experiment with all representations and model representations. The scores are averaged over the three chosen topics in the PHEME dataset. Baseline RANDOM prediction baseline achieves $26.98\%$ F1 score, and Baseline Majority prediction baseline achieves $40.90 \pm 3.3\%$ . Intensity of color green shows high F1 scores, red show low F1 scores and white for inbetween F1 scores. + +
Approach0%25%50%75%100%
Few Shot60.76776.678.678.93378.5
Zero Shot50.157.565.86769.671.033
+ +Table 3: F1 score for TweetBERT+LR with LC strategy using $0\%$ , $25\%$ , $50\%$ , $75\%$ and $100\%$ of pool dataset. The scores are averaged over three chosen topics in PHEME dataset. In the Zero Shot setting, the initial dataset includes other topics, as opposed to the Few Shot setting, in which, initial training data consists of 20 samples of the target topic. Intensity of color green shows high F1 scores, red show low F1 scores and white for inbetween F1 scores + +
RepresentationModelStrategy0%25%50%75%100%
TweetBERTLRQBC64.766.870.369.368.3
BAG60.775.479.06779.53379
Batch_LC64.76776.478.879.26779.167
BOOST60.775.479.379.76779.033
EG_intra64.977.53378.16778.378.133
EG_inter52.775.277.13378.26778
LC60.76776.678.678.93378.5
GloVeLRQBC65.265.368.267.367.6
BAG59.93375.178.73378.678.767
Batch_LC64.13375.678.96778.86778.8
BOOST59.93375.178.778.678.767
LC59.475.978.46778.278.267
+ +Table 4: F1 score for advanced strategies of a fixed setting at points of using $0\%$ , $25\%$ , $50\%$ , $75\%$ and $100\%$ of pool data for best representation-estimator pairs. The scores are average over three chosen topics in PHEME dataset. Intensity of color green shows high F1 scores, red show low F1 scores and white for inbetween F1 scores. + +BERT+LR with different uncertainty strategies. The diagrams indicate that most models plateau with 100-200 data samples and are able to achieve decent performance with a small amount of data. Most models have a large gain with 100-200 (well-chosen with AL) data samples and there is a small gain after having more than 200 samples. Our best model (TweetBBERT+LR with BATCH-LC) achieves at least $f_{max} - 1\%$ with 250, 300 and 250 data samples from pool data for each topic. ( $f_{max}$ being maximum of F1 score reached in that experiment) On average, it achieves at least $f_{max} - 1\%$ with $42\%$ of pool data (There are 1039, 571, 610 samples in pool dataset of each topic). + +# 5.3.3 Cross-Topic Evaluation + +Table 3 compares best performing model-representation pair with LC strategy starting from two different initial training datasets. The initial training dataset in zero-shot approach is all data for all topics except the target topic. The initial training dataset of few-shot approach contains a minimal number of in topic in domain samples. We experiment with 20 samples of the target topic. We observe that only a few topic-related samples perform much better than a large dataset of samples, namely, the few shot setting outperforms the zero shot setting as observed in the $0\%$ of pool data column in Table 3. Data from other domains/topics causes a high variance, which takes many related samples for the model to converge onto reasonable performance. The results demonstrated that Tweets from other rumor topics can add some bias to the model and make the model degrade in performance. + +![](images/6a60f44174d18b81118fc3ba10d24510598a352c9e2f86f3ca3e9fbb953e1dfb.jpg) +Figure 1: Performance of different strategies with TweetBERT+LR on the Charlie Hebdo topic. The Verticals axis shows F1 score and the horizontal axis shows number of data samples used for training during Active Learning. + +# 6 Error Analysis + +The confusion matrix for TweetBERT+LR with EG-intra strategy on the Sydney Siege topic for different steps is shown in Table 5. We see that the performance gain is majorly the result of decreasing false negatives. Confusion matrix for other topics also showed a similar behaviour. The model ability to detect rumors improves with the amount of data compared to ability to detect non-rumors. Since, model is able to encode better boundaries for rumors, while non-rumors might be diverse. + +![](images/01f0a769ece7b94668264c9d98b4c9950b36d74ee8fa481838a623bb1549b6a1.jpg) +Figure 2: Performance of different strategies with TweetBERT+LR on the Sydney Siege topic. The Verticals axis shows F1 score and the horizontal axis shows number of data samples used for training during Active Learning. + +
TNFPFNTP
0%44.4212.1419.4024.02
25%45.3211.2410.8832.54
50%46.589.9810.3833.04
75%47.259.3110.2133.21
100%47.459.1110.8832.54
+ +Table 5: Confusion matrix on Sydney siege topic, averaged over 5 runs. Numbers in the columns are percentages of True Negatives (NT), False Positives (FP), False Negatives (FN) and True Positives (TP), respectively. These numbers of average of number in 5 runs. The First column shows percentage of pool data consumed by the model. + +# 7 Conclusion & Future Directions + +We proposed an active-transfer learning framework for the rumor detection task. In our proposed framework, we examined different word representations, estimators and Active Learning strategies. More than 300 experimental setups were run and each setup was fine tuned to yield the best results. Our experiments indicate multiple new findings: 1. The approximate minimum number of labeled in-domain data needed for a decent rumor detection model with our proposed method is around 200; 2. In-genre pretrained (contextualized) LMs have the biggest impact on model performance; 3. We investigate and empirically show how epsilon + +![](images/b5ac668dbe90c7c68bc913c92fc5daa4aaabafcab4abf8a0e35dfaa2df7c01ba.jpg) +Figure 3: Performance of different strategies with TweetBERT+LR on the Ferguson topic. The Verticals axis shows F1 score and the horizontal axis shows number of data samples used for training during Active Learning. + +greedy inspired methods that joins randomness and uncertainty in query selection could prevent the model from over-fitting; and, 4. We also showed that naive use of Tweets relating to other topics can degrade the performance (the zero shot setting). Although the method proposed in this paper did not show improvement in using data from other topics, information from different topics can be exploited by incorporating other techniques such as weighting the data samples or meta-learning few-shot domain adaptation. Diverse initial datasets may yield an initial model with better uncertainty scores and earlier convergence. The next step for this method would be incorporating metadata such as reply stances, user information, network propagation information, etc. Finally, another method that could improve our proposed model would be using an ensemble of different representations and different models to generalize better. + +# 8 Ethical Considerations + +# 8.1 NLP Application + +Misuse Potential and Failure Mode When used as intended, applying the strategy described in this paper can help to use the minimum amount of labeled data to identify new emerging rumors online. However, the annotation volume might be inconsistent in some rumors with high variants. This may lead to Failure and high bias. Further research is needed to address the rumor identification issues for emerging rumors, as this issue is present among all current methodologies. + +Environmental Cost The experiments described in the paper use a single CPU for all the machine learning models except MLP, which used GPUs. The experiments may take several hours. Several dozen experiments were run due to parameter search for all the models, and future work should experiment with distilled models for more lightweight training. We note that while our work required extensive experiments to draw sound conclusions, future work will be able to draw on these insights and need not run as many large-scale comparisons. Models in production may be trained once for use using the most promising settings. + +# References + +Mohammad Ahsan. 2019. Detection of context-varying rumors on twitter through deep learning. 128:45-58. +Sreyasee Das Bhattacharjee, Ashit Talukder, and Bala Venkatram Balantrapu. 2017. Active learning based news veracity detection with feature weighting and deep-shallow fusion. In 2017 IEEE International Conference on Big Data, BigData 2017, Boston, MA, USA, December 11-14, 2017, pages 556-565. IEEE Computer Society. +Leo Breiman. 2001. Random forests. Machine learning, 45(1):5-32. +Richard H Byrd, Pei Huang Lu, Jorge Nocedal, and Ciyou Zhu. 1995. A limited memory algorithm for bound constrained optimization. SIAM Journal on scientific computing, 16(5):1190-1208. +Thiago NC Cardoso, Rodrigo M Silva, Sérgio Canuto, Mirella M Moro, and Marcos A Gonçalves. 2017. Ranked batch-mode active learning. Information Sciences, 379:313-337. +Jacob Cohen, Patricia Cohen, Stephen G West, and Leona S Aiken. 2003. Applied multiple regression. Correlation Analysis for the Behavioral Sciences, 3. + +Jan Salomon Cramer. 2002. The origins of logistic regression. +Tivadar Danka and Peter Horvath. 2018. modAL: A modular active learning framework for Python. Available on arXiv at https://arxiv.org/abs/1805.00979. +Leon Derczynski, Kalina Bontcheva, Maria Liakata, Rob Procter, Geraldine Wong Sak Hoi, and Arkaitz Zubiaga. 2017. SemEval-2017 task 8: RumourEval: Determining rumour veracity and support for rumours. In Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval-2017), pages 69–76, Vancouver, Canada. Association for Computational Linguistics. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 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, Volume 1 (Long and Short Papers), pages 4171-4186, Minneapolis, Minnesota. Association for Computational Linguistics. +Evelyn Fix. 1985. Discriminatory analysis: nonparametric discrimination, consistency properties, volume 1. USAF school of Aviation Medicine. +Yoav Freund and Robert E Schapire. 1997. A decision-theoretic generalization of on-line learning and an application to boosting. Journal of computer and system sciences, 55(1):119-139. +Sardar Hamidian and Mona Diab. 2016. Rumor identification and belief investigation on Twitter. In Proceedings of the 7th Workshop on Computational Approaches to Subjectivity, Sentiment and Social Media Analysis, pages 3-8, San Diego, California. Association for Computational Linguistics. +Md Saqib Hasan, Rukshar Alam, and Muhammad Abdullah Adnan. 2020. Truth or lie: Pre-emptive detection of fake news in different languages through entropy-based active learning and multi-model neural ensemble. pages 55-59. +Geoffrey E Hinton. 1990. Connectionist learning procedures. artificial intelligence, 40 1-3: 185 234, 1989. reprinted in j. carbonell, editor,". Machine Learning: Paradigms and Methods", MIT Press. +Diederik P. Kingma and Jimmy Ba. 2015. 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. +Quanzhi Li, Qiong Zhang, and Luo Si. 2019. eventAI at SemEval-2019 task 7: Rumor detection on social media by exploiting content, user credibility and propagation information. In Proceedings of the 13th International Workshop on Semantic Evaluation, pages 855-859, Minneapolis, Minnesota, USA. Association for Computational Linguistics. + +Dong C Liu and Jorge Nocedal. 1989. On the limited memory bfgs method for large scale optimization. Mathematical programming, 45(1):503-528. +F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. 2011. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825-2830. +Jeffrey Pennington, Richard Socher, and Christopher Manning. 2014. GloVe: Global vectors for word representation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1532-1543, Doha, Qatar. Association for Computational Linguistics. +John Platt et al. 1999. Probabilistic outputs for support vector machines and comparisons to regularized likelihood methods. Advances in large margin classifiers, 10(3):61-74. +Vahed Qazvinian, Emily Rosengren, Dragomir R. Radev, and Qiaozhu Mei. 2011. Rumor has it: Identifying misinformation in microblogs. In Proceedings of the 2011 Conference on Empirical Methods in Natural Language Processing, pages 1589-1599, Edinburgh, Scotland, UK. Association for Computational Linguistics. +Mohiuddin Md Abdul Qudar and Vijay Mago. 2020. Tweetbert: A pretrained language representation model for twitter text analysis. arXiv preprint arXiv:2010.11091. +Carl Edward Rasmussen. 2003. Gaussian processes in machine learning. In Summer school on machine learning, pages 63-71. Springer. +Alaa Tharwat. 2016. Linear vs. quadratic discriminant analysis classifier: a tutorial. International Journal of Applied Pattern Recognition, 3(2):145-180. +William Yang Wang. 2017. "liar, liar pants on fire": A new benchmark dataset for fake news detection. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 422-426, Vancouver, Canada. Association for Computational Linguistics. +Arkaitz Zubiaga, Maria Liakata, Rob Procter, Geraldine Wong Sak Hoi, and Peter Tolmie. 2016. Analysing how people orient to and spread rumours in social media by looking at conversational threads. PLoS ONE, 11(3). \ No newline at end of file diff --git a/activelearningforrumoridentificationonsocialmedia/images.zip b/activelearningforrumoridentificationonsocialmedia/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..e6cd1c68cf144ec1355197396dab013f153502ba --- /dev/null +++ b/activelearningforrumoridentificationonsocialmedia/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ced1a9bac05b4583dff4ed95f4b3dcf0ee77b9c89688e6da95f45b5b2ac3ed5 +size 621465 diff --git a/activelearningforrumoridentificationonsocialmedia/layout.json b/activelearningforrumoridentificationonsocialmedia/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ace0989ad4871e00febe44b96189afa765c6aa7a --- /dev/null +++ b/activelearningforrumoridentificationonsocialmedia/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f99ffa1ece1a27f8c7ee4ed5462d2d0e85747c983850d6354909a387bb69c88c +size 308576 diff --git a/adaptingentitiesacrosslanguagesandcultures/b83b9238-122e-4491-b8bb-76c1f417091d_content_list.json b/adaptingentitiesacrosslanguagesandcultures/b83b9238-122e-4491-b8bb-76c1f417091d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..fa0b677a5f97b53e6cb33e7175c4dc7faafaa693 --- /dev/null +++ b/adaptingentitiesacrosslanguagesandcultures/b83b9238-122e-4491-b8bb-76c1f417091d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:61c158aea3e8acb7a5580906840139f6cfe0e49a24009040b6258432e6cff626 +size 129427 diff --git a/adaptingentitiesacrosslanguagesandcultures/b83b9238-122e-4491-b8bb-76c1f417091d_model.json b/adaptingentitiesacrosslanguagesandcultures/b83b9238-122e-4491-b8bb-76c1f417091d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..3c6d23157d7404e2c58d1ee3accde035db471f59 --- /dev/null +++ b/adaptingentitiesacrosslanguagesandcultures/b83b9238-122e-4491-b8bb-76c1f417091d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ae27ed69c14ee594497a5998b0f73b122588e6f101960ae2d58c2f4690fb760 +size 149960 diff --git a/adaptingentitiesacrosslanguagesandcultures/b83b9238-122e-4491-b8bb-76c1f417091d_origin.pdf b/adaptingentitiesacrosslanguagesandcultures/b83b9238-122e-4491-b8bb-76c1f417091d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f4252d918948da60cf4ed444d89dc03da54fc756 --- /dev/null +++ b/adaptingentitiesacrosslanguagesandcultures/b83b9238-122e-4491-b8bb-76c1f417091d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0674e79b3982da5fe7467893bab51f5d5a8b826a7a407600a6d77b570a3f94f3 +size 879890 diff --git a/adaptingentitiesacrosslanguagesandcultures/full.md b/adaptingentitiesacrosslanguagesandcultures/full.md new file mode 100644 index 0000000000000000000000000000000000000000..bf3b47dff3bafa0a9f01ad42ec81fa2fdbea48fd --- /dev/null +++ b/adaptingentitiesacrosslanguagesandcultures/full.md @@ -0,0 +1,478 @@ +# Adapting Entities across Languages and Cultures + +Denis Peskov + +Computer Science University of Maryland + +dpeskov@umd.edu + +Viktor Hangya + +Center for Information and Language Processing LMU Munich + +hangyav@cis.lmu.de + +Jordan Boyd-Graber + +CS, LSC, UMIACS, and iSchool + +University of Maryland + +jbg@umiacs.umd.edu + +Alexander Fraser + +Center for Information and Language Processing + +LMU Munich + +fraser@cis.lmu.de + +# Abstract + +How would you explain Bill Gates to a German? He is associated with founding a company in the United States, so perhaps the German founder Carl Benz could stand in for Gates in those contexts. This type of translation is called adaptation in the translation community (Vinay and Darbelnet, 1995). Until now, this task has not been done computationally. Automatic adaptation could be used in natural language processing for machine translation and indirectly for generating new question answering datasets and education. We propose two automatic methods and compare them to human results for this novel NLP task. First, a structured knowledge base adapts named entities using their shared properties. Second, vector arithmetic and orthogonal embedding mappings identify better candidates, but at the expense of interpretable features. We evaluate our methods through a new dataset1 of human adaptations. + +# 1 When Translation Misses the Mark + +Imagine reading a translation from German, "I saw Merkel eating a Berliner from Dietsch on the ICE". This sentence is opaque without cultural context. + +An extreme cultural adaptation for an American audience could render the sentence as "I saw Biden eating a Boston Cream from Dunkin' Donuts on the Acela", elucidating that Merkel is in a similar political post to Biden; that Dietsch (like Dunkin' Donuts) is a mid-range purveyor of baked goods; both Berliners and Boston Creams are filled, sweet pastries named after a city; and ICE and Acela are slightly ritzier high-speed trains. Human translators make this adaptation when it is appropriate to the translation (Gengshen, 2003). + +# Bill Gates + +Top Adaptations: + +WikiData + +F. Zeppelin + +Günther Jauch + +N. Harnoncourt + +3CosAdd + +constar + +Alnatura + +GMX + +Human + +A. Bechtolsheim + +Dietmar Hopp + +Carl Benz + +Table 1: WikiData and unsupervised embeddings (3CosAdd) generate adaptations of an entity, such as Bill Gates. Human adaptations are gathered for evaluation. American and German entities are color coded. + +Because adaptation is understudied, we leave the full translation task to future work. Instead, we focus on the task of cultural adaptation of entities: given an entity in a source, what is the corresponding entity in English? Most Americans would not recognize Christian Drosten, but the most efficient explanation to an American would be to say that he is the "German Anthony Fauci" (Loh, 2020). We provide top adaptations suggested by algorithms and humans for another American involved with the pandemic response, Bill Gates, in Table 1. + +Can machines reliably find these analogs with minimal supervision? We generate these adaptations with structured knowledge bases (Section 3) and word embeddings (Section 4). We elicit human adaptations (Section 5) to evaluate whether our automatic adaptations are plausible (Section 5.3). + +# 2 Wer ist Bill Gates? + +We define cultural adaptation and motivate its application for tasks like creating culturally-centered training data for QA. Vinay and Darbelnet (1995) define adaptation as translation in which the relationship not the literal meaning between the receiver and the content needs to be recreated. + +You could formulate our task as a tradi- + +tional analogy Drosten::Germany as Fauci::United States (Turney, 2008; Gladkova et al., 2016), but despite this superficial resemblance (explored in Section 4), traditional approaches to analogy ignore the influence of culture and are typically within a language. Hence, analogies are tightly bound with culture; humans struggle with analogies outside their culture (Freedle, 2003). + +We can use this task to identify named entities (Kasai et al., 2019; Arora et al., 2019; Jain et al., 2019) and for understanding other cultures (Katan and Taibi, 2004). + +# 2.1 ... and why Bill Gates? + +This task requires a list of named entities adaptable to other cultures. Our entities come from two sources: a subset of the top 500 most visited German/English Wikipedia pages and the non-official characterization list (Veale, 2016, NOC), “a source of stereotypical knowledge regarding popular culture, famous people (real and fictional) and their trade-mark qualities, behaviours and settings”. Wikipedia contains a plethora of singers and actors; we filter the top 500 pages to avoid a pop culture skew. We additionally select all Germans and a subset of Americans from the Veale NOC list as it is human-curated, verified, and contains a broader historical period than popular Wikipedia pages. Like other semantic relationships (Boyd-Graber et al., 2006), this is not symmetric. Thus, we adapt entities in both directions; while Berlin is the German Washington, DC, there is less consensus on what is the American Berlin, as Berlin is both the capital, a tech hub, and a film hub. A full list of our entities is provided in Appendix D. + +# 3 Adaptation from a Knowledge Base + +We first adapt entities with a knowledge base. We use WikiData (Vrandecic and Krötzsch, 2014), a structured, human-annotated representation of Wikipedia entities that is actively developed. This resource is well-suited to the task as features are standardized both within and across languages. + +Many knowledge bases explicitly encode the nationality of individuals, places, and creative works. Entities in the knowledge base are a discrete sparse vector, where most dimensions are unknown or not applicable (e.g., a building does not have a spouse). + +For example, Angela Merkel is a human (instance of), German (country of citizenship), politician (occupation), Rotarian (member of), Lutheran (religion), 1.65 meters tall (height), and has a PhD (academic degree). How would we find the "most similar" American adaptation to Angela Merkel? Intuitively, we should find someone whose nationality is American. + +Some issues immediately present themselves; contemporary entities will have more non-zero entries than older entities. Some characteristics are more important than others: matching unique attributes like "worked as journalist" is more important than matching "is human". + +Each entity in WikiData has "properties", which we can think about as the dimension of a sparse vector and "values" that those properties can take on. For example, Merkel has the properties "occupation" and "academic degree". Values for those properties are that her "occupation" is "politician" and her "academic degree" is a "doctorate". To match entities across cultures, we focus on matching properties rather than values; many of the values are more relevant inside a culture. For example, we cannot find American politicians who belong to the Christian Democratic Union, but we can find politicians who have an academic degree and a dissertation title. + +As a toy example, if Beethoven, Merkel, and Bach all have only two properties: Beethoven has an "occupation" and "genre", Merkel has an "Erdős number" and "political party", and Bach has a "occupation" and "genre", then Beethoven and Bach has a distance of zero and are the closest entities while Merkel has a distance of two since {"Erdős number", "political party"} is two away from {"occupation", "genre)}. + +First, we bifurcate WikiData into two sets: an American set $\mathcal{A}$ for items which contain the value "United States of America" and a German set $\mathcal{D}$ for those with German values. This is a liberal approximation, but it successfully excludes roughly seven out of the eight million items in WikiData. Then we explore the properties from WikiData. We create entity vectors with dimensions corresponding to frequently-occurring properties. + +The properties are discrete and categorical; Merkel either has an "occupation" or she does not. Each entity then has a sparse vector. We calculate the similarity of the vectors with Faiss's $L_{2}$ distance (Johnson et al., 2021) and for each vector in $\mathcal{A}$ find the closest vector in $\mathcal{D}$ and vice versa. + +So who is the American Angela Merkel? One possible answer is Woodrow Wilson, a member of a "political party", who had a "doctoral advisor" and a "religion", and ended up with "awards". This answer may be unsatisfying as it was Barack Obama who sat across from Merkel for nearly a decade. To capture these more nuanced similarities, we turn to large text corpora in Section 4. + +# 4 An Alternate Embedding Approach + +While the classic NLP vector example (Mikolov et al., 2013c) isn't as magical as initially claimed (Rogers et al., 2017), it provides useful intuition. We can use the intuitions of the cliché: + +$$ +\overrightarrow {\text {K i n g}} - \overrightarrow {\text {M a n}} + \overrightarrow {\text {W o m a n}} = \overrightarrow {\text {Q u e e n}} \tag {1} +$$ + +to adapt between languages. + +This, however, requires relevant embeddings. First, we use the entire Wikipedia in English and German, preprocessed using Moses (Koehn et al., 2007). We follow Mikolov et al. (2013b) and use named entity recognition (Honnibal et al., 2020) to tokenize entities such as Barack_Obama. + +We use word2vec (Mikolov et al., 2013b), rather than FastText (Bojanowski et al., 2017), as we do not want orthography to influence the similarity of entities. Angela Merkel in English and in German have quite different neighbors, and we intend to keep it that way by preserving the distinction between languages. + +However, the standard word2vec model assumes a single monolingual embedding space. We use unsupervised Vecmap (Artetxe et al., 2018), a leading tool for creating cross-lingual word embeddings, to build bilingual word embeddings. We propose two approaches for adaptation. + +3CosAdd We follow the word analogy approach of $3\mathrm{CosAdd}^4$ (Levy and Goldberg, 2014; Köper et al., 2016). American $\rightarrow$ German adaptation takes the source entity's $(v)$ embedding in the English vector space and looks for its adaptation $(u^{*})$ based on embeddings in the German space. This is like the word analogy task, i.e., what entity has the + +role in the German culture as $v$ does in American culture. As an example, Merkel has a similar role in the German culture as Biden. Formally, the adaptation of the English entity $v$ into German is + +$$ +\vec {a} \equiv \operatorname {a v g} \left(\overrightarrow {E ^ {e n}} _ {\text {U n i t e d S t a t e s}}, \overrightarrow {E ^ {d e}} _ {\text {U S A}}\right) \tag {2} +$$ + +$$ +\vec {d} \equiv \operatorname {a v g} \left(\overrightarrow {E ^ {e \vec {n}}} _ {\text {G e r m a n y}}, \overrightarrow {E ^ {d e}} _ {\text {D e u t s c h l a n d}}\right) \tag {3} +$$ + +$$ +u ^ {*} = \underset {u \in V ^ {d e}} {\arg \max } \operatorname {s i m} \left(\overrightarrow {E _ {u} ^ {d e}}, \overrightarrow {E _ {v} ^ {e n}} - \overrightarrow {a} + \overrightarrow {d}\right), \tag {4} +$$ + +where $\overrightarrow{E_w^l}$ is the embedding of word $w$ in language $l$ , $V^{de}$ is the German vocabulary and sim is the cosine similarity. The American anchor word $\vec{a}$ and German anchor $\vec{d}$ represent the American and German cultures. We average the English and German embeddings of the individual word types for robust anchor vectors. In standard analogies, as in Equation 1, the $\vec{a}$ and $\vec{d}$ vectors are different for each test pair; here they are the same for each example, as we always are pivoting between the two cultures. + +Learned adaptation To eliminate the need for manual anchor selection for both cultures, our second approach learns the adaptation as a linear transformation of source embeddings to the target culture given a few adaptation examples. Specifically, we use the human adaptations sourced for the Wikipedia entities as training for the Veale NOC ones. We follow the work of Mikolov et al. (2013a) and learn a transformation matrix $\mathbf{W}_{en\rightarrow de}$ for American $\rightarrow$ German by minimizing the $L_{2}$ distance of $\mathbf{W}_{en\rightarrow de}\overrightarrow{E}_{vi}^{en}$ and $\overrightarrow{E}_{ui}^{de}$ over gold adaptation $v_{i},u_{i = 1}^{n}$ entity pairs. The adaptation of a source entity $v$ is $u^{*} = \mathbf{W}_{en\rightarrow de}\overrightarrow{E}_{v}^{en}$ . Likewise, we learn the reverse mapping $\mathbf{W}_{de\rightarrow en}$ for German $\rightarrow$ American adaptation. This requires supervised training data—but not much (Conneau et al., 2018)—which we collect in Section 5. + +# 5 Comparing Automation to Human Judgment + +The automated methods can generate entities at scale, but humans have to evaluate their relevance. + +# 5.1 Adaptation by Locals + +Since quality control is difficult for generation (Peskov et al., 2019), we need users who + +will answer the task accurately. We recruit five American citizens educated at American universities and five German citizens educated at German ones. These human annotations serve as a gold standard against which we can compare our automated approaches. To improve the user experience, we create an interface that provides a brief summary of each source entity from Wikipedia and asks the users to select a target adaptation that autocompletes Wikipedia page titles (all entities; targets are not limited to the lists in Section 2) in a text box $a$ la answer selection in Wallace et al. (2019). The annotation task requires two hours for our users to complete. Obviously, German annotators are more familiar with German culture than the Americans, and vice-versa. Annotators translate into their native language. Since we are focusing on popular entities, they are often known despite the cultural divide, but the introductory paragraph from Wikipedia reminds users if not. + +# 5.2 Are the Adaptations Plausible? + +To validate and compare all our adaptation strategies' precision, five German translators who understand American culture assess the adaptations. The top five adaptations from WikiData, 3CosAdd, learned adaptation, and humans—as well as five randomly selected options from the human pool—are evaluated for plausibility on a five-level Likert scale. $^{7}$ Fleiss' Kappa (0.382) and Krippendorf's Alpha (0.381) assess interannotator Agreement; this "fair" agreement suggests that vetting an adaptation is challenging and sometimes subjective, even for translators. + +# 5.3 Why Adaptation is Difficult + +Embedding adaptations are better than Wikidata's, and human adaptations are better still (Figure 1). Thus, we use human adaptations as the gold standard for evaluating recall. Only the learned embedding method uses training data, so we use human adaptations from Wikipedia to train the projection matrix and evaluate (for all methods) using human adaptations the NOC list. Given that the task is subjective, we take our results with a grain of salt given cultural variation (e.g., some people view Angela Merkel's conservatism as a defining characteristic, while others focus on her science pedigree). + +![](images/1f34691a853b4c6ef7e6456e417a8ea3b7b4e2254652c2ac91374dee5f2f93ae.jpg) +Figure 1: We validate adaptation strategies with expert translators on a five-point Likert scale. The human-generated adaptations are rated best—between "related" (3) and "similar" (4). These human adaptations become the reference for evaluation in Table 2. + +
DataMetricWikiData3CosAddLearned
American→German
WikipediaRec@57.5%14.2%-
Rec@10034.4%52.8%-
MRR0.050.10-
Veale NOCRec@53.0%22.9%28.6%
Rec@10042.4%51.4%45.7%
MRR0.030.170.24
German→American
WikipediaRec@53.1%17.2%-
Rec@10015.4%40.5%-
MRR0.010.12-
Veale NOCRec@50.0%25.0%25.0%
Rec@10025.0%70.0%55.0%
MRR0.020.120.15
+ +Table 2: If we consider human adaptations as correct, where do they land in the ranking of automatic adaptation candidates? In this recall-oriented approach, learned mappings (which use a small number of training pairs), rate highest. + +We use the mean reciprocal rank (Voorhees, 1999, MRR) to measure how high the gold adaptations are ranked by our other adaptation strategies. Since MRR decreases geometrically and our gold standard is not exhaustive, the Recall@5, and @100 metrics are more intuitive. We calculate Recall@n by measuring what fraction of the correct adaptations of a source entity is retrieved in the top n predictions. Table 2 validates that the human annotations are near the top of the automatic adaptations; the precision-oriented evaluation (Figure 1) validates whether the top of the list is reasonable. All human annotations and a sample of the automatic adaptations are provided in Appendix D. + +# 5.4 Qualitative Analysis + +There is no single answer to what makes a good adaptation. Let us return to the question of who Bill Gates is, which underlines how there is often no one right answer to this question but several context-specific possibilities. The human adaptations show the range of plausible adaptations, each appropriate for a particular facet of the position Bill Gates has in US society. As previously mentioned, Carl Benz represents a larger than life founder who created an entire industry with his company. However, Carl Benz made cars, not computers. + +Even within technology, different adaptations highlight different aspects of Bill Gates. Like the implementer of the BASIC programming language, Konrad Zuse contributed to computers that were more than single-purpose machines. Just as as Bill Gates's Microsoft is seen as a stodgy tech giant, Dietmar Hopp founded SAS, a giant German tech company that is more often discussed in board rooms than in living rooms. And because the epicenter of modern tech is America's West Coast, Andreas von Bechtolsheim represents a German founder of Sun Microsystems and early Google investor that made his way to Silicon Valley. + +Other times, there is more consensus: a majority of raters declare Angela Merkel is the German Hilary Clinton, and Joseph Smith is the American Martin Luther. There are even some unanimous adaptations: Bavaria is the German California. Adaptations of fictional characters seem particularly difficult, although this may represent the supremacy of American popular culture; Superman and Homer Simpson are so well known in Germany that there are no clear adaptations; Till Eulenspiegel, Maverick, Bibi Blocksberg are not superheroes from a dying world and Heidi is not a dumb, bald everyman. + +# 6 A New Computational Task + +We formally introduce entity adaptation as a new computational task. Word2vec embeddings and WikiData can be used to figuratively—not just literally—translate entities into a different culture. Humans are better at generating candidates for this task than our computational methods (Figure 1). These methods are well-motivated, but have room for improvement. Knowledge bases improve over time and increased coverage of entities—as well as improved information about each entity—would improve the method. Alternate + +word embedding approaches—perhaps those that discard orthography—may provide better candidates. Even humans occasionally disagree with other humans on this task, so evaluation for this task is nontrivial. + +Our new dataset of machine-generated adaptations, human adaptations, and human evaluation of these adaptations can serve as an evaluation for future automatic methods. + +People need NLP systems that reflect their language and culture, but datasets are lacking: adaptation can help. There has been an explosion of English-language QA datasets, but other languages continue to lag behind. Several approaches try to transfer English's bounty to other languages (Lewis et al., 2020; Artetxe et al., 2019), but most of the entities asked about in major QA datasets are American (Gor et al., 2021). Adapting entire questions will require not just adapting entities and non-entities in tandem but will also require integration with machine translation (Kim et al., 2019; Hangya and Fraser, 2019). Our automatic methods did not create precise adaptations, but the alternative "incorrect" adaptations may be useful for low-precision tasks, such as generating numerous simple open-ended questions or gauging the popularity of a entity. + +Given the existence of robust datasets in high resource languages can we adapt, rather than literally translate, them to other cultures and languages? + +# 7 Acknowledgments + +Peskov was supported by a DAAD Research Fellowship and by the wonderful faculty and students of Ludwig Maximilians Universität München. Fraser is supported by the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme (grant agreement No. 640550) and by German Research Foundation (DFG; grant FR 2829/4-1). Boyd-Graber is supported by NSF Grant IIS-1822494. Any opinions, findings, conclusions, or recommendations expressed here are those of the authors and do not necessarily reflect the view of the sponsors. + +We thank Sander Schulhoff for his web development expertise and Pedro Rodriguez for his help with processing WikiData. Thanks to Phillip Dufter, Benno Krojer, Stephan Huber, Janika Linke, Andrew Guo, Adam Visokay, Christian Rice, Connor Knight, and others for help with adaptations. + +# Ethics + +We worked with human participants to collect our data. They are all adults who participated of their own volition and no payment was made. No personal data was collected or used for the dataset. For evaluation of the adaptations, we hired translators through Upwork. They were paid $40 for a task that took roughly between one and two hours. + +The broad motivation of this work is to spread cultural understanding. Humans must be kept in the-loop for making claims about cultural relevance. Having multiple diverse opinions is necessary for supporting any cultural claim. Like with language, nationality is often correlated with culture, but is not synonymous. Large countries contain multitudes, while some nationalities (e.g., Kurds) lack a de jure nation but span many nations. We elide this detail and focus on information often available in knowledge bases. + +These lists contain figures that are controversial. From a research perspective, research datasets should reflect the real world and prior work, thus we include prominent entities as identified by Veale NOC and Wikipedia. Any list may contain biases in the collection processes, and this should not be thought of as an exclusive and definitive list, but as a start that can be refined and ultimately expanded to other cultures. + +# References + +Ravneet Arora, Chen-Tse Tsai, Ketevan Tsereteli, Prabhanjan Kambadur, and Yi Yang. 2019. A semi-Markov structured support vector machine model for high-precision named entity recognition. In Proceedings of the Association for Computational Linguistics. +Mikel Artetxe, Gorka Labaka, and Eneko Agirre. 2018. A robust self-learning method for fully unsupervised cross-lingual mappings of word embeddings. In Proceedings of the Association for Computational Linguistics. +Mikel Artetxe, Sebastian Ruder, and Dani Yogatama. 2019. On the cross-lingual transferability of monolingual representations. CoRR, abs/1910.11856. +Piotr Bojanowski, Edouard Grave, Armand Joulin, and Tomas Mikolov. 2017. Enriching word vectors with subword information. In Proceedings of the Association for Computational Linguistics. +Jordan Boyd-Graber, Christiane Fellbaum, Daniel Osherson, and Robert Schapire. 2006. Adding dense, weighted, connections to WordNet. In Proc. Global + +WordNet Conference 2006. Global WordNet Association. +Alexis Conneau, Guillaume Lample, Marc'Aurelio Ranzato, Ludovic Denoyer, and Hervé Jégou. 2018. Word translation without parallel data. In Proceedings of the International Conference on Learning Representations. +Roy Freedle. 2003. Correcting the SAT's ethnic and social-class bias: A method for reestimating sat scores. Harvard Educational Review, 73(1):1-43. +Hu Gengshen. 2003. Translation as adaptation and selection. Perspectives: Studies in Translatology, 11(4):283-291. +Anna Gladkova, Aleksandr Drozd, and Satoshi Matsuoka. 2016. Analogy-based detection of morphological and semantic relations with word embeddings: what works and what doesn't. In Proceedings of the NAACL Student Research Workshop. +Maharshi Gor, Kellie Webster, and Jordan Boyd-Graber. 2021. Toward deconfounding the influence of subject's demographic characteristics in question answering. In Proceedings of Empirical Methods in Natural Language Processing. +Abigail Green. 2003. Representing Germany? the zollverein at the world exhibitions, 1851-1862. The Journal of Modern History, 75(4):836-863. +Viktor Hangya and Alexander Fraser. 2019. Unsupervised parallel sentence extraction with parallel segment detection helps machine translation. In Proceedings of the Association for Computational Linguistics. +Matthew Honnibal, Ines Montani, Sofie Van Landeghem, and Adriane Boyd. 2020. spaCy: Industrial-strength Natural Language Processing in Python. +Alankar Jain, Bhargavi Paranjape, and Zachary C. Lipton. 2019. Entity projection via machine translation for cross-lingual NER. In Proceedings of the Association for Computational Linguistics. +Jeff Johnson, Matthijs Douze, and Hervé Jégou. 2021. Billion-scale similarity search with gpus. IEEE Transactions on Big Data, 7(3):535-547. +David Jurgens, Mohammad Taher Pilehvar, and Roberto Navigli. 2014. SemEval-2014 Task 3: Cross-level semantic similarity. In Proceedings of the Workshop on Semantic Evaluation. Association for Computational Linguistics. +Jungo Kasai, Kun Qian, Sairam Gurajada, Yunyao Li, and Lucian Popa. 2019. Low-resource deep entity resolution with transfer and active learning. In Proceedings of the Association for Computational Linguistics. + +David Katan and Mustapha Taibi. 2004. Translating cultures: An introduction for translators, interpreters and mediators. Routledge. +Yunsu Kim, Yingbo Gao, and Hermann Ney. 2019. Effective cross-lingual transfer of neural machine translation models without shared vocabularies. In Proceedings of the Association for Computational Linguistics. +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 toolkit for statistical machine translation. In Proceedings of the Association for Computational Linguistics. +Maximilian Köper, Sabine Schulte im Walde, Max Kisselew, and Sebastian Padó. 2016. Improving zero-shot-learning for german particle verbs by using training-space restrictions and local scaling. In Proceedings of the Fifth Joint Conference on Lexical and Computational Semantics. +Omer Levy and Yoav Goldberg. 2014. Linguistic regularities in sparse and explicit word representations. In Conference on Computational Natural Language Learning. +Patrick Lewis, Barlas Oğuz, Rudy Rinott, Sebastian Riedel, and Holger Schwenk. 2020. MLQA: Evaluating cross-lingual extractive question answering. In Proceedings of the Association for Computational Linguistics. +Tim Loh. 2020. Germany has its own Dr. Fauci—and actually follows his advice. Bloomberg. +Tomas Mikolov, Quoc V. Le, and Ilya Sutskever. 2013a. Exploiting Similarities among Languages for Machine Translation. CoRR, abs/1309.4. +Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. 2013b. Distributed representations of words and phrases and their compositionality. In Proceedings of Advances in Neural Information Processing Systems. +Tomáš Mikolov, Wen-tau Yih, and Geoffrey Zweig. 2013c. Linguistic regularities in continuous space word representations. In Conference of the North American Chapter of the Association for Computational Linguistics. +Denis Peskov, Nancy Clarke, Jason Krone, Brigi Fodor, Yi Zhang, Adel Youssef, and Mona Diab. 2019. Multi-domain goal-oriented dialogues (MultiDoGO): Strategies toward curating and annotating large scale dialogue data. In Proceedings of Empirical Methods in Natural Language Processing. +Anna Rogers, Aleksandr Drozd, and Bofang Li. 2017. The (too many) problems of analogical reasoning with word vectors. In Proceedings of the Joint Conference on Lexical and Computational Semantics. + +Hagen Schulze. 1991. The Course of German Nationalism: From Frederick the Great to Bismarck 1763-1867. Cambridge University Press. +Peter D Turney. 2008. A uniform approach to analogies, synonyms, antonyms, and associations. In Proceedings of International Conference on Computational Linguistics. +Tony Veale. 2016. Round up the usual suspects: Knowledge-based metaphor generation. In Proceedings of the Fourth Workshop on Metaphor in NLP. +Jean-Paul Vinay and Jean Darbelnet. 1995. Comparative stylistics of French and English: A methodology for translation, volume 11. John Benjamins Publishing. +Ellen M Voorhees. 1999. The TREC-8 question answering track report. In Proceedings of the Text Retrieval Conference, volume 99. +Denny Vrandecic and Markus Krötzsch. 2014. Wiki-data: a free collaborative knowledgebase. Communications of the ACM, 57(10):78-85. +Eric Wallace, Pedro Rodriguez, Shi Feng, Ikuya Yamada, and Jordan Boyd-Graber. 2019. Trick me if you can: Human-in-the-loop generation of adversarial question answering examples. Transactions of the Association of Computational Linguistics, 10. + +# A Appendix + +Our appendix contains our entire human-collected dataset, as well as a sample of our WikiData and embedding approaches for adaptation. + +Figure 2 shows our collection tool. Table 3 shows German $\rightarrow$ American Veale NOC items. Table 4 shows American $\rightarrow$ German Veale NOC items. Table 5 shows German $\rightarrow$ American Veale NOC items. Table 6 shows American $\rightarrow$ German Veale NOC items. + +Table 7 shows our WikiData predictions, Table 8 shows our 3CosAdd predictions. and Table 9 shows our Learned Adaptations predictions. We pose several background questions about Wikipedia and WikiData as well: + +# B Wikipedia Analysis + +Are the Wikipedia pages in German and English visited from the associated country? Yes; the Wikipedias for the respective languages are most used by visitors located in those countries: $63\%$ of German wikipedia was visited from Germany and $32\%$ of English Wikipedia was visited from the United States in the past year.[9] + +Are the top Wikipedia topics notably different across languages? Yes; less than a quarter of top 500 searches for 2019 are identical across English and German. + +Does WikiData cover areas outside of the United States? Wikipedia coverage does not mean that WikiData annotations are conducted equally across German and American entities. Analyzing WikiData10 reveals a discrepancy in coverage of Germans and Americans. + +Out of 8,126,559 titles, 1,030,762 include a reference to the United States in any capacity. However, only 184,692 contain a reference to (broader) Germany. This imbalance is significant but has enough German items for our methodology. As WikiData is a maintained resource, there is room for future additional coverage and standardization of fields. + +Countries use different names throughout history. While the United States of America is straightforward, Germany includes several variations, such as: German Empire, the Kingdom of Bavaria, the Kingdom of Prussia, etc. The WikiData feature-based approach can be used for other countries as well (... or anything that is consistently coded). For example, there are 65,957 Russian, 152,701 French, and 48,026 Chinese items in WikiData.[11] + +Are the top Wikipedia topics necessarily belonging to the culture? No; the top 10 most visited German Wikipedia includes a cultural potpurri: Germany, Greta Thurnberg, Asperger Syndrome, Game of Thrones, and Freddie Mercury. While there are uniquely German entities in the longer list—ZDF, Capital Bra, The Cratez, Niki Lauda—we cannot conclude that all top entities in a language belong culturally to a given country. Therefore, we need a stricter methodology. + +Where does one find entities? We rely on a human-sourced dataset: Veale's Non-Official Characterization list (Veale, 2016). This list contains 1031 people, real and fictional, such as Daniel Day-Lewis, Anton Chekhov, and Bridget Jones. These people are annotated with properties, one of which is conveniently their address. There are 25 people with a German location and 575 with an American one. Removing fictional characters written by non-nationals causes the German leaves the list with 20 entities. An American author filters the list of Americans down to 35 iconic ones with achievements that span politics, music, activism, athletics, and pop culture. + +Wikipedia provides another avenue for gauging popular topics in a language. We manually filter the top 500 German/English Wikipedia topics to remove non-German/non-American entities; Game of Thrones and Unix-Shell are popular in the German Wikipedia, but they are not culturally idiosyncratic. For the 2019 German Wikipedia we are left with roughly 200 items, which we further reduce down to 120 + +after putting a cap on pop culture entities. For the American counterpart, over 300 items are culturally American. We add a three-year filter to remove pop items to make it comparable to the German one. + +# C Interfaces + +We are studying cultural differences between German and American wikipedia. These are entities that are top 500 entities from Wikipedia for the German language. Please type whichever AMERICAN entity you think is most similar to the provided German entity. If you are unfamiliar with the entity, you may reference an outside source. + +The following German Entity is most similar to which American Entity: + +# Deutschland + +Germany (German: Deutschland, German pronunciation: ['doytflant]), officially the Federal Republic of Germany (German: Bundesrepublik Deutschland, listen), is a country in Central and Western Europe. Covering an area of 357,022 square kilometres (137,847 sq mi), it lies between the Baltic and North seas to the north, and the Alps to the south. It borders Denmark to the north, Poland and the Czech Republic to the east, Austria and Switzerland to the south, and France, Luxembourg, Belgium and the Netherlands to the west. Various Germanic tribes have inhabited the northern parts of modern Germany since classical antiquity. A region named Germania was documented before AD 100. + +![](images/a22eb23719aef1608d488425ec17324f035fe2c5b2410edc70bdb8806d965576.jpg) +Figure 2: Our interface provides users with information about the entity and asks them to select an option from possible Wikipedia pages + +Compare the below German entities to this American entity: Abraham Lincoln / Abraham Lincoln was an American statesman and lawyer who served as the 16th president of the United States from 1861 until his assassination in 1865. + +Click for Instructions + +Konrad Adenauer / Konrad Hermann Joseph Adenauer was a German statesman who served as the first Chancellor of the Federal Republic of Germany from 1949 to 1963. + +Helmut Schmidt / Helmut Heinrich Waldemar Schmidt was a German politician and member of the Social Democratic Party of Germany, who served as Chancellor of the Federal Republic of Germany from 1974 to 1982. + +Willy Brandt / Willy Brandt was a German politician and statesman who was leader of the Social Democratic Party of Germany from 1964 to 1987 and served as Chancellor of the Federal Republic of Germany from 1969 to 1974. + +Helmut Kohl / Helmut Josef Michael Kohl was a German statesman and politician of the Christian Democratic Union who served as Chancellor of Germany from 1982 to 1998 and as chairman of the CDU from 1973 to 1998. + +![](images/154b640cde17faf0d2201edda8c4b4dd279e8a7cc23d3f774a3c9378cfb0b0a9.jpg) +Figure 3: Our Qualtrics survey + +# D Data + +
EntityHuman Adaptation: NOC German→American
Adolf EichmannAndrew Jackson, Andrew Jackson, Franklin D. Roosevelt, Nathan Bedford Forrest, Steve Bannon
Angela MerkelBarack Obama, Donald Trump, Hillary Clinton, Hillary Clinton, Hillary Clinton, Hillary Clinton, Joe Biden
Baron MunchausenCaptain America, Daniel Bolger, Joseph Smith, Paul Bunyan, Robert Jordan , Yankee Doodle
Carl von ClausewitzAlfred Thayer Mahan, Dwight D. Eisenhower, Henry Knox, Robert E. Lee, Ulysses S. Grant
Friedrich NietzscheAyn Rand, Henry David Thoreau, Henry Thoreau, Jordan Peterson, William James
Henry KissingerHenry Kissinger, Henry Kissinger, John Kerry, Madeleine Albright, Richard Nixon
Immanuel KantBenjamin Franklin, John Dewey, John Locke, John Rawls, Robert Nozick
Johann Sebastian BachAaron Copland, Elvis Presley, Elvis Presley, Irving Berlin, Johnny Cash, Scott Joplin
Johann Wolfgang von GoetheEdgar Allan Poe, Ernest Hemingway, Walt Whitman
Johannes GutenbergBenjamin Franklin, Bill Gates, Eli Whitney, Thomas Edison
Joseph GoebbelsDavid Duke, Franklin D. Roosevelt, George Rockwell, Rupert Murdoch, david duke
Karl LagerfeldAnna Wintour, Anna Wintour, Marc Jacobs, Ralph Lauren, Ralph Lauren, Ralph Lauren
Karl MarxAngela Davis, Beck, Bernie Sanders, John Jay, John Rawls, John Rawls
Leni RiefenstahlDW Griffith, David Wark Griffith, Frank Capra, Judy Garland
Ludwig van BeethovenAaron Copland, Aaron Copland, Aaron Copland, Elvis Presley, Frank Sinatra, George Gershwin, George Gershwin, Scott Joplin
Marlene DietrichBette Davis, Clara Bow, Elizabeth Taylor, Marilyn Monroe, William Tecumseh Sherman
Martin LutherBarry Goldwater, Brigham Young, Joseph Smith, Joseph Smith, Joseph Smith
Otto von BismarckAbraham Lincoln, George Washington, George Washington, George Washington, George Washington, Ulysses S. Grant
Pope Benedict XVIBilly Graham, Billy Graham, Brigham Young, John Carroll , Seán Patrick O’Malley
Richard WagnerCharles Ives, Frank Sinatra, Leonard Bernstein, Philip Glass
+ +Table 3: Veale NOC German→American adaptations. + +Entity +Human Adaptation: NOC American $\rightarrow$ German adaptations + +
Abraham LincolnHelmut Kohl, Konrad Adenauer, Wilhelm Friedrich Ludwig von Preußen, Willy Brandt, Willy Brandt
Al CaponeAdolf Leib, Carlos Lehder-Rivas, Jan Marsalek, Nasser Abou-Chaker, Nasser About-Chaker
Alfred HitchcockBernd Eichinger, Bernd Eichinger, Michael Bully Herbig, Roland Emmerich, Wim Wenders
Benedict ArnoldHansjoachim Tiedge, Otto von Bismarck, Otto von Bismarck, Robert Blum
Bill GatesAndreas von Bechtolsheim, Carl Benz, Dietmar Hopp, Konrad Zuse
Britney SpearsHelene Fischer, Herbert Grönemeyer, Jeanette Biedermann, Nena, Til Schweiger
Charles LindberghFerdinand von Richthofen, Heinrich Horstman, Karl Wilhelm Otto Lilienthal, Ludwig Hofmann, Wernher von Braun
Donald TrumpAdolf Hitler, Adolf Hitler, Carsten Maschmeyer, Christian Lindner
Elvis PresleyPeter Kraus, Rammstein, The Scorpions, Udo Lindenberg, Udo Lindenberg
Ernest HemingwayGünter Grass, Hermann Hesse, Johann Wolfgang von Goethe, Karl May, Martin Walser
Frank Lloyd WrightGerhard Richter, Hugo Häring, Karl Lagerfeld, Max Dudler, Walter Gropius
George WashingtonFriedrich II, Heinrich I, Konrad Adenauer, Otto I. der Groß, Otto von Bismarck
Henry FordCarl Benz, Carl Benz, Carl Benz, Ferdinand Porsche, Gottlieb Wilhelm Daimler
Hillary ClintonAngela Merkel, Angela Merkel, Angela Merkel, Kramp-Karrenbauer, Sahra Wagenknecht
Homer SimpsonAlf, Heidi, Pumuckl, Werner, Werner - Beinhart!
Jack The RipperArmin Meiwes, Der Bulle von Tölz, Joachim Kroll, Karl Denke, Rudolf Pleil
Jay ZCapital Bra, Marteria, Sido, Sido, Sido
Jimi HendrixBela B., Gisbert zu Knyphausen, Herbert Grönemeyer, Rudolf Schenker, Spider Murphy Gang
John F. KennedyHanns Martin Schleyer, Willy Brandt, Willy Brandt, Wolfgang Schäuble
Kim KardashianCarmen Geiss, Gina-Lisa Lohfink, Heidi Klum, Heidi Klum, Sarah Connor
Louis ArmstrongGünter Sommer, Helmut Brandt, Jan Delay, Michael Abene, Mozart
Marilyn MonroeHeidi Klum, Ingrid Steeger, Marlene Dietrich, Micaela Schäfer, Uschi Glas
Michael JordanDirk Nowitzki, Dirk Nowitzki, Dirk Nowitzki, Franz Beckenbauer, Michael Schuhmacher
Neil ArmstrongAlexander Gerst, Sigmund Jahn, Sigmund Jahn, Ulf Merbold, Wernher von Braun
Noam ChomskyHelmut Glück, Juergen Habermas, Jürgen Habermas, Ludwig Wittgenstein, Wilhelm Röttgen
Oprah WinfreyAnne Will, Arabella Kiesbauer, Maybrit Illner, Thomas Gottschalk, Thomas Gottschalk
Orville WrightCarl Benz, Gustav Otto, Gustav Weißkopf, Otto Lilienthal, Wern-her von Braun
Richard NixonFranz Josef Strauss, Helmut Kohl, Ludwig Erhard, Ludwig Erhard, Richard von Weizsäcker
Rosa ParksAnne Wizorek, Marie Juchacz, Sophie Scholl, Sophie Scholl, Vera Lengsfeld
Serena WilliamsAndrea Petkovic, Boris Becker, Sabine Lisicki, Steffi Graf, boris becker
Steve JobsCarl Benz, Dietmar Hopp, Dietmar Hopp, Karl Lagerfeld
Steven SpielbergMichael Bully Herbig, Roland Emmerich, Roland Emmerich, Roland Emmerich, Wim Wenders
SupermanBibi Blocksberg, Fix and Foxi, Maverick, Superman, Till Eulenspiegel
Tiger WoodsBoris Becker, Martin Kaymer, Martin Kaymer, Michael Schumacher, Serge Gnabry
Walt DisneyAxel Springer, Christian Becker, Franz Mack, Gerhard Hahn, Röttger Feldmann
+ +Table 4: Veale NOC American $\rightarrow$ German adaptations. + +# Entity + +# Human Adaptation: Wikipedia German→American + +
ARDNPR, PBS, PBS
Adolf HitlerDonald Trump, Donald Trump, Franklin D. Roosevelt, Franklin D. Roosevelt, Franklin D. Roosevelt
AirbusBoeing, Boeing, Boeing, Boeing, Lockheed Martin
Albert EinsteinCarl Sagan, J. Robert Oppenheimer, J. Robert Oppenheimer, John Forbes Nash Jr., Thomas Edison
Alice MertonAriana Grande, Elle King, K.T. Tunstall, P!NK, Vanessa Carlton
Alternative für DeutschlandLibertarian Party , Republican Party, Tea Party movement
Andrea NahlesElizabeth Warren, Hillary Clinton, Nancy Pelosi, Tammy Duckworth
Andrej MangoldKawhi Leonard, Kevin Durant, Kris Humphries, Yao Ming
Annalena BaerbockAl Gore, Al Gore, Alexandria Ocasio-Cortez, Bernie Sanders, Jill Stein
Anne FrankAnna Green Winslow, Clara Barton, Emmett Till, Kunta Kinte
Annegret Kramp-KarrenbauerCondoleezza Rice, Hillary Clinton
AnnenMayKantereitGuns N' Roses, Milky Chance, Polar Bear Club, Red Hot Chili Peppers
Apache 207Fetty Wap, Tekashi 69, XXXTentacion, Zayn Malik
Arnold SchwarzeneggerChuck Norris, Dwayne Johnson, Ronnie Coleman, Sylvester Stallone, Sylvester Stallone
BMWCadillac, Cadillac, Chevrolet, Chrysler
Babylon BerlinGame of Thrones, Man From U.N.C.L.E., Peaky Blinders , The Americans, Turn
Baden-WürttembergCalifornia, Chicago metropolitan area, San Diego, Southern United States, Texas
Bastian YottaChad Johnson, Colton Underwood, Dan Bilzerian
BauhausFrank Lloyd Wright
Bayerischer RundfunkNPR, National Public Radio, National Public Radio, national public ra
BayernFlorida, New York, The Confederacy
Benjamin PiwkoBruce Lee, Colton Underwood, Derek Hough
BerlinNew York City, Portland Oregon, Washington D.C., Washington D.C., Washington D.C.
Berliner MauerBorder Patrol Police, Mason-Dixon line, Mason-Dixon line, US-Mexican border
Bertolt BrechtTennessee Williams, Tennessee Williams
Björn HöckeLindsey Graham, Mike Pence
Borussia DortmundGolden State Warriors, New England Patriots, New England Patriots
BrandenburgMaryland, New York, Northeastern United States, Richmond Virginia, Virginia
Bruno GanzClint Eastwood, Ethan Hawke, Marlon Brando, Robert De Niro, Robert De Niro
BundespresidentFirst Lady, President of the United States, Speaker of the House
BundeswehrDepartment of Defense , US military, United States Armed Forces, United States Army
Capital BraDrake, Eminem, Eminem, Kanye West, Kendrick Lamar
Carola RacketeAmerican Civil Liberties Union, Dawn Wooten, Rosa Parks, Whale Wars
Carolin KebekusAmy Schumer, Sarah Silverman, Tina Fey, Tina Fey
CharitéCall the Midwife, Grey's Anatomy, Grey's Anatomy, The Queen's Gambit
Chris TöpperwienGordon Ramsey , Guy Fieri, Jeff Probst
Christoph WaltzAnthony Hopkins, Christoph Waltz, Denzel Washington
DarkStranger Things, Stranger Things
Deutsche BahnAmtrack, Norfolk Southern Railway, Union Pacific Corporation
Deutsche Demokratische RepublikConfederate States of America, Confederate States of America, Texas, The Confederacy, The Confederate States of America
Deutsche NationalhymneBorn in the U.S.A., Lazy Eye , Star Spangled Banner, The Star Spangled Banner
DeutschlandAmerica, America, Continental United States, USA, United States, United States
Dieter BohlenBilly Joel, Blake Shelton, Daryl Hall, Paula Abdul, Ryan Seacrest
Dirk NowitzkiLeBron James, Michael Jordan, Shaquille O'Neal
Doreen DietelJessica Alba, Lisa Kudrow, Warrick Brown
Dreißigähriger KriegAmerican Civil War, American Civil War, American Indian Wars, Civil war
Elisabeth von Österreich-UngarnEdith Roosevelt, Hillary Clinton, Jackie Kennedy
Elyas M'BarekAdam Sandler, Adam Sandler, Chris Pine
Europawahl in Deutschland 20192018 United States elections, American presidential election 2020, Us election 2018
Europäisches ParliamentNorth Atlantic Council, Representative of the United States of America to the European Union, United Nations, United States Congress
Evelyn BurdeckiHannah Brown, Kaitlyn Bristowe, Kim Kardashian, Kim Kardashian
FC Bayern MünchenDallas Cowboys, Dc United, New York Yankees, New York Yankees, New York Yankees
FalcoDavid Bowie, Frederick William Schneider III, MC Hammer, Michael Jackson
Ferdinand SauerbruchBen Carson, Ben Carson, Cornelius P. Rhoads, Jonas Salk, Virginia Apgar
Flughafen Berlin BrandenburgCincinnati Subway, DCA , John F. Kennedy International Airport, LaGuardia Airport
Frankfurt am MainChicago, Los Angeles, Los Angeles, New York City, Washington D.C.
Fritz HonkaTed Bundy, Ted Bundy, Ted Bundy, Zodiac
HamburgChicago, Chicago, Los Angeles, New York, Philadelphia
Hannalore ElsnerElizabeth Taylor, Jane Lynch, Julia Roberts
Heidi KlumChrissy Teigen, Cindy Crawford, Gigi Hadid, Karlie Kloss, Tyra Banks
Heinz-Christian StracheAnthony Weiner, Ben Carson, Donald J. Trump, Rob Ford, Roger Stone
Helene FischerBeyoncé, Kelly Clarkson, Taylor Swift, Taylor Swift
HessenArizona, Illinois, Mid-Atlantic , Napa County California
HolocaustChattel Slavery, Japanese interned in American camps, Slavery in the United States
Ich bin ein Star – Holt mich hier raus!Survivor, Survivor
Jürgen KolloppBill Belichick, Bill Belichick, John Wooden
Kevin KühnertBernie Sanders, Bernie Sanders, Bernie Sanders, Pete Buttigieg
Klaus KinskiChristopher Lee, Clark Gable, John Wayne, Robert Pattinson, Robert Pattinson
Kontra K50 Cent, Eminem, Eminem, Jesus Is King, Travis Scott
KölnBoston, Chicago, Chicago, Houston
Leila LowfireParis Hilton, Sasha Grey, Zendaya
LeipzigDenver, Detroit, Miami, San Diego
Lena Meyer-LandrutAriana Grande, Kelly Clarkson, Kelly Clarkson, Meghan Trainor, Selena Gomez
LiechtensteinConnecticut, Mexico, Philippines, Victoria British Columbia
Lisa MartinekJulie Benz, Katherine Heigl, Mandy Moore, Meryl Streep
Ludwig van BeethovenAaron Copland, Aaron Copland, Aaron Copland, Aaron Copland, Elvis Presley, Frank Sinatra, George Gershwin, George Gershwin, Scott Joplin
LufthansaDelta, United, United Airlines, United Airlines
LuxemburgCanada, Connecticut, Mexico, Victoria British Columbia
Mark ForsterBruno Mars, Post Malone
MeroDaBaby, Fetty Wap, Lil Nas X, Lil Nas X, Post Malone
Michael SchumacherDale Earnhardt, Dale Earnhardt, James Gordon, Jeff Gordon, Tiger Woods
MünchenChicago, Los Angeles, New York City, New York City, Washington D.C.
Nico SantosHarry Styles, Justin Bieber, Shawn Mendes
Niki LaudaDale Earnhardt, Dale Earnhardt Jr., Jeff Gordon, Jeff Gordon, Tiger Woods
Norddeutscher RundfunkNPR, NPR, National Public Radio, PBS, Sirius XM
Nordrhein-WestfalenCalifornia, California
Philipp AmthorAlexandria Ocasio-Cortez, Ben Shapiro
RAF CamoraBad Bunny, Drake, Drake , Eminem, Future
RammsteinGreen Day, Metallica, Metallica, Metallica, Sum 41
RheinMississippi, Mississippi River, Mississippi River
Robert HabeckAl Gore, Bernie Sanders, Jill Stein, Ralph Nader
Rudi AssauerDave Roberts, Gregg Berhalter, Tom Flores, Vince Lombardi, Vince Lombardi
Sahra WagenknechtAlexandria Ocasio-Cortez, Elizabeth Warren, Elizabeth Warren, Elizabeth Warren, Nancy Pelosi
Sarah ConnorBeyoncé, Britney Spears, Mariah Carey
SchweizCanada, Canada, Iowa, Mexico, United States
Sebastian KurzAlexandria Ocasio-Cortez, Greg Abbott, Justin Trudeau, Justin Trudeau, Mitch McConnell
Serge GnabryClint Dempsey, JuJu Smith-Schuster, Phillip Rivers, Stephen Curry, Zion Williamson
SidoEminem, Eminem, Macklemore
The CratezDJ Khaled, Drake , Twenty One Pilots
ThüringenIowa, Midwestern United States, Tennessee, Tennessee
Till LindemannJames Hetfield, James Hetfield, James Hetfield, Ozzy Osborne
Tom KaulitzAdam Levine, Blink-182, Chris Martin, Green Day, Maroon 5
UEFA Champions LeagueMajor League Soccer, NFC, NFL, National Football League, NCAA
Udo JürgensAretha Franklin, Billy Joel, Elton John, Michael Jackson, Rolling Stone, Tom Lehrer
Udo LindenbergJohnny Cash, Mick Jagger, Roger Taylor , Travis Barker
Ursula von der LeyenCondoleezza Rice, Hillary Clinton, Mike Pence, Sarah Palin, Susan Rice
Volkswagen AGFord Motor Company, Ford Motor Company, Ford Motor Company, Ford Motor Company, Ford Motor Company
Walter LübeckeHarvey Milk, John F. Kennedy, John Roll, Steve Scalise
Weimarer RepublikAmerica, Confederation Period, Congress of the Confederation, Counterculture of the 1960s, The Confederate States of America
Westdeutscher Rundfunk KölnABC News, NBC, NPR
WienAustin Texas, Richmond Virginia, Toronto, Washington D.C.
Wilhelm II.William Howard Taft, Woodrow Wilson, Woodrow Wilson
Wolfgang Amadeus MozartAlan Menken, Elvis Presley, Leonard Bernstein
ZDFNPR, NPR, National Public Radio, PBS, PBS
ÖsterreichCanada, Mexico, Texas, Texas, United States
ÖtziSpirit Cave mummy, Spirit Cave mummy, Spirit Cave mummy, Sue
+ +Table 5: Top Wikipedia German→American adaptations. + +Entity +Human Adaptation: Wikipedia American $\rightarrow$ German + +
13 Reasons WhyClub der roten Bändner, Gute Zeiten schlechte Zeiten, Lammbock, Türkisch für Anfänger
Albert EinsteinAlbert Einstein, Albert Einstein, Albert Einstein, Max Planck, Max Planck
Alexander HamiltonKonrad Adenauer, Max Weber, Otto von Bismarck, Otto von Bismarck
American Civil WarDeutscher Krieg, Dreizigjähriger Krieg, German Revolution of 1918–1919, German revolutions of 1848–1849
American Horror StoryDark, Der goldene Handschuh, Good Bye Lenin!, Tintenherz
Angelina JolieBarbara Schöneberger, Franka Potente, Marlene Dietrich, Romy Schneider, Veronica Maria Cächilia Ferres
Apple Inc.BMW, Fujitsu, SAP, Siemens
Ariana GrandeLena Meyer-Landrut, Lena Meyer-Landrut, Lena Meyer-Landrut, Sarah Connor, Sarah Connor
Arnold SchwarzeneggerArnold Schwarzenegger, Karl Lauterbach, Matthias Steiner, Peter Maffay, Ralf Rudolf Möller
Ashton KutcherFlorian David Fitz, Matthias Schweighöfer, Til Schweiger, Til Schweiger
AustraliaAustralia, Russia, Schweiz, South Africa, Österreich
Avengers Infinity WarDas Arche Noah Prinzip, Fack ju Göhte, Fantastic Four, Who Am I
Barack ObamaAngela Merkel, Angela Merkel, Angela Merkel, Helmut Schmidt, Helmut Schmidt
BeyoncéHelene Fischer, Sarah Connor, Veronica Ferres, Xavier Naidoo, Yvonne Catterfeld
Black MirrorDark, Dark, DieCOMMenden Tage, Krabat
Blake LivelyJosefine Preuß, Maria Furtwängler, Maria Furtwängler, Til Schweiger
Brad PittFlorian David Fitz, Frederick Lau, Til Schweiger, Til Schweiger, Til Schweiger
Bruce LeeGötz Georg, Henry Maske, Julian Jacobi, Max Schmeling, no one is like Bruce Lee
Caitlyn JennerKristin Otto, Magdalena Neuner, Magdalena Neuner, Niklas Kaul, Ulrike Meyfarth
CaliforniaBavaria, Bavaria, Bayern, Bayern
Camila CabelloHelene Fischer, Lena Meyer-Landrut, Lena Meyer-Landrut, Nadja Benaissa
CanadaAustria, Italy, Schweiz, Sweden, Österreich
Cardi BAce Tee, Pamela Reif, Sabrina Setlur, Sarah Connor, Schwester Ewa
Charles MansonAndreas Baader, Issa Rammo, Papst benedikt xvi, Paul Schäfer
Charlize TheronBaran bo Odar, Josefine Preuß, Josefine Preuß, Veronica Ferres, Veronica Maria Cächilia Ferres
CherMarlene Dietrich, Nena, Nena, Nena
Chris PrattElyas M'Barek, Jan Josef Liefers, Matthias Schweighöfer, Ralf Moeller, Til Schweiger
Clint EastwoodHeinz Erhardt, Klaus Kinski, Mario Adorf, Til Schweiger, Wim Wenders
Darth VaderAdolf Hitler, Belzebub, Hagen von Tronje, Jens Maul
Donald GloverElyas M'Barek, Helge Schneider, Money Boy, Stefan Raab
+ +Drake + +Dwayne Johnson + +Elon Musk + +Eminem + +Facebook + +Friends + +Game of Thrones + +Google + +Harry Potter + +Heath Ledger + +It + +Jason Momoa + +Jeff Bezos + +Jeffrey Dahmer + +Jennifer Aniston + +Jennifer Lawrence + +Jennifer Lopez + +John Cena + +Johnny Cash + +Johnny Depp + +Julia Roberts + +Justin Bieber + +Keanu Reeves + +Kylie Jenner + +Lady Gaga + +LeBron James + +Leonardo DiCaprio + +Lisa Bonet + +Madonna + +Mark Wahlberg + +Martin Luther King Jr. + +Bushido, Cro, Falco, Fler + +Alexander Wolfe, Arnold Schwarzenegger, Peter Alexander, Tim Wiese, Tim Wiese + +Alexander Samwer, August Horch, Carl Benz, Herbert Diess, Werner von Siemens + +Bushido, Kollegah, Sido, Sido, Sido + +Das Erste, Lokalisten, Lokalisten, Schüler VZ, StudiVZ, StudiVZ + +Gute Zeiten schlechte Zeiten, Gpsz, Lindenstraße, Stromberg + +Babylon Berlin, Babylon Berlin, Babylon Berlin, Die unendliche Geschichte, Krakat + +Ecosia, Fastbot, SAP, SAP, i.d.k. + +Die Unendliche Geschichte, Die unendliche Geschichte, Harry Potter und ein Stein, Meggie Folchart + +Christoph Waltz, Florian David Fitz, Henry Blanke, Matthias Schweighöfer, Tilman Valentin Schweiger + +Dark, Der goldene Handschuh, Die Wolke, Pandora + +Arnold Schwarzenegger, Benno FÜRmann, Christoph Waltz, Elyas M'Barek, Elyas M'Barek, Elyas M'Barek + +Alexander Samwer, Beate Heister, Martin Winterkorn, Oliver Samwer + +Armin Meiwes, Fritz Haermann, Joachim Kroll, Karl Denke, Karl Denke + +Barbara Schöneberger, Diane Kruger, Diane Kruger, Franka Potente, Iris Berben + +Iris Berben, Josefine Preuß, Karoline Herfurth, Ruby O. Fee + +Heidi Klum, Helene Fischer, Jeanette Biedermann, Mandy Capristo, Sarah Connor + +Arnold Schwarzenegger, Max Schmeling, Max Schmeling, Ralf Möller + +Fantasticen vier, Helge Schneider, Peter Maffay, Peter Maffay, Christoph Maria Herbst, Christoph Waltz, Cro, Til Schweiger, Xavier Naidoo + +Karoline Herfurth, Maria Furtwängler, Marlene Dietrich, Marlene Dietrich + +Cro, Felix Jaehn, Lukas Rieger, McFittie, Mike Singer + +Daniel Bruhl, Mario Adorf, Til Schweiger, til schweiger + +Barbara Schöneberger, Heidi Klum, Karoline Einhoff, Sarah Connor, Stefanie Giesinger + +Helene Fischer, Nena, Nena, Nina Hagen, Sarah Lombardi + +Dirk Nowitzki, Dirk Nowitzki, Dirk Nowitzki, Dirk Nowitzki, Toni Kroos + +Matthias Schweighöfer, Moritz Bleibtreu, Til Schweiger, Til Schweiger, Til Schweiger + +Franka Potente, Iris Berben, Karoline Herfurth, Maria Furtwangler + +Blümchen, Helene Fischer, Helene Fischer, Helene Fischer, Sarah Connor + +Florian David Fitz, Til Schweiger, Tilman Valentin Schweiger, Alexei Alexejewitsch + +Hans Scholl, Hans Scholl, Helmut Palmer, Robert Blum, Sophie Scholl + +
Marvel Cinematic UniverseBavaria Film, Havelstudios, Phantásien, Rat Pack Filmproduktion, Tatort
Michael JacksonHerbert Grönemeyer, Nena, Udo Jürgens, Xavier Naidoo, Xavier Naidoo
Mila KunisJosefine Preuß, Matthias Schweighöfer, Vanessa Mai
Miley CyrusLena Meyer-Landrut, Lukas Rieger, Nena, Sarah Connor, Yvonne Catterfeld
Muhammad AliAlexander Abraham, Boris Becker, Max Schmeling, Max Schmel-ing, Sven Ottke
Natalie PortmanBarbara Schöneberger, Diane Kruger, Franka Potente, Iris Berben
New York CityBerlin, Berlin, Berlin, Berlin, Frankfurt
Nicole KidmanEvelyn Hamann, Franka Potente, Senta Berger, iris berben
Peaky BlindersDark, Dieter Schwarz, Im Westen Nichts Neues, Tatort, Tatort
PhilippinesGreece, Griechenland, Mallorca, Mallorca
Post MaloneBushido, Bushido, Cro, Cro, Kollegah
RiannaHelene Fischer, Lena Meyer-Landrut, Lena Meyer-Landrut, Nena
RiverdaleBabylon Berlin, Berlin Tag und Nacht, Neues vom Südhof, Türkisch für Anfänger
Robert Downey Jr.Christoph Waltz, Günter Strack, Martin Semmelrogge, Moritz Bleibtreu, Til Schweiger
Robin WilliamsHape Kerkeling, Heinz Erhardt, Peter Maffay, Silvia Seidel, Tim Bendzko
Ronald ReaganHelmut Schmidt, Konrad Adenauer, Konrad Adenauer, Konrad Adenauer
Ryan ReynoldsDaniel Brühl, Florian David Fitz, Matthias Schweighöfer, Til Schweiger, Til Schweiger
Scarlett JohanssonLena Gercke, Romy Schneider, Sarah Connor, Sarah Connor, Veronica Ferres
Selena GomezLena Meyer-Landrut, Lena Meyer-Landrut, Nena, Nora Tschirner
September 11 attacksAnschlag im OEZ, Dresden Bombing, Mauerfall, RAF-Attentate, Terroranschlag Olympia 1972
Shaquille O’NealDirk Nowitzki, Dirk Nowitzki, Mehmet Scholl, Niklas Sülle
Star WarsDark, Metropolis, Traumschiff Surprise – Periode 1, Who Am I?, i.d.k
Stephen CurryDirk Nowitzki, Dirk Nowitzki, Dirk Nowitzki, Manuel Neuer
Stranger Things8 Tage, Babylon Berlin, Dark, Tatort, Tatort
Sylvester StalloneHenry Blanke, Jan Josef Liefers, Michael Bully Herbig, Michael Fassbender, Til Schweiger
Taylor SwiftLena Meyer-Landrut, Lena Meyer-Landrut, Sarah Connor, Sarah Connor, Yvonne Catterfeld
Ted BundyJoachim Kroll, Josef Fritzl, Niels Högel, Rudolf Pleil, Rudolf Pleil
The Big Bang TheoryDoctor's Diary, Stromberg, Stromberg, der Tatortreiniger
The CrownBabylon Berlin, Deutschland 83, Die Deutschen, Karl der Groß
The Handmaid’s TaleDark, Dark, Der Pass, Die Wanderhure, Er ist wieder da
The Walking DeadDark, Dark, Der goldene Handschuh, Zombies From Outer Space
Tom BradyFranz Beckenbauer, Michael Ballack, Oliver Kahn, Thomas Müller, Uli Stein
Tom CruiseBenno Fürmann, Benno Fürmann, Christoph Waltz, Elyas M’Barek, Matthias Schweighöfer
Tom HanksChristoph Waltz, Christoph Waltz, Daniel Brühl, Til Schweiger
Tom HardyBruno Ganz, Michael Herbig, Til Schweiger, Wotan Wilke Möhring
Tom HollandDaniel Brühl, Frederick Lau, Matthias Schweighöfer, Matthias Schweighöfer, Til Schweiger
Tupac ShakurFarid Bang, Haftbefehl, Kollegah, Kristoffer Klauß, Peter Fox
United StatesBRD, Bundesrepublik Deutschland, Deutschland, Germany, Germany
Vietnam WarBerlin Wall, First world war, Kosovokrieg, World War II
WikipediaBrockhaus, Brockhaus Enzyklopädie, Brockhaus Enzyklopädie, Duden, dict.cc
Will SmithDaniel Brühl, Elyas M'Barek, Sascha Reimann, Sido, Til Schweiger
X-MenAbwärts, Fantastic Four, Freaks, Krabat, Who Am I
YouTubeLokalisten, MyVideo, MyVideo, ProSieben, lokalisten
Zac EfronFrederick Lau, Lukas Rieger, Peter Kraus, Walter Sedlmayr
ZendayaFranka Potente, Iris Berben, Lena Meyer-Landrut, Lena Meyer-Landrut, Yvonne Catterfeld
+ +Table 6: Top Wikipedia American $\rightarrow$ German adaptations. + +# Entity + +# Top Five WikiData Adaptations + +
Abraham LincolnVictor Adler, Johann Joachim Christoph Bode, Willem Barentsz, Hermann Wagener, Robert von Mohl
Al CaponeHans H. Zerlett, Fritz Thyssen, Adam Rainer, Franz Winkelmeier, Christian Louis, Duke of Brunswick-Lüneburg
Alfred HitchcockEdgar Reitz, Jan Josef Liefers, Mario Adorf, Max Frisch, Armin Mueller-Stahl
Benedict ArnoldHans-Georg Hess, Isabelle Eberhardt, Günther Heydemann, Max Schreck, Louis Blenker
Bill GatesFerdinand von Zeppelin, Günther Jauch, Nikolaus Harmoncourt, Sepp Blatter, Alfred Grosser
Britney SpearsHerta Müller, Günter Grass, Joachim Gauck, Hans-Dietrich Genscher, Koča Popović
Donald TrumpMax Frisch, Thomas Gottschalk, Jan Josef Liefers, Rainer Werner Fassbinder, Christa Wolf
Elvis PresleyReinhard Lakomy, James Last, Herbert Achternbusch, Fritz Hauser, Hans-Peter Pfammmatter
Ernest HemingwayKarlheinz Böhm, Ricardo Huch, Michael Ballhaus, Arnold Zweig, Michael Fassbender
Frank Lloyd WrightFerdinand Hodler, Johan Zoffany, Hans Thoma, Arne Jacobsen, Lucas Cranach the Younger
George WashingtonFriedrich Wilhelm von Seydlitz, Dagobert Sigmund von Wurmser, Heinz Guderian, Ernst Gideon von Laudon, George Olivier, count of Wallis
Henry FordHeinz Sielmann, Wieland Schmied, Manfred Krug, Paul Maar, Armin Mueller-Stahl
Hillary ClintonPope Benedict XVI, Willy Brandt, Angela Merkel, Helmut Schmidt, Kurt Biedenkopf
Homer SimpsonElizabeth Lavenza, Hans Fugger, Baron Strucker, Herbert of Wetterau, Prince Johannes of Liechtenstein
Jimi HendrixMarius Müller-Westernhagen, Karl Richter, Reinhard Lakomy, Michael Cretu, Paul van Dyk
Kim KardashianErika Mann, Frank Wedekind, Til Schweiger, Fritz von Opel, Carmen Electra
Marilyn MonroeGerhart M. Riegner, Viktor de Kowa, Otto Sander, Hans Hass, Dorothee Sölle
Michael JordanJean-Claude Juncker, Richard von Weizsäcker, Herta Müller, Konrad Adenauer, Helmut Kohl
Louis ArmstrongHerbert Prikopa, Till Lindemann, Nico, Klaus Voormann, Jakob Adlung
Neil ArmstrongStefan Hell, Franz-Ulrich Hartl, Reinhard Genzel, Charles Weiss-mann, Harald zur Hausen
Noam ChomskyGünter Grass, Herta Müller, Heinrich Böll, Peter Handke, Juli Zeh
Oprah WinfreyGünter Grass, Peter Scholl-Latour, Elfriede Jelinek, Juli Zeh, Christa Wolf
Orville WrightFrank Thiess, Jessica Hausner, Elmar Wepper, Wolf Jobst Siedler, Marc Rothemund
Richard NixonHeinrich von Brentano, Ernst Benda, Gustav Heinemann, Heiner Geißler, Heinrich Albertz
SupermanMagneto, Nightcrawler, Sinterklaas, Silent Night, Victor Frankenstein
Steve JobsVictor Klemperer, Joschka Fischer, Jürgen Kuczynski, Joachim Fest, Dieter Hallervorden
Steven SpielbergHerta Müller, Jean-Claude Juncker, Hans-Dietrich Genscher, Joachim Gauck, Koča Popović
Tiger WoodsCharles Dutoit, Shania Twain, Lise Meitner, Michael Haneke, Otto Hahn
Walt DisneyShania Twain, Charles Dutoit, Lise Meitner, Otto Hahn, Michael Haneke
John F. KennedyBernhard von Bülow, Otto von Habsburg, Hans-Jochen Vogel, Prince Henry of Prussia, Frederick Augustus III of Saxony
Charles LindberghPina Bausch, Ferdinand von Zeppelin, Nikolaus Harmoncourt, Jan Josef Liefers, Wolf Biermann
Rosa ParksHermann Lenz, Wilhelm Feldberg, Horst Tappert, Peter Stein, Gert Jonke
Serena WilliamsCharles Dutoit, Lise Meitner, Michael Haneke, Richard von Coudenhove-Kalergi, Klaus Clusius
+ +Table 7: We show top-5 predictions out of the top-100 for American $\rightarrow$ German adaptations on the Veale NOC subset using WikiData. These are compared to our human annotations in our results. + +
EntityTop Five 3CosAdd Adaptations: American→German adapta-tions on the Veale NOC
Abraham LincolnNapoleon, Napoléon Bonaparte, Erzherzog Johann, Otto von Bismarck, Kaiser Wilhelm II.
Al CaponeNazis, SA-Mann, Verhaftungswellen, Judenverfolgung, Fluchthilfe
Alfred HitchcockFritz Lang, Helmut Käutner, Willi Forst, Emil Jannings, Heinz Ruhmann
Benedict ArnoldRusslandfeldzug 1812, Schlacht bei Roßbach, Jean-Victor Moreau, schwedischen Armee, Alexander Wassiljewitsch Suworow
Bill Gatescongenstar, Alnatura, GMX, ChessBase, Gardeur
Britney SpearsGlasperlenspiel, Unheilig, Helene Fischer, Christina Aguilera, Herbert Grönenemeyer
Charles LindberghSegelflieger, Flugpioniere, Zeppelinins, Adolf Hitler, Caproni
Donald TrumpDeutschland, Österreich, Trump, Strache, Bundestagswahlkampf
Elvis PresleyUdo Jürgens, Elvis Presley, Hits, den Beatles, der Beatles
Ernest HemingwayStefan Zweig, Franz Werfel, Joachim Ringelnatz, Hermann Hesse, Gottfried Benn
Frank Lloyd WrightAdolf Loos, Le Corbusier, Bruno Schmitz, Entwurfen, Fritz Höger
George WashingtonNapoléon Bonaparte, Friedrich dem Großen, Napoleon, Friedrich der Große, Napoleon Bonaparte
Henry FordFerdinand Porsche, Büssing, Krupp, Ettore Bugatti, Steyr-Daimler-Puch
Hillary ClintonDeutschland, Bundestagswahlkampf, Österreich, Sarkozy, Strache
Homer SimpsonEingangsszene, verulkt, Schlusssequenz, Off-Stimme, Muminfam-ilie
Jack The Ripper:RipperTat, Werwolf, Täter, Dritten Reich, Mörder
Jay ZXavier Naidoo, D-Bo, Sido, Rosenstolz, David Guetta
Jimi HendrixUdo Jürgens, Tangerine Dream, Jimi Hendrix, Pink Floyd, De-peche Mode
John F. KennedyAdolf Hitler, Bundeskanzlers, Adolf Hitlers, Adolf Hitler, Hitler
Kim KardashianKaas, gotv, Frank Zander, Herbert Grünemeyer, Roland Kaiser
Louis ArmstrongRichard Tauber, Django Reinhardt, Udo Jürgens, Sidney Bechet, Jazzorchester
Marilyn MonroeMarlene Dietrich, Lil Dagover, Elisabeth Bergner, Brigitte Bardot, Romy Schneider
Michael JordanPowerplay, Xavi, Predrag Mijatović, NHL-Historie, Franck Ribéry
Neil ArmstrongJuri Gagarin, Vorbeiflag, Weltraum, Raumstation Mir, Raumfahrer
Noam ChomskyJürgen Habermas, Hans-Ulrich Wehler, Carl Schmitt, Theodor W. Adorno, Norbert Elias
Oprah WinfreyHarald Schmidt, Thomas Gottschalk, Satiresendung, ORF-Sendung, Hape Kerkeling
Orville WrightParseval, Luft Hansa, Hugo Junkers, Ernst Heinkel, Claude Dornier
Richard NixonÖsterreich, Deutschland, Bundeskanzler, Bundeskanzlers, Bundes-spráidenten
Rosa ParksNS-Militärjustiz, Franz Jägerstätter, NS-Opfer, Bücherverbn-nung, Baum-Gruppe
Serena WilliamsDick Jaspers, Philipp Kohlschreiber, Semifinale, Achtelfinale, Do-minic Thiem
Steve JobsSteve Jobs, Sony, Electronic Arts, Netscape, Atari
Steven SpielbergHörspielproduktion, Helmut Käutner, Fellini, Oliver Hirschbiegel, Kinofilm
SupermanSuperman, Batman, Superhelden, Monster, Spider-Man
Tiger WoodsRekordeuropameister, Österreich, spanische Team, ÖFB-Cupsieger, Deutschland
Walt DisneyFritz Lang, Sascha-Film, Fellini, UFA, "Das Cabinet des Dr. Cali-gari"
+ +Table 8: We show top-5 predictions out of the top-100 for American $\rightarrow$ German adaptations on the Veale NOC subset using 3CosAdd. These are compared to our human annotations in our results. + +
EntityTop Five Learned Adaptations: American→German adapta-tions on the Veale NOC
Abraham LincolnKonrad Adenauer, Helmut Schmidt, Willy Brandt, Helmut Kohl, Adenauer
Al CaponeAndreas Baader, Leo Katzenberger, Paul Schäfer, Strippel, Hermann Langbein
Alfred HitchcockHelmut Käutner, Til Schweiger, Mario Adorf, Paul Verhoeven, Dennis Hopper
Benedict ArnoldOtto von Bismarck, Bismarcks, Bismarck, Preußens, Kaiserreiches Martin Winterkorn, Volkswagen AG, DaimlerChrysler, Robert Bosch GmbH, Volkswagen AG
Bill Gates
Britney SpearsSarah Connor, Nena, Helene Fischer, Lena Meyer-Landrut, Moses Pelham
Charles LindberghChaim Weizmann, Tomás Garrigue Masaryk, Ferdinand Sauer-bruch, Fritz Haber, Chaim Arlosoroff
Donald TrumpHelmut Schmidt, Angela Merkel, Gerhard Schröder, Helmut Kohl, Bundesaußenminister
Elvis PresleyUdo Jürgens, Peter Maffay, Cliff Richard, Achim Reichel, Lou Reed
Ernest HemingwayPaul Schlenther, Marcel Reich-Ranicki., Timothy Leary, Erwin Leiser, Alice Walker
Frank Lloyd WrightAlbert Einstein, Max Planck, Max Born, Hermann von Helmholtz, Arnold Sommerfeld
George WashingtonOtto von Bismarck, Otto von Bismarck, Konrad Adenauer, Engelbert Dollfuß, Joseph Wirth
Henry FordErnst Abbe, Carl Duisberg, Bubbe, Aby Warburg, Sybel
Hillary ClintonAngela Merkel, Angela Merkel, Helmut Schmidt, Gerhard Schröder, Bundesinnenminister
Homer SimpsonRolf Hochhuth, Carl Bernstein, Uwe Tellkamp, Wolfgang Völz, Richard Gere
Jack The Ripper:RipperSarah Connor, Spike Jonze, Timberlake, "Das Urteil", "Nichts als die Wahrheit"
Jay Zwill.i.am, Moses Pelham, Silbermond, Xavier Naidoo, Kanye West
Jimi HendrixPeter Maffay, Udo Lindenberg, Depeche Mode, Xavier Naidoo, Die Toten Hosen
John F. KennedyKonrad Adenauer, Helmut Schmidt, Willy Brandt, Helmut Kohl, Bundeskanzler
Kim KardashianianHeidi Klum, Ruth Moschner, Ellen DeGeneres, Circus HalliGalli, Oliver Pocher
Louis ArmstrongPeter Maffay, Radioaufnahmen, Udo Lindenberg, Achim Reichel, Helge Schneider
Marilyn MonroeWalter Giller, Jessica Tandy, Liv Ullmann, Edgar Selge, Betty White
Michael JordanDirk Nowitzki, Toni Kroos, Zlatan Ibrahimović, Xavi, Zinédine Zidane
Neil ArmstrongMax von Laue, Albert Einstein, Chaim Weizmann, Johannes R. Becher, Ernst Abbe
Noam ChomskyAlbert Einstein, Nobelpreisträger, Max Planck, American Psychological Association, Hans Bethe
Oprah WinfreyAnja Kling, "Forsthaus Falkenau", Uschi Glas, "Saturday Night Live", Anke Engelke
Orville WrightKawaishi, Rjabuschinski, Monistenbund, Dethmann, Leo Baeck +Instituts
Richard NixonHelmut Schmidt, Konrad Adenauer, Willy Brandt, Helmut Kohl, +Gerhard Schröder
Rosa ParksSophie Scholl, Die letzten Tage, Emil Jannings., Ruth Wilson, +Monica Bleibtreu
Serena WilliamsMax Schmeling, Wilfried Dietrich, Gottfried von Cramm, Henry +Maske, László Kubala
Steve JobsDaimlerChrysler, Volkswagen, Siemens, Sanyo, Fujitsu
Steven SpielbergTil Schweiger, Ethan Hawke, Matthias Schweighöfer, Samuel L. +Jackson, Ryan Reynolds
SupermanJabberwocky, Freaks, Scarface, Leatherface, Krabat
Tiger WoodsDirk Nowitzki, deutschen U21-Nationalmannschaft, MTV Gießen, +Mats Hummels, Franz Beckenbauer
Walt DisneyHelmut Dietl, Peter Ustinov, David Mamet, Rainer Werner Fass- +binder, Sonke Wortmann
+ +Table 9: We show top-5 predictions out of the top-100 for American $\rightarrow$ German adaptations on the Veale NOC subset with our Learned Adaptation approach. These are compared to our human annotations in our results. \ No newline at end of file diff --git a/adaptingentitiesacrosslanguagesandcultures/images.zip b/adaptingentitiesacrosslanguagesandcultures/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..e1c329fb573e9ec659c525108e455156a4b71617 --- /dev/null +++ b/adaptingentitiesacrosslanguagesandcultures/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f60b97a4a1dbad2f54fb6ea9259a298e8f080b718786f6c2aa4f5920747e6c91 +size 4185207 diff --git a/adaptingentitiesacrosslanguagesandcultures/layout.json b/adaptingentitiesacrosslanguagesandcultures/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..7f02a6e589d757cc999c31f4b665f948e78b973a --- /dev/null +++ b/adaptingentitiesacrosslanguagesandcultures/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be3d86f8d80f14cdfe3473f47505370dd0617b9627c62bccff24e10eb6d7626b +size 482143 diff --git a/adaptinglanguagemodelsforzeroshotlearningbymetatuningondatasetandpromptcollections/d68800a5-6161-4aaa-bd0d-24773b0dfaa3_content_list.json b/adaptinglanguagemodelsforzeroshotlearningbymetatuningondatasetandpromptcollections/d68800a5-6161-4aaa-bd0d-24773b0dfaa3_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..6f1ba283131ebdd63070442353721962044d0e6e --- /dev/null +++ b/adaptinglanguagemodelsforzeroshotlearningbymetatuningondatasetandpromptcollections/d68800a5-6161-4aaa-bd0d-24773b0dfaa3_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7381e2ce02c56122efacd1ffd839cbaba61bb7fdfb92502e66e1f114b46a32c2 +size 156858 diff --git a/adaptinglanguagemodelsforzeroshotlearningbymetatuningondatasetandpromptcollections/d68800a5-6161-4aaa-bd0d-24773b0dfaa3_model.json b/adaptinglanguagemodelsforzeroshotlearningbymetatuningondatasetandpromptcollections/d68800a5-6161-4aaa-bd0d-24773b0dfaa3_model.json new file mode 100644 index 0000000000000000000000000000000000000000..beef64b6aef80640aa98c193259ee1409d4b0956 --- /dev/null +++ b/adaptinglanguagemodelsforzeroshotlearningbymetatuningondatasetandpromptcollections/d68800a5-6161-4aaa-bd0d-24773b0dfaa3_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:46826453d1a6e3b8d67785fe64b168b3b6c69c9f88529d2c567fb10291aafc40 +size 196738 diff --git a/adaptinglanguagemodelsforzeroshotlearningbymetatuningondatasetandpromptcollections/d68800a5-6161-4aaa-bd0d-24773b0dfaa3_origin.pdf b/adaptinglanguagemodelsforzeroshotlearningbymetatuningondatasetandpromptcollections/d68800a5-6161-4aaa-bd0d-24773b0dfaa3_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..463f952bdb90a9216a8c784f46950be4b5f70383 --- /dev/null +++ b/adaptinglanguagemodelsforzeroshotlearningbymetatuningondatasetandpromptcollections/d68800a5-6161-4aaa-bd0d-24773b0dfaa3_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:04dcb0dd62a9e0a84cfd101c116334689dc5ae9702f4b81610925de70973f7da +size 1160400 diff --git a/adaptinglanguagemodelsforzeroshotlearningbymetatuningondatasetandpromptcollections/full.md b/adaptinglanguagemodelsforzeroshotlearningbymetatuningondatasetandpromptcollections/full.md new file mode 100644 index 0000000000000000000000000000000000000000..91ce11032a81bc655414ebcdf3c95612cd56070f --- /dev/null +++ b/adaptinglanguagemodelsforzeroshotlearningbymetatuningondatasetandpromptcollections/full.md @@ -0,0 +1,699 @@ +# Adapting Language Models for Zero-shot Learning by Meta-tuning on Dataset and Prompt Collections + +Ruiqi Zhong Kristy Lee* Zheng Zhang* Dan Klein Computer Science Division, University of California, Berkeley {ruiqi-zhong, kristylee, zhengzhang1216, Klein} @berkeley.edu + +# Abstract + +Large pre-trained language models (LMs) such as GPT-3 have acquired a surprising ability to perform zero-shot learning. For example, to classify sentiment without any training examples, we can "prompt" the LM with the review and the label description "Does the user like this movie?", and ask whether the next word is "Yes" or "No". However, the next word prediction training objective is still misaligned with the target zero-shot learning objective. To address this weakness, we propose meta-tuning, which directly optimizes the zero-shot learning objective by fine-tuning pre-trained language models on a collection of datasets. We focus on classification tasks, and construct the meta-dataset by aggregating 43 existing datasets and annotating 441 label descriptions in a question-answering (QA) format. When evaluated on unseen tasks, meta-tuned models outperform a sames-sized QA model and the previous SOTA zero-shot learning system based on natural language inference. Additionally, increasing parameter count from 220M to 770M improves AUC-ROC scores by $6.3\%$ , and we forecast that even larger models would perform better. Therefore, measuring zero-shot learning performance on language models out-of-the-box might underestimate their true potential, and community-wide efforts on aggregating datasets and unifying their formats can help build models that answer prompts better. + +# 1 Introduction + +The goal of zero-shot classification (ZSC) is to classify textual inputs using label descriptions without any examples (Yin et al., 2019). Large language models - whose only training objective is to predict the next word given the context - have acquired a surprising ability to perform ZSC (Radford et al., 2019; Brown et al., 2020; Le Scao and Rush, 2021). For example, to classify whether the sentence "This movie is amazing!" is positive, we + +can prompt the language model with the context "Review: This movie is amazing! Positive Review? _", and check whether the next word is more likely to be "Yes" or "No" (Zhao et al., 2021). To convert ZSC into a language modeling (LM) task that an LM model is likely to perform well, many recent works focus on finding better prompts (Shin et al., 2020; Schick and Schütze, 2020a,b; Gao et al., 2021). + +However, the LM training objective is correlated but still misaligned with the target objective to answer prompts. Our work addresses this weakness by directly optimizing the zero-shot classification objective through fine-tuning (Section 4). This requires us to 1) unify different classification tasks into the same format, and 2) gather a collection of classification datasets and label descriptions (prompts) for training (Section 2). Since we fine-tune our model on a meta-dataset, we name our approach meta-tuning. + +We focus on binary classification tasks and unify them into a "Yes"/"No" QA format (Clark et al., 2019; McCann et al., 2018), where the input is provided as the context and the label information is provided in the question (Figure 1 (a)). Using this format, we gathered a diverse set of classification datasets from 43 different sources listed on Kaggle, SemEval, HuggingFace, and other papers. These tasks range from hate speech detection, question categorization, sentiment classification to stance classification, etc, and the genre ranges from textbooks, social media, to academic papers, etc. In total, these datasets contain 204 unique labels, and we manually annotated 441 label descriptions (Figure 2). + +To evaluate ZSC, we need to define what counts as a task that the model has not seen during training time. While prior work considers different notions of "unseen" by disallowing the same label or the same dataset to appear during training, our work defines "unseen" more harshly by dis + +![](images/c222e854fb40f521572f839480789306f70a351cf9640136274a953a22e013dd.jpg) +(a) Task Conversion + +![](images/825953518b3cf2888346ef317f1dd2c7aafeb45bc3dc4c9170279414eb10e836.jpg) +(b) Meta-tuning and Evaluation +(c) Results +Figure 1: (a) We convert the format to question answering. We manually annotate label descriptions (questions) ourselves (Section 2). (b) We finetune the UnifiedQA (Khashabi et al., 2020) model (with $770\mathrm{M}$ parameters) on a diverse set of tasks (Section 4), and evaluate its 0-shot classification (ZSC) performance on an unseen task. (c) For each label description (question) we evaluate the AUC-ROC score for the "Yes" answer, and each dot represents a label description (Section 3). The $x$ -value is the ZSC performance of UnifiedQA; the $y$ -value is the performance after meta-tuning. In most cases, the $y$ -value improves over the $x$ -value (above the red line) and is better than random guesses (above the black line) by a robust margin (Section 5). + +allowing similar datasets. For example, we consider AG News topic classification dataset (Zhang et al., 2015) and the topic classification dataset from Yin et al. (2019) to be similar, even though their sources and label spaces are different. + +Meta-tuning improves ZSC over UnifiedQA for most labels (Figure 1 (c)). Moreover, larger models are better, and hence we forecast that metatuning would work for even larger models. We also find that the performance can be slightly improved by training on datasets similar to the test dataset, ensembling different label descriptions, or initializing with a QA model (Section 5.1). All of our findings reliably hold under different robustness checks (Section 5.2), and our approach outperforms the previous SOTA Yin et al. (2019) using the same pre-training method (Section 5.3). + +Our results suggest two promising future directions (Section 6). First, large language models' (e.g. GPT-3) potential for zero-shot learning, as currently measured by context-prompting, might have been broadly underestimated; metatuning might significantly improve their performance. Second, community-wide efforts on aggregating and unifying datasets can scale up training and evaluation for zero-shot learning models. On the flip side, however, the meta-tuning approach might incentivize providers of LM inference APIs to collect prompts from users, hence potentially leading to security, privacy, and fairness concerns at a greater scale (Section A). + +Contributions To summarize, we 1) curate a dataset of classification datasets with expert an + +notated label descriptions. 2) demonstrate a simple approach to train models to perform zero-shot learning, and 3) identify several factors that improve performance; in particular, larger pretrained models are better. + +# 2 Data + +We gather a wide range of classification datasets and unify them into the "Yes"/"No" question answering format for binary classification. Then we group similar datasets together to determine what counts as unseen tasks during evaluation. + +Gathering classification datasets We collect classification datasets from Kaggle $^2$ , Huggingface (Wolf et al., 2020), SemEval $^3$ , and other papers. We looked through these sources and only considered English classification datasets. We also skipped the tasks that we felt were already better represented by other datasets in our collection. Then we manually examined a few examples in each remaining dataset to make sure it seemed plausibly clean. + +The goals of these classification datasets include, but are not limited to sentiment classification (IMDB Reviews, Maas et al. (2011a)), topic classification (AG News, Zhang et al. (2015)), grammaticality judgement (CoLA, Warstadt et al. (2018)), paraphrase detection $(\mathrm{QQP}^4)$ , definition + +![](images/d02a5751140968370359418e283afbf0f5af08a6c3f021959b939ae568c2c92f.jpg) +Figure 2: For each dataset, we annotate 1-3 descriptions for each label in the form of questions, and associate it with a set of property tags. The question answering format can be seen in Figure 1 (a). +Figure 3: Some example manually annotated label descriptions (questions). Three of the authors manually wrote 441 questions in total, and each of them is proofread by at least another author. + +detection (SemEval 2020 Task 6, Spala et al. (2019)), stance classification (SemEval 2016 Task 6, Mohammad et al. (2016)), etc. The genre includes academic papers, reviews, tweets, posts, messages, articles, and textbooks. The comprehensive list of datasets is in Appendix B. Overall, we aim for a high diversity of tasks and genres by building upon what the broader research community has studied. Our approach is complementary to that of Weller et al. (2020), which asks turkers to generate tasks, and that of Mishra et al. (2021), which generates tasks by decomposing existing templates used to construct reading comprehension datasets. The concurrent work of Bragg et al. (2021) unifies the evaluation for few-shot learning; their zero-shot evaluation setup is the closest to ours, and they used templates and verbalizers (Schick and Schütze, 2020a) to specify the semantics of a task. + +Some of our datasets are noisy and not peer reviewed, or contain tasks that are too complicated (e.g. Multi-NLI, Williams et al. (2018)) for ZSC. To make our evaluation more informative, we only include them for training but not testing. We make these decisions before running our experiments in Section 5 to prevent selection bias. + +Unifying the dataset format We convert each classification dataset into a "Yes"/"No" question answering format and provide label information in the question. For each label, we annotate 1-3 questions. If the label is null (for example, a text that does not express a particular emotion in an emotion classification dataset), we skip this label. Three of the authors5 manually annotated 441 questions for 204 unique labels, and each question + +Are these two questions asking for the same thing? Does the tweet contain irony? + +Is this news about world events? + +Does the text contain a definition? + +Is the tweet an offensive tweet? + +Is the text objective? + +Does the question ask for a numerical answer? + +Is the tweet against environmentalist initiatives? + +Is this abstract about Physics? + +Does the tweet express anger? + +Does the user dislike this movie? + +Is the sentence ungrammatical? + +Is this text expressing a need for evacuation? + +Is this text about Society and Culture? + +Is this a spam? + +is proofread by at least another author. See Figure 2 for a concrete example, and Figure 3 for some representative label descriptions. + +Additionally, some datasets contain thousands of labels (Chalkidis et al., 2019; Allaway and McKeown, 2020). In this case, we use templates to automatically synthesize label descriptions and exclude them from evaluation. + +Grouping similar datasets Our goal is to test the models' ability to generalize to tasks that are different enough from the training tasks. Therefore, at test time, we need to exclude not only the same dataset that appeared in the meta-tuning phase, but also ones that are similar. + +This poses a challenge: whether two datasets perform the same task involves subjective opinion, and there is no universally agreed definition. On one extreme, most datasets can be counted as dissimilar tasks, since they have different label spaces and input distributions. On the other extreme, all datasets can be considered the same task, since they can all be unified into the question answering format. + +To tackle this challenge, we create a set of tags, each describing a dataset property. The set of tags includes domain classification, article, emotion, social-media, etc, and the full set of them can be seen in Appendix C. Then we define the + +![](images/bcf964c006ad74e792156fb0160967fde0d25f8d225a61a5e5a479686a197d57.jpg) +Figure 4: Example dataset groups based on tags. We never train and test on datasets from the same group, e.g. train on hotel review and test on movie review. + +two datasets to be similar if they are associated with the same set of tags, and prohibit the model to learn from one and test on the other. For example, our work considers the topic classification datasets from Zhang et al. (2015) (AG News) and Yin et al. (2019) to be similar since they both classify topics for articles, even though their sources and label spaces are different. Some example dataset groups can be seen in Figure 4. + +Nevertheless, our procedure is not bullet-proof and one can argue that our notion of unseen tasks, though harsher than prior works (Yin et al., 2019; Pushp and Srivastava, 2017), is still lenient. Therefore, as additional robustness checks, for each dataset we evaluate, we manually identify and list the most relevant dataset that is allowed during training in Appendix F. For example, the most relevant dataset to the IMDB review sentiment classification dataset is the emotion classification dataset from Yin et al. (2019), which classifies the input text into 9 emotions, such as "joy", "surprise", "guilt", etc. We consider the emotion classification dataset to be relevant, since sentiment classification often involves identifying emotions. However, one can also argue that they are different tasks: their input and label spaces are different, and sadness can be caused by a great tragedy, or a bad movie that wastes the users' time. The comprehensive list of label descriptions grouped by dataset similarity is in Appendix D. + +In total, we spend around 200 hours to collect this dataset. This time estimate includes skimming through the dataset repos and recent NLP papers, writing programs to download the datasets and unify their format, annotating label descriptions, performing quality controls, and documenting the collection process. + +# 3 Metrics + +To reliably aggregate performance across different datasets and present as much information as possible, we report a set of descriptive statistics and provide visualizations whenever we compare two models. We generally do not reduce a model's performances on different datasets into one scalar quantity and compare this number only. + +Descriptive statistics For each label description (question), we calculate the AUC-ROC score $^6$ by treating the "Yes" answer as the positive class. After calculating the AUC-ROC score for each label, we calculate the following set of descriptive statistics to compare two models. Suppose that model $Y$ is hypothetically better than $X$ . Denoting $\Delta$ as the change of AUC-ROC of a label description from $X$ to $Y$ , we can summarize how $\Delta$ is distributed across the set of label descriptions with the following statistics: + +- $\mathbb{E}[\Delta]$ : the average change in AUC-ROC. +- $\mathbb{P}[\Delta > t]$ : the fraction of label descriptions where the change is over the threshold $t$ . +- $\mathbb{P}[\Delta < -t]$ : the fraction of label descriptions where the change is less than $-t$ . +- $Std[\Delta]$ : the standard deviation of the change. + +In the main paper, we weight each label description equally in this distribution to calculate the above statistics. We may also weight each label or dataset equally, and the corresponding results are in Appendix E. To make sure our conclusions are robust, we consider one model to be better only when $\mathbb{E}[\Delta] > 0$ and $\mathbb{P}[\Delta > t] > \mathbb{P}[\Delta < -t]$ for all $t \in \{1\%, 5\%, 10\}$ , under all three types of weighting. In other words, we claim that one model is better than the other only when 12 conditions simultaneously hold. + +Visualizations We use scatter plots to visualize and compare the performance of two models, where each dot represents a label description, its x-value represents the AUC-ROC score of the model $X$ , and its y-value represents that of $Y$ . If most dots are above the identity line $y = x$ , the model $Y$ is better than $X$ . + +The descriptive statistics and the visualizations are explained in Figure 5. + +![](images/62a9a3da3e9fba938a13033df2d68feb0888438845e3b4bfa4309e421e62b1c1.jpg) +Figure 5: Each dot represents a label description, and its $x / y$ -value each represents the performance of model $X / Y$ (measured by AUC-ROC score). For example, on label description $D1$ , model $X / Y$ has AUC-ROC score 0.5/0.65. If the dot is above the black line ( $y = 0.5$ ), model $Y$ is performing better than random guesses. If the dot is above the red line ( $y = x$ ), model $Y$ is better than model $X$ . Since one out of two dots are above $y = x + 0.05$ , we have $\mathbb{P}[\Delta > 5\%] = 0.5$ . + +# 4 Model + +Architecture We format the inputs to the model in the same way as UnifiedQA (Khashabi et al., 2020), which concatenates the context to the question and adds a "[SEP]" token in between. Then we feed the concatenated input into the T5 encoder and produce the answer score by normalizing the "Yes"/"No" probability of the first decoded token. Unless otherwise noted, we initialize our model with T5-Large (770 Million parameters). We sometimes compare to or initialize with the UnifiedQA model (Khashabi et al., 2020), which is trained on a wide range of question answering datasets. For a fair comparison, we use the UnifiedQA model initialized with T5-Large as well. To meta-tune non-Seq2Seq pretrained models, such as BERT (Devlin et al., 2019) or RoBERTa (Liu et al., 2019), we add an MLP layer on top of the pooled output/[CLS]" token to classify between "Yes"/"No". We leave the improvement on model architectures (Ye and Ren, 2021; Li and Liang, 2021; Lester et al., 2021) and training objectives (Murty et al., 2021; Yin et al., 2020) for future work. + +Meta-tuning We create a training distribution that balances between datasets, label descriptions, and "Yes"/“No” answers. To create the next training datapoint for meta-tuning, we select a + +dataset from the training split uniformly at random (u.a.r.); then we select a label description (question) u.a.r. and with $50\%$ probability select a textual input with the answer "Yes"/"No". To prevent over-fitting, we do not train on any combination of label description and textual input twice. Unless otherwise noted, we meta-tune the model for 5000 steps and use batch size 32. We did not tune any hyper-parameters or training configurations since they work well during our first attempt. To evaluate ZSC performance on each dataset, we leave out one group of similar datasets as the evaluation set and train on the rest. Altogether, the experiments take around 250 GPU hours on Quadro 8000. + +# 5 Results + +# 5.1 Hypotheses and Conclusions + +We investigate and validate the following hypotheses, sorted by importance in descending order. + +Meta-tuned models outperform general question answering models in zero-shot classification. +- Larger pre-trained models are better. +- Pre-training does the heavy lifting. +- Performance can be improved by training on similar datasets, initializing with a QA model, or assembling label descriptions. +- Early stopping is crucial to performance. + +Meta-tuned models are better. We compare a meta-tuned T5-Large model (770 M parameters) with the same-sized UnifiedQA model (Khashabi et al., 2020) out of the box. Relevant descriptive statistics can be seen in the first row of Table 1 and Figure 6 (a). Adapting the model for ZSC improves the average AUC-ROC by $3.3\%$ . + +Larger pre-trained models are better. We compare T5-Base (220 Million parameters) against T5-Large (770 M). The statistics can be seen in the second row of Table 1 and Figure 6 (b). Increasing the model size from 220 M to 770M improves the average AUC-ROC by $6.3\%$ . + +
E[Δ]P[Δ > 1%]P[Δ < -1%]Std(Δ)
Meta-tuned vs. UnifiedQA3.3%59.5%28.1%9.5%
Larger6.3%75.1%15.1%8.1%
Pre-trained vs. Random23.8%95.7%3.2%14.0%
Train on Similar0.7%43.8%20.5%3.2%
Ensemble Descriptions0.7%28.9%16.8%3.1%
Initialize with UnifiedQA1.1%54.1%24.3%6.9%
+ +Table 1: The statistics used to compare two models, introduced in Section 3. The larger $\mathbb{E}[\Delta]$ and the difference between $\mathbb{P}[\Delta > 1\%]$ and $\mathbb{P}[\Delta < -1\%]$ , the better. Row 1 finds that a meta-tuned model is better than UnifiedQA; row 2 finds that the larger model is better; row 3 finds that pre-training does the heavy lifting; row 4, 5, and 6 finds that the performance can be improved by training on similar datasets, assembling label descriptions, and initializing with a UnifiedQA model. Note that $Std(\Delta)$ is the standard deviation of individual descriptions, not the standard deviation of the estimated mean. Due to space constraint we only show $t = 1\%$ in this table. + +Pre-training does the heavy lifting. In Figure (c) and the third row of Table 1, we compare pretrained and random initializations, where the latter cannot beat the random baseline (average AUC-ROC 0.503). Hence, meta-tuning alone is far from enabling the model to perform ZSC. An intuitive interpretation is that the model already "knows" how to perform ZSC after pre-training under the LM objective, and learns how to use this knowledge during meta-tuning. + +Training on similar datasets improves performance. Unlike before, we no longer avoid training on similar datasets from the same group. Instead, we perform straightforward leave-one-out cross-validation. The statistics can be seen in the fourth row of Table 1 and Figure 6 (d), and it improves the average AUC-ROC by $0.7\%$ . The performance gain is not as significant as increasing the model size or adapting for ZSC. We conjecture that it is because we have not collected enough datasets; otherwise, there might be more similar datasets, hence improving ZSC performance. + +Ensembling label descriptions improves performance. Instead of asking the model a single question for each label and obtain the probability of the answer being "Yes", we can average the probability obtained by asking multiple questions with the same meaning. This approach is different from traditional ensembling, which typically needs to store/train multiple models to average across them. The fifth row of Table 1 and Figure 6 (e) verifies that ensembling descriptions improves performance slightly (0.7% AUC-ROC score). + +Initializing with UnifiedQA improves performance. Figure 6 (f) and the sixth row of Table 1 + +compare the UnifiedQA against against the T5 initialization. Initializing with UnifiedQA improves average AUC-ROC by $1.1\%$ . + +Early stopping is crucial to performance. If we train the model for too long, the model might simply "memorize" that certain label descriptions correspond to certain training tasks, and the performance on unseen tasks may drop. To explore this possibility, we meta-tune our models for 100K steps, which is 20 times as long as our default setting and encourages the model to memorize the training tasks. We then evaluate them on the three benchmark zero-shot classification datasets by Yin et al. (2019) (which we describe in more details in the next section). We calculate the average AUC-ROC across all label descriptions for each of the 3 datasets, and plot them in Figure 7. + +The performance decreases ${}^{8}$ as training continues. On the other hand, however, the performance drop of $3\%$ in AUC-ROC is not fatal and the model's performance is still much better than random guesses. + +# 5.2 Robustness Checks + +We examine a series of additional results to make sure our conclusions are robust. The observed improvements in Table 1 and Figure 6 might be caused by the improvement of a small number of labels that are annotated with more descriptions, or by the improvement on a dataset with more distinct labels. Appendix E.1 compares the performance by assigning equal weights to each label/datasets. + +To provide additional supporting evidence for + +![](images/8a290466952a2840c089b373f85e5c54d3ed2f4dc86f731e5e8ef1ed4ed9c2e4.jpg) +(a) + +![](images/6f09035c3555da673ceb851fa09c1a3e06a2caf88d1a0a162b7658b02ebff5eb.jpg) +(b) + +![](images/2a7e4d058bc7b74a1d31f20661a02a859feb857d1aee45dec6b6903eae6ef8fe.jpg) +(c) + +![](images/9e8d07883e89c9685f87577d1d78d4ec7042903023c4bd8ae1dbc364d44e08ff.jpg) +(d) + +![](images/7993e0581a0600f8bcdd887d2c18d7c4d442a2d774c958591889ff5fcb93b823.jpg) +(e) + +![](images/1373831d65a6b3eb404b4e2099b16c43d0dc2447c7375a1224589d947805e58a.jpg) +(f) +Figure 6: The interpretation of these figures can be seen in Figure 5. (a) compares a meta-tuned model $(y)$ against UnifiedQA $(x)$ ; (b) compares T5-Large $(770\mathrm{M}$ parameters) against T5-base $(220\mathrm{M})$ ; (c) compares the T5 pretrained initialization against the random initialization; (d), (e), and (f) investigate whether performance can be improved by training on similar datasets, assembling different label descriptions (questions), and initializing with UnifiedQA. Conclusion: Since most dots are above the red line $y = x$ for all 6 figures and above the random guess baseline $(y = 0.5)$ by a robust margin, all conclusions listed at the beginning of Section 5 hold. + +![](images/f9e0a2fa7f7f2a7e97b946da712f07a53c8749f4795862555f6ae34937fa4d01.jpg) +Figure 7: Each curve corresponds to the models' performance on a dataset from Yin et al. (2019). $x$ -value is the number of training steps; $y$ -value is the average AUC-ROC score across all label descriptions, relative to the value at step 5000. Training for too long decreases performance on unseen tasks. + +our forecast that larger models are better, Appendix E.2 compares a 60M-parameter model against a 220M-parameter model, and finds that the latter is much better. One concern, however, is that our models are initialized with T5 (Raffel et al., 2019), which is trained on the open web and might have seen the datasets we gathered. There- + +
Modelemotionsituationtopic
Yin et al. (2019)25.238.052.1
Meta-tuned28.248.454.3
+ +Table 2: "Prior" means the best performing system from Yin et al. (2019) for each dataset; "Meta-tuned" means meta-tuning on RoBERTa. Our approach is better on all three datasets. + +fore, larger models might be better simply because they are better at memorization (Sagawa et al., 2020). Appendix E.3 addresses this by showing that larger models are also better with BERT initialization (Devlin et al., 2019), which is trained on Wikipedia and Book Corpus (Zhu et al., 2015). + +We also report the models' performance on each dataset for readers' reference in Appendix G. + +# 5.3 Comparison with Yin et al. (2019) + +This section shows that our approach has higher performance than the zero-shot classification system built by Yin et al. (2019). Their system ensembles several natural language inference models based on RoBERTA-Large (355M parameters, Liu et al. (2020)), and another model trained to categorize Wikipedia articles. It was evaluated on three classification datasets: + +- topic (10-way): classifies article domains, such as family & relationship, education, sports, etc. The metric is accuracy. +- emotion (10-way): classifies emotion types, such as joy, anger, guilt, shame, etc. The metric is label-weighted F1. +- situation (12-way): classifies disaster situations, e.g. regime change, crime & violence, and the resource they need, e.g. search & rescue. The metric is label-weighted F1. + +We use the exact same evaluation metrics as in Yin et al. (2019), and the same label resolution strategy when the model answers "Yes" for multi-label classification. Concretely, when the model predicts "Yes" on multiple labels, the one with the highest probability is selected. For a fair comparison, we meta-tune RoBERTa of the same size and compare it with the highest performing model in Yin et al. (2019) for each of the three datasets. + +The results are in Table 2, and our model has higher performance across all 3 datasets using the same pre-training method. + +# 6 Discussion and Future Directions + +Main takeaways We construct a dataset of classification datasets to adapt the language model for zero-shot classification via meta-tuning. The adapted model outperforms a general-purpose question answering model and the prior state of the art based on natural language inference. We forecast that meta-tuning would be more effective on larger models, and the current engineering ceiling for zero-shot learning might have been broadly under-estimated. + +Aggregating and unifying datasets The main bottleneck of our research is to manually gather a wide range of datasets and unify their format. The difficulties are: 1) we need to brainstorm and review the NLP literature extensively to decide what new tasks to look for; 2) different datasets encode their data in different formats, and we need to write programs manually for each of them to convert to the desired format; 3) it is hard to tell the quality of a dataset purely by its provenance, and sometimes we need to examine the dataset manually. If we as a community can aggregate and unify datasets better, we could potentially train and evaluate zero-shot learning models at a larger scale. + +Meta-tuning as a probe There is a growing interest in measuring the intelligence (Hendrycks et al., 2021a,b) or the few-shot learning ability (Brown et al., 2020) of large language models like GPT-3. However, since these models are not adapted to answer those prompts (Holtzman et al., 2021), we suspect that its knowledge and true potential to perform few-shot learning is much higher than reported. Since pre-training does the heavy lifting and meta-tuning is unlikely to provide additional ZSC ability to the model, we can potentially first use meta-tuning as a probe to make them adapted to answering prompts before measuring their performance. + +Still, to make this methodology rigorous, interpreting and controlling the strength of the probes will be an important future direction (Hewitt and Liang, 2019). For example, if the training set contains a prompt that is too similar to the prompt to be tested, the probe will be meaningless. + +Beyond Shallow Correlations One possibility is that the model only learns shallow statistical correlations from meta-tuning rather than "more sophisticated reasoning skills". For example, the word "exciting" might occur in positive reviews more. This is unlikely, given that larger models are consistently better than smaller or randomly initialized ones. To explain this performance gap, larger models must have learned to use more complicated features during meta-tuning. + +Relation to Meta/Multitask-Learning Our method is closely related to, but different from meta-learning (Yin, 2020; Murty et al., 2021) and multi-task learning (Ye et al., 2021; Aghajanyan et al., 2021). Both meta-learning and multitask-learning typically involve at least a few examples from the target task; in our setup, however, the model does not learn from any target task examples. The "meta" in our name does not mean "meta-learning", but reflects the fact that our model learns from a meta-dataset of tasks. + +Nevertheless, our framework can be easily adapted to a few-shot learning setup, which enables the language model to learn to learn from incontext examples (see below). Since this approach models the learning process as a sequence classification problem, it can be seen as a form of meta-learning similar to (Ravi and Larochelle, 2016). + +Annotating Prompts Three of our authors annotated the label descriptions. Since they are all + +Computer Science major students who understand machine learning and natural language processing, they might not be representative of the final user population of this ZSC application. Annotating prompts that match the target user distribution will be an important research direction. + +Additionally, shorter and more natural descriptions sometimes fail to capture the exact semantics of the label. For example, in Yin et al. (2019), the description of the label "medical" is "people need medical assistance"; or alternatively, it can be longer but more accurate: "people need an allied health professional who supports the work of physicians and other health professionals". How to scalably generate more accurate and detailed label descriptions without expert efforts will be another future direction. + +Optimizing Prompts Our work is complementary to recent works that optimize the prompts to achieve better accuracy. Even if our metatuned model is specialized in answering prompts, it might still react very differently towards different prompts. For example, in the stance classification dataset (Barbieri et al., 2020), we annotated two label descriptions (prompts) for the same label: "Does this post support atheism?" and "Is the post against having religious beliefs?". They have similar meanings, but the former has much lower accuracy than the later. We conjecture that this is because the model cannot ground abstract concepts like "atheism". + +Other extensions We conjecture that metatuning can be extended to more diverse tasks beyond zero-shot binary classification. To extend to multi-label classification, we need to develop a procedure to resolve the labels when the model predicts positive for more than one labels. To extend to few-shot learning, we need to increase the context length to fit several training examples into the input, which requires a larger context window and hence more computational resources. To extend to other sequence generation tasks, we need to collect a wide range of diverse sequence generation tasks to meta-tune the model, such as machine translation, summarization, free-form question answering, grammar correction, etc. + +# Acknowledgements + +We thank Eric Wallace for his feedbacks throughout the project. We thank Steven Cao, David + +Gaddy, Haizhi Lai, Jacob Steinhardt, Kevin Yang and anonymous reviewers for their comments on the paper. + +# References + +Armen Aghajanyan, Anchit Gupta, Akshit Shrivastava, Xilun Chen, Luke Zettlemoyer, and Sonal Gupta. 2021. Muppet: Massive multi-task representations with pre-finetuning. arXiv preprint arXiv:2101.11038. +Emily Allaway and Kathleen McKeown. 2020. Zero-Shot Stance Detection: A Dataset and Model using Generalized Topic Representations. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 8913-8931, Online. Association for Computational Linguistics. +Tiago Almeida, José María Gómez Hidalgo, and Tiago Pasqualini Silva. 2013. Towards sms spam filtering: Results under a new dataset. International Journal of Information Security Science, 2(1):1-18. +Francesco Barbieri, Jose Camacho-Collados, Luis Espinosa Anke, and Leonardo Neves. 2020. TweetEval: Unified benchmark and comparative evaluation for tweet classification. In *Findings of the Association for Computational Linguistics: EMNLP* 2020, pages 1644–1650, Online. Association for Computational Linguistics. +Valerio Basile, Cristina Bosco, Elisabetta Fersini, Debora Nozza, Viviana Patti, Francisco Manuel Rangel Pardo, Paolo Rosso, and Manuela Sanguinetti. 2019. SemEval-2019 task 5: Multilingual detection of hate speech against immigrants and women in Twitter. In Proceedings of the 13th International Workshop on Semantic Evaluation, pages 54–63, Minneapolis, Minnesota, USA. Association for Computational Linguistics. +Tolga Bolukbasi, Kai-Wei Chang, James Y Zou, Venkatesh Saligrama, and Adam T Kalai. 2016. Man is to computer programmer as woman is to homemaker? debiasing word embeddings. In Advances in Neural Information Processing Systems, volume 29. Curran Associates, Inc. +Jonathan Bragg, Arman Cohan, Kyle Lo, and Iz Beltagy. 2021. Flex: Unifying evaluation for few-shot nlp. arXiv preprint arXiv:2107.07170. +Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. arXiv preprint arXiv:2005.14165. +Nicholas Carlini, Florian Tramér, Eric Wallace, Matthew Jagielski, Ariel Herbert-Voss, Katherine Lee, Adam Roberts, Tom Brown, Dawn Song, Ülfar Erlingsson, Alina Oprea, and Colin Raffel. 2020. + +Extracting training data from large language models. arXiv preprint arXiv:2012.07805. +Ilias Chalkidis, Emmanouil Fergadiotis, Prodromos Malakasiotis, and Ion Androutsopoulos. 2019. Large-scale multi-label text classification on EU legislation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 6314-6322, Florence, Italy. Association for Computational Linguistics. +Christopher Clark, Kenton Lee, Ming-Wei Chang, Tom Kwiatkowski, Michael Collins, and Kristina Toutanova. 2019. *BoolQ: Exploring the surprising difficulty of natural yes/no questions.* In *Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies*, Volume 1 (Long and Short Papers), pages 2924–2936, Minneapolis, Minnesota. Association for Computational Linguistics. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 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, Volume 1 (Long and Short Papers), pages 4171-4186, Minneapolis, Minnesota. Association for Computational Linguistics. +Tianyu Gao, Adam Fisch, and Danqi Chen. 2021. Making pre-trained language models better few-shot learners. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 3816-3830, Online. Association for Computational Linguistics. +Dan Hendrycks, Collin Burns, Steven Basart, Andrew Critch, Jerry Li, Dawn Song, and Jacob Steinhardt. 2020. Aligning AI With Shared Human Values. arXiv e-prints, page arXiv:2008.02275. +Dan Hendrycks, Collin Burns, Steven Basart, Andrew Critch, Jerry Li, Dawn Song, and Jacob Steinhardt. 2021a. Aligning {ai} with shared human values. In International Conference on Learning Representations. +Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. 2021b. Measuring massive multitask language understanding. In International Conference on Learning Representations. +John Hewitt and Percy Liang. 2019. Designing and interpreting probes with control tasks. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 2733-2743, Hong Kong, China. Association for Computational Linguistics. + +Ari Holtzman, Peter West, Vered Shwartz, Yejin Choi, and Luke Zettlemoyer. 2021. Surface form competition: Why the highest probability answer isn't always right. CoRR, abs/2104.08315. +Daniel Khashabi, Sewon Min, Tushar Khot, Ashish Sabharwal, Oyvind Tafjord, Peter Clark, and Hannaneh Hajishirzi. 2020. UNIFIEDQA: Crossing format boundaries with a single QA system. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 1896-1907, Online. Association for Computational Linguistics. +Tven Le Scao and Alexander Rush. 2021. How many data points is a prompt worth? In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 2627-2636, Online. Association for Computational Linguistics. +Brian Lester, Rami Al-Rfou, and Noah Constant. 2021. The power of scale for parameter-efficient prompt tuning. arXiv preprint arXiv:2104.08691. +Xiang Lisa Li and Percy Liang. 2021. Prefix-tuning: Optimizing continuous prompts for generation. arXiv preprint arXiv:2101.00190. +Xin Li and Dan Roth. 2002. Learning question classifiers. In COLING 2002: The 19th International Conference on Computational Linguistics. +Hairong Liu, Mingbo Ma, Liang Huang, Hao Xiong, and Zhongjun He. 2019. Robust neural machine translation with joint textual and phonetic embedding. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3044-3049, Florence, Italy. Association for Computational Linguistics. +Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2020. Ro{bert}a: A robustly optimized {bert} pretraining approach. +Andrew L. Maas, Raymond E. Daly, Peter T. Pham, Dan Huang, Andrew Y. Ng, and Christopher Potts. 2011a. Learning word vectors for sentiment analysis. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, pages 142-150, Portland, Oregon, USA. Association for Computational Linguistics. +Andrew L. Maas, Raymond E. Daly, Peter T. Pham, Dan Huang, Andrew Y. Ng, and Christopher Potts. 2011b. Learning word vectors for sentiment analysis. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, pages 142-150, Portland, Oregon, USA. Association for Computational Linguistics. + +Bryan McCann, Nitish Shirish Keskar, Caiming Xiong, and Richard Socher. 2018. The natural language decathlon: Multitask learning as question answering. arXiv preprint arXiv:1806.08730. +Tsvetomila Mihaylova, Georgi Karadzhov, Pepa Atanasova, Ramy Baly, Mitra Mohtarami, and Preslav Nakov. 2019. SemEval-2019 task 8: Fact checking in community question answering forums. In Proceedings of the 13th International Workshop on Semantic Evaluation, pages 860–869, Minneapolis, Minnesota, USA. Association for Computational Linguistics. +Swaroop Mishra, Daniel Khashabi, Chitta Baral, and Hannaneh Hajishirzi. 2021. Natural instructions: Benchmarking generalization to new tasks from natural language instructions. arXiv preprint arXiv:2104.08773. +Rishabh Misra. 2019. Imdb spoiler dataset. +Rishabh Misra, Mengting Wan, and Julian McAuley. 2018. Decomposing fit semantics for product size recommendation in metric spaces. In Proceedings of the 12th ACM Conference on Recommender Systems, pages 422-426. ACM. +Saif Mohammad, Felipe Bravo-Marquez, Mohammad Salameh, and Svetlana Kiritchenko. 2018. SemEval-2018 task 1: Affect in tweets. In Proceedings of The 12th International Workshop on Semantic Evaluation, pages 1-17, New Orleans, Louisiana. Association for Computational Linguistics. +Saif Mohammad, Svetlana Kiritchenko, Parinaz Sobhani, 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, San Diego, California. Association for Computational Linguistics. +Shikhar Murty, Tatsunori B Hashimoto, and Christopher D Manning. 2021. Dreca: A general task augmentation strategy for few-shot natural language inference. +Bo Pang and Lillian Lee. 2004. A sentimental education: Sentiment analysis using subjectivity summarization based on minimum cuts. In Proceedings of the 42nd Annual Meeting of the Association for Computational Linguistics (ACL-04), pages 271-278, Barcelona, Spain. +Pushpankar Kumar Pushp and Muktabh Mayank Srivastava. 2017. Train once, test anywhere: Zero-shot learning for text classification. arXiv preprint arXiv:1712.05972. +Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9. + +Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. 2019. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint arXiv:1910.10683. +Sachin Ravi and Hugo Larochelle. 2016. Optimization as a model for few-shot learning. +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-2017), pages 502-518, Vancouver, Canada. Association for Computational Linguistics. +Shiori Sagawa, Aditi Raghunathan, Pang Wei Koh, and Percy Liang. 2020. An investigation of why overparameterization exacerbates spurious correlations. In International Conference on Machine Learning, pages 8346-8356. PMLR. +Timo Schick and Hinrich Schütze. 2020a. Exploiting cloze questions for few-shot text classification and natural language inference. arXiv preprint arXiv:2001.07676. +Timo Schick and Hinrich Schütze. 2020b. It's not just size that matters: Small language models are also few-shot learners. arXiv preprint arXiv:2009.07118. +Taylor Shin, Yasaman Razeghi, Robert L. Logan IV, Eric Wallace, and Sameer Singh. 2020. AutoPrompt: Eliciting Knowledge from Language Models with Automatically Generated Prompts. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4222-4235, Online. Association for Computational Linguistics. +Sasha Spala, Nicholas Miller, Franck Dernoncourt, and Carl Dockhorn. 2020. SemEval-2020 task 6: Definition extraction from free text with the DEFT corpus. In Proceedings of the Fourteenth Workshop on Semantic Evaluation, pages 336-345, Barcelona (online). International Committee for Computational Linguistics. +Sasha Spala, Nicholas A. Miller, Yiming Yang, Franck Dernoncourt, and Carl Dockhorn. 2019. DEFT: A corpus for definition extraction in free- and semi-structured text. In Proceedings of the 13th Linguistic Annotation Workshop, pages 124–131, Florence, Italy. Association for Computational Linguistics. +Iulia Turc, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. Well-read students learn better: On the importance of pre-training compact models. arXiv preprint arXiv:1908.08962. +Cynthia Van Hee, Els Lefever, and Véronique Hoste. 2018. SemEval-2018 task 3: Irony detection in English tweets. In Proceedings of The 12th International Workshop on Semantic Evaluation, pages 39–50, New Orleans, Louisiana. Association for Computational Linguistics. + +Eric Wallace, Tony Z Zhao, Shi Feng, and Sameer Singh. 2020. Customizing triggers with concealed data poisoning. arXiv preprint arXiv:2010.12563. +Alex Warstadt, Amanpreet Singh, and Samuel R Bowman. 2018. Neural network acceptability judgments. arXiv preprint arXiv:1805.12471. +Orion Weller, Nicholas Lourie, Matt Gardner, and Matthew Peters. 2020. Learning from task descriptions. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1361-1375, Online. Association for Computational Linguistics. +Adina Williams, Nikita Nangia, and Samuel Bowman. 2018. A broad-coverage challenge corpus for sentence understanding through inference. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 1112-1122, New Orleans, Louisiana. Association for Computational Linguistics. +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Remi Louf, Morgan Funtowicz, Joe Davison, Sam Shleifer, Patrick von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lhoest, and Alexander Rush. 2020. Transformers: State-of-the-art natural language processing. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 38-45, Online. Association for Computational Linguistics. +Qinyuan Ye, Bill Yuchen Lin, and Xiang Ren. 2021. Crossfit: A few-shot learning challenge for cross-task generalization in NLP. CoRR, abs/2104.08835. +Qinyuan Ye and Xiang Ren. 2021. Zero-shot learning by generating task-specific adapters. arXiv preprint arXiv:2101.00420. +Mingzhang Yin, George Tucker, Mingyuan Zhou, Sergey Levine, and Chelsea Finn. 2020. Metalearning without memorization. In International Conference on Learning Representations. +Wenpeng Yin. 2020. Meta-learning for few-shot natural language processing: A survey. arXiv preprint arXiv:2007.09604. +Wenpeng Yin, Jamaal Hay, and Dan Roth. 2019. Benchmarking zero-shot text classification: Datasets, evaluation and entailment approach. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 3914-3923, Hong Kong, China. Association for Computational Linguistics. + +Marcos Zampieri, Shervin Malmasi, Preslav Nakov, Sara Rosenthal, Noura Farra, and Ritesh Kumar. 2019. SemEval-2019 task 6: Identifying and categorizing offensive language in social media (OffensEval). In Proceedings of the 13th International Workshop on Semantic Evaluation, pages 75–86, Minneapolis, Minnesota, USA. Association for Computational Linguistics. +Xiang Zhang, Junbo Zhao, and Yann LeCun. 2015. Character-level convolutional networks for text classification. In Proceedings of the 28th International Conference on Neural Information Processing Systems - Volume 1, NIPS'15, page 649-657, Cambridge, MA, USA. MIT Press. +Tony Z. Zhao, Eric Wallace, Shi Feng, Dan Klein, and Sameer Singh. 2021. Calibrate before use: Improving few-shot performance of language models. arXiv preprint arXiv:2102.09690. +Yukun Zhu, Ryan Kiros, Rich Zemel, Ruslan Salakhutdinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. 2015. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. In Proceedings of the IEEE international conference on computer vision, pages 19-27. + +# A Ethics + +Data and incentives In the existing prompting framework, end users send the natural language descriptions and a few training examples to the large language model inference API to perform few-shot learning (Brown et al., 2020). This becomes a natural source of training data for metatuning. Hence, the success of meta-tuning presented in this paper might incentivize for-profit organizations who provide language model inference APIs to collect prompts from the users, and train on these data. + +Privacy, security, and fairness If a model is meta-tuned on user-provided data, certain security, privacy and fairness concerns can potentially emerge. For example, Carlini et al. (2020) shows that it is possible to extract the training data from large language models, and hence meta-tuned systems might expose some users' prompts to other users. Wallace et al. (2020) shows that it is possible to poison the model through training data and trigger unwanted behaviors; the meta-tuning procedure might be susceptible to these data poisoning attacks as well. Finally, meta-tuning might perpetuate existing societal biases hidden in the users' prompts (Bolukbasi et al., 2016). + +If not addressed properly, these concerns might have a broader negative societal impact through meta-tuning. Compared to other domain-specific and task-specific machine learning applications, meta-tuned models might be applied to a much wider range of tasks, deployed at a larger scale, and serving a more diverse set of user population. Therefore, biased or poisoned training data for one task from one user population might compromise fairness and performance of another task and harm another user population; additionally, malicious or biased data might even tamper with the few-shot learning capability ("meta-poisoning"). + +Potential abuse As shown in Figure 6, the AUC-ROC score for a lot of tasks are still well below 0.9, and hence our system is far from solving a significant fraction of tasks. Therefore, even though our system is flexible and has the potential to perform a wide range of tasks, it does not present an elixir to all classification tasks. Particularly, it should not be applied to higher stake scenarios (e.g. hate speech detection, fake news detection, etc), since its efficacy, robustness, and fairness properties remain unknown. + +# B Datasets + +IMDB movie review sentiment classification (Maas et al., 2011b). Classifies whether the user likes the movie. + +POSITIVE: "My favourite police series of all time turns to a TV-film. Does it work? Yes. ..." + +NEGATIVE: "Stupid! Stupid! Stupid! I can not stand Ben stiller anymore." + +Zero Shot Emotion Classification (Yin et al., 2019). This task classifies a textual input into 9 emotion types {"sadness", "joy", "anger", "disgust", "fear", "surprise", "shame", "guilt", "love"}, and none-type if not any of the above. For example, + +JOY: "Making new friends is always fun, especially when playing dress up" + +ANGER: "People that smoke cigarettes irritate my soul." + +Zero Shot topic Classification (Yin et al., 2019). This task classifies an articles into 10 topic classes, such as "Health", 'Sports", "Family & Relationships", "Science & Mathematics", etc. + +SCIENCE: "How the human species evolved? How the human species evolved? A tough question as it overlaps science and theology ..." + +SPORTS: "Number one formula one driver? Depends on your question. Kimi Raikkonen won more races ..." + +Zero Shot Situation Classification (Yin et al., 2019). This task classifies what type of situation the user is having and what aids it needs. The classes include "food", "terrorism", etc. + +FOOD: "livestock, crops, rural and urban housing, roads, river and canal embankments, and other infrastructure suffered extensive damage" + +TERRORISM: "Daish attacked Tahunmahu village with chemical gas." + +SemEval 2017 Task 4 (Barbieri et al., 2020) (Rosenthal et al., 2017). This task classifies the sentiment of a tweet as {"negative", "neutral", "positive)}. For example, + +NEGATIVE: "That sucks if you have to take the SATs tomorrow" + +NEUTRAL: "@user Well said on HMW. Can you now address why Texans fans file out of the stadium midway through the 4th qtr of every game?" + +POSITIVE: "This is the last Sunday w/o football ....NFL is back baby"" +ETHICS Justice (Hendrycks et al., 2020). This task identifies whether the justification provided for a given scenario is deemed reasonable. For example, +REASONABLE: "I deserve to be paid by my boss because I keep her house clean daily." +UNREASONABLE: "I deserve to be given a brand new car by my boss because I keep her house clean daily." +ETHICS Deontology (Hendrycks et al., 2020). This task identifies whether the excuse provided for a given scenario is a reasonable excuse. For example, +SCENARIO: "Aren't you supposed to be preparing for the meeting?" +EXCUSE (REASONABLE): "No because I have everything already set up in the conference room." +EXCUSE (UNREASONABLE): "No because you don't have a meeting" +ETHICS Common Sense (Hendrycks et al., 2020). This task identifies identifies whether a scenario demonstrates common sense. For example, +COMMON SENSE: "I went to the principal's office to change my records before going to a different school." +NOT COMMON SENSE: "I secured the loan because I would make the payments." +EURLEX57K (Chalkidis et al., 2019). This task classifies European legislation. +NATIONAL CURRENCY: "Council Regulation (EC) No 2595/2000 of 27 November 2000 amending Regulation (EC) No 1103/97 on certain provisions relating to the introduction of the euro" +SOUTHERN AFRICA: "95/458/EC: Commission Regulation (EC) No 302/2006 of 20 February 2006 on import licences in respect of beef and veal products originating in Botswana, Kenya, Madagascar, Swaziland, Zimbabwe and Namibia" +SemEval 2019 Task 6 (Barbieri et al., 2020) (Zampieri et al., 2019). This task classifies the tweet as either offensive or not offensive. For example, +OFFENSIVE: "@user She has become a parody unto herself? She has certainly taken some heat for being such an...well idiot. Could be optic too + +Who know with Liberals They're all optics. No substance" +NOT OFFENSIVE: "@user @user She is great. Hi Fiona!" + +Click Bait Detection 10 This task detects whether a news title is a click bait. + +CLICK BAIT: "Can You Pass This Basic Trigonometry Quiz" + +NON CLICK BAIT: "NASCAR driver Kyle Busch wins 2011 Jeff Byrd 500". + +Abstract Domain Classification 11 This classifies the abstract into 4 domains: "Physcis", "Maths", "Computer Science", "Statistics". For example, + +PHYSICS: "a ever-growing datasets inside observational astronomy have challenged scientists inside many aspects, including an efficient and interactive data exploration and visualization. many tools have been developed to confront this challenge ..." + +MATHS: "a main result of this note was a existence of martingale solutions to a stochastic heat equation (she) inside the riemannian manifold ..." + +SemEval 2019 Task 5 (Barbieri et al., 2020) (Basile et al., 2019). This task identifies whether the tweet contains hate speech towards women and/or immigrants or not. For example, + +HATE SPEECH: "This account was temporarily inactive due to an irrational woman reporting us to Twitter. What a lack of judgement, shocking. #YesAllMen" + +NO HATE SPEECH: "@user nice new signage. Are you not concerned by Beatlemania -style hysterical crowds crongregating on you..." + +SemEval 2019 Task 8 (Mihaylova et al., 2019). This task identifies whether the text is an example of a question asking for factual information, an example of a question asking for an opinion, or an example of socializing. For example, + +FACTUAL: "is there any place i can find scented massage oils in qatar?" + +OPINION: "hi there; i can see a lot of massage center here; but i dont which one is better. + +can someone help me which massage center is good...and how much will it cost me? thanks" + +SOCIALIZING: "Hello people...let's play this game...you have to write something good about the person whose 'post' is above you on $QL$ . You can write anything and you can write  multiple times." + +SemEval 2018 Task 3 (Barbieri et al., 2020) (Van Hee et al., 2018). This task identifies whether the tweet contains irony or not. For example, + +IRONY: "seeing ppl walking w/ crutches makes me really excited for the next 3 weeks of my life" + +NO IRONY: "@user on stage at #flzjingleball at the @user in #Tampa #iheartradio" + +SemEval 2018 Task 1 (Barbieri et al., 2020; Mohammad et al., 2018) This task classifies a tweet as one of 4 emotion types {"sadness", "joy", "anger", "optimism)}. For example, + +SADNESS: "@user I so wish you could someday come to Spain with the play, I can't believe I'm not going to see it #sad" + +JOY: "#ThisIsUs has messed with my mind & now I'm anticipating the next episode with #apprehension & #delight! #isthereahelplineforthis" + +ANGER: "@user Haters!!! You are low in self worth. Self righteous in your delusions. You cower at the thought of change. Change is inevitable." + +OPTIMISM: "Don't be #afraid of the space between your #dreams and #reality. If you can #dream it, you can #make it so" + +SemEval 2016 Task 6 (Mohammad et al., 2016; Barbieri et al., 2020) This task classifies a tweet's stance as {"neutral", "against", "favor)}. Each tweet contains a stance on one of the five different target topics {"abortion", "atheism", "climate change", "feminism", "hillary)}. For example, + +NEUTRAL: "@user maybe that's what he wants #SemST" + +AGAINST: "Life is #precious & so are babies, mothers, & fathers. Please support the sanctity of Human Life. Think #SemST" + +FAVOUR: "@user @user Nothing to do with me. It's not my choice, nor is it yours, to dictate what another woman chooses. #feminism #SemST" + +SemEval 2020 Task 6 (Spala et al., 2020). This task classifies whether textbook sentence contains a definition. For example, + +CONTAINS DEFINITION: "Since 2005, automated sequencing techniques used by laboratories are under the umbrella of next-generation sequencing, which is a group of automated techniques used for rapid DNA sequencing" + +DOESN'T CONTAIN DEFINITION: "These automated low-cost sequencers can generate sequences of hundreds of thousands or millions of short fragments (25 to 500 base pairs) in the span of one day." + +TREC (Li and Roth, 2002). This task classifies a question into one of six question types: DESC (description), ABBR (abbreviation), ENTY (entity), HUM (people/individual), LOC (location), NUM (numeric information), each of which have specific fine-grained sub-categories. For example, + +DESC: "How did serfdom develop in and then leave Russia?" + +ABBR: "What is the full form of.com?" + +ENTY: "What films featured the character Pope eye Doyle?" + +HUM: "What contemptible scoundrel stole the cork from my lunch?" + +LOC: "What sprawling U.S. state boasts the most airports?" + +NUM: "How many Jews were executed in concentration camps during WWII?" + +SUBJ (Pang and Lee, 2004). This task classifies a sentence as being subjective or objective. For example, + +SUBJECTIVE: "smart and alert, thirteen conversations about one thing is a small gem." + +OBJECTIVE: "the movie begins in the past where a young boy named sam attempts to save celebi from a hunter." + +The Corpus of Linguistic Acceptability (Warstadt et al., 2018). This task detects if sentences are grammatically acceptable by their original authors. For example, + +GRAMMATICALLY ACCEPTABLE: "Her little sister will disagree with her." + +GRAMMATICALLY NOT ACCEPTABLE: "Has not Henri studied for his exam?" + +The Multi-Genre NLI Corpus (Williams et al., 2018). This task detects if a premise is a contradiction or entailment of a hypothesis, or if a hypothesis holds neutral view on the premise.. For example, + +NEUTRAL: "Premise: Exoatmospheric Kill Vehicles orbiting Earth would be programmed to collide with warheads. Hypothesis: Exoatmospheric Kill Vehicles would be very expensive and hard to make." + +ENTAILMENT: "Premise: so we have to run our clocks up forward an hour and i sure do hate to loose that hour of sleep in the morning. Hypothesis: I don't like the time change that results in losing an hour of sleeping time." + +CONTRADICTION: "Premise: The mayor originally hoped groundbreaking would take place six months ago, but it hasn't happened yet. Hypothesis: The mayor doesn't want groundbreaking to happen at all." + +Metaphor as a Medium for Emotion: An Empirical Study (?) This task detects if the application of a word is Literal or Metaphorical. For example, + +WORD: ABUSE + +LITERAL: "This boss abuses his workers." + +METAPHORICAL: "Her husband often abuses alcohol." + +Political Preference Classification (Allaway and McKeown, 2020). This task predicts a comment's stand point on a political topic. For example, + +# TOPIC: COMPANIES REGULATION + +CON: "Regulation of corporations has been subverted by corporations. States that incorporate corporations are not equipped to regulate corporations that are rich enough to influence elections, are rich enough to muster a legal team that can bankrupt the state. Money from corporations and their principals cannot be permitted in the political process if democracy is to survive." + +PRO: "Regulation is to a corporation what a conscience is to a living person. Without a conscience, we would all be sociopaths. Corporations do not have a conscience, thus they need regulation to make sure they are focused on benefiting society instead on merely benefiting themselves." + +NEUTRAL: "Without government to ensure their behavior, companies will attempt to make a profit even to the DETRIMENT of the society that supports the business. We have seen this in the environment, in finances, in their treatment of workers and customers. Enough." + +Airline Service Review 12 This task classifies if an airline review has a positive or negative sentiment. For example, + +POSITIVE: "This is such a great deal! Already thinking about my 2nd trip to Australia; I haven't even gone on my 1st trip yet!" + +NEGATIVE: "amazing to me that we can't get any cold air from the vents." + +Covid-19 Tweets Sentiment Analysis 13 This task classifies if a tweet has a positive or negative sentiment. For example, + +POSITIVE: "Taken by Henk Zwoferink on Saturday in Wargl, our black beauty hauled a train bringing the last tourists home. Our colleagues are #workinghard to keep supply chains running while respecting the measures to ensure everyone's #safety. A pleasure to work with such #Dedicated People!" + +NEGATIVE: "So far, the Minister does not seem to have made statement on the catastrophe that can develop if the issue of markets operation is not addressed. Food insecurity has potential to make current Covid-19 panic look like a kindergarten and could lead to riots. I submit." + +Hotel Review 14 This task predicts if a hotel review is a positive or negative review. For example, + +NEGATIVE: "The single rooms like hospital rooms single rooms hotel sparse intentional know ugly like trapped hospital white walls sink basin room small rectangle shape.the beds hard rocks blankets rough really noisy.this overrated hotel stayed fans type hotels" + +POSITIVE: "loved stay, stayed univ, inn 10 days april 2005 thoroughly enjoyed, free parking clean spacious room friendly staff great breakfast snack, loved location, definitely stay," + +Stock Market Sentiment $^{15}$ This task predicts if a comment holds a positive or negative view on the performance of the stock market. For example, + +NEGATIVE: "GPS wow that was a fast fast fade..." + +POSITIVE: "user Maykiljil posted that: I agree that MSFT is going higher & possibly north of 30" + +AG-News (Zhang et al., 2015). This task classifies the topic of news based on their contents. For example, + +WORLD NEWS: "Greek duo could miss drugs hearing" + +SPORTS NEWS: "AL Wrap: Olerud Cheers Yankees by Sinking Ex-Team" + +BUSINESS NEWS: "Lowe's Second-Quarter Profit Rises" + +TECH NEWS: "Satellite boosts Olympic security" + +Real and Fake News 16 This task classifies if a news is fake or real. For example, + +REAL: "WASHINGTON (Reuters) - Alabama Secretary of State John Merrill said he will certify Democratic Senator-elect Doug Jones as winner on Thursday despite opponent Roy Moorea x80 + +$x99s$ challenge, in a phone call on CNN. Moore, a conservative who had faced allegations of groping teenage girls when he was in his 30s, filed a court challenge late on Wednesday to the outcome of a U.S. Senate election he unexpectedly lost." + +FAKE: "Ronald Reagan shut down the Berkeley protests many years ago THIS is how you do it!" + +Disaster Tweets $^{17}$ This task detects if a tweet announces an emergency or a disaster. For example, + +CONTAINS DISASTER: "Our Deeds are the Reason of this #earthquake May ALLAH Forgive us all." + +DOES NOT CONTAIN DISASTER: "My dog attacked me for my food #pugprobs." + +Obama vs Trump Tweets $^{18}$ This task detects if a tweet was send by Obama or Trump. For example, + +OBAMA: "Michelle and I are delighted to congratulate Prince Harry and Meghan Markle on their engagement. We wish you a lifetime of joy and happiness together." + +TRUMP: "Together, we dream of a Korea that is free, a peninsula that is safe, and families that are reunited once again!" + +Kaggle Sexually Explicit Tweets $^{19}$ This dataset provides positive examples of profane comments. For example, + +EXPLICIT "What do guys say when you get naked in front of them for the first time?" + +Democratic vs Republican Tweets $^{20}$ This task detects if a tweet was send by the Democratic or Republican Party. For example, + +DEMOCRATIC: "YuccaMountain would require moving tens of thousands of metric tons of radioactive waste across the country and through Southern Nevada." + +REPUBLICAN: "Stopped by One Hour Heating& Air Conditioning to discuss the benefits tax reform will bring to their business." + +Women E-commerce Clothing Reviews 21 + +This task predicts if the buyer likes or recommends a product base on its review. For example, + +LIKE: "After reading the previous reviews, i ordered a size larger. i am so glad i did it! it fits perfectly! i am 5'4"/115/32dd and went with the s regular. so beautiful! i can't wait to wear it!" + +DISLIKE: "The zipper broke on this piece the first time i wore it. very disappointing since i love the design. I'm actually going to try to replace the zipper myself with something stronger, but annoying that it's come to that." + +Quora Question Pairs 22 This task predicts if a pair of Quora question is asking for the same thing. For example, + +SAME: "Question 1: How many months does it take to gain knowledge in developing Android apps from scratch?; Question 2: How much time does it take to learn Android app development from scratch?" + +DIFFERENT: "Question 1: How would you review the site Waveclues? ; Question 2: Is there a good pay for reviews site out there?" + +Headline Sarcasm Detection This task detects if is a news headline contains sarcasm. For example, + +SARCASM: "guy who just wiped out immediately claims he's fine" + +NO SARCASM: "Donald trump effigies burn across Mexico in Easter ritual" + +Company Account Tweets $^{23}$ This task detects whether the tweet is targeted towards a company account. For example, + +YES: "@VirginTrains Oh, that's nice. What are you doing about it? What are you targets next year?" + +No: "@115738 That's the best kind of trick-or-treating. All treats, my friend. -Becky" + +SMS Spam Detection (Almeida et al., 2013) This task detects whether the SMS is a spam message. For example, + +SPAM: "Thank you, winner notified by sms. Good Luck! No future marketing reply STOP to 84122 customer services 08450542832" + +HAM: "Lol great now I am getting hungry." + +Clothing Fitness (Misra et al., 2018) Checking whether the customer complains that the cloth is too small or too large. + +SMALL: "runs a bit small. wish it fit". + +LARGE: "too big". + +Water Problem Topic Classification 24 Classifying the topic of a report on water problems. The labels include "biological", "climatic indicator", "environmental technology", etc. For example, + +BIOLOGICAL: "Mineralization of organic phosphorus in bottom sediments reaches $40 - 80\%$ and as we found out during the project implementation it intensified in autumn-winter period." + +CLIMATIC INDICATOR: "The average amount of precipitation in the lower part of the basin makes $470~\mathrm{mm}$ to $540~\mathrm{mm}$ . The relative average annual air humidity makes $60 - 65\%$ . + +ENVIRONMENTAL TECHNOLOGY: "Most of wastewater treatment facilities require urgent modernization and reconstruction". + +Sexist Statement Detection 25 This task classifies whether the statement is sexist. For example, + +SEXIST: "It's impossible for a girl to be faithful." + +NON SEXIST: "Without strength, can we work to create wealth?" + +Movie Spoiler Detection (Misra, 2019) $^{26}$ This task classifies whether the movie review is a spoiler. For example, + +SPOILER: "I must say that this movie was good but several things were left unsaid. For those who have seen the movie know what I am talking about but for those who haven't, I don't want to give spoilers. I was also impressed by Vin Diesel's acting skills. Overall I have to say it was a good movie filled with several twists and turns." + +NON SPOILER: "The Great Wall amazes with its spectacular effects, both on screen and sound. Usually I do not appreciate 3D movies, but in this case I felt like it worth it. However, being honest, the storytelling and the story itself had its weaknesses. There were many logical lapses, and for me, many details are still waiting to be answered. On the other hand, expect decent acting especially from the main characters. All in all, The Great Wall is a solid popcorn-movie, but I expected a more elaborated unfolding of the legend it tells about." + +News Summary/headline Topic Classification + +27 This task classifies the topic of the summary of a news. For example, + +POLITICS: "City and state officials said they received little advance warning of the decision." + +BUSINESS: "The streaming giant's third-quarter earnings were nothing like the Upside Down." + +# C Dataset Property Tags + +Here we list all the dataset property tags (Section 2). We define two datasets to be "similar" if they have the set of tags, and disallow meta-tuning on datasets that are similar to evaluation dataset. + +social media: whether the source is from social media (e.g. tweets). + +social/political: whether the task is highly related to political/social topics. Some examples include stance classification and hate speech detection. + +topic classification: whether the task classifies the topics of the input. + +good vs. bad: whether the task classifies whether the text is judging something to be good or bad. + +paper: whether input text comes from a paper. + +review: whether the input text is a review of a product (e.g. movie, hotel). + +questions: whether the input texts are questions. Some examples include classifying whether the question asks for factual information or subjective opinion and detecting whether two questions have the same meaning. + +emotion: whether the task classifies certain emotion in the text, for example "hate", "surprise", "joy", etc. + +Besides, we do not assign tags to datasets that we are confident to be different enough from other tasks (e.g. extracting whether a text contains definition), and allow the model to be meta-tuned on all other datasets. + +# D List of Label Descriptions + +Please refer to the appendix in our arXiv version: https://arxiv.org/abs/2104.04670. Somehow the acl_pubcheck software package always gives us errors. + +# E Robustness Checks + +We report all the descriptive statistics mentioned in Section 3 under 3 different types of description weighting. We additionally compare T5-small vs. T5-base, BERT-medium vs. BERT-Base and BERT-Base vs. BERT Large. All the results can be seen in Table 3, 4, and 5. Due to space constraint, we abbreviate $\mathbb{P}[\Delta > t]$ as $>t$ if $t$ is positive, and $< t$ if $t$ is negative. Notice that, since we only have around 20 datasets to evaluate the model, most of the results presented here are not statistically significant at the dataset level; nevertheless, + +# E.1 Different Description Weighting + +We weight each label and dataset equally in Table 4 and 5. We find that, under almost all comparisons across different weighting, the mean change $\bar{\Delta}$ is positive, and the change above a certain threshold $t$ is more frequent than the change below a certain threshold $-t$ . The only single exception the "Ensemble" row in Table 5, where there are slightly more datasets where the change is lower than $-1\%$ . Nevertheless, given that the trend is still positive under $t = 5\%$ and $10\%$ , and two other + +description weightings, we may still conclude that ensembling label descriptions is more likely to improve model performance. + +# E.2 Larger T5 Models are Better + +In addition to comparing T5-Base (220 Million parameters) vs. T5-Large (770M), we also compare T5-small (60M) vs. T5-base (220M). Across all metrics, larger models are significantly better. Most notably, there is a sudden jump in performance when increasing model size from T5-small to T5-base (sometimes $15\%$ increase in $\bar{\Delta}$ ). + +# E.3 Larger BERT Models are Better + +We also compare different sizes of BERT (Turc et al., 2019) (41, 110, and 330M) parameters. Across all metrics, larger models are significantly better. + +# F Most Relevant Datasets + +To ensure that we are testing the models' ability to generalize to an unseen tasks, we disallow both training and testing on datasets that are too similar, which is defined as "having the same set of dataset property tags" (Section 2). To help interpret how we define unseen tasks, for each dataset that we evaluate on, we try to find the "most relevant" dataset that the model has seen during the meta-tuning phase, and list it in Table 6. + +# G Performance Break Down + +For each model, we average the AUC-ROC scores for each label description for each dataset, and report the results in Table 7. + +# H Accuracy + +
Δ>1%<-1%>5%<-5%>10%<-10%std(Δ)
Meta-tuned vs QA3.3%59.5%28.1%31.4%10.3%15.7%5.9%9.5%
220 vs 770M (T5)6.3%75.1%15.1%47.6%2.7%27.0%0.5%8.1%
Pre-trained vs. Random Ensemble23.8%95.7%3.2%91.4%1.6%83.2%1.1%14.0%
0.7%28.9%16.8%8.7%1.7%1.7%0.6%3.1%
Initialized with QA1.1%54.1%24.3%24.3%11.9%6.5%4.9%6.9%
Train on similar0.7%43.8%20.5%6.5%4.3%1.6%1.1%3.2%
60 vs 220M (T5)14.4%86.5%10.3%79.5%4.3%61.1%2.2%12.6%
41 vs. 110M (BERT)4.3%65.9%22.7%40.0%10.8%20.5%5.9%9.1%
110 vs. 340M (BERT)1.4%46.5%35.7%23.8%17.3%11.4%6.5%8.5%
+ +Table 3: All results, with metrics explained in Section 3 and Appendix E. Each label description is weighted equally. + +
Δ>1%<-1%>5%<-5%>10%<-10%std(Δ)
Meta-tuned vs QA3.0%57.5%30.7%31.3%11.5%16.2%7.3%10.2%
220M vs 770M (T5)5.8%75.8%15.5%46.9%3.5%25.6%1.4%7.8%
Pre-trained vs. Random Ensemble23.7%93.5%5.5%89.4%3.4%82.5%2.1%15.1%
0.5%25.0%18.8%6.9%1.6%1.7%0.7%3.1%
Initialized with QA1.2%54.0%24.0%26.0%11.8%8.1%5.3%7.3%
Train on similar0.7%44.5%20.1%6.0%4.3%1.7%0.8%3.1%
60 vs 220M (T5)15.2%85.7%11.4%79.1%3.9%62.5%1.9%13.3%
41 vs. 110M (BERT)4.8%67.0%21.5%41.9%9.2%22.5%4.9%9.0%
110 vs. 340M (BERT)1.1%44.3%36.3%21.9%18.2%11.0%7.3%8.5%
+ +Table 4: All results, with metrics explained in Section 3 and Appendix E. Each label is weighted equally. + +
Δ>1%<-1%>5%<-5%>10%<-10%std(Δ)
Meta-tuned vs QA1.2%55.4%35.7%31.2%17.7%15.6%13.6%11.2%
220 vs 770M (T5)6.3%77.4%16.5%51.7%7.0%31.6%4.5%9.0%
Pre-trained vs. Random Ensemble20.2%89.8%8.5%84.8%6.1%76.6%1.5%15.1%
0.1%18.6%20.2%4.3%1.9%1.5%1.2%2.8%
Initialized with QA2.3%59.2%22.5%34.3%9.9%13.9%5.7%7.2%
Train on similar0.6%48.8%25.4%7.3%5.7%1.3%0.9%3.3%
60 vs 220M (T5)12.1%84.6%12.9%73.6%3.5%52.9%2.2%11.6%
41 vs. 110M (BERT)7.0%74.6%13.8%58.5%6.8%31.5%2.9%8.9%
110 vs. 340M (BERT)1.1%45.6%36.1%25.5%18.6%10.8%9.3%8.8%
+ +Table 5: All results, with metrics explained in Section 3 and Appendix E. Each dataset is weighted equally. + +
Evaluation DatasetMost Relevant Training Dataset
SemEval 2016 Task 6, stance classifications on issues like feminism, atheism, etcSemEval 2019 Task 5, detecting hate speech against women and immigrants
SemEval 2019 Task 6, classifying whether the text is offensiveA dataset from Kaggle that classifies sexually explicit comments
SemEval 2019 Task 5, detecting hate speech against women and immigrantsSemEval 2016 Task 6, stance classifications on issues like feminism, atheism, etc
TREC, classifying the type the question is asking about (e.g. numbers, acronyms, human/occupations, etc)AG News, which classifies news into different categories (e.g. sports, world events).
SemEval 2019 Task 8, classifying whether the question is asking for subjective opinion, factual information, or simply having a conversationN/A
SUBJ, classifying whether the text contains subjective or objective informationN/A
QQP, classifying whether two questions have the same meaningN/A
Yin et al. (2019) emotion classification, classifying text into 9 emotion types, such as “joy”, “anger”, “guilt”, “shame”, etc.Classifying whether an IMDB movie review is positive.
Yin et al. (2019) situation classification, classifying which disaster situation people are experiencing, e.g. “regime change”, “crime and violence”, and what resource they need, e.g. “food and water”, “search and rescue”.Classifying (binary) whether a tweet is related to a natural disaster.
Yin et al. (2019) topic classification, classifying the domain of an article into domains such as “family and relationship”, “education”, “business”, “sports”classifying the domain of a paper abstract into physics, maths, computer sciences, and statistics.
AG News, which classifies news into different categories (e.g. sports, world events).Abstract Domain classification, classifying the domain of a paper abstract into physics, maths, computer sciences, and statistics.
Abstract Domain classification, classifying the domain of a paper abstract into physics, maths, computer sciences, and statistics.AG News, which classifies news into different categories (e.g. sports, world events).
IMDB movie reviews, classifying whether the user feels positive about the movieStock market sentiment, classifying whether a comment is optimistic about the market.
CoLA, classifying whether a sentence is grammaticalN/A
SemEval 2020 Task 6, classifying whether a sentence contains a definitionN/A
Spam classification, classifying whether a text message is a spamclick-bait classification, classifying whether the title of an article is a clickbait.
SemEval 2018 Task 1, classifying a tweet as one of 4 emotion types {“sadness”, “joy”, “anger”, “optimism”}Classifying whether an IMDB movie review is positive.
SemEval 2018 Task 3, classifying whether a tweet is ironicclassifying whether a news title is sarcastic.
+ +Table 6: For each dataset that we evaluate on, we list the task in the training split that we consider to be the most relevant. We list "N/A" if we think that none of the training dataset is particularly relevant. + +
QAQA + MetaMetaT5 220MBERT 340M
Abstract Classification76.9%84.3%81.2%68.0%85.3%
AG News76.5%82.0%77.8%69.9%69.5%
Stance (Hillary)74.8%79.8%73.8%69.0%63.2%
Hate Speech59.4%66.0%64.1%59.6%69.2%
Stance (Feminism)67.8%71.6%69.1%61.0%64.8%
Stance (Climate)75.8%81.7%79.6%72.0%76.2%
Emotion Classification*67.6%70.5%68.0%65.0%64.0%
Emotion Classification (SemEval)81.6%85.2%81.7%76.1%74.2%
Irony Detection67.9%83.4%80.2%61.0%64.9%
Stance (Atheism)60.2%62.4%65.6%55.1%60.9%
QQP54.1%61.1%68.6%56.7%66.9%
TREC59.3%63.9%76.4%73.4%66.9%
Stance (Abortion)58.2%61.3%62.8%60.5%59.5%
Offensive Speech76.6%80.4%79.5%74.5%80.6%
CoLA52.3%49.4%49.8%49.6%50.0%
SUBJ62.8%66.8%58.7%54.5%50.2%
Situation Classification*73.9%80.4%79.3%75.5%79.5%
SPAM Detection57.2%45.4%35.0%49.3%47.8%
IMDB Movie Review92.9%94.0%90.5%67.7%84.4%
Topic Classification*77.6%82.7%84.0%77.5%80.7%
Definition Detection72.8%73.5%63.9%63.6%60.2%
Question Type Classification75.1%73.8%59.3%51.8%64.5%
+ +Table 7: Zero shot performance of each model on each dataset. "QA" means the UnifiedQA model; "QA + Meta" means meta-tuning with UnifiedQA initialization; "Meta" means meta-tuning on T5 (770M) parameters. To save space, we use “*” to denote datasets from Yin et al. (2019). + +
Dataset name#classesAccuracy
2016SemEval6TweetEvalStanceAtheism366
KaggleNewsTopicClassification464
2019SemEval6TweetEvalOffensive228
2019SemEval8Qtype273
2018SemEval3TweetEvalIrony239
2016SemEval6TweetEvalStanceHillary355
subj261
trec638
KaggleQuoraQPairs250
definition232
BenchmarkingZeroshotTopic1059
2019SemEval5TweetEvalHate242
cola255
2018SemEval1TweetEvalEmotion472
2016SemEval6TweetEvalStanceAbortion364
KaggleIMDBMovieReview285
2016SemEval6TweetEvalStanceClimate361
KaggleSMSSPAM214
2016SemEval6TweetEvalStanceFeminist353
+ +Table 8: We report the accuracy of the meta-tuned model for completeness according to the request of the reviewers. However, given that accuracy is very sensitive to thresholding (Zhao et al., 2021) and is generally unreliable when the labels are imbalanced, these numbers are not likely to be informative. Additionally, to speed up evaluation, we use a subsample of the original test split for some datasets, so these numbers are not directly comparable to those in the other papers either. \ No newline at end of file diff --git a/adaptinglanguagemodelsforzeroshotlearningbymetatuningondatasetandpromptcollections/images.zip b/adaptinglanguagemodelsforzeroshotlearningbymetatuningondatasetandpromptcollections/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..05e2bdb11884ddc4e387702d0cec26ab08d42e95 --- /dev/null +++ b/adaptinglanguagemodelsforzeroshotlearningbymetatuningondatasetandpromptcollections/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eb0a37cdecf94596ad573416ee3898b74b4f3e7a4c2924e1e1119d543857b7ad +size 1187983 diff --git a/adaptinglanguagemodelsforzeroshotlearningbymetatuningondatasetandpromptcollections/layout.json b/adaptinglanguagemodelsforzeroshotlearningbymetatuningondatasetandpromptcollections/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d2ef32031c1d6bed21c5bc413f108b97558a05c7 --- /dev/null +++ b/adaptinglanguagemodelsforzeroshotlearningbymetatuningondatasetandpromptcollections/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8b2583d0e7a90f41e34dba07cc3c596c818603183a5233c7c681a38f15773af5 +size 735459 diff --git a/adeepdecomposablemodelfordisentanglingsyntaxandsemanticsinsentencerepresentation/d6393320-f49d-4224-bd0d-01754e8793e5_content_list.json b/adeepdecomposablemodelfordisentanglingsyntaxandsemanticsinsentencerepresentation/d6393320-f49d-4224-bd0d-01754e8793e5_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..722bac518550026ecb75bf02eae9719a93c66532 --- /dev/null +++ b/adeepdecomposablemodelfordisentanglingsyntaxandsemanticsinsentencerepresentation/d6393320-f49d-4224-bd0d-01754e8793e5_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:77708641e704dd2ac67b3aca1e6f45fbf23be5228c0ff4be578cb16d26d19d25 +size 89636 diff --git a/adeepdecomposablemodelfordisentanglingsyntaxandsemanticsinsentencerepresentation/d6393320-f49d-4224-bd0d-01754e8793e5_model.json b/adeepdecomposablemodelfordisentanglingsyntaxandsemanticsinsentencerepresentation/d6393320-f49d-4224-bd0d-01754e8793e5_model.json new file mode 100644 index 0000000000000000000000000000000000000000..59bfff9d5ed2a4201508c50db766ee86e2ff760d --- /dev/null +++ b/adeepdecomposablemodelfordisentanglingsyntaxandsemanticsinsentencerepresentation/d6393320-f49d-4224-bd0d-01754e8793e5_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a97a9e2a7cc9a822a84493088e321b09a1bf2ae3634f5a3577c561238f2117db +size 104944 diff --git a/adeepdecomposablemodelfordisentanglingsyntaxandsemanticsinsentencerepresentation/d6393320-f49d-4224-bd0d-01754e8793e5_origin.pdf b/adeepdecomposablemodelfordisentanglingsyntaxandsemanticsinsentencerepresentation/d6393320-f49d-4224-bd0d-01754e8793e5_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..69d34210730e4e0709bfff0e59c1c2b6edfe887c --- /dev/null +++ b/adeepdecomposablemodelfordisentanglingsyntaxandsemanticsinsentencerepresentation/d6393320-f49d-4224-bd0d-01754e8793e5_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7236abecf447306a4e2a51a24044d9f8f4d1331d9a10799967e9c7ea1e9e3c91 +size 690562 diff --git a/adeepdecomposablemodelfordisentanglingsyntaxandsemanticsinsentencerepresentation/full.md b/adeepdecomposablemodelfordisentanglingsyntaxandsemanticsinsentencerepresentation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2fae5427e3e205de88de14558eccca8214045011 --- /dev/null +++ b/adeepdecomposablemodelfordisentanglingsyntaxandsemanticsinsentencerepresentation/full.md @@ -0,0 +1,366 @@ +# A Deep Decomposable Model for Disentangling Syntax and Semantics in Sentence Representation + +Dingcheng Li, Hongliang Fei, Shaogang Ren, Ping Li + +Cognitive Computing Lab (CCL) + +Baidu Research USA + +10900 NE 8th St. Bellevue, WA 98004, USA + +{lidingcheng,hongliangfei,shaogangren,liping11}@baidu.com + +# Abstract + +Recently, disentanglement based on a generative adversarial network or a variational autoencoder has significantly advanced the performance of diverse applications in CV and NLP domains. Nevertheless, those models still work on coarse levels in the disentanglement of closely related properties, such as syntax and semantics in human languages. This paper introduces a deep decomposable model based on VAE to disentangle syntax and semantics by using total correlation penalties on KL divergences. Notably, we decompose the KL divergence term of the original VAE so that the generated latent variables can be separated in a more clear-cut and interpretable way. Experiments on benchmark datasets show that our proposed model can significantly improve the disentanglement quality between syntactic and semantic representations for semantic similarity tasks and syntactic similarity tasks. + +# 1 Introduction + +Recently, disentangled representations have significantly advanced the performance of several applications in NLP. For example, disentanglement has been used to separating representation of attributes such as sentiment from contents (Fu et al., 2018; John et al., 2019), understanding subtleties in component modeling (Esmaeili et al., 2019), detecting anomalies (Hou et al., 2021), and learning sentence representations that split the syntax and the semantics (Ju et al., 2021). They are also used to boost text generation (Iyyer et al., 2018; Jain et al., 2018) or calculating the semantic or syntactic similarity between sentences (Chen et al., 2018). + +In this paper, we focus on the task of separating syntax and semantics in sentence representation learning. Unlike previous supervised approaches that usually resort to syntactic parsers to handle syntax processing, our approach separates syntactic and semantic variables by disentangling hidden + +states of deep neural nets in a self-learning and unsupervised fashion. + +The first work focusing on the separation of syntax and semantics from hidden variables is Chen et al. (2019). They proposed a deep generative model based on VAE with two latent variables to represent syntax and semantics. The generative model comprises von Mises Fisher (vMF) and Gaussian priors on the semantic and syntactic latent variables, and a deep BOW decoder conditioning on these latent variables. Following previous work, they train this model by optimizing the Evidence Lower Bound (ELBO) with a VAE-like (Kingma and Welling, 2014) objective. + +However, their approach still generates a rough decomposition and thus may fail to disentangle syntax and semantics at a finer granularity. To address this weakness, we propose a decomposable variational autoencoder (DecVAE) to allow hidden variables factorizable. From a modeling perspective, factorizable representations with statistically independent variables usually obtained in an unsupervised or semi-supervised manner can distill information into a compact form, which is semantically useful for downstream tasks. From an application perspective, different words or phrases in sentences represent various entities with variant roles. It is necessary to utilize decomposable latent variables to capture a variety of entities with different semantic meanings. + +Towards building a finer-grained disentanglement, motivated by FactorVAE (Kim and Mnih, 2018), we extend the work in Chen et al. (2019) and use total correlation (Watanabe, 1960) (TC) as a penalty term to obtain a deeper and meaningful factorization of syntactic and semantic latent variables. To make TC more discriminative, we also integrate multi-head attention into this framework. DecVAE can identify and cluster hierarchically independent semantic components in natural language text, which exhibits hierarchical linguistic + +structure (Sanh et al., 2019), and the corresponding syntax and semantics interact with each other. For experiments, we evaluate learned semantic representations on the SemEval semantic textual similarity (STS) tasks. Following the protocol in Chen et al. (2019), we predict the syntactic structure of an unseen sentence to be the one similar to its nearest neighbor, determined by the latent syntactic representation in a large dataset of annotated sentences. Experiments show that DecVAE achieves the best performance on all tasks when learned representations are mostly disentangled. + +Contributions. Firstly, we propose a generic DecVAE to disentangle semantics and syntax based on the total correlation of KL divergence. Secondly, DecVAE is also integrated with a multi-head attention network to cluster embedding vectors so that corresponding word embeddings are more discriminative. Thirdly, results after integrating DecVAE in disentangling syntax from semantics achieve SOTA performances, confirming DecVAE's effectiveness. + +# 2 Background and Related Work + +# 2.1 VAEs for Disentanglement + +The variational autoencoder (VAE) (Kingma and Welling, 2014) is a latent variable model that pairs a top-down generator with a bottom-up inference network. Different from traditional maximum-likelihood estimation (MLE) approach, VAE training is done by evidence lower bound (ELBO) optimization in order to overcome the intractability of posterior. Basically, the objective function of VAE is represented as: + +$$ +\mathbb {E} _ {\mathbf {z} \sim q (\mathbf {Z} | \mathbf {X})} [ \log p (\mathbf {X} | \mathbf {Z}) ] - \beta \mathbf {K L} (q (\mathbf {Z} | \mathbf {X}) | | p (\mathbf {Z})) +$$ + +When $\beta = 1$ , this is the standard VAE. When $\beta > 1$ , it becomes $\beta$ -VAE (Higgins et al., 2017), which attempts to learn a disentangled representation by optimizing a heavily penalized objective. + +Vanilla VAEs cannot disentangle latent variables. PixelGAN Autoencoders (Makhzani and Frey, 2017) further break down the $KL$ term as: + +$$ +\mathbf {K L} (q (\mathbf {Z} | \mathbf {X}) | | p (\mathbf {Z})) = I (\mathbf {X}; \mathbf {Z}) + \mathbf {K L} (q (\mathbf {Z}) | | p (\mathbf {Z})) \tag {1} +$$ + +where $I(x;z)$ is the mutual information under the joint distribution $p(x)q(z|x)$ . Penalizing the $KL(q(z)||p(z))$ term pushes $q(z)$ towards the factorial prior $p(z)$ , encouraging independence in the dimensions of $z$ and thus disentangling. + +Alternatively, FactorVAE approaches this problem with total correlation penalty (Kim and Mnih, 2018), which we adopt for our work. FactorVAE achieves similar disentangling results while preserving good quality of reconstruction by augmenting the vanilla VAE objective with a term directly encouraging independence in the code distribution: + +$$ +\begin{array}{l} \mathbb {E} _ {\mathbf {z} \sim q (\mathbf {Z} | \mathbf {X})} [ \log p (\mathbf {X} | \mathbf {Z}) ] - \mathbf {K L} (q (\mathbf {Z} | \mathbf {X}) | | p (\mathbf {Z})) \\ - \gamma \mathbf {K L} (q (\mathbf {Z}) | | \bar {q} (\mathbf {Z})) \\ \end{array} +$$ + +where $\bar{q} (\mathbf{z})\coloneqq \prod_{j = 1}^{K}q(z_{j})$ . The FactorVAE's objective is also a lower bound on the marginal log likelihood $\mathbb{E}_p[\log p(\mathbf{X})]$ .KL(q(Z)||q(Z)) is known as "Total Correlation" (TC) (Watanabe, 1960), a popular measure of dependence for multiple random variables. + +# 2.2 Disentanglement in NLP + +Disentanglement in NLP has strong connections with LDA (Blei et al., 2003; Blei and Lafferty, 2006). In particular, neural topic models, that use belief networks (Mnih and Gregor, 2014; Li et al., 2019b) or enforce the Dirichlet prior via Gaussian or Wassertein autoencoders (Nan et al., 2019; Li et al., 2018), associate topic learning to disentanglement with component analysis. Later on, seq2seq VAE represent disentangled topics via continuous representations (Dieng et al., 2017; Ding et al., 2018; Bowman et al., 2016; Yang et al., 2017). Srivastava and Sutton (2017) combines LDA and VAE for topic detection and Pergola et al. (2021) proposes to consider latent topics as generative factors to be disentangled to improve discriminative power of topics. + +Meanwhile, a growing amount of work start to explore neural learning disentangled/component representations to diverse NLP tasks. For example, we see such applications in sentiment analysis and style transfer (Hu et al., 2017; Li et al., 2019a), morphological reinfectionoon (Zhou and Neubig, 2017), semantic parsing (Yin et al., 2018), text generation (Wiseman et al., 2018), sequential labeling (Chen et al., 2018), text-based variational autoencoder (Miao et al., 2016), etc. + +Although much work has been done on grammatical and semantic analysis, there are few explorations on disentangling syntax and semantics. The disentanglement between syntax and semantics is quite challenging since they are heavily entangled. Except under some circumstances where there are no ambiguities, such as some unique proper names, + +it is usually difficult to find absolute borderlines among words, phrases, or entities. + +The work of VGVAE (Chen et al., 2019) is the latest one quite relevant to our work, wherein they assume that a sentence is generated by conditioning on two independent latent variables: semantic variable $\mathbf{z}_{sem}$ and syntactic variable $\mathbf{z}_{syn}$ . For inference, they assume a factored posterior is produced and a lower bound on marginal log-likelihood is maximized in the generative process. The corresponding inference and generative models are two independent word averaging encoders with additional linear feed-forward neural networks and a feed-forward neural network with the output being a bag of words or an RNN. + +Compared with their work, we aim to construct a more generic work by deploying the decomposability of KL divergence, thus discovering more subtle components from latent variables. Consequently, the VAE framework can do better disentanglement with more fine-grained decomposed parts. Further, we can flexibly add regularities to guide the decomposition to generate more interpretable and controllable elements from decoders. + +# 3 Proposed Approach + +In this work, we are developing a generative model named Decomposable VAE (DecVAE). Although our proposed approach is applicable to any disentangled tasks in NLP, we focus on disentangling semantic and syntactic information from sentence representations. We extend VGVAE model (Chen et al., 2019) to incorporate the total correlation as a penalty term to enable latent variable factorization. + +# 3.1 Decomposable VAE + +Our model is essentially based on VAE, namely, composed of a term of computing loglikelihood of input data given latent variables, and terms of computing KL divergences between posterior variational probabilities of hidden variables given input data and the prior probabilities of hidden variables. + +Let $x_{1}, \ldots, x_{T}$ be a sequence of $T$ tokens (words), conditioned on a continuous latent variable $\mathbf{z}$ . As a usual practice, for example, like the assumption in Latent Dirichlet Allocations (LDA) (Blei et al., 2003), we have a conditional independence assumption of words on $\mathbf{z}$ : + +$$ +p _ {\theta} (x _ {1}, \dots , x _ {T}) = \int \prod_ {t = 1} ^ {T} p _ {\theta} (x _ {t} | \mathbf {z}) p _ {\theta} (\mathbf {z}) d \mathbf {z} +$$ + +Model parameters $\theta$ can be learned via the variational lower-bound (Kingma and Welling, 2014) + +$$ +\begin{array}{l} \mathcal {L} (\theta , \phi ; \mathbf {X}) \geq \frac {1}{T} \sum_ {t = 1} ^ {T} \left(\mathbb {E} _ {\mathbf {z} \sim q _ {\phi}} [ \log p _ {\theta} (x _ {t} | \mathbf {z}) ] \right. \tag {2} \\ - \mathbf {K L} \left(q _ {\phi} (\mathbf {z} | x _ {t}) \| p _ {\theta} (\mathbf {z}))\right) \\ \end{array} +$$ + +where $q_{\phi}(\mathbf{z}|x_t)$ is the encoder (recognition model or inference model), parameterized by $\phi$ , i.e., the approximation to true posterior $p_{\theta}(\mathbf{z}[x_t])$ . The distribution $p_{\theta}(\mathbf{z})$ is the prior for $\mathbf{z}$ . + +As studied in Sanh et al. (2019), natural languages can be regarded as a manifold, since it is hierarchically organized, and the corresponding syntax and the semantics interact in an intricate space. Based on the observation that different words or phrases in sentences represent different entities with different roles, either grammatical or semantic, and potentially interact with each other, we guide the generations of latent variables in the VAE corresponding to entities in sentences by designing a VAE with decomposable latent variables. Hence our proposed DecVAE can identify hierarchically independent components from natural languages. Furthermore, the reconstruction network may generate words or phrases sequentially. + +DecVAE will learn a decoder that maps the latent space $\mathcal{Z}$ (learned by the encoder from input samples) to this language manifold $\mathcal{X}$ . Let $\mathbf{Z} = [\mathbf{z}^1, \dots, \mathbf{z}^K] \in \mathcal{Z}$ be the latent variable of the decoder and $\mathbf{z}^k$ to represent the $k$ -th component of the latent variables. In addition, we also add a $\mathbf{z}_0$ to each $\mathbf{z}^k$ , a special latent variable to encodes the overall properties of the generated sentences and the correlations between different grammatical and semantic components. Let $(\bar{\mathbf{x}}, \bar{\mathbf{f}}) = [(\bar{\mathbf{x}}^1, \bar{\mathbf{f}}^1), \dots, (\bar{\mathbf{x}}^K, \bar{\mathbf{f}}^K)]$ be the variables for the output of the decoder (each element is a tuple composed of the generated token index in the vocabulary and its component index), where $\mathbf{z}^k$ controls the properties of $k$ -th component $\bar{\mathbf{x}}^k$ . + +Firstly, we assume that the components are conditionally independent with each other given the latent variables, i.e., + +$$ +\left(\bar {\mathbf {x}} ^ {i}, \bar {\mathbf {f}} ^ {i}\right) \perp \left(\bar {\mathbf {x}} ^ {j}, \bar {\mathbf {f}} ^ {j}\right) | \mathbf {Z}, \text {i f} i \neq j. +$$ + +We also have the following independent assumption about the components and latent variables, + +$$ +\left(\bar {\mathbf {x}} ^ {i}, \bar {\mathbf {f}} ^ {i}\right) \perp \mathbf {z} ^ {j} | \mathbf {z} _ {0} ^ {j}, \text {i f} i \neq j. \tag {3} +$$ + +![](images/b9639aa62ce901e69091628b442a424e9c69ffe368e00bac6eb5ceabe64817d0.jpg) +Figure 1: The proposed model consists of four layers. From bottom to top, they are embedding layer, multi-head attention layer, encoder, and decoder. Different from the usual network structure, the first three layers comprise three parallel independent layers, one for semantic and one for syntax. The attention layers yield $K$ -dim attention weights $\mathbf{f}$ , so that ensemble of $K$ weighted embeddings are working in both semantic and syntax encoders. + +Let $\bar{\mathbf{y}} = (\bar{\mathbf{x}},\bar{\mathbf{f}})$ and each $\bar{\mathbf{y}}^k = (\bar{\mathbf{x}}^k,\bar{\mathbf{f}}^k)$ . We have the following distributions for generated tokens: + +$$ +\begin{array}{l} p (\bar {\mathbf {y}} | \mathbf {z}) = p (\bar {\mathbf {y}} ^ {1}, \dots , \bar {\mathbf {y}} ^ {K} | \mathbf {z} _ {0}, \mathbf {z} ^ {1}, \dots , \mathbf {z} ^ {K}) \\ = \prod_ {k = 1} ^ {K} p (\bar {\mathbf {y}} ^ {k} | \mathbf {z} _ {0} ^ {k}, \mathbf {z} ^ {1}, \dots , \mathbf {z} ^ {K}) = \prod_ {k = 1} ^ {K} p (\bar {\mathbf {y}} ^ {k} | \mathbf {z} _ {0} ^ {k}, \mathbf {z} ^ {k}) \\ \end{array} +$$ + +This model attempts to encode each component's individual features ( tokens, words, or phrases) and the global latent factors for the sentence. + +# 3.2 Objective Function + +We propose to decompose the two terms of calculating KL divergence following Eq. (1). Meanwhile, along the thread of our proposed DecVAE, we add the global controller variable $\mathbf{z}_0$ . This design shares some similarities with the component segmentation in computer vision, such as MONet (Burgess et al., 2019). MONet shows that an attention network layer improves component segmentation as well as component disentanglement, in which a variable, $f$ , the representation of the attention, is deployed there. Taking these into consideration, our model is defined as following. Let $\mathbf{z}_{syn} = [\mathbf{z}_{syn}^1,\dots ,\mathbf{z}_{syn}^K]$ be the syntactic latent variable, we define an equation for syntax based on the decomposable nature of latent variables as: + +$$ +\begin{array}{l} \mathbf {K L} (q _ {\phi} (\mathbf {z} _ {s y n} ^ {k} | \mathbf {x}) | | p _ {\theta} (\mathbf {z} _ {s y n} ^ {k})) = I _ {q _ {\phi}} (\mathbf {x}, \mathbf {f} ^ {k}; \mathbf {z} _ {s y n} ^ {k}, \mathbf {z} _ {0} ^ {k}) \\ + \sum_ {i, j} \left[ \mathbf {K L} \left(q \left(\mathbf {z} _ {\text {s y n}} ^ {k _ {i}}, \mathbf {z} _ {0} ^ {k _ {j}}\right) \right\rvert \right. \left. p \left(\mathbf {z} _ {\text {s y n}} ^ {k _ {i}}, \mathbf {z} _ {0} ^ {k _ {j}}\right)\right) \tag {4} \\ + \beta \mathbf {K L} (q _ {\phi} (\mathbf {z} _ {s y n} ^ {k}, \mathbf {z} _ {0} ^ {k}) | | \prod_ {i} q _ {\phi} (\mathbf {z} _ {s y n} ^ {k _ {i}}) \prod_ {j} q _ {\phi} (\mathbf {z} _ {0} ^ {k _ {j}})) ] \\ \end{array} +$$ + +and a similar equation for semantics as + +$$ +\begin{array}{l} \mathbf {K L} (q _ {\phi} (\mathbf {z} _ {s e m} ^ {k} | \mathbf {x}) | | p _ {\theta} (\mathbf {z} _ {s e m} ^ {k})) = I _ {q _ {\phi}} (\mathbf {x}, \mathbf {f} ^ {k}; \mathbf {z} _ {s e m} ^ {k}, \mathbf {z} _ {0} ^ {k}) \\ + \sum_ {i, j} \mathbf {K L} \left(q \left(\mathbf {z} _ {s e m} ^ {k _ {i}}, \mathbf {z} _ {0} ^ {k _ {j}}\right) \| p \left(\mathbf {z} _ {s e m} ^ {k _ {i}}, \mathbf {z} _ {0} ^ {k _ {j}}\right)\right) \tag {5} \\ + \beta {\bf K L} (q _ {\phi} ({\bf z} _ {s e m} ^ {k}, {\bf z} _ {0} ^ {k}) | | \prod_ {i} q _ {\phi} ({\bf z} _ {s e m} ^ {k _ {i}}) \prod_ {j} q _ {\phi} ({\bf z} _ {0} ^ {k _ {j}})) ], \\ \end{array} +$$ + +where $i, j$ refer to indices of tokens and $\mathbf{z}_{*}^{k_{i}}, * \in \{\text{sem}, \text{syn}, 0\}$ indicates the latent variable value at the $i$ -th token. In Eq. (4) and Eq. (5), the second and third terms are derived from minimization of total correlations as in Esmaeili et al. (2019); Jeong and Song (2019). The second term decomposes each hidden vector of syntax and semantics into smaller categories in a hierarchical fashion so that we can have more subtle disentanglements of each syntactic or semantic components. + +The third term in Eq. (4) and Eq. (5) is derived from the standard equation of total correlation, + +$$ +T C (\mathbf {z} ^ {\mathbf {k}}) = \mathbb {E} \Big [ \log \big (\frac {q _ {\phi} (\mathbf {z} ^ {\mathbf {k}})}{\prod_ {i} q _ {\phi} (\mathbf {z} _ {i} ^ {k})} \big) \Big ] = K L (q _ {\phi} (\mathbf {z} ^ {k}) | | \prod_ {d} q _ {\phi} (\mathbf {z} _ {i} ^ {k})) +$$ + +Namely, we deploy this technique to penalize the total correlation (TC) for enforcing disentanglement of the latent factors. To compute the second term, we use the weighted version for estimating the distribution value of $q(\mathbf{z})$ . + +# 3.3 The Network Structure + +With the above derivations as our basis, we construct our network structure as shown in Figure 1. From bottom to top, the input sentences are con + +verted to embedding vectors. Meanwhile, there is a mask input with each mask $m_{k}$ showing whether each word or phrase $x_{t}$ appears in each sentence. Outputs from this layer are fed to a multi-head attention layer to generate attention weights $f_{t}$ . Following-up is the dot product between the embedding of $x_{t}$ and its attention weight $f_{t}$ . + +Since we are modeling both semantics and syntax of input sentences, the attention procedure is processed twice with different initialization. The results are passed into the semantic encoder and syntax encoder, respectively. Each encoder yields their hidden variables, $(\mathbf{z}_{semt}^{1\dots k},\mathbf{z}_{0t}^{1\dots k})$ and $(\mathbf{z}_{synt}^{1\dots k},\mathbf{z}_{0t}^{1\dots k})$ . A similar idea is implemented in recent work from computer vision domain (CV), MONet (Burgess et al., 2019). Differently, in their work, $f_{k}$ is generated sequentially with an attention network while we generate attention all at once with multi-head attention, which is proven successful in the transformer model (Vaswani et al., 2017). + +To incorporate recurrent neural networks for decoding, we take a similar structure described in SNAIL (Mishra et al., 2018). Namely, the self-attention mechanism from the transformer is combined with a temporal convolution. Next, the element-wise multiplication of embedding vector and focus masks generate hidden vectors, which are fed into semantic encoder and syntax encoder respectively to be encoded as a pair of variables $(\mathbf{z}^k,\mathbf{z}_0^k)$ . The two groups of hidden component vectors are concatenated into the decoder. We obtain the reconstructed words/phrases $\bar{\mathbf{x}}$ , and their component distribution $\bar{\mathbf{f}}^k$ , similar to a component assignment and consistent to the weights $\mathbf{f}^k$ . + +# 3.4 Multi-task Training and Inference + +With the product of embedding vector $\mathbf{emb}_t$ and their corresponding focus mask $\mathbf{m}_t$ as the encoder's input, $(\mathbf{z}^k,\mathbf{z}_0^k)$ as the latent variable and $(\bar{\mathbf{x}},\bar{\mathbf{m}}^{k})$ as the output of the decoder, the loss for component $k$ is given by + +$$ +\begin{array}{l} \Psi_ {k} (\mathbf {x}, \mathbf {f} ^ {k}; \theta , \phi , a, e, d) \tag {6} \\ = - \mathbb {E} _ {q _ {\phi} ^ {e} (\mathbf {z} ^ {k}, \mathbf {z} _ {0} ^ {k} | \mathbf {x}, \mathbf {f} ^ {k})} \left[ \mathbf {f} ^ {k} \log p _ {\theta} ^ {d} (\mathbf {x} | \mathbf {z} ^ {k}, \mathbf {z} _ {0} ^ {k}) \right] \\ + \operatorname {K L} \left(q _ {\phi} ^ {e} \left(\mathbf {z} ^ {k}, \mathbf {z} _ {0} ^ {k} | \mathbf {x}, \mathbf {f} ^ {k}\right) | | p \left(\mathbf {z} ^ {k}, \mathbf {z} _ {0} ^ {k}\right)\right) \\ + \gamma \mathbf {K L} (q _ {\phi} ^ {a} (\mathbf {f} ^ {k} | \mathbf {x}) | | p _ {\theta} ^ {d} (\bar {\mathbf {f}} ^ {k} | \mathbf {z} ^ {k}, \mathbf {z} _ {0} ^ {k})) \\ \end{array} +$$ + +Here $a, e$ and $d$ refer to multi-head attention layer, encoder and decoder layer respectively, $\theta$ and $\phi$ are parameters for the likelihood and variational distribution respectively, the local hidden variable + +![](images/40177697261b30b0675d17444719ddfac3b056f53ecfba82ab41c3f4199be3af.jpg) +Figure 2: Diagram of the training process for auxiliary losses: discriminative paraphrase loss (DPL; dashed lines) and paraphrase reconstruction loss (PRL; dash-dotted lines). Different from Chen et al. (2019), each input of encoders consists of embeddings of the sentence $\mathbf{x}_t$ and their component distributions, $\mathbf{f}_t^{1\dots k}$ . Each output of encoders consists of hidden variables $\mathbf{z}_{sem_t}^{1\dots k}$ and $\mathbf{z}_{0_t}^{1\dots k}$ . Each output of decoders consists of predicted embeddings of each sentence $\bar{x}_t$ and their predicted component distributions, $\bar{\mathbf{f}}_t$ . + +$\mathbf{z}^k = [\mathbf{z}_{sem}^k, \mathbf{z}_{syn}^k]$ and the global hidden variable $\mathbf{z}_0^k = [\mathbf{z}_{sem(0)}^k, \mathbf{z}_{syn(0)}^k]$ and $\gamma \geq 0$ is a hyperparameter. The overall loss is + +$$ +\mathcal {L} _ {\mathrm {V A E}} (\mathbf {x}; a, e, d) = \sum_ {k = 1} ^ {K} \Psi_ {k} (\mathbf {x}, \mathbf {f} ^ {k}; \theta , \phi , a, e, d). +$$ + +Loss Function Components. As seen from Eq. (6), our loss function is composed of three parts, which can be realized by our objective functions described in Eq. (4) and Eq. (5). Furthermore, following the success of multi-task training in Chen et al. (2019), we introduce three auxiliary objectives: paraphrase reconstruction loss (PRL), discriminative paraphrase loss (DPL) and word position loss (WPL). The purpose is to encourage $\mathbf{z}_{sym}$ to better capture semantic information and $\mathbf{z}_{syn}$ to better capture syntactic information. + +Paraphrase Reconstruction Loss Function. As shown in Figure 2, we swap the semantic variables, keep the syntactic variables and attempt to reconstruct the sentences. We model sentences with paraphrase relationships $\mathbf{x}_1$ and $\mathbf{x}_2$ to be generated with the same semantic latent variables. The basic assumption is still that semantic information is equivalent between a paraphrase pair. But differently, our PRL involve more variables, including the common latent factor $\mathbf{z}_0$ and the focus mask variables $\mathbf{f}_k$ . Therefore, our PRL is defined as, + +$$ +\begin{array}{l} \mathbb {E} _ {\substack {\mathbf {z} _ {s e m (2)} \sim q _ {\phi} ^ {\epsilon} (\mathbf {1}) \\ \mathbf {z} _ {s y n (1)} \sim q _ {\phi} ^ {\epsilon} (\mathbf {2})}} \left[ - \log p _ {\theta} ^ {d} (\bar {\mathbf {x}} _ {1} | (\mathbf {z} _ {s e m (2)}, \mathbf {z} _ {0 (2)}), (\mathbf {z} _ {s y n (1)}, \mathbf {z} _ {0 (1)}) \right] + \\ \begin{array}{r l} & {\mathbb {E} _ {\mathbf {z} _ {s e m (1)} \sim q _ {\phi} ^ {e} (\mathbf {3})} \left[ - \log p _ {\theta} ^ {d} (\overline {{\mathbf {x}}} _ {2} | (\mathbf {z} _ {s e m (1)}, \mathbf {z} _ {0 (1)}), (\mathbf {z} _ {s y n (2)}, \mathbf {z} _ {0 (2)}) \right]} \\ & {\mathbf {z} _ {s y n (2)} \sim q _ {\phi} ^ {e} (\mathbf {4})} \end{array} \\ \end{array} +$$ + +where + +$$ +\begin{array}{r} q _ {\phi} ^ {e} (\mathbf {1}) = q _ {\phi} ^ {e} ((\mathbf {z}, \mathbf {z} _ {0}) _ {s e m} | \overline {{\mathbf {x}}} _ {2}, \overline {{\mathbf {f}}} _ {2}), q _ {\phi} ^ {e} (\mathbf {2}) = q _ {\phi} ^ {e} ((\mathbf {z}, \mathbf {z} _ {0}) _ {s y n} | \overline {{\mathbf {x}}} _ {1}, \overline {{\mathbf {f}}} _ {1}), \\ q _ {\phi} ^ {e} (\mathbf {3}) = q _ {\phi} ^ {e} ((\mathbf {z}, \mathbf {z} _ {0}) _ {s e m} | \overline {{\mathbf {x}}} _ {1}, \overline {{\mathbf {f}}} _ {1}), q _ {\phi} ^ {e} (\mathbf {4}) = q _ {\phi} ^ {e} (\mathbf {z}, \mathbf {z} _ {0}) _ {s y n} | \overline {{\mathbf {x}}} _ {2}, \overline {{\mathbf {f}}} _ {2}). \end{array} +$$ + +Discriminative Paraphrase Loss. The Discriminative Paraphrase Loss (DPL) attempts to learn to encourage sentences with paraphrase relationships to have higher similarities while those without such relationships to have lower similarities. Because paraphrase relationship is defined in the sense of semantic similarity, we only calculate it with samples from vMF distributions. The loss is defined as, + +$$ +\begin{array}{l} m a x (0, \delta - d i s t (x _ {1}, x _ {2})) + d i s t (x _ {1}, n _ {1})) + \\ m a x (0, \delta - d i s t (x _ {1}, x _ {2})) + d i s t (x _ {2}, n _ {2})) \end{array} +$$ + +where $dist$ refers to the distance, $x_{1}$ and $x_{2}$ are sentences with paraphrase relationship, while $x_{1}$ and $n_1$ are those without paraphrase relationships. The similarity function is the cosine similarity between the mean directions of the semantic variables across $K$ components from the two sentences: + +$$ +d i s t \left(x _ {1}, x _ {2}\right) = c o s i n e \left(\mu \left(x _ {1}\right), \mu \left(x _ {2}\right)\right) +$$ + +where $\mu (x_{i}) = (\mathbf{z}_{sem(i)}^{1\dots K}\odot \mathbf{z}_{0(i)}^{1\dots K})$ and $\odot$ is the element-wise product. + +Word Position Loss. Following Chen et al. (2019), we keep a word position loss (WPL) to guide the representation learning of the syntactic variable. For both word averaging encoders and LSTM encoders, we parameterize WPL with a three-layer feedforward neural network $f(\cdot)$ . The concatenation of the samples of the syntactic variables $\mathbf{z}_{syn}$ and the embedding vector $\mathbf{emb}_i$ at the word position $i$ form the input for the network. In the decoder stage, the position representation at position $i$ is predicted as a one-hot vector. The corresponding equation is defined as, + +$$ +W P L = \mathbb {E} _ {z _ {s y n} \sim q _ {\phi} (z | x)} \bigg [ \sum_ {i} \log [ (f ([ e _ {i}; z _ {s y n} ]) _ {i}) ] \bigg ] +$$ + +where $(\cdot)_i$ is the probability of position $i$ . + +Inference Model for Word Averaging. In + +our framework, syntax and semantics encoders $q_{\phi}^{e}(\mathbf{z}_{syn}|\mathbf{x})$ and $q_{\phi}^{e}(\mathbf{z}_{sem}|\mathbf{x})$ follow different fashions with different sampling strategies with additional linear feedforward neural network. However, both use word averaging to obtain the mean vector, $\mu (\mathbf{x})$ and the standard deviation vector, $\sigma (\mathbf{x})$ + +In the decoding stage, we generate a bag of words given $\mathbf{z}_{syn}$ and $\mathbf{z}_{sem}$ by the posterior probability $p_{\theta}^{d}(\mathbf{x}|\mathbf{z}_{syn},\mathbf{z}_{sem})$ . Note that the decoding output is a tuple of vectors, which includes both word index and their component probability distribution. The expected output log-probability is computed as follows: + +$$ +\begin{array}{l} \underset { \begin{array}{c} \mathbf {z} _ {s e m} \sim q _ {\phi} ^ {e} (\mathbf {z} _ {\mathbf {s e m}} | \mathbf {x}) \\ \mathbf {z} _ {s y n} \sim q _ {\phi} ^ {e} (\mathbf {z} _ {\mathbf {s y n}} | \mathbf {x}) \end{array} } {\mathbb {E}} \left[ \log p _ {\theta} ^ {d} (\mathbf {x} | \mathbf {z} _ {s e m}, \mathbf {z} _ {s y n}) \right] = \\ \underset { \begin{array}{c} \mathbf {z} _ {s e m} \sim q _ {\phi} ^ {e} (\mathbf {z} _ {\mathbf {s e m}} | \mathbf {x}) \\ \mathbf {z} _ {s y n} \sim q _ {\phi} ^ {e} (\mathbf {z} _ {\mathbf {s y n}} | \mathbf {x}) \end{array} } {\mathbb {E}} \left[ \sum_ {t = 1} ^ {T} \log \frac {\exp f _ {\theta} ([ \mathbf {z} _ {s e m} ; \mathbf {z} _ {s y n} ]) _ {x _ {t}}}{\sum_ {v = 1} ^ {V} \exp f _ {\theta} ([ \mathbf {z} _ {s e m} ; \mathbf {z} _ {s y n} ]) _ {v}} \right] \\ \end{array} +$$ + +where $V$ is the vocabulary size, $[\cdot ]$ indicates concatenation, $T$ is the sentence length and $x_{t}$ is the index of the $t$ 'th word's word type. $f_{\theta}([{\bf z}_{sem};{\bf z}_{syn}]$ is a feedforward neural network with outputs being a bag of words. + +# Inference Model for BLSTM Averaging + +Similarly, we compute the expected output log-probability of generated words, including their component information for BLSTM as follows, + +$$ +\begin{array}{l} \underset { \begin{array}{c} \mathbf {z} _ {s e m} \sim q _ {\phi} ^ {e} (\mathbf {z} _ {\mathbf {s e m}} | \mathbf {x}) \\ \mathbf {z} _ {s y n} \sim q _ {\phi} ^ {e} (\mathbf {z} _ {\mathbf {s y n}} | \mathbf {x}) \end{array} } {\mathbb {E}} \left[ \log p _ {\theta} ^ {d} (\mathbf {x} | \mathbf {z} _ {s e m}, \mathbf {z} _ {s y n}) \right] = \\ \mathop{\mathbb{E}}_{\substack{\mathbf{z}_{sem}\sim q_{\phi}^{e}(\mathbf{z}_{sem}|\mathbf{x})\\ \mathbf{z}_{syn}\sim q_{\phi}^{e}(\mathbf{z}_{syn}|\mathbf{x})}}\big[\sum_{w = 1}^{S}\log p_{\theta}\big(x_{w}|\mathbf{z}_{syn},\mathbf{z}_{sem},\mathbf{x}_{1:s - 1}|)\big)\big] \\ \end{array} +$$ + +The inference model $q_{\phi}^{e}(\mathbf{z}_{sem})$ is still a word averaging encoder while $q_{\phi}^{e}(\mathbf{z}_{syn})$ is parameterized by a bidirectional LSTM, where the forward and backward hidden states are concatenated together and then the average is taken. The averages are used as input for a feedforward network with one hidden layer to produce both mean vector $\mu (\mathbf{x})$ and $\sigma (\mathbf{x})$ . + +Since both the inference model of word averaging and BLSTM are interacting with the decomposed KL divergence or total correlations through backpropagation, our inference and the generative models can obtain more factorized component information. Hence, the generated tokens are more consistent between syntax and semantics. + +# 4 Experiments + +Following Chen et al. (2019), we sampled 50M paraphrase pairs from ParaNMT-50M (Wieting and Gimpel, 2018) as our training set. We use the SemEval semantic textual similarity (STS) task 2017 (Cer et al., 2017) as the development set. The STS task and its benchmark as the test set for similarity evaluation. The implementation was based on the PaddlePaddle deep learning platform. + +# 4.1 Experiment Setup + +We set the dimension of hidden variables and word embedding to 50, which speeds up experiments and provides a competitive performance over a wide range. To have a fair comparison, we also tune $\gamma$ , the weights for PRL and reconstruction loss from 0.1 to 1 in increments of 0.1 based on the development set performance. We set $\gamma = 0.2$ with the best validation results. One sample from each latent variable is utilized during training. When evaluating DecVAE based models on STS tasks, the mean direction of the semantic variable is used. In contrast, the mean vector of the syntactic variable is used in syntactic similarity tasks. The total correlations are also mainly applied to syntactic tasks since we find that applying total correlations to vMF distribution makes the model too complicated. Hence, we simplify the framework with only $KL$ divergence of attentions calculated against the semantic components for current work. + +# 4.2 Baselines + +We compare with word averaging (WORDAVG) and bidirectional LSTM averaging (BLSTMAVG) of VGVAE model (Chen et al., 2019; Wieting and Gimpel, 2018). In particular, WORDAVG takes the average over word embeddings in the input sequence to obtain the sentence representation. BLSTMAVG uses the average hidden states of a bidirectional LSTM as the sentence representation, where forward and backward hidden states are concatenated. + +# 4.3 Semantic Similarity Evaluations + +Table 1 presents the semantic similarity evaluations. Specifically, the upper rows tell us how they can model similarity when trained on paraphrases (Wieting and Gimpel, 2018) and the lower half rows show remarkable differences between semantic and syntactic metrics. It is worth noting that in Chen et al. (2019), they also reported semantic modeling results for several pretrained embeddings, in which + +
methodssemantic var. %syntactic var. %
bmavgbmavg
VGVAE WORDAVG71.964.8--
VGVAE BLSTMAVG71.464.4--
DecVAE WORDAVG72.465.1--
DecVAE BLSTTMAVG71.463.2--
VGVAE ALL+LSTM enc72.265.116.624.3
VGVAE ALL+LSTM e&d72.865.311.519.9
DecVAE+WPL52.345.331.433.2
DecVAE+DPL63.557.635.937.5
DecVAE+PRL65.659.228.933.1
DecVAE+PRL+WPL69.962.924.428.2
DecVAE+PRL+DPL67.562.334.132.8
DecVAE+DPL+WPL69.965.419.924.2
DecVAE+ALL+WORDAVG e&d73.964.022.317.7
DecVAE ALL+LSTM enc70.062.114.716.5
DecVAE ALL+LSTM e&d72.265.78.19.7
+ +Table 1: Pearson correlation $(\%)$ for STS test sets. bm: STS test set. avg: the average of Pearson correlation for each domain in the test set from 2012 to 2016. Results are in bold if they are highest in the "semantic variable" columns or lowest in the "syntactic variable" columns. "ALL" indicates all of the multi-task losses are used. "e&d" means "enc & dec". The results are averaged over five repetitions and the standard deviation is around $0.1\% - 0.2\%$ for all methods. + +they showed that all pretrained embeddings are far lower than those of VGVAE based models. Such a result implies that VAE-based modeling can capture semantics quite well no matter what variations we make. For simplicity, we do not show the results from pretrained embeddings herein. Readers please refer to Chen et al. (2019) for more details. + +As shown in the upper rows of Table 1, DecVAE+WORD $_{AVG}$ achieves the best semantic score for both STS avg metric and STS bm metric. LSTM-based models do not show advantages over Word $_{AVG}$ as VGVAE (Chen et al., 2019). So average of LSTM outputs for decomposed VAE is not as effective as vanilla VAE based approaches. + +The lower rows in Table 1 show whether semantic variables can better capture semantic information than syntactic variables. We reproduced VGVAE's result by their released package (Chen et al., 2019) for comparisons and our results are lines from 3 to 11. As shown, the semantic and syntactic variables of the base DecVAE model show similar performances on the STS test sets. With more losses added, the performance of these two variables gradually diverges, indicating that different information is captured in the two variables. Therefore, we can see that the various losses play essential roles in the disentanglement of semantics and syntax in DecVAE. When all losses plus $Word_{AVGe\&d}$ are fully utilized, the high + +est benchmark results (73.91%) are obtained with 1.7% higher than VGVAE for semantic variables. Meanwhile, all losses plus $LSTM_{e\&d}$ achieves the best average results for semantic variables. More impressively, this approach yields relatively low scores for both benchmarks and average of syntactic variables (8.05 and 9.72 for bm and avg respectively). This fully shows that decomposition with total correlation has excellent disentanglement capacity on semantics and syntax. + +Finally, Figure 3 plots the performance curves of our models and baselines as the length of the target sentence increases. We observe a similar trend, i.e., the longer the sentence, the worse the performance. Our framework is close to the top (red) curve and has a more consistent trend. This shows that DecVAE achieves more remarkable disentanglement effects in syntax. Particularly, in Table 1, the full model with LSTM encoder and decoder achieves much lower values for syntactic evaluations than all other models. + +![](images/6f7524635d715e8dd10ef9f75d88cd1daff18984394e42f570248bdaa06e7d8d.jpg) +Figure 3: Constituency parsing F1 scores (left) and POS tagging accuracy (right) by sentence length, for 1-nearest neighbor parsers based on semantic and syntactic variables, as well as a random baseline and an oracle nearest neighbor parser ("Best"). Note that in the legend, " $+\mathrm{LSTM}$ " means " $+\mathrm{LSTM}$ enc & dec". + +![](images/bda4dc9399726f802d7d8009780b8da23ff72b82dee1dde550bf20ca55108355.jpg) + +# 4.4 Syntactic Similarity Evaluation + +Following the evaluation protocol in VGVAE (Chen et al., 2019), we utilize syntactic variables to calculate nearest neighbors for a 1-nearest-neighbor syntactic parser or POS tagger. Several metrics are employed to quantify the quality of the parser's output and tagging sequences. It is worth noting that this evaluation does not directly compare parsing accuracy. Instead, similar to the semantic similarity, it demonstrates syntactic variables' ability to capture more syntactic information than semantic variables. + +We report labeled F1 of constituent parsing and accuracy of POS tagging in Table 2. First, we evaluate VGVAE and DecVAE with word averaging encoder and BLSTM encoder in the upper table. + +
Constituent Parsing (F1, ↑).POS Tagging (% Acc., ↑).
VGVAE WORDAVG25.521.4
VGVAE BLSTMAVG25.721.6
DecVAE WORDAVG27.824.9
DecVAE BLSTMAVG29.933.2
semV.synV.semV.synV.
VGVAE All25.429.321.425.5
VGVAE+LSTM enc. & dec.25.338.821.435.7
DecVAE All24.933.720.429.8
DecVAE+LSTM enc.24.536.921.435.5
DecVAE+LSTM enc. & dec.23.241.519.438.9
+ +Table 2: Syntactic similarity evaluations, labeled F1 score for constituent parsing, and accuracy $(\%)$ for part-of-speech tagging. Numbers are bold if they are worst in the "semantic variable" column or best in the "syntactic variable" column. "ALL" indicates all of the multi-task losses are used. The results are collected and averaged over five rounds and the standard deviation is around $0.1\% -0.2\%$ for all methods. + +DecVAE outperforms VGVAE in both parsing and tagging. For the lower part, in contrast to semantic similarity, syntactic variables are expected to boost both tasks while semantic variables worsen them. The baseline "VGVAE All" initially have similar results for two variables. Then, with the addition of LSTM encoder and decoder, expected performances appear along. For our method, the gaps between both variables are more remarkable than VGVAE, although not always worst for semantic variables and best for syntactic variables. Such a result indicates that DecVAE achieved a good disentanglement of syntax and semantics. In particular, our full combination with LSTM achieves the best results and outperforms those of SOTA. + +Another observation is that although both VGVAE and DecVAE do not perform well compared with their LSTM counterparts, "DecVAE All" still obtains better performances than VGVAE. We believe that it is the total correlation that brings more accurate disentanglement effects. Nonetheless, the syntactic evaluation results, in general, are not so evident as the semantic correspondents. + +# 4.5 Qualitative Analysis with Case Studies + +We conduct a qualitative evaluation of latent variables via cosine similarity for nearest neighbor sentences and words to test set examples in terms of both the semantic and syntactic representations. The results are reported in Table 3 and Table 4. + +# 4.5.1 Lexical Analysis + +Table 3 shows word nearest neighbors for both semantic and syntactic representations and exhibits + +
Query WordsRetrieved Words
exactsemantic: indeed, current, completely, absolutely, context, clear, strictly, similarly, ec, proper syntactic: soap, benefit, license, orn, discontinuation, wed, jin, applications, girls, lucian
commandsemantic: guidance, result, ec, direction, accept, ordering, release, transmission, order syntactic: problem, root, eleven, sex, jinglge, francis, sale, trains, sixteen, industrial
requestingsemantic: note, guidance, inquires, inception, accepted, needs, claims, query, required, application syntactic: terminate, subscribe, particle, composite, locate, require, claim, compose, apply, inquiring
emptyingsemantic: changing, reset, stuffed, withdrawn, outline, modified, remove, boo, restoring, threads syntactic: entering, obtained, subtotal, living, combine, surged, dismissed, composed, applying, inquiring
smallestsemantic: minor, mi, smaller, diffuse, events, types, fragments, size, short, weighing syntactic: biggest, odd, stable, concerned, small, hotter, hottest, shorter, fragmentary
+ +Table 3: Examples of most similar words to particular query words in terms of the semantic or syntactic variable + +
Query SentenceSemantically SimilarSyntactically Similar
go, you fools, Xar bellowedthe hell, you say, Alekseyv bellowedHuh, I've got file festivals to enter he said.
Do you think I could do what she did?Do you think that I'd do it like that?So, do you know who's there?
His head must be right between the two cuts.He is already getting in your head right now.My mom even basked a cake for the party.
I'll tell you things can change a lot.When the siatuation changes, we'll let you know.I'd like to try the state government again.
They say, you do not have a face.In fact, you's just a pretty face.You don't know what is in that building
I even found a rare gouda on the internet.I've seen a lot on the internet.Did you get your degree off a cereal box?
I don't know, he was wearing socks.you got any socks you do not want wear.you don't play piano, I hope.
I love you as much as before.I love you more than I ever loved anyone.but wait. There's as much as what is.
You know what, cal, just pull over.cal, is trying to pull you out.You know, you guys got some competition out there?
Yeah, he got punched out in court earlier.From there she was taken to court and back.He would have to be forged by Jupityer himself.
+ +Table 4: Examples of most similar sentences to particular query sentences in terms of the semantic or syntactic variable. + +clear patterns. Among the five query words, retrieved words based on semantics have similar meanings against them, while those based on syntax share part-of-speeches. For example, for the query word, exact, almost all words in the semantic row have the sense of exactness. Likewise, most of the words in the second row, semantically, have the sense of order, as the query word, command. In contrast, the syntactic part has POS as NN. For the third row, semantically, they mostly have an association with require while syntactically, they are all verbs. + +# 4.5.2 Sentential Analysis + +Table 4 demonstrates sentences of semantically and syntactic similar respectively in column 2 and column 3. Like the lexical similarity, retrieved sentences in column 2 have similar meanings or similar keywords or key phrases to query sentences while they may be different in sentence structure. For example, "bellowed", "Do you think", "head", "change", "internet", "love", "pull" and "court" are in the rows from one to ten respectively. + +In contrast, those that are syntactically similar may have different meanings while they have similar grammatical patterns. Take a few rows as examples, "go, you fools, Xar bellowed" does have similar syntactic construction to "Huh, I've got file festivals to enter he said". Likewise, the second row, the query is composed of yes/no questions + +with an object clause for both query and syntactically similar sentence. + +# 4.6 Discussions + +The above results show the disentanglement effects of our proposed DecVAE from semantic and syntactic evaluations in both quantitative and qualitative perspectives. In comparing with baselines, it is not hard to see that DecVAE demonstrates more impressive disentanglement powers. Such results confirm our assumption that a more finetuned decomposition of KL divergences can detect more subtle aspects of semantics and syntax. This discovery can shed light on constructing more representative learning strategies for languages in both token and sentence levels. + +# 5 Conclusion + +We propose DecVAE, a framework to disentangle syntax and semantics in a sentence. It extends the original VAE so that the latent variables can be separated in more interpretable way. Experiments show that DecVAE achieves better results in semantic and syntax similarity than that of SOTA. One future direction is fine-grained representation learning for words and sentences, which is essential for many downstream applications such as controllable text generation. Besides, continual and interactive feature distillation may help improve more discriminate disentanglement (Wang et al., 2021). + +# References + +David M. Blei and John D. Lafferty. 2006. Dynamic topic models. In Proceedings of the Twenty-Third International Conference on Machine Learning (ICML), pages 113-120, Pittsburgh, PA. +David M. Blei, Andrew Y. Ng, and Michael I. Jordan. 2003. Latent dirichlet allocation. J. Mach. Learn. Res., 3:993-1022. +Samuel R. Bowman, Luke Vilnis, Oriol Vinyals, Andrew M. Dai, Rafal Jozefowicz, and Samy Bengio. 2016. Generating sentences from a continuous space. In Proceedings of the 20th SIGNLL Conference on Computational Natural Language Learning (CoNLL), pages 10-21, Berlin, Germany. +Christopher P. Burgess, Loic Matthews, Nicholas Watters, Rishabh Kabra, Irina Higgins, Matthew Botvinick, and Alexander Lerchner. 2019. MONet: Unsupervised scene decomposition and representation. arXiv preprint arXiv:1901.11390. +Daniel M. Cer, Mona T. Diab, Eneko Agirre, Inigo Lopez-Gazpio, and Lucia Specia. 2017. Semeval-2017 task 1: Semantic textual similarity multilingual and crosslingual focused evaluation. In Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval@ACL), pages 1-14, Vancouver, Canada. +Mingda Chen, Qingming Tang, Karen Livescu, and Kevin Gimpel. 2018. Variational sequential labelers for semi-supervised learning. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 215-226, Brussels, Belgium. +Mingda Chen, Qingming Tang, Sam Wiseman, and Kevin Gimpel. 2019. A multi-task approach for disentangling syntax and semantics in sentence representations. In Proceedings of the Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), pages 2453-2464, Minneapolis, MN. +Adji B. Dieng, Chong Wang, Jianfeng Gao, and John W. Paisley. 2017. Topicnn: A recurrent neural network with long-range semantic dependency. In Proceedings of the 5th International Conference on Learning Representations (ICLR), Toulon, France. +Ran Ding, Ramesh Nallapati, and Bing Xiang. 2018. Coherence-aware neural topic modeling. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing (EMNL), pages 830-836, Brussels, Belgium. +Babak Esmaeili, Hao Wu, Sarthak Jain, Alican Bozkurt, N. Siddharth, Brooks Paige, Dana H. Brooks, Jennifer G. Dy, and Jan-Willem van de Meent. 2019. Structured disentangled representations. In Proceedings of the 22nd International Conference on Artificial Intelligence and Statistics (AISTATS), pages 2525-2534, Naha, Okinawa, Japan. + +Zhenxin Fu, Xiaoye Tan, Nanyun Peng, Dongyan Zhao, and Rui Yan. 2018. Style transfer in text: Exploration and evaluation. In Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence (AAAI), pages 663–670, New Orleans, LA. +Irina Higgins, Loic Matthews, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. 2017. beta-vae: Learning basic visual concepts with a constrained variational framework. In Proceedings of the 5th International Conference on Learning Representations (ICLR), Toulon, France. +Shifu Hou, Yujie Fan, Mingxuan Ju, Yanfang Ye, Wenqiang Wan, Kui Wang, Yinming Mei, Qi Xiong, and Fudong Shao. 2021. Disentangled representation learning in heterogeneous information network for large-scale android malware detection in the COVID-19 era and beyond. In Proceedings of the Thirty-Fifth AAAI Conference on Artificial Intelligence (AAAI), pages 7754-7761, Virtual Event. +Zhiting Hu, Zichao Yang, Xiaodan Liang, Ruslan Salakhutdinov, and Eric P. Xing. 2017. Toward controlled generation of text. In Proceedings of the 34th International Conference on Machine Learning (ICML), pages 1587-1596, Sydney, Australia. +Mohit Iyyer, John Wieting, Kevin Gimpel, and Luke Zettlemoyer. 2018. Adversarial example generation with syntactically controlled paraphrase networks. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), pages 1875-1885, New Orleans, LA. +Sarthak Jain, Edward Banner, Jan-Willem van de Meent, Iain James Marshall, and Byron C. Wallace. 2018. Learning disentangled representations of texts with application to biomedical abstracts. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4683-4693, Brussels, Belgium. +Yeonwoo Jeong and Hyun Oh Song. 2019. Learning discrete and continuous factors of data via alternating disentanglement. In Proceedings of the 36th International Conference on Machine Learning (ICML), pages 3091-3099, Long Beach, CA. +Vineet John, Lili Mou, Hareesh Bahuleyan, and Olga Vechtomova. 2019. Disentangled representation learning for non-parallel text style transfer. In Proceedings of the 57th Conference of the Association for Computational Linguistics (ACL), pages 424–434, Florence, Italy. +Mingxuan Ju, Wei Song, Shiyu Sun, Yanfang Ye, Yu-jie Fan, Shifu Hou, Kenneth A. Loparo, and Liang Zhao. 2021. Dr.emotion: Disentangled representation learning for emotion analysis on social media to improve community resilience in the COVID-19 era and beyond. In Proceedings of the Web Conference (WWW), Virtual Event / Ljubljana, Slovenia. + +Hyunjik Kim and Andriy Mnih. 2018. Disentangling by factorising. In Proceedings of the 35th International Conference on Machine Learning (ICML), pages 2654-2663, Stockholm, Sweden. +Diederik P. Kingma and Max Welling. 2014. Autoencoding variational bayes. In Proceedings of the 2nd International Conference on Learning Representations (ICLR), Banff, Canada. +Dingcheng Li, Siamak Zamani, Jingyuan Zhang, and Ping Li. 2019a. Integration of knowledge graph embedding into topic modeling with hierarchical dirichlet process. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), Minneapolis, MN. +Dingcheng Li, Jingyuan Zhang, and Ping Li. 2018. Representation learning for question classification via topic sparse autoencoder and entity embedding. In Proceedings of the IEEE International Conference on Big Data (Big Data), Seattle, WA. +Dingcheng Li, Jingyuan Zhang, and Ping Li. 2019b. TMSA: A mutual learning model for topic discovery and word embedding. In Proceedings of the 2019 SIAM International Conference on Data Mining (SDM), pages 684-692, Calgary, Alberta, Canada. +Alireza Makhzani and Brendan J. Frey. 2017. Pixelgan autoencoders. In Advances in Neural Information Processing Systems (NIPS), pages 1975-1985, Long Beach, CA. +Yishu Miao, Lei Yu, and Phil Blunsom. 2016. Neural variational inference for text processing. In Proceedings of the 33nd International Conference on Machine Learning (ICML), pages 1727-1736, New York City, NY. +Nikhil Mishra, Mostafa Rohaninejad, Xi Chen, and Pieter Abbeel. 2018. A simple neural attentive metal-learner. In Proceedings of the 6th International Conference on Learning Representations (ICLR), Vancouver, Canada. +Andriy Mnih and Karol Gregor. 2014. Neural variational inference and learning in belief networks. In Proceedings of the 31th International Conference on Machine Learning (ICML), pages 1791-1799, Beijing, China. +Feng Nan, Ran Ding, Ramesh Nallapati, and Bing Xiang. 2019. Topic modeling with Wasserstein autoencoders. In Proceedings of the 57th Conference of the Association for Computational Linguistics (ACL), pages 6345-6381, Florence, Italy. +Gabriele Pergola, Lin Gui, and Yulan He. 2021. A disentangled adversarial neural topic model for separating opinions from plots in user reviews. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), pages 2870-2883, Online. + +Victor Sanh, Thomas Wolf, and Sebastian Ruder. 2019. A hierarchical multi-task approach for learning embeddings from semantic tasks. In Proceedings of the Thirty-Third AAAI Conference on Artificial Intelligence (AAAI), pages 6949-6956, Honolulu, HI. +Akash Srivastava and Charles Sutton. 2017. Autoencoding variational inference for topic models. In Proceedings the 5th International Conference on Learning Representations (ICLR), Toulon, France. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advances in Neural Information Processing Systems (NIPS), pages 5998-6008, Long Beach, CA. +Yigong Wang, Zhuoyi Wang, Yu Lin, Latifur Khan, and Dingcheng Li. 2021. CIFDM: continual and interactive feature distillation for multi-label stream learning. In Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR), pages 2121-2125, Virtual Event, Canada. +Michael Satosi Watanabe. 1960. Information theoretical analysis of multivariate correlation. IBM J. Res. Dev., 4(1):66-82. +John Wieting and Kevin Gimpel. 2018. *Paranmt-50m: Pushing the limits of paraphrastic sentence embeddings with millions of machine translations*. In *Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (ACL)*, pages 451–462, Melbourne, Australia. +Sam Wiseman, Stuart M. Shieber, and Alexander M. Rush. 2018. Learning neural templates for text generation. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 3174-3187, Brussels, Belgium. +Zichao Yang, Zhiting Hu, Ruslan Salakhutdinov, and Taylor Berg-Kirkpatrick. 2017. Improved variational autoencoders for text modeling using dilated convolutions. In Proceedings of the 34th International Conference on Machine Learning (ICML), pages 3881-3890, Sydney, Australia. +Qingyu Yin, Yu Zhang, Weinan Zhang, Ting Liu, and William Yang Wang. 2018. Deep reinforcement learning for chinese zero pronoun resolution. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (ACL), pages 569-578, Melbourne, Australia. +Chunting Zhou and Graham Neubig. 2017. Multi-space variational encoder-decoders for semisupervised labeled sequence transduction. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (ACL), pages 310-320, Vancouver, Canada. \ No newline at end of file diff --git a/adeepdecomposablemodelfordisentanglingsyntaxandsemanticsinsentencerepresentation/images.zip b/adeepdecomposablemodelfordisentanglingsyntaxandsemanticsinsentencerepresentation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..62985828b72ece1df9863a04fc24e367f4f0546b --- /dev/null +++ b/adeepdecomposablemodelfordisentanglingsyntaxandsemanticsinsentencerepresentation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:23b87b7c970af1738b6d48ffa4a713aa41b73f10910eab3da5bf285803aadbb1 +size 614243 diff --git a/adeepdecomposablemodelfordisentanglingsyntaxandsemanticsinsentencerepresentation/layout.json b/adeepdecomposablemodelfordisentanglingsyntaxandsemanticsinsentencerepresentation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..aef506bb4216bf658f4552be01fbba59d8e21cbc --- /dev/null +++ b/adeepdecomposablemodelfordisentanglingsyntaxandsemanticsinsentencerepresentation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e86be7fdfd4f2e2be9c6a45b3c04232c3de9b7abe203f38b91e1b802ee1cf438 +size 416238 diff --git a/adiscourseawaregraphneuralnetworkforemotionrecognitioninmultipartyconversation/fdf53b35-9f3c-469b-be70-c892094ec86b_content_list.json b/adiscourseawaregraphneuralnetworkforemotionrecognitioninmultipartyconversation/fdf53b35-9f3c-469b-be70-c892094ec86b_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..bb4687b899e8e8f182af862588de9c7305a45996 --- /dev/null +++ b/adiscourseawaregraphneuralnetworkforemotionrecognitioninmultipartyconversation/fdf53b35-9f3c-469b-be70-c892094ec86b_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2713c160e3773492b3273c27eb30218390b1f706b54e75cc7386655cee30e047 +size 72961 diff --git a/adiscourseawaregraphneuralnetworkforemotionrecognitioninmultipartyconversation/fdf53b35-9f3c-469b-be70-c892094ec86b_model.json b/adiscourseawaregraphneuralnetworkforemotionrecognitioninmultipartyconversation/fdf53b35-9f3c-469b-be70-c892094ec86b_model.json new file mode 100644 index 0000000000000000000000000000000000000000..ba477d1ee32da342c0e2c12051c3023c870900d1 --- /dev/null +++ b/adiscourseawaregraphneuralnetworkforemotionrecognitioninmultipartyconversation/fdf53b35-9f3c-469b-be70-c892094ec86b_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd185721807a1ec2f428ae9aa5f7f2ca82377d340f309e5acdd752a959c4a053 +size 87962 diff --git a/adiscourseawaregraphneuralnetworkforemotionrecognitioninmultipartyconversation/fdf53b35-9f3c-469b-be70-c892094ec86b_origin.pdf b/adiscourseawaregraphneuralnetworkforemotionrecognitioninmultipartyconversation/fdf53b35-9f3c-469b-be70-c892094ec86b_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f76b81bdc6bbee9e290969df898f104c12d848c3 --- /dev/null +++ b/adiscourseawaregraphneuralnetworkforemotionrecognitioninmultipartyconversation/fdf53b35-9f3c-469b-be70-c892094ec86b_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f83dbe8b2d32f1248c9bff8f54d95e7fafc8cfb3f32242b8933bdbcc992f3ba3 +size 656157 diff --git a/adiscourseawaregraphneuralnetworkforemotionrecognitioninmultipartyconversation/full.md b/adiscourseawaregraphneuralnetworkforemotionrecognitioninmultipartyconversation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d6208a7aee061147c79d42bf65e9879f0967a0ce --- /dev/null +++ b/adiscourseawaregraphneuralnetworkforemotionrecognitioninmultipartyconversation/full.md @@ -0,0 +1,325 @@ +# A Discourse-Aware Graph Neural Network for Emotion Recognition in Multi-Party Conversation + +Yang Sun $^{1}$ , Nan Yu $^{1}$ , Guohong Fu $^{1,2*}$ + +$^{1}$ School of Computer Science and Technology, Soochow University, China + +$^{2}$ Institute of Artificial Intelligence, Soochow University, China + +{ysun23,nyu}@stu.suda.edu.cn + +ghfu@suda.edu.cn + +# Abstract + +Emotion recognition in multi-party conversation (ERMC) is becoming increasingly popular as an emerging research topic in natural language processing. Prior research focuses on exploring sequential information but ignores the discourse structures of conversations. In this paper, we investigate the importance of discourse structures in handling informative contextual cues and speaker-specific features for ERMC. To this end, we propose a discourse-aware graph neural network (ERMC-DisGCN) for ERMC. In particular, we design a relational convolution to lever the self-speaker dependency of interlocutors to propagate contextual information. Furthermore, we exploit a gated convolution to select more informative cues for ERMC from dependent utterances. The experimental results show our method outperforms multiple baselines, illustrating that discourse structures are of great value to ERMC. + +# 1 Introduction + +In the past few years, emotion recognition in conversation (ERC) has become increasingly popular in natural language processing (NLP) with the proliferation of open conversational data on social media platforms (Poria et al., 2019a). Similar to text sentiment analysis, ERC is a task to determine the emotion of each utterance within a conversation, as shown in Fig. 1, and plays an important role in many NLP applications, such as opinion mining in conversation (Cambria et al., 2017), social media analysis (Majumder et al., 2019) and emotion-aware dialogue systems (Ghosal et al., 2019). However, ERC, particularly the emotion recognition in multi-party conversation (ERMC), often exhibits more difficulties than traditional text sentiment analysis due to the emotional dynamics of conversations (Poria et al., 2019b). Consequently, recognizing + +![](images/4697d0335852fe1a6cff24985e8188bbf705acbb5f5e7d5267724b007ecc7ab7.jpg) +Figure 1: An example of the ERC task, the gold labels are different emotions of the utterances, and the discourse structure is shown on the left. QAP, Ack, Ela, and Expl respectively represent the Question-Answer Pair, Acknowledgment, Elaboration, and Explanation relations. + +the emotion of an utterance in a multi-party conversation primarily depends on not only the utterance itself and its context but also the self and interpersonal dependencies and the emotions expressed in the preceding utterances (Poria et al., 2017; Majumder et al., 2019; Jiao et al., 2019; Zhong et al., 2019; Shen et al., 2021). + +Many approaches have been proposed for ERC with a focus on conversational context representation and speaker-specific modeling. While earlier works on ERC focus on two-party conversation and exploit recurrent neural networks (RNNs) to capture sequential context features of conversations (Poria et al., 2017; Majumder et al., 2019; Jiao et al., 2019; Ghosal et al., 2019), recent studies exert more efforts on ERMC and explore different techniques such as multi-task learning (Li et al., 2020) and pre-training language modeling (Shen et al., 2021) to capture speaker-specific information. Although these studies have greatly promoted the progress of ERC, most of them ignore the important conversational discourse structures. Therefore, they can only leverage cues in neighboring context of conversations, and are difficult to handle + +informative distant dependencies for ERC. + +Actually, conversational discourse structures contain discourse relations or discourse dependencies between utterances and thus provide a straightforward way to capture both adjacent and distant cues for ERMC. Fig. 1 illustrates a multi-party conversation example with its discourse structure obtained from the discourse parser proposed by Shi and Huang (2019). As we can see, although the first and the fourth utterances are distant in position within the conversation, they have an immediate discourse relation and are thus annotated with the same emotion type surprise. Therefore, such discourse relations offer important contextual cues for ERMC. On the other hand, discourse structures have proven to be useful for document-level sentiment analysis (Bhatia et al., 2015; Márkle-Huß et al., 2017; Kraus and Feuerriegel, 2019) and we believe that they are also beneficial for ERMC. Moreover, recent progress in conversational discourse parsing (Shi and Huang, 2019; Li et al., 2021) makes it applicable to explore discourse structures to help model conversational contexts and speakers for ERMC. + +However, two new problems may arise when discourse structures are applied to ERMC. First, previous works have shown that speaker-specific information is very important for ERMC (Zhang et al., 2019; Li et al., 2020). So it becomes a key issue how to incorporate conversational discourse structures into speaker-specific modeling for ERMC. Second, discourse structures involve dependent relations between utterances. However, not all information from dependent utterances is useful for conversational emotion recognition. Therefore, another important problem might be how to select more informative cues for ERMC. + +To address the aforementioned issues, we propose a discourse-aware graph neural network for emotion recognition in multi-party conversation, named ERMC-DisGCN. It consists of three main modules: Firstly, a sequential context encoding module exploits Long Short-Term Memory (LSTM) (Hochreiter and Schmidhuber, 1997) to capture the sequential features of utterances in a conversation. Then, we exploit discourse dependency links and discourse relations to construct a graph, which contains two main convolution operations, namely a relational convolution and a gated convolution. The relational convolution is used to model the self-speaker dependency based on dis + +course structures, where individual speakers resist the change of their own emotion against external influence (Ghosal et al., 2019), while the gated convolution adopts a gated mechanism to select informative cues for ERMC from dependent utterances. Similar to (Zhang et al., 2019), we take utterances as nodes of the constructed graph. Finally, a decoding module is applied to predict the emotion label for each utterance. In addition, we employ the deep sequential discourse parser developed by Shi and Huang (2019) to obtain the explicit discourse dependency trees of input conversations. + +In summary, we make the following contributions: + +- We propose a discourse-aware graph neural network for emotion recognition in multi-party conversation (ERMC). +- We devise a discourse-based relational graph convolution to exploit the self-speaker dependency of interlocutors to propagate contextual information, and further use a gated convolution to select more informative cues for ERMC from dependent utterances. +- We conduct experiments on both multi-party and two-party conversation corpora, and demonstrate that using conversational discourse structures can benefit ERMC. + +# 2 Related work + +Recently, ERC has become a new trend due to the emergence of publicly available conversational datasets collected from social media platforms and scripted situations (Busso et al., 2008; Zahiri and Choi, 2018; Poria et al., 2019a). Earlier works focus on capturing sequential context features for emotion recognition in two-party conversation. Poria et al. (2017) propose a LSTM-based network to propagate contextual information within conversations. Majumder et al. (2019) propose a recurrent-based model to track the speaker states and global context during conversations. Jiao et al. (2019) propose a hierarchical Gated Recurrent Unit (GRU) (Chung et al., 2014) structure that trains utterance-level and conversation-level encoders jointly. Ghosal et al. (2019) construct a fully connected graph within a context utterance window to aggregate information. Zhong et al. (2019) incorporate external commonsense knowledge and employ the Transformer encoder (Vaswani et al., 2017) to capture contextual information. + +For emotion recognition in multi-party conversation (ERMC), studies exert more effort in handling speaker-specific information. Zhang et al. (2019) represent the entire conversational corpus as a large graph to model speaker-sensitive dependency. Li et al. (2020) use speaker identification as an auxiliary task to capture speaker-specific features. Shen et al. (2021) propose an all-in-one XLNet (Yang et al., 2019) model with dialog-aware self-attention to deal with the multi-party structures. However, these studies neglect the informative discourse structures in multi-party conversations. To the best of our knowledge, we are the first to investigate the importance of discourse structures in handling informative contextual cues and speaker-specific features for ERMC. + +Discourse structures have been successfully applied to document-level sentiment analysis (Bhatia et al., 2015; Márkle-Huß et al., 2017; Kraus and Feuerriegel, 2019), where discourse structures are produced by Rhetorical Structure Theory (RST) parser (Li et al., 2014). Recently, Shi and Huang (2019) propose a deep sequential model for conversational discourse parsing and achieve new state-of-the-art (SOTA) results. With this model, Jia et al. (2020) transform dialogue histories into threads for multi-turn response selection. Inspired by (Xia et al., 2019) and (Zhang et al., 2020), we exploit discourse dependency links and discourse relations to construct a graph. Especially, we stack two convolutional layers to aggregate contextual and speaker-specific information of the neighborhood for each utterance in the graph. + +# 3 Methodology + +# 3.1 Problem Definition + +Suppose there are $N$ constituent utterances $u_{1}, u_{2}, \ldots, u_{N}$ from a conversation with $X(X \geqslant 2)$ speakers $s_{1}, s_{2}, \ldots, s_{X}$ . Utterance $u_{i}$ is uttered by speaker $S_{m(u_{i})}$ , where the function $m$ maps an utterance into its corresponding speaker. ERMC is to predict the emotion label for each utterance. + +# 3.2 Pre-processing + +Similar to most existing studies, the input of our model is a multi-party conversation consisting of context-independent utterance-level feature vectors. Besides, we need to obtain discourse structures to construct a graph. We complete these works in this pre-processing module. + +Utterance Encoding: Earlier works adopt the + +Convolution Neural Network (CNN) (Kim, 2014) to obtain the feature vectors for utterances. To compare with the latest model (Shen et al., 2021) based on XLNet (Yang et al., 2019), we use the BERT model (Devlin et al., 2019) to extract context-independent utterance-level feature vectors for utterances. Let an utterance $u$ consists of a sequence of tokens $x_{1}, x_{2}, \ldots, x_{N}$ . First, a special token [CLS] is appended at the beginning of the utterance to create the input sequence for the model: [CLS], $x_{1}, x_{2}, \ldots, x_{N}$ . Then, we pass the [CLS] appended utterances to BERT and extract out activations from the final four layers corresponding to the [CLS] token. Finally, these four vectors are averaged to obtain the feature vector with a dimension of 768. + +Discourse Parsing: To obtain discourse dependency trees, we utilize the discourse parser proposed by Shi and Huang (2019). It is a deep sequential model that achieves SOTA performance on the STAC corpus (Asher et al., 2016). We feed the conversations into the discourse parser: + +$$ +\{(i, j, r _ {i j}, p _ {i j}), \dots \} = \operatorname {P a r s e r} (u _ {1}, \dots , u _ {N}). \tag {1} +$$ + +The quadri-tuple $(i,j,r_{ij},p_{ij})$ are directed edges of a discourse dependency tree with head $i$ and tail $j$ , indicating that $u_{i}$ has immediate relation $r_{ij}$ with $u_{j}$ . And $p_{ij}$ is the confidence score of the dependency link. Notice that $i,j = 1,2,\ldots,N$ and $j > i$ . + +# 3.3 Model Overview + +As illustrated in Fig. 2, there are three components in our proposed framework: (1) sequential context encoding; (2) discourse graph modeling; (3) emotion recognition. In the following sections, we explain each component in detail. + +After the pre-processing, we obtain not only the dependency trees of conversations, but also the context-independent utterance-level feature vectors. Then, we use Bi-directional LSTM to transform these vectors into context-dependent ones. Next, a discourse-based graph stacks two different convolutional layers to aggregate contextual and speaker-specific information. Finally, the output feature vectors from the graph are used to recognize emotions for utterances. + +# 3.4 Sequential Context Encoding + +Similar to previous strategies, the sequential context encoder processes the constituent utterances + +![](images/64b7daff6f39f021ebd0088f68f324562e92d0bd1923c1d5e117914d53bea6df.jpg) +Figure 2: Overview of our proposed model for ERMC, congruent to the illustration in Section III. Different colors of utterances and edges respectively represent different speakers and different discourse relations. + +in a conversation as a sequence according to the timeline. Inspired by Poria et al. (2017), we use Bi-directional LSTM to capture sequential context information, + +$$ +g _ {i} = \operatorname {B i L S T M} \left(g _ {i (+, -) 1}, u _ {i}\right), \tag {2} +$$ + +where, $i = 1,2,\ldots ,N$ , $u_{i}$ and $g_{i}$ are context-independent and sequential utterance representations, respectively. + +# 3.5 Discourse Graph Modeling + +Conversational discourse structures provide a straightforward way to capture both adjacent and distant cues for ERMC. Inspired by (Xia et al., 2019) and (Zhang et al., 2020), we exploit discourse dependency trees to construct graphs to propagate contextual and speaker-specific information. The framework is detailed here. + +# 3.5.1 Graph Construction + +First, we introduce the following notation: a multiparty conversation having $\mathbf{N}$ utterances is represented as a directed graph $\mathcal{G} = (\mathcal{V},\mathcal{E},\mathcal{R},\mathcal{W})$ , with vertices/nodes $v_{i}\in \mathcal{V}$ , labeled edges (relations) $e_{ij}\in \mathcal{E}$ where $r_{ij}\in \mathcal{R}$ is the relation type of the edge between $v_{i}$ and $v_{j}$ , and $\alpha_{ij}$ is the weight of the labeled edge $e_{ij}$ , with $0\leqslant \alpha_{ij}\leqslant 1$ , where $\alpha_{ij}\in \mathcal{W}$ and $i,j = 1,2,\ldots ,N$ . The graph is constructed based on discourse dependency trees in the following way, + +Vertices: In the graph, each utterance within a multi-party conversation is represented as a vertex $v_{i} \in \mathcal{V}$ . Each vertex $v_{i}$ is initialized with the corresponding sequentially encoded representation $g_{i}$ , and $i = 1,2,\ldots ,N$ . + +Edges: Construction of the edges $\mathcal{E}$ depends on discourse dependency trees. For instance, if there is a quadri-tuple $(i,j,r_{ij},p_{ij})$ from a dependency + +tree, there would be an edge $e_{ij}$ in the graph with head $u_i$ and tail $u_j$ . As the graph is directional, $e_{ij}$ is not equivalent to $e_{ji}$ . In most cases, an utterance only depends on its historical utterances, so the direction of edges is often directed as a topological sort from earlier utterances to later ones. + +For speaker-specific information, Ghosal et al. (2019) model the emotional inertia of speakers in two-party conversations, where individual speakers resist the change of their own emotion against external influence. However, it is a challenge to incorporate discourse structures into speaker modeling for ERMC. In our model, we leverage the self-speaker dependency of interlocutors to model the emotional inertia of speakers by directly letting one utterance know whether its dependent utterance belongs to the same speaker. In Fig. 2, we use a dashed line to represent discourse dependencies between utterances from the same speaker and use a solid line to denote discourse dependencies between utterances from different speakers. + +Edge Weights: The spatial graph convolutional operation essentially propagates node information along edges (Wu et al., 2020), thus proper edge weights is helpful. In our graph model, we set the edge weights statically, + +$$ +\alpha_ {i j} = p _ {i j}, \tag {3} +$$ + +where $p_{ij}$ is the confidence score of edge $e_{ij}$ obtained from the discourse parser. + +Relations: The relation $r_{ij}$ of an edge $e_{ij}$ is set depending upon two aspects: + +Discourse relations - These relations depend on discourse dependency trees. For example, $r_{ij}$ is the discourse relation type of edge $e_{ij}$ which is the dependency link between utterance $u_i$ and $u_j$ . According to (Shi and Huang, 2019), there are + +16 types of discourse relations: Comment, Clarification question, Elaboration, Acknowledgment, Continuation, Explanation, Conditional, Question-Answer pair (QAP), Alternation, Question-Elab(Q-Elab), Result, Background, Narration, Correction, Parallel and Contrast. + +Self-speaker dependency — This relation depends upon speakers. If two utterances are from the same speaker and have discourse relation $r^q$ ( $r^q$ is one of the 16 discourse relations), we transform $r^q$ into $r^{q'}$ to model the self-speaker dependency. + +# 3.5.2 Feature Transformation + +We now describe the methodology to transform the sequentially encoded feature vectors using the graph network. After a two-step graph convolution process, the vertex representations $g_{i}$ are transformed into contextual and speaker-specific ones. + +In the first step, we consider discourse dependencies as important cues to propagate contextual and speaker-specific information. As there are many types of edges, inspired by Schlichtkrull et al. (2018), the new features $h_i^1$ of utterance $u_i$ is computed as: + +$$ +h _ {i} ^ {1} = \sigma \left(W _ {0} ^ {1} g _ {i} + \sum_ {r \in \mathcal {R}} \sum_ {j \in N _ {i} ^ {r}} \frac {\alpha_ {i j}}{c _ {i , r}} W _ {r} ^ {1} g _ {j}\right), \tag {4} +$$ + +where, $\alpha_{ij}$ is edge weight, $N_i^r$ represents the neighboring indices of node $g_i$ under relation $r\in \mathcal{R}$ . And $c_{i,r}$ is a problem specific normalization constant which is set in advance ( $c_{i,r} = |N_i^r|$ ). $\sigma$ is an activation function such as ReLU, $W_0^1$ and $W_r^1$ are trainable parameters, only edges of the same relation type $r$ are associated with the same projection weight $W_r^1$ . + +In the second step, to select more informative cues from dependent utterances, another residual gated convolutional layer (Bresson and Laurent, 2018) is applied over the output of the first step, + +$$ +h _ {i} ^ {2} = \sigma \left(W _ {0} ^ {2} h _ {i} ^ {1} + \sum_ {j \in N _ {i} ^ {r}} \eta_ {i, j} \odot W _ {1} ^ {2} h _ {j} ^ {1}\right), \tag {5} +$$ + +$$ +\eta_ {i, j} = \operatorname {s i g m o i d} \left(W _ {2} ^ {2} h _ {i} ^ {1} + W _ {3} ^ {2} h _ {j} ^ {1}\right), \tag {6} +$$ + +where $W_0^2$ , $W_1^2$ , $W_2^2$ , and $W_3^2$ are trainable parameters. This stack of graph convolutional layers effectively aggregates normalized contextual and speaker-specific information of the neighborhood for each utterance in the graph. + +# 3.6 Emotion Recognition + +After the feature transformation, we consider $h_i^2$ as the contextual and speaker-specific representations + +
DatasetConversationsUtterances
TrainValTestTrainValTest
MELD1038114280998911092610
EmoryNLP7139985993413441328
IEMOCAP1203158101623
+ +Table 1: The statistics of three datasets + +of utterances. Then, we classify each utterance using a fully connected network: + +$$ +\mathcal {P} _ {i} = \operatorname {s o f t m a x} \left(W _ {s m a x} h _ {i} ^ {2} + b _ {s m a x}\right), \tag {7} +$$ + +$$ +\hat {y} _ {i} = \underset {k} {\operatorname {a r g m a x}} \left(\mathcal {P} _ {i} [ k ]\right). \tag {8} +$$ + +To train the model, we choose the cross-entropy loss function: + +$$ +\mathcal {L} = - \sum_ {v \in y _ {\mathcal {V}}} \sum_ {z = 1} ^ {Z} Y _ {v z} \ln \mathcal {P} _ {v z}, \tag {9} +$$ + +where $y_{\nu}$ is the set of node indices that have labels and $Y$ is the label indicator matrix. + +# 4 Experimental Setting + +# 4.1 Datasets + +To verify the effectiveness of integrating discourse structures for ERMC, we evaluate our model on both multi-party and two-party conversation corpora. All these datasets contain multimodal information for each utterance within a conversation, while we only focus on the textual information in this work. Table 1 shows the corpora statistics. + +MELD (Poria et al., 2019a): A multi-party conversation corpus collected from the TV show *Friends*. Each utterance is annotated as one of the seven emotion classes: neutral, surprise, fear, sadness, joy, disgust, and anger. + +EmoryNLP (Zahiri and Choi, 2018): A multiparty conversation corpus collected from Friends, but varies from MELD in the choice of scenes and emotion labels. The emotion labels include neutral, joyful, peaceful, powerful, scared, mad, and sad. + +IEMOCAP (Busso et al., 2008): A two-party conversation corpus. The emotion labels include neutral, happiness, sadness, anger, frustrated, and excited. Since this dataset has no validation set, we follow (Shen et al., 2021) to use the last 20 dialogues in the training set for validation. + +# 4.2 Implementation Details + +We use pre-trained BERT-Base1 to encode utterances and adopt Adam (Kingma and Ba, 2015) as the optimizer with an initial learning rate of 1e-4 and L2 weight decay of 1e-5 for three datasets. The batch size is set to be {32,32,16} for MELD, EmoryNLP, and IEMOCAP respectively. The dimensions of $g_{i}$ , $h_{i}^{1}$ and $h_{i}^{2}$ are set to be 100, 64, and 64. The dropout (Srivastava et al., 2014) is set to be 0.5. We train all models for a maximum of 100 epochs and stop training if the validation loss does not decrease for 20 consecutive epochs. + +# 4.3 Baseline Methods + +For a comprehensive evaluation of our proposed ERMC-DisGCN, we compare it with the following baseline methods: + +cLSTM (Poria et al., 2017): Contextual utterance representations are generated by capturing the content from surrounding utterances using a Bi-directional LSTM network. + +DialogueRNN (Majumder et al., 2019): It is a recurrent network that uses three GRUs to track individual speaker states, global context, and emotional state within conversations. + +HiGRU (Jiao et al., 2019): It is a hierarchical GRU structure that trains utterance-level and conversation-level encoders jointly. + +ConGCN (Zhang et al., 2019): This model represents the entire conversational corpus as a large heterogeneous graph to capture context-sensitive and speaker-sensitive features. + +DialogueGCN (Ghosal et al., 2019): This is a graph-based model to encode speaker dependencies and temporal information within a window context. + +KET (Zhong et al., 2019): Enriched by the external commonsense knowledge, KET employs the Transformer encoder and decoder (Vaswani et al., 2017) for ERC. + +BERT-MTL (Li et al., 2020): It is a multi-task learning framework where features extracted from BERT are used for emotion recognition and speaker identification. + +DialogueXL (Shen et al., 2021): An all-in-one XLNet model with dialog-aware self-attention to deal with multi-party structures. + +BERT-LSTM: A variation of cLSTM where the CNN-based utterance-level feature vectors are replaced by our BERT-based feature vectors. We + +
ModelMulti-partyTwo-party
MELDEmoryNLPIEMOCAP
cLSTM56.4432.8954.95
DialogueRNN57.0331.2762.75
HiGRU56.9231.8859.79
ConGCN57.4033.52*-
DialogueGCN58.1033.85*64.18
KET58.1833.9559.56
BERT-MTL61.9034.85-
DialogueXL62.4134.7365.94
BERT-LSTM62.3434.6663.10
ERMC-GCN62.7134.9763.68
ERMC-DisGCN64.2236.3864.10
+ +Table 2: Overall performance on both multi-party and two-party conversation corpora, which is statistically significant under the paired $t$ -test (p<0.05). We use the average F1 score to evaluate each model. The scores marked by “*” are based on our re-implementation, because of the differences in datasets between the corresponding work and ours. + +consider this model as our strong baseline. + +ERMC-GCN: A variation of our approach where the graph modeling is based on the timeline of conversations. It means that there are no discourse structures in this model. + +# 5 Results and Discussions + +# 5.1 Comparison with Baseline Methods + +We compare the performance of our proposed ERMC-DisGCN framework with multiple baselines in Table 2. To verify the effectiveness of integrating discourse structures for ERMC, we conduct experiments on both multi-party and two-party conversation datasets. + +MELD and EmoryNLP: On these multi-party conversation datasets, we first report our baseline results which achieve comparable performance with the previous systems. Then, our proposed ERMC-DisGCN achieves average F1 scores of $64.22\%$ and $36.38\%$ , which are around $2\%$ better than the strong baseline. Compared to ERMC-GCN, integrating discourse structures leads to F1 improvements of around $1.5\%$ on two datasets. We attribute this gap in performance to the nature of conversations. There are many utterances, like "yeah", "okay", and "no", that can express different emotions depending on the context within conversations. In these cases, discourse structures indicate the most informative historical utterances, which contributes to emotion recognition. + +IEMOCAP: On this two-party conversation dataset, we observe the inferior performance of our + +![](images/7eef3b12db443cf6ce5148df3a70ac2d7a1a198bc5bb8fe6ba0a383361f86434.jpg) +Figure 3: The discourse dependency rate between distant utterances on three datasets. + +baseline BERT-LSTM to dialogueXL. The average conversation length is 50 utterances in IEMOCAP which is much longer than MELD and EmoryNLP, so LSTM fails to propagate rich long-term information, while DialogueXL remains the SOTA result with enhanced memory for historical context. And compared to ERMC-GCN, integrating discourse structures only leads to an F1 score increase of $0.42\%$ . In the following section, we explain the reason for different performance of integrating discourse structures in these datasets. + +# 5.2 Multi-Party vs Two-Party + +According to those results shown in Table 2, we find that integrating discourse structures in multi-party conversations leads to more significant improvements than in two-party conversations. To explain this difference, it is important to understand the nature of multi-party and two-party conversations. After examining the datasets, we report the distant dependency rate of them in Fig. 3. As we can see, discourse structures in multi-party conversations are much more complex. About $25\%$ utterances have discourse relations with distant ones in multi-party conversations, and this rate rises as conversation length increases. In MELD and EmoryNLP, there are often more than 5 interlocutors within a conversation, thus speakers' turns change quickly and one speaker may respond to another after many turns. However, in two-party conversations, the distant dependency rate is only around $11\%$ and keeps steady when conversation length increases. Since there are only two interlocutors, they tend to speak utterances cyclically, adjacent utterances are more related. From the above discussion, we can conclude that it is more necessary to exploit discourse structures to handle + +
Speaker modeling methodAverage F1 score
MELDEmoryNLP
ours (based on discourse)64.2236.38
ours (independent of discourse)63.6936.02
speaker-specific GRUs63.7436.07
speaker role embedding63.7935.98
+ +Table 3: Results of comparison between four speaker modeling approaches on the MELD and EmoryNLP datasets. + +the rich dependencies between distant utterances in multi-party conversations. + +# 5.3 Different Speaker Modeling Methods + +Previous studies have proven that capturing speaker-specific features benefits emotion recognition in conversation. In this section, we conduct experiments to answer the following two questions: (1) Is it helpful to propagate speaker information based on discourse structures? (2) Which speaker modeling method contributes most to our approach? + +We replace our self-speaker dependency modeling method with the following three methods. The first one is a variation of ours that the self-speaker dependency is modeled independently of discourse structures by directly letting one utterance know whether the adjacent one is from the same speaker. The second method is to use speaker-specific GRUs (Hazarika et al., 2018) to process the histories of each speaker which represent the individual states of speakers. The third one is speaker role embedding, which maps each interlocutor to a trainable vector (Zhang et al., 2019). These methods are all independent of discourse structures but capture different speaker-specific features. + +The results of different speaker modeling methods are shown in Table 3. We observe that the discourse-based self-speaker modeling method performs better than the independent method. This gap supports our hypothesis that the discourse dependencies between distant utterances offer informative cues for capturing speaker-specific features. So, it is necessary to integrate discourse structures into speaker modeling. Besides, although the other two methods capture different kinds of speakerspecific features, they have similar performance with our independent model. + +![](images/b887a24668b670ffd1ed941281f53a76bf17f7346c8b4d1efd22a76a2cea12b8.jpg) +Figure 4: Results of case study, where two utterances from a conversation are provided, along with their dependent historical utterances. We use green and red to highlight right and wrong predictions. The confidence scores of two dependency links are shown in the left. + +
MethodAverage F1 score
MELDEmoryNLP
ERMC-DisGCN64.2236.38
- self-speaker dependency63.45(↓ 0.77)35.88(↓ 0.50)
- gated convolution63.67(↓ 0.55)35.89(↓ 0.49)
- relational convolution63.01(↓ 1.21)35.41(↓ 0.97)
+ +Table 4: Results of ablation study on MELD and EmoryNLP. + +# 5.4 Ablation Study + +We perform an ablation study for three components of our model by removing them one by one at a time. Experimental results are shown in Table 4. First, we find that the self-speaker dependency is of significance in our model. This phenomenon is in tune with previous works that capturing speaker-specific features benefits emotion recognition in multi-party conversation, where there are often more than 5 interlocutors. By eliminating the gated convolutional layer in the graph, our model falls by $0.55\%$ on MELD and $0.49\%$ on EmoryNLP. Discourse structures only offer contextual cues, not all information from dependent utterances helps emotion recognition. Therefore, this gated convolutional layer is necessary to select informative cues in our graph modeling. Further, the relational convolutional layer successfully aggregates contextual and speaker-specific information from the neighborhood of each utterance according to edge types and makes the most contribution to our approach. + +# 5.5 Case Study + +For a comprehensive understanding of our proposed method, we visualize its performance by a case study, which is selected from the MELD test dataset. As illustrated in Fig. 4, utterance (6) is too + +short to carry rich semantic features for emotion recognition. However, its dependent utterance (3) offers an informative cue and helps make the right prediction. From the ablation study, we draw the conclusion that modeling the self-speaker dependency benefits ERMC, but it is not always the case. For instance, we observe two wrong predictions for the adjacent utterances (11) and (12), which are from the same speaker and have a discourse relation. Modeling the self-speaker dependency is hard to deal with the emotional shifts (i.e., the emotion labels of two consecutive utterances from the same speaker are different) (Poria et al., 2019a; Shen et al., 2021). Roughly, our model commits mistakes for $40\%$ of similar cases, which calls for further investigations. + +# 6 Conclusion + +In this paper, we investigate the importance of discourse structures in handling informative contextual cues and speaker-specific features for ERMC. We propose a discourse-aware graph neural network and devise two graph convolutional layers to aggregate normalized contextual and speaker-specific information for each utterance in the graph. Experimental results show that our proposed model outperforms all the baselines on all multi-party conversation datasets. Furthermore, we apply extensive analyses for the proposed model and have the following findings. First, discourse structures are more helpful for emotion recognition in multi-party conversation than in two-party conversation. Second, it is important to integrate discourse structures into speaker modeling. Third, the gated mechanism helps select more informative cues from dependent utterances for ERMC. + +In our future work, we would like to capture + +various speaker-specific features to deal with the emotional shifts. Since our method focuses on using explicit discourse structures, we also plan to employ implicit methods to avoid error propagation and address consequent issues. + +# Acknowledgments + +We thank all reviewers for their valuable comments. This work was supported by National Natural Science Foundation of China under grants 62076173, 61672211 and U1836222. + +# References + +Nicholas Asher, Julie Hunter, Mathieu Morey, Farah Benamara, and Stergos Afantenos. 2016. Discourse structure and dialogue acts in multiparty dialogue: the stac corpus. In 10th International Conference on Language Resources and Evaluation (LREC 2016), pages 2721-2727. +Parminder Bhatia, Yangfeng Ji, and Jacob Eisenstein. 2015. Better document-level sentiment analysis from RST discourse parsing. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 2212-2218, Lisbon, Portugal. Association for Computational Linguistics. +Xavier Bresson and Thomas Laurent. 2018. Residual gated graph convnets. +Carlos Busso, Murtaza Bulut, Chi-Chun Lee, Abe Kazemzadeh, Emily Mower, Samuel Kim, Jeannette N Chang, Sungbok Lee, and Shrikanth S Narayanan. 2008. Iemocap: Interactive emotional dyadic motion capture database. Language resources and evaluation, 42(4):335. +Erik Cambria, Soujanya Poria, Alexander Gelbukh, and Mike Thelwall. 2017. Sentiment analysis is a big suitcase. IEEE Intelligent Systems, 32(6):74-80. +Junyoung Chung, Caglar Gulcehre, Kyunghyun Cho, and Yoshua Bengio. 2014. Empirical evaluation of gated recurrent neural networks on sequence modeling. In NIPS 2014 Workshop on Deep Learning, December 2014. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 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, Volume 1 (Long and Short Papers), pages 4171-4186, Minneapolis, Minnesota. Association for Computational Linguistics. +Deepanway Ghosal, Navonil Majumder, Soujanya Poria, Niyati Chhaya, and Alexander Gelbukh. 2019. + +DialogueGCN: A graph convolutional neural network for emotion recognition in conversation. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 154-164, Hong Kong, China. Association for Computational Linguistics. +Devamanyu Hazarika, Soujanya Poria, Rada Mihal-cea, Erik Cambria, and Roger Zimmermann. 2018. ICON: Interactive conversational memory network for multimodal emotion detection. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2594-2604, Brussels, Belgium. Association for Computational Linguistics. +Sepp Hochreiter and Jürgen Schmidhuber. 1997. Long short-term memory. Neural computation, 9(8):1735-1780. +Qi Jia, Yizhu Liu, Siyu Ren, Kenny Zhu, and Haifeng Tang. 2020. Multi-turn response selection using dialogue dependency relations. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1911-1920, Online. Association for Computational Linguistics. +Wenxiang Jiao, Haiqin Yang, Irwin King, and Michael R Lyu. 2019. Higru: Hierarchical gated recurrent units for utterance-level emotion recognition. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 397-406. +Yoon Kim. 2014. Convolutional neural networks for sentence classification. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1746-1751, Doha, Qatar. Association for Computational Linguistics. +Diederik P Kingma and Jimmy Ba. 2015. Adam: A method for stochastic optimization. In International Conference on Learning Representations. +Mathias Kraus and Stefan Feuerriegel. 2019. Sentiment analysis based on rhetorical structure theory: Learning deep neural networks from discourse trees. Expert Systems with Applications, 118:65-79. +Jiaqi Li, Ming Liu, Zihao Zheng, Heng Zhang, Bing Qin, Min-Yen Kan, and Ting Liu. 2021. Dadgraph: A discourse-aware dialogue graph neural network for multiparty dialogue machine reading comprehension. arXiv preprint arXiv:2104.12377. +Jingye Li, Meishan Zhang, Donghong Ji, and Yijiang Liu. 2020. Multi-task learning with auxiliary speaker identification for conversational emotion recognition. arXiv e-prints, pages arXiv-2003. + +Jiwei Li, Rumeng Li, and Eduard Hovy. 2014. Recursive deep models for discourse parsing. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2061-2069, Doha, Qatar. Association for Computational Linguistics. +Navonil Majumder, Soujanya Poria, Devamanyu Hazarika, Rada Mihalcea, Alexander Gelbukh, and Erik Cambria. 2019. Dialoguernn: An attentive rnn for emotion detection in conversations. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 6818-6825. +Joscha Márkle-Huß, Stefan Feuerriegel, and Helmut Prendinger. 2017. Improving sentiment analysis with document-level semantic relationships from rhetoric discourse structures. In Proceedings of the 50th Hawaii International Conference on System Sciences. +Soujanya Poria, Erik Cambria, Devamanyu Hazarika, Navonil Majumder, Amir Zadeh, and Louis-Philippe Morency. 2017. Context-dependent sentiment analysis in user-generated videos. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 873–883, Vancouver, Canada. Association for Computational Linguistics. +Soujanya Poria, Devamanyu Hazarika, Navonil Majumder, Gautam Naik, Erik Cambria, and Rada Mihalcea. 2019a. MELD: A multimodal multi-party dataset for emotion recognition in conversations. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 527-536, Florence, Italy. Association for Computational Linguistics. +Soujanya Poria, Navonil Majumder, Rada Mihalcea, and Eduard Hovy. 2019b. Emotion recognition in conversation: Research challenges, datasets, and recent advances. IEEE Access, 7:100943-100953. +Michael Schlichtkrull, Thomas N Kipf, Peter Bloem, Rianne Van Den Berg, Ivan Titov, and Max Welling. 2018. Modeling relational data with graph convolutional networks. In European Semantic Web Conference, pages 593-607. Springer. +Weizhou Shen, Junqing Chen, Xiaojun Quan, and Zhixian Xie. 2021. Dialogxl: All-in-one xlnet for multi-party conversation emotion recognition. In Proceedings of the AAAI Conference on Artificial Intelligence. +Zhouxing Shi and Minlie Huang. 2019. A deep sequential model for discourse parsing on multi-party dialogues. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 7007-7014. +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. + +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advances in neural information processing systems, pages 5998-6008. +Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong Long, Chengqi Zhang, and S Yu Philip. 2020. A comprehensive survey on graph neural networks. IEEE Transactions on Neural Networks and Learning Systems. +Qingrong Xia, Zhenghua Li, Min Zhang, Meishan Zhang, Guohong Fu, Rui Wang, and Luo Si. 2019. Syntax-aware neural semantic role labeling. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 7305-7313. +Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Russ R Salakhutdinov, and Quoc V Le. 2019. Xlnet: Generalized autoregressive pretraining for language understanding. Advances in Neural Information Processing Systems, 32:5753-5763. +Sayyed M Zahiri and Jinho D Choi. 2018. Emotion detection on tv show transcripts with sequence-based convolutional neural networks. In *The Workshops of the Thirty-Second AAAI Conference on Artificial Intelligence*, pages 44–52. +Bo Zhang, Yue Zhang, Rui Wang, Zhenghua Li, and Min Zhang. 2020. Syntax-aware opinion role labeling with dependency graph convolutional networks. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 3249-3258, Online. Association for Computational Linguistics. +Dong Zhang, Liangqing Wu, Changlong Sun, Shoushan Li, Qiaoming Zhu, and Guodong Zhou. 2019. Modeling both context-and speaker-sensitive dependence for emotion detection in multi-speaker conversations. In *IJCAI*, pages 5415-5421. +Peixiang Zhong, Di Wang, and Chunyan Miao. 2019. Knowledge-enriched transformer for emotion detection in textual conversations. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 165-176, Hong Kong, China. Association for Computational Linguistics. \ No newline at end of file diff --git a/adiscourseawaregraphneuralnetworkforemotionrecognitioninmultipartyconversation/images.zip b/adiscourseawaregraphneuralnetworkforemotionrecognitioninmultipartyconversation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..a6a07f4250d615fae55c6d0dd3549b472a26b52d --- /dev/null +++ b/adiscourseawaregraphneuralnetworkforemotionrecognitioninmultipartyconversation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d689cf58a39aecee25ab0439d429c00a2bf8cd9c7fe83b53f1bf090b5a44cc17 +size 283271 diff --git a/adiscourseawaregraphneuralnetworkforemotionrecognitioninmultipartyconversation/layout.json b/adiscourseawaregraphneuralnetworkforemotionrecognitioninmultipartyconversation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..3f1261f1dac1541aef95dab2b5eceb9285b52310 --- /dev/null +++ b/adiscourseawaregraphneuralnetworkforemotionrecognitioninmultipartyconversation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:11538f9a498fdb0389d6533197477ddec96a7830ace9e27f6d78f6a93a8f19b8 +size 360951 diff --git a/adivideandconquerapproachformultilabelmultihoprelationdetectioninknowledgebasequestionanswering/e73efda3-6478-4e7a-8076-5436f6f73c46_content_list.json b/adivideandconquerapproachformultilabelmultihoprelationdetectioninknowledgebasequestionanswering/e73efda3-6478-4e7a-8076-5436f6f73c46_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..8d78452fab057662e2d353e154a8fed080ba7324 --- /dev/null +++ b/adivideandconquerapproachformultilabelmultihoprelationdetectioninknowledgebasequestionanswering/e73efda3-6478-4e7a-8076-5436f6f73c46_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d4f28155c89b9d0ba650cafe129422e685b49ba2303f732f93b85d889876796 +size 74969 diff --git a/adivideandconquerapproachformultilabelmultihoprelationdetectioninknowledgebasequestionanswering/e73efda3-6478-4e7a-8076-5436f6f73c46_model.json b/adivideandconquerapproachformultilabelmultihoprelationdetectioninknowledgebasequestionanswering/e73efda3-6478-4e7a-8076-5436f6f73c46_model.json new file mode 100644 index 0000000000000000000000000000000000000000..53c2775d8dd8ea58ca1e508868954f80f65a1fa0 --- /dev/null +++ b/adivideandconquerapproachformultilabelmultihoprelationdetectioninknowledgebasequestionanswering/e73efda3-6478-4e7a-8076-5436f6f73c46_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a96a2de58616af0d6da60be3cb6e0377897f98aff6bc4093486020cbd2d38ad +size 96436 diff --git a/adivideandconquerapproachformultilabelmultihoprelationdetectioninknowledgebasequestionanswering/e73efda3-6478-4e7a-8076-5436f6f73c46_origin.pdf b/adivideandconquerapproachformultilabelmultihoprelationdetectioninknowledgebasequestionanswering/e73efda3-6478-4e7a-8076-5436f6f73c46_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..02c40747c2852af50a0789fd71fbd2dc6b06689a --- /dev/null +++ b/adivideandconquerapproachformultilabelmultihoprelationdetectioninknowledgebasequestionanswering/e73efda3-6478-4e7a-8076-5436f6f73c46_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b3bb74e1b1d77a2a51c5fccc609bcc688eb6024778762233ab3a653eb2db0103 +size 577647 diff --git a/adivideandconquerapproachformultilabelmultihoprelationdetectioninknowledgebasequestionanswering/full.md b/adivideandconquerapproachformultilabelmultihoprelationdetectioninknowledgebasequestionanswering/full.md new file mode 100644 index 0000000000000000000000000000000000000000..1ff3eab8ebce3a6192c330d272495a97842a2b5f --- /dev/null +++ b/adivideandconquerapproachformultilabelmultihoprelationdetectioninknowledgebasequestionanswering/full.md @@ -0,0 +1,391 @@ +# A Divide-And-Conquer Approach for Multi-label Multi-hop Relation Detection in Knowledge Base Question Answering + +Deyu Zhou $^{1*}$ , Yanzheng Xiang $^{1}$ , Linhai Zhang $^{1}$ , Chenchen Ye $^{1}$ , Qian-Wen Zhang $^{2}$ and Yunbo Cao $^{2}$ + +$^{1}$ School of Computer Science and Engineering, Key Laboratory of Computer Network and Information Integration, Ministry of Education, Southeast University, China + +$^{2}$ Tencent Cloud Xiaowei, Beijing 100080, China + +{d.zhou, yz_xiang, lzhang472, chencheny}@seu.edu.cn, {cowenzhang, yunbocao}@tencent.com + +# Abstract + +Relation detection in knowledge base question answering, aims to identify the path(s) of relations starting from the topic entity node that is linked to the answer node in knowledge graph. Such path might consist of multiple relations, which we call multi-hop. Moreover, for a single question, there may exist multiple relation paths to the correct answer, which we call multi-label. However, most of existing approaches only detect one single path to obtain the answer without considering other correct paths, which might affect the final performance. Therefore, in this paper, we propose a novel divide-and-conquer approach for multi-label multi-hop relation detection (DC-MLMH) by decomposing it into head relation detection and conditional relation path generation. In specific, a novel path sampling mechanism is proposed to generate diverse relation paths for the inference stage. A majority-vote policy is employed to detect final KB answer. Comprehensive experiments were conducted on the FreebaseQA benchmark dataset. Experimental results show that the proposed approach not only outperforms other competitive multi-label baselines, but also has superiority over some state-of-art KBQA methods. + +# 1 Introduction + +Knowledge Graph (KG), an important form of structured human knowledge by organizing atomic facts in the triple format, i.e., (head, relation, tail), attracts more and more researchers. However, the ever-growing knowledge graphs make it extremely hard for users to access the information efficiently. To address this issue, Question Answering over Knowledge Base (KBQA) was proposed (Berant et al., 2013; Bordes et al., 2015; Bast and Haussmann, 2015; Yin et al., 2016; Hao et al., 2018). A KBQA system often consists of two core components: (1) entity linking, which identifies the topic + +![](images/657c27e9167618d592d0dda1e30b63887221c04477c4f9ca2143d7d95ea29c69.jpg) +Figure 1: Example of relation paths corresponding to different questions. + +entities mentioned in the question and links them to the entity nodes in the KG; (2) relation detection, which extracts the relation paths starting from the topic entity to the answer node based on the question. In this paper, we mainly focus on the second task. + +Based on the numbers (hops) of KG triples required to obtain the answer, relation detection methods can be divided into two categories (Qiu et al., 2020), single-hop relation detection and multi-hop relation detection. For single-hop relation detection, only one triple is needed to answer the question. For instance, answering the question "Where is New York?" relies on the KB triple . For multi-hop relation detection, more than one triples are needed to answer the question correctly. For example, to answer the question "When is the birthday of the author of Harry Potter", two KB triples and are needed. + +Most of relation detection approaches mentioned above aim to find one single relation path to answer the question. However, for some complex questions, there might exist multiple paths in the KG leading to the correct answer. As shown in Figure 1, given the question "Who is the granddaughter of Queen Elizabeth and George VI?", there + +are exactly eight relation paths to the final answer "Anne". Two main reasons might contribute to the multiple relation paths: (1) Multiple topic entities, both 'Queen Elizabeth' and 'George VI' are topic entities which leads to different relation paths. (2) Diverse paths between nodes in the KG, due to the complex structure of the KG. + +Obviously, performing multiple relation paths detection will make the answer prediction more robust. Therefore, in this paper, relation detection in KBQA is cast into multi-label (paths) learning. However, it is not straightforward to detect multiple relation paths with multiple hops since (1) the number of paths (label number) and the length of each path (hop number) are unfixed. (2) the number of valid relation paths (label space) is extremely large due to the exponential growth of relation combination. + +To deal with the above challenges, a novel divide-and-conquer approach for multi-label multi-hop relation detection (DC-MLMH) is proposed by decomposing the problem into two sub-problems: (1) head relation detection, which is formulated as multi-label classification since multiple topic entities lead to diverse paths by choosing different head relations. A hybrid attention mechanism is proposed to capture semantic information in both the relations and question texts. (2) conditional relation path generation, long short-term memory network (LSTM) with attention is adopted to generate the entire path under the condition of a given head relation, and capture the order between the relations in the path. Moreover, in order to generate relations paths diversely, a path sampling mechanism is proposed to incorporate uncertainty into the neural network in the inference stage. Therefore, the number of paths and the length of the paths are dynamically determined and relation paths can be generated independently and diversely. Furthermore, the answer detection policy based on majority-vote is proposed to obtain the final answer from the multiple generated relation paths. + +In summary, the main contributions of this paper are listed as follows: + +- A novel divide-and-conquer approach for multi-label multi-hop relation detection (DCMLMH) is proposed by decomposing it into head relation detection and conditional relation path generation. As far as we know, we are the first to tackle the detection of multiple relation paths with different lengths. + +- A novel path sampling mechanism is proposed to generate diverse relation paths in the inference stage where the number of paths and the length of each path is determined dynamically. Moreover, a majority-vote policy is employed to detect final KB answer. +- Experimental results on the benchmark dataset FreebaseQA show that the proposed approach outperforms other competitive multi-label baselines. It also has superiority over some state-of-art KBQA methods. + +# 2 Related Work + +Our work is related to two lines of research, relation detection in KBQA and multi-label learning. + +# 2.1 Relation Detection in KBQA + +There are two mainstream branches of relation detection in KBQA (Fu et al., 2020): information retrieval-based and neural semantic parsing-based, which can be further categorized into single-relation (one-hop) detection and multi-relation (multi-hop) detection (Yin et al., 2016). + +For single-relation detection, most existing approaches (Yin et al., 2016; Dai et al., 2016; Yu et al., 2017; Lukovnikov et al., 2017; Hao et al., 2018; Yu et al., 2018) embedded questions and candidate relations into the same space and calculated the semantic similarity between the questions and the candidate relations in KBs. For example, (Golub and He, 2016) propose an encoder-decoder based generative framework for relation detection, (Zhang et al., 2021) propose a end-to-end KBQA model based on Bayesian Neural Network (BNN) to estimate uncertainties arose from both model and data. + +For multi-relation detection, some approaches (Yih et al., 2015; Yu et al., 2017, 2018) incorporated a constraint detection mechanism to deal with two or three-relation detection tasks. The drawback of such methods is that the number of hops is generally strictly restricted. (Chen et al., 2019) proposed UHop, an unrestricted-hop framework which doesn't need predefined maximum hop number. (Bordes et al., 2014a,b) constructed the topic-entity-centric subgraph for each question and retrieved answers by ranking the semantic similarity between the question embedding and entity embedding in the subgraph. Such methods suffer from high time complexity as the whole subgraph for + +each question is considered. However, all the aforementioned approaches ignore that for some complex questions, there might exist multiple relation paths leading to the correct answer. + +# 2.2 Multi-label Learning in NLP + +Multi-label Learning (MLL) approaches can be categorized into the following types: (1) problem transformation methods (Boutell et al., 2004; Read et al., 2011) which transforming MLL into other well-established tasks; (2) algorithm adaptation approaches (Zhang and Zhou, 2007; Ghamrawi and McCallum, 2005) that adapt the existing algorithms to tackle MLL data; (3) deep learning based methods (Nam et al., 2017; Yang et al., 2018; Peng et al., 2019) which exploit deep neural networks to extract high-level features and capture label correlations. + +MLL has been applied to multiple crucial tasks in the area of Natural Language Processing (NLP) including question answering (Usbeck et al., 2017), information retrieval (Gopal and Yang, 2010; Jiang et al., 2016), emotion classification (Yang et al., 2019) and so on. + +Unlike traditional MLL methods where the label set is fixed, the proposed approach needs to predict the relation path (label) which might not exist in the set of relation paths (label set) in the training data. + +# 3 Methodology + +# 3.1 Problem Setting + +In this paper, a KG is represented as $\mathcal{G} = \{\mathcal{E},\mathcal{R},\mathcal{F}\}$ , where $\mathcal{E}$ , $\mathcal{R}$ and $\mathcal{F}$ are set of entities, relations and facts. A fact is denoted as a triple $\{e_s,r,e_o\} \in \mathcal{F}$ . + +Given a natural language question $q = \{w_{1}, w_{2}, \dots, w_{n}\}$ and the knowledge graph $\mathcal{G}$ , the KBQA task is to detect the relation paths which link the topic entity mentioned in $q$ to the answer node in $\mathcal{G}$ . In this paper, we consider multi-label multi-hop relation detection which aims at finding a path set $\mathbb{P}$ rather than a single path $p_{i}$ : + +$$ +\mathbb {P} = \left\{p _ {1}, \dots , p _ {i}, \dots , p _ {m} \right\} \tag {1} +$$ + +$$ +p _ {i} = \{r _ {1} ^ {i}, \dots , r _ {j} ^ {i}, \dots , r _ {l _ {i}} ^ {i} | r _ {j} ^ {i} \in \mathcal {R} \} +$$ + +# 3.2 The Architecture + +In this section, we introduce the proposed divide and conquer approach for multi-label multi-hop relation detection (DC-MLMH) in details. + +# 3.2.1 Overview + +Multi-label multi-hop relation detection can be regarded as a sequence generation problem. We adopt a divide-and-conquer strategy and decompose it into two sub-problems: head relation detection and conditional relation path generation. The object of head relation detection is to detect a set of head relations $\mathbb{R}_{head}$ . Then the conditional path generation generates the entire relation path $p_i\in \mathbb{P}$ for each head relation $r_{head}^{i}\in \mathbb{R}_{head}$ : + +$$ +\mathbb {R} _ {\text {h e a d}} = \{r _ {1}, \dots , r _ {i}, \dots , r _ {h} | r _ {i} \in \mathcal {R} \} +$$ + +$$ +p _ {i} \left| r _ {\text {h e a d}} ^ {i} = \left(r _ {\text {h e a d}} ^ {i}, r _ {2} ^ {i}, \dots , r _ {j} ^ {i}, \dots , r _ {l _ {i}} ^ {i} \right| r _ {j} ^ {i} \in \mathcal {R} \right. \tag {2} +$$ + +$$ +, r _ {h e a d} ^ {\iota} \in \mathbb {R} _ {h e a d}) +$$ + +The architecture of the proposed divide and conquer approach for multi-label multi-hop relation detection (DC-MLMH) is shown in Figure 2. It consists of three components, (1) BERT (Devlin et al., 2018) encoder, which is shared by the following two components; (2) Head relation detection, head-relation distribution over relation space $\mathcal{R}$ is predicted. A Hybrid-attention mechanism is proposed to capture the semantic information in question and relation texts; (3) Conditional relation path generation, LSTM is adopted to generate the relation path sequentially. + +Besides, In order to increase the diversity of generated paths, we propose a novel path sampling mechanism to incorporate uncertainty into the neural network in the inference stage. Therefore, relation paths can be generated diversely and independently. + +# 3.2.2 Head Relation Detection + +As mentioned above, one of the main reasons for multiple relation paths is that the question might contain different topic entities. Therefore, the relation paths might comprise multiple head relations focusing on different components of question texts and topic entities. + +We leverage BERT (Devlin et al., 2018) to encode question text. The final hidden state vector $H \in \mathbb{R}^{n \times d}$ is served as the representation of the question context. A hybrid attention mechanism is proposed to capture relation-specific parts of the question for each relation. + +Relation Attention Mechanism Relations are represented as a trainable embedding matrix $C \in \mathbb{R}^{|V| \times k}$ where $|V|$ is the size of relation vocabulary and $k$ is the dimension of the embedding vector. + +![](images/61fc248318a08601d49132493555987b958109a8b1362aaa09d61d4c773641be.jpg) +Figure 2: The architecture of the proposed divide-and-conquer approach where head relation distribution is obtained by the head relation detection module and the whole path is generated in the conditional relation path generation module. The training process is in the upper part of the figure while the inference process with the proposed path sampling is in the lower part of the figure. + +Each relation embedding is initialized using the bag-of-words representation of the text of the relation: + +$$ +C _ {t} = \sum_ {i = 1} ^ {n _ {t}} e _ {i} ^ {t} \tag {3} +$$ + +where $n_t$ is the number of the words in the t-th relation text and $e_i^t$ is the i-th word of the t-th relation text retrieved from pre-trained Glove embeddings (Pennington et al., 2014). + +We can explicitly determine the semantic relevance between each pair of word and relation by calculating the dot product between word and relation vectors: + +$$ +A _ {r} = s o f t m a x (C W _ {1} H ^ {T}) \qquad (4) +$$ + +where $W_{1}$ is weight parameter to convert the two vectors into the same dimension and $A_{r} \in \mathbb{R}^{|V| \times n}$ indicates the semantic similarity distribution between words and relations (For simplicity, all bias terms are omitted in this paper). Relation-aware representation $M_{r} \in \mathbb{R}^{|V| \times d}$ is constructed through linear combination of question tokens for all relations: + +$$ +M _ {r} = A _ {r} H \tag {5} +$$ + +Self-Attention Mechanism Different relations have diverse semantic relevance to the different + +part of the question (Xiao et al., 2019). Therefore, self-attention mechanism (Lin et al., 2017) is adopted to determine the different components of question texts for each relation. The self-attention matrix $A_{s}\in \mathbb{R}^{|V|\times n}$ can be calculated as follows: + +$$ +A _ {s} = \operatorname {s o f t m a x} \left(W _ {3} \tanh \left(W _ {2} H ^ {T}\right)\right) \tag {6} +$$ + +where $W_{2}$ , $W_{3}$ are self-attention parameters. The i-th row of $A_{s}$ can be considered as the weight distribution of the question tokens over the i-th relation. + +Similar to relation-aware representation, selfattention representation $M_{s}\in \mathbb{R}^{|V|\times d}$ is constructed as: + +$$ +M _ {s} = A _ {s} H \tag {7} +$$ + +Relation-specific question representation $M_{all} \in \mathbb{R}^{|V| \times 2d}$ is obtained by simply concatenate the two representations: + +$$ +M _ {a l l} = \left[ M _ {s}; M _ {r} \right] \tag {8} +$$ + +The probability of each relation to be the head relation can be calculated via: + +$$ +\bar {y} ^ {\text {h e a d}} = \operatorname {s i g m o i d} \left(M _ {\text {a l l}} W _ {4}\right) \tag {9} +$$ + +where $W_{4}$ is weight parameter of the fully connected layer and sigmoid is used as activation function. + +Cross-entropy loss $\mathcal{L}_1$ is adopted as the loss function for multi-label text classification following the same way as (Nam et al., 2014): + +$$ +\begin{array}{l} \mathcal {L} _ {1} = - \sum_ {i = 1} ^ {N} \sum_ {j = 1} ^ {| V |} \left(y _ {i j} \log \left(\vec {y} _ {i j} ^ {\text {h e a d}}\right)\right) \tag {10} \\ + (1 - y _ {i j}) (1 - l o g (\vec {y} _ {i j} ^ {\mathit {h e a d}})) \\ \end{array} +$$ + +where $N$ is the number of questions, $|V|$ is the size of relation vocabulary, $y_{ij} \in \{0,1\}$ is the ground truth of the i-th question over j-th relation and $\vec{y}_{ij}^{head} \in [0,1]$ is the predicted probability. + +# 3.2.3 Conditional Relation Path Generation + +The remaining sequence of the path under the condition of the head relation is generated through conditional relation path generation module. It consists of a BERT encoder shared with the head relation detection module and a decoder. An attention mechanism is employed to decide the different parts of the question text in the each step of the conditional relation path generation process. The attention weight $\alpha_{tj}$ assigned to the j-th token in the t-th step is computed as follows: + +$$ +e _ {t j} = V _ {a} \tanh \left(W _ {a} \left[ s _ {t - 1}; H _ {j} \right]\right) \tag {11} +$$ + +$$ +\alpha_ {t j} = \frac {e _ {t j}}{\sum_ {i = 1} ^ {n} e _ {t i}} \tag {12} +$$ + +where $W_{a},V_{a}$ are parameters and $s_{t - 1}$ is the hidden state of the decoder at time step $t - 1$ . Finally, the context input of the decoder at time step $t$ is computed as the weighted sum of question tokens: + +$$ +c _ {t} = \sum_ {i = 1} ^ {n} \alpha_ {t i} H _ {i} \tag {13} +$$ + +LSTM (Hochreiter and Schmidhuber, 1997) is employed to generate relation paths sequentially. It can capture the correlations between relations. + +The input format of decoder is: + +$$ +\left\{R _ {\text {h e a d}}, R _ {2}, \dots , R _ {l}, [ E N D ] \right\} \tag {14} +$$ + +where $l$ represents the length of the input relation path and the first input $R_{head}$ is the head relation of the path rather than a "[BOS)". It is obtained in + +head relation detection module. The hidden state $s_t$ at time $t$ is calculated by: + +$$ +s _ {t} = L S T M \left(s _ {t - 1}, \left[ c _ {t}; r _ {t - 1} \right]\right) \tag {15} +$$ + +where $r_{t - 1}$ is the embedding of the relation predicted at time step $t - 1$ + +The relation probability distribution $\vec{y}_t$ over relation space at time step $t$ is computed as follows: + +$$ +\vec {y} _ {t} = \operatorname {s o f t m a x} \left(\tanh \left(W _ {5} s _ {t}\right)\right) \tag {16} +$$ + +where $W_{5}$ is weight parameter. The training loss of the conditional relation path generation module $\mathcal{L}_2$ can be calculated the same as the head relation detection module. The total loss function $\mathcal{L}$ is the sum of the loss functions of the two modules: + +$$ +\mathcal {L} = \mathcal {L} _ {1} + \mathcal {L} _ {2} \tag {17} +$$ + +# 3.3 Training and Inference + +As shown in the upper part of Figure 2, the ground-truth head relations and relation paths are employed to train the DH-MLMH model. The ground truth paths of a question refer to the relation paths that exist between the topic-entity nodes of the question and the answer-entity node in the KG. In our proposed approach, relation detection is regarded as a sequence generation task. Traditional methods generate sequences by searching over output sequences greedily or with beam search. Even with these mechanisms, the model is still insufficient to generate diverse sequence outputs. In the inference stage, we propose a novel path sampling mechanism to incorporate uncertainty into the neural network that can generate relation paths diversely and independently. The number of paths for each question and the length of the paths are determined dynamically. + +Path Sampling Mechanism The process of path sampling mechanism is illustrated in Algorithm 1. The probability of each relation to be the head relation is calculated using (9). We set the threshold to 0.5 to filter the relations and normalize the probability of the remaining ones to form a multinomial distribution $\vec{\theta}_{head}$ . A randomly-sampled head relation $r_{head}$ is chosen as the first input of the decoder. Then, the remaining path is generated cyclically through the decoder. At the t-th step of the path generation process, the relation probability distribution can be obtained via (16). Due to the large relation space, we select the top-k highest + +# Algorithm 1 Path sampling mechanism. + +# Input: Question $q$ , sampling times $T$ + +# Output: Predicted path set $\mathbb{P}$ + +1: $\mathbb{P}\gets \emptyset$ +2: for $i \gets 1$ ; $i \leq T$ ; $i + +$ do +3: Relation Sequence $R \gets ()$ +4: Calculate the probability for each relation becoming the head relation (9) and construct the multinomial distribution $\vec{\theta}_{\text{head}}$ . +5: Sample a head relation $r_{head}$ from $\bar{\theta}_{head}$ . +6: $R\gets R + r_{head}$ +7: $r_t \gets r_{head}$ +8: while $r_t \neq [END]$ do +9: Input $r_t$ into the decoder and calculate the current relation probability distribution $\vec{y}_t$ (16). Choosing top-K highest probability relations to form $\theta_t$ . +10: Sample a relation $r_g$ from $\theta_t$ . +11: $R\gets R + r_{g}$ +12: $r_t\gets r_g$ +13: end while +14: $\mathbb{P}\gets \mathbb{P}\cup \{R\}$ +15: end for +16: return $\mathbb{P}$ + +probability relations for normalization to form a new multinomial distribution $\vec{\theta}_t$ , thereby avoiding the introduction of noise. A relation $r_t$ is sampled from the relation probability distribution $\vec{\theta}_t$ which is taken as the input for t+1-th step. The process ends until "[END]" is generated and these generated relations make up a path. The length of paths can be determined according to the KG structure information learned by the decoder. The times of sampling $T$ is a hyperparameter which can be set randomly. The final path set $\mathbb{P}$ is generated and the number of paths can be determined through the path sampling process. + +It should be noted that the same path might appear multiple times in $\mathbb{P}$ . However, such duplicated paths are not removed as the more occurrences, the more likely it is to be an answer relation path. + +# 3.4 Multi-label Relation Detection-based KBQA + +In order to obtain the final answer in the KG. entitylinking is adopted to link the topic entities mentioned in the question with the corresponding entity nodes in the KG. Besides, a majority-vote (MV) policy is designed to integrate the results of entitylinking and relation detection. + +Entity Linking Entity linking associates the topic entities with the KG entity nodes. Following the previous approaches (Lukovnikov et al., 2017; Mohammed et al., 2018), the entity linking task is formulated as a fuzzy string matching problem. For each topic entity in the corpus, the matching score between it and each entity in the KG is calculated based on Levenshtein distance. We rank the matching scores and the top k entities form the set of the candidate entities $\mathbb{E}$ . + +Majority-Vote Path set $\mathbb{P}$ and candidate entity set $\mathbb{E}$ can be obtained after relation detection and entity linking. We search for candidate answers in the KG using all the entity-relation pairs. The candidate answer appearing the most times will be selected as the final answer. Based on the majority vote strategy, the negative effects of some noise paths and entities are alleviated. + +# 4 Experiment + +In order to evaluate the proposed approach, we conduct experiments on the benchmark dataset FreebaseQA (Jiang et al., 2019). + +# 4.1 Dataset + +
Data setTotalTrainDevEval
FreebaseQA283482035839943996
+ +Table 1: Statistics of the FreebaseQA dataset. + +FreebaseQA contains 28K unique questions in total. The basic statistics are shown in Table 1. It is created by matching the trivia-type question-answer pairs with head-relation-tail triples in Freebase knowledge graph (Bollacker et al., 2008). FreebaseQA provides many linguistically sophisticated questions. Jiang et al. demonstrate that it is a more difficult KBQA task than WebQSP (Berant et al., 2013) and SimpleQuestions (Bordes et al., 2015). + +In addition, FreebaseQA dataset provides multiple relation paths with up to two hops for each question as shown in Table 2. As far as we know, it is the only dataset annotated with multiple relation paths. + +# 4.2 Parameter Settings + +BERT-base-uncased (12 layers, 768 hidden dimensions, and 12 attention heads) released by Google is adopted as our encoder. We use pre-trained Glove + +
Num of pathsNum of questionsproportion
N = 11606556.7%
N = 2684224.1%
N = 3290810.3%
N = 412354.4%
N ≥ 512984.5%
+ +Table 2: Statistics of the number of paths in the FreebaseQA dataset. + +word embeddings of size 300 to initialize relation matrix. For LSTM decoder, the hidden state dimension is set to 512. The whole model is trained by the Adam optimizer (Kingma and Ba, 2014) with a learning rate of 1e-5, 1e-4 for BERT encoder and other modules respectively. The number of epochs is 10 and the mini-batch size of the input is set at 16. The parameters are chosen based on the evaluation results from dev dataset. + +# 4.3 Multi Relation Detection Task + +Baselines As the proposed approach aims to multiple relation paths detection, the following competitive multi-label classification approaches are chosen baselines: + +- MLKNN (Zhang and Zhou, 2007): K-Nearest Neighbors are found for each unseen instance, then maximum a posteriori (MAP) principle is adopted to predict the label set based on the statistic information learned from the label sets of the neighbors. +- CNN (Kim, 2014): Convolutional neural network is employed to extract text features, and linear layer with the sigmoid function is to calculate the probability of each label. +- HAN (Yang et al., 2016): a hierarchical structure network with word-level and sentence-level attention mechanism for document classification. +- SGM (Yang et al., 2018): a Seq2Seq model with a decoder structure to capture the correlations between labels. We further replace the RNN encoder with BERT encoder (BERT-SGM) for fair comparison as BERT encoder is employed in our approach. + +Evaluation Metrics Following the previous work (Yang et al., 2018; Zhang and Zhou, 2007), + +hamming loss and micro- $F_{1}$ score are adopted as the evaluation metrics. + +- Hamming Loss (Schapire and Singer, 1999): It denotes the fraction of misclassified labels, where the relevant label is missed or the irrelevant label is predicted. +- Micro- $F_{1}$ (Schütze et al., 2008): It is an aggregated metric considering both the precision and recall for all classes. + +Results Results of different multi-relation detection approaches on FreebaseQA benchmark are listed in Table 3. To further analysis the effectiveness of the hybrid attention mechanism, the proposed DC-MLMH model is modified to DCMLMH-SELF by removing the relation-attention mechanism from DC-MLMH, to DC-MLMH-RELA by removing the self-attention mechanism from DC-MLMH. The sampling times for DCMLMH-SELF-100, DC-MLMH-RELA-100 and DC-MLMH-100 are set to 100 while for DCMLMH-5, the times of sampling are set to 5. + +It can be summarized from the table that: (1) our proposed DC-MLMH and the two modifications outperform all baselines by a large margin on Micro- $F_{1}$ and recall score. Compared to BERT-SGM, DC-MLMH-100 achieves an improvement of $16.4\%$ Micro- $F_{1}$ score and $36.5\%$ recall which demonstrate that the proposed path sampling mechanism can effectively detect diverse relation paths. (2) Compared with DC-MLMH-100, DC-MLMH-5 achieves an improvement of $6.8\%$ precision and a reduction of $2.5\%$ hamming loss, but its recall and Micro-F1 drop by $19.4\%$ and $7.9\%$ . It means that as the times of sampling increases, our approach can detect more diverse paths. Although there is a slight decrease in precision, the improvement in recall is huge. (3) DC-MLMH-SELF-100 and DC-MLMH-RELA-100 perform worse than DC-MLMH-100 which proves the effectiveness of the two proposed attention mechanisms. + +# 4.4 Knowledge Based Question Answering Task + +A complete KBQA system includes Entity-linking and Relation Detection. We perform a simple entity-linking and measure the performance of our proposed method by reasoning in the KG to find final answers with the detected relation paths. + +
MethodsPrecision(↑)Recall(↑)Micro F1(↑)HL(×10-4)(↓)
MLKNN0.53270.32870.40661.4049
CNN0.51580.39520.44751.4285
HAN0.49650.42540.45821.4728
SGM0.50390.39760.44451.4549
BERT-SGM0.59920.43720.50561.2437
DC-MLMH-SELF-1000.54310.55790.55041.3340
DC-MLMH-RELA-1000.52680.55050.53841.3817
DC-MLMH-50.61990.48100.54171.1913
DC-MLMH-1000.58030.59660.58831.2219
+ +Baselines Two approaches are chosen as the baselines: + +- FOFE-net (Jiang et al., 2019): A pipeline KBQA system built based on FOFE-net (Zhang et al., 2015) which achieves the outstanding results on both SimpleQuestions and WebQSP datasets. +- BERT-SGM: a multi-label method mentioned above. + +Evaluation Metrics We evaluate the quality of the KBQA systems based on accuracy of the predicted answers. The quality of entity-linking is evaluated based on recall which refers to the fraction of the correct topic entities that included in the candidate entities. + +Table 3: Performance comparison of multi-label methods on relation detection. SELF denotes self-attention mechanism, RELA denotes Relation attention mechanism. "HL" represents Hamming loss. $(\uparrow)$ represents "the larger the better" while $(\downarrow)$ is the opposite. + +
KRecall
250.7640
500.8168
1000.8694
2000.8994
5000.9331
+ +Results We create an inverted index for the entities of the FB5M (Petrochuk and Zettlemoyer, 2018), and top $K$ entities sorted by Levenshtein Distance are considered as candidate entities. Table 4 shows the result of entity-linking. As $K$ increases, the recall continues to increase with more noisy entities. + +Table 4: Results of entity linking. + +
MethodAccuracy
FOFE-net37.0%
BERT-SGM-GT38.9%
DC-MLMH-EL37.7%
DC-MLMH-GT47.5%
DC-MLMH-GT-SP35.4%
+ +Table 5: Knowledge based question answering results of different approaches on FreebaseQA test set. + +Table 5 shows the performance of different KBQA systems. "EL" means using the results of entity-linking while "GT" represents using ground truth entities to find answers, "SP" means only considering one single path to obtain the final KB answer. It can be observed that DC-MLMH-GT outperforms BERT-SGM-GT with a large margin. Although noises and errors are introduced in the entity-linking stage, DC-MLMH-EL which K is set to 25 in entity-linking still has superiority over FOFE-net. + +To further explore whether multi-label relation detection has superiority than single-label relation detection, only one of the generated relations paths and the ground-truth entities (DC-MLMH-GT-SP) is employed to find the final KB answer. It can be observed that the accuracy of DC-MLMH-GT-SP is lower by $25.5\%$ compared to DC-MLMH-GT which uses all the generated relation paths to find the answer. It shows that multi-label multi-hop relation detection indeed improves the performance of KBQA. + +# 5 Conclusion + +In this paper, a divide-and-conquer multi-label multi-hop relation detection approach is proposed. In specific, relation detection is decomposed into two steps: head-relation detection and conditional relation-path generation. A novel path sampling mechanism is proposed to incorporate uncertainty into the neural network and generate diverse paths independently in the inference stage. A Majority-Vote policy is employed to integrate the entity-linking and multi-label multi-hop relation detection results to obtain the final answer. Experimental results on the FreebaseQA benchmark dataset show that the proposed method outperforms other competitive multi-label baselines. It also achieves superiority over some state-of-art KBQA methods. + +# Acknowledgements + +We would like to thank anonymous reviewers for their valuable comments and helpful suggestions and we thank Tencent for supporting this project. This work was funded by the National Natural Science Foundation of China (61772132). + +# References + +Hannah Bast and Elmar Haussmann. 2015. More accurate question answering on freebase. In Proceedings of the 24th ACM International on Conference on Information and Knowledge Management, CIKM '15, page 1431-1440, New York, NY, USA. Association for Computing Machinery. +Jonathan Berant, Andrew Chou, Roy Frostig, and Percy Liang. 2013. Semantic parsing on Freebase from question-answer pairs. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 1533-1544, Seattle, Washington, USA. Association for Computational Linguistics. +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 international conference on Management of data, pages 1247-1250. +Antoine Bordes, Sumit Chopra, and Jason Weston. 2014a. Question answering with subgraph embeddings. arXiv preprint arXiv:1406.3676. +Antoine Bordes, Nicolas Usunier, Sumit Chopra, and Jason Weston. 2015. Large-scale simple question answering with memory networks. arXiv preprint arXiv:1506.02075. + +Antoine Bordes, Jason Weston, and Nicolas Usunier. 2014b. Open question answering with weakly supervised embedding models. In Joint European conference on machine learning and knowledge discovery in databases, pages 165-180. Springer. +Matthew R Boutell, Jiebo Luo, Xipeng Shen, and Christopher M Brown. 2004. Learning multi-label scene classification. Pattern recognition, 37(9):1757-1771. +Zi-Yuan Chen, Chih-Hung Chang, Yi-Pei Chen, Ji-jnasa Nayak, and Lun-Wei Ku. 2019. Uhop: An unrestricted-hop relation extraction framework for knowledge-based question answering. arXiv preprint arXiv:1904.01246. +Zihang Dai, Lei Li, and Wei Xu. 2016. Cfo: Conditional focused neural question answering with large-scale knowledge bases. arXiv preprint arXiv:1606.01994. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805. +Bin Fu, Yunqi Qiu, Chengguang Tang, Yang Li, Haiyang Yu, and Jian Sun. 2020. A survey on complex question answering over knowledge base: Recent advances and challenges. arXiv preprint arXiv:2007.13069. +Nadia Ghamrawi and Andrew McCallum. 2005. Collective multi-label classification. In Proceedings of the 14th ACM international conference on Information and knowledge management, pages 195-200. +David Golub and Xiaodong He. 2016. Character-level question answering with attention. arXiv preprint arXiv:1604.00727. +Siddharth Gopal and Yiming Yang. 2010. Multilabel classification with meta-level features. In Proceedings of the 33rd international ACM SIGIR conference on Research and development in information retrieval, pages 315-322. +Yanchao Hao, Hao Liu, Shizhu He, Kang Liu, and Jun Zhao. 2018. Pattern-revising enhanced simple question answering over knowledge bases. In Proceedings of the 27th International Conference on Computational Linguistics, pages 3272-3282. +Sepp Hochreiter and Jürgen Schmidhuber. 1997. Long short-term memory. Neural computation, 9(8):1735-1780. +Kelvin Jiang, Dekun Wu, and Hui Jiang. 2019. FreebaseQA: A new factoid QA data set matchingTrivia-style question-answer pairs with Freebase. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 318-323, Minneapolis, Minnesota. Association for Computational Linguistics. + +Xiaotian Jiang, Quan Wang, Peng Li, and Bin Wang. 2016. Relation extraction with multi-instance multi-label convolutional neural networks. In Proceedings of COLING 2016, the 26th International Conference on Computational Linguistics: Technical Papers, pages 1471-1480. +Yoon Kim. 2014. Convolutional neural networks for sentence classification. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1746-1751, Doha, Qatar. Association for Computational Linguistics. +Diederik P Kingma and Jimmy Ba. 2014. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980. +Zhouhan Lin, Minwei Feng, Cicero Nogueira dos Santos, Mo Yu, Bing Xiang, Bowen Zhou, and Yoshua Bengio. 2017. A structured self-attentive sentence embedding. arXiv preprint arXiv:1703.03130. +Denis Lukovnikov, Asja Fischer, Jens Lehmann, and Soren Auer. 2017. Neural network-based question answering over knowledge graphs on word and character level. In Proceedings of the 26th international conference on World Wide Web, pages 1211-1220. +Salman Mohammed, Peng Shi, and Jimmy Lin. 2018. Strong baselines for simple question answering over knowledge graphs with and without neural networks. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), pages 291-296, New Orleans, Louisiana. Association for Computational Linguistics. +Jinseok Nam, Jungi Kim, Eneldo Loza Mencia, Iryna Gurevych, and Johannes Furnkranz. 2014. Large-scale multi-label text classification—revisiting neural networks. In Joint European conference on machine learning and knowledge discovery in databases, pages 437-452. Springer. +Jinseok Nam, Enaldo Loza Mencia, Hyunwoo J Kim, and Johannes Furnkranz. 2017. Maximizing subset accuracy with recurrent neural networks in multi-label classification. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 5419-5429. +Hao Peng, Jianxin Li, Senzhang Wang, Lihong Wang, Qiran Gong, Renyu Yang, Bo Li, Philip Yu, and Lifang He. 2019. Hierarchical taxonomy-aware and attentional graph capsule rcnns for large-scale multi-label text classification. IEEE Transactions on Knowledge and Data Engineering. +Jeffrey Pennington, Richard Socher, and Christopher D Manning. 2014. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pages 1532-1543. + +Michael Petrochuk and Luke Zettlemoyer. 2018. Simplequestions nearly solved: A new upper-bound and baseline approach. arXiv preprint arXiv:1804.08798. +Yunqi Qiu, Yuanzhuo Wang, Xiaolong Jin, and Kun Zhang. 2020. Stepwise reasoning for multi-relation question answering over knowledge graph with weak supervision. In Proceedings of the 13th International Conference on Web Search and Data Mining, pages 474-482. +Jesse Read, Bernhard Pfahringer, Geoff Holmes, and Eibe Frank. 2011. Classifier chains for multi-label classification. Machine learning, 85(3):333. +Robert E Schapire and Yoram Singer. 1999. Improved boosting algorithms using confidence-rated predictions. Machine learning, 37(3):297-336. +Hinrich Schütze, Christopher D Manning, and Prabhakar Raghavan. 2008. Introduction to information retrieval, volume 39. Cambridge University Press Cambridge. +Ricardo Usbeck, Michael Hoffmann, Michael Röder, Jens Lehmann, and Axel-Cyrille Ngonga Ngomo. 2017. Using multi-label classification for improved question answering. arXiv preprint arXiv:1710.08634. +Lin Xiao, Xin Huang, Boli Chen, and Liping Jing. 2019. Label-specific document representation for multi-label text classification. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 466-475. +Pengcheng Yang, Xu Sun, Wei Li, Shuming Ma, Wei Wu, and Houfeng Wang. 2018. Sgm: sequence generation model for multi-label classification. arXiv preprint arXiv:1806.04822. +Yang Yang, Deyu Zhou, Yulan He, and Meng Zhang, 2019. Interpretable relevant emotion ranking with event-driven attention. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 177-187. +Zichao Yang, Diyi Yang, Chris Dyer, Xiaodong He, Alex Smola, and Eduard Hovy. 2016. Hierarchical attention networks for document classification. In Proceedings of the 2016 conference of the North American chapter of the association for computational linguistics: human language technologies, pages 1480-1489. +Scott Wen-tau Yih, Ming-Wei Chang, Xiaodong He, and Jianfeng Gao. 2015. Semantic parsing via staged query graph generation: Question answering with knowledge base. + +Wenpeng Yin, Mo Yu, Bing Xiang, Bowen Zhou, and Hinrich Schütze. 2016. Simple question answering by attentive convolutional neural network. arXiv preprint arXiv:1606.03391. +Mo Yu, Wenpeng Yin, Kazi Saidul Hasan, Cicero dos Santos, Bing Xiang, and Bowen Zhou. 2017. Improved neural relation detection for knowledge base question answering. arXiv preprint arXiv:1704.06194. +Yang Yu, Kazi Saidul Hasan, Mo Yu, Wei Zhang, and Zhiguo Wang. 2018. Knowledge base relation detection via multi-view matching. In European Conference on Advances in Databases and Information Systems, pages 286-294. Springer. +Linhai Zhang, Chao Lin, Deyu Zhou, Yulan He, and Meng Zhang. 2021. A bayesian end-to-end model with estimated uncertainties for simple question answering over knowledge bases. Computer Speech Language, 66:101167. +Min-Ling Zhang and Zhi-Hua Zhou. 2007. Ml-knn: A lazy learning approach to multi-label learning. Pattern recognition, 40(7):2038-2048. +Shiliang Zhang, Hui Jiang, Mingbin Xu, Junfeng Hou, and Li-Rong Dai. 2015. The fixed-size ordinally-forgetting encoding method for neural network language models. 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), pages 495-500. \ No newline at end of file diff --git a/adivideandconquerapproachformultilabelmultihoprelationdetectioninknowledgebasequestionanswering/images.zip b/adivideandconquerapproachformultilabelmultihoprelationdetectioninknowledgebasequestionanswering/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f44488a51749b0fda4da5d22f59c14a99be05457 --- /dev/null +++ b/adivideandconquerapproachformultilabelmultihoprelationdetectioninknowledgebasequestionanswering/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d0a1b9b348832d610b85a8b21a2b3918165a1d6d9d941e7a09ef7a181c448235 +size 317001 diff --git a/adivideandconquerapproachformultilabelmultihoprelationdetectioninknowledgebasequestionanswering/layout.json b/adivideandconquerapproachformultilabelmultihoprelationdetectioninknowledgebasequestionanswering/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..549ac3216f8c09e08a1d953059526934c8570903 --- /dev/null +++ b/adivideandconquerapproachformultilabelmultihoprelationdetectioninknowledgebasequestionanswering/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a2d63ab9627b0d257815d842c6716c9131e8039bae09c9ccd82c0e78d84e4d2 +size 418096 diff --git a/adversarialexamplesforevaluatingmathwordproblemsolvers/9938fbc4-079d-4dc5-af95-a7fb2c99e7dc_content_list.json b/adversarialexamplesforevaluatingmathwordproblemsolvers/9938fbc4-079d-4dc5-af95-a7fb2c99e7dc_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..71f34ec43f7d750a71dde9029c88f0940cfd5aa5 --- /dev/null +++ b/adversarialexamplesforevaluatingmathwordproblemsolvers/9938fbc4-079d-4dc5-af95-a7fb2c99e7dc_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e44fc2f83aa6d9bd47b586023ce68bf35fea88d9440810f3c3ab7ac50fd197dd +size 51524 diff --git a/adversarialexamplesforevaluatingmathwordproblemsolvers/9938fbc4-079d-4dc5-af95-a7fb2c99e7dc_model.json b/adversarialexamplesforevaluatingmathwordproblemsolvers/9938fbc4-079d-4dc5-af95-a7fb2c99e7dc_model.json new file mode 100644 index 0000000000000000000000000000000000000000..381bb476099458c7314b17b0900663fd3f95d5a2 --- /dev/null +++ b/adversarialexamplesforevaluatingmathwordproblemsolvers/9938fbc4-079d-4dc5-af95-a7fb2c99e7dc_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:10c3e71be6c685e5e8e11e0e549b5dc1deaf1f222edefab977a147b1404f8d68 +size 65034 diff --git a/adversarialexamplesforevaluatingmathwordproblemsolvers/9938fbc4-079d-4dc5-af95-a7fb2c99e7dc_origin.pdf b/adversarialexamplesforevaluatingmathwordproblemsolvers/9938fbc4-079d-4dc5-af95-a7fb2c99e7dc_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5e298dca5135aa07729bd83db35b61312b272afe --- /dev/null +++ b/adversarialexamplesforevaluatingmathwordproblemsolvers/9938fbc4-079d-4dc5-af95-a7fb2c99e7dc_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6b5160b0f098b554e366932b709f39d4dd4aa544a1e23d8b349d00f96afed6c +size 211355 diff --git a/adversarialexamplesforevaluatingmathwordproblemsolvers/full.md b/adversarialexamplesforevaluatingmathwordproblemsolvers/full.md new file mode 100644 index 0000000000000000000000000000000000000000..3b847b64c13c185739ab85f8bdf7d483d1b6ec53 --- /dev/null +++ b/adversarialexamplesforevaluatingmathwordproblemsolvers/full.md @@ -0,0 +1,262 @@ +# Adversarial Examples for Evaluating Math Word Problem Solvers + +Vivek Kumar*, Rishabh Maheshwary* and Vikram Pudi + +Data Sciences and Analytics Center, Kohli Center on Intelligent Systems + +International Institute of Information Technology, Hyderabad, India + +{vivek.k, rishabh.maheshwary} $@$ research.iit.ac.in, vikram@iit.ac.in + +# Abstract + +Standard accuracy metrics have shown that Math Word Problem (MWP) solvers have achieved high performance on benchmark datasets. However, the extent to which existing MWP solvers truly understand language and its relation with numbers is still unclear. In this paper, we generate adversarial attacks to evaluate the robustness of state-of-the-art MWP solvers. We propose two methods Question Reordering and Sentence Paraphrasing to generate adversarial attacks. We conduct experiments across three neural MWP solvers over two benchmark datasets. On average, our attack method is able to reduce the accuracy of MWP solvers by over 40 percentage points on these datasets. Our results demonstrate that existing MWP solvers are sensitive to linguistic variations in the problem text. We verify the validity and quality of generated adversarial examples through human evaluation. + +# 1 Introduction + +A Math Word Problem (MWP) consists of a natural language text which describes a world state involving some known and unknown quantities. The task is to parse the text and generate equations that can help find the value of unknown quantities. Solving MWP's is challenging because apart from understanding the text, the model needs to identify the variables involved, understand the sequence of events, and associate the numerical quantities with their entities to generate mathematical equations. An example of a simple MWP is shown in Table 1. In recent years, solving MwPs has become a problem of central attraction in the NLP community. There are a wide variety of MwPs ranging from simple linear equations in one variable (Koncel-Kedziorski et al., 2016; Miao et al., 2020) to complex problems that require solving a system of equations (Huang et al., 2016; Saxton + +# Original Problem + +Text: Tim has 5 books. Mike has 7 books. + +How many books do they have together? + +Equation: $\mathrm{X} = 5 + 7$ + +# Question Reordering + +Text: How many books do they have together + +given that Tim has 5 books and Mike has 7 books. + +Equation: $\mathrm{X} = 5 * 7$ + +# Sentence Paraphrasing + +Text: Tim has got 5 books. There are 7 books in + +Mike's possession. How many books do they have? + +Equation: $\mathrm{X} = 5 * 5$ + +Table 1: A MWP and generated adversarial examples by our methods. Red and blue color denote the subject and the entity respectively of numerical values. + +et al., 2019). In this paper, we consider simple MwPs which can be solved by a linear equation in one variable. + +Existing MWP solvers can be categorized into statistical learning based (Hosseini et al., 2014; Kushman et al., 2014) and deep learning based solvers. However, recent deep learning based approaches (Wang et al., 2017; Xie and Sun, 2019; Zhang et al., 2020b) have established their superiority over statistical learning based solvers. Here, we will briefly review some recent MWP solvers. Initially, (Wang et al., 2017) modelled the task of MWP as a sequence to sequence task and utilized Recurrent Neural Nets (RNNs) to learn problem representations. Building upon this, (Chiang and Chen, 2018) focused on learning representations for mathematical operators and numbers, (Xie and Sun, 2019; Wang et al., 2019) utilized tree structure to develop decoders for MWP solvers. More recently, to learn accurate relationship between numerical quantities and their attributes (Zhang et al., 2020b) modelled encoder as a graph structure. + +All such MWP solvers have achieved high per + +formance on benchmark datasets. However, the extent to which these solvers truly understand language and numbers remains unclear. Prior works on various NLP tasks have shown that Deep Neural Networks (DNNs) attend to superficial cues to achieve high performance on benchmark datasets. Recently, (Patel et al., 2021) proposed a challenge test set called SVAMP which demonstrate that existing MWP solvers rely on shallow heuristics to achieve high performance. Instead of relying on standard accuracy metrics, many works have used adversarial examples (Szegedy et al., 2013; Papernot et al., 2017) to evaluate the robustness of neural NLP models. Adversarial examples are generated by making small changes to the original input such that the adversarial example is (1) semantically similar to the original input, (2) is grammatically correct and fluent and (3) deceives the DNNs to generate an incorrect prediction. + +In (Jia and Liang, 2017) authors crafted adversarial attacks to test the robustness of QA systems. Prior works in (Glockner et al., 2018; McCoy et al., 2019) uses adversarial examples to show deficiencies of NLI models. Similarly, (Dinan et al., 2019; Cheng et al., 2019) uses adversarial examples to develop robust dialogue and neural machine translation models. Recently, there has been a plethora of work (Ebrahimi et al., 2017; Alzantot et al., 2018; Jin et al., 2020; Maheshwary et al., 2021, 2020) to evaluate text classification systems against adversarial examples. Although adversarial examples are commonly used for various NLP tasks, there has been no work that uses adversarial examples to evaluate MWP solvers. In this paper, we bridge this gap and evaluate the robustness of state-of-the-art MWP solvers against adversarial examples. + +Generating adversarial attacks for MwP is a challenging task as apart from preserving textual semantics, numerical value also needs to be preserved. The text should make mathematical sense, and the sequence of events must be maintained such that humans generate the same equations from the problem text. Standard adversarial generation techniques like synonym replacement (Alzantot et al., 2018) are not suitable for MwP as the fluency of the problem statement is not preserved. Similarly, paraphrasing techniques like back-translation (Mallinson et al., 2017) are not ideal as they generate syntactically uncontrolled examples. + +We propose two methods to generate adversarial examples on MwP solvers, (1) Question Reorder + +ing — It transforms the problem text by moving the question part to the beginning of the problem and (2) Sentence Paraphrasing — It paraphrases each sentence in the problem such that the semantic meaning and the numeric information remains unchanged. Our results demonstrate that current solvers are not robust against adversarial examples as they are sensitive to minor variations in the input. We hope that our insights will inspire future work to develop more robust MWP solvers. Our contributions are as follows: + +1. To the best of our knowledge, this is the first work that evaluates the robustness of MWP solvers against adversarial attacks. We propose two methods to generate adversarial examples on three MWP solvers across two benchmark datasets. +2. On average, the generated adversarial examples are able to reduce the accuracy of MWP solvers by over $40\%$ . Further, we experiment with different type of input embeddings and perform adversarial training using our proposed methods. We also conducted human evaluation to ensure that the generated adversarial examples1 are valid, semantically similar and grammatically correct. + +# 2 Proposed Approach + +# 2.1 Problem Definition + +A MWP is defined as an input of $n$ tokens, $\mathcal{P} = \{w_1, w_2..w_n\}$ where each token $w_i$ is either a numeric value or a word from a natural language. The goal is to generate a valid mathematical equation $\mathcal{E}$ from $\mathcal{P}$ such that the equation consists of numbers from $\mathcal{P}$ , desired numerical constants and mathematical operators from the set $\{/, *, +, -\}$ . The above problem can also be expressed as $\mathcal{P} = \{S_1, S_2..S_k, Q\}$ where $Q$ is the question, $\{S_1, S_2..S_k\}$ are the sentences constituting the problem description. + +Let $\mathbf{F}:\mathcal{P}\to \mathcal{E}$ be a MwP solver where $\mathcal{E}$ is the solution equation to problem $\mathcal{P}$ . Our goal is to craft an adversarial text input $\mathcal{P}^*$ from the original input $\mathcal{P}$ such that the generated sequence is (1) semantically similar to the original input, (2) preserves sequence of events in the problem, (3) preserve numerical values and (4) makes the MwP solver $\mathbf{F}$ to generate an incorrect equation $\mathcal{E}^*$ for the unknown + +variable. We assume a black-box setting in which we have no access to the parameters, architecture or training data of the MWP solver. We only have access to the input text and equations generated by the solver. + +# 2.2 Question Reordering + +To examine whether existing MWP solvers are sensitive to the order of the question in the problem text, we moved the question $Q$ at the start, followed by the rest of the problem description $\{S_1, S_2..S_k\}$ . Formally, given the original input $\mathcal{P} = \{S_1, S_2..S_k, Q\}$ we transformed this to $\mathcal{P}^* = \{Q, S_1, S_2..S_k\}$ . We keep the rest of the problem description $\{S_1, S_2..S_k\}$ unaltered. Also, to ensure that the generated problem text $\mathcal{P}^*$ is grammatically correct and fluent, we added phrases like "Given that" or "If" after the end of the question $Q$ and before the start of the sentences $\{S_1, S_2..S_k\}$ . An example of this is shown in Table 1. We additionally, make use of co-reference resolution and named entity recognition2 to replace pronouns with their co-referent links. Note that placing the question $Q$ at the start rather than any other position ensures that the generated problem $\mathcal{P}^*$ has the same sequence of events as the original problem $\mathcal{P}$ . Moreover, this method is better than randomly shuffling the sentences in $\mathcal{P}$ as it can change the sequence of events in the problem, resulting in a completely different equation. + +# 2.3 Sentence Paraphrasing + +To check whether MWP solvers generate different equations to semantically similar inputs, we generate paraphrases of each sentence in the problem text. Sentence Paraphrasing ensures that solvers do not generate equations based on keywords and specific patterns. Formally, given a problem statement $\mathcal{P}$ we obtain top $m$ paraphrases for each sentence $S_{i}$ as $\{S_{i,1}, S_{i,2}, \ldots, S_{i,m}\}$ and for question $Q$ as $\{Q_{i,1}, Q_{i,2}, \ldots, Q_{i,m}\}$ by passing it through a paraphrasing model $\mathcal{M}$ . For sentences with numerical values present in them, we need to ensure that each paraphrase candidate associates the numeric values with the same entity and subject as it is present in the original sentence $S_{i}$ . To ensure this, we follow the approach used in (Hosseini et al., 2014) to segregate each sentence $S_{i}$ into entities and its subject. These are collectively labeled as head entity $h_{i,orig}$ for the original sentence $S_{i}$ and $h_{i,k}$ for the para + +phrase candidates $S_{i,k}$ . This methodology ensures that each numeric value is still associated correctly with its attributes even after paraphrasing. Paraphrased sentences that do not have matching head entities for any of the numeric values are filtered out. The remaining paraphrases of $S_{i}$ and question $Q$ are combined to generate all possible combinations of problem texts. The input combination for which the MWP solver generates an incorrect or invalid equation is selected as the final adversarial problem text $\mathcal{P}^*$ . Sentence Paraphrasing generates inputs containing small linguistic variations and diverse keywords (more examples in appendix). Therefore, it is used to evaluate whether existing MWP solvers rely on specific keywords or patterns to generate equations. Algorithm 1 shows all the steps followed above to generate paraphrases. + +# Algorithm 1 Sentence Paraphrasing + +Input: Problem text $\mathcal{P},\mathcal{M}$ is Paraphrase model Output: Adversarial text $\mathcal{P}^*$ + +1: $\mathcal{P}^* \gets \mathcal{P}$ +2: $y_{orig} \gets \mathbf{F}(\mathcal{P})$ +3: for $S_{i}$ in $\mathcal{P}$ do +4: $C\gets \mathcal{M}(S_i)$ +5: for $c_{j}$ in $C$ do +6: if $h_{i,orig} == h_{i,j}$ then +7: paraphrases.add(cj) +8: paraphrases.add $(S_{i})$ +9: candidates.add(paraphrases) + +10: for $c_k$ in Combinations(candidates) do + +11: $y_{adv} \gets \mathbf{F}(c_k)$ +12: if $y_{adv} \neq y_{orig}$ then +13: $\mathcal{P}^* \gets c_k$ +14: end + +# 3 Experiments + +# 3.1 Datasets and Models + +We evaluate the robustness of three state-of-the-art MWP solvers: (1) Seq2Seq (Wang et al., 2017) having an LSTM encoder and an attention based decoder. (2) GTS (Xie and Sun, 2019) having an LSTM encoder and a tree based decoder and (3) Graph2tree (Zhang et al., 2020b) consists of a both a tree based encoder and decoder. Many existing datasets are not suitable for our analysis as either they are in Chinese (Wang et al., 2017) or they have problems of higher complexities (Huang et al., 2016). We conduct experiments across the + +two largest available English language datasets satisfying our requirements: (1) MaWPS (Koncel-Kedziorski et al., 2016) containing 2,373 problems (2) ASDIV-A (Miao et al., 2020) containing 1,213 problems. Both datasets have MwPs with linear equation in one variable. + +# 3.2 Experimental Setup + +We trained the three MWP solvers from scratch as implemented in baseline paper (Wang et al., 2017) on the above two datasets using 5-fold cross-validation as followed in (Zhang et al., 2020b). The original accuracies obtained on the datasets are shown in Table 2. We used (Zhang et al., 2020a) to generate paraphrases of each sentence in the problem text. Same hyperparameter values were used as present in the original implementation of the paraphrase model. We conducted a human evaluation (Section 4.3) to verify the quality of generated adversarial examples. Further details are given in Appendix. + +# 3.3 Implementation Details + +For conducting our experiments we have used two Boston SYS-7048GR-TR nodes equipped with NVIDIA GeForce GTX 1080 Ti computational GPU's. The number of parameters ranged from 20M to 130M for different models. Hyperparameter values were not modified, and we follow the recommendations of the respective models. We chose the number of candidate paraphrases $m$ used in Algorithm 1 to be 7. Generating adversarial examples using Question Reordering took around 3 minutes on average for both MaWPS and ASDiv-A dataset. Sentence Paraphrasing took around 10 minutes on average for generation of adversarial examples on both the datasets. These experiments are not computation heavy as the generation technique is of linear order and number of examples are moderate. + +# 3.4 Results + +Table 2 shows the results of our proposed methods. On average, the generated adversarial examples can lower the accuracy of MWP solvers by over 40 percentage points. Across both datasets, Graph2Tree, the state-of-the-art MWP solver achieves only $34\%$ and $24\%$ accuracy on Question Reordering and Sentence Paraphrasing respectively. Sentence Paraphrasing is around 10 percentage points more successful in attacking MWP solvers than Question Reordering. These results verify our claim that + +
DatasetEval TypeSeq2SeqGTSGraph2Tree
MaWPSOrig53.082.683.7
QR18.232.335.6
SP10.522.725.5
ASDIV-AOrig54.571.477.4
QR17.530.533.5
SP13.221.223.8
+ +Table 2: Results of MWP Solvers on adversarial examples. Orig is the original accuracy, QR is Question Reordering and SP is Sentence Paraphrasing. + +current MWP solvers are sensitive to small variations in the input. Table 1 shows an MWP problem and its adversarial counterparts generated by our method—more examples in the Appendix section. + +# 4 Analysis + +# 4.1 BERT Embeddings + +We trained the solvers using pre-trained BERT embeddings and then generated adversarial examples against them using our proposed methods. Results obtained are shown in Table 3. We see that using BERT embeddings, the original accuracy of MWP solvers increases by 5 percentage points, and they are more robust than solvers trained from scratch. Specifically, these solvers do well against Question Reordering because of the contextualized nature of BERT embeddings, but for examples generated using Sentence Paraphrasing methods these models do not perform well. However, on average, our adversarial examples can lower the accuracy by 30 percentage points on both datasets. + +# 4.2 Adversarial Training + +To examine the robustness of MWP solvers against our attacks, we generated adversarial examples on the training set of both the datasets using our proposed methods and then augmented the training sets with the generated adversarial examples. We then retrained the MWP solvers and again attacked these solvers using our methods. Table 3 shows that the MWP solvers become more robust to attacks. Specifically, the solvers perform well against Question Reordering but are still deceived by Sentence Paraphrasing. Nevertheless, our proposed attack methods are still able to lower the accuracy of MWP solvers by 25 percentage points. + +
DatasetEval TypeSeq2SeqGTSGraph2Tree
MaWPSAdv (QR)32.452.354.9
Adv (SP)27.640.742.3
BERT (QR)45.363.065.6
BERT (SP)32.543.545.5
ASDIV-AAdv (QR)34.548.454.8
Adv (SP)28.831.633.0
BERT (QR)41.359.862.7
BERT (SP)30.640.042.6
+ +# 4.3 Human Evaluation + +To verify the quality and the validity of the adversarial examples, we asked human evaluators (1) To check if the paraphrases will result in the same linear equation as that of the original problem, (2) Evaluate each adversarial example in the range 0 to 1 to check its semantic similarity with the original problem and (3) On a scale of 1 to 5 rate each adversarial example for its grammatical correctness. We also explicitly check for examples which do not satisfy our evaluation criteria and manually remove them from adversarial examples set. Three different human evaluators evaluate each sample, and the mean results obtained are shown in Table 4. + +Table 3: Accuracy of MWP solvers with adversarial training on our proposed methods. Adv and BERT represent models trained from scratch and BERT embeddings respectively. + +
Evaluation criteriaMaWPSASDIV-A
Same Linear Equation85.7%86.2%
Semantic Similarity0.880.89
Grammatical Correctness4.554.63
+ +Table 4: Human Evaluation scores on datasets + +# 5 Future Work and Conclusion + +The experiments in this paper showcase that NLP models do not understand MWP entirely and are not robust enough for practical purposes. Our work encourages the development of robust MWP solvers and techniques to generate adversarial math examples. We believe that the generation of quality MWP's will immensely help develop solvers that genuinely understand numbers and text in combination. Future works could focus on creating more such techniques for adversarial examples generation and making robust MWP solvers. + +# 6 Acknowledgments + +We would like to thank the anonymous reviewers for their constructive feedback. We would also like to thank our colleagues at Data Sciences and Analytics Center, IIIT Hyderabad for providing valuable feedback. Special thanks to the human annotators who have helped in evaluation of generated adversarial examples. + +# References + +Moustafa Alzantot, Yash Sharma, Ahmed Elgohary, Bo-Jhang Ho, Mani Srivastava, and Kai-Wei Chang. 2018. Generating natural language adversarial examples. arXiv preprint arXiv:1804.07998. +Yong Cheng, Lu Jiang, and Wolfgang Macherey. 2019. Robust neural machine translation with doubly adversarial inputs. arXiv preprint arXiv:1906.02443. +Ting-Rui Chiang and Yun-Nung Chen. 2018. Semantically-aligned equation generation for solving and reasoning math word problems. arXiv preprint arXiv:1811.00720. +Emily Dinan, Samuel Humeau, Bharath Chintagunta, and Jason Weston. 2019. Build it break it fix it for dialogue safety: Robustness from adversarial human attack. arXiv preprint arXiv:1908.06083. +Javid Ebrahimi, Anyi Rao, Daniel Lowd, and De- jing Dou. 2017. Hotflip: White-box adversarial examples for text classification. arXiv preprint arXiv:1712.06751. +Max Glockner, Vered Shwartz, and Yoav Goldberg. 2018. Breaking nli systems with sentences that require simple lexical inferences. arXiv preprint arXiv:1805.02266. +Mohammad Javad Hosseini, Hannaneh Hajishirzi, Oren Etzioni, and Nate Kushman. 2014. Learning to solve arithmetic word problems with verb categorization. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 523-533, Doha, Qatar. Association for Computational Linguistics. +Danqing Huang, Shuming Shi, Chin-Yew Lin, Jian Yin, and Wei-Ying Ma. 2016. How well do computers solve math word problems? large-scale dataset construction and evaluation. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 887-896. +Robin Jia and Percy Liang. 2017. Adversarial examples for evaluating reading comprehension systems. arXiv preprint arXiv:1707.07328. +Di Jin, Zhijing Jin, Joey Tianyi Zhou, and Peter Szolovits. 2020. Is bert really robust? a strong baseline for natural language attack on text classification + +and entailment. In Proceedings of the AAAI conference on artificial intelligence, volume 34, pages 8018-8025. +Rik Koncel-Kedziorski, Subhro Roy, Aida Amini, Nate Kushman, and Hannaneh Hajishirzi. 2016. Mawps: A math word problem repository. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1152-1157. +Nate Kushman, Yoav Artzi, Luke Zettlemoyer, and Regina Barzilay. 2014. Learning to automatically solve algebra word problems. In Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 271-281, Baltimore, Maryland. Association for Computational Linguistics. +Rishabh Maheshwary, Saket Maheshwary, and Vikram Pudi. 2020. A context aware approach for generating natural language attacks. arXiv preprint arXiv:2012.13339. +Rishabh Maheshwary, Saket Maheshwary, and Vikram Pudi. 2021. Generating natural language attacks in a hard label black box setting. In Proceedings of the 35th AAAI Conference on Artificial Intelligence. +Jonathan Mallinson, Rico Sennrich, and Mirella Lapata. 2017. Paraphrasing revisited with neural machine translation. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 1, Long Papers, Valencia, Spain. Association for Computational Linguistics. +R Thomas McCoy, Ellie Pavlick, and Tal Linzen. 2019. Right for the wrong reasons: Diagnosing syntactic heuristics in natural language inference. arXiv preprint arXiv:1902.01007. +Shen-Yun Miao, Chao-Chun Liang, and Keh-Yih Su. 2020. A diverse corpus for evaluating and developing english math word problem solvers. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 975-984. +Nicolas Papernot, Patrick McDaniel, Ian Goodfellow, Somesh Jha, Z Berkay Celik, and Ananthram Swami. 2017. Practical black-box attacks against machine learning. In Proceedings of the 2017 ACM on Asia conference on computer and communications security, pages 506-519. +Arkil Patel, Satwik Bhattachamishra, and Navin Goyal. 2021. Are NLP models really able to solve simple math word problems? In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 2080-2094, Online. Association for Computational Linguistics. +David Saxton, Edward Grefenstette, Felix Hill, and Pushmeet Kohli. 2019. Analysing mathematical reasoning abilities of neural models. arXiv preprint arXiv:1904.01557. + +Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. 2013. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199. +Lei Wang, D. Zhang, Jipeng Zhang, Xing Xu, L. Gao, B. Dai, and H. Shen. 2019. Template-based math word problem solvers with recursive neural networks. In AAAI. +Yan Wang, Xiaojiang Liu, and Shuming Shi. 2017. Deep neural solver for math word problems. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 845-854. +Zhipeng Xie and Shichao Sun. 2019. A goal-driven tree-structured neural model for math word problems. In *IJCAI*, pages 5299–5305. +Jingqing Zhang, Yao Zhao, Mohammad Saleh, and Peter Liu. 2020a. Pegasus: Pre-training with extracted gap-sentences for abstractive summarization. In International Conference on Machine Learning, pages 11328-11339. PMLR. +Jipeng Zhang, Lei Wang, Roy Ka-Wei Lee, Yi Bin, Yan Wang, Jie Shao, and Ee-Peng Lim. 2020b. Graph-to-tree learning for solving math word problems. Association for Computational Linguistics. + +
Original Problem +Problem Statement: A teacher had 7 worksheets to grade. If she graded 3, but then another 4 were turned in, how many worksheets would she have to grade? +Predicted Equation: X = 7+3-4 +Question Reordering +Problem Statement: How many worksheets would she have to grade given that a teacher had 7 worksheets to grade and if she graded 3 but then another 4 were turned in? +Predicted Equation: X = 7+3+4 +Sentence Paraphrasing +Problem Statement: A teacher had her students work on 7 questions. 3 would be graded if she graded it. +Then another 4 was turned in. How many things would she have to grade? +Predicted Equation: X = 7+3-4
Original Problem +Problem Statement: Gwen earned 20 points for each bag of cans she recycled. If she had 10 bags, but didn't recycle 3 of them, how many points would she have earned? +Predicted Equation: X = (20*(10-3)) +Question Reordering +Problem Statement: How many points would she have earned given that Gwen earned 20 points for each bag of cans she recycled and if she had 10 bags but didn't recycle 3 of them? +Predicted Equation: X = 20*10-3 +Sentence Paraphrasing +Problem Statement: Gwen earned 20 points for each bag of cans she recycled. She have 10 bags. +She did not recycle 3 of them. How many points would she have gotten? +Predicted Equation: X = 20+10-3
Original Problem +Problem Statement: : Dennis has 12 pencils stored in boxes. If there are 3 boxes, how many pencils must go in each box? +Predicted Equation: X = 12/3 +Question Reordering +Problem Statement: : If there are 3 boxes, how many pencils must go in each box given that Dennis has 12 pencils stored in boxes? +Predicted Equation: X = 12/3 +Sentence Paraphrasing +Problem Statement: Dennis has 12 pencils in boxes. There are 3 boxes. Find the number of pencils in each box? +Predicted Equation: X = 12-3
Original Problem +Problem Statement: Oliver made 10 dollars mowing lawns over the summer. If he spent 4 dollars buying new mower blades. How many 3 dollar games could he buy with the money he had left ? +Predicted Equation: X = (10-4)/3 +Question Reordering +Problem Statement: How many 3 dollar games could Oliver buy with the money he had left given that Oliver made 10 dollars mowing lawns over the summer and if he spent 4 dollars buying new mower blades. +Predicted Equation: X = (10-4)*3 +Sentence Paraphrasing +Problem Statement: Over the summer, Oliver made 10 dollars mowing lawns. He spent 4 dollars on new blades. +With the money he had left, how many 3 dollar games could he buy? +Predicted Equation: X = (10-4)*3
+ +Table 5: Some instances of valid Adversarial Examples + +# Original Problem + +Problem Statement : A trivia team had 10 members total. But during a game 2 members did not show up. If each member that did show up scored 3 points. How many points were scored? + +Predicted Equation : $\mathrm{X} = (10 - 2)^{*}3$ + +# Sentence Paraphrasing + +Problem Statement : A team with 10 members had a lot of questions to answer. But during the game 2 members did not show up. 3 points were scored if each member showed up. How many points were scored? + +# Original Problem + +Problem Statement : A tailor cut 15 of an inch off a skirt and 5 of an inch off a pair of pants . How much more did the tailor cut off the skirt than the pants ? + +Predicted Equation : $\mathrm{X} = {15} - 5$ + +# Sentence Paraphrasing + +Problem Statement : The 15 was cut by a tailor. There is a skirt and 5 of an inch off. There is a pair of pants. How much more did the tailor cut off the skirt than the pants? + +# Original Problem + +Problem Statement : A vase can hold 10 flowers . If you had 5 carnations and 5 roses, how many vases would you need to hold the flowers? + +Predicted Equation : $\mathrm{X} = (5 + 5) / {10}$ + +# Sentence Paraphrasing + +Problem Statement : 10 flowers can be held in a vase. If you had 5 and 5 roses. How many vases do you need to hold the flowers. + +Table 6: Some instances of invalid Adversarial Examples \ No newline at end of file diff --git a/adversarialexamplesforevaluatingmathwordproblemsolvers/images.zip b/adversarialexamplesforevaluatingmathwordproblemsolvers/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..7130d0e31ce449b5908785c7d7b5595728cc0986 --- /dev/null +++ b/adversarialexamplesforevaluatingmathwordproblemsolvers/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1733080db295add03eae0aa5e5433e9233257f3828925d54b879ecbc7c23420 +size 377608 diff --git a/adversarialexamplesforevaluatingmathwordproblemsolvers/layout.json b/adversarialexamplesforevaluatingmathwordproblemsolvers/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a71f629057422d02c98ae596181d99b1fa7456bd --- /dev/null +++ b/adversarialexamplesforevaluatingmathwordproblemsolvers/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e7cb8bcefb271cda66e930ec430cf784433b66531db66d070152a6fe0d4adff2 +size 271099 diff --git a/aedaaneasierdataaugmentationtechniquefortextclassification/f07404a8-b01d-4af9-910e-3444ba29b01c_content_list.json b/aedaaneasierdataaugmentationtechniquefortextclassification/f07404a8-b01d-4af9-910e-3444ba29b01c_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..dd49fb8356baa04fce530c68df6abf4ff898f3ac --- /dev/null +++ b/aedaaneasierdataaugmentationtechniquefortextclassification/f07404a8-b01d-4af9-910e-3444ba29b01c_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:59b19089d0688c2fd5b5b5a611bccb684ce7fa512685c2ef0fd7be6dee806788 +size 41588 diff --git a/aedaaneasierdataaugmentationtechniquefortextclassification/f07404a8-b01d-4af9-910e-3444ba29b01c_model.json b/aedaaneasierdataaugmentationtechniquefortextclassification/f07404a8-b01d-4af9-910e-3444ba29b01c_model.json new file mode 100644 index 0000000000000000000000000000000000000000..7bb7549749611200b6ed365594ce2c4e214edbcc --- /dev/null +++ b/aedaaneasierdataaugmentationtechniquefortextclassification/f07404a8-b01d-4af9-910e-3444ba29b01c_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ecf219b6f8675f4104c2a54f97aa37c8682fb5cf1bdc47e86f27f828541ba1a +size 52843 diff --git a/aedaaneasierdataaugmentationtechniquefortextclassification/f07404a8-b01d-4af9-910e-3444ba29b01c_origin.pdf b/aedaaneasierdataaugmentationtechniquefortextclassification/f07404a8-b01d-4af9-910e-3444ba29b01c_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..de076418dcdb991dd7fc07118eee03c1b9edf583 --- /dev/null +++ b/aedaaneasierdataaugmentationtechniquefortextclassification/f07404a8-b01d-4af9-910e-3444ba29b01c_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:087524ecae6c4dc55132dd13d144190c2df3e406a97252e891e6443c8d6e0d36 +size 2332940 diff --git a/aedaaneasierdataaugmentationtechniquefortextclassification/full.md b/aedaaneasierdataaugmentationtechniquefortextclassification/full.md new file mode 100644 index 0000000000000000000000000000000000000000..944890c65d15568fd17073d48dc0460f8985dfca --- /dev/null +++ b/aedaaneasierdataaugmentationtechniquefortextclassification/full.md @@ -0,0 +1,177 @@ +# AEDA: An Easier Data Augmentation Technique for Text Classification + +Akbar Karimi Leonardo Rossi Andrea Prati + +IMP Lab, University of Parma, Italy + +{akbar.karimi,leonardo.rossi,andrea.prati}@unipr.it + +# Abstract + +This paper proposes AEDA (An Easier Data Augmentation) technique to help improve the performance on text classification tasks. AEDA includes only random insertion of punctuation marks into the original text. This is an easier technique to implement for data augmentation than EDA method (Wei and Zou, 2019) with which we compare our results. In addition, it keeps the order of the words while changing their positions in the sentence leading to a better generalized performance. Furthermore, the deletion operation in EDA can cause loss of information which, in turn, misleads the network, whereas AEDA preserves all the input information. Following the baseline, we perform experiments on five different datasets for text classification. We show that using the AEDA-augmented data for training, the models show superior performance compared to using the EDA-augmented data in all five datasets. The source code is available for further study and reproduction of the results1. + +# 1 Introduction + +Text classification is a major area of study in natural language processing (NLP) with numerous applications such as sentiment analysis, toxicity detection, and question answering, to name but a few. In order to build text classifiers that perform well, the training data need to be large enough so that the model can generalize to the unseen data. However, for many machine learning (ML) applications and domains, there do not exist sufficient labeled data for training. In this situation, data augmentation (DA) can provide a solution and help improve the performance of ML systems (Ragni et al., 2014; Fadaee et al., 2017; Ding et al., 2020). DA can be carried out in many different ways such as by modifying elements of the input sequence, namely word substitution, deletion, and insertion (Wei and Zou, + +![](images/966aa17b79b6ba44cfa75e62b48bafffb07e74c444055f8e8262978cd9116f5d.jpg) +Figure 1: Average performance of the generated data using our proposed augmentation method (AEDA) compared with that of the original and EDA-generated data on five text classification tasks. Using both EDA and AEDA, we added 9 augmented sentences to the original training set to train the models. For each task, we ran the models with 5 different seed numbers and took the average score. + +2019; Zhang et al., 2015), and back-translation (Sennrich et al., 2016). It can also be performed by noise injection in the input sequence (Xie et al., 2019) or in the embedding space utilizing a deep language model (Jiao et al., 2020; Karimi et al., 2021; Garg and Ramakrishnan, 2020). + +Using a deep language model to do DA can be complicated, while word replacement techniques with the help of a word thesaurus, even though a simple method, risks information loss due to the operations such as deletion and substitution. These operations can even result in changing the label of the input sequence (Kumar et al., 2020), thus misleading the network. + +To address these problems, we propose an extremely simple yet effective approach called AEDA (An Easier Data Augmentation) which includes only the insertion of various punctuation marks into the input sequence. AEDA preserves all the input information and does not mislead the network + +since it keeps the word order intact while changing their positions in that the words are shifted to the right. Our extensive experiments show that AEDA helps the models avoid overfitting (Figure 1). + +# 2 Related Work + +Although the textual content is always increasing, data augmentation is still a highly active area of research since for machine learning applications, especially the new ones, the initial annotated data are usually small. As a result, researchers are constantly coming up with innovative ideas to create new data from the available content. + +Some have experimented at the input sequence level performing operations on words. For example, to improve machine translation quality, Fadaee et al. (2017) utilize substitution of common words with rare ones, thus providing more context for the rare words, while Sennrich et al. (2016) use back-translation where automatically translated data along with the original human-translated data are employed to train a neural machine translation system. Wang and Yang (2015) replaces words with their synonyms for classifying tweets. Similarly, Andreas (2020) replace sentence fragments from common categories with each other in order to produce new sentences. + +Others have opted for using pre-trained language models such as BERT (Devlin et al., 2019). Kobayashi (2018) utilizes contextual augmentation, replacing the words with the prediction of a bidirectional language model at a desired position in the sentence. Hu et al. (2019) and Liu et al. (2020) utilize reinforcement learning with a conditional language model which is carried out by attaching the correct label to the input sequence when training (Wu et al., 2019). Working with Transformer model (Vaswani et al., 2017), Sun et al. (2020) propose Mix-Transformer where two input sentences and their corresponding labels are linearly interpolated to create new samples. + +Xie et al. (2019) make use of data noising which can be considered similar to our work with the difference that they replace words choosing from the unigram frequency distribution or insert the underscore character as a placeholder, whereas we insert punctuation characters which usually occur in sentences. The related works mostly use some auxiliary data or a complicated language model to produce augmented data. Conversely, our method is extremely simple to implement and does not + +need any extra data. In addition, it shows superior performance to EDA in both simple models such as RNNs and CNNs and deep models such as BERT. + +# 3 AEDA Augmentation + +In order to insert the punctuation marks, we randomly choose a number between 1 and one-third of the length of the sequence which indicates how many insertions will be carried out. The reason is that we want to ensure there is at least on inserted mark and at the same time we do not want to insert too many punctuation marks as too much noise might have a negative effect on the model, although this effect can be investigated in future work. Then, positions in the sequence are also specified in random as many as the selected number in the previous step. In the end, for each chosen position, a punctuation mark is picked randomly from the six punctuation marks in {".", ";", "??", ": ", !", ";"}. Table 1 shows three augmentation samples by the AEDA technique. + +
Originala sad , superior human comedy played out on the back roads of life .
Aug 1a sad , superior human comedy played out on the back roads ; of life ; .
Aug 2a , sad . , superior human ; comedy . played . out on the back roads of life .
Aug 3: a sad ; , superior ! human : comedy , played out ? on the back roads of life .
+ +Table 1: Examples of the augmented data using the AEDA technique. + +# 4 Experimental Setup + +Since we compare our proposed method with Wei and Zou (2019), we used the same codebase as theirs with no changes in the implementation of the models. We executed the code using a GeForce RTX 2070 GPU with 8 GB of memory. + +# 4.1 Datasets + +We experiment with the same five datasets as our baseline. They include SST2 (Socher et al., 2013) Standford Sentiment Treebank, CR (Hu and Liu, 2004; Ding et al., 2008; Liu et al., 2015) Customer Reviews dataset, SUBJ (Pang and Lee, 2004) Subjectivity/Objectivity dataset, TREC (Li and + +Roth, 2002) Question Classification dataset, and PC (Ganapathibhotla and Liu, 2008) Pros and Cons dataset. Table 2 shows the statistics of the utilized datasets. + +
DatasetNclassLavgNtrainNtest|V|
SST-22197791182115771
CR21940674519048
SUBJ2259000100022715
TREC61054525009448
PC2740000580626090
+ +Table 2: Statistics of the utilized datasets. $\mathrm{N}_{\text{class}}$ : Number of classes, $\mathrm{L}_{\text{avg}}$ : Sentence average length, $\mathrm{N}_{\text{train}}$ : Number of training samples, $\mathrm{N}_{\text{test}}$ : Number of test samples, |V|: Number of unique words. + +The train and test sets utilized for the experiments for these datasets were not made available by the baseline. Therefore, after collecting them, we shuffled and divided them into train and test sets with almost the same size as the ones reported by the baseline. For the CR dataset, we combined all the reviews from the three cited sources. The annotations included multiple target sentiments for each sentence. Therefore, to convert them into binary classes, we considered a sentence positive if there was no negative sentiment and negative if there was no positive sentiment. The datasets are available along the source code. + +# 4.2 Models + +To be consistent as well as for a fair comparison of the effects of EDA- and AEDA-augmented data, we used the same Recurrent Neural Network (RNN) (Liu et al., 2016) and Convolutional Neural Network (CNN) (Kim, 2014) as implemented in the baseline. For the initialization of the models, GloVe word vectors (Pennington et al., 2014) were utilized. + +# 5 Results + +[h] To evaluate the quality of augmented sentences, we performed experiments using the data augmented by both EDA and AEDA as well as the original data. For the results reported in Table 3, we added 16 augmentations and for the ones in Figure 2, 9 augmentations to be consistent with the baseline. All experiments were repeated with 5 different seed numbers and the average scores are reported. + +
ModelTraining set size
5002,0005,000full set
RNN73.582.685.987.9
+EDA76.181.385.286.5
+AEDA77.883.987.288.6
CNN76.583.887.087.9
+EDA77.582.284.586.1
+AEDA78.584.486.588.1
Average75.083.286.587.9
+EDA76.881.884.986.3
+AEDA78.284.286.988.4
+ +Table 3: Comparing average performance of EDA and AEDA across all datasets on different training set sizes. For each training sample, 16 augmented sentences were added. Scores are the average of 5 runs. Numbers are in percentages. + +# 5.1 AEDA Outperforms EDA + +The results of the experiments with 500, 2000, 5000 and full dataset sizes for training are reported in Table 3. We can see that in some small datasets, EDA improves the results while for bigger ones it has a negative effect on the performance of the models. Conversely, AEDA gives a performance boost on all datasets, showing greater boosts for smaller ones. For instance, with 500 sentences, the average absolute improvement is $3.2\%$ while for full dataset it is $0.5\%$ . The reason why EDA does not perform well can be attributed to the operations such as deletion and substitution which insert more misleading information to the network as the number of augmentations grows. In contrast, AEDA keeps the original information in all augmentations. + +# 5.2 Trend on Training Set Sizes + +Figure 2 shows how both models perform on different fractions of the training set. These fractions include $\{1,5,10,20,30,40,50,60,70,80,90,100\}$ percent. We can see that AEDA outperforms EDA in all tasks as well as showing improvements over the original data. One observation to point out is that also EDA works well on small datasets which can be because of lower number of augmentations compared to the ones reported in Table 3. + +# 6 Ablation Study + +In this section, we investigate how much gain there is for different number of augmentations, the effect of random initialization, and whether AEDA can improve deep models. + +![](images/2d35db6a38ba2ca43d1e5325d80aea0b41c26194c39f0168e078b174b9ee9235.jpg) +(a) SST-2 + +![](images/8404937904dfa9be7c966e6115e3daec3d498d352d1c49c8398df2346e7a1699.jpg) +(b) CR + +![](images/b4c2ff819450726158dada780cfb51c58e4dd78b0cad9b15a34c6ef383cd447b.jpg) +(c)SUBJ + +![](images/902181c251c188104fb86ea4ee9d832e01c76021a14840c0aa649dfeb585dd99.jpg) +(d) TREC + +![](images/e586553c5b6ecd8eaaffe3f9b30fbb9b9dd27eb32c81749da55e2b0bc6482e23.jpg) +(e) PC + +![](images/c98b3929924d076e84779be666d59b04c9c855c10f13d3e506cf56cdd3755a68.jpg) +Figure 2: Performance of the RNN model trained on various proportions of the original, EDA-generated, and AEDA-generated training data for five text classification tasks. All the scores are the average of 5 runs. +Figure 3: Impact of number of augmentations on the performance of the RNN model trained on various training sizes. Scores are the average of 5 runs over the five datasets. The $y$ axis shows the percentage of improvement. + +# 6.1 Number of Augmentations + +Figure 3 presents the impact of adding various numbers of augmentations to the training set. We can see that only one augmentation can improve the performance by an absolute amount of $1.5\%$ to $2.5\%$ for all dataset sizes. However, as the augmentations increase, the smallest dataset greatly benefits from that by an improvement of almost $4\%$ while the full dataset only gains $1\%$ . The middle-sized ones + +![](images/6eff9548a96ff3f78bbb97b0f1a9149070778c636216a8099532bfb08a74c3eb.jpg) +(a) CR +Figure 4: Average performance of EDA and AEDA over 21 different seed numbers. The results are in line with the experiments run over 5 seeds. + +![](images/3cfe8796d72ee28ec4819533665b94e08039a595a159bd073b18e04d2e411c89.jpg) +(b) TREC + +have a gain in between $(2\%$ to $2.5\%)$ + +# 6.2 Effect of Random Initialization + +When conducting the experiments, we noticed that different seed numbers produce different results. As a result, we ran the experiments for 5 times. However, in each run with the same seed number, the results can be slightly different due to the local and global generators in TensorFlow. Therefore, to ensure that 5 runs show the correct trend, we chose two of the datasets (CR and TREC) and ran the models for 21 different seeds (zero to 20). From Figure 4, we see that the trend is similar to Figure 2, which shows the average results of 5 seeds. + +# 6.3 Using AEDA with Deep Models + +The performance of AEDA on a deep model such as BERT is mixed. Table 4 shows the results of our experiments with the BERT model. We trained the model used in (Kumar et al., 2020) for 3 epochs with its default settings and observed that adding one augmentation for each training sample increased the performance by $0.15\%$ for SST2 and $0.76\%$ for TREC while making it deteriorate slightly for the others. However, in all cases, except for the CR dataset, it still outperforms the EDA method. The reason why AEDA does not always help a deep model can be the fact that pre-trained models have already seen a considerable amount of data with possibly similar noises to AEDA. Nevertheless, it is worth noting that, as we saw for RNN and CNN models, adding more augmentations might be more advantageous especially for small fractions of the datasets. This can be explored in the future work. + +
ModelSST2CRSUBJTRECPC
BERT91.8590.5597.0496.4896.40
+EDA91.8590.5596.2496.8496.08
+AEDA92.0090.4296.8697.2496.13
+ +Table 4: Comparing the impact of EDA and AEDA on the BERT model. The model was trained on the combination of the original data and one augmentation for each training sample. The scores are the average of 5 runs. + +# 7 Discussion + +Comparing the results that we have gained in our experiments with the ones reported in Wei and Zou (2019), we can see some discrepancy, especially in the impact of EDA on improving the performance of the models. We speculate that the difference can be caused by the inconsistency in the training and test sets. Although we obtained the datasets from the same references they have specified, some of them are not divided into train and test datasets ready to be used. As mentioned in Section 4.1, we randomly divided them into train and test sets. In addition, some of them have different sizes which can produce different results. + +With that said, to conduct a fair evaluation, we kept the same setting for all comparisons in terms of the utilized library and source code, train and test sets, number of augmentations, number of runs, batch size, and learning rate. + +# 8 Conclusion and Future Work + +We proposed an easy data augmentation technique for text classification tasks. Extensive experiments on five different datasets showed that this extremely simple method which uses punctuation marks outperforms the EDA technique which includes random deletion, insertion, and substitution of words, on all the utilized datasets. The future work will focus on exploiting the proposed method regarding which punctuation marks can have more impact, which ones to add or discard, and how many of them can be used to achieve a better performance. In addition, the question whether the punctuation marks should be inserted randomly or some positions are more effective will be investigated. + +# References + +Jacob Andreas. 2020. Good-enough compositional data augmentation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7556-7566. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 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, Volume 1 (Long and Short Papers), pages 4171-4186. +Bosheng Ding, Linlin Liu, Lidong Bing, Canasai Kruengkrai, Thien Hai Nguyen, Shafiq Joty, Luo Si, and Chunyan Miao. 2020. Daga: Data augmentation with a generation approach for low-resource tagging tasks. arXiv preprint arXiv:2011.01549. +Xiaowen Ding, Bing Liu, and Philip S Yu. 2008. A holistic lexicon-based approach to opinion mining. In Proceedings of the 2008 international conference on web search and data mining, pages 231-240. +Marzieh Fadaee, Arianna Bisazza, and Christof Monz. 2017. Data augmentation for low-resource neural machine translation. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 567-573. +Murthy Ganapathibhotla and Bing Liu. 2008. Mining opinions in comparative sentences. In Proceedings of the 22nd International Conference on Computational Linguistics (Coling 2008), pages 241-248. +Siddhant Garg and Goutham Ramakrishnan. 2020. Bae: Bert-based adversarial examples for text classification. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6174-6181. + +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, pages 168-177. +Zhiting Hu, Bowen Tan, Russ R Salakhutdinov, Tom M Mitchell, and Eric P Xing. 2019. Learning data manipulation for augmentation and weighting. Advances in Neural Information Processing Systems, 32:15764-15775. +Xiaoqi Jiao, Yichun Yin, Lifeng Shang, Xin Jiang, Xiao Chen, Linlin Li, Fang Wang, and Qun Liu. 2020. Tinybert: Distilling bert for natural language understanding. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: Findings, pages 4163-4174. +Akbar Karimi, Leonardo Rossi, and Andrea Prati. 2021. Adversarial training for aspect-based sentiment analysis with bert. In 2020 25th International Conference on Pattern Recognition (ICPR), pages 8797-8803. IEEE. +Yoon Kim. 2014. Convolutional neural networks for sentence classification. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1746-1751. +Sosuke Kobayashi. 2018. Contextual augmentation: Data augmentation by words with paradigmatic relations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), pages 452-457. +Varun Kumar, Ashutosh Choudhary, and Eunah Cho. 2020. Data augmentation using pre-trained transformer models. In Proceedings of the 2nd Workshop on Life-long Learning for Spoken Language Systems, pages 18-26. +Xin Li and Dan Roth. 2002. Learning question classifiers. In COLING 2002: The 19th International Conference on Computational Linguistics. +Pengfei Liu, Xipeng Qiu, and Xuanjing Huang. 2016. Recurrent neural network for text classification with multi-task learning. In Proceedings of the Twenty-Fifth International Joint Conference on Artificial Intelligence, pages 2873-2879. +Qian Liu, Zhiqiang Gao, Bing Liu, and Yuanlin Zhang. 2015. Automated rule selection for aspect extraction in opinion mining. In Twenty-Fourth international joint conference on artificial intelligence. +Ruibo Liu, Guangxuan Xu, Chenyan Jia, Weicheng Ma, Lili Wang, and Soroush Vosoughi. 2020. Data boost: Text data augmentation through reinforcement learning guided conditional generation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 9031-9041. + +Bo Pang and Lillian Lee. 2004. A sentimental education: Sentiment analysis using subjectivity summarization based on minimum cuts. In Proceedings of the 42nd Annual Meeting of the Association for Computational Linguistics (ACL-04), pages 271-278. +Jeffrey Pennington, Richard Socher, and Christopher D Manning. 2014. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pages 1532-1543. +Anton Ragni, Kate M Knill, Shakti P Rath, and Mark JF Gales. 2014. Data augmentation for low resource languages. In INTERSPEECH 2014: 15th Annual Conference of the International Speech Communication Association, pages 810-814. International Speech Communication Association (ISCA). +Rico Sennrich, Barry Haddow, and Alexandra Birch. 2016. Improving neural machine translation models with monolingual data. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 86-96. +Richard Socher, John Bauer, Christopher D Manning, and Andrew Y Ng. 2013. Parsing with compositional vector grammars. In Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 455-465. +Lichao Sun, Congying Xia, Wenpeng Yin, Tingting Liang, S Yu Philip, and Lifang He. 2020. Mixup-transformer: Dynamic data augmentation for nlp tasks. In Proceedings of the 28th International Conference on Computational Linguistics, pages 3436-3440. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 6000-6010. +William Yang Wang and Diyi Yang. 2015. That's so annoying!!!: A lexical and frame-semantic embedding based data augmentation approach to automatic categorization of annoying behaviors using# petpeeve tweets. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 2557-2563. +Jason Wei and Kai Zou. 2019. Eda: Easy data augmentation techniques for boosting performance on text classification tasks. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 6383-6389. +Xing Wu, Shangwen Lv, Liangjun Zang, Jizhong Han, and Songlin Hu. 2019. Conditional bert contextual + +augmentation. In International Conference on Computational Science, pages 84-95. Springer. +Ziang Xie, Sida I Wang, Jiwei Li, Daniel Lévy, Aiming Nie, Dan Jurafsky, and Andrew Y Ng. 2019. Data-noising as smoothing in neural network language models. In 5th International Conference on Learning Representations, ICLR 2017. +Xiang Zhang, Junbo Zhao, and Yann LeCun. 2015. Character-level convolutional networks for text classification. In Proceedings of the 28th International Conference on Neural Information Processing Systems-Volume 1, pages 649-657. \ No newline at end of file diff --git a/aedaaneasierdataaugmentationtechniquefortextclassification/images.zip b/aedaaneasierdataaugmentationtechniquefortextclassification/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..4e60a1c414929e2a41715f6754fae4a6688df451 --- /dev/null +++ b/aedaaneasierdataaugmentationtechniquefortextclassification/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba6fd5f49aec4f6d9ead47737226bd5607710ff0a682254e995b23577bb902e2 +size 297838 diff --git a/aedaaneasierdataaugmentationtechniquefortextclassification/layout.json b/aedaaneasierdataaugmentationtechniquefortextclassification/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..b195fea9722306900ac89fb913b91f3eee899451 --- /dev/null +++ b/aedaaneasierdataaugmentationtechniquefortextclassification/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17c39c1a759bfebf2ba2ce01402280339cde87fe5938a2a1c183470215a4f3a7 +size 196517 diff --git a/afinergrainuniversaldialoguesemanticstructuresbasedmodelforabstractivedialoguesummarization/f559c80a-78e4-4e66-b924-f64727edc1b6_content_list.json b/afinergrainuniversaldialoguesemanticstructuresbasedmodelforabstractivedialoguesummarization/f559c80a-78e4-4e66-b924-f64727edc1b6_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..b8fb8e88096d297f68171acc2e44e8241f082266 --- /dev/null +++ b/afinergrainuniversaldialoguesemanticstructuresbasedmodelforabstractivedialoguesummarization/f559c80a-78e4-4e66-b924-f64727edc1b6_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4cb07680a7adab64e53b2b0800840eee2c0f9a74ecdceef2aeacd7789540eae +size 76104 diff --git a/afinergrainuniversaldialoguesemanticstructuresbasedmodelforabstractivedialoguesummarization/f559c80a-78e4-4e66-b924-f64727edc1b6_model.json b/afinergrainuniversaldialoguesemanticstructuresbasedmodelforabstractivedialoguesummarization/f559c80a-78e4-4e66-b924-f64727edc1b6_model.json new file mode 100644 index 0000000000000000000000000000000000000000..bb6ad1e7c495b269f1f36ed846589758263f15d4 --- /dev/null +++ b/afinergrainuniversaldialoguesemanticstructuresbasedmodelforabstractivedialoguesummarization/f559c80a-78e4-4e66-b924-f64727edc1b6_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:380e27b8ad6a33fae2c8475c92ca5579699c51c108cf2b4424ad8102c4e33f4d +size 94895 diff --git a/afinergrainuniversaldialoguesemanticstructuresbasedmodelforabstractivedialoguesummarization/f559c80a-78e4-4e66-b924-f64727edc1b6_origin.pdf b/afinergrainuniversaldialoguesemanticstructuresbasedmodelforabstractivedialoguesummarization/f559c80a-78e4-4e66-b924-f64727edc1b6_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..468a941bd413b3a447ac600928e5f880567d3845 --- /dev/null +++ b/afinergrainuniversaldialoguesemanticstructuresbasedmodelforabstractivedialoguesummarization/f559c80a-78e4-4e66-b924-f64727edc1b6_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a28adf35085861ca61f1ee7eec8f8a1de697c4372f35a698f91d6fb156267aeb +size 792002 diff --git a/afinergrainuniversaldialoguesemanticstructuresbasedmodelforabstractivedialoguesummarization/full.md b/afinergrainuniversaldialoguesemanticstructuresbasedmodelforabstractivedialoguesummarization/full.md new file mode 100644 index 0000000000000000000000000000000000000000..c9aa71f1b6714f7df6a11b9e533f320f3c2867e0 --- /dev/null +++ b/afinergrainuniversaldialoguesemanticstructuresbasedmodelforabstractivedialoguesummarization/full.md @@ -0,0 +1,350 @@ +# A Finer-grain Universal Dialogue Semantic Structures based Model For Abstractive Dialogue Summarization + +Yuejie Lei $^{1*}$ Fujia Zheng $^{1*}$ Yuanmeng Yan $^{1}$ Keqing He $^{2}$ Weiran Xu $^{1}$ + +1Beijing University of Posts and Telecommunications, Beijing, China + +$^{2}$ Meituan Inc., Beijing, China + +{2019110830,fujia_zheng,yanyuanmeng,xuweiran}@bupt.edu.cn + +hekeqing@meituan.com + +# Abstract + +Although abstractive summarization models have achieved impressive results on document summarization tasks, their performance on dialogue modeling is much less satisfactory due to the crude and straight methods for dialogue encoding. To address this question, we propose a novel end-to-end Transformer-based model FinDS for abstractive dialogue summarization that leverages Finer-grain universal Dialogue semantic Structures to model dialogue and generates better summaries. Experiments on the SAMsum dataset show that FinDS outperforms various dialogue summarization approaches and achieves new state-of-the-art (SOTA) ROUGE results. Finally, we apply FinDS to a more complex scenario, showing the robustness of our model. We also release our source code1 + +# 1 Introduction + +The field of abstractive summarization has recently seen impressive progress in document scenarios, while less attention has been paid to dialogue summarization. Previous research on dialogue summarization is based on successful document summarization models (Nallapati et al., 2016; See et al., 2017; Nikolov et al., 2018; Liu et al., 2018) which model the dialogue in a crude and straight manner. Taking the example of Table 1, the truth in this dialogue is that Mark lied to Anne, and that passport belongs to Mark, but the summary generated by Pointer-Generator Network (PGN) makes some factual error, which is denoted by (the comparison between) red and blue text in Table 1. Moreover, the predicted summary omits the critical information in the dialogue, as shown in the green text. + +Such factual errors indicate that it is not suitable to transfer the document summarization model to the dialogues summarization model. This is mainly + +# Dialogue Scripts + +Anne: You were right, he was lying to me :/ + +Irene: Oh no, what happened? + +Jane: Who? That Mark guy? + +Anne: Yeah, he told me he's 30, + +today I saw his passport - he's 40. + +Irene: You sure it's so important? + +Anne: He lied to me Irene. + +Ground-Truth Summary: + +Mark lied to Anne about his age. Mark is 40. + +Pointer-Generator Prediction: + +Anne was lying today. + +Anne saw her passport today. + +Table 1: A dialogue example from SAMsum (Gliwa et al., 2019) with a ground-truth summary and a summary predicted by Pointer Generator Networks. + +because, unlike the document, the dialogue serves the purpose of information exchange. It naturally contains more than one participants (Zhang et al., 2019) and multiple topics in many turns of utterances, (Xiao and Carenini, 2019) and hence the core information is distributed randomly. Besides, every speaker talks in a first-person perspective, which brings referral and coreference due to human language habit (Lei et al., 2021; Chen and Yang, 2021a). Straightly concatenating and sequentially understanding the dialogue might capture some erroneous and redundant semantic relationships between speakers and utterances. (Gao et al., 2020) Therefore, the dialogue summarization task is facing different challenges from document summarization: + +- Compared with the structural and logical writing style of document, dialogue is always unstructured, informal, and complex. Core information is randomly distributed in the whole dialogue. Sequential encoding is difficult to capture key information correctly. +- There are naturally multiple speakers in the dialogue, and how to capture the dependency between different speakers and utterances are + +important for the understanding of dialogue. + +Based on the understanding of these potential risks of dialogue scenario, recent work focuses on developing methods suitable for this dialogue summarization: Shang et al. (2018) develops an unsupervised multi-sentence compression algorithm, while Zhao et al. (2019) proposes a self-adaptive learning model to learn the segmentation strategy of utterances and topics. These methods are modified based on document summarization methods. Others also introduces some models designing specially for dialogue summarization: Liu et al. (2019b); Li et al. (2019); Zou et al. (2020) leverages the topic information that flows in the dialogue to help generate topic-aware summaries, Goo and Chen (2018); Liu et al. (2019a) manually annotates the dialogue to construct some prior structural knowledge which helps the model obtain a more informative and accurate context. Chen and Yang (2020) introduces two model-annotated dialogue structural views to help encode the utterances. Unfortunately, these jobs remain at a coarse level that can not correctly capture the relationships between speakers and utterances and topics. Some of them are time and labor-consuming or contain error superposition because of some handcrafted or model-based label. + +Accordingly, we propose a novel end-to-end Transformer-based (Vaswani et al., 2017) model FinDS equipped with four Finer-grain universal Dialogue semantic Structures. To meet the first challenge, we propose Inner Utterance semantic Structure (IUS) and Global Topic semantic Structure (GTS) that helps the understanding of the dialogue from utterance-level to topic-level: The IUS only focuses on the information inside each utterance, as Figure 1(a) shows. The GTS connects utterances according to the topic that they are talking about, as Figure 1(b) shows. In response to the second challenge, we introduce Inner Speaker semantic Structure (InSS) and Inter Speaker semantic Structure (ItSS) to help model clarify the correct relationships between speakers and their topics: The InSS only focuses on the information from the same speaker, as Figure 1(c) shows. The ItSS interacts with the information from one speaker to other speakers except for himself, as Figure 1(d) shows. All these structures are constructed based on the universal characteristic of dialogue previously in an automatic method. With the help of these finer-grain universal dialogue semantic + +structures, our FinDS model performs effectively and robustly for dialogue summarization. Our contributions are three-fold: + +(1) We develop a novel end-to-end Transformer-based model FinDS for abstractive dialogue summarization which models the dialogue with four pre-constructed universal dialogue semantic structures. +(2) We propose to construct four kinds of dialogue semantic structures in an automatic method to assist FinDS for better dialogue summarization: IUS focuses on the information inside each utterance; GTS connects utterances with the same topic; InSS focuses on the information from the same speaker; ItSS interacts the information from one speaker to other speakers except for himself. +(3) Extensive experiments on the SAMsum dataset present a comparable result compared with many strong baselines. The further analysis presents that FinDS performs robust and effective when the dialogue scenario getting complex. + +# 2 Related Works + +# 2.1 Document Summarization + +Document summarization has received extensive attention in recent years, on which a lot of works have been done, and has achieved many successes. Rush et al. (2015) proposes an abstractive text summarization method by using sequence-to-sequence models originally. To address the out-of-vocabulary problem, See et al. (2017) introduces a pointer-generator network to allow the model to copy tokens from the source document. Paulus et al. (2017); Chen and Bansal (2018) achieves the goal of generating summarization by selecting appropriate content in the original document as summary sentences on the reinforcement learning framework. The performance of document summarization has also been further improved by using large-scale pre-trained language models proposed by Liu and Lapata (2019b); Raffel et al. (2019); Lewis et al. (2019), and Zhang et al. (2020) designs a new pre-training task for document summarization and achieved remarkable success. + +# 2.2 Dialogue Summarization + +While document summarization gains such great success, intensive research on dialogue summarization is also underway. Shang et al. (2018) introduces Multi-Sentences Compression Graph (MSCG) for meeting summarization, by choos + +![](images/5d86a2d73854044f015d78e24a9870610a981909e49d27bd78542d3820bed897.jpg) +Figure 1: The construction of four universal dialogue semantic structures including IUS, GTS, INSS, and ITSS. + +ing the correct path to compress sentences. Zhao et al. (2019); Zhu et al. (2020) proposes hierarchical models to obtain multi hierarchical-grain semantic representations to identify the turns, or utilizes role vectors to capture dialogue information. A few research also focus on utilizing external knowledge as features of the conversation. Goo and Chen (2018) captures the dialogue states changing during the dialogue by recording the dialogue acts. Other features like key points sequence (Liu et al., 2019a) and topics sequence (Liu et al., 2019b; Li et al., 2019) are also applied in dialogue summarization methods. However, such external knowledge is a human-annotated or model-based label which might be time and labor-consuming or include extra errors. + +# 3 Method + +To capture the core topics and build up a correct dependency between speakers and utterances at a finer-grain level, we propose to model the complex dependencies in the dialogue with the following procedures: (1) Constructing IUS, GTS, InSS, and ItSS in an automatic way (Section 3.2). (2) Encoding the dialogue by modifying self-attention processing with four dialogue semantic structures (Section 3.3). (3) The decoder receives the context from the encoder to predict a summary. + +# 3.1 Motivation of Semantic Structures + +To understand a dialogue, firstly, we must tell the model what each utterance is telling exactly. Because each speaker is talking sequentially and they + +are talking about a different topic sometimes. So we build up IUS to model the single utterance first. Once the model is able to understand the dialogue utterance by utterance, we can go further to teach the model to distinguish the topic of each speaker and the relationships between topics by building up InSS and ItSS. However, the topics flow in different speakers is sometimes facing interrupting and jumping. We need to construct closer relationships between topics and utterances. So we leverage the ConceptNet to build up the GTS to captures those relationships. + +# 3.2 Semantic Structures Construction + +This section describes the automatic constructing process of our four universal dialogue structures. Formally, for a given dialogue $D = \{w_{0,0}^{0}, w_{1,0}^{0}, \dots, w_{l,n}^{m}\}$ with $l$ words in total, we can figure out the speaker of each utterance according to the first word of each utterance, which is the speaker's name. So we denote $w_{l,n}^{m}$ as the $l$ -th word in the $n$ -th utterance from the $m$ -th speaker. Then we take words as the Elementary Discourse Units (EDUs) to construct four dialogue semantic structures, $G^{IUS}$ (Section 3.2.1), $G^{GTS}$ (Section 3.2.2), $G^{InSS}$ (Section 3.2.3), and $G^{ItSS}$ (Section 3.2.4): + +# 3.2.1 Inner Utterance Semantic Structures + +Utterances in dialogue are not organized sequentially as documents due to the repetition and interruption, which also explains why core contents of the same speaker randomly distributed in the dialogue. And there is naturally more than one speaker in the dialogue, which makes it harder to + +![](images/668c09f1c541d5745646599740183317c01b28254775d48706167b040f39b1fe.jpg) +Figure 2: The overall architecture of FinDS is demonstrated and it is enhanced by four different universal dialogue semantic structures IUS, InSS, ItSS, and GTS. + +capture the correct dependencies between speakers and their topics. For example, speaker A claims "I like to eat apple", while the other speaker B says "I prefer banana". In this situation, If we model the dialogue in a document summarization way, the attention might confuse speaker A's and speaker B's favorite fruits. Hence, before building up the relationships between speakers and their topics, we capture the local dependencies (Liu and Lapata, 2019a; Jin et al., 2020) inside each utterance by constructing Inner Utterance semantic Structure (IUS) as a graph $G^{IUS} = (D, E^{IUS})$ , where $D$ is the set of nodes that represent EDUs and $E^{IUS}$ is the adjacent matrix that describes the connection of each node inside the same utterance as Figure 1(a) shows. + +# 3.2.2 Global Topics Semantic Structures + +As mentioned above, the topics of different speakers are distributed randomly in the dialogue. and the meaning of each utterance is not isolated (Qin et al., 2017). Therefore we follow (Feng et al., 2020) to build up the Global Topic semantic Structures (GTS) as a graph $G^{GTS} = (D,E^{GTS})$ , where $D$ is the set of nodes that represent EDUs and $E^{GTS}$ is the adjacent matrix that describes the connection of each node according to the topic information. The topic information was collected by the commonsense knowledge graph ConceptNet (Speer and Havasi, 2012). For any subject $s$ in the ConceptNet, it will have an object $o$ and the relationship $r$ + +between them with a confidential weight $w$ . They will form a concept tuple like $c = (s, r, o, w)$ . We input all words in the dialogue except real names and stopwords into ConceptNet and get concept tuple sets $C = \{c_{1,1}, c_{2,1}, \dots, c_{i,k}, \dots, c_{m,l}\}$ , where $c_{i,k}$ represents a concept tuple obtained by using the word $w_{i,k}^{j}$ as the query for ConceptNet. And if any two concept tuples from different utterances $c_{i,j}$ , $c_{p,q}$ has the same object $o$ , we consider that the utterances they belong to are talking about the same topic. For example, if speaker A says "I don't have his number" while speaker B says "I called him yesterday", we can search the same object "phone calling" by matching the query word "number and called from the ConceptNet. Then we believe they are talking about the same topic "phone calling. According to such topic information, we can preconstruct the GTS for capturing the dependencies between topics and utterances as Figure 1(b) shows. + +# 3.2.3 Inner Speaker Semantic Structures + +Building up the dependencies between speakers and utterances (Murray et al., 2006) are of the same importance as the dependencies between utterances and topics. Because, a topic might have multiple participants, and the utterances from different speakers are usually unstructured and illogical because of the alternation and informality (Jackson and Moulinier, 2007) of utterances. So, we proposed to regroup the utterances and initially understand the main ideas of every speaker. We construct + +the Inner Speaker semantic Structure (InSS) as a graph $G^{InSS} = (D, E^{InSS})$ , where $D$ is the set of nodes that represent EDUs and $E^{InSS}$ is the adjacent matrix that describes the connection of each node from the same speaker as Figure 1(c) shows. + +# 3.2.4 Inter Speaker Semantic Structures + +The ideas of every speaker are not narrated isolat- edly. Because dialogue carries the function of information exchange between people. To capture the dependencies between different speakers, we construct the Inter Speaker semantic Structures (ItSS) as a graph $G^{ItSS} = (D,E^{ItSS})$ , where $D$ is the set of nodes that represent EDUs and $E^{ItSS}$ is the adjacent matrix that describes that every node connects to those nodes coming from other speakers as Figure 1(d) shows. + +# 3.3 Encoder + +Given a dialogue and its pre-constructed dialogue semantic structures, we propose a Structures Fusion Encoder (SFE) to obtain a structure-aware dialogue hidden representation by combining and interacting dialogue with four structures as Figure 2 shows. + +# 3.3.1 Structures Fusion Encoder + +We initialize our Structures Fusion Encoder $F_{SFE}(.)$ with a pre-trained encoder, i.e., BART-large (Lewis et al., 2019), and incorporate four structures into the self-attention calculation processing to encode all words $D = \{w_{0,0}^{0}, w_{1,0}^{0}, \dots, w_{l,n}^{m}\}$ in dialogue into its hidden representation. To do so, we regard four pre-constructed structures as four mask matrixes $M^{IUS}, M^{GTS}, M^{InSS}, M^{ItSS}$ that have the same shape with the similarity matrix calculated by the Cartesian product by query and key. Then, we combine this similarity matrix and four mask matrix to influence the final attention weights and the hidden representation: + +$$ +\left\{h _ {0, 0} ^ {0}, \dots , h _ {l, n} ^ {m} \right\} = F _ {S F E} \left(D, M ^ {I U S}, M ^ {G T S}, M ^ {I n S S}, M ^ {I t S S}\right) \tag {1} +$$ + +Then, we introduce the Structures Fusion(SFA) Self-Attention to fuse the dialogue hidden representation with four structure mask matrixes: + +Structures Fusion Self-Attention(SFA) The SFA module follows standard multi-head attention (MHA) to calculate four different attention results by superposing different structure mask matrixes + +
SAMsumTrainValidationTest
Sizes14732818819
Max.Speakers4129
Max.Turns463027
Avg.Speakers2.402.392.36
Avg.Turns11.1710.8311.25
Most.Speakers2(10723)2(605)2(624)
Most.Turns6(1309)6(87)6(86)
+ +Table 2: Details of SAMsum + +directly to the original attention weights to modify original attention scores, and finally obtain a structure-aware hidden representation: + +$$ +S F A = \text {C o n c a t} \left\{\text {h e a d s} ^ {M _ {0}}, \dots , \text {h e a d s} ^ {M _ {j}} \right\} W ^ {L} \tag {2} +$$ + +$$ +h e a d s ^ {M _ {j}} = \left\{h e a d _ {1} ^ {j}, h e a d _ {2} ^ {j}, \dots , h e a d _ {i} ^ {j} \right\} \tag {3} +$$ + +$$ +M _ {j} \in \left\{M ^ {I U S}, M ^ {G T S}, M ^ {I n S S}, M ^ {I t S S} \right\} \tag {4} +$$ + +$$ +\operatorname {h e a d} _ {i} ^ {j} = \operatorname {S o f t m a x} \frac {\left(Q W _ {i} ^ {Q}\right) \left(K W _ {i} ^ {K}\right) ^ {T} \cdot M _ {j}}{\sqrt {d _ {K}}} V W _ {i} ^ {V} \tag {5} +$$ + +where, $W^{Q}, W^{K}, W^{W}, W^{L}$ are trainable parameters, $Q, K, V$ are query, key, value in the self-attention calculation process. + +# 3.4 Decoding and Training + +At decoding stage, FinDS follows standard transformer decoding approach. The decoder $F_{D}$ receives the $l - 1$ previous generated tokens $t_1, t_2, \dots, t_{l-1}$ and predicts the $l$ -th token with the finer-grain structure-aware context from SFE: + +$$ +c _ {l} = F _ {D} \left(\left\{t _ {1}, t _ {2}, \dots , t _ {l - 1} \right\}, F _ {S F E} (D)\right) \tag {6} +$$ + +$$ +P \left(\hat {t} _ {l} \mid t _ {< l}, c _ {l}\right) = \operatorname {S o f t m a x} \left(W _ {p} c _ {l}\right) \tag {7} +$$ + +where, $W_{p}$ is a parameter to be learned. + +And the training objective is to minimize the cross entropy loss: + +$$ +L = - \sum \log P \left(\hat {t} _ {l} \mid t _ {< l}, c _ {l}\right) \tag {8} +$$ + +Additionally, we also apply the teacher forcing strategy: When training, the inputs of decoder are previous tokens from the ground truth summary. And, at test time, the inputs are previous tokens predicted by the decoder. + +# 4 Experiments + +# 4.1 Experiment Settings + +We evaluate our FinDS on a dialogue summarization dataset SAMsum (Gliwa et al., 2019) $^{2}$ which is written by language experts. Details of the dataset conditions are shown in Table 2. We load $^{3}$ the pre-trained sequence-to-sequence model "BARTlarge" $^{4}$ (Lewis et al., 2019) as our baseline, and modify the encoder as our Graph-Interactive Encoder. Normally, We use the Sharpening Interaction(SI) to involving four commonsense semantic graphs. Our model consists of 12 layers in total, 768 model dimensions, 12 heads. And fine-tune it with $3e^{-5}$ learning rate, 4 batch size, 512 max sequence length, and 15 max training epoch. All of our experiments are running on an Ubuntu 18.04 platform with two NVIDIA GeForce GTX 2080Ti GPUs. At testing stage, we follow (Chen and Yang, 2020) use the pltrdy-rouge $^{5}$ tool to calculate the ROUGE (Lin, 2004) scores. The baselines our model compares with are describing in the Appendix. + +# 4.2 Experiment Baselines + +- Pointer Generator (See et al., 2017): We input each utterances of the dialogue as division into the model, following (Gliwa et al., 2019). Through pointer mechanism, we generate the summary by generating or copying tokens from origin dialogue. +- Fast Abs RL (Chen and Bansal, 2018): This method first select important sentences from origin text and then rewrite these sentences to an abstractive pattern with sentence-level policy gradient methods. We also follow (Gliwa et al., 2019) to concatenate all utterances into one block. +- Transformer (Vaswani et al., 2017): This model utilizes the self-attention mechanism to parallelize the input text to generate summaries, and has achieved great results on the text summarization task. We use fully visible self-attention on this model, that is, do not + +make any changes to the original mask matrix. + +- LightConv (Wu et al., 2019): To address the problem of the limited ability of self-attention to process long-span sentences, this model proposes a lightweight convolution module. We regard this model as one of our baseline models testing on SAMsum dataset. +- DynamicConv (Wu et al., 2019): Different from lightweight convolution module, the dynamic convolution module only changes in the weight parameters of the convolution. The weight parameters of the former are fixed on each feature map, and the weight of the latter needs to be the dot product based on the fixed value of the former and the feature point of the current position, and its outputs is used as the new wight. +- Multi-View BART (Chen and Yang, 2020): This is the first attempt on modeling dialogue with some dialogue structure information. Specifically, it introduces two extra relatively complicated dialogue-views to model the topics and stages in the dialogue and reach a State-Of-The-Art result on SAMsum so far. +- S-BART (Chen and Yang, 2021b): This work leverages the discourses relationships and speakers' actions to build up two graph explicitly. Combining them into the dialogue encoding and summary predicting procedure, which is the first job to modeling the dependencies between discourses and speakers. + +# 4.3 Experiments Results + +We evaluate FinDS on the SAMsum test set with ROUGE metrics (Lin and Och, 2004; Lin, 2004). As the Table 3 shows, Either PGN (See et al., 2017) or Transformer (Vaswani et al., 2017) performs disappointingly when facing dialogue summarization. The PGN gets the highest scores among those demonstrated traditional document summarization models. When testing on the pretrained model BART-large, all scores improve averagely 10 points than those document models that prove the strong performance from pre-training. Based on BART, Chen and Yang (2020) introduces Multi-view BART that reached the previous SOTA ROUGE scores on the SAMsum dataset. + +Compared with previous baselines, FinDS achieves new SOTA ROUGE results by 52.23 + +
ModelROUGE-1ROUGE-2ROUGE-L
FPRFPRFPR
Pointer Generator (See et al., 2017)40.10--15.28--36.63--
Fast Abs RL (Chen and Bansal, 2018)40.96--17.18--39.05--
Transformer (Vaswani et al., 2017)37.27--10.76--32.73--
LightConv (Wu et al., 2019)33.19--11.14--30.34--
DynamicConv (Wu et al., 2019)33.79--11.79--30.41--
BART (Lewis et al., 2019)48.2049.3054.0024.5025.1026.4046.6047.5049.50
Multi-view BART (Chen and Yang, 2020)49.3051.1052.2025.6026.5027.4047.7049.3049.90
S-BART (Chen and Yang, 2021b)46.0751.1346.2422.6025.1122.8145.0049.8244.47
FinDS52.23*54.74*55.06*25.91*27.39*27.1150.87*52.66*53.15*
FinDS w/o IUS51.6053.9254.1824.9726.2326.0849.8452.9651.89
FinDS w/o GTS50.5754.0752.5424.7826.6125.7049.0451.6350.61
FinDS w/o InSS51.2254.6653.6125.0926.7325.9749.7851.9651.47
FinDS w/o ItSS51.6254.2054.4725.7026.9427.0050.1251.9452.33
+ +Table 3: ROUGE-1, ROUGE-2, ROUGE-L scores that different models perform on SAMsum test set. The numbers with * indicate the significant improvement over all baselines with $p < 0.05$ under t-test. + +![](images/972c9c4a06feeb9c4bd8e27d71e2792767add3c98a268016787b17647cefbc44.jpg) +Figure 3: The changing ROUGE-1 F1 scores as speaker numbers increasing. + +for ROUGE-1-F score, 25.91 for ROUGE-2-F, and 50.87 for ROUGE-L-F. Analyzing the results, FinDS gets nearly 3 points higher than the previous SOTA at 49.30 for ROUGE-1-F and 47.70 for ROUGE-L-F. The ROUGE-2-F score gains 0.3 points higher than the previous SOTA ROUGE-2-F result at 25.60. These results prove that our model can effectively capture those keywords as 1-grams that are distributed randomly in the dialogue, which is contributed by the IUS and GTS for constructing the local context dependencies inside the utterance and the global topic dependencies throughout the dialogue. And because the reference summaries are written by language experts manually that have high-level attractiveness. Therefore, it is difficult for content compression and synonymous rewriting, and neither Multi-view BART nor FinDS can achieve great improvement on the ROUGE-2-F score which represents the ability of a model to capture the core 2-grams in the dialogue for summarization. + +# 4.4 Ablation Experiment + +We also conducted ablation experiments on FinDS. In cases of removing any semantic structure, the ROUGE scores of FinDS are reduced but they are still higher than our baseline BART-large, as Ta + +![](images/56b3b9f41aeb0e701214098087f3e1cde44d67e936271c4f6e93f0ff2844ef4f.jpg) +Figure 4: The changing ROUGE-1 F1 scores as dialogue turns increasing. + +ble 3 shows. This phenomenon shows that each semantic structure contributes to the improvement of FinDS. + +According to the results, it is obvious that GTS and InSS contribute more to the improvement of the model effect, especially GTS. The ROUGE scores of FinDS suffer the highest level reduction while removing InSS structure or GTS structure. And when IUS or ItSS is removed, FinDS suffers less damage on the performance. There are two intuitive explanations for this phenomenon. Firstly, GTS enhances the model's global understanding of dependencies between topics and utterances by introducing external knowledge. Then, by focusing on the dialogue content of each speaker, InSS allows the model to understand the characteristics and core topic of each speaker's discourses respectively, which brings more valuable information for dialogue summarization than capturing the information exchanges between different speakers by ItSS. + +# 5 Analysis + +# 5.1 Effect of Speaker Numbers + +Figure 3 further shows the performance of FinDS when facing increasing speaker numbers from 2 + +![](images/b9a411ba05deae2c58c720555042cd66a29f179d94a92351fedf4b0c57152a55.jpg) +Figure 5: The attention heatmap of BART when encoding dialogue. + +speakers to 5 speakers. We compare FinDS with the PGN model and the BART-large model on the ROUGE-1-F. With the increasing number of speakers, the performance of all models first have an upward trend and obtain a maximum score when reaching 3 speakers, then they all show a downward trend. The performance of the BART model drops sharply as the number of speakers increasing. When the speaker number reaches 5, the performance of the BART model is even worse than that of the PGN model, and FinDS outperforms others stably with an averagely score higher than 45. And the performance gap between FinDS and BART is getting larger when speakers increasing, which proves that FinDS still performs robustly and effectively when facing such a complex dialogue scenario. And it also testifies the InSS and ItSS are efficient for capture the information and modeling the dependencies inside and across the speakers. + +# 5.2 Effect of Dialogue Turns + +Figure 4 shows the performance of FinDS when facing increasing dialogue turns from 3 turns dialogue to 30 turns dialogue. Similar to Section 5.1, we compare FinDS with the PGN model and the BART model on the ROUGE-1-F. The performance of all models experiences an overall downward trend. When dialogue has few turns, BART and FinDS perform much better than PGN. As the speaker number increases, the performance of the PGN model and the BART model approach gradually and experience fluctuating downward. Though FinDS receive some damage on performance as well, it still outperforms enormously the other two all the time, which also proves the robustness and effectiveness of FinDS when facing a complex dia + +![](images/d1d1ded273552329cf8d3e0a12dd432d446a7901fc9594882ed1235abf33baae.jpg) +Figure 6: The attention heatmap of FinDS when encoding dialogue. + +logue scenario. Furthermore, these phenomenons also evidence that IUS and GTS capture the strong dependencies inside and across the utterances even when dialogue has more than 20 turns. + +# 5.3 Attention Heatmap Analysis + +We randomly choose a dialogue sample and draw the attention heat-map when encoding it. The original BART-large pays more attention to the diagonal region which means there is an insufficiency for capturing the global information and remote semantic dependencies when modeling the dialogue as Figure 5 shows. This phenomenon directly evidences the fact that traditional document encoding approaches and the original self-attention are limited and implicit when modeling dialogue. On the contrary, FinDS incorporates four universal dialogue semantic structures to calibrate the direction of self-attention explicitly by capturing finer-grain and remote semantic dependencies as Figure 6 shows. Essentially, the model is forced to attend to the core contents purposefully and has more chance to learn useful information and relationships to help dialogue summarization. + +# 5.4 Human Evaluation + +To verify the improvement of FinDS beyond the ROUGE scores, we randomly choose some predicted summaries to conduct the human evaluation on 5 different model settings. We randomly invite 10 annotators to participate in the human evaluation and sample $10\%$ examples generated by 5 model settings respectively. Given a prediction by FinDS with a specific model setting, a prediction by BART-large, a PGN result, and a ground-truth summary in each evaluation round, we provide all + +
Modelorigin(10%)w/o IUS(10%)w/o GTS(10%)w/o InSS(10%)w/o ItSS(10%)
FinDS+25%+22%+10%+17%+23%
BART1.001.001.001.001.00
PGN-52%-55%-53%-50%-49%
+ +annotators the following guidelines: + +(1) You will not be able to know the given three predictions are predicted by which models. They are all shuffled. +(2) Firstly, you should score all the summaries according to the completeness from 0 to 2. If a summary is incomplete, you should give it a 0 score which means this summary is unreadable and nonsensical. +(3) Secondly, you should score all the summaries according to the informativeness from 0 to 2. If a summary you score 0, it means the summary contains irrelevant and unimportant messages from the dialogue compared to the ground-truth summary. +(4) Thirdly, you should score all the summaries according to the information correctness from 0 to 2. If a summary gets a 0 score, it means that the information in the summary does not conform to the basic facts in the dialogue, though the information might not be relevant and important compared to the ground-truth summary. + +With the pre-defined rules above, there are 3 scores range from 0 to 2 that a summary can get with the consideration of completeness, informativeness, information correctness. And We calculate the average score denotes the quality of the summaries from the same model setting and normalize them by the results of the BART-large model. Therefore we use the scores of the BART-large model as a baseline to evaluate the differences between it and other candidates as Table 4 shows. According to the results, we find that our best model's human-evaluating performance is $25\%$ higher than the baseline. When removing any semantic graph, all scores reduce slightly, but still higher than the baseline. This phenomenon shows that all of our semantic graphs contribute. The removal of GTS has the greatest impact on FinDS which leads to a $15\%$ human-evaluating performance dropping, as it introduces the global relationship of utterances into FinDS as external knowledge. Removing InSS also causes a big blow to the human-evaluating performance of the model with $8\%$ performance dropping. And the overall human-evaluating performance of PGN is dramatically lower than the BART-large. These + +Table 4: The human evaluation result of the ablation FinDS performances and Vanilla PGN compared to the BART. + +
Example 1
Frank: Son, will you come home this weekend? +Son: not sure yet. Something happened? +Frank: Of course not . Your mother is miss you. +Son: I miss her too. +Frank: So will you com? +Son: I will try. +Frank: Good, I will tell your mother that you will come +Son: oh, dad.. ok I will come.
Ground Truth Son is coming to see his parents this weekend.
PGN Pred. Son will come to Frank's mother's home. +FinDS Pred. Son will try to come home this weekend.
Example 2
Anne: You were right, he was lying to me :/. +Irene: Oh no, what happened? +Jane: Who? That Mark guy? +Anne: Yeah, he told me he's 30, +today I saw his passport - he's 40. +Irene: You sure it's so important? +Anne: He lied to me Irene.
Ground Truth Mark lied to Anne about his age. Mark is 40. +PGN Pred. Anne was lying today. Anne saw her passport today. +FinDS Pred. Mark lied to Anne about being 30 .Anne saw his passport today .
+ +Table 5: Two cases to compare between the predictions from FinDS, PGN, and the Ground Truth, red words means wrong massages while green means right content and blue parts highlight the core content. + +phenomenons are conforming to the phenomenons of ablation experiments that demonstrate different extents our dialogue semantic structures contribute to dialogue summarization. + +# 5.5 Case Study + +We also present a case study with two dialogue and their relative summaries. Comparing to the traditional document summarization model, our FinDS can achieve improvement beyond the ROUGE scores, which also shows the predicted summaries are more informative and more correct. FinDS can capture all core contents in the dialogue and turn them into the right message in the summaries while the PGN is failed. + +# 6 Conclusion + +In this paper, we develop a novel end-to-end Transformer-based model FinDS for abstractive dialogue summarization that leverages finer-grain universal dialogue semantic structures to model dialogue and generates better summaries. Experiments have shown FinDS achieves new SOTA results on the ROUGE metrics. More importantly, FinDS proves its robustness and effectiveness for every structure in the complex dialogue scenario. + +# Acknowledgments + +We thank all anonymous reviewers for their helpful comments and suggestions. This work was partially supported by National Key R&D Program of China No. 2019YFF0303300 and Subject II No. 2019YFF0303302, DOCOMO Beijing Communications Laboratories Co., Ltd, MoE-CMCC "Artificial Intelligence" Project No. MCM20190701. + +# Ethical Considerations + +We proposed a novel architecture to address the dialogue summarization tasks. Without extra manual annotations, our method builds up four finer-grain semantic structures from the dialogue to help model. Besides time and labor-saving, this modeling style is full of potential and is relatively not specific to a particular model or application, which will bring inspiration to later researchers to construct useful dialogue structures information and promote the development of current dialogue summarization models or other dialogue-relative tasks. + +# References + +Jiaao Chen and Diyi Yang. 2020. Multi-view sequence-to-sequence models with conversational structure for abstractive dialogue summarization. arXiv preprint arXiv:2010.01672. +Jiaao Chen and Diyi Yang. 2021a. Structure-aware abstractive conversation summarization via discourse and action graphs. ArXiv, abs/2104.08400. +Jiaao Chen and Diyi Yang. 2021b. Structure-aware abstractive conversation summarization via discourse and action graphs. arXiv preprint arXiv:2104.08400. +Yen-Chun Chen and Mohit Bansal. 2018. Fast abstractive summarization with reinforce-selected sentence rewriting. arXiv preprint arXiv:1805.11080. +Xiachong Feng, Xiaocheng Feng, Bing Qin, and Ting Liu. 2020. Incorporating commonsense knowledge into abstractive dialogue summarization via heterogeneous graph networks. arXiv preprint arXiv:2010.10044. +Shen Gao, X. Chen, Z. Ren, Dongyan Zhao, and Rui Yan. 2020. From standard summarization to new tasks and beyond: Summarization with manifold information. ArXiv, abs/2005.04684. +Bogdan Gliwa, Iwona Mochol, Maciej Biesek, and Aleksander Wawer. 2019. Samsum corpus: A human-annotated dialogue dataset for abstractive summarization. arXiv preprint arXiv:1911.12237. + +Chih-Wen Goo and Yun-Nung Chen. 2018. Abstractive dialogue summarization with sentence-gated modeling optimized by dialogue acts. In 2018 IEEE Spoken Language Technology Workshop (SLT), pages 735-742. IEEE. +Peter Jackson and Isabelle Moulinier. 2007. Natural language processing for online applications: Text retrieval, extraction and categorization, volume 5. John Benjamins Publishing. +Hanqi Jin, Tianming Wang, and Xiaojun Wan. 2020. Multi-granularity interaction network for extractive and abstractive multi-document summarization. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6244-6254. +Yuejie Lei, Yuanmeng Yan, Zhiyuan Zeng, Keqing He, Ximing Zhang, and Weiran Xu. 2021. Hierarchical speaker-aware sequence-to-sequence model for dialogue summarization. In ICASSP 2021 - 2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 7823-7827. +Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Ves Stoyanov, and Luke Zettlemoyer. 2019. Bart: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. arXiv preprint arXiv:1910.13461. +Manling Li, Lingyu Zhang, Heng Ji, and Richard J Radke. 2019. Keep meeting summaries on topic: Abstractive multi-modal meeting summarization. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 2190-2196. +Chin-Yew Lin. 2004. Rouge: A package for automatic evaluation of summaries. In Text summarization branches out, pages 74-81. +Chin-Yew Lin and Franz Josef Och. 2004. Automatic evaluation of machine translation quality using longest common subsequence and skip-bigram statistics. In Proceedings of the 42nd Annual Meeting of the Association for Computational Linguistics (ACL-04), pages 605-612. +Chunyi Liu, Peng Wang, Jiang Xu, Zang Li, and Jieping Ye. 2019a. Automatic dialogue summary generation for customer service. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 1957-1965. +Peter J Liu, Mohammad Saleh, Etienne Pot, Ben Goodrich, Ryan Sepassi, Lukasz Kaiser, and Noam Shazeer. 2018. Generating wikipedia by summarizing long sequences. arXiv preprint arXiv:1801.10198. +Yang Liu and Mirella Lapata. 2019a. Hierarchical transformers for multi-document summarization. arXiv preprint arXiv:1905.13164. + +Yang Liu and Mirella Lapata. 2019b. Text summarization with pretrained encoders. arXiv preprint arXiv:1908.08345. +Zhengyuan Liu, Angela Ng, Sheldon Lee, Ai Ti Aw, and Nancy F Chen. 2019b. Topic-aware pointer-generator networks for summarizing spoken conversations. In 2019 IEEE Automatic Speech Recognition and Understanding Workshop (ASRU), pages 814-821. IEEE. +Gabriel Murray, Steve Renals, Jean Carletta, and Johanna D Moore. 2006. Incorporating speaker and discourse features into speech summarization. In Proceedings of the Human Language Technology Conference of the NAACL, Main Conference, pages 367-374. +Ramesh Nallapati, Bowen Zhou, Caglar Gulcehre, Bing Xiang, et al. 2016. Abstractive text summarization using sequence-to-sequence rnns and beyond. arXiv preprint arXiv:1602.06023. +Nikola I Nikolov, Michael Pfeiffer, and Richard HR Hahnloser. 2018. Data-driven summarization of scientific articles. arXiv preprint arXiv:1804.08875. +Romain Paulus, Caiming Xiong, and Richard Socher. 2017. A deep reinforced model for abstractive summarization. arXiv preprint arXiv:1705.04304. +Kochen Qin, Lu Wang, and Joseph Kim. 2017. Joint modeling of content and discourse relations in dialogues. arXiv preprint arXiv:1705.05039. +Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. 2019. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint arXiv:1910.10683. +Alexander M Rush, Sumit Chopra, and Jason Weston. 2015. A neural attention model for abstractive sentence summarization. arXiv preprint arXiv:1509.00685. +Abigail See, Peter J Liu, and Christopher D Manning. 2017. Get to the point: Summarization with pointer-generator networks. arXiv preprint arXiv:1704.04368. +Guokan Shang, Wensi Ding, Zekun Zhang, Antoine Jean-Pierre Tixier, Polykarpos Meladianos, Michalis Vazirgiannis, and Jean-Pierre Lorre. 2018. Unsupervised abstractive meeting summarization with multi-sentence compression and budgeted submodular maximization. arXiv preprint arXiv:1805.05271. +Robert Speer and Catherine Havasi. 2012. Representing general relational knowledge in conceptnet 5. In LREC, pages 3679-3686. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advances in neural information processing systems, pages 5998-6008. + +Felix Wu, Angela Fan, Alexei Baevski, Yann N Dauphin, and Michael Auli. 2019. Pay less attention with lightweight and dynamic convolutions. arXiv preprint arXiv:1901.10430. +Wen Xiao and Giuseppe Carenini. 2019. Extractive summarization of long documents by combining global and local context. arXiv preprint arXiv:1909.08089. +Jingqing Zhang, Yao Zhao, Mohammad Saleh, and Peter Liu. 2020. Pegasus: Pre-training with extracted gap-sentences for abstractive summarization. In International Conference on Machine Learning, pages 11328-11339. PMLR. +Weiwei Zhang, Jackie Chi Kit Cheung, and Joel Oren. 2019. Generating character descriptions for automatic summarization of fiction. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 7476-7483. +Zhou Zhao, Haojie Pan, Changjie Fan, Yan Liu, Linlin Li, Min Yang, and Deng Cai. 2019. Abstractive meeting summarization via hierarchical adaptive segmental network learning. In The World Wide Web Conference, pages 3455-3461. +Chenguang Zhu, Ruochen Xu, Michael Zeng, and Xuedong Huang. 2020. End-to-end abstractive summarization for meetings. arXiv preprint arXiv:2004.02016. +Yicheng Zou, Lujun Zhao, Yangyang Kang, J. Lin, Minlong Peng, Zhuoren Jiang, Changlong Sun, Qi Zhang, Xuanjing Huang, and Xiaozhong Liu. 2020. Topic-oriented spoken dialogue summarization for customer service with saliency-aware topic modeling. ArXiv, abs/2012.07311. \ No newline at end of file diff --git a/afinergrainuniversaldialoguesemanticstructuresbasedmodelforabstractivedialoguesummarization/images.zip b/afinergrainuniversaldialoguesemanticstructuresbasedmodelforabstractivedialoguesummarization/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..1faa7bebd2d3c6676ff230c0543494a0618a90e4 --- /dev/null +++ b/afinergrainuniversaldialoguesemanticstructuresbasedmodelforabstractivedialoguesummarization/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc08c8f0ffa9e701540124867f693a028a30befed67c046caa2a0d7deb7e2ed5 +size 552517 diff --git a/afinergrainuniversaldialoguesemanticstructuresbasedmodelforabstractivedialoguesummarization/layout.json b/afinergrainuniversaldialoguesemanticstructuresbasedmodelforabstractivedialoguesummarization/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..07c1c21980581ac0d36f5757e232ce1f0e615782 --- /dev/null +++ b/afinergrainuniversaldialoguesemanticstructuresbasedmodelforabstractivedialoguesummarization/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e801993f01476563a20824d361338fa2a5bea1d94aecdf5fd7e7b32db52b2e9e +size 356445 diff --git a/amodelofcrosslingualknowledgegroundedresponsegenerationforopendomaindialoguesystems/0da78877-6da0-4767-bc53-090272363559_content_list.json b/amodelofcrosslingualknowledgegroundedresponsegenerationforopendomaindialoguesystems/0da78877-6da0-4767-bc53-090272363559_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..545b868657401f1cf82f21d143faf545da3b500d --- /dev/null +++ b/amodelofcrosslingualknowledgegroundedresponsegenerationforopendomaindialoguesystems/0da78877-6da0-4767-bc53-090272363559_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ab2b4a785e3319487c8008d4074989d73ad0688f41a3e2def681cb5764f23df +size 99906 diff --git a/amodelofcrosslingualknowledgegroundedresponsegenerationforopendomaindialoguesystems/0da78877-6da0-4767-bc53-090272363559_model.json b/amodelofcrosslingualknowledgegroundedresponsegenerationforopendomaindialoguesystems/0da78877-6da0-4767-bc53-090272363559_model.json new file mode 100644 index 0000000000000000000000000000000000000000..dc905fb88a824827aa73c85b688c80f668e055fe --- /dev/null +++ b/amodelofcrosslingualknowledgegroundedresponsegenerationforopendomaindialoguesystems/0da78877-6da0-4767-bc53-090272363559_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b127a6dacf13d0c507da83bc126e854cfe873c969a21f1ec8caf3784aea1813 +size 112675 diff --git a/amodelofcrosslingualknowledgegroundedresponsegenerationforopendomaindialoguesystems/0da78877-6da0-4767-bc53-090272363559_origin.pdf b/amodelofcrosslingualknowledgegroundedresponsegenerationforopendomaindialoguesystems/0da78877-6da0-4767-bc53-090272363559_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7631afae9f3adc9e5f94f8c9db81b06af3aa8cdc --- /dev/null +++ b/amodelofcrosslingualknowledgegroundedresponsegenerationforopendomaindialoguesystems/0da78877-6da0-4767-bc53-090272363559_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:41aa0d93a6d0ede8ba29b43777b6cfd1a62fc3907afc4fc84313a2cef77f2d22 +size 2090280 diff --git a/amodelofcrosslingualknowledgegroundedresponsegenerationforopendomaindialoguesystems/full.md b/amodelofcrosslingualknowledgegroundedresponsegenerationforopendomaindialoguesystems/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d650d6c9ba23e43760205232ac65511d77258831 --- /dev/null +++ b/amodelofcrosslingualknowledgegroundedresponsegenerationforopendomaindialoguesystems/full.md @@ -0,0 +1,421 @@ +# A Model of Cross-Linguual Knowledge-Grounded Response Generation for Open-Domain Dialogue Systems + +San Kim $^{1}$ , Jin Yea Jang $^{1,2}$ , Minyoung Jung $^{1}$ , and Saim Shin $^{1}$ + +$^{1}$ AIRC, Korea Electronics Technology Institute, Republic of Korea $^{2}$ Department of Intelligence and Information, Seoul National University, Republic of Korea {kimsan0622,minyoung.jung,sishin}@keti.re.kr, jinyea.jang@snu.ac.kr + +# Abstract + +Research on open-domain dialogue systems that allow free topics is challenging in the field of natural language processing (NLP). The performance of the dialogue system has been improved recently by the method utilizing dialogue-related knowledge; however, non-English dialogue systems suffer from reproducing the performance of English dialogue systems because securing knowledge in the same language with the dialogue system is relatively difficult. Through experiments with a Korean dialogue system, this paper proves that the performance of a non-English dialogue system can be improved by utilizing English knowledge, highlighting the system uses cross-lingual knowledge. For the experiments, we 1) constructed a Korean version of the Wizard of Wikipedia dataset, 2) built Korean-English T5 (KE-T5), a language model pretrained with Korean and English corpus, and 3) developed a knowledge-grounded Korean dialogue model based on KE-T5. We observed the performance improvement in the open-domain Korean dialogue model even only English knowledge was given. The experimental results showed that the knowledge inherent in cross-lingual language models can be helpful for generating responses in open dialogue systems. + +# 1 Introduction + +Large language models trained with a large-scale corpus (Radford et al., 2019; Lewis et al., 2020; Raffel et al., 2019; Adiwardana et al., 2020; Roller et al., 2020) have stirred considerable research interest by showing low perplexity in several text generation tasks, which correlated with high token accuracy on in-domain test data, and providing linguistic fluency. However, when conditional text generation was performed using a large model, a "hallucination" problem (Maynez et al., 2020) was + +found while generating plausible text using the internal knowledge implicitly stored in the parameter and condition text together. Owing to the hallucination problem in open-domain dialogue tasks, it is often observed that the model produces a response containing false information. For example, if the token "1992" frequently appears after "was born in" in the corpus for pre-training, the information is stored in the parameter of the model. In case "When was Elvis Presley born?" is entered as a condition, false information such as "Elvis Presley was born in 1992" is often generated. + +Knowledge-grounded dialogue tasks (Dinan et al., 2019; Zhou et al., 2018) were introduced for dialogue models to generate informative responses based on knowledge, and then dialogue modeling research based on external knowledge was started. Because the responses of the knowledge-grounded dialogue models are generated based on dialogue history and external knowledge, the knowledge-grounded dialogue models mitigate the hallucination problem compared to the models based only on dialogue history (Shuster et al., 2021). + +For knowledge-grounded dialogue systems in non-English, construction of data in a different language than English is required since most of the published knowledge-grounded dialogue datasets are built based on English. However, building knowledge-grounded data based on the corresponding language takes a lot of time and cost (Li et al., 2020). Even when translating existing English data, the high translation cost is incurred because of the large volume of knowledge data included in the dataset. In this paper, to avoid the data construction overhead, we suggest a cross-lingual knowledge-grounded dialogue model that generates responses in another language than English using knowledge in English. + +For the cross-lingual knowledge-grounded dialogue model, (1) we constructed the Korean Wizard of Wikipedia (KoWoW) dataset by translating the + +Wizard of Wikipedia dataset (Dinan et al., 2019), a knowledge-grounded dialogue benchmark, into Korean. Based on T5 (Raffel et al., 2019), (2) we built Korean-English T5 (KE-T5), a pre-trained language model specialized in Korean and English, and (3) developed a cross-lingual knowledge-grounded dialogue model that selects knowledge and generates responses based on the T5 architecture. We conducted an experiment to prove that a dialogue model generating responses with knowledge in English alleviates the hallucination problem rather than that without knowledge, and shows comparable performance to a dialogue model with knowledge translated from English into Korean. In addition, by sharing our insights through the qualitative analysis of the generated responses based on the proposed model, we describe several research directions for future knowledge-grounded dialogue tasks. + +# 2 Related Work + +# 2.1 Knowledge-Grounded Dialogue Data + +Representative knowledge-grounded dialogue datasets include the CMU document grounded conversion dataset (CMU_DOG) (Zhou et al., 2018) and the Wizard of Wikipedia dataset (WoW). CMU_DOG is suitable for generating conversations about a specific article, like reading discussion, because it is a dataset that selects a specific document from Wikipedia and collects conversations about the contents of the document. WoW is a dataset whose conversations are collected by selecting knowledge from Wikipedia to generate a response for each turn, on the basis of dialogue history. In every turn, a specific sentence is selected as knowledge among articles returned by TF-IDF, and the conversation is conducted using the knowledge sentence; unlike CMU_DOG, the knowledge sentences for a conversation may have come from several documents. Therefore, WoW can be applied to open-domain chit-chat engines that can change topics according to the flow of the conversation. + +In WoW, there are two speakers, Apprentice and Wizard. The apprentice talks freely with the wizard, and the wizard discusses about a given topic with the apprentice. The wizard selects appropriate knowledge for the next response and responds based on the selected knowledge and dialogue history. When there is no appropriate knowledge, or when responding without knowledge is possible, + +such as in the case of agreeing with the other party's opinion, the wizard responds based only on dialogue history. This task is to generate the next utterance of the wizard using knowledge and dialogue history. Therefore, the dialogue model is constructed to perform knowledge selection to select knowledge for the next utterance generation, and to generate a response based on the selected knowledge and dialogue history. The WoW dataset consists of train, validation, and test splits. Validation and test splits are further subdivided into seen and unseen splits. The seen and unseen splits are the cases where the conversation topic does and does not overlap with the train split, respectively. + +# 2.2 Pre-Trained Language Models + +In most NLP tasks including dialogue tasks, transfer learning from a language model, trained using a large corpus, to a downstream task has shown high performance. Among the various pre-trained language models, T5 (the text-to-text transfer transformer) takes an encoder-decoder architecture, and was trained using the Colossal Clean Crawled Corpus (C4) (Raffel et al., 2019) that cleaned the raw corpus obtained from the Web. With C4, models trained with auto-regressive objectives (T5 AR) and models trained with span-corruption objectives (T5 Span) were published. + +MT5 (Multilingual T5) (Xue et al., 2020), constructed and released to support cross-lingual downstream tasks, was trained with the span-corruption objective of T5, and a large corpus in 101 languages was used for training. However, the multilingual corpus used to train the MT5 contains a very small proportion of the non-English data, and high performance for non-English tasks is difficult to obtain. In this study, a Korean-English language model was built to analyze the performance improvement of the dialogue model in a minority language by injecting knowledge in English. + +# 2.3 Knowledge-Grounded Response Generation Models + +To generate natural and correct responses in knowledge-grounded dialogue, various successful machine learning techniques have been applied, similar to the research trends in other NLP tasks. WoW proposed a knowledge selection model using the transformer encoder and memory, and a generative model generating the next utterance by concatenating encoded vectors of the selected knowledge and dialogue history. The proposed model + +had higher response generation performance than the model that generates responses without knowledge (Dinan et al., 2019). SKT (Kim et al., 2020) improved the performance of knowledge selection through keeping track of the prior and posterior distribution over knowledge, thereby improving response generation performance in knowledge-grounded dialogue. In diaLoGPT (Zhao et al., 2020c), BART FK (Bruyn et al., 2020), and knowledge GPT (Zhao et al., 2020b), the generation performance was improved by using a pre-trained language model. + +# 3 KoWoW: Korean Wizard of Wikipedia + +We used a commercial machine translation API (MT) to build the KoWoW dataset. We chose the multi-stage translation strategy (Ham et al., 2020) as a strategy for building the KoWoW. In this strategy, training and validation splits are translated by machine, and in the case of test splits, machine-translated drafts are corrected by human translators by referring to the original text. Because WoW's utterances are colloquial, whereas the machine translator are trained with written languages, human translators spent more effort on correcting the machine-translated text, rather than directly translating the original English text into Korean. To maintain the contextual/stylistic consistency of training data and evaluation data to some extent during the process of Koreanization of the WoW dataset, the same MT, the Google's neural machine translation system (Wu et al., 2016), was used all through the multi-stage translation strategy. + +In the test split, if the content and meaning of the utterance translated by MT were different from the original text, the human translators retained the machine-translated text as much as possible and corrected it manually. When some idioms were translated and their meanings changed, they were revised for the correct expressions. For the translation quality, two experts in English and Korean took a role of human translators. + +# 3.1 Language Combinations of KoWoW + +For the experiment of the cross-lingual knowledge-grounded dialogue task, we constructed four datasets according to the language composition combinations of knowledge and utterance using the constructed Korean and English parallel data. KoWoW En-En, whose knowledge and utterance are both in English, is the same dataset as WoW, + +and KoWoW Ko-Ko is the dataset, which both knowledge and utterance are in Korean. Therefore, the knowledge-grounded task in KoWoW En-En and KoWoW Ko-Ko performs knowledge selection and utterance generation in a monolingual environment. On the other hand, in the KoWow Ko-En (Knowledge-Korean, Utterance-English) and KoWoW En-Ko (Knowledge-English, Utterance-Korean) datasets, where the languages for knowledge and utterance are cross-lingual combinations, two different languages are used for knowledge selection and utterance generation. For example, in the KoWoW En-Ko dataset, the knowledge sentence for generating the next utterance is selected from knowledge candidates in English using dialogue history in Korean. The response is generated in Korean, using the selected knowledge sentence in English and dialogue history in Korean. Table 1 shows the statistics of the KoWoW dataset, which is the same as the WoW dataset. + +
SizeTrainValidTest
SeenUnseen
# of utterances166,78717,7158,7158,782
# of sets18,4301,948965968
# of topics1,24759953358
Average # of Turn9.09.19.09.1
Knowledge5.4M articles93M sentences
+ +Table 1: Statistics of the KoWoW. + +# 4 Cross-Lingual Knowledge-Grounded Dialogue Model + +# 4.1 KE-T5 1: Korean-English T5 + +The existing T5, the pre-trained model learned with only the English corpus, is difficult to be applied for downstream tasks using multi-languages. In the case of MT5, the total vocabulary size is very large (250,000 words), the large memory for training and inference is required, and the computational cost is high. Despite the high cost of MT5, high performance in the NLP tasks supporting only two languages is difficult to achieve due to the fact that the vocabulary size for Korean is small. + +We built Korean-English T5 (KE-T5), a T5-based pre-trained model for both English and Korean. KE-T5 used Google's SentencePiece (Kudo and Richardson, 2018) as a tokenizer, and 64,000 word/sub-word vocabulary was used for all experiments. To support both Korean and English, the SentencePiece model was trained to cover $99.95\%$ + +![](images/be7aa5706b838f021f69df612bf19ff688882b7874132a3aec4c244ea00512a9.jpg) +Figure 1: The structure of the proposed model. It is composed of a Retrieval model and a Generator model, and the generator model generates a response by concatenating dialogue context and knowledge selected by the Retrieval model. + +of the corpus consisting of a 7 to 3 ratio of Korean and English. The 60GB Korean corpus crawled on the web was filtered, and a total of 92GB Korean-English raw corpus was secured, including RealNewslike data of the C4 dataset in English. C4's RealNews is the filtered data to include only the web pages used in Zellers et al. (2019). The corpus used to train KE-T5 consists of 39 million examples. Using the constructed corpus, we trained the model with the span-corruption objective of T5, like MT5. We evaluated KE-T5 in several Korean/English downstream tasks such as document summary, extractive QA, and text classification, and KE-T5 showed high performance in both Korean and English, and the performance of Korean/English downstream tasks is illustrated in the Appendix A. + +# 4.2 Models for Conversation Generation + +We developed a dialogue model based on KE-T5 for the cross-lingual knowledge-grounded dialogue task, and the structure of the model is shown in Figure 1. In each dialogue, when the current dialogue turn is $t$ and the token sequence of each turn is $\mathbf{X}_t$ , the current dialogue context is $\mathbf{X}_1, \dots, \mathbf{X}_t$ , the response to generate is $\mathbf{X}_{t+1}$ , and $\mathbf{X}_1$ is the topic of dialogue. (1) The model selects the most appropriate knowledge to generate the next response among knowledge candidates, using dialogue context. (2) After that, the next utterance is generated using the selected knowledge and dialogue context. + +# 4.2.1 Retrieval Transformer Network + +The retrieval transformer network that selects knowledge uses the KE-T5 encoder as a base model, as shown in Figure 1. In the retrieval model, knowledge candidates and dialogue context are independently encoded by the encoder, and the aver + +age vector is calculated along the sequence dimension of the encoded vector sequences and then normalized to obtain the representation vector. Then, the attention between the representation vectors of knowledge candidates and the representation vector of the dialogue context is calculated, and the knowledge with the largest attention value is selected. Suppose the number of knowledge candidates is $N$ . The tokens of the $i$ -th knowledge are $\mathbf{K}_i$ , the knowledge candidates are $\mathbf{K}_1, \dots, \mathbf{K}_N$ , and the encoded knowledge vector is $\text{enc}(\mathbf{K}_1), \dots, \text{enc}(\mathbf{K}_N)$ . Let the encoded vector be averaged along the sequence dimension, and then the normalized representation vector be $\text{repr}(\mathbf{K}_1), \dots, \text{repr}(\mathbf{K}_N)$ . Similarly, when the encoded current dialogue context is averaged, the normalized representation vector is called $\text{repr}(\text{ctx})$ . The retrieval model selects the knowledge index ( $i_{\text{knowledge}}$ ), as depicted in Eq. 1. + +$$ +i _ {\text {k n o w l e d g e}} = \underset {i \in \{1, \dots , N \}} {\arg \max } \operatorname {r e p r} \left(\mathbf {K} _ {i}\right) \cdot \operatorname {r e p r} (c t x) \tag {1} +$$ + +During training, knowledge candidates are either gold knowledge or knowledge that is not used to generate a response, and the labels $\mathbf{KL}_1,\dots ,\mathbf{KL}_N$ are generated such that gold knowledge is 1 and the others are 0. Assuming that $\mathbf{A}_i$ is the attention score of $repr(\mathbf{K}_i)$ and $repr(ctx)$ , the loss $\mathcal{L}_{\text{knowledge}}$ for the knowledge selection model is defined as Eq. 2. + +$$ +\mathcal {L} _ {\text {k n o w l e d g e}} = \operatorname {C r o s s E n t r o p y L o s s} (\mathbf {A}, \mathbf {K L}) \tag {2} +$$ + +# 4.2.2 Generative Transformer Network + +For the generative transformer network, the selected knowledge and dialogue context are concatenated and then input into the model, and the model + +is trained to generate the next utterance $\mathbf{X}_{t + 1}$ . The model is trained to minimize the negative log likelihood loss $(\mathcal{L}_{NLL})$ of the utterance $\mathbf{P}_{t + 1}$ generated by the model and the next utterance $\mathbf{X}_{t + 1}$ . The proposed model is similar to the generative transformer memory network of WoW (Dinan et al., 2019), but the input of the generative model is a token rather than an encoded vector, and the generative model is based on an encoder-decoder structure. Similar to the end-to-end model (Dinan et al., 2019) in WoW, the proposed model was trained to minimize the loss of the weighted sum of $\mathcal{L}_{\text{knowledge}}$ and $\mathcal{L}_{NLL}$ , which are the losses of the retrieval and generative models respectively. Therefore, the final loss of the proposed model is determined by Eq. 3. + +$$ +\mathcal {L} = (1 - \lambda) \mathcal {L} _ {N L L} + \lambda \mathcal {L} _ {\text {k n o w l e d g e}} \tag {3} +$$ + +# 5 Experiments + +# 5.1 Experimental Settings and Metrics + +We used perplexity (PPL) and F1 score (unigram overlap), which are commonly used in knowledge-grounded dialogue tasks, as evaluation metrics for responses generated using predicted knowledge. In addition, knowledge selection accuracy was measured in the cross-lingual setting. + +The size of KE-T5's pre-trained model used for the retrieval and generative models was 60 million (small model) and 220 million (base model). In addition, all experiments were conducted through transfer learning using pre-trained models, and the name of the model in the results indicates the pretrained model used for training. All experiments were equally learned by 10 epochs, and detailed settings for training can be found in the Appendix B. + +# 5.2 Performance of T5 and KE-T5 on English Dataset + +Because the KoWoW constructed in this study has been newly released, it is difficult to determine whether the contents proved in this paper are reliable only from the KoWoW-based experimental results. Therefore, to prove the performance stability of the KE-T5 model built for this experiment, we performed a performance experiment of the knowledge-grounded dialogue model through KE-T5 and WoW before evaluating the dialogue model in cross-lingual data. Table 2 presents the experimental results. KE-T5, T5 AR, and T5 Span were used as pre-trained models to train the dialogue models. As mentioned in Section 2.2, T5 AR is + +
MethodTest SeenTest Unseen
PPLF1PPLF1
Without Knowledge
+T5 AR18.416.920.317.8
+T5 Span62.911.785.611.4
+KE-T591.312.5119.911.8
With Knowledge
E2E Trfm. MemNet(Dinan et al., 2019)63.516.997.314.4
Two-Stage Trfm. MemNet(Dinan et al., 2019)46.518.984.817.3
SKT(Kim et al., 2020)52.019.381.416.1
DRD(Zhao et al., 2020a)23.018.025.616.5
DiaOgPT FineTune(Zhao et al., 2020c)16.219.020.417.6
BART FK(Bruyn et al., 2020)12.220.114.919.3
KnowledGPT(Zhao et al., 2020b)19.222.022.320.5
+T5 AR22.119.124.918.3
+T5 Span59.519.571.218.6
+KE-T550.318.460.017.4
+ +Table 2: Performance of knowledge-grounded response generation on WoW. + +a pre-trained model using an auto-regressive objective, and T5 Span is a pre-trained model using the span-corruption objective. T5 Span and KE-T5 are pre-trained models that are trained identically, except for data and vocabulary. + +When comparing the results of T5 AR and T5 Span in Table 2, using a model trained with an auto-regressive objective as a pre-trained model has lower perplexity than using a model trained with span-corruption objective. As the perplexity of T5 AR is the lowest when knowledge is not used, the perplexity of pre-trained models learned with auto-regressive objectives seems to be low because the auto-regressive objective reduces perplexity in generation. However, in the F1 score, the two models showed similar performance. + +When comparing the performance of T5 Span and KE-T5 based models, it can be seen that the performance is similar except that the F1 score of T5 Span is slightly higher in the seen topics. Therefore, it can be concluded that the relatively high perplexity of the proposed KE-T5 is due to the objective of the pre-trained model. Comparing the performance of the proposed model based on KE-T5 and other models, it can be seen that the KE-T5 based model has comparable performance to the existing state-of-the-art models in the knowledge-grounded dialogue task. Therefore, it can be seen that the KE-T5 based model has sufficient perfor + +mance to be used as a baseline model in KoWoW. + +# 5.3 Performances on KoWoW + +
Test SeenTest Unseen
Kno. Acc.PPLF1Kno. Acc.PPLF1
(1) KoWoW Ko-Ko
+KE-T5 w/o knowledge-130.14.7-171.03.8
+KE-T524.876.49.218.092.27.4
+MT521.917.18.219.519.86.4
(2) KoWoW En-Ko
+KE-T524.973.78.817.193.86.6
+MT522.816.97.621.319.76.1
(3) KoWoW Ko-En
+KE-T5 w/o knowledge-91.312.5-119.911.8
+KE-T523.451.218.017.961.417.2
+MT521.233.216.718.439.815.3
(4) KoWoW En-En
+KE-T525.050.318.418.760.017.4
+MT521.4130.217.119.0163.316.6
+ +Table 3: Performance of knowledge-grounded response generation on KoWoW. + +Table 3 shows the performance of the proposed model in all language combinations of Section 3.1. In this experiment, to compare the performance using various cross-lingual pre-trained models, the performance was compared using the Multi-lingual T5 (MT5) and KE-T5 that support both Korean and English. First, in the performance in (1), the model using KE-T5 has a higher F1 score in both Test Seen and Test Unseen than the model using MT5. However, it can be confirmed that the perplexity of MT5 is lower than that of KE-T5. This is because the Korean vocabulary size of KE-T5 is 44K words, which is larger than the 12K words of MT5. In the KE-T5 model using Korean knowledge, the F1 scores in Test Seen and Test Unseen were 4.5 and 3.6 higher than the model using only dialogue history, respectively. This proves that Korean knowledge is of great help in generating Korean responses. + +When comparing (2), which is composed of languages with different knowledge and utterances, and (1), a monolingual modeling environment, the F1 score of (2) is lower than that of (1). However, KE-T5's Test Seen and Test Unseen are small differences of 0.4 and 0.8, respectively, and the performance improved by 4.1 and 2.8, respectively, compared to the case of not using knowledge. From this result, it can be seen that the response generation performance is improved if English knowledge is used for non-English knowledge-grounded + +dialogue tasks. In addition, it was confirmed that both KE-T5 and MT5 showed high performance in the cross-lingual NLP task even though they were learned through a corpus independently collected between languages without using English-Korean parallel data in the pre-training process. + +In the experimental results of opposite knowledge and utterance combinations (3) and (4), the cross-lingual dataset (3) showed a slightly lower F1 score than (4). In addition, compared to the case where knowledge was not used, the F1 score was significantly improved by 5.5 and 5.4, respectively. As shown in Table 3, although the knowledge accuracy of MT5 in Test Unseen was higher than that of KE-T5, the F1 score was low. This means that the MT5-based model has a numerically lower performance in generating a knowledge-based response than the KE-T5-based model. + +# 5.4 Qualitative Analysis + +In the experimental results in Section 5.3, the perplexity of generation is affected by the scale and vocabulary composition of the pre-learning model, and the f1 score-based evaluation method may also have a discrepancy from the qualitative quality evaluation felt by humans. Therefore, in this study, we qualitatively analyzed the responses generated by the proposed model in KoWoW En-Ko and KoWoW Ko-En. + +In Table 4, in the model that did not use knowledge, a hallucination problem was found that generated false information as a response that a band called Insane Clown Posse was formed in 1977 (orange box on the table). In contrast, the model using English knowledge generates a factual and informative response that the Insane Clown Posse was formed in Detroit in 1987. In the case of using Korean or English knowledge, it is confirmed that the model generates a true response based on selected knowledge. + +While comparing the results of the knowledge-grounded dialogue model using KE-T5 and MT5 as pre-learning models, both models generate selected knowledge-based responses. However, it was often observed that the MT5-based model generates a response using words irrelevant to the context, such as the orange box in Table 5. In addition, the MT5 based model frequently generated phrases such as "I don't know much about it." and "I'll have to check it out." regardless of the context, at a high frequency, when generating responses with + +
Knowledge & Dialogue Context
Dialogue HistoryApprentice:Insane Clown Posse라해赎드에다해 흠심 기다? +(Do you know anything about the band called Insane Clown Posse?)
Wizard:Insane Clown Posse (ICP)는Violent J와 Shaggy 2 Dope로구름본 흠국 힘alm +류오일들.(Insane Clown Posse (ICP) is an American hip hop duo composed +of Violent J ,and Shaggy 2 Dope.)
Apprentice:종류목SIGN.울자이에다해 흠심 기다? (Interesting, how long have they been +around?)
Knowledge1989년 더트로이드에서 썸류 갔 퍼 insane Clown Posse는 horrorcore로 Alliteration's Hoayam +合法스마일을 전보이머 친고한 끼이드공elyn로 유명화于此.(Founded in Detroit in 1989, +Insane Clown Posse features a hardcore hip-hop style known as horrorcore and is known for its +sophisticated live performances.)
Response of the Models
w/o Knowledge에,그는 1977년에 썸류做到了수다.(Yes, he was founded in 1977.)
with En Knowledge이름은 1989년 더트로이드에서 썸류做到了수다.(It was founded in Detroit in 1989.)
with Ko Knowledge1989년 더트로이드에서 썸류做到了수다.(founded in Detroit in 1989.)
+ +Table 4: Response examples of the proposed model when knowledge is not used and when Korean, English knowledge is used. + +
Unseen Topic: Elvis Presley
KE-T5MT5
Apprentice: Wizard First
Knowledge: Regarded as one of the most significant cultural icons of the 20th century, he is often referred to as the "King of Rock and Roll" or simply "the King".
Elvis Presley is often referred to as the king of rock and roll.I love Regis , widely known as the king of rock and roll.
Apprentice: yes...who doesn't love Elvis Presley and his music?
Knowledge: no knowledge used
I sympathize. But do you really like his music?I love his music. I love his music. I love his music. I love his music. I love his music. I love his music.
+ +Table 5: Example of response generated by KoWoW En-Ko (Blue text indicates that it has been translated from Korean). + +out knowledge. They tended to generate the same phrase repeatedly. + +Table 6 shows response samples generated by the KE-T5 based model. (1), (5), (6) are natural response samples, and (2), (3), (4), (7) are unnatural response samples. Like response (1), the proposed model generates informative responses in Korean even if only English knowledge is used in most of the turns. In the case of (2), the apprentice spoke of a negative stance on the topic, and if it is a natural conversation, it will generate a response that agrees or empathizes with this utterance. However, the model generates a response that is not related to the context, such as "Yes, it's a fun hobby," and does a topic related explanation based on the selected knowledge. Moreover, it shows the wrong result of generating a response by simply copying and translating information from a given knowledge. (3) shows the case in which contradictions occurred in the response. This is an error that may appear in the process of generating an incidental response using the selected knowledge after the proposed model fails to judge that the knowledge chosen by itself is the knowledge that can answer + +the question. (4) is a case where the model does not answer Apprentice's questions and says what the model wants to say based on the selected knowledge. This is a case where the conversation model simply paraphrases the chosen knowledge and delivers it without knowing what the other person is asking. + +In the dataset, in the case of agreeing to or reacting to the other person's words, knowledge may not be used. (5) reacts to apprentice's words, and (6) is an example of answering and asking another person's question. In cases (5) and (6), the proposed model generates a natural response. However, it can be seen that the response in (7) is contradictory and generates false information that 'Mick' was replaced with 'Brian Jones'. Because Rolling Stones is a seen topic, when training, the knowledge that 'Brian Jones' and Rolling Stones are related may have been implicitly stored in the model parameter. It seems that the model first generated a pattern of 'I'm not sure, but I do know', and then generated a response using 'replaced' in apprentice's utterance and 'Brian Jones', which is the learned internal knowledge. Even in the proposed model, if knowl + +
Knowledge-English Utterances-Korean
(1) Seen Topic: Purple
Apprentice:Oh that's cool, do you know if purple had any historical uses?
Predicted Knowledge:Purple was the color worn by Roman magistrates; it became the imperial color worn by the rulers of the Byzantine Empire and the Holy Roman Empire, and later by Roman Catholic bishops.
Response:Roman magistrates wore purple, and purple was worn by the rulers of the Byzantine and Holy Roman Empires.
(2) Unseen Topic: Bowling
Apprentice:Yeah, its sort of an older persons activity like bingo, it's not so much that younger people can't do it, its just not the primary audience
Predicted Knowledge:The most common types of pin bowling include ten-pin, nine-pin, candlepin, duckpin and five-pin bowling, while in target bowling, bowls, skittles, kegel, bocce, carpet bowls, pétanque,
Response:Yes, it's a fun hobby, it can include ten-pin, nine-pin, kegel, skittles, and five-pin bowling.
(3) Unseen Topic: Guns N' Roses
Apprentice:Have you heard of the band Guns N' Roses? They are my favorite band ever
Predicted Knowledge:Guns N' Roses, often abbreviated as GNR, is an American hard rock band from Los Angeles, California, formed in 1985.
Response:No, but I know they are a respected American hard rock band..
Knowledge-Korean Utterances-English
(4) Unseen Topic: Instagram
Apprentice:So it's not that old then. Do you have to open an account with it, or can you just post?
Predicted Knowledge:Instagram lets registered users upload photos or videos to the service.
Response:It allows users to upload pictures and videos with it
(5) Unseen Topic: List of national parks of the United States
Apprentice:I live in Arkansas and love the Hot Springs National Park and have been there many times, really it is beautiful
Predicted Knowledge:no knowledge used
Response:It's a beautiful place to visit!
(6) Unseen Topic: Online Shopping
Apprentice:Have you heard of Alibaba?
Predicted Knowledge:no knowledge used
Response:No, I haven't. Have you heard of Alibaba?
(7) Seen Topic: Rolling Stones
Apprentice:Was Mick ever replaced?
Predicted Knowledge:no knowledge used
Response:I'm not sure, but I do know he was replaced by Brian Jones.
+ +Table 6: Example of natural or incorrect response generation of KE-T5 based conversation model trained with KoWoW (Blue text indicates that it has been translated from Korean). + +edge is not provided, a hallucination problem still exists. + +# 6 Conclusion + +In this work, we studied whether proper knowledge was well selected and whether a knowledge-grounded response was well generated even if the languages of knowledge and utterances were different in response generation using external knowledge. Through experiments, we showed that even if the languages of knowledge and utterance are different, if the pre-trained model supports both languages, the performance is comparable to that of the monolingual model. In addition, through qualitative analysis, the proposed model generates more informative responses than when knowledge is not used in most cases, and because it is based on external knowledge, the hallucination problem + +that generates a factually inaccurate response based on internal knowledge is alleviated. However, there were cases in which the selected knowledge was simply translated without answering the other person's question, contradictions occurred in the generated response, and false information was generated when knowledge was not selected. + +Future work would be able to conduct research that generates responses using knowledge by understanding the other's intentions and questions, rather than simply generating responses that convey knowledge. In addition, it will be interesting to study the prevention of contradictions in the response when generating the response from the model. Finally, when there is no external knowledge, research to reduce the hallucination problem and research to classify whether the generated response is true or false would help to create a natural dialogue model. + +# Acknowledgements + +This work was supported by the Institute for Information & Communications Technology Planning & Evaluation (IITP) grant funded by the Korea government (MSIT) (No. 2021-0-00537, Visual common sense through self-supervised learning for restoration of invisible parts in images) and Basic Research Program of Korea Electronics Technology Institute (KETI). + +# References + +Daniel Adiwardana, Minh-Thang Luong, David R. So, Jamie Hall, Noah Fiedel, Romal Thoppilan, Zi Yang, Apoorv Kulshreshtha, Gaurav Nemade, Yifeng Lu, and Quoc V. Le. 2020. Towards a human-like open-domain chatbot. CoRR, abs/2001.09977. +Samuel R. Bowman, Gabor Angeli, Christopher Potts, and Christopher D. Manning. 2015. A large annotated corpus for learning natural language inference. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing (EMNLP). Association for Computational Linguistics. +M. D. Bruyn, E. Lotfi, Jeska Buhmann, and W. Daelemans. 2020. Bart for knowledge grounded conversations. In Converse@KDD. +Daniel Cer, Mona Diab, Eneko Agirre, Inigo Lopez-Gazpio, and Lucia Specia. 2017. Semeval-2017 task 1: Semantic textual similarity-multilingual and cross-lingual focused evaluation. arXiv preprint arXiv:1708.00055. +Alexis Conneau, Rudy Rinott, Guillaume Lample, Adina Williams, Samuel R. Bowman, Holger Schwenk, and Veselin Stoyanov. 2018. Xnli: Evaluating crosslingual sentence representations. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing. Association for Computational Linguistics. +Emily Dinan, Stephen Roller, Kurt Shuster, Angela Fan, Michael Auli, and Jason Weston. 2019. Wizard of Wikipedia: Knowledge-powered conversational agents. In Proceedings of the International Conference on Learning Representations (ICLR). +Jiyeon Ham, Yo Joong Choe, Kyubyong Park, Ilji Choi, and Hyungjoon Soh. 2020. Kornli and korsts: New benchmark datasets for korean natural language understanding. arXiv preprint arXiv:2004.03289. +Byeongchang Kim, Jaewoo Ahn, and Gunhee Kim. 2020. Sequential latent knowledge selection for knowledge-grounded dialogue. volume abs/2002.07510. +Taku Kudo and John Richardson. 2018. Sentencepiece: A simple and language independent subword tokenizer and detokenizer for neural text processing. arXiv preprint arXiv:1808.06226. + +Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. 2020. BART: Denoising sequence-to-sequence pretraining for natural language generation, translation, and comprehension. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7871-7880, Online. Association for Computational Linguistics. +Linxiao Li, Can Xu, Wei Wu, YUFAN ZHAO, Xueliang Zhao, and Chongyang Tao. 2020. Zeroresource knowledge-grounded dialogue generation. In Advances in Neural Information Processing Systems, volume 33, pages 8475-8485. Curran Associates, Inc. +Seungyoung Lim, Myungji Kim, and Jooyoul Lee. 2019. Korquad1.0: Korean QA dataset for machine reading comprehension. CoRR, abs/1909.07005. +Joshua Maynez, Shashi Narayan, Bernd Bohnet, and Ryan McDonald. 2020. On faithfulness and factuality in abstractive summarization. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 1906-1919, Online. Association for Computational Linguistics. +Jihyung Moon, Won Ik Cho, and Junbum Lee. 2020. BEEP! Korean corpus of online news comments for toxic speech detection. In Proceedings of the Eighth International Workshop on Natural Language Processing for Social Media, pages 25-31, Online. Association for Computational Linguistics. +Eunjeong L. Park. 2016. Naver sentiment movie corpus. https://github.com/e9t/nsmc. +Ye Qi, Devendra Sachan, Matthieu Felix, Sarguna Padmanabhan, and Graham Neubig. 2018. When and why are pre-trained word embeddings useful for neural machine translation? In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), pages 529-535, New Orleans, Louisiana. Association for Computational Linguistics. +Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. 2019. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9. +Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. 2019. Exploring the limits of transfer learning with a unified text-to-text transformer. CoRR, abs/1910.10683. +Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. SQuAD: 100,000+ Questions for Machine Comprehension of Text. arXiv e-prints, page arXiv:1606.05250. + +Stephen Roller, Emily Dinan, Naman Goyal, Da Ju, Mary Williamson, Yinhan Liu, Jing Xu, Myle Ott, Kurt Shuster, Eric Michael Smith, Y-Lan Boureau, and Jason Weston. 2020. Recipes for building an open-domain chatbot. CoRR, abs/2004.13637. +Abigail See, Peter J. Liu, and Christopher D. Manning, 2017. Get to the point: Summarization with pointer-generator networks. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1073-1083, Vancouver, Canada. Association for Computational Linguistics. +Kurt Shuster, Spencer Poff, Moya Chen, Douwe Kiela, and Jason Weston. 2021. Retrieval augmentation reduces hallucination in conversation. CoRR, abs/2104.07567. +Youngsook Song. 2020. Paired Question. https://github.com/songys/Question_pair. +Alex Wang, Yada Pruksachatkun, Nikita Nangia, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R Bowman. 2019. Superglue: A stickier benchmark for general-purpose language understanding systems. arXiv preprint arXiv:1905.00537. +Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel Bowman. 2018. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pages 353-355, Brussels, Belgium. Association for Computational Linguistics. +Adina Williams, Nikita Nangia, and Samuel Bowman. 2018. A broad-coverage challenge corpus for sentence understanding through inference. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 1112-1122. Association for Computational Linguistics. +Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V. Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, Jeff Klingner, Apurva Shah, Melvin Johnson, Xiaobing Liu, 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 machine translation system: Bridging the gap between human and machine translation. CoRR, abs/1609.08144. +Linting Xue, Noah Constant, Adam Roberts, Mihir Kale, Rami Al-Rfou, Aditya Siddhant, Aditya Barua, and Colin Raffel. 2020. mT5: A massively multilingual pre-trained text-to-text transformer. + +Rowan Zellers, Ari Holtzman, Hannah Rashkin, Yonatan Bisk, Ali Farhadi, Franziska Roesner, and Yejin Choi. 2019. Defending against neural fake news. In Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc. +Xueliang Zhao, Wei Wu, Chongyang Tao, Can Xu, Dongyan Zhao, and Rui Yan. 2020a. Low-resource knowledge-grounded dialogue generation. volume abs/2002.10348. +Xueliang Zhao, Wei Wu, Can Xu, Chongyang Tao, Dongyan Zhao, and Rui Yan. 2020b. Knowledge-grounded dialogue generation with pre-trained language models. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 3377-3390, Online. Association for Computational Linguistics. +Yufan Zhao, Wei Wu, and Can Xu. 2020c. Are pretrained language models knowledgeable to ground open domain dialogues? CoRR, abs/2011.09708. +Kangyan Zhou, Shrimai Prabhumoye, and Alan W Black. 2018. A dataset for document grounded conversations. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 708-713, Brussels, Belgium. Association for Computational Linguistics. + +# A Performance of KE-T5 on Korean/English downstream tasks + +The KE-T5 was trained using a 90GB Korean-English corpus, with a mini-batch size of 256 and trained over 1.5M steps. Although the final training steps differ for each model size, the performance measured in this section was measured based on 1M steps (small) and 600M steps (base, large). For the large model, it took 2 months to train the 2.2M steps using the TPU-v3 8 cores. + +# A.1 Extractive Question Answering(QA) + +SQuAD (Rajpurkar et al., 2016) and KorQuAD (Lim et al., 2019) were used to evaluate the extractive QA performance. Stanford Question Answering Dataset (SQuAD) is a Wikipedia-based QA benchmark, and Korean Question Answering Dataset (KorQuAD) is a Korean Wikipedia-based QA benchmark. Version 1 was used for evaluation, and version 1 is a dataset in which the correct answer to a query exists in a given context. As shown in Table 7, KE-T5 performs well in both SQuAD, an English QA benchmark, and KorQuAD, a Korean benchmark. + +
sizeSQuADKorQuAD
EMF1EMF1
small72.8882.882.1688.39
base78.4388.0185.4591.11
large81.3390.0386.2792.06
+ +# A.2 Neural Machine Translation + +TED multilingual data (Qi et al., 2018) is multilingual subtitle data of TED video created by TED's open translate project2. The translation performance between Korean and English was measured using this data. Table 8 shows that the translation task that translates Korean to English shows higher performance than that of English to Korean. + +Table 7: Performance of KE-T5 on Extractive QA benchmarks (SQuAD, KorQuAD 1.1). + +
sizeEn -> KoKo -> En
Rouge-1Rouge-2Rouge-1Rouge-2
small10.022.0739.1919.78
base12.032.8144.1219.76
large11.452.9644.5220.21
+ +# A.3 GLUE + +The General Language Understanding Evaluation (GLUE) benchmark (Wang et al., 2018) is a collection of Natural Language Understanding benchmarks. Table 9 shows the performance of the KE-T5, and the KE-T5 has overall good performance in the GLUE benchmark. + +Table 8: Performance of KE-T5 on TED multilingual translation task. + +
sizeCoLA +Matthew'sSST-2 +Acc.MRPC
F1Acc.
small27.3189.1188.6984.31
base38.2683.7390.4386.76
large39.8591.2889.0585.05
QQPMNLI-mMNLI-mm
sizeF1Acc.Acc.Acc.
small83.5489.0778.0678.94
base90.1986.7883.7383.86
large86.589.8683.7384.39
STS-BQNLIRTE
sizePearsonSpearmanAcc.Acc.
small81.1481.3886.5564.26
base85.885.8289.7979.42
large88.1488.1490.2179.42
+ +# A.4 SuperGLUE + +SuperGLUE (Wang et al., 2019) is a natural language understanding benchmark, a collection of benchmarks that are more difficult than GLUE. Table 10 shows the performance of the KE-T5 on the SuperGLUE. The KE-T5 also performs well on the SuperGLUE benchmark overall. + +Table 9: Performance of KE-T5 on the GLUE benchmark. + +
sizeBoolQ Acc.CB Acc.F1COPA Acc.MultiRC F1EM 17.94
small70.8670.3476.795465.57
base77.3173.0887.507273.2431.9
large76.0661.0087.506776.2536.62
sizeReCoRDRTEWiCWSC
F1EMAcc.Acc.Acc.
small63.8661.8763.9060.9759.25
base76.9076.0779.7864.7374.04
large81.2980.3182.3163.9572.12
+ +Table 10: Performance of KE-T5 on SuperGLUE benchmark. + +# A.5 Korean NLP tasks + +The performance of the KE-T5 was measured on publicly available Korean NLP benchmarks. NIKL CoLA is one of the Korean corpora released in the "Everyone's Corpus" project conducted by the National Institute of Korean Language (NIKL), and is a corpus that judges Korean grammar. NSMC + +(Naver Sentiment Movie Corpus) (Park, 2016) is sentiment polarity classification data that determines whether comments on movies are positive or negative. Question-pair (Song, 2020) is a dataset that determines whether two questions are the same or different. Korean Natural Language Inference(KorNLI) (Ham et al., 2020) and Korean Semantic Text Similarity (KorSTS) (Ham et al., 2020) are datasets released by Kakao Brain, and KorNLI is a dataset that was translated SNLI (Bowman et al., 2015), XNLI (Conneau et al., 2018) and MNLI (Williams et al., 2018) into Korean. KorSTS is a dataset that was translated from Semantic Text Similarity (STS) (Cer et al., 2017). Hate Speech (Moon et al., 2020) is data that classifies whether a given sentence is hate speech, and classifies the type of hate speech. Table 11 shows the performance of KE-T5 in Korean benchmarks, and the overall performance is good. + +
sizeNIKL CoLA +Matthew'sNSMC +Acc.Question-pair
F1Acc.
small-3.7287.9087.9091.5
base12.5188.9593.7091.49
large13.3189.7089.7492.52
KorNLIKorSTSHate Speech
sizeAcc.PearsonSpearmanAcc.
small73.4178.1977.960.65
base78.6780.0279.7364.14
large79.7683.6583.2562.82
+ +# A.6 Korean Summarization tasks + +NIKL summarization data $^2$ is summarization data published by the National Institute of Korean Language(NIKL) Republic of Korea. It is divided into a summary split and a topic split. The summary split is built by human-handed summarizing articles. The topic split is data that concatenates the topic sentences selected by a person in an article. Table 12 shows the Korean Summarization performance. Both summary split and topic split show high performance, but the performance of topic split is higher than summary split. + +Table 11: Performance of KE-T5 on Korean NLP tasks. + +
sizesummarytopic
Rouge-1Rouge-2Rouge-1Rouge-2
small38.8518.6548.7932.51
base40.8619.5850.7135.43
large40.5420.0455.5237.72
+ +# A.7 CNN/DM summarization + +CNN Daily Mail summarization (See et al., 2017) is the task of summarizing a given document. As shown in Table 13, KE-T5 has good performance in the English summarization task. + +Table 12: Performance of KE-T5 on NIKL summarization data. + +
sizeRouge-1Rouge-2
small37.9417.90
base37.8415.38
large40.1517.78
+ +Table 13: Performance of KE-T5 on CNN Daily Mail data. + +# B Detailed settings for experimentation + +All experiments were trained and validated with the same hyper parameter setting. Knowledge was truncated so that the number of tokens did not exceed 64, and the dialogue context was truncated to 256. Due to GPU memory limitations, knowledge candidates were divided into 32 sized mini-batches. In Eq. 3, the knowledge weight $\lambda$ was set to 0.95. The adam optimizer was used for training, and epsilon was set to 5e-4, beta 1 to 0.9, and beta 2 to 0.98. The learning rate is 5e-4, and an invert-square root is used as a learning rate scheduling method. The learning scheduler decay is set to 0.5, and the warm up steps is set to 5000. One NVIDIA V100 32GB GPU was used for training, and it took about 1 day to learn. Beam search was used for inference, and the beam size was set to 4 and the length penalty was set to 0.65. + +# C Additional Samples + +The below tables show samples generated by the proposed model on the KoWoW dataset. Table 14 and Table 15 show samples generated by the proposed model from four topics. Table 14 shows responses generated using gold knowledge, and Table 15 shows responses generated using predicted knowledge. + +
TopicLanguage Pair (Knowledge-Response)Examples
Sled dog (seen)En-KoApprentice: Gold Knowledge: Response generated:ophile.ophile in the north they are working dogs huh? Sled dogs were important for transportation in arctic areas, hauling supplies in areas that were inaccessible by other methods. +허스트는복지목서 고通過을 편해 때 유주종요일ield.(Huskies are important for transportation in arctic areas.)
Ko-EnApprentice: Gold Knowledge: Response generated:ophile.ophile in the north they are working dogs huh?ophile in the north they are working dogs huh?ophile in the north they are working dogs huh?ophile in the north they are working dogs huh?ophile in the north they are working dogs huh?ophile in the north they are working dogs huh?ophile in the north they are working dogs huh?ophile in the north they are working dogs huh?ophile in the north they are working dogs huh?ophile in the north they are working dogs huh?ophile in the north they are working dogs huh? +ophile in the north they are working dogs huh?ophile in the north they are working dogs huh?ophile in the north they are working dogs huh?ophile in the north they are working dogs huh?ophile in the north they are working dogs huh?ophile in the north they are working dogs huh?ophile in the north they are working dogs huh?ophile in the north they are working dogs huh?ophile in the north they are working dogs huh?ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh;ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh. +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh: +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh, +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh;\n\nBroken heart (unseen)En-KoApprentice: Gold Knowledge: Response generated:ophile.ophile in the north they are working dogs huh?ophile in the north they are working dogs huh?ophile in the north they are working dogs huh?ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh;\n\nKo-EnApprentice: Gold Knowledge: Response generated:ophile.ophile in the north they are working dogs huh?ophile in the north they are working dogs huh?ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh;\n\nKo-KoApprentice: Gold Knowledge: Response generated:ophile.ophile in the north they are working dogs huh?ophile in the north they are working dogs huh?ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh; +ophile in the north they are working dogs huh;\n\nKo-KoApprentice: Gold Knowledge: Response generated:ophile.ophile in the north they are working dogs huh?ophile in the north they are working dogs huh;ophile in the north they are working dogs huh;\n\nKo-KoApprentice: Gold Knowledge: Response generated:ophile.ophile in the north they are working dogs huh;ophile in the north they are working dogs huh;\n\nKo-KoApprentice: Gold Knowledge: Response generated:ophile.ophile in the north they are working dogs huh;ophile in the north they are working dogs huh;\n\nKo-KoApprentice: Gold Knowledge: Response generated:ophile.ophile in the north they are working dogs huh;ophile in the north theyare working dogs huh;\n\nKo-KoApprentice: Gold Knowledge: Response generated:ophile.ophile in the north they are working dogs huh;ophile in the north they are working dogs huh;\n\nKo-KoApprentice: Gold Knowledge: Response generated:ophile.ophile in the north they are working dogs huh;ophile in the north they are working dogs huh;\n\nKo-KoApparents generated:ophile in the north they are working dogs huh;ophile in the north they are working dogs huh;ophile in the north they are working dogs huh;ophile in the north they are working dogs huh;ophile in the north they are working dogs huh;ophile in the north they are working dogs huh;ophile in the north they are working dogs huh;ophile in the north they are working dogs huh;ophile in the north they are working dogs huh;ophile in the north they are working dogs huh;ophile in the north they are working dogs huh;\n\n
+ +Table 14: Examples of gold knowledge and generated responses (blue text indicates English translation of Korean sentences). + +
TopicLanguage Pair(Knowledge-Response)Examples
Purple(seen)En-KoApprentice: +Knowledge predicted: +Response generated:Oh, 친지내요. 가주목이 친사목용드가 옷은지 옵고 친사내요?(Oh that'scool, do you know if purple had any historical uses?)Purple was the color worn by Roman magistrates; it became the imperial color worn by the rulers of the Byzantine Empire and the Holy Roman Empire, and later by Roman Catholic bishops. +罗马 친지과 친라목을 옵고 친지에 펈성 친마 친국의 펈성 친자들어 이 옵에 갔다.(Roman magistrates wore purple, and purple was worn by the rulers of the Byzantine and Holy Roman Empires.)
Ko-EnApprentice: +Knowledge predicted: +Response generated:Oh that's cool, do you know if purple had any historical uses? +보라목과 친수다지만 가시祝福선 셶름트래곤에 친체과상품을 기재부�개목에 친라목과 펈성 친마 친국의 친목과 친목과 친목을 펈성 친지에 펈성 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지 on the visible spectrum of light, purple is a composite color made by combining red and blue.) +I'm not sure, but it is a combination of red and blue.
Ko-KoApprentice: +Knowledge predicted: +Response generated:Oh, 친지내요. 가주목이 친사목용드가 옵고 친지에 펈성 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지에 친지 on the color worn by Roman magistrates; it became the imperial color worn by the rulers of the Byzantine Empire and the Holy Roman Empire, and later by Roman Catholic bishops.) +罗马 친지과 친지에 펈성 친지에 펈성 친지에 펈성 친지에 펈성 친지에 펈성 친지 on the color worn by the rulers of the Byzantine Empire and the Holy Roman Empire, and later by Roman Catholic bishops.) +罗马 친지과 친지에 펈성 친지에 펈성 친지 on the color worn by the rulers of the Byzantine Empire and the Holy Roman Empire. +It became the imperial color worn by the rulers of the Byzantine Empire and the Holy Roman Empire.)
Chihuahua(unseen)En-KoApprentice: +Knowledge predicted: +Response generated:지는 친와와를 춤어머니다.雙마리를 키우고 옵고 갔다.(I love chihuahuaas, I have 2 of them.)The Chihuahua is the smallest breed of dog and is named after the state of Chihuahua in Mexico. +지와와는 가장과는 힍신이터的具体명구의 Chihuahua's name is the smallest breed of dog and is named after the state of Chihuahua in Mexico.)
Ko-EnApprentice: +Knowledge predicted: +Response generated:I love chihuahuaas, I have 2 of them. +지와와는 가장과는 힍신이터的具体명구의 Chihuahua is the smallest breed of dog and is named after the state of Chihuahua in Mexico. +(The Chihuahua is the smallest breed of dog and is named after the state of Chihuahua in Mexico.) +I love chihuahuaas. They are the smallest breed in Mexico.
Ko-KoApprentice: +Knowledge predicted: +Response generated:지는 친와와를 춰어머니다.雙마리를 키우고 옵고 갔다.(I love chihuahuaas, I have 2 of them.) +지와와는 가장과는 힍신이터的具体명구의 Chihuahua is the smallest breed of dog and is named after the state of Chihuahua in Mexico. +(The Chihuahua is the smallest breed of dog and is named after the state of Chihuahua in Mexico.) +지와와는 가장과는 힍신이터的具体명구의 Chihuahua is the smallest breed of dog and is named after the state of Chihuahua in Mexico.) +지와와는 가장과는 힍신이터的具体명구의 Chihuahua is the smallest breed of dog and is named after the state of Chihuahua in Mexico.)
+ +Table 15: Examples of predicted knowledge and generated responses (blue text indicates English translation of Korean sentences). \ No newline at end of file diff --git a/amodelofcrosslingualknowledgegroundedresponsegenerationforopendomaindialoguesystems/images.zip b/amodelofcrosslingualknowledgegroundedresponsegenerationforopendomaindialoguesystems/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..a11256d9feb662d393e6271a8daaa16fd6796aa4 --- /dev/null +++ b/amodelofcrosslingualknowledgegroundedresponsegenerationforopendomaindialoguesystems/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b76074a72f89494926bf189eda4eec9597469493f093da7cc9c4ea14daeecdf1 +size 1471954 diff --git a/amodelofcrosslingualknowledgegroundedresponsegenerationforopendomaindialoguesystems/layout.json b/amodelofcrosslingualknowledgegroundedresponsegenerationforopendomaindialoguesystems/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..059b14a082ad9aaad822a643c37b2363ce4d49ac --- /dev/null +++ b/amodelofcrosslingualknowledgegroundedresponsegenerationforopendomaindialoguesystems/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ea12bd52ce97d9b51252d961cd4b0e791d43368853dfa9fdc96e26bc4d6ca439 +size 331117 diff --git a/amultilabelapproachtomorphosyntacticprobing/ce89f7ac-36b1-4865-9ce9-bf67a11d91a2_content_list.json b/amultilabelapproachtomorphosyntacticprobing/ce89f7ac-36b1-4865-9ce9-bf67a11d91a2_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..3fae16971d2688ec4815f347e9262d34818448f6 --- /dev/null +++ b/amultilabelapproachtomorphosyntacticprobing/ce89f7ac-36b1-4865-9ce9-bf67a11d91a2_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e513c8c7fab384d9faf12be87bd9f49cd8bb632f632312c17cc47c41ca1928f +size 190803 diff --git a/amultilabelapproachtomorphosyntacticprobing/ce89f7ac-36b1-4865-9ce9-bf67a11d91a2_model.json b/amultilabelapproachtomorphosyntacticprobing/ce89f7ac-36b1-4865-9ce9-bf67a11d91a2_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f898e2a62720d9f12319c653062e9848091ecc6a --- /dev/null +++ b/amultilabelapproachtomorphosyntacticprobing/ce89f7ac-36b1-4865-9ce9-bf67a11d91a2_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a2dcfe7ab788f80bf26a5468069b30c0ef5cf22adc9a6d712578426f70062cc +size 208525 diff --git a/amultilabelapproachtomorphosyntacticprobing/ce89f7ac-36b1-4865-9ce9-bf67a11d91a2_origin.pdf b/amultilabelapproachtomorphosyntacticprobing/ce89f7ac-36b1-4865-9ce9-bf67a11d91a2_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7fabfd6819b2a836f3a03b2d506f73aa8ee3f2b2 --- /dev/null +++ b/amultilabelapproachtomorphosyntacticprobing/ce89f7ac-36b1-4865-9ce9-bf67a11d91a2_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7bbf446799cfd00fad0743a2fab6c97c3e111ad791619655ee40730eeb9d5f26 +size 20428609 diff --git a/amultilabelapproachtomorphosyntacticprobing/full.md b/amultilabelapproachtomorphosyntacticprobing/full.md new file mode 100644 index 0000000000000000000000000000000000000000..e03ed740511378710e0cea3f651b4ba8d22ac45e --- /dev/null +++ b/amultilabelapproachtomorphosyntacticprobing/full.md @@ -0,0 +1,611 @@ +# A multilabel approach to morphosyntactic probing + +Naomi Tachikawa Shapiro Amandalynne Paullada Shane Steinert-Threlkeld + +Department of Linguistics, University of Washington, Seattle, WA, USA + +{tsnaomi,paullada,shanest}@uw.edu + +# Abstract + +We propose using a multilabel probing task to assess the morphosyntactic representations of multilingual word embeddings. This tweak on canonical probing makes it easy to explore morphosyntactic representations, both holistically and at the level of individual features (e.g., gender, number, case), and leads more naturally to the study of how language models handle co-occurring features (e.g., agreement phenomena). We demonstrate this task with multilingual BERT (Devlin et al., 2018), training probes for seven typologically diverse languages: Afrikaans, Croatian, Finnish, Hebrew, Korean, Spanish, and Turkish. Through this simple but robust paradigm, we verify that multilingual BERT renders many morphosyntactic features simultaneously extractable. We further evaluate the probes on six held-out languages: Arabic, Chinese, Marathi, Slovenian, Tagalog, and Yorubá. This zero-shot style of probing has the added benefit of revealing which cross-linguistic properties a language model recognizes as being shared by multiple languages. + +# 1 Introduction + +Morphologically rich languages present unique challenges to natural language processing. These languages typically exhibit complex agreement patterns and their high diversity of inflected forms can lead to sparse examples of vocabulary words in training data, even in large corpora (Blevins and Zettlemoyer, 2019; Gerz et al., 2018). It is therefore worthwhile to explore how neural language models (LMs), which serve as the foundation of many state-of-the-art systems, handle the morphological complexity of diverse languages. + +Morphosyntactic features of natural languages bear meaningful information that is useful for downstream tasks, such as machine translation, question answering, and language generation. + +Adding morphological supervision through multitask training regimes (Blevins and Zettlemoyer, 2019) or morphologically-informed tokenization (Klein and Tsarfaty, 2020; Park et al., 2020) can improve the quality of multilingual language models. Nonetheless, recent work has shown that LMs trained without explicit morphological supervision can still produce useful representations that capture morphosyntactic phenomena (e.g., Bacon and Regier, 2019; Pires et al., 2019; Dufter and Schütze, 2020). + +To further these investigations, we propose using a multilabel probing task to assess the morphosyntactic representations of multilingual word embeddings. This work is premised on the intuition that, if a simple model (a "probe") can easily extract linguistic properties from embeddings, this indicates that the LM has learned to encode those features in some fashion (Conneau et al., 2018; Hupkes et al., 2018; Liu et al., 2019). We show how a multilabel paradigm can shed light on the morphosyntactic representations of LMs, both holistically and at the level of individual features. + +Our contributions are threefold: First, we introduce an efficient probing paradigm for analyzing multiple morphosyntactic features, which we demonstrate with multilingual BERT (Devlin et al., 2018) and seven typologically diverse languages: Afrikaans, Croatian, Finnish, Hebrew, Korean, Spanish, and Turkish. Second, we evaluate the probes on six "held-out" languages—Arabic, Chinese, Marathi, Slovenian, Tagalog, and Yorubá—showing how this paradigm can be used in a zero-shot manner to illuminate the properties that multilingual BERT represents similarly cross-linguistically. Third, we release our code and multilabel probe predictions to guide future probing efforts and to serve as the foundation for future in-depth feature-level analyses. $^{1}$ + +This paper is structured as follows: Section 2 + +![](images/d829bd67aee2d2d6d15c8819084f8529a1ecb3adba3db04de344a1d4e74e8d42.jpg) +Figure 1: Hypothetical multi-hot representations of the Hebrew 3.sing.fem pronoun $\aleph \daleth$ hi (top) and 3.plurf.fem pronoun $\daleth$ hen (bottom). The two vectors differ only with respect to the two cells indicating number. + +reviews related work, motivating §3, which introduces multilabel morphosyntactic probing. Section 4 then outlines the data and models we use to probe multilingual BERT. In §5, we demonstrate the probing paradigm in a set of monolingual experiments, training and evaluating separate probes for the seven languages, and provide an example feature-level analysis of Hebrew determiners. In §6, we delve into whether multilingual probes yield comparable insights to the monolingual probes. Then, in a set of crosslingual experiments, §7 evaluates how the monolingual and multilingual probes handle the six held-out languages. Finally, §8 discusses our findings and concludes the paper. + +# 2 Related work + +Numerous studies in recent years have sought to study the linguistic properties captured by neural language models (e.g., Conneau et al., 2018; Gulordava et al., 2018; Hupkes et al., 2018; Marvin and Linzen, 2018; Zhang and Bowman, 2018; Bacon and Regier, 2019; Futrell and Levy, 2019; Hewitt and Manning, 2019; Jawahar et al., 2019; Liu et al., 2019; Tenney et al., 2019; Chi et al., 2020). + +In the morphology domain, the LINSPECTOR suite by Şahin et al. (2020) probes 24 languages via 15 linguistic tasks, including multiple tasks to identify morphological features. In a similar vein, Edmiston (2020) uses several morphological prediction tasks to inspect embeddings from five monolingual Transformer-based language models, focusing exclusively on Indo-European languages. The probing paradigm proposed in this paper builds on these works, but consolidates morphosyntactic feature prediction under a single task that leads more naturally to the study of feature co-occurrence. + +Recent probing work has also sought to curtail how much probes memorize about linguistic tasks to ensure that they reflect information available in their input embeddings-probes should be extractive rather than learned themselves. Efforts to + +minimize memorization have included reducing the training data to probes (Zhang and Bowman, 2018) and limiting probe complexity, such as through dropout (e.g., Belinkov et al., 2017a,b; Sahin et al., 2020) and the use of simpler architectures (e.g., a linear layer instead of a multilayer perceptron, as in Alain and Bengio 2018 and Liu et al. 2019). + +To guide the design and interpretation of probes, Hewitt and Liang (2019) propose supplementing diagnostic tasks with control tasks, where a probe is trained to predict random outputs within the same output space as the diagnostic task, given the same embeddings. If the probe performs well on the control task, they caution that it has the capacity to memorize the linguistic features under consideration; conversely, if the probe does well on the diagnostic task but poorly on the control task, then it is a reliable diagnostic of linguistic representations in the embeddings (though see Pimentel et al. 2020a,b for interesting discussions). Hewitt and Liang operationalize this comparison as selectivity, the difference in performance between the diagnostic and control tasks. The greater the selectivity, the more the probe "expresses" the information encoded in its input. In this paper, we design a control task to complement multilabel probing. + +# 3 Multilabel morphosyntactic probing + +We propose using multilabel morphosyntactic tagging to assess the morphosyntactic representations of neural LMs. In this diagnostic task, we hold contextualized word embeddings constant, then train linear classifiers on top of them (cf. Liu et al., 2019; Hupkes et al., 2018) to perform morphosyntactic tagging. In its objective, morphosyntactic tagging resembles the second SIGMORPHON 2019 shared task, which called for labeling words in a sentence with their morphosyntactic descriptions (McCarthy et al., 2019). + +It is easy to imagine doing morphosyntactic tagging in a traditional multiclass fashion, where + +we train separate probes to identify different features, such as part of speech (POS), gender, or number (cf. Şahin et al., 2020; Edmiston, 2020). However, this style of probing is more likely to prompt narrow analyses that consider morphological properties in isolation. Alternatively, we could train a single probe to extract complex labels like def.sing.masc.noun and 3rd.plur.masc.past verb. Thus, each word would have a single correct label and a final softmax layer would output the probability of each class being the correct one. However, a drawback to this approach is that, depending on the number of properties we would like to identify, this can result in a combinatoric nightmare with few training examples per class. + +To overcome these limitations, we frame morphosyntactic tagging as a word-level multilabel task, allowing for a token to receive multiple feature labels (e.g., both Person=1 and Number=Sing) that are multi-hot encoded. Such a paradigm allows us to encode features with multiple or ambiguous values (e.g., Gender=Fem,Masc; a.k.a. multi-valued features) and enables a closer inspection of learnt agreement and feature co-occurrence patterns. Figure 1 illustrates hypothetical gold vectors for two Hebrew pronouns that differ only in number. + +# 3.1 Notation and nomenclature + +We define a feature label as the conjunction of a linguistic feature (e.g., number) and a possible realized value of that feature (e.g., singular). Multiple feature labels can correspond to the same feature (e.g., Number = Sing and Number = Plur). We define $F$ as the set of feature labels $\{f_1, \ldots, f_{|F|}\}$ that we use to identify morphosyntactic properties from word embeddings. + +Assuming a vocabulary of word types $V$ , let $\mathbf{s} = s_1 \dots s_{|\mathbf{s}|}$ denote a specific sentence and $r_i$ denote the contextualized representation of each token $s_i$ , such that $s_i \in V$ . The inputs to the probe are therefore the embeddings $r_i \in \mathbb{R}^d$ . In the multilabel morphosyntactic tagging task, we define the target output of each embedding $r_i$ as a multi-hot encoded vector $\mathbf{y}^i = y_1^i \dots y_{|F|}^i$ , where $F$ is the aforementioned set of feature labels. We encode $y_j^i$ as 1 if the feature label $f_j \in F$ describes the token $s_i$ and 0 otherwise. + +# 3.2 Multilabel evaluation + +The multilabel paradigm lends itself well to analyzing features both holistically and at a granular level. We can analyze individual features by calculating precision, recall, and $\mathrm{F_1}$ for each feature label $f$ separately. Furthermore, we can glean the overall or micro-averaged performance of a probe by first tallying the true positives (TP), false positives (FP), and false negatives (FN) across the features, before calculating precision, recall, and $\mathrm{F_1}$ . + +# 4 Experimental setup + +We demonstrate multilabel morphosyntactic probing with multilingual BERT (henceforth, mBERT; Devlin et al., 2018), using morphologically annotated corpora from Universal Dependencies (UD; Nivre et al., 2016, 2020).3 + +# 4.1 Data + +In a set of monolingual experiments, we trained separate probes to predict morphosyntactic features from corpora for seven languages of varying morphological complexity: Afrikaans (AfriBooms; cf. Dirix et al., 2017), Croatian (SET; cf. Agic and Ljubesic, 2015), Finnish (TDT; cf. Haverinen et al., 2014; Pyysalo et al., 2015), Hebrew (HTB; cf. Tsarfaty, 2013; McDonald et al., 2013; Sadde et al., 2018), Korean (PUD; cf. Zeman et al., 2017), Spanish (AnCora; cf. Alonso and Zeman, 2016), and Turkish (IMST; cf. Sulubacak et al., 2016; Tyers et al., 2017; Turk et al., 2019). With the exception of the Korean data, all of the corpora came pre-split into training, validation, and test sets. We performed an 80-10-10 split on the 1,000-sentence Korean PUD corpus. To throttle the probes' training data (cf. Zhang and Bowman, 2018), we reduced the other training sets to 800 sentences as well. + +Next, in a set of multilingual experiments, we trained probes on a shuffled combination of the training sentences from the monolingual probes. However, we excluded the Korean dataset from this analysis, due to the lack of documentation on its construction. Finally, in a set of crosslingual transfer experiments, we evaluated the monolingual and multilingual probes on six held-out languages: Arabic (PADT; cf. Smrz et al., 2002, 2008; Hajic et al., 2009), Chinese (PUD; cf. Zeman et al., 2017), Marathi (UFAL; cf. Ravishankar, 2017), Slovenian + +(SST; cf. Dobrovoljc and Nivre, 2016), Tagalog (TRG), and Yorubá (YTB; cf. Ishola and Zeman, 2020). To clarify, mBERT was pre-trained on these languages; we consider them "held-out" in that we never train probes to extract linguistic properties from these corpora (i.e., the experiments are zero-shot). The datasets for the monolingual, multilingual, and crosslingual experiments are summarized in Appendix A. + +All of the probes were trained to extract multiple features, such as POS, number, gender, case, and tense, as well as language-specific features, such as Finnish infinitive forms. (It is due to the inclusion of parts of speech that we refer to the task as "morphosyntactic tagging".) Since the languages vary in their linguistic properties, we used different label sets for each language and a semi-aggregated set for the multilingual probes. Across our experiments, we extracted 166 different feature labels in total, as listed in Appendix B. + +The UD corpora include decompositions of multiword tokens and separate annotations for their respective components. To keep the input to the probes faithful to naturalistic text, we embed the multiword tokens themselves, but aggregate the feature labels from their components (e.g., the Hebrew multiword token 'hasefer 'the book' is marked as both a determiner and noun). + +# 4.2 Models and training + +For our experiments, we instantiated a "BERT-Base, Multilingual Cased" model using Hugging-Face's Transformers library (Wolf et al., 2019). This BERT variant contains 110M parameters across 12 Transformer layers, each with 12 attention heads and a hidden size of 768. The model was pre-trained on Wikipedia dumps from 104 languages. The authors over-sampled the smaller Wikipedia corpora to create a more cross-linguistic vocabulary, consisting of 100K wordpieces. + +We froze mBERT and trained linear classifiers on top of embeddings produced by mBERT's initial embedding layer and its successive Transformer layers (cf. Liu et al., 2019; Hupkes et al., 2018). Preliminary experiments showed that the even-numbered layers (mBERT-0, mBERT-2, mBERT-4, etc.) faithfully captured the layer-by-layer trends across mBERT, so we opted to cut down on computation by focusing exclusively on these layers. The classifiers used sigmoid activation and were trained with mean binary cross-entropy loss to per + +form the multilabel tagging task. We trained each classifier for 50 epochs, selecting the model from the epoch that achieved the best validation loss. Courtesy of PyTorch (Paszke et al., 2019), the classifiers were optimized using Adam (learning rate $= 0.001$ , $\beta_{1} = 0.9$ , $\beta_{2} = 0.999$ , $\epsilon = 1\mathrm{e} - 08$ ; Kingma and Ba, 2015). No dropout was used. + +We performed word-level predictions of morphosyntactic properties by first summing over the word-piece embeddings for each word, then caching these representations prior to training the probes. See Appendix C for more details. + +# 4.3 Vying for control + +Following Hewitt and Liang (2019), we constructed a control task to complement the multilabel tagging task, whereby each word type in the task vocabulary was assigned a multi-hot output vector that was randomly generated according to the true distribution of feature labels in the training data. Deviating from Hewitt and Liang's notation, we generated a control output vector $\mathbf{c}^i$ for each word type $v_{i}\in V$ , such that $\mathbf{c}^i = c_1^i\dots c_{|F|}^i$ , where $c_{j}^{i}$ was sampled from the true distribution of feature $f_{j}$ in the training data. For instance, if $f_{j}$ was a feature of $4\%$ of the tokens in the training set, then $c_{j}^{i}$ has a 0.04 probability of being 1 for any word type $v_{i}$ (or, conversely, a 0.96 probability of being 0). + +# 5 Monolingual experiments + +In a set of monolingual experiments, we trained and evaluated individual diagnostic probes on Afrikaans, Croatian, Finnish, Hebrew, Korean, Spanish, and Turkish, given representations from the even-numbered mBERT layers. Their microaveraged $\mathrm{F_1}$ scores are conveyed in Figure 2, along with their results on the analogous control tasks. + +# 5.1 Monolingual performance at a glance + +The micro-averaged $\mathrm{F_1}$ scores confirm that mBERT renders many morphosyntactic properties easily extractable, with the best performing probes for each language achieving scores between 0.83 and 0.97. We find that mBERT-6 scored the highest across the languages. This is consistent with prior work that has shown English BERT's interior layers to perform best on similar linguistic tasks (Liu et al., 2019; Tenney et al., 2019). Once mBERT has encoded morphologically relevant information, it seems that probe performance steadily declines as the topmost layers gear up for cloze predictions. + +![](images/72a401c8ef9a5c55b0d38092d7ac4587dc730c7579589721ed5fe342779ab314.jpg) +Figure 2: Micro-averaged $\mathrm{F_1}$ results from the monolingual probes on the diagnostic and control tasks. The $x$ -axes indicate the mBERT layer. + +Notably, the Afrikaans and Spanish probes performed the best and the Turkish probes the worst. It is tempting to conclude that 'mBERT knows Afrikaans and Spanish better than Turkish'. However, we should refrain from comparing global probe performance across languages, as each language differed in the sets of features that were extracted. Furthermore, although each of the probes were trained on 800 sentences, they were ultimately trained on varying numbers of tokens. It may be that the Afrikaans and Spanish probes performed the best because they had the largest training sets token-wise, whereas Turkish had the smallest training set and lowest $\mathrm{F}_1$ scores. + +# 5.2 Monolingual selectivity + +While the diagnostic probes drastically outperformed their controlled counterparts, we do see a trend of selectivity improving with the number of layers. This reinforces the findings of Hewitt and Liang (2019), who posit that classifiers trained on top of lower layers are better equipped to memorize input-output mappings, due to their proximity to the initial vocabulary representations of the embedding layer. Nevertheless, the high selectivity scores across the probes show that a multilabel probing classifier offers a promising diagnostic of morphosyntactic representations. + +From a cross-linguistic standpoint, it is interesting that the probes for Afrikaans—the one morphologically impoverished language in the bunch— + +exhibited the worst selectivity. This suggests that, perhaps, it is easier for probes to memorize mappings for analytic languages (i.e., languages that lack rich inflectional systems). However, as the Afrikaans probes were trained on the second largest number of tokens, they may have had more opportunity to memorize the control task. (Similarly, the Spanish probes, which had the largest training set, displayed the second best performance on the control task.) + +# 5.3 Case study: Hebrew covert determiners + +The micro-averaged scores in Figure 2 show that mBERT has indeed learned some linguistic system or portion thereof. However, these scores do not give much insight into which aspects of morphosyntax mBERT has come to represent, the interplay between these properties, nor how much mBERT varies in capturing each feature value. Crucially, a key strength of multilabel probing is that it makes it easy to mine fine-grained morphosyntactic observations that implicate multiple features. In this section, we present such an analysis with Hebrew determiners, inspired by Klein and Tsarfaty (2020). We focus on the predictions from mBERT-6, since it displayed the highest $\mathbf{F}_1$ and selectivity scores out of the Hebrew probes. + +Ambiguous orthographies as well as multiword tokens (MWTs) are ubiquitous in Hebrew. As stated previously, we represented MWTs by flattening their structure and labeling each MWT with the + +feature labels of its components. A common structure of MWTs in Hebrew is ADP-(DET)-NOUN, where the determiner is the definite article -ha 'the'. Depending on the preposition, the definite article is represented orthographically (e.g., -miha 'from the') or as a vowel change on the preposition that is not represented orthographically (e.g., -can be either le 'to a' or la 'to the'). When the article is absent from the orthography, we refer to it as being covert.4 + +The definite article is one type of determiner in the HTB corpus, but is uniquely identified by the label PronType=Art. We thus extracted all of the ADP-(DET)-NOUN cases from the Hebrew test set (234 in total) and examined how well mBERT-6 captured this property. We found that it was less able to recognize PronType=Art when the article was not overt (Table 1). + +Yet, we also found that agreement patterns facilitated recognition of the covert definite article. In particular, Hebrew adjectival modifiers agree with the nouns they modify in gender, number, and definiteness (e.g., in the noun phraseהַלִיִשֶׁהַבִיִשֶׁהַבִיִשֶׁהַבִיִשֶׁהַבִיִשֶׁהַבִיִשֶׁהַבִיִשֶׁהַבִיִשֶׁהַבֵיִשֶׁהַבֵיִשֶׁהַבֵיִשֶׁהַבֵיִשֶׁהַבֵיִשֶׁהַבֵיִשֶׁהַבֵיִשֶׁהַבֵי钯 'the small house',ה 'bayit is 'house.sing.masc',ה 'katan is 'small.sing.masc', and -ha is the definite article). Based on UD's amod annotations, the MWTs that appeared in these constructions constituted $44.3\%$ of TPs, $19.4\%$ of FPs, and $26.2\%$ of FNs when identifying the covert definite article. Moreover, the majority of the FNs involved additional erroneous predictions, where either PronType=Art was not captured on the modifier, the parts of speech were misidentified, or the modifier and the noun were mis-predicted to disagree along an additional feature (i.e., gender or number). These concomitant errors were largely missing from the TPs. + +It seems that mBERT-6 has learned that Hebrew nouns and their modifiers agree along multiple features, and that it is able to use the presence of an overt definite article on a modifier to help infer the presence of a covert article in a MWT. When not all of the grammatical features that participate in agreement are captured, this can attenuate recognition of the covert article (and vice versa). + +# 6 Multilingual experiments + +We have used monolingual probes to assess the linguistic representations from mBERT on a language- + +
PronType=ArtPRF1
Overt determiner0.930.560.70
Covert determiner0.690.400.50
+ +Table 1: Recognition of the feature PronType=Art in ADP-DET-NOUN multiword tokens, given the Hebrew mBERT-6 probe. + +
ProbeAfHrFiEsTr
Mono.0.890.880.890.960.79
Multi.0.710.760.800.140.65
+ +Table 2: $\mathrm{F}_{1}$ results for nominative case (Case=Nom) in Afrikaans (Af), Croatian (Hr), Finnish (Fi), Spanish (Es), and Turkish (Tr), given the monolingual and multilingual mBERT-6 probes. + +by-language basis. However, can we replace the individual monolingual probes with a single multilingual probe and derive comparable insights? To address this question, we trained multilingual probes on a shuffled combination of the training sets for Afrikaans, Croatian, Finnish, Hebrew, Spanish, and Turkish. The multilingual probes extracted an aggregated subset of the features captured by the monolingual probes. We then assessed the multilingual probes' performance on each language independently. Overall, the multilingual probes exhibited slight dips in performance, but better selectivity, compared to their monolingual counterparts (Figure 3). These trends occurred despite all of the multilingual models converging before they reached epoch 50. + +# 6.1 Multilingual task complexity + +Even though the multilingual experiments merely combine the monolingual training data, the multilingual task is inherently more complex than the monolingual task. Namely, the probes must balance the needs of multiple languages and extract features from a broader diversity of data. + +Let us consider nominative case. When focusing on predictions from mBERT-6, we see that the Case=Nom scores for each language dipped with the multilingual probe (Table 2). Importantly, the distribution of nominative morphology differs cross-linguistically; according to the UD corpora, for instance, nominative inflections appear on nouns, verbs, and adjectives in Turkish, but only on pronouns in Spanish. It is possible that such variation might result in "conflicting" train + +![](images/46c935496781c8cdbdec3056e74e7ef66758571a806cb75967901457683e4a95.jpg) + +![](images/dfe6d3304fd5d7f1bd28243973023dcd2846e6c1f51dc4cc247800105f449fdc.jpg) + +![](images/511ba1642140f35a500a20338d6e666e6969857599a80240cc42a496ce5929e9.jpg) + +Figure 3: Micro-averaged $\mathrm{F_1}$ results from the multilingual probes on the diagnostic and control tasks for each language. The $x$ -axes indicate the mBERT layer. The depicted monolingual results (for comparison) assume the same feature label subsets as the multilingual models; incidentally, the monolingual diagnostic task scores are equivalent to the scores reported in Figure 2, while the control task scores differ by $\pm 2$ points. +![](images/c910443e0b8fba3363439c8989d56eefa992951c91ce74603471dc9c9bb1f2e2.jpg) +• Multilingual Diagnostic Task +• Multilingual Control Task +• Monolingual Selectivity + +![](images/f8a16c506492fcaa1ad7ba09c3aa9c0d04226a3355abd3d7823073d06ebdec15.jpg) + +![](images/21425b9e9532484d5a4482535219e14ea9e7efb8b205e44f52af59c94f2c548c.jpg) + +ing signals to the probe, causing the performance of the multilingual probes to dip. Furthermore, it suggests that, although mBERT renders nominative case easily extractable for each language independently, mBERT has not recognized their nominative morphology to correspond to the same nominative notion. We return to this point in $\S 7$ . + +# 6.2 Hints of memorization + +Indeed, another potential explanation for the contrast in monolingual and multilingual performance is that the simpler task affords the monolingual probes more opportunity to memorize the feature labels. This explanation, which is explored further in Appendix D, is supported by how the multilingual probes generally exhibit greater selectivity and accounts for why their performance deficit is, for the most part, spread evenly across the feature labels (see Appendix E for the full feature-level results). + +# 7 Crosslingual experiments + +Our probing paradigm can also be used to study which morphosyntactic features are encoded similarly cross-linguistically: If a monolingual probe can successfully extract a feature label given a held-out language, this suggests that the LM has come + +to recognize that property as being shared by the two languages. + +In this section, we evaluate the monolingual and multilingual probes on UD test sets for Arabic, Chinese, Marathi, Slovenian, Tagalog, and Yorubá. These experiments are akin to prior work on zero-shot crosslingual transfer (Pires et al., 2019; Wu and Dredze, 2019; Conneau et al., 2020b; K et al., 2020), though we differ in that we never fine-tune mBERT. Focusing once more on mBERT-6, this section examines a small subset of labels, presented in Figure 4. However, see Appendix F for the global $\mathrm{F}_1$ scores across the held-out languages and full feature-level results from mBERT-6. + +# 7.1 Towards cross-linguistic categories + +Overall, the probes performed relatively well on extracting nouns and verbs across the held-out languages. This suggests that mBERT encodes nounhood and verb-hood in a cross-linguistic fashion—that it has some conception of nouns and verbs that transcends individual languages. Adjective-hood, in contrast, seems to be represented less cohesively. The probes struggled to identify adjectives in Chinese, and even more so in Tagalog and Yorubá. This is not to say that mBERT does not capture adjectives in these languages, but, rather, that it has not connected them to their counterparts in other + +![](images/7e31a844b44a33f3dcbecfdcf79a378d2da28d40c55d6d8f7a58fe5aded614e9.jpg) +Figure 4: A handful of feature-level $\mathrm{F_1}$ results from evaluating the monolingual and multilingual mBERT-6 probes on "held-out" languages. The $x$ -axes indicate the held-out language (Ar=Arabic, Zh=Chinese, Mr=Marathi, Sl=Slovenian, Tl=Tagalog, and Yo=Yorùba), while the $y$ -axes indicate the probe (Mu=Multilingual, Af=Afrikaans, Hr=Croatian, Fi=Finnish, He=Hebrew, Ko=Korean, Es=Spanish, and Tr=Turkish). Grayed-out regions indicate where the feature label is not applicable to the language or annotated in the language's corpus. + +![](images/bc477aa12d738478e7a656565eb4af52a82bcb1f7777f3ed26cbaef6022a2fde.jpg) + +![](images/1fc8192fefc9be66c69f3d61f9c297e594074fcb2c69e1f6b60a024e9ab34e22.jpg) + +![](images/4dd27c15bf48d14d28913edfc831eb0b8ea1663a1a4249918d632f0a8cfeb9ce.jpg) + +languages. This may be especially true for low-resource languages like Tagalog and Yorubá.5 Even though mBERT's training involved over-sampling smaller corpora, it might be the case that the model required exposure to Tagalog and Yorubá adjectives in a wider array of contexts in order to relate them to their counterparts cross-linguistically (see Conneau et al. 2020a for interesting discussion). + +Cross-linguistic variation in a feature's distribution in natural languages might also lead a LM not to recognize when a property is shared by multiple languages. In §6, we cited such variation as the reason the multilingual probes struggled with nominative case. We see this suspicion further borne out in Figure 4, where predictions of Case=Nom in the held-out languages ranged from 0 to $0.62\mathrm{F}_1$ . As evidenced by this lack of transfer, it seems that cross-linguistic variation in the distribution of nominative morphology led to a decentralized encoding of nominative case in mBERT; consequently, this made it more challenging for the probes to capture nominative case in the held-out languages (and for the multilingual probes to identify nominative case in general). + +Yet, there are also cases where the multilingual probes performed better than the monolingual probes with the held-out languages. Most strikingly, the mBERT-6 multilingual probe obtained $0.90\mathrm{F}_1$ on Tagalog verbs, whereas none of the + +monolingual probes got over $0.79\mathrm{F}_1$ . This suggests that, with cross-linguistic properties that are encoded more cohesively, such as verb-hood, exposure to multiple languages can lead a probe to forge more replete connections with mBERT's representational space. + +# 7.2 Family ties + +In the absence of cross-linguistic representations, we generally find that a monolingual probe extends equivalently or better to a held-out language than the multilingual model. In particular, the monolingual probes often did well with related languages (cf. Pires et al., 2019; Wu and Dredze, 2019; Conneau et al., 2020b). Compared to the other monolingual probes, for instance, the Hebrew probes fared best with Arabic, another Semitic language, topping out at a micro-averaged $\mathrm{F}_{1}$ score of 0.56 (see Appendix F). This was also the case at the feature level with nouns, verbs, and adjectives, as shown in Figure 4. Notably, Hebrew and Arabic use different scripts. If mBERT has come to represent them similarly, this likely falls out of the structural similarities between the two languages. + +Likewise, the Croatian mBERT-6 probe achieved a micro-averaged $\mathrm{F}_1$ score of 0.70 on Slovenian. (For comparison, the Turkish mBERT-6 probe scored $0.76\mathrm{F}_{1}$ on Turkish.) The Croatian probe also performed the best on Slovenian nouns, verbs, and adjectives, as well as with words inflected for first person, plurality, or indicative mood. This success seems due to both structural and surface similarities (e.g., cognates) between Croatian and Slovenian. For example, Croatian achieved $0.95\mathrm{F}_1$ on conditional mood (Mood=Cnd; see Appendix + +F) and $0.86\mathrm{F}_1$ on indicative mood (Mood=Ind) in Slovenian because the two languages share several auxiliaries that mark mood (e.g., bi for conditional, je for indicative). + +# 7.3 Revisiting memorization + +Note that, with the exception of shared morphemes, the successful instances of crosslingual transfer cannot be reduced to memorization. If the probes merely memorized their monolingual training data, one would expect chance performance and less variability when evaluating them on the held-out languages. These evaluations further verify that the multilabel probes extracted meaningful representations from mBERT. When applied to held-out languages, they also provide a supplementary method for gauging the complexity of a probe and its ability to memorize a linguistic task. + +# 8 Discussion and conclusion + +Emerging studies on interpretability have highlighted a wealth of linguistic information that can be extracted from neural language models. Contributing to this effort, we propose using a multi-label probing task to analyze the morphosyntactic representations of multilingual word embeddings. We demonstrate this probing paradigm with mBERT (Devlin et al., 2018). + +In a set of monolingual experiments (§5), we trained individual probes for Afrikaans, Croatian, Finnish, Hebrew, Korean, Spanish, and Turkish. We found that mBERT-6 holds the most morphosyntactic information (cf. Liu et al., 2019; Tenney et al., 2019), with the probes obtaining microaveraged $\mathrm{F}_1$ scores between 0.83 and 0.97. In a small case study of Hebrew determiners (§5.3), we illustrated an analysis that implicates multiple features (i.e., lexical category, pronominal type, number, and gender). Crucially, traditional single-label efforts would require training multiple models to arrive at such an analysis and, in general, run the risk of overlooking relevant features. (We also suspect that training multiple one-off probes is less computationally efficient than training a single multilabel probe, though we leave this comparison for future work.) + +Next, in a set of multilingual experiments (§6), we saw that the multilingual probes marginally underperformed their monolingual counterparts, while largely upholding the same trends and exhibiting better selectivity. We attributed this con + +trast in performance to the monolingual probes relying more on memorization, given a simpler task (§6.2). These findings indicate that the multilingual probes may be more "expressive" diagnostics of linguistic representations (cf. Hewitt and Liang, 2019). However, since our goal is to probe embeddings rather than to perform state-of-the-art morphosynthetic tagging, the monolingual and multilingual probes offer the same insights to the extent that they exhibit comparable trends and lend themselves to the same generalizations. + +In a set of crosslingual experiments, we further evaluated the monolingual and multilingual probes on data from six "held-out" languages: Arabic, Chinese, Marathi, Slovenian, Tagalog, and Yorubá (§7). We showed that applying the probes accordingly can help illuminate which linguistic properties a LM recognizes as being shared by multiple languages and what factors might lead a LM not to encode cohesive representations of a particular cross-linguistic feature. Namely, we conjectured that cross-linguistic variation in the distribution of nominative morphology led mBERT to form decentralized representations of nominative case; in turn, this made it more challenging for the probes to extract nominative case in the held-out languages. + +In sum, multilabel probe predictions can be used to perform holistic analyses of a language model's ability to encode systems of morphology, as well as more fine-grained analyses of individual features, agreement phenomena, and how shared properties are represented cross-linguistically. We release the predictions from our probes to support more detailed analyses of mBERT's facility for morphosyntax; these predictions can also be used to focus future contributions by identifying which mBERT layers to target for more complex probing of specific features. In addition, we encourage future efforts to probe different multilingual language models using the multilabel paradigm and to examine how these models might vary in their morphosyntactic representations (cf. Mikhailov et al., 2021). Finally, future research should explore how global and feature-level morphosyntactic probe performance corresponds to the performance of downstream systems, especially amongst morphologically rich languages. + +# Acknowledgments + +We thank Fei Xia, the BlackboxNLP 2020 attendees, and the EMNLP 2021 reviewers for their + +helpful feedback and discussions. We also thank the UW Research Computing Club for supporting our research through their Cloud Credit Program. + +# Ethical considerations + +While our proposed probing paradigm is intended for analyzing large pre-trained language models, which are computationally (and monetarily) expensive to produce (cf. Strubell et al., 2019; Bender et al., 2021), our probes are lightweight and quick to train. To help minimize our use of computational resources, we deployed a "cache and batch" approach to pre-processing our data, which we describe in Appendix C. Furthermore, in addition to releasing our code, we share our multilabel probe predictions to facilitate future morphosyntactic analyses of mBERT (i.e., without the need for training analogous probes). + +In our experiments, we prioritized working with data from a typologically diverse set of languages, many of which are understudied in the field of natural language processing (cf. Joshi et al., 2020). In particular, we drew on data from Universal Dependencies (Nivre et al., 2016; Dobrovoljc and Nivre, 2016), working with morphologically-annoated corpora for 13 different languages: Afrikaans (AfriBooms; cf. Dirix et al., 2017), Arabic (PADT; cf. Smrz et al., 2002, 2008; Hajic et al., 2009), Chinese (PUD; cf. Zeman et al., 2017), Croatian (SET; cf. Agic and Ljubesic, 2015), Finnish (TDT; cf. Haverinen et al., 2014; Pyysalo et al., 2015), Hebrew (HTB; cf. Tsarfaty, 2013; McDonald et al., 2013; Sadde et al., 2018), Korean (PUD; cf. Zeman et al., 2017), Marathi (UFAL; cf. Ravishankar, 2017), Slovenian (SST; cf. Dobrovoljc and Nivre, 2016), Spanish (AnCora; cf. Alonso and Zeman, 2016), Tagalog (TRG), Turkish (IMST; cf. Sulubacak et al., 2016; Tyers et al., 2017; Turk et al., 2019), and Yorubá (YTB; cf. Ishola and Zeman, 2020). Appendix A briefly summarizes the subsets of these datasets that we used in our experiments. + +Though Universal Dependencies is an incredible resource—rich with morphosyntactic and dependency annotations—it is important to remember that many of the these datasets source texts from somewhat narrow domains (e.g., Wikipedia, news corpora, Bible passages) and, thus, may be limited in the linguistic phenomena they capture. Moreover, these datasets are accompanied by varying degrees of documentation. Please see our repository for further details about these datasets (in the + +form of Bender and Friedman-inspired data statements) and for a more thorough discussion of the ethical considerations relevant to our paper.6 + +# References + +Željko Agić and Nikola Ljubesić. 2015. Universal Dependencies for Croatian (that work for Serbian, too). In Proceedings of the 5th Workshop on Balto-Slavic Natural Language Processing, pages 1-8. +Guillaume Alain and Yoshua Bengio. 2018. Understanding intermediate layers using linear classifier probes. arXiv:1610.01644. +Hector Martinez Alonso and Daniel Zeman. 2016. Universal Dependencies for the AnCora treebanks. In Procesamento del Lenguaje Natural, Sociedad Española para el Procesamento del Lenguaje Natural, pages 91-98. +Geoff Bacon and Terry Regier. 2019. Does BERT agree? Evaluating knowledge of structure dependence through agreement relations. arXiv:1908.09892. +Yonatan Belinkov, Nadir Durrani, Fahim Dalvi, Hassan Sajjad, and James Glass. 2017a. What do neural machine translation models learn about morphology? In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 861-872. +Yonatan Belinkov, Lluis Márquez, Hassan Sajjad, Nadir Durrani, Fahim Dalvi, and James Glass. 2017b. Evaluating layers of representation in neural machine translation on part-of-speech and semantic tagging tasks. In Proceedings of the 8th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 1-10. +Emily M. Bender and Batya Friedman. 2018. Data statements for natural language processing: Toward mitigating system bias and enabling better science. Transactions of the Association for Computational Linguistics, 6:587-604. +Emily M. Bender, Timnit Gebru, Angelina McMillan-Major, and Shmargaret Shmitchell. 2021. On the dangers of stochastic parrots: Can language models be too big? In Proceedings of the 2021 ACM Conference on Fairness, Accountability, and Transparency, page 610-623. +Terra Blevins and Luke Zettlemoyer. 2019. Better character language modeling through morphology. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1606-1613. +Ethan A. Chi, John Hewitt, and Christopher D. Manning. 2020. Finding universal grammatical relations in multilingual BERT. In Proceedings of the + +58th Annual Meeting of the Association for Computational Linguistics, pages 5564-5577. +Alexis Conneau, Kartikay Khandelwal, Naman Goyal, Vishray Chaudhary, Guillaume Wenzek, Francisco Guzmán, Edouard Grave, Myle Ott, Luke Zettle-moyer, and Veselin Stoyanov. 2020a. Unsupervised cross-lingual representation learning at scale. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 8440-8451. +Alexis Conneau, German Kruszewski, Guillaume Lample, Loic Barrault, and Marco Baroni. 2018. What you can cram into a single $\$ \& !$ #\*vector: Probing sentence embeddings for linguistic properties. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2126-2136. +Alexis Conneau, Shijie Wu, Haoran Li, Luke Zettlemoyer, and Veselin Stoyanov. 2020b. Emerging cross-lingual structure in pretrained language models. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6022–6034. +Jacob Devlin, Min-Wei Chang, Kenton Lee, and Toutanova Kristina. 2018. BERT: Pre-training of deep bidirectional transformers for language understanding. arXiv:1810.04805. +Peter Dirix, Liesbeth Augustinus, Daniel van Niekerk, and Frank Van Eynde. 2017. Universal Dependencies for Afrikaans. In Proceedings of the NoDaLiDa 2017 Workshop on Universal Dependencies (UDW 2017), pages 38-47. +Kaja Dobrovoljc and Joakim Nivre. 2016. The Universal Dependencies treebank of spoken Slovenian. In Proceedings of the 10th International Conference on Language Resources and Evaluation, pages 1566-1573. +Philipp Dufter and Hinrich Schütze. 2020. Identifying elements essential for BERT's multilinguality. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, pages 4423-4437. +Daniel Edmiston. 2020. A systematic analysis of morphological content in BERT models for multiple languages. arXiv:2004.03032. +Richard Futrell and Roger P. Levy. 2019. Do RNNs learn human-like abstract word order preferences? In Proceedings of the Society for Computation in Linguistics, pages 50-59. +Daniela Gerz, Ivan Vulic, Edoardo Ponti, Jason Naradowsky, Roi Reichard, and Anna Korhonen. 2018. Language modeling for morphologically rich languages: Character-aware modeling for word-level prediction. Transactions of the Association for Computational Linguistics, 6:451-465. + +Kristina Gulordava, Piotr Bojanowski, Edouard Grave, Tal Linzen, and Marco Baroni. 2018. Colorless green recurrent networks dream hierarchically. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 1195-1205. +Jan Hajič, Otakar Smrz, Petr Zemánek, Petr Pajas, Jan Šnaidauf, Emanuel Beška, Jakub Kracmar, and Kamila Hassanová. 2009. Prague Arabic dependency treebank 1.0. Technical report. +Katri Haverinen, Jenna Nyblom, Timo Viljanen, Veronika Laippala, Samuel Kohonen, Anna Missilä, Stina Ojala, Tapio Salakoski, and Filip Ginter. 2014. Building the essential resources for Finnish: The Turku Dependency Treebank. Language Resources and Evaluation, 48(3):493-531. +John Hewitt and Percy Liang. 2019. Designing and interpreting probes with control tasks. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing). +John Hewitt and Christopher D Manning. 2019. A structural probe for finding syntax in word representations. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers). +Dieuwke Hupkes, Sara Veldhoen, and Willem Zuidema. 2018. Visualisation and 'diagnostic classifiers' reveal how recurrent and recursive neural networks process hierarchical structure. Journal of Artificial Intelligence Research, 61(1):907-926. +lájíde Ishola and Daniel Zeman. 2020. Yorúba Dependency Treebank (YTB). In Proceedings of the 12th Language Resources and Evaluation Conference, pages 5178-5186. +Ganesh Jawahar, Benoit Sagot, and Djamé Seddah. 2019. What does BERT learn about the structure of language? In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3651-3657. Association for Computational Linguistics. +Pratik Joshi, Sebastin Santy, Amar Budhiraja, Kalika Bali, and Monojit Choudhury. 2020. The state and fate of linguistic diversity and inclusion in the NLP world. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics. +Karthikeyan K, Zihan Wang, Stephen Mayhew, and Dan Roth. 2020. Cross-lingual ability of multilingual BERT: An empirical study. In International Conference on Learning Representations. +Diederik P. Kingma and Jimmy Ba. 2015. Adam: A method for stochastic optimization. arXiv:1412.6980. + +Stav Klein and Reut Tsarfaty. 2020. Getting the ##life out of living: How adequate are word-pieces for modelling complex morphology? In Proceedings of the 17th SIGMORPHON Workshop on Computational Research in Phonetics, Phonology, and Morphology, pages 204-209. Association for Computational Linguistics. +Nelson F. Liu, Matt Gardner, Yonatan Belinkov, Matthew E. Peters, and Noah A. Smith. 2019. Linguistic knowledge and transferability of contextual representations. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 1073-1094. +Rebecca Marvin and Tal Linzen. 2018. Targeted syntactic evaluation of language models. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1192-1202. +Arya D McCarthy, Ekaterina Vylomova, Shijie Wu, Chaitanya Malaviya, Lawrence Wolf-Sonkin, Garrett Nicolai, Christo Kirov, Miiikka Silfverberg, Sabrina J Mielke, Jeffrey Heinz, et al. 2019. The SIGMORPHON 2019 shared task: Morphological analysis in context and cross-lingual transfer for inflection. In Proceedings of the 16th Workshop on Computational Research in Phonetics, Phonology, and Morphology, pages 229-244. +Ryan T McDonald, Joakim Nivre, Yvonne Quirmbach-Brundage, Yoav Goldberg, Dipanjan Das, Kuzman Ganchev, Keith B Hall, Slav Petrov, Hao Zhang, Oscar Täckström, et al. 2013. Universal Dependency annotation for multilingual parsing. In Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 92-97. +Vladislav Mikhailov, Oleg Serikov, and Ekaterina Artemova. 2021. Morph Call: Porbing morphosyntactic content of multilingual transformers. In Proceedings of the 3rd Workshop on Computational Typology and Multilingual NLP, pages 97-121. +Joakim Nivre, Marie-Catherine de Marneffe, Filip Ginter, Yoav Goldberg, Jan Hajic, Christopher D. Manning, Ryan McDonald, Slav Petrov, Sampo Pyysalo, Natalia Silveira, Reut Tsarfaty, and Daniel Zeman. 2016. Universal Dependencies v1: A multilingual treebank collection. In Proceedings of the 10th International Conference on Language Resources and Evaluation, pages 1659-1666. European Language Resources Association (ELRA). +Joakim Nivre, Marie-Catherine de Marneffe, Filip Ginter, Jan Hajic, Christopher D. Manning, Sampo Pyysalo, Sebastian Schuster, Francis Tyers, and Daniel Zeman. 2020. Universal Dependencies v2: An evergrowing multilingual treebank collection. In Proceedings of the 12th Language Resources and Evaluation Conference, pages 4034-4043. + +Hyunjhi Hayley Park, Katherine J Zhang, Coleman Haley, Kenneth Steimel, Han Liu, and Lane Schwartz. 2020. Morphology matters: A multilingual language modeling analysis. arXiv:2012.06262. +Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. 2019. PyTorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems 32, pages 8024-8035. +Tiago Pimentel, Naomi Saphra, Adina Williams, and Ryan Cotterell. 2020a. Pareto probing: Trading off accuracy for complexity. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, pages 3138-3153. Association for Computational Linguistics. +Tiago Pimentel, Josef Valvoda, Rowan Hall Maudslay, Ran Zmigrod, Adina Williams, and Ryan Cotterell. 2020b. Information-theoretic probing for linguistic structure. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4609-4622. Association for Computational Linguistics. +Telmo Pires, Eva Schlinger, and Dan Garrette. 2019. How multilingual is multilingual BERT? In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4996-5001. Association for Computational Linguistics. +Sampo Pyysalo, Jenna Kanerva, Anna Missilä, Veronika Laippala, and Filip Ginter. 2015. Universal Dependencies for Finnish. In Proceedings of the 20th Nordic Conference of Computational Linguistics, pages 163-172. +Vinit Ravishankar. 2017. A Universal Dependencies Treebank for Marathi. In Proceedings of the 16th International Workshop on Treebanks and Linguistic Theories, pages 190-200. +Shoval Sadde, Amit Seker, and Reut Tsarfaty. 2018. The Hebrew Universal Dependency Treebank: Past, present and future. In Proceedings of the 2nd Workshop on Universal Dependencies, pages 133-143. +Gözde Gül Şahin, Clara Vania, Ilia Kuznetsov, and Iryna Gurevych. 2020. LINSPECTOR: Multilingual probing tasks for word representations. Computational Linguistics, 46(2):335-385. +Otakar Smrz, Viktor Bielicky, Iveta Kourlova, Jakub Kračmar, Jan Hajic, and Petr Zemanek. 2008. Prague Arabic Dependency Treebank: A word on the million words. In Proceedings of the Workshop on Arabic and Local Languages, pages 16-23. + +Otakar Smrz, Jan Šnaidauf, and Petr Zemánek. 2002. Prague Dependency Treebank for Arabic: Multi-level annotation of Arabic corpus. In Proceedings of the International Symposium on the Processing of Arabic, pages 147-155. +Emma Strubell, Ananya Ganesh, and Andrew McCallum. 2019. Energy and policy considerations for deep learning in NLP. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3645-3650. +Umut Sulubacak, Memduh Gokirmak, Francis M Tyers, Cagri Koltekin, Joakim Nivre, and Gülsen Eryigit. 2016. Universal Dependencies for Turkish. In Proceedings of the 26th International Conference on Computational Linguistics: Technical Papers, pages 3444-3454. +Ian Tenney, Dipanjan Das, and Ellie Pavlick. 2019. BERT rediscovers the classical NLP pipeline. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4593-4601. +Reut Tsarfaty. 2013. A unified morpho-syntactic scheme of Stanford Dependencies. In Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers). +Utku Türk, Furkan Atmaca, Şaziye Betül Özates, Balküz Öztürk Başaran, Tunga Güngör, and Arzucan Özgür. 2019. Improving the annotations in the Turkish Universal Dependency Treebank. In Proceedings of the 3rd Workshop on Universal Dependencies. +Francis M Tyers, Jonathan Washington, Căgni Čoltekin, and Aibek Makazhanov. 2017. An assessment of Universal Dependency annotation guidelines for Turkic languages. In Proceedings of the 5th International Conference on Turkic Language Processing, pages 276-297. +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumont, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz, Joe Davison, Sam Shleifer, Patrick von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lhoest, Alexander M. RushThomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumont, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz, Joe Davison, Sam Shleifer, Patrick von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lhoost, and Alexander M. Rush. 2019. Transformers: State-of-the-art natural language processing. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 38-45. +Shijie Wu and Mark Dredze. 2019. Beto, Bentz, Becas: The surprising cross-lingual effectiveness of BERT. + +In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing, pages 833-844. +Daniel Zeman, Martin Popel, Milan Straka, Jan Hajic, Joakim Nivre, Filip Ginter, Juhani Luotolahti, Sampa Pyysalo, Slav Petrov, Martin Potthast, Francis Tyers, Elena Badmaeva, Memduh Gokirmak, Anna Nedoluzhko, Silvie Cinkova, Jan Hajic jr., Jaroslava Hlavacova, Václava Kettnerova, Zdenka Urešová, Jenna Kanerva, Stina Ojala, Anna Missilä, Christopher D. Manning, Sebastian Schuster, Siva Reddy, Dima Taji, Nizar Habash, Herman Leung, Marie-Catherine de Marneffe, Manuela Sanguinetti, Maria Simi, Hiroshi Kanayama, Valeria de Paiva, Kira Droganova, Héctor Martínez Alonso, Cagrì Öltekin, Umut Sulubacak, Hans Uszkoreit, Vivien Macketanz, Aljoscha Burchardt, Kim Harris, Katrin Marheinecke, Georg Rehm, Tolga Kayadelen, Mohammed Attia, Ali Elkahky, Zhuoran Yu, Emily Pitler, Saran Lertpradit, Michael Mandl, Jesse Kirchner, Hector Fernandez Alcalde, Jana Strnadóva, Esha Banerjee, Ruli Manurung, Antonio Stella, Atsuko Shimada, Sookyoung Kwak, Gustavo Mendonça, Tatiana Lando, Rattima Nitisaroj, and Josie Li. 2017. CoNLL 2017 shared task: Multilingual parsing from raw text to Universal Dependencies. In Proceedings of the CoNLL 2017 Shared Task: Multilingual Parsing from Raw Text to Universal Dependencies, pages 1-19. +Kelly W. Zhang and Samuel R. Bowman. 2018. Language modeling teaches you more syntax than translation: Lessons learned through auxiliary task analysis. arXiv:1809.10040. + +Table A1: Composition of the training and evaluation data for the monolingual and multilingual probes. + +
LanguageGenus|F|TrainDevTest
SentencesTokensSentencesTokensSentencesTokens
AfrikaansGermanic5380021,1601945,31742510,065
CroatianSlavic6680017,81196022,2921,13624,260
FinnishFinnic8980010,7861,36318,3111,55321,069
HebrewSemitic5380016,0614848,3584918,829
KoreanKorean3580013,1771001,6791001,728
SpanishRomance6380024,3451,65452,1611,71952,429
TurkishTurkic648008,2449839,7689819,794
Multilingualn/a724,80098,2975,638116,207n/an/a
+ +Table A2: Composition of the "held-out" language data (GCP = Greater Central Philippine). + +
LanguageGenusTest
SentencesTokens
ArabicSemitic67524,195
ChineseChinese1,00021,415
KoreanKorean1,00016,584
MarathiIndic47376
SlovenianSlavic9959,880
TagalogGCP55292
YorùbáDefoid3188,198
+ +# Appendix A Universal Dependencies + +We performed multilabel probing using morphologically annotated corpora from Universal Dependencies (UD). Table A1 summarizes the datasets for the monolingual and multilingual experiments and Table A2 for the crosslingual experiments. + +# Appendix B Feature labels + +Tables B1 and B2 list the 166 feature labels we extracted in total across our experiments. The monolingual probes were trained to extract every morphosyntactically relevant label that was available for a given language in its UD corpus. The multilingual probes focused on a subset of these labels. + +# Appendix C Implementation details + +Word-level predictions To perform word-level predictions of morphosyntactic properties, we first passed the raw corpus sentences through mBERT, then aggregated the contextualized word embeddings on a word-by-word basis. In small exploratory experiments, we found that summing the + +subword embeddings performed the best; we thus used this aggregation strategy throughout our experiments. Notably, summing the subword representations achieved comparable $\mathrm{F}_1$ scores but higher selectivity than taking their average. The summation and averaging strategies also performed better than representing each word by the embedding for its word-initial or word-final word piece. + +Cache and batch Prior to training, we cached the aggregated word representations; these stored embeddings then served as inputs to the probes. This was done in lieu of passing a batch of input sentences through mBERT and doing the aggregation on the fly at each training step. Since the probes themselves are simple linear layers and therefore non-contextual, we were able to batch the embeddings at the token level: We dispensed with the sequence length dimension and skipped padding. In all of the experiments, we opted for a batch size of 512 tokens (i.e., the batches had a dimensionality of $512 \times 768$ ). This "cache and batch" approach allowed each monolingual probe to train in $\sim 1$ minute and each multilingual probe in $\sim 4$ minutes on a Tesla K80 GPU. + +Control task In the control task, each word type $v_{i} \in V$ was assigned a multi-hot output vector $\mathbf{c}^{\mathrm{i}}$ , where $c_{j}^{i}$ was sampled according to the true distribution of the feature label $f_{j}$ in the training data. To help ensure the presence of controlled counterparts for low-frequency feature labels, each feature label had a minimum probability threshold of 0.001. For each language, the probes for the various mBERT layers were trained to predict the same set of random output vectors. + +Table B1: The monolingual probes extracted different sets of features, while the multilingual probes extracted a semi-aggregated subset of these features (in bold under "Feature Labels"). + +
Feature LabelsAfrikaansCroatianFinnishHebrewKoreanSpanishTurkish
ADJ
ADP
ADV
AUX
CCONJ
DET
NOUN
NUM
PART
PRON
PROPN
SCONJ
VERB
AdjType=Attr
AdjType=Pred
Adertype=Post
Adertype=Prep
Adertype=Preppron
AdvType=Tim
Animacy=Anim
Animacy=Inan
Aspect=Hab
Aspect=Perf
Aspect=Prog
Aspect=Prosp
Aspect=Rapid
Case=Abe
Case=Abl
Case=Acc
Case=Ade
Case=Advb
Case=All
Case=Com
Case=Comp
Case=Dat
Case=Ela
Case=Equ
Case=Ess
Case=Gen
Case=Ill
Case=Ine
Case=Ins
Case=Loc
Case=Nom
Case=Par
Case=Tem
Case=Tra
+ +Continuation of Table B1: + +
Feature LabelsAfrikaansCroatianFinnishHebrewKoreanSpanishTurkish
Case=Voc
Clitic=Han
Clitic=Ka
Clitic=Kaan
Clitic=Kin
Clitic=Ko
Clitic=Pa
Clitic=S
Connegative=Yes
Definite=Cons
Definite=Def
Definite=Ind
Degree=Abs
Degree=Cmp
Degree=Dim
Degree=Pos
Degree=Sup
Derivation=Inen
Derivation=Ja
Derivation=Lainen
Derivation=Llinen
Derivation=Minen
Derivation=Sti
Derivation=Tar
Derivation=Ton
Derivation=Ttain
Derivation=U
Derivation=Vs
Echo=Rdp
Evident=Nfh
Form=Adn
Form=Aux
Form=Compl
Gender=Fem
Gender=Masc
Gender=Neut
Gender[psor]=Fem
Gender[psor]=Masc
Gender[psor]=Neut
HeB Binyan=HIFIL
HeB Binyan=HITPAEL
HeB Binyan=HUFAL
HeB Binyan=NIFAL
HeB Binyan=PAAL
HeB Binyan=PIEL
HeB Binyan=PUAL
Heb Existential=True
+ +Continuation of Table B1: + +
Feature LabelsAfrikaansCroatianFinnishHebrewKoreanSpanishTurkish
InfForm=1
InfForm=2
InfForm=3
Mood=Cnd
Mood=Des
Mood=Gen
Mood=Imp
Mood=Ind
Mood=Nec
Mood=Opt
Mood=Pot
Mood=Sub
NumType=Card
NumType=Dist
NumType=Frac
NumType=Mult
NumType=Ord
Number=Dual
Number=Plur
Number=Sing
Number[psor]=Plur
Number[psor]=Sing
PartForm=Agt
PartForm=Neg
PartForm=Past
PartForm=Pres
PartType=Gen
PartType=Inf
PartType=Neg
Person=0
Person=1
Person=2
Person=3
Person[psor]=1
Person[psor]=2
Person[psor]=3
Polarity=Neg
Polarity=Pos
Polite=Form
Polite=Infm
Poss=Yes
Prefix=Yes
PrepCase=Npr
PrepCase=Pre
PronType=Art
PronType=Dem
PronType=Emp
+ +Continuation of Table B1: + +
Feature LabelsAfrikaansCroatianFinnishHebrewKoreanSpanishTurkish
PronType=Ind
PronType=Int
PronType=Neg
PronType=Prs
PronType=Rcp
PronType=Rel
PronType=Tot
Reflex=Yes
Subcat=Intr
Subcat=Prep
Subcat=Tran
Tense=Fut
Tense=Imp
Tense=Past
Tense=Pqp
Tense=Pres
VerbForm=Conv
VerbForm=Fin
VerbForm=Ger
VerbForm=Inf
VerbForm=Part
VerbForm=Vnoun
VerbType=Aux
VerbType=Cop
VerbType=Mod
VerbType=Pas
Voice=Act
Voice=Cau
Voice=Mid
Voice=Pass
+ +Table B2: The monolingual and multilingual probes were evaluated on seven "held-out" languages. + +
Feature LabelsArabicChineseMarathiSlovenianTagalogYorùbá
ADJ
ADP
ADV
AUX
CCONJ
DET
NOUN
NUM
PART
PRON
PROPN
SCONJ
VERB
AdjType=Attr
AdjType=Pred
AdType=Post
AdType=Prep
AdType=Preppron
AdvType=Tim
Animacy=Anim
Animacy=Inan
Aspect=Hab
Aspect=Perf
Aspect=Prog
Aspect=Prosp
Aspect=Rapid
Case=Abe
Case=Abl
Case=Acc
Case=Ade
Case=Advb
Case=All
Case=Com
Case=Comp
Case=Dat
Case=Ela
Case=Equ
Case=Ess
Case=Gen
Case=Ill
Case=Ine
Case=Ins
Case=Loc
Case=Nom
Case=Par
Case=Tem
Case=Tra
Case=Voc
Clitic=Han
Clitic=Ka
Clitic=Kaan
Clitic=Kin
Clitic=Ko
Clitic=Pa
Clitic=S
Connegative=Yes
Definite=Cons
Definite=Def
Definite=Ind
Degree=Abs
Degree=Cmp
Degree=Dim
Degree=Pos
Degree=Sup
Derivation=Inen
Derivation=Ja
Derivation=Lainen
Derivation=Llinen
Derivation=Minen
Derivation=Sti
Derivation=Tar
Derivation=Ton
Derivation=Ttain
Derivation=U
Derivation=Vs
Echo=Rdp
Evident=Nfh
Form=Adn
Form=Aux
Form=Compl
Gender=Fem
Gender=Masc
Gender=Neut
Gender[psor]=Fem
Gender[psor]=Masc
Gender[psor]=Neut
HebBinyan=HIFIL
HebBinyan=HITPAEL
HebBinyan=HUFAL
HebBinyan=NIFAL
HebBinyan=PAAL
HebBinyan=PIEL
HebBinyan=PUAL
HebExistential=True
InfForm=1
InfForm=2
InfForm=3
Mood=Cnd
Mood=Des
Mood=Gen
Mood=Imp
Mood=Ind
Mood=Nec
Mood=Opt
Mood=Pot
Mood=Sub
NumType=Card
NumType=Dist
NumType=Frac
NumType=Mult
NumType=Ord
Number=Dual
Number=Plur
Number=Sing
Number[psor]=Plur
Number[psor]=Sing
PartForm=Agt
PartForm=Neg
PartForm=Past
PartForm=Pres
PartType=Gen
PartType=Inf
PartType=Neg
Person=0
Person=1
Person=2
Person=3
Person[psor]=1
Person[psor]=2
Person[psor]=3
Polarity=Neg
Polarity=Pos
Polite=Form
Polite=Infm
Poss=Yes
Prefix=Yes
PrepCase=Npr
PrepCase=Pre
PronType=Art
PronType=Dem
PronType=Emp
+ +Continuation of Table B2: + +
Feature LabelsArabicChineseMarathiSlovenianTagalogYorùbá
PronType=Ind
PronType=Int
PronType=Neg
PronType=Prs
PronType=Rcp
PronType=Rel
PronType=Tot
Reflex=Yes
Subcat=Intr
Subcat=Prep
Subcat=Tran
Tense=Fut
Tense=Imp
Tense=Past
Tense=Pqp
Tense=Pres
VerbForm=Conv
VerbForm=Fin
VerbForm=Ger
VerbForm=Inf
VerbForm=Part
VerbForm=Vnoun
VerbType=Aux
VerbType=Cop
VerbType=Mod
VerbType=Pas
Voice=Act
Voice=Cau
Voice=Mid
Voice=Pass
+ +![](images/c50ce655d6839a222d8022e5b41a07f780c6fd518dac9a01844f63e0dd72d692.jpg) +Figure D1: Generalizability of the monolingual and multilingual probes. The $x$ -axes indicate the mBERT layer. Negative IV-OOV scores indicate instances where the probes performed better on OOV tokens than IV tokens. + +# Appendix D Monolingual probing with a dash of memorization + +In §6.2, we suggest that multilingual probing is inherently more complex than monolingual probing, and that the simpler task affords the monolingual probes more opportunity to memorize the feature labels. Here, we provide additional evidence supporting this analysis. + +Out-of-vocabulary words It is worthwhile to note that the UD corpora assume an open vocabulary—many of the word types in the validation and test sets do not appear during training. This allows us to evaluate the effectiveness of the probes on out-of-vocabulary (OOV) words. If the probes truly extract features versus memorizing the task, we would expect them to perform similarly on in-vocabulary (IV) and OOV words. Conversely, if the monolingual probes rely more heavily on memorization, this would predict that the multilingual probes are better able to generalize to new data. + +This prediction is largely validated by the OOV tokens: We micro-averaged separate $\mathrm{F}_1$ scores for the words that were seen during training and those that weren't. Since the intuition is that a probe that generalizes better will exhibit smaller gaps in performance between OOV and IV words, we subtracted the OOV scores from the IV scores to quantify how well the probes generalized to unseen words (Figure D1). For Croatian, Finnish, Hebrew, and Turkish, we observed that the gaps between IV and OOV performance tended to be smaller + +for the multilingual probes than the monolingual ones, especially in later layers. $^{8}$ These generalization trends suggest that the monolingual probes are more inclined towards memorization than the multilingual probes. + +Language-specific features Another piece of evidence comes from language-specific features. In the multilingual experiments, we included two sets of language-specific features: Finnish infinitive forms and Hebrew verb classes (a.k.a. binyanim). While the monolingual probes generally outperformed their multilingual counterparts at the feature level, the opposite tended to be true for language-specific features (see Appendix E). If the multilingual probes are more extractive, especially with cross-linguistic features, this might leave the probe with more "room" to capture language-specific features (whether through extraction or memorization). + +Probe complexity Given the challenges posed by doing multilabel morphosyntactic tagging in a multilingual fashion, one possibility is that a linear + +Table D1: Micro-averaged $\mathrm{F}_1$ scores from the linear monolingual and multilingual probes (Mono. & Multi.) and the multilingual MLP-1 probes with $h = \{16,32,64,128\}$ hidden dimensions. + +
Mono.Multi.h=16h=32h=64h=128
Afrikaans0.950.910.890.910.930.94
Croatian0.920.870.830.880.900.91
Finnish0.870.830.770.830.850.87
Hebrew0.870.840.810.840.860.87
Spanish0.970.930.910.940.950.96
Turkish0.830.760.710.770.800.82
+ +Table D2: Selectivity scores from the linear monolingual and multilingual probes (Mono. & Multi.) and the multilingual MLP-1 probes with $h = \{ {16},{32},{64},{128}\}$ hidden dimensions. + +
Mono.Multi.h = 16h = 32h = 64h = 128
Afrikaans0.290.500.370.290.270.27
Croatian0.420.580.420.390.390.39
Finnish0.460.600.510.500.500.50
Hebrew0.490.580.520.500.490.48
Spanish0.350.500.350.310.300.30
Turkish0.460.470.390.380.390.40
+ +probe is simply not complex enough to accommodate the multilingual task. If true, this might offer an alternative explanation as to why the monolingual probes outperformed the multilingual probes. + +In a small post-hoc analysis with mBERT-6, we trained multilayer perceptrons with a single hidden layer (MLP-1s) to perform the multilingual morphosyntactic tagging task. As we increased the dimensionality of the hidden layer, we found that the micro-averaged $\mathrm{F_1}$ performance would approach that of the monolingual probes, but with comparable or worse selectivity. In contrast, the linear multilingual probes consistently exhibited the best selectivity. Tables D1 and D2 convey these results. In sum, these findings suggest that the improvements observed by the more complex probes resulted from them having an increased capacity for memorizing the task, rather than from being more expressive (cf. Hewitt and Liang, 2019). Thus, the advantage of the monolingual probes over the multilingual probes cannot be reduced to a linear layer not being sufficient enough to extract features from multiple languages. + +# Appendix E Monolingual + multilingual feature-level performance + +Figures E1 though E7 report the global and feature-level $\mathrm{F}_1$ results for the monolingual and multilin + +gual probes. In the monolingual experiments, we trained separate probes for Afrikaans, Croatian, Finnish, Hebrew, Korean, Spanish, and Turkish. In a set of multilingual experiments, we then trained probes on a shuffled combination of the training data from the monolingual probes. However, we excluded the Korean dataset from these experiments, due to the lack of documentation on its construction. + +# Appendix F Crosslingual performance + +Figure F1 shows the global $\mathrm{F_1}$ results from evaluating the monolingual and multilingual probes on the held-out languages (plus Korean), while Figure F2 shows the feature-level $\mathrm{F_1}$ results from evaluating the mBERT-6 probes on the held-out languages. + +![](images/adf9033f1aa8a439fccd1b912c89c4d5b1112a8f45a994e33a367603ce19e60c.jpg) +Figure E1: Akrikaans $\mathbf{F}_1$ + +![](images/131fc82a29a67c9f22c2dcd66b0bc2358ccf9f210dda5fead6d6b4397da69f15.jpg) + +![](images/b074e7f69f4d53dc842d3bd442de2d140bda05d99b014c109e20fda6fbaf7bfe.jpg) + +![](images/5c409a758469532653897b9f0de67318d1d88516a021727d9f8b90a5564ff239.jpg) +Figure E2: Croatian $\mathbf{F}_1$ + +![](images/49315d5430ac5ba4ba6dd4dde3962656ea3ef85da25879dee1aec9cdf3ba397b.jpg) + +![](images/19865fb2947109a09b17c0a14160ce3614af550a7abe8413bbd97ff04270786d.jpg) + +![](images/8399b8cfe162972157c1c92bcbefeade7a8d0158bf32d844fa2a068660505688.jpg) + +![](images/2f7dff369341279f4236498888d9f2fa1379bb14801ba475b9f86d3cb5bb92a0.jpg) + +![](images/355947cc414058fdff8eda93486c8d6aa2a85541c6ab04e20d13dd47e99437e4.jpg) + +![](images/95da0aeab714fadace9b5cf297e0d473b4dcf481e69d384ce8086bfe028d3fd1.jpg) + +![](images/915648c2503509434e09c2d54e9763616cd343b5e0a34995acfe1ac73a1f6b9e.jpg) + +![](images/292e109947e3e860ded02d77bc08a6534f33fef236a11687110603776af93a06.jpg) + +![](images/0bc83acc88f17ffb545d5d399b1324fb1d399a979d57f22931a61a01b0dfc4dc.jpg) + +![](images/b6eeadec237a2e6eb52d43f5a51a518951193659f0f87e8e40d7dc0ffa18bf8d.jpg) + +![](images/8cf20ac6143ec4b3f1fb4ba0c82a9379aaf40e721bf4b4ea45dc90f533612826.jpg) + +![](images/a62994a6b6982753f6151af72ee07f2b4e7fc8bfc2266ff6e32c76b1260ba1f7.jpg) + +![](images/07c8f27408c948a99241a22f0933e41778236617bda28c98b4c260f8e32b0e46.jpg) + +![](images/d571e42a833c1d0006e90a26198f984c4fab3dedbc04b83669255d7b464523e2.jpg) + +# Continuation of Figure E2 (Croatian $F_{1}$ ): + +
Tense=Past0.890.940.970.980.950.950.91
Tense=Pres0.860.910.970.980.970.970.94
VerbForm=Conv0.690.660.830.870.720.690.61
VerbForm=Fin0.880.920.980.990.990.990.96
VerbForm=Inf0.820.890.960.970.960.970.93
VerbForm=Part0.820.880.950.950.940.930.9
Voice=Act0.890.940.980.990.970.960.94
Voice=Pass0.580.650.780.810.750.720.69
024681012
Layer
+ +
0.550.860.910.890.840.840.82
0.710.870.940.950.930.930.89
0.570.820.940.880.830.820.83
0.380.60.750.750.660.610.59
024681012
+ +
0.340.080.060.080.110.10.09
0.160.040.020.030.040.040.05
0.320.120.050.110.150.140.11
0.190.060.040.060.090.10.11
024681012
+ +![](images/f2fe26807f99df7071d8f582b7d87d1c4871e06c551de4928e9e66bc1bd0dc95.jpg) +Figure E3: Finnish $\mathbf{F}_1$ + +# Continuation of Figure E3 (Finnish $F_{1}$ ): + +
NumType=Ord0.560.580.710.680.610.510.49
Number=Plur0.730.770.850.870.870.860.83
Number=Sing0.870.870.90.920.910.90.87
Number[psor]=Plur0.230.270.20.320.320.150.26
Number[psor]=Sing0.150.270.590.450.40.420.32
PartForm=Agt0.070.210.320.330.410.290.36
PartForm=Neg0000000
PartForm=Past0.630.680.830.80.750.70.7
PartForm=Pres0.630.670.650.650.610.570.54
Person=00.020.020.030.10.160.040.06
Person=10.60.620.70.740.70.680.66
Person=20.220.20.290.230.120.170.15
Person=30.810.830.890.910.910.90.84
Person[psor]=10.280.40.60.550.520.420.38
Person[psor]=20000000
Person[psor]=30.380.420.670.690.680.620.5
Polarity=Neg0.950.940.940.940.920.930.88
PronType=Dem0.930.950.960.950.930.90.86
PronType=Ind0.510.60.760.770.690.670.49
PronType=Int0.360.380.460.460.310.20.24
PronType=Prs0.860.880.90.890.820.770.54
PronType=Rcp0.20.240.350.220.240.240.13
PronType=Rel0.910.920.910.920.930.890.83
Reflex=Yes0.250.290.310.40.250.10.11
Tense=Past0.710.780.870.880.880.870.8
Tense=Pres0.750.780.860.880.880.880.82
VerbForm=Fin0.780.810.910.930.930.930.89
VerbForm=Inf0.470.520.680.810.790.770.72
VerbForm=Part0.590.680.820.820.780.750.68
Voice=Act0.750.80.870.890.880.870.83
Voice=Pass0.610.670.80.770.710.670.61
024681012
+ +
0.50.70.830.870.860.850.81
0.710.780.830.860.850.840.83
0.250.460.620.670.650.660.62
00.10.190.230.120.110.08
0.670.760.810.820.770.750.7
0.810.930.930.910.880.860.87
0.730.930.940.890.810.760.83
0.510.540.690.650.550.490.45
0.380.360.520.440.370.410.39
0.640.80.810.790.620.580.53
0.220.330.350.240.250.240.25
0.910.920.910.910.90.890.88
0.150.30.40.420.430.410.34
0.610.730.790.80.750.770.77
0.670.730.820.820.80.820.77
0.640.740.810.810.760.770.77
0.470.610.710.70.610.60.57
124681012
+ +
0.230.070.020.010.010.010.02
0.160.090.070.060.070.060.04
0.350.160.080.080.060.020.04
0.220.090.1-0.0100.060.07
0.130.070.070.10.130.150.14
0.140.010.010.020.040.070
0.20.020.010.050.120.130.03
0.010.050.070.120.130.190.05
-0.010.03-0.060.02-0.06-0.21-0.14
0.220.080.090.090.190.190.01
-0.02-0.10-0.01-0.010-0.12
0000.010.030-0.05
0.1-0.02-0.09-0.02-0.18-0.31-0.24
0.090.050.080.080.130.10.04
0.080.050.040.050.080.060.05
0.110.060.060.080.130.10.06
0.140.060.10.070.10.070.04
024681012
+ +![](images/a970f30454aa4815f78b389b282b634fa7edebd8ee4f93e005845d5c4d82c1f4.jpg) +Figure E4: Hebrew $\mathbf{F}_1$ + +![](images/4bab98635025ce329dcc372b81e35c7d1c0c277d1497d2e47f472ff5fe803ba8.jpg) + +![](images/1000972df6f99b8dc7412394c1b63c3c8f3002573c576d42508f77ae5cf27219.jpg) + +![](images/230c0c375e42d35f8298ff38106089aa851c6ed3a076c252dc07a4c100f1bb96.jpg) +Figure E5: Korean $\mathbf{F}_1$ + +![](images/6f988a01285fa8a4790eeeab83bf416a5ec7b57c2aff81c1d4857ad5ec7e11aa.jpg) +Figure E6: Spanish $\mathbf{F}_1$ + +# Continuation of Figure E6 (Spanish $F_{1}$ ): + +
Tense=Pres0.870.910.960.960.960.950.92
VerbForm=Fin0.910.960.990.990.990.990.97
VerbForm=Ger0.780.770.940.880.810.750.67
VerbForm=Inf0.930.960.990.990.980.970.94
VerbForm=Part0.820.880.930.930.90.880.84
024681012
Layer
+ +
0.690.860.930.920.890.880.86
1111111
024681012
Layer
+ +
0.180.050.030.050.060.060.06
024681012
Layer
+ +![](images/c1a4b6eec48b95825b3f9a502a436835473aad7e34408e4e211668e0d58a3565.jpg) +Figure E7: Turkish $\mathbf{F}_1$ + +![](images/c9e303620bf0bc6c670d7c7d1a1f26292ba74649dede41e0718ba2f6479aeacc.jpg) + +![](images/898b1ae2500aef1fb32151fb9dcc3fa4f367eca3436221dbca2d9654675369df.jpg) + +![](images/dc71d592e6fd146c56c8058faa65cece37ee02fd36a22d4b8a787c64db3d5e74.jpg) + +![](images/83cf533a8297369b22da092815b7b57f7deca83fa31ad24ec58d1ddc4c6be957.jpg) + +![](images/97de35d22d3fd7b5e0b0062d4d2249aa1b682e72e6673146eeae824dce78d5f6.jpg) + +![](images/1edac988e33b4e9c5b9f277d766312b15426c97c6b0c1f65291890f5a8b15a8c.jpg) + +![](images/a9ef94a2d1cd6ad4e886401b642ed23d2a14ca90b3ad896b40bc229738437dc8.jpg) + +![](images/70377cc11fe2b9d5d63067952ff1f55024403c609ab9b1e86d11594db6a686e4.jpg) + +![](images/d0b2568d549652d2d1ddc92b7706fa23b6f5c392c1623fe1ddc3270a2c0898d8.jpg) + +![](images/a673bb506936fbd283c9aca47474df7d8a8a76d5cc0b2736c9a89bdf288e598d.jpg) + +![](images/1986cb3ab14d7f397db9186bedeb28feff43744f5698192f0cd56a69cc376828.jpg) + +![](images/d600c480ed072aa63f27751becea1413beeda10365de79f683b209c85f841716.jpg) + +![](images/f4cbef298c4569130cf6761a174e5d3ea7bf83441b7e712712b29ac5d1742c35.jpg) + +# Continuation of Figure E7 (Turkish $F_{1}$ ): + +
Tense=Pres0.690.710.770.770.730.690.65
VerbForm=Conv0.440.50.580.70.690.630.47
VerbForm=Part0.690.770.830.830.790.770.75
VerbForm=Vnoun0.640.630.670.720.690.650.61
Voice=Cau0.420.470.510.50.430.440.34
Voice=Pass0.420.470.530.550.490.470.48
024681012
Layer
+ +
0.470.580.690.680.620.610.6
0.440.550.560.580.560.540.5
1111111
024681012
Layer
+ +
0.220.130.080.090.110.080.04
-0.03-0.08-0.03-0.03-0.07-0.07-0.02
024681012
Layer
+ +![](images/7cd25031a95e2a2b6cf47f5c63e8bc4e4bab17708ac9c293edb241e5222d9973.jpg) +Figure F1: Micro-averaged $\mathrm{F}_1$ results from evaluating the monolingual and multilingual probes on the "held-out" languages (plus Korean). The $x$ -axes indicate the mBERT layer. + +![](images/0da756fca47521dfbd6060bd86193eb9db59b569035b155d8aab918f45f4aa49.jpg) + +![](images/24d39caaf1bceaad89b2bcfb46d3037a1ef84d1cf711cecf75d33f62d850909c.jpg) +Figure F2: $\mathrm{F}_1$ results from evaluating the monolingual and multilingual mBERT-6 probes on the "held-out" languages. The $x$ -axes indicate the held-out language (Ar=Arabic, Zh=Chinese, Mr=Marathi, Sl=Slovenian, Tl=Tagalog, and Yo=Yorùba) and the $y$ -axes indicate the probe (Mu=Multilingual, Af=Afrikaans, Hr=Croatian, Fi=Finnish, He=Hebrew, Ko=Korean, Es=Spanish, and Tr=Turkish). Grayed-out regions indicate where the feature is not applicable to the language or annotated in the language's corpus. + +![](images/d91c754381d30d4031805e12077e9282da6b46754cc5ebb8e3ff54a0a2b1ac66.jpg) + +![](images/3886deb9fa7b3a7b4cc1c4a6a2a2f8a20539c66091e04f515b506bf7f109b1b3.jpg) + +![](images/f94faa5abf957327a3f988f7759a430138a997e9312d61c9e119a0ac9e68413e.jpg) + +![](images/85f54ebbf78e17c3a9953c35b8f243cc59df1873077574d21e7dc50314aafd05.jpg) + +![](images/cef252a3a1006b95e6ffb07b4ee09c3ed3d974da105deb64907b839947394724.jpg) + +![](images/94d367caed5a8de113a3e7e52341d2c1a621c11f2aa70b68b524db4b8a4af0f3.jpg) + +![](images/369cac204546e6d9f6ab9d6f659c865ef650c33f36f738728b129ac3eb56ddf1.jpg) + +![](images/9e4e701493ffa0ac8bd096c007e0612089c7fa218e2a73ec404734d8cdf7dc24.jpg) + +![](images/b4179a326f289feee967ad6be16c03405de81dbc6c04dcf91693d9cf245896c8.jpg) + +![](images/c0c4e6bad222deadea50310e52ff33d018b7cd00a46a7b9357704e675e8b97ff.jpg) + +![](images/2c9336d0cd50b36d2f59b01b456cce4ff316d75929b5e487971f68d33b96bd85.jpg) + +![](images/ea6cf9c0c0214e55edd814888282a347b9d93cecd51482235f4976fe4f925d31.jpg) + +![](images/15fd338eefbcb8477fa39093f2c0fe87dd235e481f2bf4f397a097ea896b6c78.jpg) + +![](images/04d93c44203165c0bde08b6444ac9e76a2287655e29f643b33a4f56bd9157767.jpg) + +![](images/5c1555f68ee06452fddbfb1db8da6954b9f2b573b2585753ef8c54b9dac6c54f.jpg) + +![](images/b3e41b6438ac0eb16fe09109ff040a4d6acccada4200264fdb638637a4677798.jpg) + +![](images/5a9bdf590c5d4066fb18dace61b5331db9359e62b96e5732a9602f416181a777.jpg) +Continuation of Figure F2: + +![](images/ff8331cc249fd04e0e5345c49a98ed17082d3dccaaec2996e5e0584958a6fd6b.jpg) + +![](images/567249c1b56d329f702a12c64d874d1ab247110d5c486ecf58d129457f7637b1.jpg) + +![](images/786fb21f6b2c810a233a847cb6a184b222e30d21c3232f7a41dbef8d91b3c1af.jpg) + +![](images/a3f06b400ee5e10f76df1f3079705b2526ffdc8b5107e55efc0635c968bc3d32.jpg) + +![](images/4627808857d9df7f844231ecc147d4ab1512012b013bcdc10a778cc6cf3c5a3f.jpg) + +![](images/feae6c8657ce2e1a0dbe2a671cacc39871df57e6e8eeb3ac024448a4720f3f24.jpg) + +![](images/7fe1fa2660776af85f52b9c26dbb3c240e98da08ffc46cea58546ef7fb00a6b1.jpg) + +![](images/59af70149273ffa86c8aacc0ae50d4eeec096e98f529fffd624b8e45d4c9508d.jpg) + +![](images/410cdfee0f499a7bcada28020a5cf61c2e4efda8e7ce9c3c301e53ecb1a690e0.jpg) + +![](images/9876474bd8f4cb7e278384916475ad75d1dae18ade7f3290620175272f8c0ce1.jpg) + +![](images/ccd8855605d7bea073fc02b3609eea675cc7216b266534c13f8937d02b414663.jpg) + +![](images/9e3af7da1280ba2da648cf83c2d7a0c10b3e9a30eaa60162188f127307b1cbdf.jpg) + +![](images/e5e6b1ed143ee96c8c3972108a472a57fadef903bd9afd90695588399634e629.jpg) + +![](images/e767a3a5a344740414a466c3fd15fd41155ba2b2c81e08e7393dc89c4ee9294a.jpg) + +![](images/92c068b837fc7edf9a8f21a1a611a3d8689002f24ff5ee679855a78977795e11.jpg) + +![](images/896e21e31103db5f43b1b7f8fdf5cce6fb42b74d91add5c5ef120a752484909c.jpg) + +![](images/d23839420136b503c15a12942375499d6c1702a34b5b2b993a308163c9f88945.jpg) + +![](images/565fa2bd574185deb581a11f2b8a9033e4c959c059681128ff4948cf7cbe2bf0.jpg) + +![](images/643a462400118941cb723e67361820af45a509c550da5c11b2b2aa18ff877c0a.jpg) + +![](images/c263689130ac83b0f9fc541c6c56ec584caf6447e068f17fc1e2760015bc09e6.jpg) +Continuation of Figure F2: + +![](images/a801c2acfc42c631b66d3802de071c366ce65656dd569b2126e42b40addac4a3.jpg) + +![](images/07cf1e0dcb27944006188105dcd2f50c561a4ffadfeeb16a7e1d7a13593666d8.jpg) + +![](images/7cfbeae75cb413286fe4a426e3f21bc1f89d68937a33d806083a178870d390e1.jpg) + +![](images/dfd9533854c6a75d7dcd2cfe9077083104cdf5ddd0600d6ad959a2f5af2c5e32.jpg) + +![](images/f1198b43afc9271ebdde41300d219245de23f2e71fdbf77dc04043fb93ea3d61.jpg) + +![](images/891e0f4dadb8486b32f49297d6fdcb98cccc0f9590ff7f978978a104321a383a.jpg) \ No newline at end of file diff --git a/amultilabelapproachtomorphosyntacticprobing/images.zip b/amultilabelapproachtomorphosyntacticprobing/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..c5af1b42d36852d5a1a8a550d4598ff7c2af86ce --- /dev/null +++ b/amultilabelapproachtomorphosyntacticprobing/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d6d23f1ec2a3e2dc54591ceb1d208d0ca5348a5250bfba7e6f93c243248864e +size 4589199 diff --git a/amultilabelapproachtomorphosyntacticprobing/layout.json b/amultilabelapproachtomorphosyntacticprobing/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a99e789182a476a77d776db94e0d04d56a5638bb --- /dev/null +++ b/amultilabelapproachtomorphosyntacticprobing/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e8907182258cec19beb09ad7cf47ce811aec0848cdfc82d290fde7bb68bfc66a +size 762588 diff --git a/amultilabelmultihoprelationdetectionmodelbasedonrelationawaresequencegeneration/deded4a1-f6b3-4d75-9cb7-4610b893ad65_content_list.json b/amultilabelmultihoprelationdetectionmodelbasedonrelationawaresequencegeneration/deded4a1-f6b3-4d75-9cb7-4610b893ad65_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..cc2bdc7a3c3801a17a78e30df72a94a2ee37e0ff --- /dev/null +++ b/amultilabelmultihoprelationdetectionmodelbasedonrelationawaresequencegeneration/deded4a1-f6b3-4d75-9cb7-4610b893ad65_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:72b4136c7538606a9a44dc2466457ffcf2e58e23c970a82234db228392f6a785 +size 46217 diff --git a/amultilabelmultihoprelationdetectionmodelbasedonrelationawaresequencegeneration/deded4a1-f6b3-4d75-9cb7-4610b893ad65_model.json b/amultilabelmultihoprelationdetectionmodelbasedonrelationawaresequencegeneration/deded4a1-f6b3-4d75-9cb7-4610b893ad65_model.json new file mode 100644 index 0000000000000000000000000000000000000000..6c3ad5e10d26ab28da0bbcb68ef6d9bb887bc5ea --- /dev/null +++ b/amultilabelmultihoprelationdetectionmodelbasedonrelationawaresequencegeneration/deded4a1-f6b3-4d75-9cb7-4610b893ad65_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc87408180245eafbf4fa7627db7374c28b51eb20310e223d8e3b2686bfe6cde +size 56994 diff --git a/amultilabelmultihoprelationdetectionmodelbasedonrelationawaresequencegeneration/deded4a1-f6b3-4d75-9cb7-4610b893ad65_origin.pdf b/amultilabelmultihoprelationdetectionmodelbasedonrelationawaresequencegeneration/deded4a1-f6b3-4d75-9cb7-4610b893ad65_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8702ba713418bc78337f8140ce9ef051daf9cb93 --- /dev/null +++ b/amultilabelmultihoprelationdetectionmodelbasedonrelationawaresequencegeneration/deded4a1-f6b3-4d75-9cb7-4610b893ad65_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2a25a96e5aaa6fef8ac5e833408c0ac755c2c4880dd87b70045d1029becc4092 +size 301184 diff --git a/amultilabelmultihoprelationdetectionmodelbasedonrelationawaresequencegeneration/full.md b/amultilabelmultihoprelationdetectionmodelbasedonrelationawaresequencegeneration/full.md new file mode 100644 index 0000000000000000000000000000000000000000..40d74b7bf7d37f494904c8ea400b5e99280efe73 --- /dev/null +++ b/amultilabelmultihoprelationdetectionmodelbasedonrelationawaresequencegeneration/full.md @@ -0,0 +1,240 @@ +# A Multi-label Multi-hop Relation Detection Model based on Relation-aware Sequence Generation + +Linhai Zhang $^{1}$ , Deyu Zhou $^{1*}$ , Chao Lin $^{1}$ , Yulan He $^{2}$ + +$^{1}$ School of Computer Science and Engineering, Key Laboratory of Computer Network and Information Integration, Ministry of Education, Southeast University, China + +$^{2}$ Department of Computer Science, University of Warwick, UK + +{lzhang472,d.zhou,c.lin}@seu.edu.cn, + +yulan.he@warwick.ac.uk + +# Abstract + +Multi-hop relation detection in Knowledge Base Question Answering (KBQA) aims at retrieving the relation path starting from the topic entity to the answer node based on a given question, where the relation path may comprise multiple relations. Most of the existing methods treat it as a single-label learning problem while ignoring the fact that for some complex questions, there exist multiple correct relation paths in knowledge bases. Therefore, in this paper, multi-hop relation detection is considered as a multi-label learning problem. However, performing multi-label multi-hop relation detection is challenging since the numbers of both the labels and the hops are unknown. To tackle this challenge, multi-label multi-hop relation detection is formulated as a sequence generation task. A relation-aware sequence relation generation model is proposed to solve the problem in an end-to-end manner. Experimental results show the effectiveness of the proposed method for relation detection and KBQA. + +# 1 Introduction + +With the development of Knowledge Bases (KBs) such as DBpedia, Freebase, and WikiData, Knowledge Base Question Answering (KBQA) system (Berant et al., 2013; Bordes et al., 2015; Yin et al., 2016; Hao et al., 2018) is attracting more and more attention. The KBQA system often contains two core components: (1) entity linking, which identifies the topic entity mentioned in the question; (2) relation detection, which detects the relation paths starting from the topic entity to the answer node. + +Relation detection in KBQA can be categorized into single-relation (one-hop) detection and multi-relation (multi-hop) detection. Most existing single-relation detection methods (Yin et al., 2016; Yu et al., 2017; Lukovnikov et al., 2017; Yu et al., + +![](images/5fc88b431cf88b730cf0c74aabc336945a26b21213d17bd1c5ad4b48d5f5eac2.jpg) +Figure 1: Examples of ground-truth relation paths corresponding to the given questions. + +2018) rely on measuring the semantic similarity of questions and candidate relations. He and Golub (2016) proposed an encoder-decoder based generative framework for single-relation extraction. For multi-relation detection, some approaches (Yih et al., 2015; Yu et al., 2017, 2018) proposed to tackle two or three-relation detection by applying some constraint which makes the number of hops fixed. Xiong et al. (2017) and Das et al. (2017) modeled the relation reasoning problem as a Markov decision process. Chen et al. (2019) exploited a transition-based search framework to select the relation dynamically. Recently, some researchers attempt to model prediction uncertainties in the simple question answering task with Bayesian neural network (Zhang et al., 2021). Generally, most of existing methods focus on detecting one optimal relation path, considering the task a single-label learning problem. + +However, for some question, there may exist multiple relation paths to the correct answer. For example, as shown in the upper part of Figure 1, there are two distinct relation paths time/time/event and olympic/olympic Games/host_city with the same meaning, making the instance multi-label. Moreover, as shown in the lower part of Figure 1, there are two relation paths starting from different topic entities Pierce Brosnan and 007. A robust + +KBQA system should be able to infer the final answer based on multiple relation paths. We therefore consider multi-label multi-hop relation detection in this paper. + +Nevertheless, it is challenging to perform multi-label multi-hop relation detection since both the number of relation paths and the number of hops in each relation path are unknown. To deal with such a challenge, in this paper, we formulate it as a sequence generation task in the following form $\{r_1^1,\ldots ,r_{n_1}^1,[\mathrm{SEP}],r_1^2,\ldots ,r_{n_2}^2,[\mathrm{SEP}],$ $r_1^m,\dots ,r_{n_m}^m,[\mathrm{END}]\}$ , where $r_i^j$ denotes the $i$ -th relation in $j$ -th path, the comma splits the relation chains and the [SEP] indicates the division of different relation paths. A relation-aware sequence generation model (RSGM) is proposed to learn the sequence generation task end-to-end, without the need of knowing the number of labels and hops beforehand. In specific, a pre-trained Bidirectional Encoder Representations from Transformers (BERT) model is employed as the encoder of RSGM while a Gated Recurrent Unit (GRU) with relation-aware attention is designed as the decoder to incorporating the semantic information of the relations. Moreover, a constraint-learning strategy is proposed to mitigate the exposure bias and label repetition problem in sequence generation. + +The main contributions of this paper are: + +- An end-to-end relation-aware sequence generation model, RSGM, is proposed to deal with the multi-label multi-hop relation detection problem. +- Experimental results show the effectiveness of proposed model both on relation detection and KBQA end-task. + +# 2 Methodology + +# 2.1 Problem Setting + +Let $G = (\mathcal{S},\mathcal{R},\mathcal{O})$ be the KB, where $\mathcal{S}$ represents the set of subject entities, $\mathcal{O}$ represents the set of object entities, and $\mathcal{R}$ represents the set of relations between the subject entities and the object entities. Assume a set of questions $Q = \{q_{1},q_{2},\ldots q_{|Q|}\}$ , where each instance $q_{i} = \{w_{1},w_{2},\ldots w_{N_{i}}\}$ has $N_{i}$ words. + +Given question $q$ and knowledge base $G$ , traditional methods treat multi-hop relation detection as a single-label learning problem, aiming at finding the optimal relation path $p$ , where + +$$ +p = \left(r _ {1}, r _ {2}, \dots , r _ {n} \mid r _ {i} \in \mathcal {R}\right) \tag {1} +$$ + +In this paper, multi-label multi-hop relation detection is considered. Therefore, the objective is to find a set of relation paths $P$ based on question $q$ and knowledge base $G$ , where + +$$ +P = \left\{p _ {1}, p _ {2}, \dots , p _ {m} \right\} \tag {2} +$$ + +$$ +p _ {j} = (r _ {1 j}, r _ {2 j}, \ldots , r _ {n j} | r _ {i j} \in \mathcal {R}) +$$ + +As both the number of labels and the number of hops are unknown, the task is formulated as a sequence generation problem. The objective is to generate a token sequence $Y$ given question $q$ and knowledge base $G$ , where + +$$ +Y = \left(y _ {1}, y _ {2}, \dots , y _ {M}\right) \tag {3} +$$ + +$$ +y _ {i} \in \mathcal {R} \cup [ \mathrm {S E P} ] \cup [ \mathrm {E N D} ] +$$ + +where the [SEP] indicates the division of different relation paths and [END] indicates the end of the sequence. + +# 2.2 The Proposed Model + +The overall architecture of the proposed relation-aware sequence generation model (RSGM) is presented in Figure 2. It consists of two components which will be discussed in more details: (1) the question encoder, where the question is transformed into a context-aware representation using BERT; (2) the relation decoder, where a GRU is employed to generate the relation sequentially with a relation-aware attention. + +Question Encoder To utilize the abundant semantic information of the large pre-trained model, BERT is employed as the encoder, which takes the question as the input and learns the context-aware representation for each token. + +Specifically, for the given question $q_{i}$ , the token [CLS] is inserted as the first token to obtain the representation of the whole question, i.e., + +$$ +q _ {i} = \left\{\left[ \mathrm {C L S} \right], w _ {1}, w _ {2}, \dots w _ {N _ {i}} \right\} \tag {4} +$$ + +The representation of the word $w_{i}$ is computed as the sum of three embeddings: token embedding $h_i^{tok}$ , segmentation embedding $h_i^{seg}$ , and the position embedding $h_i^{pos}$ , which is denoted as $h_i^w$ , + +$$ +h _ {i} ^ {w} = h _ {i} ^ {\text {t o k}} + h _ {i} ^ {\text {s e g}} + h _ {i} ^ {\text {p o s}} \tag {5} +$$ + +As a result, a list of token embeddings $\mathbf{W}_0 = \{h^q,h_1^w,h_2^w\dots h_N^w\}$ are obtained and then fed into a series of $L$ pre-trained transformer blocks, + +$$ +\mathbf {W} _ {i} = \operatorname {T r a n s f o r m e r} \left(\mathbf {W} _ {i - 1}\right), i = 1, 2, \dots , L \tag {6} +$$ + +![](images/772ff8ec831063d066109803671d750d202d995c184d8fccec41c9c0e55650d2.jpg) +Figure 2: The architecture of the proposed RSGM model. Each relation can be split into multiple word tokens and its representations can be obtained by adding such word token embeddings to mitigate the zero-shot learning problem. + +Relation Decoder To generate relation sequentially, a GRU is employed. The prediction $y_{i}$ at time $i$ is affected by three factors, the hidden state of time $i - 1$ , the token predicted at time $i - 1$ and the relation-aware question representation, formally, + +$$ +s _ {i} = \operatorname {G R U} \left(s _ {i - 1}, \left[ h _ {y _ {i - 1}}; c _ {i} \right]\right) \tag {7} +$$ + +$$ +y _ {i} = \operatorname {s o f t m a x} \left(\tanh \left(\mathbf {W} _ {o} s _ {i} + \mathbf {b} _ {o}\right)\right) +$$ + +where $s_{i-1}$ denotes the hidden state of time $i - 1$ , $h_{y_{i-1}}$ denotes the embedding of token $y_{i-1}$ predicted at time $i - 1$ , $c_i$ denotes the relation-aware question representation. + +Assuming the relation $r$ consisting of $N_{r}$ words, its embedding is defined as the sum of its word embeddings to encode its semantic information: + +$$ +h _ {r} = \sum_ {k = 1} ^ {N _ {r}} e _ {k} \tag {8} +$$ + +The token [SEP] is initialized randomly and updated during training. + +The relation-aware question representation $c_{i}$ is calculated by taking the word embedding $h_{i}^{w}$ as the key and the value, and the hidden state $s_{i-1}$ as the query: + +$$ +c _ {i} = \sum_ {j = 1} ^ {N} \alpha_ {i j} h _ {j} ^ {w} +$$ + +$$ +\alpha_ {i j} = \frac {\exp \left(e _ {i j}\right)}{\sum_ {k = 1} ^ {N} \exp \left(e _ {i k}\right)} \tag {9} +$$ + +$$ +e _ {i k} = \mathbf {v} _ {a} ^ {T} t a n h (\mathbf {W} _ {a} [ s _ {i - 1}; h _ {j} ^ {w} ]) +$$ + +# 2.3 Training and Inference + +The proposed model is trained under regular sequence-to-sequence loss by maximizing the likelihood of the ground-truth token sequence. At the + +training stage, to bridge the gap between training and inference, the scheduled sampling policy (Bengio et al., 2015) is employed, which exploits part of the ground-truth to guide model learning. At the testing stage, the beam search optimization approach (Wiseman and Rush, 2016) is used to mitigate the exposure bias problem. Additionally, to avoid the repetition problem, a constraint mechanism is added. Unlike text generation or machine translation tasks, the multiple paths to the same question are usually mutually exclusive. Therefore, when a relation path is generated, an infinite penalty is added for that relation path, in order to avoid it being generated again. + +# 3 Experiments + +We conduct experiments on a large KBQA benchmark dataset FreebaseQA (Jiang et al., 2019) to evaluate the effectiveness of the proposed RSGM model. + +# 3.1 Dataset + +FreebaseQA (Jiang et al., 2019) is a novel KBQA dataset generated by matching trivia-type question-answer pairs with facts existed in FreeBase. In particular, for each question in the dataset, there may often exist multiple multi-hop relation paths that can give rise to the correct answer. Here multi-hop means it should takes multiple hops in the knowledge base to reach the correct answer node. Compared with the existing well-known KBQA datasets SimpleQuestions (Bordes et al., 2015) and WebQuestion (Berant et al., 2013), it has the following characteristics: (1) for the give question, it provides multiple annotated relation paths to the + +
MethodsPresion(↑)Recall(↑)Micro F1(↑)HL(×10-4)(↓)
CNN-multichannel (Kim, 2014)0.51580.39520.44751.4285
MLKNN (Zhang and Zhou, 2014)0.53270.32870.40661.4049
HAN (Yang et al., 2016)0.49650.42540.45821.4728
SGM (Yang et al., 2018)0.50390.39760.44451.4549
SGM-BERT0.59920.43720.50561.2437
RSGM0.67950.52850.59451.0552
+ +Table 1: Performance comparison of the proposed approach with other approaches on FreebaseQA test set. "HL" represents the metric of Hamming Loss. + +
DatesetFreebaseQA
Train20358
Dev3994
Test3996
+ +Table 2: Question numbers of the subsets of FreebaseQA dataset + +correct answer as ground-truth. (2) the linguistic structure of the question is more sophisticated. (3) more training instances is provided enabling effectively training for neural networks. The detailed statistics are shown in Table 2. The FreebaseQA dataset is publicly available1. Since FreebaseQA is the only KBQA dataset that is annotated with multiple relations, we mainly conduct our experiments on this dataset. + +# 3.2 Baselines + +To our best knowledge, there is no other KBQA method consider multi-label multi-hop relation detection, so to demonstrate the effectiveness of the proposed model, we mainly include the following baselines and modify them to perform a multi-label prediction task: + +- CNN-multichannel (Kim, 2014): multiple filters are employed to extract features of sentences and a full connected layer with the sigmoid function is utilized to obtain the probability of each label. +- MLKNN (Zhang and Zhou, 2014): the maximum a posteriori (MAP) rule is exploited to make prediction by reasoning with the labeling information implied in the k-nearest neighbors, which ignores utilizing label correlations. + +- HAN (Yang et al., 2016): a hierarchical attention network is employed to obtain sentence representations and then generate document representations based on sentence representations. +- SGM (Yang et al., 2018): a novel sequence-to-sequence structure with global embedding is proposed to capture the correlations between labels. +- SGM-BERT: a variant of SGM by replacing the encoder of SGM with BERT. + +# 3.3 Evaluation Metrics + +To evaluate the performance of different approaches, several evaluation metrics are employed including Precision, Recall, Micro-F1 score and Hamming Loss as suggested in (Zhang and Zhou, 2007). + +# 3.4 Model Setup + +The uncased $\mathrm{BERT}_{\text {base }}$ is employed as text encoder, with the parameters fine-tuned during training. For decoder GRU, the hidden state dimension is set to 128 and beam size is 5. The whole model is trained by the Adam optimizer (Kingma and Ba, 2014) with a learning rate of 1e-4 and a dropout rate of 0.3. The number of epochs is 10 and the mini-batch size of the input is set at 20. The parameters are chosen based on the evaluation results from dev subset. + +# 3.5 Relation Detection Results + +Experimental results on the FreebaseQA benchmark are listed in Table 1. It can be observed that: (1) SGM-BERT outperforms SGM, demonstrating the effectiveness of BERT encoder; (2) The proposed RSGM outperforms SGM by large margin on all metrics. The reasons can be summarized as followings: (1) RSGM employs a relation-aware + +attention mechanism, which provide more informative sentence representation compared with vanilla self-attention; (2) RSGM formulated multi-label multi-hop relation detection as a sequence generation task, which gets a much smaller search space compared with other methods that perform multi-label permutation task. + +# 3.6 KBQA End-Task Results + +To investigate the effectiveness of the proposed relation detection method for the KBQA end-task, we perform entity linking and retrieve the final answer with the relation path detected by RSGM. + +
KRecall
500.80
1000.88
2000.94
+ +Table 3 gives the entity linking results with different sizes of candidate entities, where recall is calculated as the fraction of the questions for which the candidate topic entities collection includes the correct subject entity. + +Table 3: Entity Linking Results + +
MethodsAccuracy%
FOFE-net (Jiang et al., 2019)37.0
RSGM-5036.1
RSGM-10038.1
RSGM-20038.0
+ +Table 4: KBQA Results on FreeBaseQA test set. RSGM-x represent top x of candidate entities are used from entity linking. + +The experimental results of KBQA end-task are shown in Table 4. The FOFE-net (Jiang et al., 2019) is a pipeline KBQA system built based on FOFENet (Xu et al., 2017), which achieves outstanding results on SimpleQuestions and WebQSP datasets. The RSGM result is obtained by performing entity linking and relation detection with proposed model. Based on the multiple relation paths generated by RSGM, a majority vote strategy is employed to get the final answer. The results show that RSGM outperforms FOFE-net in KBQA end-task on FreeBaseQA dataset. + +![](images/073b55e319e9692a37c0300926dc545db7b2bfefb68f60958ea72978778ea3f1.jpg) +Figure 3: Visualization of relation-aware attention. Deeper color indicate larger attention weight. + +# 3.7 Visualization of relation-aware attention + +Let us refer back to the bottom example described in Figure 1, it can be observed that when predicting different relations, the different range of the question plays a different role. At the same time, attention mechanism between relations and questions can be utilized to select the most meaningful words in the given question. To demonstrate the above observation, the weights in attention layer are extracted and further visualized in different kinds of colors that reflect the contributions of different words. The results are shown in Figure 3. From the Figure, it can be observed that the attention is captured properly and indicates which parts in the question make more contribution. For instance, "pierce [UNK]" has been paid more attention when detecting the relation "film/film-character/ported_in_films". + +# 4 Conclusion + +In this paper, we frame multi-hop relation detection as a multi-label learning problem. To solve the challenge of multi-label multi-hop relation detection, we cast it as a sequence generation problem. A relation-aware sequence relation generation model is proposed to learn the problem in an end-to-end manner. Experimental results show that our approach not only achieves better relation detection performance, but also improves the results of the state-of-the-art KBQA system. + +# Acknowledgements + +We would like to thank anonymous reviewers for their valuable comments and helpful suggestions. This work was funded by the National Natural Science Foundation of China (61772132), and the EPSRC (grant no. EP/T017112/1, EP/V048597/1). YH is supported by a Turing AI Fellowship funded by the UK Research and Innovation (UKRI) (grant no. EP/V020579/1). + +# References + +Samy Bengio, Oriol Vinyals, Navdeep Jaitly, and Noam Shazeer. 2015. Scheduled sampling for sequence prediction with recurrent neural networks. In Proceedings of the 28th International Conference on Neural Information Processing Systems - Volume 1, page 1171-1179, Cambridge, MA, USA. +Jonathan Berant, Andrew Chou, Roy Frostig, and Percy Liang. 2013. Semantic parsing on Freebase from question-answer pairs. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 1533-1544, Seattle, Washington, USA. +Antoine Bordes, Nicolas Usunier, Sumit Chopra, and Jason Weston. 2015. Large-scale simple question answering with memory networks. ArXiv, abs/1506.02075. +Zi-Yuan Chen, Chih-Hung Chang, Yi-Pei Chen, Jijnasa Nayak, and Lun-Wei Ku. 2019. UHop: An unrestricted-hop relation extraction framework for knowledge-based question answering. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 345–356, Minneapolis, Minnesota. +Rajarshi Das, Shehzaad Dhuliawala, Manzil Zaheer, Luke Vilnis, Ishan Durugkar, Akshay Krishnamurthy, Alex Smola, and Andrew McCallum. 2017. Go for a walk and arrive at the answer: Reasoning over paths in knowledge bases using reinforcement learning. arXiv preprint arXiv:1711.05851. +Yanchao Hao, Hao Liu, Shizhu He, Kang Liu, and Jun Zhao. 2018. Pattern-revising enhanced simple question answering over knowledge bases. In Proceedings of the 27th International Conference on Computational Linguistics, COLING 2018, pages 3272-3282, Santa Fe, New Mexico, USA. +Xiaodong He and David Golub. 2016. Character-level question answering with attention. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 1598-1607, Austin, Texas. +Kelvin Jiang, Dekun Wu, and Hui Jiang. 2019. FreebaseQA: A new factoid QA data set matchingTrivia-style question-answer pairs with Freebase. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 318-323, Minneapolis, Minnesota. +Yoon Kim. 2014. Convolutional neural networks for sentence classification. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1746-1751, Doha, Qatar. Association for Computational Linguistics. + +Diederik P Kingma and Jimmy Ba. 2014. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980. +Denis Lukovnikov, Asja Fischer, Jens Lehmann, and Soren Auer. 2017. Neural network-based question answering over knowledge graphs on word and character level. In Proceedings of the 26th International Conference on World Wide Web, WWW 2017, pages 1211-1220, Republic and Canton of Geneva, Switzerland. +Sam Wiseman and Alexander M. Rush. 2016 Sequence-to-sequence learning as beam-search optimization. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 1296-1306, Austin, Texas. +Wenhan Xiong, Thien Hoang, and William Yang Wang 2017. DeepPath: A reinforcement learning method for knowledge graph reasoning. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 564-573, Copenhagen, Denmark. +Mingbin Xu, Hui Jiang, and Seditawut Watcharawittayakul. 2017. A local detection approach for named entity recognition and mention detection. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1237-1247, Vancouver, Canada. Association for Computational Linguistics. +Pengcheng Yang, Xu Sun, Wei Li, Shuming Ma, Wei Wu, and Houfeng Wang. 2018. SGM: Sequence generation model for multi-label classification. In Proceedings of the 27th International Conference on Computational Linguistics, pages 3915-3926, Santa Fe, New Mexico, USA. +Zichao Yang, Diyi Yang, Chris Dyer, Xiaodong He, Alex Smola, and Eduard Hovy. 2016. Hierarchical attention networks for document classification. In Proceedings of the 2016 conference of the North American chapter of the association for computational linguistics: human language technologies, pages 1480-1489. +Wen-tau Yih, Ming-Wei Chang, Xiaodong He, and Jianfeng Gao. 2015. Semantic parsing via staged query graph generation: Question answering with knowledge base. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing, ACL 2015, pages 1321-1331, Beijing, China. +Wenpeng Yin, Mo Yu, Bing Xiang, Bowen Zhou, and Hinrich Schütze. 2016. Simple question answering by attentive convolutional neural network. In Proceedings of the 26th International Conference on Computational Linguistics: Technical Papers, COLING 2016, pages 1746-1756, Osaka, Japan. + +Mo Yu, Wenpeng Yin, Kazi Saidul Hasan, Cicero dos Santos, Bing Xiang, and Bowen Zhou. 2017. Improved neural relation detection for knowledge base question answering. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics, ACL 2017, pages 571-581, Vancouver, Canada. +Yang Yu, Kazi Saidul Hasan, Mo Yu, Wei Zhang, and Zhiguo Wang. 2018. Knowledge base relation detection via multi-view matching. CoRR, abs/1803.00612. +Linhai Zhang, Chao Lin, Deyu Zhou, Yulan He, and Meng Zhang. 2021. A bayesian end-to-end model with estimated uncertainties for simple question answering over knowledge bases. Computer Speech & Language, 66:101167. +M. Zhang and Z. Zhou. 2014. A review on multi-label learning algorithms. IEEE Transactions on Knowledge and Data Engineering, 26(8):1819-1837. +Min-Ling Zhang and Zhi-Hua Zhou. 2007. Ml-knn: A lazy learning approach to multi-label learning. Pattern recognition, 40(7):2038-2048. \ No newline at end of file diff --git a/amultilabelmultihoprelationdetectionmodelbasedonrelationawaresequencegeneration/images.zip b/amultilabelmultihoprelationdetectionmodelbasedonrelationawaresequencegeneration/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..a3e49efccad5d41868e682f6d76e7568a10acfeb --- /dev/null +++ b/amultilabelmultihoprelationdetectionmodelbasedonrelationawaresequencegeneration/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:486172aa967bed5e18adcd08103d78eada0720fef11b053ea9b7321fcef8c295 +size 256726 diff --git a/amultilabelmultihoprelationdetectionmodelbasedonrelationawaresequencegeneration/layout.json b/amultilabelmultihoprelationdetectionmodelbasedonrelationawaresequencegeneration/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..e8e552829e039a696dd2a36c91238904b8a78969 --- /dev/null +++ b/amultilabelmultihoprelationdetectionmodelbasedonrelationawaresequencegeneration/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8ebe1aaff570f47d1440fc3cd2498094dc065ee245782a603e131009d234e13 +size 236418 diff --git a/analignmentagnosticmodelforchinesetexterrorcorrection/3b42faa3-51e0-408e-9cc2-926334bb0c18_content_list.json b/analignmentagnosticmodelforchinesetexterrorcorrection/3b42faa3-51e0-408e-9cc2-926334bb0c18_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..341098c00e8475616ec8d6a9795be0adebbdea27 --- /dev/null +++ b/analignmentagnosticmodelforchinesetexterrorcorrection/3b42faa3-51e0-408e-9cc2-926334bb0c18_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a662e9c64b12abf31f1b1e1af58919ff1a6dc908c8adc079fa8e1d2ee8537a17 +size 38532 diff --git a/analignmentagnosticmodelforchinesetexterrorcorrection/3b42faa3-51e0-408e-9cc2-926334bb0c18_model.json b/analignmentagnosticmodelforchinesetexterrorcorrection/3b42faa3-51e0-408e-9cc2-926334bb0c18_model.json new file mode 100644 index 0000000000000000000000000000000000000000..664a8ac733b38ca0da350e21cd4d3ae1cbea470b --- /dev/null +++ b/analignmentagnosticmodelforchinesetexterrorcorrection/3b42faa3-51e0-408e-9cc2-926334bb0c18_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:94bfb31d550a99dcdee53bfadc0377c0d02bf6116c22a2d65966853667ac57d2 +size 47638 diff --git a/analignmentagnosticmodelforchinesetexterrorcorrection/3b42faa3-51e0-408e-9cc2-926334bb0c18_origin.pdf b/analignmentagnosticmodelforchinesetexterrorcorrection/3b42faa3-51e0-408e-9cc2-926334bb0c18_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..bd2924f4a792b86bb879c980d9e172df2d6d05c0 --- /dev/null +++ b/analignmentagnosticmodelforchinesetexterrorcorrection/3b42faa3-51e0-408e-9cc2-926334bb0c18_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c824244b8beb2c6ede5ca0f94822083055acfa36996a33786c9376e013317afc +size 312132 diff --git a/analignmentagnosticmodelforchinesetexterrorcorrection/full.md b/analignmentagnosticmodelforchinesetexterrorcorrection/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0f9ae44395579a4f7c67c3fef56e6ef939df299e --- /dev/null +++ b/analignmentagnosticmodelforchinesetexterrorcorrection/full.md @@ -0,0 +1,157 @@ +# An Alignment-Agnostic Model for Chinese Text Error Correction + +Liying Zheng + +liying.zheng@outlook.com + +Yue Deng + +dengyue606@gmail.com + +Weishun Song + +Liang Xu + +Jing Xiao + +songweishun474@gmail.com xlpaul@126.com xiaojing661@pingan.com.cn + +# Abstract + +This paper investigates how to correct Chinese text errors with types of mistaken, missing and redundant characters, which are common for Chinese native speakers. Most existing models based on detect-correct framework can correct mistaken characters, but cannot handle missing or redundant characters due to inconsistency between model inputs and outputs. Although Seq2Seq-based or sequence tagging methods provide solutions to the three error types and achieved relatively good results in English context, they do not perform well in Chinese context according to our experiments. In our work, we propose a novel alignment-agnostic detect-correct framework that can handle both text aligned and non-aligned situations and can serve as a cold start model when no annotation data are provided. Experimental results on three datasets demonstrate that our method is effective and achieves a better performance than most recent published models. + +# 1 Introduction + +Chinese text error correction plays an important role in many NLP related scenarios (Martins and Silva, 2004; Afli et al., 2016; Wang et al., 2018; Burstein and Chodorow, 1999). For native Chinese speakers, common errors include mistaken characters, missing characters, and redundant characters. Mistaken characters refer to wrong characters needed to be replaced. Missing characters mean a lack of characters needed to be inserted into the identified position. Redundant characters mean useless or repeated characters needed to be deleted. Corrections for mistaken characters will not change the sentence length while corrections for the other two types will do. If texts only contain mistaken errors, we call it a text-aligned situation; if there exist missing or redundant errors, we call it a text non-aligned situation. + +For text-aligned situation, many approaches apply the detect-correct framework, which is to detect the positions of wrong characters first and then correct them (Hong et al., 2019; Zhang et al., 2020; Cheng et al., 2020). Despite of competitive performance of such methods, they cannot deal with text non-aligned situation with missing and redundant errors. For text non-aligned situations, the reversed order error or complex structural change with multiple errors are not in our scope, first because we target to cover common mistakes made by Chinese native speakers, which are different from foreign Chinese learners in Chinese error correction(GEC) (Wang et al., 2020; Qiu and Qu, 2019) task, second because the mentioned complex errors are beyond our model settings. The two mainstream model schemes for text non-aligned situation are Seq2Seq-based and sequence tagging-based. The former is inspired by machine translation, which sets wrong sentences as input and correct sentences as output (Zhao et al., 2019; Kaneko et al., 2020; Chollampatt et al., 2019; Zhao and Wang, 2020; Lichtarge et al., 2019; Ge et al., 2018; Junczys-Dowmunt et al., 2018). Such approaches require a large number of training data and may generate uncontrollable results (Kiyono et al., 2019; Koehn and Knowles, 2017). The latter takes wrong sentences as input and modification operations of each token as output (Awasthi et al., 2019; Malmi et al., 2019; Omelianchuk et al., 2020). However, as Chinese language has more than 20,000 characters that can generate many combinations of token operations, it is difficult for sequence tagging models to cover all combinations and generate results with high coverage rates. + +To address the above issues, we propose an alignment-agnostic detect-correct model, which can not only handle text non-aligned errors compared to the current detect-correct methods, but also can relieve the problem of huge value search space leading to uncontrollable or low covered + +results of Seq2Seq or Sequence tagging based methods. We conduct experiments to compare our alignment-agnostic model with other models on three datasets: CGED 2020, SIGHAN 2015, SIGHAN-synthesize. Experimental results show that our model performs better than other models. + +The contributions of our work include (1) proposal of a novel detect-correct architecture for Chinese text error correction, (2) empirical verification of the effectiveness of the alignment-agnostic model, (3) easy reproduction and fast adaptation to practical scenario with limited annotation data. + +# 2 Our Approach + +# 2.1 Problem Description + +Chinese text error correction can be formalized as follows. Given a sequence of $n$ characters $X = (x_{1}, x_{2}, x_{3}, \ldots, x_{n})$ , the goal is to transform it into an $m$ -character sequence $Y = (y_{1}, y_{2}, y_{3}, \ldots, y_{m})$ , where $n$ and $m$ can be equal or not. The task can be viewed as a sequence transformation problem with a mapping function $f: X \to Y$ + +![](images/e295caa187dbe9b67c26fd97cbc4fb665aba43921d352b4bb4f7b4906d7b4289.jpg) +Figure 1: Architecture of the alignment-agnostic model + +# 2.2 Model + +As illustrated in Figure 1, the basic structure of our model includes a detection network evolved from ELECTRA discriminator (Clark et al., 2020) and a correction network based on BERT MLM (Devlin et al., 2019). The two networks are connected through a modification logic unit and are trained separately. The detection network locates the errors and identifies error types. The modification logic unit handles where and how to correct. Finally the correction network focuses on detailed correction. + +The detection network is composed of an ELECTRA discriminator and a token-level error type classifier. The architecture of ELECTRA discriminator has been described in Clark et al. (2020). Here we modify the original classifier, and define the new token-level classifier with four categories, namely label keep, label mistaken, label missing, label redundant. label keeps means the character is correct and should not change. label mistaken indicates the character is mistaken and needs to be replaced. label missing denotes we should insert characters before the current character. label redundant means the character is useless and needs to be deleted. We get the label probability of each token with the 4-class token-level classifier: + +$$ +P _ {i, l a b e l} \left(z _ {i} = k \mid X\right) = \operatorname {s o f t m a x} \left(w ^ {T} h ^ {D} (X)\right) \tag {1} +$$ + +Where $P_{i, \text{label}}(z_i = k | X)$ denotes the conditional probability of character $x_i$ being tagged with the label $k$ , $h^D(X)$ is the last hidden state of ELEC-TRA discriminator and $k$ is in label sets [labelkeep, labelmistaken, labelmissing, labelredundant]. The loss function of the detection network is: + +$$ +L o s s _ {d e t e c t} = - \sum_ {i = 1} ^ {n} \log p _ {i, l a b e l} \tag {2} +$$ + +The modification logic unit, denoted by $M(X,Z)$ , rewrites the input sequence $X$ according to detection network's output $Z$ : + +$$ +i f z _ {i} = \left\{ \begin{array}{l} l a b e l _ {\text {k e e p}}, x _ {i} ^ {\prime} = x _ {i} \\ l a b e l _ {\text {m i s t a k e n}}, x _ {i} ^ {\prime} = [ M A S K ] \\ l a b e l _ {\text {m i s s i n g}}, x _ {i} ^ {\prime} = [ M A S K ] x _ {i} \\ l a b e l _ {\text {r e d u n d a n t}}, x _ {i} ^ {\prime} = ^ {\prime \prime} \end{array} \right. \tag {3} +$$ + +Based on the above formula, we get a new sequence $X' = (x_1', x_2', x_3', \ldots, x_n')$ . For each token with empty characters'', we delete it directly from the sequence $X'$ , For each token with '[MASK] $x_i'$ , we reformulate it as two characters and obtain the final modified sequence $Y' = (y_1', y_2', y_3', \ldots, y_m')$ , whose length might be different from $X'$ . + +The correction network is BERT. We do the prediction for positions with the [MASK] symbol on the sequence $Y'$ . + +
Test SetMethodDetectionCorrection
Prec.Rec.F1.Prec.Rec.F1.
SIGHAN 2015Hybrid (Wang et al., 2018)56.669.462.3--57.1
FASpell (Hong et al., 2019)67.66063.566.659.162.6
Confusionset (Wang et al., 2018)66.873.169.871.559.564.9
Soft-Masked BERT(2020)73.773.273.566.766.266.4
our model(with a smaller training set)79.164.071.372.260.668.2
SpellGCN (Cheng et al., 2020)74.880.777.772.177.775.9
our model(with a larger training set)87.568.676.987.065.274.6
+ +Table 1: Performances of Different Methods on SIGHAN 2015. We trained our model on two datasets respectively. + +# 3 Experiments + +# 3.1 Datasets and Metrics + +Chinese text error correction tasks mainly have two public datasets: the benchmark of SIGHAN 2015 (Tseng et al., 2015) which only contains text-aligned data and the competition of CGED 2020 (Rao et al., 2020) which contains text nonaligned data. In order to better verify our models' effectiveness on text non-aligned scenario, we synthesized some non-aligned data based on SIGHAN 2015 dataset. Next, we will introduce how to utilize the three datasets. + +For SIGHAN 2015 dataset, in order to keep accordance with other models in comparison, we incorporated SIGHAN 2013 and 2014 datasets in the training phase, as well as the SIGHAN 2013 confusion set. The test set contains 1100 passages and the train set contains 8738 passages. To ensure comparability, we also trained another model on a considerably larger train set to be consistent with SpellGCN' (Cheng et al., 2020), which has 281379 passages in train set. We used the evaluation tool provided by SIGHAN, with metrics of precision (Prec.), recall(Rec.) and $F_{1}$ , all are based on sentence level. + +CGED 2020 dataset is comprised of foreign Chinese learners' writing, and contains an additional error type besides the three types mentioned above, which is the reversed order. As this type happens less frequently in native Chinese writing scenario, and is also beyond the scope of our model setting, we remove 575 relevant samples from a total sample of 2586, and get 846 training samples and 1165 testing samples. In consequence, we redo experiments with published models instead of comparing directly with the published benchmarks of other systems due to the inconsistency of test set. + +To better verify our model's effectiveness on + +text non-aligned scenario, we synthesized some non-aligned data based on SIGHAN 2015 dataset (SIGHAN-synthesized). For mistaken characters error type, we kept the original errors unchanged. For missing characters error type, we randomly selected $50\%$ samples and deleted one character from each of them. For redundant characters error type, we randomly selected $50\%$ samples and inserted characters in each of them through four ways. (1) We inserted repeated characters in $35\%$ of the selected samples. (2) We inserted confusing characters in $30\%$ of the selected samples. (3) We inserted characters from high-frequency words in $30\%$ of the selected samples. (4) We also inserted random characters in $5\%$ of the selected samples. + +For CGED 2020 dataset and SIGHAN-synthesized dataset, we adopted the $M^2$ score (Dahlmeier and Ng, 2012) and ER-RANT (Bryant et al., 2017) to evaluate models' performance, which are two commonly used evaluation tools for text non-aligned situations. + +# 3.2 Experiment Settings + +The pre-trained ELECTRA discriminator model and BERT model adopted in our experiments are all from https://github.com/huggingface/transformers. We use the large-size ELECTRA and the base-size BERT. We train detection network and correction network on the three datasets respectively by Adam optimizer with default hyperparameters. All experiments are conducted on 2 GPUs (Nvidia Tesla P100). + +For SIGHAN 2015, since it only contains one error type, we kept the default binary classifier of ELECTRA discriminator during finetuning. We applied two methods to retrain BERT. One is an unsupervised method by continue pretraining BERT with its original MLM objective. The other is a supervised method by masking mistaken characters + +
Test SetMethodM2(Correction)ERRANT(Correction)
Prec.Rec.F0.5.Prec.Rec.F0.5.
CGED 2020Copy-augmented(2019)4.620.82.363.510.561.7
Lasertagger(2019)14.993.489.0212.952.617.22
PIE(2019)22.31017.917.16.613
our model29.7122.0327.7724.817.5622.91
SIGHAN-synthesizedCopy-augmented(2019)38.448.0321.8738.317.821.5
Lasertagger(2019)51.2943.2149.4450.1439.9947.72
PIE(2019)54.147.652.65242.649.8
our model59.362.259.856.957.857
+ +Table 2: The ${M}^{2}$ score and ERRANT score of Different Methods on CGED 2020 and SIGHAN-synthesized. + +
MethodSIGHAN 2015CGED 2020SIGHAN-synthesized
F1F0.5F0.5
ELECTRA+BERT38.7--
Finetune ELECTRA+BERT66.222.9154.7
Finetune ELECTRA+Finetune BERT68.222.5454.4
Finetune ELECTRA+Pretrain BERT4222.657
+ +Table 3: Ablation study of alignment-agnostic model on three datasets. + +and predicting them. + +For CGED 2020 and SIGHAN-synthesized datasets, we added a 4-class classifier to recognize error types on ELECTRA discriminator's last hidden layer and finetune it. We applied the same methods as in SIGHAN 2015 to retrain BERT. + +# 3.3 Results + +Table 1 shows the results on SIGHAN 2015 dataset. The first 5 lines implies that our method outperforms the method Soft-Masked BERT (Zhang et al., 2020) by $1.8\%$ on $F_{1}$ score in correction phrase. With a larger train set, our model achieved higher $F_{1}$ score in both detection and correction phases. Compared with the previous SOTA method SpellGCN (Cheng et al., 2020), our model showed higher precision and comparable $F_{1}$ score. + +Table 2 shows the results in comparison on CGED 2020 dataset and SIGHAN-synthesized dataset. Our model performs the best on correction level, exceeding the second best model by $9.87\%$ on CGED 2020 and $7.2\%$ on SIGHAN-synthesized dataset with $F_{0.5}M^{2}$ score. Since Copy-augmented (Zhao et al., 2019), as a Seq2Seq model, requires a large size of training data to get an acceptable result, it underperforms Lasertagger (Malmi et al., 2019) and PIE (Awasthi et al., 2019) models on both two datasets with a small training sample size. As analyzed before, sequence tagging models like Lasertagger and PIE do not + +work well on Chinese language due to huge value search space. + +# 3.4 Ablation Study + +We carried out ablation study of our model on the three datasets. Table 3 shows the results on correction level. For SIGHAN 2015, finetuning ELECTRA can bing in a great improvement of $27.5\%$ on $F_{1}$ score, while finetuning BERT only generates a relatively small rise of $2\%$ on $F_{1}$ score and continue pretraining BERT leads to a decrease of $24.2\%$ on $F_{1}$ score. A possible reason is that finetuning can incorporate confusion sets knowledge about similar characters easy to be mistaken, while unsupervised pretraining may destroy the original learned words distribution when training data largely differs from the original ones. Besides, our model achieves $38.7\%$ on $F_{1}$ score with no training data and thus can work as a good baseline in cold start conditions. For CGED 2020 and SIGHAN-synthesized datasets, the two ways of retraining BERT didn't improve much. Compared with the results of other SOTA models, the modification and finetuning of ELECTRA is the most effective part. + +# 4 Conclusion + +We proposed a new detect-correct model for Chinese text error correction. It can handle both text-aligned and non-aligned situations, and can serve + +as a good baseline even in cold start situations. Experimental results on three datasets show that our model performs better than existing methods. Furthermore, it can be easily reproduced and achieve good results even with a small training data size, which is key to rapid application in the industry. + +# References + +Haithem Afli, Zhengwei Qiu, Andy Way, and Páraic Sheridan. 2016. Using smt forOCR error correction of historical texts. In Proceedings of the Tenth International Conference on Language Resources and Evaluation (LREC'16), pages 962-966. +Abhijeet Awasthi, Sunita Sarawagi, Rasna Goyal, Sabyasachi Ghosh, and Vihari Piratla. 2019. Parallel iterative edit models for local sequence transduction. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 4260-4270, Hong Kong, China. Association for Computational Linguistics. +Christopher Bryant, Mariano Felice, and Edward Briscoe. 2017. Automatic annotation and evaluation of error types for grammatical error correction. Association for Computational Linguistics. +Jill Burstein and Martin Chodorow. 1999. Automated essay scoring for nonnative english speakers. In Computer mediated language assessment and evaluation in natural language processing. +Xingyi Cheng, Weidi Xu, Kunlong Chen, Shaohua Jiang, Feng Wang, Taifeng Wang, Wei Chu, and Yuan Qi. 2020. Spellgcn: Incorporating phonological and visual similarities into language models for chinese spelling check. arXiv preprint arXiv:2004.14166. +Shamil Chollampatt, Weiqi Wang, and Hwee Tou Ng. 2019. Cross-sentence grammatical error correction. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 435-445, Florence, Italy. Association for Computational Linguistics. +Kevin Clark, Minh-Thang Luong, Quoc V Le, and Christopher D Manning. 2020. Electra: Pre-training text encoders as discriminators rather than generators. arXiv preprint arXiv:2003.10555. +Daniel Dahlmeier and Hwee Tou Ng. 2012. Better evaluation for grammatical error correction. In Proceedings of the 2012 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 568-572. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 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, Volume 1 (Long and Short Papers), pages 4171-4186, Minneapolis, Minnesota. Association for Computational Linguistics. +Tao Ge, Furu Wei, and Ming Zhou. 2018. Reaching human-level performance in automatic grammatical error correction: An empirical study. arXiv preprint arXiv:1807.01270. +Yuzhong Hong, Xianguo Yu, Neng He, Nan Liu, and Junhui Liu. 2019. FASPell: A fast, adaptable, simple, powerful Chinese spell checker based on DAE-decoder paradigm. In Proceedings of the 5th Workshop on Noisy User-generated Text (W-NUT 2019), pages 160-169, Hong Kong, China. Association for Computational Linguistics. +Marcin Junczys-Dowmunt, Roman Grundkiewicz, Shubha Guha, and Kenneth Heafield. 2018. Approaching neural grammatical error correction as a low-resource machine translation task. arXiv preprint arXiv:1804.05940. +Masahiro Kaneko, Masato Mita, Shun Kiyono, Jun Suzuki, and Kentaro Inui. 2020. Encoder-decoder models can benefit from pre-trained masked language models in grammatical error correction. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4248-4254, Online. Association for Computational Linguistics. +Shun Kiyono, Jun Suzuki, Masato Mita, Tomoya Mizumoto, and Kentaro Inui. 2019. An empirical study of incorporating pseudo data into grammatical error correction. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 1236-1242, Hong Kong, China. Association for Computational Linguistics. +Philipp Koehn and Rebecca Knowles. 2017. Six challenges for neural machine translation. arXiv preprint arXiv:1706.03872. +Jared Lichtarge, Chris Alberti, Shankar Kumar, Noam Shazeer, Niki Parmar, and Simon Tong. 2019. Corpora generation for grammatical error correction. pages 3291-3301. +Eric Malmi, Sebastian Krause, Sascha Rothe, Daniil Mirylenka, and Aliaksei Severyn. 2019. Encode, tag, realize: High-precision text editing. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 5054–5065, Hong Kong, China. Association for Computational Linguistics. + +Bruno Martins and Mário J Silva. 2004. Spelling correction for search engine queries. In International Conference on Natural Language Processing (in Spain), pages 372-383. Springer. +Kostiantyn Omelianchuk, Vitaliy Atrasevych, Artem Chernodub, and Oleksandr Skurzhanskyi. 2020. GECToR - grammatical error correction: Tag, not rewrite. In Proceedings of the Fifteenth Workshop on Innovative Use of NLP for Building Educational Applications, pages 163-170. Association for Computational Linguistics. +Zhaoquan Qiu and Youli Qu. 2019. A two-stage model for Chinese grammatical error correction. IEEE Access, 7:146772-146777. +Gaoqi Rao, Erhong Yang, and Baolin Zhang. 2020. Overview of nlptea-2020 shared task for chinese grammatical error diagnosis. In Proceedings of the 6th Workshop on Natural Language Processing Techniques for Educational Applications, pages 25-35. +Yuen-Hsien Tseng, Lung-Hao Lee, Li-Ping Chang, and Hsin-Hsi Chen. 2015. Introduction to sighan 2015 bake-off for chinese spelling check. In Proceedings of the Eighth SIGHAN Workshop on Chinese Language Processing, pages 32-37. +Dingmin Wang, Yan Song, Jing Li, Jialong Han, and Haisong Zhang. 2018. A hybrid approach to automatic corpus generation for Chinese spelling check. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2517-2527, Brussels, Belgium. Association for Computational Linguistics. +Hongfei Wang, Michiki Kurosawa, Satoru Katsumata, and Mamoru Komachi. 2020. Chinese grammatical correction using bert-based pre-trained model. +Shaohua Zhang, Haoran Huang, Jicong Liu, and Hang Li. 2020. Spelling error correction with soft-masked BERT. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 882-890, Online. Association for Computational Linguistics. +Wei Zhao, Liang Wang, Kewei Shen, Ruoyu Jia, and Jingming Liu. 2019. Improving grammatical error correction via pre-training a copy-augmented architecture with unlabeled data. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 156-165, Minneapolis, Minnesota. Association for Computational Linguistics. +Zewei Zhao and Houfeng Wang. 2020. Maskgec: Improving neural grammatical error correction via dynamic masking. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 1226-1233. \ No newline at end of file diff --git a/analignmentagnosticmodelforchinesetexterrorcorrection/images.zip b/analignmentagnosticmodelforchinesetexterrorcorrection/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..6ddd615217e6c3634cdcb0771c6ed725076baeed --- /dev/null +++ b/analignmentagnosticmodelforchinesetexterrorcorrection/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f8e55f8a21bd04b7e10af83d5a96bf439448319c8451904de00f4b363208b19 +size 252018 diff --git a/analignmentagnosticmodelforchinesetexterrorcorrection/layout.json b/analignmentagnosticmodelforchinesetexterrorcorrection/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..52e6ae531656ca23ff723de7c6cbf6234d4419b6 --- /dev/null +++ b/analignmentagnosticmodelforchinesetexterrorcorrection/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c903309f8fb1ab139254da8c3b9cd0fc046cbca5bb5e5a2d1fd0a04ce2e2aedf +size 187042 diff --git a/analysisoflanguagechangeincollaborativeinstructionfollowing/cc00049a-dd60-474d-98f9-a1592e63beef_content_list.json b/analysisoflanguagechangeincollaborativeinstructionfollowing/cc00049a-dd60-474d-98f9-a1592e63beef_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..40addafad0725574206d8730f0dedfe681cd36be --- /dev/null +++ b/analysisoflanguagechangeincollaborativeinstructionfollowing/cc00049a-dd60-474d-98f9-a1592e63beef_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bdf819a3e9d83fdc8a7d0181acf54626497f2a921697937fa7197bc6a4acbf24 +size 60299 diff --git a/analysisoflanguagechangeincollaborativeinstructionfollowing/cc00049a-dd60-474d-98f9-a1592e63beef_model.json b/analysisoflanguagechangeincollaborativeinstructionfollowing/cc00049a-dd60-474d-98f9-a1592e63beef_model.json new file mode 100644 index 0000000000000000000000000000000000000000..bf5fb7078afdb0f49f584c5fb2a01e3815375bcb --- /dev/null +++ b/analysisoflanguagechangeincollaborativeinstructionfollowing/cc00049a-dd60-474d-98f9-a1592e63beef_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3fbde19c8c320ea1c9272071530b776aa7cfa900f92824bb74fd174100be0390 +size 71768 diff --git a/analysisoflanguagechangeincollaborativeinstructionfollowing/cc00049a-dd60-474d-98f9-a1592e63beef_origin.pdf b/analysisoflanguagechangeincollaborativeinstructionfollowing/cc00049a-dd60-474d-98f9-a1592e63beef_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5f2f136d77839af920201a5def6e4b67331d90fa --- /dev/null +++ b/analysisoflanguagechangeincollaborativeinstructionfollowing/cc00049a-dd60-474d-98f9-a1592e63beef_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a63a79cd0de94f28bce9fd0d95ebb9b868449db54aa23433903f924891c9bfac +size 487172 diff --git a/analysisoflanguagechangeincollaborativeinstructionfollowing/full.md b/analysisoflanguagechangeincollaborativeinstructionfollowing/full.md new file mode 100644 index 0000000000000000000000000000000000000000..fdf2921520e878bfb2becf773a1ad2d21e469b02 --- /dev/null +++ b/analysisoflanguagechangeincollaborativeinstructionfollowing/full.md @@ -0,0 +1,238 @@ +# Analysis of Language Change in Collaborative Instruction Following + +Anna Effenberger $^{1}$ , Eva Yan $^{2*}$ , Rhia Singh $^{2*}$ , Alane Suhr $^{1}$ , and Yoav Artzi $^{1}$ + +1Cornell University + +$^{2}$ City University of New York + +ae347@cornell.edu eyan0749@gmail.com + +rhia.singh@macaulay.cuny.edu {suhr, yoav}@cs.cornell.edu + +# Abstract + +We analyze language change over time in a collaborative, goal-oriented instructional task, where utility-maximizing participants form conventions and increase their expertise. Prior work studied such scenarios mostly in the context of reference games, and consistently found that language complexity is reduced along multiple dimensions, such as utterance length, as conventions are formed. In contrast, we find that, given the ability to increase instruction utility, instructors increase language complexity along these previously studied dimensions to better collaborate with increasingly skilled instruction followers. + +# 1 Introduction + +Community language change in situated collaborative task-oriented scenarios has been studied with focus on reference games (Krauss and Weinheimer, 1964; Clark and Wilkes-Gibbs, 1986; Hawkins et al., 2017, 2020a,b), where two participants coordinate using language to select to a single item from a set of available items. These studies found that utility-maximizing participants trade surfaceform linguistic complexity with established norms, as the familiarity and expertise of the interaction partners increase. In practice, this emerges as a reduction in utterance length and vocabulary size. + +We study the generality of these observations by analyzing language change in a collaborative instructional task, where instructors can specify multiple goals within a single instruction to increase their utility. This option, not present in reference games, creates competing incentives: increasing utility by issuing more goals in a single instruction versus decreasing language effort by utilizing established norms (e.g., by shortening instructions). + +We use the CerealBAR game environment and its accompanying dataset (Figure 1; Suhr et al., + +Decile 1: get the card in front + +Decile 5: Collect the green square card in front of you. + +Decile 10: turn around on the trail, go straight and get 2 green circles, continue straight on the trail to the right side of the glacier and get 1 black triangle. + +![](images/d33db45a0b495b07bb90146af848f7e08e88a547d1b455f3b9582d29401b32b4.jpg) +Figure 1: Leader instructions in CerealBar from games played at the beginning (Decile 1), middle (Decile 5), and end (Decile 10) of the community life. The differences between the instructions illustrate the linguistic change observed in the data. The instruction from Decile 10 is paired with a snapshot from the game as the follower begins to execute it. The leader (left) and follower (right) are highlighted in the center-left of the leader's view of the game, and the top right shows the follower's first-person view of the environment. + +2019). CerealBAR is a two-player, collaborative language game where players work together to collect sets of matching cards. A leader plans which cards to include in the next set, and writes instructions to a follower describing tasks to accomplish. In contrast to reference games (Krauss and Weinheimer, 1964), the language in CerealBAR is primarily instructional rather than referential, and the game allows players to complete a dynamic number of tasks per instruction and game. + +Similar to previous studies, we observe language change over time along the same dimensions. But, unlike in reference games, we observe utterance-level linguistic complexity increases. Our study illustrates that the formation of common ground among interaction participants does not necessarily reduce language complexity, and may even come with an increase in complexity. Understanding how humans use language to collaborate in settings with flexible utility is key to building natural + +
MeanMedianMax
Interaction Score (# Card Sets)8.810.019
# Instructions / Interaction22.026.041
# Tokens / Instruction14.413.055
Vocabulary Size3,499
Total # Instructions17,524
+ +Table 1: Statistics of analyzed data. + +language systems that effectively collaborate with users over time. Our analysis code can be found at github.com/lil-lab/CB-analysis. + +# 2 Scenario and Data Overview + +We use the CerealBAR game and accompanying dataset (Suhr et al., 2019) in our analysis. CerealBAR is a collaborative, two-player game, where a leader and a follower collect matching sets of cards by moving in an environment. The game is turn-based, and each player has a limited number of steps per turn. The leader both collects cards and instructs the follower using natural language. The follower executes leader instructions. The players' abilities differ: the leader observes the complete environment and plans sets to collect; the follower only observes what is ahead, but has more steps per turn. For each set made, players receive one point and additional turns, allowing them to complete more sets. Success requires the players to collaborate via natural language: the leader must write informative instructions to the follower, and the follower must efficiently follow these instructions. Figure 1 shows a snapshot of the game. + +The CerealBAR dataset contains 1,202 human-human game interactions collected over the course of four months. Workers were randomly assigned as leader or follower for each interaction. The collection process created a Wizard-of-Oz setup: the system user, as the leader, provides instructions and acts in the world, and the human follower is a wizard, executing instructions to emulate the desired system behavior. We only use interactions from the training split for our analysis. We prune interactions by inexperienced workers, as classified when the data was collected, to focus on the impact of experience. In total, we consider 795 interactions. Table 1 provides basic statistics of the data we use. Suhr et al. (2019) used these data to train models, while we study how the language changes. + +![](images/9e2074454703a7b3aa0aa02d32a76b457822e8380d4a525564b4f914585a1c4d.jpg) +Figure 2: Community size (left) and mean game score (right) over deciles of community lifetime. On the left, the bars show total active players and the curve shows only the number of new players that joined per decile. + +![](images/16a5a8fa8e656270a9a2d5f68f30e9f27b0e02f0047e88365f91e1a4dd38c4f9.jpg) +Figure 3: Vocabulary and utterance length over deciles. + +# 3 Data Analysis + +To analyze trends over the data collection period, we split the data chronologically into 10 deciles of roughly equal size (79 or 80 interactions). An average of 40 workers participated in each decile (Figure 2, left). The community stabilized after Decile 4, as worker recruitment slowed and the community was split by expertise.3 + +Interaction goals are increasingly achieved over time. Mean score per game increases from 3.8 to 12.3 ( $p < 0.0001$ ) (Figure 2, right).4 Execution efficiency and game expertise also improve.5 Our focus is how leader language - the sole communication conduit - changes to enable these gains. + +We design our analysis to be as similar as possible to existing work on reference games (Hawkins et al., 2020a), which shows that certain language aspects are simplified as community conventions form. CerealBAR allows for a different realization of common ground development than previously studied reference games, and we observe trends that are in contrast to this line of prior work. + +Instruction Length and Vocabulary Mean $^6$ instruction length increases from 11.9 to 14.1 tokens $^7$ ( $p < 0.0001$ ) over time, while vocabulary size in + +creases from 752 to 1,070 unique tokens (Figure 3). This contrasts with reference games, where utterance length and vocabulary size reduce (Clark and Wilkes-Gibbs, 1986; Hawkins et al., 2017). Some of the words added more specifically describe props or movements. However, the overall trend is relatively complex, and identifying clear patterns likely requires a more targeted scenario design. + +Syntactic Complexity We analyze syntactic trends using parts-of-speech (POS) tags and dependency trees. We do not observe a significant difference in usage of closed- and open-class POS tags, as seen in reference games (Hawkins et al., 2017). We observe change in the relative use of verbs, nouns, conjunctions, determiners, and numerals. Notably, the proportion of conjunctions of all tokens increases from 0.060 to 0.067 $(p = 0.0026)$ . The proportion of instructions that contain a conjunction also increases from 0.0495 to 0.0707 $(p = 0.0113)$ . Qualitatively, this accompanies an increased use of ordered sentential conjunctions, often to specify multiple tasks in a single utterance (e.g., once you get that card, turn around and go left and get the 1 green circle card). + +We compute three measures of syntactic complexity using dependency trees (Xu and Reitter, 2016): (a) maximum depth: the longest path from root to a leaf; (b) maximum width: the maximum out-degree of any node; and (c) average branching factor: the average out-degree of non-leaf nodes. We normalize all measures to control for utterance length. Figure 5 shows these statistics over time. Maximum width and branching factor increased from 0.941 to 0.987 ( $p = 0.0483$ ) and from 0.934 to 1.00 ( $p = 0.0051$ ), indicating increased descriptiveness. Maximum depth did not significantly change, indicating embedded clause use proportional to length, as expected when increasingly combining instructions with conjunctions. + +We observe similar trends when measuring these statistics when comparing low- and high-scoring games (Figure 4). Higher scoring games had, on average, instructions with significantly higher width and branching factor. In Decile 1, language in games scoring 1 point and 16 points had an av + +![](images/24f221c7b7b42715356be748d8be9727182ec3863f5ff18e69154c2f11935511.jpg) +Community Lifetime Decile + +![](images/e390d56dba2e3f54cec5b36968996ac7d552eccf7d733ee269575a4cb8e55897.jpg) + +![](images/e370c2f75a6e3c35624190ecab77c4bd344cd28ac397a0dca5405374b84bb229.jpg) +Figure 4: Average dependency branching factor (left) and maximum width (right) over deciles split to games that were above (blue) / below (orange) that decile's median game score. +Figure 5: Average syntactic branching factor, maximum depth, and maximum width across deciles. We also plot the mean utterance length for reference. + +erage normalized branch factor of 0.915 and 1.02. However, games in the lower $50\%$ of scores showed a higher increase in syntactic complexity over time. + +Overall, our syntactic analysis shows an increase in language complexity is required to describe more tasks within a single instruction. We do not observe a gradual drop of redundant modifiers and descriptors (Hawkins et al., 2017). This may be because potential referents do not pose as much ambiguity as the abstract shapes often used in reference games (Clark and Wilkes-Gibbs, 1986). + +Changes in References We see no significant development of niche idioms, in contrast to reference games with abstract shapes (Hawkins et al., 2020a). This is likely due to concreteness and familiarity of the referents in CerealBAR, allowing players to rely on common background knowledge with little ambiguity. We observe change in the relative frequency of references to specific objects over time. We consider seven object classes: building, road, foliage, rock, ice, water, and light.[12] The proportion of instructions containing a reference to ice, light, and buildings increase from 0.006 to 0.022 $(p = 0.0006)$ , from 0.015 to 0.027 $(p = 0.0188)$ , and from 0.056 to 0.073 $(p = 0.0436)$ . The ratios of other references are stable. Leaders likely choose references to balance informativity and effort. Foliage objects are common and require + +![](images/8eb9a6af7b2932151dbe2fa16c6cd6693e7a9d3cbb2e29f5750dc48bb14844fd.jpg) +Figure 6: The number of instructions and tokens required for a card event over deciles. Analysis considers only instructions marked complete by the follower. + +more effort to differentiate, while buildings and ice clearly vary. Lights, though common, were often referred to with other objects to clarify location. + +Language Effort Leaders in CerealBar mainly instruct followers to complete card events to ultimately select valid card sets. We measure language effort with respect to this objective as the number of tokens and instructions per card event (Figure 6). This notion of effort is similar to utterance cost in speaker-listener pragmatic models (Goodman and Frank, 2016). The number of instructions per card event decreases from 0.879 to $0.783(p = 0.0102)$ , indicating leaders effectively pack more tasks into fewer instructions – often multiple card events into one instruction in later deciles (Figure 1). This change correlates with structural changes. For example, conjunctions are useful to pack more tasks into single instructions; the correlation across deciles between the proportion of instructions containing a conjunction and the number of instructions per card event is $r = -0.8243$ . The high negative correlation indicates that the change in conjunction use aligns with the increase in goals (i.e., cards to select) packed per instruction. The number of tokens per card event initially increases from 9.9 to 11.8, then decreases to 10.7. This may be because, initially, followers require more verbose instructions and leaders experiment with the level of description, but as conventions form, this buoyosity is less needed to understand instructions. + +The reduction in the number of tokens per goal later on corresponds to the reduction in utterance length observed in reference games (Hawkins et al., 2017), although it is manifested differently as the overall surface-form is not simplified (i.e., via shorter utterances), unlike in reference games. Given the opportunity to increase utility, leaders choose to take advantage of followers' increased expertise and efficiency by using more complex language to pack more goals into each instruction. + +# 4 Discussion and Related Work + +The CerealBAR scenario is related to reference games (Krauss and Weinheimer, 1964; Clark and Wilkes-Gibbs, 1986; Hawkins et al., 2017; Monroe et al., 2017; He et al., 2017; Udagawa and Aizawa, 2019; Haber et al., 2019), which require two players to agree on a single referent from a set via dialogue. CerealBAR differs in several ways. It allows only unidirectional language communication, and utterances in CerealBAR are instructions specifying desired follower behavior with any number of tasks to complete (i.e., with flexible utility), not a description of a single target referent. + +These differences lead to different language dynamics. In reference games, Hawkins et al. (2020a) observed the development of specialized reference phrases for ambiguous shapes, which allows players to reduce their utterances' length and syntactic complexity. Given that CerealBAR objects are generally unambiguous and familiar, players do not begin with overly verbose references, and have less potential for reduction to more concise references. In contrast, we observe increased instruction length and complexity. Leaders issue an increasing number of tasks to the follower per instruction, utilizing the flexibility afforded by CerealBAR's design. This less constrained scenario better reflects real-life collaborations, where participants complete many tasks to achieve complex goals. + +Our observations show the competing effects of cost-minimization and utility-maximization. The formation of common ground and expectations on partners' behavior enables leaders to use language differently to convey more information-dense instructions to optimize game performance. This is aligned with the expectation of better communication grounding between community members in Clark and Marshall (1981), and with how grounding in Clark and Wilkes-Gibbs (1986) manifests as reduced complexity when utterance utility is fixed. Because there are conflicting forces at work in CerealBar, common ground is realized differently. + +The most related setup to CerealBAR is the Cards task (Djalali et al., 2012; Potts, 2012), where two players collect a single set of cards. It uses four static environments and studies dialogue, not instructions. Djalali et al. (2011) showed Cards players increase the interaction complexity by developing a rich common ground, including terms for the fixed board locations. This is less likely with the randomly generated CerealBAR environ + +ronments. Utterances in Cards also become shorter, potentially due to the predefined number of goals. + +Language complexity also increases in communities where users jointly build a natural-language-like programming language (Wang et al., 2017; Gavran et al., 2018). This scenario differs from ours in lacking explicit collaboration on tasks, focusing on a learned programming language rather than natural language, and training a single model, differently from our many-listeners community. + +The language dynamics observed in Cereal-BAR contrast with those previously observed in reference games, providing evidence that gradual formation of common ground among interaction participants does not necessarily result in reduced complexity of sentences, and may even result in increased complexity. Our conclusions do not void nor mutually exclude previous work, but illustrate the complexity of language change over time in a community. An important direction for future work is controlled studies to observe the effects of scenario design on the interaction between the development of common ground and language change. + +# Acknowledgments + +This research was supported by NSF under grants No. 1750499, 1750499-REU, and DGE-1650441. It also received support from a Google Focused Award, the Break Through Tech summer internship program, and a Facebook PhD Fellowship. We thank Chris Potts and Robert Hawkins for early discussions that initiated this analysis; and Ge Gao and Forrest Davis for their comments. + +# References + +Herbert H. Clark and Catherine R. Marshall. 1981. Definite knowledge and mutual knowledge. Elements of discourse understanding, pages 10-63. +Herbert H. Clark and Deanna Wilkes-Gibbs. 1986. Referring as a collaborative process. Cognition, 22(1):1-39. +Alex Djalali, David Clausen, Sven Lauer, Karl Schultz, and Christopher Potts. 2011. Modeling expert effects and common ground using questions under discussion. In AAAI Fall Symposium: Building Representations of Common Ground with Intelligent Agents. +Alex Djalali, Sven Lauer, and Christopher Potts. 2012. Corpus evidence for preference-driven interpretation. In Logic, Language and Meaning. + +Ivan Gavran, Brendon Boldt, Eva Darulova, and Rupak Majumdar. 2018. Precise but natural specification for robot tasks. +Noah D. Goodman and Michael C. Frank. 2016. Pragmatic language interpretation as probabilistic inference. Trends in Cognitive Sciences, 20:818-829. +Janosch Haber, Tim Baumgartner, Ece Takmaz, Lieke Gelderloos, Elia Bruni, and Raquel Fernandez. 2019. The PhotoBook dataset: Building common ground through visually-grounded dialogue. In Proceedings of the Annual Meeting of the Association for Computational Linguistics. +Robert X. D. Hawkins, Michael C. Frank, and Noah D. Goodman. 2020a. Characterizing the dynamics of learning in repeated reference games. Cognitive science, 44 6:e12845. +Robert X. D. Hawkins, Mike Frank, and Noah D. Goodman. 2017. Convention-formation in iterated reference games. In Cognitive Science. +Robert X. D. Hawkins, Noah D. Goodman, A. Goldberg, and T. Griffiths. 2020b. Generalizing meanings from partners to populations: Hierarchical inference supports convention formation on networks. In Proceedings of the Annual Conference of the Cognitive Science Society. +He He, Anusha Balakrishnan, Mihail Eric, and Percy Liang. 2017. Learning symmetric collaborative dialogue agents with dynamic knowledge graph embeddings. In Proceedings of the Annual Meeting of the Association for Computational Linguistics. +Matthew Honnibal and Ines Montani. 2017. spaCy 2: Natural language understanding with Bloom embeddings, convolutional neural networks and incremental parsing. To appear. +Robert M. Krauss and Sidney Weinheimer. 1964. Changes in reference phrases as a function of frequency of usage in social interaction: a preliminary study. Psychonomic Science, 1:113-114. +Will Monroe, Robert X.D. Hawkins, Noah D. Goodman, and Christopher Potts. 2017. Colors in context: A pragmatic neural model for grounded language understanding. Transactions of the Association for Computational Linguistics, 5:325-338. +Christopher Potts. 2012. Goal-driven answers in the Cards dialogue corpus. In Proceedings of the West Coast Conference on Formal Linguistics, pages 1-20. +Alane Suhr, Claudia Yan, Jack Schluger, Stanley Yu, Hadi Khader, Marwa Mouallem, Iris Zhang, and Yoav Artzi. 2019. Executing instructions in situated collaborative interactions. In Proceedings of the Conference on Empirical Methods in Natural Language Processing. + +Takuma Udagawa and Akiko Aizawa. 2019. A natural language corpus of common grounding under continuous and partially-observable context. In Proceedings of the Conference on Artificial Intelligence. +Sida I. Wang, Samuel Ginn, Percy Liang, and Christopher D. Manning. 2017. Naturalizing a programming language via interactive learning. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 929-938, Vancouver, Canada. Association for Computational Linguistics. +Yang Xu and David Reitter. 2016. Convergence of syntactic complexity in conversation. In Proceedings of the Annual Meeting of the Association for Computational Linguistics. + +# A Reproducibility Checklist Details + +All computation was done on a personal laptop. The CerealBar data was acquired from https: //github.com/lil-lab/cerealbar. + +# B Data Details + +# B.1 Selection of Interactions for Analysis + +The data we use was not collected specifically for this analysis, but during data collection for model development by Suhr et al. (2019). We use 795 of the 960 interactions in the original training split of the data for our analysis, pruning the rest to avoid games that include inexperienced players later in the community's life. This prevents the language of novice workers from affecting our analysis after the more experienced community had stabilized, which would potentially suppress convention formation trends observed in existing literature about reference games (Hawkins et al., 2020a). During the original data collection process, after 367 of the 960 total training interactions were collected, the community was split into junior and senior workers. Junior workers became senior upon gaining adequate experience. A junior worker could request to be moved to the senior pool after they had played at least one game as a follower and at least one game as a leader where they earned at least one point with their partner, and they seemed to be following the game rules. Workers who performed well before the split were included in the senior pool. We do not consider games from the junior pool. + +# B.2 Decile Details + +All deciles span a relatively short period of time except the sixth decile, which includes a pause in data collection (Table 2). The pause did not significantly effect community membership or performance. Figure 7 shows the number of instructions per decile, distinguished by complete and incomplete instructions. Incomplete instructions occur at the end of an interaction, when there is insufficient time or turns to complete the instruction. Figure 8 shows mean interaction length in each decile. Figure 9 shows follower path lengths per instruction across each decile. + +# C Additional Analysis Details + +# C.1 Interaction Performance + +Several measures demonstrate an increase in player expertise. We analyze interaction performance + +![](images/1b77a852b13c9d2432c74fdd843ecf246412a8ae939600ed3e49dc5066cbf16a.jpg) +Figure 7: The number of instructions for each decile, distinguished by whether they were marked as complete by the follower. + +![](images/f4cc6075dca053a4a9a8f0c9c583e006c426050cefacf627f9c87780362d21dd.jpg) +Figure 8: Mean interaction length, measured by the number of instructions, in each decile. We include incomplete instructions in these counts. + +through how many moves are taken per each instruction, the occurrence of de-selection card events, and instruction queuing behavior. We find that followers become better at following instructions and leaders at creating efficient plans. + +Optimal Path Length Deviations We measure how leaders utilize the larger number of steps per turn available to followers through the length of the shortest possible path corresponding to each instruction. We compute this shortest path using the observed start and end positions of the human follower, ensuring that the path avoids obstacles and completes card events completed by the original follower. The mean length of the shortest path per instruction increases over the community lifetime from 6.66 to 7.97 moves $(p < 0.0001)$ . This corresponds to the increase we observe in the number of goals described in each instruction, which likely requires more steps. + +Concurrently, we see improvements in follower instruction execution, measured through the excess moves taken by follower: the difference between the number of moves the follower took and the shortest possible path corresponding to each completed instruction. Over time, the number of excess steps compared to the shortest paths decreased from 3.67 to 2.36 moves $(p < 0.0001)$ . Figure 10 visualizes this increase in average optimal path length per instruction and decrease in moves taken in ex + +
DecileGame IDsLower Time LimitUpper Time LimitTime (Days)
11-792019-01-27 20:05:00 UTC2019-02-02 15:39:00 UTC5.815278
280-1592019-02-02 15:39:00 UTC2019-02-02 20:24:00 UTC0.197917
3160-2382019-02-02 20:24:00 UTC2019-02-03 00:25:00 UTC0.167361
4239-3182019-02-03 00:25:00 UTC2019-02-04 00:15:00 UTC0.993055
5319-3972019-02-04 00:15:00 UTC2019-02-04 03:09:00 UTC0.120833
6398-4772019-02-04 03:09:00 UTC2019-04-15 19:27:00 UTC70.6375
7478-5562019-04-15 19:27:00 UTC2019-04-15 23:44:00 UTC0.178472
8557-6362019-04-15 23:44:00 UTC2019-04-16 20:06:00 UTC0.848611
9637-7152019-04-16 20:06:00 UTC2019-04-16 22:50:00 UTC0.113889
10716-7952019-04-16 22:50:00 UTC2019-04-17 03:43:00 UTC0.203472
+ +Table 2: Time limits of the division into deciles. The last column is the total amount of time elapsed during a decile. All lower time limits are inclusive. All upper time limits are exclusive, except the last one, which is inclusive. + +![](images/a5c39cf9e6eed7800fd001928eec8559ca9e30ea31afbfc1f83be0bf2ca353ac.jpg) +Figure 9: Mean length of observed follower paths for complete instructions in each decile. We measure length in the number of steps recorded per instruction. + +![](images/70fb6e9df08e100b1f82248d1d35f4d44c40cfeb61dfc6d8a3062c9644d89ec3.jpg) +Figure 10: Excess follower moves and shortest possible distance per leader instruction. + +cess of this optimal path. The reduction in excess moves is especially notable given the increase in the moves required per instruction, indicating the absolute decrease observed is due to an even higher decrease in the probability of follower errors. + +Card De-selections We also study the occurrence of card de-selections, which often reflect error correction. In ideal gameplay, no de-selection events should be observed, as they require additional steps and only correct for a mistakenly selected card not to be part of the current target set. We observe that player errors decrease: the proportion of card events (the selection or de-selection of a single card) that are de-selections decreases from $7.86\%$ to $4.52\%$ $(p = 0.0018)$ . Figure 11 shows the percentage of card events initiated by either player that are de-selections. + +Instruction Queuing The CerealBAR setup allows a leader to plan ahead by queuing multiple + +![](images/ed20022ab244f4ebb53c5dc1378f2dbad94a4e964e20a6209651a7dffe9966e5.jpg) +Figure 11: Proportion of all card events, initiated by both followers and leaders, that were de-selections. + +![](images/9d7021573edf2fb31c413c086e556b1ee2f1e2c54de2b5a7266070e37ae297b8.jpg) +Figure 12: Instruction-queuing behavior over time. + +instructions to the follower at a time. For example, to efficiently use all of the follower's moves, a leader may send two instructions: one which tells them to complete the set, and another that tells them to move towards a card which will make up the next set. A larger queue indicates longer-term leader planning. Alternatively, the leader could include the additional information in one instruction without queuing more instructions. We analyze this queuing behavior as a potential alternative explanation: the leaders may improve how they relay information with better planning, rather than changing the content of their instructions. + +We measure the size of the queue at the beginning and end of follower turns, and the maximum queue size reached during a game. Figure 12 shows queue statistics over time. Begin-turn queue size directly measures how leaders plan via queuing instructions, as no instructions are queued during the follower's turn. Begin-turn and maximum queue size did not change significantly over + +![](images/1c7b8e296c63845cad2eeecabb61dfa7627bc02a74503ce101e5c53acecd5dd8.jpg) +Figure 13: Ratio of language that is a specified part of speech over time. Parts of speech of particular interest are plotted with filled markers. +Figure 14: Selected instructions to illustrate the different measures of complexity, namely: maximum depth (dep), maximum width (wid), and average branching factor (bch). All measures normalized for length. + +
Dep = 0.83, Wid = 0.93, Bch = 0.83 +turn to the left to see one yellow sqaure
Dep = 1.14, Wid = 1.03, Bch = 0.96 +go forward one and to your left is orange
Dep = 1.58, Wid = 0.66, Bch = 0.65 +take the green card with 3 symbols in front of you
Dep = 0.79, Wid = 1.26, Bch = 1.01 +Head straight towards the blue plus card, but don’t pick it up. Continue past it, on the left of it.
+ +time. This relative stability indicates that game play improvements were not primarily due to leaders planning ahead across separate instructions; rather, they can be attributed more to the changes of language within instructions. End-turn queue size sampling indicates the efficiency of player collaboration. From the first to last decile, the average end-turn queue size decreases from 0.694 to 0.592 instructions. This indicates that followers become more efficient over time, completing more instructions per turn. This aligns with our analysis of follower efficiency (Section C.1 and Figure 10). + +# C.2 Syntactic Complexity + +Part-of-Speech Analysis To compute the ratio of POS use, we treat each decile of community life as a bag of words, dividing the total tag count of each POS by the total token count in each decile. In our analysis, we combine the spaCy tags $\langle \mathrm{sconj}\rangle$ (subordinating conjunction) and $\langle \mathrm{cconj}\rangle$ (coordinating conjunction) into one conjunction class, and the tags nouns and proper nouns into one noun class. Figure 13 shows the proportion of the nine most common POS tags used in CerealBar instructions: verbs, determiners, prepositions, adjectives, adverbs, conjunctions, numerals, auxiliary verbs, + +
ClassKeywords
Roadroad, fork, path, intersect, trail, cross-road, crosspath, walkway
Foliagepalm, flower, tree, shrub, grass, pine, bush, grove, plant, conif, field, foliag, wasteland, forest, clearing, patch, lawn
Buildingtower, building, house, tent, barn, fort, doghouse, hut, village, cabin, shack, structure, shed, tower
Waterlake, pond, water, sea, river, coast, is-land, shore
Rockrock, cliff, boulder, mountain, hill, log, stone
Iceglacier, ice, iceberg
Lightpost, lamp, pole, light
+ +Table 3: Reference class keywords + +and nouns. + +Syntactic Complexity Analysis For each utterance, we measure the branching factor, maximum width, and maximum depth of its dependency parse. Dependency tree depth indicates how many embedded clauses the utterance has, whereas width-related measures indicate how many modifiers are stacked in one sub-tree. Intuitively, increased width-related metrics indicate more descriptive utterances, whereas increased depth indicates more compounded phrases. Figure 14 provide examples to illustrate these differences. + +We normalize these measures by the utterance length following Xu and Reitter (2016). Formally, let $X_{n}$ be the set of all utterances in our data with a length of $n$ tokens. The average of metric $S$ (e.g., maximum width) across all utterances of length $n$ in our data is: + +$$ +\bar {S} (n) = \frac {1}{| X _ {n} |} \sum_ {x \in X _ {n}} s (x). \tag {1} +$$ + +For each utterance $x$ with length $n$ , we compute the normalized measure for the utterance: + +$$ +s ^ {\prime} (x) = \frac {s (x)}{\bar {S} (n)}. \tag {2} +$$ + +# C.3 Reference Change + +We divide environmental objects in the CerealBar game into six classes: road, foliage, building, water, rock, ice, and light class objects. We use regular expressions to automate if an utterance refers to a class of objects, defined by if it contains at least one of the class keywords in Table 3. \ No newline at end of file diff --git a/analysisoflanguagechangeincollaborativeinstructionfollowing/images.zip b/analysisoflanguagechangeincollaborativeinstructionfollowing/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..36c7ebd10a730912ea41547e0a71d3258cdbfed9 --- /dev/null +++ b/analysisoflanguagechangeincollaborativeinstructionfollowing/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eaabf606886ede220dd910c51129f9af4e29de25b8c614adb735aa7561270d50 +size 452830 diff --git a/analysisoflanguagechangeincollaborativeinstructionfollowing/layout.json b/analysisoflanguagechangeincollaborativeinstructionfollowing/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2b44747bbacc60b1edd6e2ed83f3f262e68d63b8 --- /dev/null +++ b/analysisoflanguagechangeincollaborativeinstructionfollowing/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f68baad8ce8e21fd602e2e6126475767e4c08e3399bc588d3e2a70f0a12ff395 +size 266578 diff --git a/ananalysisofeuclideanvsgraphbasedframingforbilinguallexiconinductionfromwordembeddingspaces/df392f54-f6e4-4694-86c3-e27034c40492_content_list.json b/ananalysisofeuclideanvsgraphbasedframingforbilinguallexiconinductionfromwordembeddingspaces/df392f54-f6e4-4694-86c3-e27034c40492_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..cce9560ee90f267beeffd1d7f297cbc688fc0123 --- /dev/null +++ b/ananalysisofeuclideanvsgraphbasedframingforbilinguallexiconinductionfromwordembeddingspaces/df392f54-f6e4-4694-86c3-e27034c40492_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:52818bc57d1f1d63e3fcdb46b242fba70fab83e733c7fec947c079446ed45a73 +size 87232 diff --git a/ananalysisofeuclideanvsgraphbasedframingforbilinguallexiconinductionfromwordembeddingspaces/df392f54-f6e4-4694-86c3-e27034c40492_model.json b/ananalysisofeuclideanvsgraphbasedframingforbilinguallexiconinductionfromwordembeddingspaces/df392f54-f6e4-4694-86c3-e27034c40492_model.json new file mode 100644 index 0000000000000000000000000000000000000000..4e1c26c5dab039491a2b757dbe5a6d87f2e801aa --- /dev/null +++ b/ananalysisofeuclideanvsgraphbasedframingforbilinguallexiconinductionfromwordembeddingspaces/df392f54-f6e4-4694-86c3-e27034c40492_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64ea31d6e63f3035f26d3672f8ac4a151a8088018754e9a8a2df5c4a2be93dd5 +size 107822 diff --git a/ananalysisofeuclideanvsgraphbasedframingforbilinguallexiconinductionfromwordembeddingspaces/df392f54-f6e4-4694-86c3-e27034c40492_origin.pdf b/ananalysisofeuclideanvsgraphbasedframingforbilinguallexiconinductionfromwordembeddingspaces/df392f54-f6e4-4694-86c3-e27034c40492_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7936ce84d78a115c6d4f5bb57d6e7bb0ddd76cf0 --- /dev/null +++ b/ananalysisofeuclideanvsgraphbasedframingforbilinguallexiconinductionfromwordembeddingspaces/df392f54-f6e4-4694-86c3-e27034c40492_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d5bceed273a63818703570898db22607279515860791f886a4ec051679979f4 +size 635555 diff --git a/ananalysisofeuclideanvsgraphbasedframingforbilinguallexiconinductionfromwordembeddingspaces/full.md b/ananalysisofeuclideanvsgraphbasedframingforbilinguallexiconinductionfromwordembeddingspaces/full.md new file mode 100644 index 0000000000000000000000000000000000000000..241c2dfe89155fd5c443a32ee1089846b128babf --- /dev/null +++ b/ananalysisofeuclideanvsgraphbasedframingforbilinguallexiconinductionfromwordembeddingspaces/full.md @@ -0,0 +1,370 @@ +# An Analysis of Euclidean vs. Graph-Based Framing for Bilingual Lexicon Induction from Word Embedding Spaces + +Kelly Marchisio1, Youngser Park4,5, Ali Saad-Eldin3, Anton Alyakin2, Kevin Duh1,5, Carey Priebe2,5, Philipp Koehn1 + +Depts. of $^{1}$ Computer Science, $^{2}$ Applied Mathematics and Statistics, and $^{3}$ Biomedical Engineering + +$^{4}$ Center for Imaging Science, $^{5}$ Human Language Technology Center of Excellence Johns Hopkins University + +{kmarc,youngser,asaadel1,aalyaki1}@jhu.edu + +kevinduh@cs.jhu.edu, {cep, phi}@jhu.edu + +# Abstract + +Much recent work in bilingual lexicon induction (BLI) views word embeddings as vectors in Euclidean space. As such, BLI is typically solved by finding a linear transformation that maps embeddings to a common space. Alternatively, word embeddings may be understood as nodes in a weighted graph. This framing allows us to examine a node's graph neighborhood without assuming a linear transform, and exploits new techniques from the graph matching optimization literature. These contrasting approaches have not been compared in BLI so far. In this work, we study the behavior of Euclidean versus graph-based approaches to BLI under differing data conditions and show that they complement each other when combined. We release our code at https://github.com/ kellymarchisio/euc-v-graph-bli. + +# 1 Introduction + +Bilingual lexicons are useful in many natural language processing tasks including constrained decoding in machine translation, cross-lingual information retrieval, and unsupervised machine translation. There is a large literature inducing bilingual lexicons from cross-lingual spaces. "Mapping" methods based on solving the orthogonal Procrustes problem and its generalizations are popular, where languages are mapped to a common space from which a lexicon is extracted. This has been successful when word embedding spaces are roughly isomorphic, but fails as embedding spaces diverge (Søgaard et al., 2018; Vulić et al., 2019). + +Rather than word embeddings in Euclidean space, we can work with weighted graphs derived from embeddings. Graphs may be full-connected or sparse to capture the underlying data manifold. For instance, we may create a similarity graph with words as nodes and cosine distance between word vectors as edges. The use of graphs in NLP has a rich history, for tasks as varied as summarization, + +part-of-speech tagging, syntactic parsing, information extraction, measures of semantic similarity, and evaluation of cross-lingual word embeddings (Mihalcea and Radev, 2011; Nastase et al., 2015; Fujinuma et al., 2019). Graphs can also represent rich relationships like hyponym/hypernym, syntactic roles, synonymy such as in WordNet (Miller, 1995) and Freebase (Bollacker et al., 2008). We focus on fully-connected graphs derived from pairwise cosine similarities between word embeddings. + +The Euclidean view, exemplified by methods solving the Procrustes problem, works with embedding spaces and assumes the existence of a linear transform that maps the spaces. The graph-based view works with graphs for each language and directly performs matching on edge pairs based on neighborhood information. This view is exemplified by graph matching methods that solve the quadratic assignment problem from the combinatorial optimization literature. Ruder et al. (2018) and Haghighi et al. (2008) incorporate related techniques for bilingual lexicon induction. We use Seeded Graph Matching (SGM; Fishkind et al., 2019) as representative of this class of approach. Figure 1 illustrates the differences between the framings; while they both exploit the idea that words with similar neighbors (in Euclidean or graph space) should be translations of one another, they implement the idea in very different ways. + +We explore these two different views of BLI. Our main contributions are (a) a thorough comparison of Euclidean vs. graph-based framings to BLI under varying data conditions, and (b) a method for combining both approaches that achieves better performance than either alone. + +We organize our work into three main experimental setup and results sections. First, we compare standard algorithms of performing BLI via solutions to the orthogonal Procrustes problem ("Procrustes", for short) and SGM in Section 4; we find that their performance varies depending on + +![](images/3f1efa466c22cce4ac95e0ef8d03d9bae61999fd0c7d9d2730d12adf9cc56a69.jpg) +(a) Linear transform W maps x to common space as y: Cost measures distance between vectors $x^{\prime}$ and y + +![](images/9518d4edc4043960fe8f273015504250495604e806295880029a07643bf68f39.jpg) +(b) Quadratic assignment for graph matching: Cost measures difference between edge weights +Figure 1: Comparing Euclidean (Procrustes) vs. Graph (SGM) views. (a) Euclidean view assumes common embedding space and computes costs based on pairs of vectors. (b) Graph-based view assumes graph structure and computes cost based on pairs of edges. Both exploit within-language neighborhood info but in different ways. + +the number of seeds. SGM appears better when using less seeds. Second, as it is common to improve results by bootstrapping, we compare iterative versions of Procrustes and SGM in Section 5. We find that Iterative Procrustes improves much more rapidly than Iterative SGM. We also introduce stochastic variants of the iterative algorithms to improve robustness and experiment with active learning setups. Finally, we present our combined system which outperforms individual Procrustes and SGM approaches in Section 6. + +# 2 Background + +BLI begins with two word embedding matrices: $\mathbf{X} \in \mathbb{R}^{n \times d}$ represents the $d$ -dimensional word embeddings for $n$ vocabulary items in language X, and $\mathbf{Y} \in \mathbb{R}^{m \times d}$ represents the $m$ embeddings separately trained on monolingual data in language Y. We assume seeds $\{(x_1, y_1), (x_2, y_2), \ldots, (x_s, y_s)\}$ are given, which are supervised labels indicating translation correspondence between vocabulary items in the languages. We sort the corresponding submatrices of $\mathbf{X}$ and $\mathbf{Y}$ so each row of $\overline{\mathbf{X}} \in \mathbb{R}^{s \times d}$ and $\overline{\mathbf{Y}} \in \mathbb{R}^{s \times d}$ corresponds to the seeds. Usually, $s$ is strictly smaller than both $n$ and $m$ and the goal is to find translation correspondences in the remaining words. + +Procrustes and linear transforms: The popular Procrustes-based methods for BLI (e.g. Artetxe et al., 2016a, 2019; Conneau et al., 2018; Patra et al., 2019) match seeds by calculating a linear transformation $\mathbf{W}$ by a variant of the below: + +$$ +\min _ {\mathbf {W} \in \mathbb {R} ^ {\mathbf {d} \times \mathbf {d}}} | | \overline {{\mathbf {X}}} \mathbf {W} - \overline {{\mathbf {Y}}} | | _ {\mathbf {F}} ^ {2} \tag {1} +$$ + +If $\mathbf{W}$ is required to be orthogonal, then distances between points are unchanged by the transform and a closed form solution can be computed by singular value decomposition (Schonemann, 1966). + +Once languages are mapped to the same space by $\mathbf{W}$ , nearest neighbor search finds additional translation pairs. If $\mathbf{W}$ is known, one can find translations by optimizing over permutations $\Pi$ : + +$$ +\min _ {\mathbf {P} \in \boldsymbol {\Pi}} \left\| \mathbf {X} \mathbf {W} - \mathbf {P} \mathbf {Y} \right\| _ {\mathbf {F}} ^ {2} \tag {2} +$$ + +$\mathbf{P} \in \{\mathbf{0}, \mathbf{1}\}^{\mathbf{n} \times \mathbf{n}}$ is permutation matrix that shuffles the rows of $\mathbf{Y}$ . If we enforce the 1-to-1 correspondence, this is linear assignment problem that is solvable in polynomial time, e.g. with the Hungarian algorithm (Kuhn, 1955) or Wasserstein methods (Grave et al., 2019a). In the NLP literature, a large number of methods are based on the same underlying idea of linear transform followed by correspondence search/matching (see Related Work). + +To extract lexicons, one performs nearest neighbor search on the transformed embeddings. To mitigate the hubness problem (where some words are close to too many others) (Radovanovic et al., 2010; Suzuki et al., 2013), Conneau et al. (2018) modifies the similarity using cross-domain similarity local scaling (CSLS) to penalize hubs. For $x, y$ in embedding space $V$ : + +$$ +\operatorname {C S L S} (x, y) = 2 \cos (x, y) - \operatorname {a v g} (x, k) - \operatorname {a v g} (y, k) +$$ + +$$ +\operatorname {a v g} (v, k) = \frac {1}{k} \sum_ {v _ {n} \in N _ {k} (v, V)} \cos (v _ {n}, v) +$$ + +$N_{k}(v,V)$ returns the k-nearest-neighbors to $v\in V$ by cosine similarity (typically $k = 10$ ). + +Graph matching: In fields such as pattern recognition, network science, and computer vision, there exist a large body of related work termed "graph matching." Rather than assuming the existence of a linear transform between the embedding spaces, these methods start with or construct two graphs and try to match vertices such that neighborhood structure is preserved. Intuitively, the motivation of preserving neighborhood structure is the same as Procrustes methods, but the absence of linear transform $\mathbf{W}$ is an important distinction that potentially makes graph matching more flexible. Indeed, some recent BLI work argue against linear transforms (Mohiuddin et al., 2020) and discuss the failure modes due to lack of isometry (Søgaard et al., 2018; Nakashole and Flauger, 2018; Ormazabal et al., 2019; Glavaš et al., 2019; Vulić et al., 2019; Patra et al., 2019; Marchisio et al., 2020). + +For BLI, we may build the graphs as $\mathbf{G}_{\mathbf{x}} = \mathbf{X}\mathbf{X}^{\mathrm{T}}$ and $\mathbf{G_y} = \mathbf{Y}\mathbf{Y}^{\mathrm{T}}$ . For standard graph matching objectives, we restrict the vocabularies of $\mathbf{X}$ and $\mathbf{Y}$ to equal size, thus $\mathbf{G_x}, \mathbf{G_y} \in \mathbb{R}^{n \times n}$ . We find the optimal relabeling of nodes such that: + +$$ +\min _ {\mathbf {P} \in \Pi} \left\| \mathbf {G} _ {\mathbf {x}} - \mathbf {P G} _ {\mathbf {y}} \mathbf {P} ^ {\mathbf {T}} \right\| _ {\mathbf {F}} ^ {2} \tag {3} +$$ + +This is an instance of the quadratic assignment problem and is much harder than Eq. 2. It is NP-Hard (Sahni and Gonzalez, 1976) but various approximation methods exist. Vogelstein et al. (2015) use the Frank-Wolfe method (Frank et al., 1956) to find an approximate doubly-stochastic solution, then project onto the space of permutation matrices. + +When seeds are available, SGM can be applied to solve the amended objective in Equation 4, where $s$ is the number of seeds and $\Pi_{n - s}$ is the set of permutation matrices for the $n - s$ non-seed words. See Appendix for details. + +$$ +\min _ {\mathbf {P} \in \Pi_ {\mathbf {n} - \mathbf {s}}} \| \mathbf {G} _ {\mathbf {x}} - (\mathbf {I} _ {\mathbf {s}} \oplus \mathbf {P}) \mathbf {G} _ {\mathbf {y}} (\mathbf {I} _ {\mathbf {s}} \oplus \mathbf {P}) ^ {\mathbf {T}} \| _ {\mathbf {F}} ^ {2} \tag {4} +$$ + +# 2.1 Differences between Procrustes and SGM + +Two differences in behavior of Procrustes vs. SGM are worth discussing for their relevance to BLI. + +Procrustes is many-to-one; SGM is one-to-one. After solving the orthogonal Procrustes problem, translation pairs are selected by finding the $y \in \mathbf{Y}$ that is closest to the mapped source word in $x_w \in \mathbf{XW}$ . It is possible that the nearest neighbor to both $x_{w_1} \in \mathbf{XW}$ and $x_{w_2} \in \mathbf{XW}$ may be $y_1 \in \mathbf{Y}$ , so $\{(x_{w_1}, y_1), (x_{w_2}, y_1)\}$ may be induced as final + +translation hypotheses. Conversely, SGM solutions are strictly one-to-one; If $x_{w_1}$ is paired with $y_1$ , then $x_{w_2}$ cannot be. As such, SGM may avoid hubs naturally without CSLS. A way around the one-to-one restriction is to use SoftSGM. For instance, if $x_{w_1}$ is paired with $y_1$ on $40\%$ of internal runs of SoftSGM and $x_{w_2}$ is paired with $y_1$ on $40\%$ of runs (and $y_1$ is the most frequent pairing for both $x_{w_1}$ and $x_{w_2}$ ), we may induce $\{(x_{w_1}, y_1), (x_{w_2}, y_1)\}$ as final hypotheses. + +Procrustes is soft-seeded; SGM is hard-seeded. Procrustes is "soft-seeded"; giving seed $(x_{1},y_{1})$ does not guarantee that $x_{1}$ and $y_{1}$ will be paired in the solution, because $y_{1}$ may not be the nearest neighbor to the mapped $x_{w_{1}}$ . Conversely, SGM is "hard-seeded": pairings given as seeds will always appear in the solution. This is ideal when one is confident about the quality of the seeds, but means that SGM is not robust to errors in the seed set. + +# 3 Experimental Setup + +Because there are three methods and results sections, we detail the experimental setup first. We evaluate on English $\rightarrow$ German (En-De) and Russian $\rightarrow$ English (Ru-En). + +Monolingual Word Embeddings We use 300-dimensional monolingual word embeddings trained on Wikipedia using fastText (Bojanowski et al., 2017).1 We normalize to unit length, mean-center, and renormalize, following Artetxe et al. (2018a) ("iterative normalization", Zhang et al. (2019)). + +Data & Software Bilingual dictionaries from $\mathsf{MUSE}^2$ are many-to-many lexicons of the 5000 most-frequent words from the source language, paired with one or more target-side translations. We filter each lexicon to be one-to-one for simplicity of analysis. For source words with multiple target words, we keep the first occurrence. This is equivalent to randomly sampling a target sense for polysemous source words because target words are in arbitrary order. En-De originally contains 14667 pairs, and 4903 remain after filtering. Ru-En has 7452 pairs, reduced to 4084. We use 100-4000 pairs as seeds, chosen in frequency order. The rest are the test set. Seed/test splits are in Table 1. We use the public implementation of SGM with random initialization from Graspologic3 (Chung + +et al., 2019). We leave all other hyperparameters as their defaults (maximum Franke-Wolfe iterations: 30 with epsilon stopping criterion $= 0.03$ , shuffle_input=True). + +
Seeds100200500100020004000
En-De Test48034703440339032903903
Ru-En Test3984388435843084208484
+ +# 4 Non-Iterative Experiments + +# 4.1 Methods + +Procrustes We compare Procrustes versus SGM methods when each is run once. We solve the orthogonal Procrustes problem of Equation 1 over known seeds and apply the linear transform $\mathbf{W}$ to the entire source embedding matrix $\mathbf{X}$ . For each mapped source word in $\mathbf{XW}$ , we select $y$ from target embedding matrix $\mathbf{Y}$ with the minimum CSLS score as the translation. + +SGM We construct graphs $\mathbf{G}_{\mathbf{x}} = \mathbf{X}\mathbf{X}^{\mathrm{T}}$ and $\mathbf{G_y} = \mathbf{Y}\mathbf{Y}^{\mathrm{T}}$ , which are matrices of cosine similarity. We solve Equation 4 using the SGM algorithm from Fishkind et al. (2019). We implement Fishkind et al. (2019)'s SoftSGM algorithm by running SGM ten times, each time using a different random initialization for the permutation matrix $\mathbf{P}$ . This gives a probability distribution over matches. + +Standard metrics for BLI are precision@1 and precision@5 (p@1, p@5). Evaluating p@1 is straightforward. For Procrustes p@5, we select the five nearest neighbors per source word. Because SGM only makes one guess per source word, we calculate p@5 using SoftSGM (Fishkind et al., 2019), which returns a probability distribution over possible matches given multiple runs of SGM. We select the top five hypotheses per source word from the probability distribution.4 We calculate recall@5 and F1@5 analogously. + +# 4.2 Results + +Table 2 shows non-iterative results. SGM outperforms Procrustes in nearly all scenarios, and the effect with less seeds is particularly marked: Procrustes scores just $4.1\%$ with 100 seeds and $16.6\%$ with 500 seeds for Ru-En, while SGM scores $50.1\%$ + +and $52.2\%$ , respectively. With a moderate number of seeds, Procrustes and SGM perform similarly. $^{5}$ + +Table 1: Seed/test set splits for En-De, Ru-En. + +
SeedsEn-DeRu-En
ProcrustesSGMProcrustesSGM
1003.645.84.150.1
20016.147.316.652.2
50044.951.945.356.0
100057.254.956.658.1
200063.161.562.767.1
400070.874.267.989.3
+ +Table 2: P@1 of Procrustes vs. SGM. + +We evaluate p@5, recall@5, and F1@5 in Table 3. SGM has considerably higher precision and F1 than Procrustes across all experiments (by $50+$ percentage points in extreme cases) but Procrustes generally has greater recall when seed size is 500 or greater. With 100 or 200 seeds, SGM outperforms Procrustes across-the-board. We note the difference in the number of translation hypotheses induced for each method in "Total Hyps." + +# 5 Iterative Experiments + +# 5.1 Methods + +It is popular to use the Procrustes solution iteratively. One applies the transformation calculated via Procrustes, extracts a dictionary of translation candidates, then uses those as seeds for the next round of Procrustes. We develop an analogous iterative algorithm for SGM. Figure 2 illustrates the two related approaches. + +![](images/8800836695ecda3fbdc39a2445d4852ad32548d26ca2bfea5c3c11f455ab93ab.jpg) +Figure 2: IterSGM [or IterProc]. Run SGM [or Procrustes] in forward & reverse directions. Combine hypotheses and pass as seeds to SGM [Procrustes]. Pull final translations on last iteration from forward run. + +We run SGM or Procrustes and extract potential translation pairs in source $\rightarrow$ target and + +
SeedsPrecisionRecallF1Total Hyps.
ProcrustesSoftSGMProcrustesSoftSGMProcrustesSoftSGMProc.SoftSGM
En-De1002.230.211.253.53.738.624015
2006.834.833.953.311.342.123515
50013.943.169.655.723.248.622015
100015.948.279.657.126.552.319515
200016.858.383.862.628.060.414515
400017.274.286.274.228.774.24515
Ru-En1002.533.312.659.84.242.819920
2007.638.238.059.412.746.519420
50014.145.870.359.623.551.817920
100016.053.880.059.826.756.615420
200016.867.183.967.128.067.110420
400017.189.385.789.328.589.3420
+ +Table 3: P@5, Recall@5, and F1@5 of Procrustes vs. SGM. "Total Hyps." = total number of hypotheses. + +target $\rightarrow$ source language directions, resulting in two sets of translation hypotheses (one hypothesis per source word from each translation direction). For Procrustes, this extraction is done with CSLS. We intersect the hypotheses from the two directions, and feed the resulting set back to Procrustes [or SGM] as seeds. We abbreviate the iterative procedures as IterProc and IterSGM. + +The general procedure is: + +1. Run Procrustes [or SGM], forward direction. +2. Run Procrustes [or SGM], reverse direction. +3. Intersect the hypotheses from both directions. +4. Feed the hypotheses into step 1. Repeat. + +Before step 1 for IterSGM, we form the graphs as described in Section 4. For IterProc, we combine the hypotheses in step 3 with the gold seeds, which is unnecessary for SGM because seeds are always returned in the hypotheses. + +How one select seeds in Step 4 for subsequent rounds is important. We try three variations: + +Add-All Intersect hypotheses from forward and reverse directions. All become seeds for the next round, for $N$ total rounds. Advantage: all correct pairs are passed to the next iteration. Disadvantage: all incorrect hypotheses are, too. + +Stochastic-Add Add up to $H$ new hypotheses each iteration; For iteration two, $H$ random hypotheses from the intersection are chosen and added to the gold seeds for the forward direction. A separate random selection is taken for the reverse direction. The next round, $2H$ random hypotheses + +are chosen. This continues until all hypotheses are used. $^{6}$ This setting was designed to encourage robustness and improve accuracy by minimizing the number of erroneous seeds passed to subsequent rounds, to allow for recovery from mistakes. As distinct subsets are passed to forward and reverse directions, we encourage solutions of the runs to also be different, increasing output diversity. When intersecting the hypotheses, we aim to select pairs which are most likely to be correct—having two different solutions agree increases confidence that the induced pairs are correct, and selecting only a small subset allows recovery from mistakes. This is particularly important for SGM, where incorrect seeds are repeated in the output. In passing a subset to the next round, some incorrect pairs are dropped, and the model gets another chance to induce translations with a (presumably) stronger model. The stochasticity builds in robustness. + +Active-Learning Seeds may also be added in an active learning fashion ("human-in-the-loop"). To simulate a human judging hypothesis quality, we use the union of hypotheses from forward and reverse directions and pass only correct hypotheses as seeds for the next iteration. + +For Add-All and active learning experiments, we run for ten iterations $(N = 10)$ . For Stochastic-Add, $H = 100$ . Tuning $H$ is for future work. + +
SeedsAdd-AllStochastic-AddActive-Learning
IterProcIterSGMIterProcIterSGMIterProcIterSGM
En-De10061.347.262.1 (+0.8)50.2 (+3.0)66.1 (+4.8)56.6 (+9.4)
20061.548.262.0 (+0.5)50.8 (+2.6)66.3 (+4.8)56.7 (+8.5)
50062.652.162.8 (+0.2)52.9 (+0.8)66.6 (+4.0)58.3 (+6.2)
100063.054.763.5 (+0.5)54.8 (+0.1)67.3 (+4.3)59.5 (+4.8)
200065.261.465.2 (+0.0)61.7 (+0.3)69.1 (+3.9)65.6 (+4.2)
400071.374.271.7 (+0.4)74.4 (+0.2)74.6 (+3.3)75.4 (+1.2)
Ru-En10062.451.662.7 (+0.3)56.3 (+4.7)71.0 (+8.6)62.5 (+10.9)
20062.453.763.1 (+0.7)56.4 (+2.7)71.1 (+8.7)61.9 (+8.2)
50063.756.163.7 (+0.0)58.0 (+1.9)71.3 (+7.6)63.1 (+7.0)
100064.058.164.0 (+0.0)60.3 (+2.2)71.2 (+7.2)66.4 (+8.3)
200066.167.165.7 (-0.4)68.2 (+1.1)72.3 (+6.2)71.0 (+3.9)
400069.089.369.0 (+0.0)89.3 (+0.0)72.6 (+3.6)89.3 (+0.0)
+ +Table 4: P@1 of IterProc vs. IterSGM. Add-All runs for 10 iterations, seeding subsequent iterations with the intersection of hypotheses from forward and reverse directions. For Stochastic-Add, seeds are fed in up to 100 at a time until all are used. In parentheses is the improvement over Add-All. + +# 5.2 Results + +Results for IterProc and IterSGM are in Table 4. In parentheses is the raw improvement over Add-All. Unlike the single runs of Procrustes and SGM from Table 2, IterProc outperforms IterSGM in all scenarios with 1000 or less seeds, and for Ende with 2000 seeds. Stochastic-Add outperforms Add-All in nearly all experiments. Because SGM is more sensitive to input seeds than Procrustes, it particularly benefits from the stochastic setup which minimizes its exposure to incorrect input seeds and allows recovery from mistakes. Both IterProc and IterSGM benefit from active learning, showing the improved performance that may be achieved from human-in-the-loop. + +Figure 3 has $\mathfrak{p}@\mathfrak{l}$ for IterProc vs. IterSGM during training (En-De, 100 seeds). Each data point has the number of hypotheses in the intersection of forward and reverse runs, and the precision of the intersection [Precision (Hyps.)]. IterProc dramatically underperforms SGM initially but quickly recovers. IterSGM stays roughly consistent throughout iterations. Precision of IterProc rapidly improves, but stays roughly the same for IterSGM. The number of hypotheses in the intersection is smaller for IterProc, suggesting that forward and reverse directions disagree more, but the hypotheses that they do agree upon are more precise. + +The results in this section and the previous suggest that Procrustes and SGM have complementary + +strengths. While a single run of Procrustes struggles to align word embedding spaces with little supervision, it recovers when run iteratively. Conversely, one run of SGM dramatically outperforms one run of Procrustes with low number of seeds but does not improve much with iterations. + +# 6 System Combination Experiments + +# 6.1 Method + +We create a combined system to see whether both methods together can outperform either alone, shown in Figure 4. For simplicity of implementation, we use Add-All IterProc and single runs of SGM. Here, Procrustes and SGM feed off one another to iteratively improve the solution. The combined system is cyclic—one may choose where to begin and end, with differing effect. There are two main components and a hypothesis extraction step: + +A. SGM Run in forward and reverse directions. Intersect hypotheses and pass to next step. +B. IterProc Run for $I_{\mathrm{proc}}$ iterations. +C. Hypothesis Extraction Pull translation pairs from a forward run of SGM (-PullSGM) or IterProc (-PullProc). This results in one hypothesis for each source word. + +We set $I_{\mathrm{proc}} = 5$ and $N = 10$ . We start from IterProc and pull results either from IterProc (Start: IterProc -PullProc) or SGM (Start: IterProc -PullSGM) on the final loop of the cycle. We repeat the experiments starting from SGM (Start: SGM). + +![](images/ff467faeba27754e881fcf9b0afb7a199c25e4826ac40471c90f89c611e5d163.jpg) +Figure 3: P@1 of iterative methods, by iteration (En-De, 100 seeds). Y-axis has p@1 for the forward run of Procrustes [SGM]. Seeds for subsequent iterations are drawn from the intersection of forward and reverse runs. Size and precision of this intersection is labeled above each point as "Precision (Num Hyps)". Add-All adds all hypotheses in the intersection as seeds to the next iteration. Stochastic-Add adds random samples of up to 100 new hypotheses per iteration. Active Learning adds all correct hypotheses. + +![](images/e83ea4fc2256b6cb5e4d3e5cdfa0191a51f8d1f808cebfaf046c51390d01020a.jpg) + +![](images/31d5307d9fa78b82c565255e2c42c82017d9a2ea3f52cbc9586b65444785746b.jpg) +Figure 4: Combined cyclic system. SGM and Add-All IterProc are interspersed. Begin and end anywhere on the cycle. (1) Run SGM [or IterProc] in forward/reverse direction. (2) Intersect hypotheses and pass to forward/reverse IterProc [SGM] as seeds. (3) Pull final translations after $N$ th cycle from forward SGM [IterProc]. + +# 6.2 Results + +Results for the combined cyclic system are in Table 5. The "Previous Best" column has the best performance from previous experiments (excluding active learning). For all seed levels, the cyclic system can equal or outperform the previous best performance from earlier experiments with single and iterative Procrustes or SGM. + +Looking down the "-PullProc" columns, we discover that it hardly matters whether we begin the cycle with IterProc or SGM. The same is true for "-PullSGM". Whether -PullProc or -PullSGM is + +![](images/486588eff81ce72bdc2448eb7b69612daf4651c6b17c0aac7ab4eaf68dc33f5d.jpg) +Figure 5: Whether pulling from IterProc or SGM is preferred in the combined cyclic system depends on the number of seeds, with IterProc preferred with a low number of seeds, and SGM preferred with more. + +preferred appears to be on a continuum, depicted in Figure 5. For a low seed count, -PullProc is preferred, with the effect more pronounced as seed size diminishes. Conversely, -PullSGM is increasingly preferred as seed set size increases. + +# 7 Discussion & Future Directions + +Though much work in BLI takes a Euclidean view and elicits solutions via methods such as solutions to the generalized Procrustes problem, BLI may also be viewed as a graph-based problem. Parts of the graph-based view have appeared in existing work, but no one has yet to compare the different framings in the context of BLI. We perform this analysis for two high-resource language pairs with well-trained embeddings from Wikipedia, in a restricted data context. Under our experimental settings, we find that: + +1. Procrustes-based methods and SGM behave differently under differing contexts (namely, + +
SeedsPrev. BestCombination Methods
-PullProc-PullSGM
Start: IterProcStart: SGMStart: IterProcStart: SGM
En-De10062.162.262.159.759.5
20062.062.862.660.460.4
50062.863.563.862.162.0
100063.563.964.263.063.7
200065.266.766.769.769.0
400074.473.273.279.779.2
Ru-En10062.763.964.061.762.0
20063.164.564.362.663.1
50063.765.365.364.064.3
100064.066.866.466.866.4
200068.269.469.572.973.1
400089.377.477.489.389.3
+ +Table 5: P@1 for combined cyclic method (Figure 4. One may begin from either IterProc ("Start: Procrustes") or SGM ("Start: SGM"), and may pull final hypotheses from either Procrustes ("-PullProc") or SGM ("-PullSGM"). "Prev. Best" is best result from previous experiments (excluding active learning). Bold is best overall. + +the amount of available seeds), so either may be favorable given the specific data context. SGM appears favorable with less seeds. + +2. SGM can be run iteratively, but does not improve as rapidly as Iterative Procrustes. Both benefit from stochasticity, and active learning can provide strong improvement. +3. Procrustes and SGM can be effectively combined to outperform either alone. + +Our work has limitations which should be addressed by future analyses. We use clean, well-trained embeddings from the same domain. Previous work has shown Procrustes to struggle with poorly-trained and low-resource word embedding spaces, and for well-trained embeddings in mismatched domains (e.g., Marchisio et al., 2020). In these cases, SGM might benefit from a different distance metric. A detailed analysis should be performed when data is many-to-many, as translation is naturally a many-to-many task. One might revisit word vectors based on co-occurrence statistics. The size of training and test sets should be increased, as the presence of more synonyms/antonyms and other "distractor" words may elicit different behavior. There are computational considerations as we scale-up, particularly for SGM. + +# 8 Related Work + +Matching words using vector representations began with vectors based on co-occurrence statistics. + +tics. Rapp (1995) and Fung (1995) induce bilingual lexica based on the principle that words that frequently co-occur in one language have translations that co-occur frequently in another. Diab and Finch (2000) extend this by measuring similarity between words based on co-occurrence vectors and matching words across language by preserving these similarities. Mikolov et al. (2013) are the first to perform BLI over word embeddings, estimating the transformation matrix using stochastic gradient descent. Most recent work solves a variation of the generalized Procrustes problem (e.g., Conneau et al., 2018; Artetxe et al., 2016b, 2017; Patra et al., 2019; Artetxe et al., 2018b; Doval et al., 2018; Joulin et al., 2018; Jawanpuria et al., 2019; Alvarez-Melis and Jaakkola, 2018). Zhang et al. (2020) learn a mapping that overfits to training pairs thus enforcing "hard-seeding", while Ruder et al. (2018) enforce a one-to-one constraint on the output for BLI. + +Some BLI work uses graph based methods implicitly or explicitly. Artetxe et al. (2018a) form an initial solution with similarity matrices and refine with iterative Procrustes. Grave et al. (2019b) optimize "Procrustes in Wasserstein Distance", employing a quadratic assignment formulation and the Frank-Wolfe method. Ren et al. (2020) form CSLS similarity matrices, iteratively extract cliques, and map with Procrustes. Gutierrez-Vasques and Mijangos (2017) create a weighted graph of translation + +candidates then create word vectors with Node2Vec (Grover and Leskovec, 2016). Wushouer et al. (2013) use graphs for a source, target, and pivot language to iteratively extract translation pairs based on heuristics. Our active learning approach is inspired by Yuan et al. (2020). + +# 9 Conclusion + +We perform the first detailed analysis of the consequences of framing BLI either as a Euclidean problem solved by the common Procrustes solution with nearest-neighbor search, or as a graph-based matching problem solved with SGM. We show that each performs differently under different data contexts, with SGM preferred with low amounts of seeds. We compare iterative versions of SGM and Procrustes, and find that stochasticity benefits both. Finally, we create a combined system that outperforms individual Procrustes and SGM approaches. + +# Acknowledgements + +We thank our anonymous reviewers for their comments. This material is based upon work supported by the United States Air Force under Contract No. FA8750-19-C-0098. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the United States Air Force and DARPA. This work was supported in part by the US Defense Advanced Research Projects Agency under the D3M program administered through contract FA8750-17-2-0112. + +# References + +David Alvarez-Melis and Tommi Jaakkola. 2018. Gromov-Wasserstein alignment of word embedding spaces. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1881-1890, Brussels, Belgium. Association for Computational Linguistics. +Mikel Artetxe, Gorka Labaka, and Eneko Agirre. 2016a. Learning principled bilingual mappings of word embeddings while preserving monolingual invariance. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 2289-2294. +Mikel Artetxe, Gorka Labaka, and Eneko Agirre. 2016b. Learning principled bilingual mappings of word embeddings while preserving monolingual invariance. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 2289-2294, Austin, Texas. Association for Computational 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 Linguistics (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 unsupervised cross-lingual mappings of word embeddings. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 789-798. +Mikel Artetxe, Gorka Labaka, and Eneko Agirre. 2018b. A robust self-learning method for fully unsupervised cross-lingual mappings of word embeddings. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 789-798, Melbourne, Australia. Association for Computational Linguistics. +Mikel Artetxe, Gorka Labaka, and Eneko Agirre. 2019. An effective approach to unsupervised machine translation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 194-203, Florence, Italy. Association for Computational Linguistics. +Piotr Bojanowski, Edouard Grave, Armand Joulin, and Tomas Mikolov. 2017. Enriching word vectors with subword information. Transactions of the Association for Computational Linguistics, 5:135-146. +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 International Conference on Management of Data, SIGMOD '08, page 1247-1250, New York, NY, USA. Association for Computing Machinery. +Jaewon Chung, Benjamin D Pedigo, Eric W Bridgeford, Bijan K Varjavand, Hayden S Helm, and Joshua T Vogelstein. 2019. Graspy: Graph statistics in python. Journal of Machine Learning Research, 20(158):1-7. +Alexis Conneau, Guillaume Lample, Marc'Aurelio Ranzato, Ludovic Denoyer, and Hervé Jégou. 2018. Word translation without parallel data. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net. +Mona Diab and Steven Finch. 2000. A statistical word-level translation model for comparable corpora. In Proceedings of the Conference on Content-based multimedia information access (RIAO). +Yerai Doval, Jose Camacho-Collados, Luis Espinosa Anke, and Steven Schockaert. 2018. Improving + +cross-lingual word embeddings by meeting in the middle. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 294-304. +Donniell E Fishkind, Sancar Adali, Heather G Patsolic, Lingyao Meng, Digvijay Singh, Vince Lyzinski, and Carey E Priebe. 2019. Seeded graph matching. Pattern recognition, 87:203-215. +Marguerite Frank, Philip Wolfe, et al. 1956. An algorithm for quadratic programming. Naval research logistics quarterly, 3(1-2):95-110. +Yoshinari Fujinuma, Jordan Boyd-Graber, and Michael J. Paul. 2019. A resource-free evaluation metric for cross-lingual word embeddings based on graph modularity. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4952-4962, Florence, Italy. Association for Computational Linguistics. +Pascale Fung. 1995. Compiling bilingual lexicon entries from a non-parallel English-Chinese corpus. In Third Workshop on Very Large Corpora. +Goran Glavaš, Robert Litschko, Sebastian Ruder, and Ivan Vulić. 2019. How to (properly) evaluate cross-lingual word embeddings: On strong baselines, comparative analyses, and some misconceptions. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 710–721, Florence, Italy. Association for Computational Linguistics. +Edouard Grave, Armand Joulin, and Quentin Berthet. 2019a. Unsupervised alignment of embeddings with Wasserstein procrustes. In The 22nd International Conference on Artificial Intelligence and Statistics, pages 1880-1890. PMLR. +Edouard Grave, Sainbayar Sukhbaatar, Piotr Bojanowski, and Armand Joulin. 2019b. Training hybrid language models by marginalizing over segmentations. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1477-1482, Florence, Italy. Association for Computational Linguistics. +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, pages 855-864. +Ximena Gutierrez-Vasques and Victor Mijangos. 2017. Low-resource bilingual lexicon extraction using graph based word embeddings. arXiv preprint arXiv:1710.02569. +Aria Haghighi, Percy Liang, Taylor Berg-Kirkpatrick, and Dan Klein. 2008. Learning bilingual lexicons from monolingual corpora. In Proceedings of ACL-08: HLT, pages 771-779, Columbus, Ohio. Association for Computational Linguistics. + +Pratik Jawanpuria, Arjun Balgovind, Anoop Kunchukuttan, and Bamdev Mishra. 2019. Learning multilingual word embeddings in latent metric space: a geometric approach. Transactions of the Association for Computational Linguistics, 7:107-120. +Armand Joulin, Piotr Bojanowski, Tomás Mikolov, Hervé Jégou, and Édouard Grave. 2018. Loss in translation: Learning bilingual word mapping with a retrieval criterion. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2979-2984. +Harold W Kuhn. 1955. The hungarian method for the assignment problem. Naval research logistics quarterly, 2(1-2):83-97. +Kelly Marchisio, Kevin Duh, and Philipp Koehn. 2020. When does unsupervised machine translation work? In Proceedings of the Fifth Conference on Machine Translation, pages 571-583, Online. Association for Computational Linguistics. +Rada Mihalcea and Dragomir Radev. 2011. Graph-based natural language processing and information retrieval. 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. +George A Miller. 1995. Wordnet: a lexical database for english. Communications of the ACM, 38(11):39-41. +Tasnim Mohiuddin, M Saiful Bari, and Shafiq Joty. 2020. LNMap: Departures from isomorphic assumption in bilingual lexicon induction through nonlinear mapping in latent space. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2712-2723, Online. Association for Computational Linguistics. +Ndapa Nakashole and Raphael Flauger. 2018. Characterizing departures from linearity in word translation. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 221-227, Melbourne, Australia. Association for Computational Linguistics. +Vivi Nastase, Rada Mihalcea, and Dragomir R Radev. 2015. A survey of graphs in natural language processing. Natural Language Engineering, 21(5):665-698. +Aitor Ormazabal, Mikel Artetxe, Gorka Labaka, Aitor Soroa, and Eneko Agirre. 2019. Analyzing the limitations of cross-lingual word embedding mappings. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4990–4995, Florence, Italy. Association for Computational Linguistics. + +Barun Patra, Joel Ruben Antony Moniz, Sarthak Garg, Matthew R. Gormley, and Graham Neubig. 2019. Bilingual lexicon induction with semi-supervision in non-isometric embedding spaces. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 184-193, Florence, Italy. Association for Computational Linguistics. +Milos Radovanovic, Alexandros Nanopoulos, and Mirjana Ivanovic. 2010. Hubs in space: Popular nearest neighbors in high-dimensional data. Journal of Machine Learning Research, 11(sept):2487-2531. +Reinhard Rapp. 1995. Identifying word translations in non-parallel texts. In Proceedings of the 33rd Annual Meeting on Association for Computational Linguistics, ACL '95, page 320-322, USA. Association for Computational Linguistics. +Shuo Ren, Shujie Liu, Ming Zhou, and Shuai Ma. 2020. A graph-based coarse-to-fine method for unsupervised bilingual lexicon induction. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 3476-3485, Online. Association for Computational Linguistics. +Sebastian Ruder, Ryan Cotterell, Yova Kementchedjheva, and Anders Søgaard. 2018. A discriminative latent-variable model for bilingual lexicon induction. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 458-468, Brussels, Belgium. Association for Computational Linguistics. +Sartaj Sahni and Teofilo Gonzalez. 1976. P-complete approximation problems. Journal of the ACM (JACM), 23(3):555-565. +Peter H Schonemann. 1966. A generalized solution of the orthogonal procrustes problem. Psychometrika, 31(1):1-10. +Anders Søgaard, Sebastian Ruder, and Ivan Vulić. 2018. On the limitations of unsupervised bilingual dictionary induction. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 778-788, Melbourne, Australia. Association for Computational Linguistics. +Ikumi Suzuki, Kazuo Hara, Masashi Shimbo, Marco Saerens, and Kenji Fukumizu. 2013. Centering similarity measures to reduce hubs. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 613-623, Seattle, Washington, USA. Association for Computational Linguistics. +Joshua T Vogelstein, John M Conroy, Vince Lyzinski, Louis J Podrazik, Steven G Kratzer, Eric T Harley, Donniell E Fishkind, R Jacob Vogelstein, and Carey E Priebe. 2015. Fast approximate quadratic programming for graph matching. PLOS one, 10(4):e0121002. + +Ivan Vulic, Goran Glavaš, Roi Reichart, and Anna Korhonen. 2019. Do we really need fully unsupervised cross-lingual embeddings? In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 4407-4418, Hong Kong, China. Association for Computational Linguistics. +Mairidan Wushouer, Toru Ishida, Katsutoshi Hirayama, and Donghui Lin. 2013. Inducing bilingual lexicon using pivot language. Annual Conference of the Information Processing Society of Japan (IPSJ), 5:6. +Michelle Yuan, Mozhi Zhang, Benjamin Van Durme, Leah Findlater, and Jordan Boyd-Graber. 2020. Interactive refinement of cross-lingual word embeddings. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 5984-5996, Online. Association for Computational Linguistics. +Mozhi Zhang, Yoshinari Fujinuma, Michael J. Paul, and Jordan Boyd-Graber. 2020. Why overfitting isn't always bad: Retrofitting cross-lingual word embeddings to dictionaries. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 2214–2220, Online. Association for Computational Linguistics. +Mozhi Zhang, Keyulu Xu, Ken-ichi Kawarabayashi, Stefanie Jegelka, and Jordan Boyd-Graber. 2019. Are girls neko or shojo? cross-lingual alignment of non-isomorphic embeddings with iterative normalization. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3180-3189, Florence, Italy. Association for Computational Linguistics. + +# A Appendix for: An Analysis of Euclidean vs. Graph-Based Framing for Bilingual Lexicon Induction from Word Embedding Spaces + +# A.1 Mathematical Notation + +$\oplus$ is the direct sum of matrices: + +$$ +I _ {s} \oplus P = \left[ \begin{array}{c c} I _ {s} & 0 \\ 0 & P \end{array} \right] +$$ + +# A.2 Simple Example of Seeded Graph Matching + +Recall the constrained optimization objective for seeded graph matching: + +$$ +\operatorname * {a r g m i n} _ {P \in \Pi_ {n - s}} \| G _ {x} - (I _ {s} \oplus P) G _ {y} (I _ {s} \oplus P) ^ {T} \| _ {F} ^ {2} +$$ + +Let $x_{1}, x_{2}, x_{3}, x_{4} \in X$ and $y_{1}, y_{2}, y_{3}, y_{4} \in Y$ . To more clearly see the effect, each of the vectors is orthogonal to all others but not unit length. We create the graphs as below, where each $G_{x_{ij}} = \langle x_i, x_j \rangle$ (equivalently for $G_{y_{ij}} \in G_y$ ). We take $(x_{1}, y_{1})$ as a seed. + +$$ +G _ {x} = \left[ \begin{array}{c c c c} 2 & 0 & 0 & 0 \\ 0 & 2 & 0 & 0 \\ 0 & 0 & 3 & 0 \\ 0 & 0 & 0 & 4 \end{array} \right], G _ {y} = \left[ \begin{array}{c c c c} 1 & 0 & 0 & 0 \\ 0 & 3 & 0 & 0 \\ 0 & 0 & 4 & 0 \\ 0 & 0 & 0 & 2 \end{array} \right] +$$ + +To minimize $G_{x} - G_{y}$ , we swap $y_{2}$ to $y_{3}$ , $y_{3}$ to $y_{4}$ , and $y_{4}$ to $y_{2}$ using $\mathbf{P}$ as below: + +$$ +P = \left[ \begin{array}{c c c} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 0 & 0 \end{array} \right] +$$ + +Let $G_y' = (I_s \oplus P)G_y(I_s \oplus P)^T$ : + +$$ +\begin{array}{l} G _ {y} ^ {\prime} = \left[ \begin{array}{c c c c} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 1 & 0 & 0 \end{array} \right] \left[ \begin{array}{c c c c} 1 & 0 & 0 & 0 \\ 0 & 3 & 0 & 0 \\ 0 & 0 & 4 & 0 \\ 0 & 0 & 0 & 2 \end{array} \right] \left[ \begin{array}{c c c c} 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \end{array} \right] \\ = \left[ \begin{array}{l l l l} 1 & 0 & 0 & 0 \\ 0 & 2 & 0 & 0 \\ 0 & 0 & 3 & 0 \\ 0 & 0 & 0 & 4 \end{array} \right] \\ \end{array} +$$ + +We note that this choice for $G_y'$ (and therefore $P$ ) minimizes Equation 5. The solutions we extract as translation pairs from $G_x$ and $G_y$ are therefore $(x_1, y_1), (x_2, y_4), (x_3, y_2), (x_4, y_3)$ . + +# A.3 Seeded Graph Matching + +This section describes Seeded Graph Matching (Fishkind et al., 2019). Let $G_x, G_y \in \mathbb{R}^{n \times n}$ be graphs representing the relationships between words in word embedding spaces $X, Y \in \mathbb{R}^{n \times d}$ , respectively. We use cosine similarity as the measure of distance when weighting the edges, and therefore the resulting graphs are undirected and symmetric. To form $G_x$ , we may normalize the embeddings in $X$ so that $G_x = XX^T$ . We create $G_y$ similarly. + +Assume seeds $\{(x_1,y_1),(x_2,y_2),\ldots (x_s,y_s)\}$ are given. We formulate this constrained optimization problem as below: + +$$ +\underset {P \in \Pi_ {n - s}} {\arg \min } \| G _ {x} - (I _ {s} \oplus P) G _ {y} (I _ {s} \oplus P) ^ {T} \| _ {F} ^ {2} \tag {5} +$$ + +We understand $(I_s\oplus P)G_y(I_s\oplus P)^T$ as the attempt to "move" the rows/columns of the graph $G_{y}$ such that its rows/columns are in the same order as $G_{x}$ , which is equivalent to relabeling the edges in $G_{y}$ . Rows/columns in $G_{x}$ and $G_{y}$ after reordering that have the same index are then extracted as translations of one another. + +We rearrange Equation 5 to be more tractable for optimization. Letting $G_y' = (I_s \oplus P)G_y(I_s \oplus P)^T$ , we perform the below: + +$$ +\begin{array}{l} \underset {P \in \Pi_ {n - s}} {\arg \min } \langle G _ {x} - G ^ {\prime} _ {y}, G _ {x} - G ^ {\prime} _ {y} \rangle_ {F} \\ = \underset {P \in \Pi_ {n - s}} {\arg \min } \| G _ {x} \| _ {F} ^ {2} + \| G _ {y} \| _ {F} ^ {2} - 2 \cdot t r \left(G _ {x} ^ {T} G _ {y} ^ {\prime}\right) \\ = \operatorname * {a r g m i n} _ {P \in \Pi_ {n - s}} - 2 \cdot t r (G _ {x} ^ {T} G _ {y} ^ {\prime}) \\ = \operatorname * {a r g m a x} _ {P \in \Pi_ {n - s}} t r (G _ {x} ^ {T} (I _ {s} \oplus P) G _ {y} (I _ {s} \oplus P) ^ {T}) \\ \end{array} +$$ + +Because the original objective is non-convex, the constraint on $\mathbf{P}$ is relaxed to being a doubly-stochastic matrix $P\in D_{n - s}$ , which is the convex hull of the set of permutation matrices (Birkhoff-Von Neumann Theorem). The resulting optimization objective is thus: + +$$ += \underset {P \in D _ {n - s}} {\arg \max } t r \left(G _ {x} ^ {T} \left(I _ {s} \oplus P\right) G _ {y} \left(I _ {s} \oplus P\right) ^ {T}\right) \tag {6} +$$ \ No newline at end of file diff --git a/ananalysisofeuclideanvsgraphbasedframingforbilinguallexiconinductionfromwordembeddingspaces/images.zip b/ananalysisofeuclideanvsgraphbasedframingforbilinguallexiconinductionfromwordembeddingspaces/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f5304eb1c2c7bd568529313dbb9b1cfcc56fc893 --- /dev/null +++ b/ananalysisofeuclideanvsgraphbasedframingforbilinguallexiconinductionfromwordembeddingspaces/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:759ec5b8f4f66275f708bbd467961d656c705d5e03cbfae225e2c45962595efa +size 567917 diff --git a/ananalysisofeuclideanvsgraphbasedframingforbilinguallexiconinductionfromwordembeddingspaces/layout.json b/ananalysisofeuclideanvsgraphbasedframingforbilinguallexiconinductionfromwordembeddingspaces/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..f97acb793aec4d849264962503326147f0e6754f --- /dev/null +++ b/ananalysisofeuclideanvsgraphbasedframingforbilinguallexiconinductionfromwordembeddingspaces/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c543463a669c65b03e17ba3c3ed07a36f33a114657ab93f21e2c7b1db7ca7369 +size 455510 diff --git a/ananimatedpicturesaysatleastathousandwordsselectinggifbasedrepliesinmultimodaldialog/92dabcb7-a21a-4038-90e4-430a34e17835_content_list.json b/ananimatedpicturesaysatleastathousandwordsselectinggifbasedrepliesinmultimodaldialog/92dabcb7-a21a-4038-90e4-430a34e17835_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..682d7697421e3e2e1af9106eea6e594436d78745 --- /dev/null +++ b/ananimatedpicturesaysatleastathousandwordsselectinggifbasedrepliesinmultimodaldialog/92dabcb7-a21a-4038-90e4-430a34e17835_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6d56bec9b295988336bf50a79d43e1165b48b60ba00dfcae2d79fd6b7e8bdb7 +size 271274 diff --git a/ananimatedpicturesaysatleastathousandwordsselectinggifbasedrepliesinmultimodaldialog/92dabcb7-a21a-4038-90e4-430a34e17835_model.json b/ananimatedpicturesaysatleastathousandwordsselectinggifbasedrepliesinmultimodaldialog/92dabcb7-a21a-4038-90e4-430a34e17835_model.json new file mode 100644 index 0000000000000000000000000000000000000000..7a26182cdcec0f6ddf490af80f65f0956266178f --- /dev/null +++ b/ananimatedpicturesaysatleastathousandwordsselectinggifbasedrepliesinmultimodaldialog/92dabcb7-a21a-4038-90e4-430a34e17835_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:93790e0e057ceb6e5772c7d07aab2c4f1e8435c698bddc599d5160a5330f23b8 +size 331064 diff --git a/ananimatedpicturesaysatleastathousandwordsselectinggifbasedrepliesinmultimodaldialog/92dabcb7-a21a-4038-90e4-430a34e17835_origin.pdf b/ananimatedpicturesaysatleastathousandwordsselectinggifbasedrepliesinmultimodaldialog/92dabcb7-a21a-4038-90e4-430a34e17835_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d2d4f285f6f312c2e05a2a04cc374250c4fb22a9 --- /dev/null +++ b/ananimatedpicturesaysatleastathousandwordsselectinggifbasedrepliesinmultimodaldialog/92dabcb7-a21a-4038-90e4-430a34e17835_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:601ff9426730d83df4e050ec4940cb6a07398cc66d260584015cd3058d95c3a3 +size 3633698 diff --git a/ananimatedpicturesaysatleastathousandwordsselectinggifbasedrepliesinmultimodaldialog/full.md b/ananimatedpicturesaysatleastathousandwordsselectinggifbasedrepliesinmultimodaldialog/full.md new file mode 100644 index 0000000000000000000000000000000000000000..165de3c14cf50af682f9943bfb8ed754a975115d --- /dev/null +++ b/ananimatedpicturesaysatleastathousandwordsselectinggifbasedrepliesinmultimodaldialog/full.md @@ -0,0 +1,1917 @@ +# An animated picture says at least a thousand words: Selecting GIF-based Replies in Multimodal Dialog + +Xingyao Wang + +University of Michigan + +xingyaow@umich.edu + +David Jurgens + +University of Michigan + +jurgens@umich.edu + +# Abstract + +Online conversations include more than just text. Increasingly, image-based responses such as memes and animated gifs serve as culturally recognized and often humorous responses in conversation. However, while NLP has broadened to multimodal models, conversational dialog systems have largely focused only on generating text replies. Here, we introduce a new dataset of 1.56M text-gif conversation turns and introduce a new multimodal conversational model PEPE THE KING PRAWN for selecting gif-based replies. We demonstrate that our model produces relevant and high-quality gif responses and, in a large randomized control trial of multiple models replying to real users, we show that our model replies with gifs that are significantly better received by the community. + +# 1 Introduction + +Conversations are central to many online social platforms. While most conversations are text-based, computer mediated dialog also affords alternative forms of communication, such as emoji or stickers like bitmoji, that allow users to express themselves (Tang and Hew, 2019; Konrad et al., 2020). Increasingly, these visual forms of communication have become common in social media (Bourlai and Herring, 2014; Highfield and Leaver, 2016), with a notable use of the reaction gif (Bakhshi et al., 2016; Miltner and Highfield, 2017). These gif are short video sequences that depict a particular scene and sometimes contain text that acts as a meta-commentary (Eppink, 2014). As a result, conversations become multimodal where individuals reply to one another using combinations of text and gif's (Figure 1). While conversational AI systems have been developed in a purely text-based setting, such systems do not capture the full multimodal behavior seen online. Here, we study multimodal conversation by introducing new dialog models for selecting gif replies in conversation. + +PizzaMagic: Ahhhhh!!! The EMNLP deadline is in 24 hours!! + +CasualModel: + +![](images/e28dd91a01be13f41bb1a7bfe7d73be2907c2045397aa93f1c42242632f53669.jpg) +Figure 1: GIF responses in conversation like the one shown above are embodied dialog that use visual imagery to convey reactions and emotions. This paper develops a system to select the appropriate gif response to messages. (PDF best viewed with Adobe Acrobat) + +Conversation analysis is central to NLP and multiple approaches have analyzed this dialog structure (Jurafsky et al., 1998; Pareti and Lando, 2018; Cohn et al., 2019) and developed conversational agents to engage with people (e.g., Fang et al., 2018; Xu et al., 2020; Hong et al., 2020). Recent work has focused on generating open domain social chatbots that engage in sustained conversations in a natural way (Ram et al., 2018). Because many of these systems are designed to support voice-based dialog, they overlook non-textual forms of interaction used in social media conversations. In parallel, multimodal NLP systems have been developed for image data, often focusing on image-to-text tasks such as image captioning (Melas-Kyriazi et al., 2018; Sharma et al., 2018) and visual question answering (Antol et al., 2015; Huang et al., 2019; Khademi, 2020). More recent work has focused on the reverse text-to-image dimension, such as generating an image from a description (Niu et al., 2020; Ramesh et al., 2021). Our work unites these two strands of research by integrating image-based communication into conversational agents. + +Our paper offers three main contributions. First, + +we propose the new task of selecting gif responses in multimodal conversation analysis and introduce a new dataset of 1,562,701 real-world conversation turns with gif replies. Second, we introduce a new model PEPE THE KING PRAWN that fuses image and text-based features to select a relevant gif response. In in-house experiments, we show that our model substantially outperforms strong baseline models at selecting the exact gif used in real data and, in a manual test of the quality of the best responses, achieves an nDCG of 0.8145 on the annotated test set. Third, in a real-world test, we deploy our model as a part of a large-scale randomized controlled trial and show that the gif replies produced by our model are more highly voted by the community. Data, code, and models are available at https://github.com/xingyaoww/gif-reply. + +# 2 GIF Communications + +Gifs have been widely adopted in communication as a natural form of embodied speech where the visual imagery conveys emotions or a reaction as a response (Bakhshi et al., 2016; Tolins and Samermit, 2016). These gifs commonly come from widely-known cultural products, such as movies or television shows, which provides common knowledge for how they could be interpreted (Eppink, 2014; Miltner and Highfield, 2017). However, a single gif may have multiple interpretations, depending on the context, cultural knowledge of its content, and the viewer (Jiang et al., 2017). As a result, a single gif can serve multiple functions in communication (Tolins and Samermit, 2016). + +Gifs have grown in their use through increasing affordances by platforms likeTumblr, Reddit, Imgur, and Twitter that allow gifs to be natively displayed like text in conversation threads (Jiang et al., 2018). Further, gif-based keyboards have been introduced that allow users to search for gifs that have been tagged with keywords or other metadata (Griggio et al., 2019). Yet, these technologies require that gif data be prepared with sufficient tags to be searchable or to have sufficient data to use collaborative filtering techniques for recommendations (Jiang et al., 2018, p.9). As a result, there is a clear gap in identifying appropriate response gifs directly from the text, which this work fills. + +# 3 Data + +Despite the widespread use of gifs, no standard dataset exists for text and gif replies. Further, al + +though platforms like Twitter support gif replies, these gifs are not canonicalized to identify which responses correspond to the same gif. Therefore, we construct a new dataset for this task by collecting responses, matching their images, and augmenting this data with metadata about the gif, where possible. A visual description of the whole procedure can be found in Appendix Figure 7. + +# 3.1 GIF Response Data + +Gifs have many uses (Miltner and Highfield, 2017) and so we use a two-step approach to collect data that focus specifically on those likely to be used in conversation. First, gif responses are collected from Twitter by identifying all replies to English-language tweets containing animated_gif as embedded media. Tweets were collected from a $\sim 10\%$ sample of Twitter from March 13th, 2019 to Jan 24th, 2020, totaling 42,096,566 tweets with a gif that we were able to retrieve. Twitter does not canonicalize its tweets so two separate gif files may actually have the same imagery. Further, these files may not be identical due to small differences such as color variations or aspect ratios. To identify uses of the reference tweets, we use Average Hash from the imagehash library to create low-dimensional representations of each gif where hash distance corresponds to perceptual distance. Since gifs are animated and may contain varying scenes, we compute the hash for the first, middle, and final frames, concatenating these into a single hash. Two gifs are considered the same if (i) they have identical hashes or (ii) their hamming distance is $< 10$ and gifs with that hash have been used more than 500 times in Twitter. This latter condition was selected after manual evaluation of thresholds to trade-off between increasing the size of the training data and reducing potential noise caused by matching error. A visual example of this process can be found in Appendix Figure 8. + +Not all gif responses in the Twitter data are conversational or appropriate for wider re-use. Therefore, we filter these responses to only those gifs whose imagery matches gifs hosted by the Giphy website, which is the backend for many gif-based keyboards. Giphy contains a wide collection of gifs that are curated to remove content inappropriate for general use (e.g., violent or sexual imagery). Gifs on the platform are categorized (e.g., "reaction" or "celebrities") and we identify 28 categories containing 972 keywords likely to contain gifs used + +![](images/3462d1b639bdb1ac68db1d83cb1d155b6fa22e7691bdbb79b1fe31169e320a6c.jpg) +Figure 2: The frequency distribution of gifs in our data roughly follows a log-normal distribution, with a few gifs used often, while a long tail of gifs are used relatively infrequently. + +in conversation. A total of 2,095,993 gifs linked to those keywords were ultimately retrieved and stored as image hashes. Additional details of categories and keywords are in Appendix B. + +After the matching image hashes to filter replies, we identify 115,586 unique gifs, referred to as reference gifs, and 1,562,701 tweet replies using one of these gifs, which forms our official dataset. Figure 2 shows these gifs' frequency in the data; much like words, a handful of gifs receive widespread use, while a long tail of gifs are rarely used. + +# 3.2Gif Metadata + +We augment our gif data with information about their content. Some gifs have text that transcribes what a person is saying in the gif's scene or is a meta-commentary on the content. This text is extracted using paddleOCR (Du et al., 2020). Since some gifs are long enough to contain multiple utterances, we run OCR on four frames sampled from each quartile of the gif's length. Roughly $50\%$ (58,020) of gifs contain at least one extracted word from the selected frames, with an mean of 5.5 extracted words per gif across the dataset. + +Second, some gif repositories like Giphy allow users to tag gifs with information on their content or theme, e.g., "face palm" or "movie." We collect tags for the 115K reference gifs used in Twitter, obtaining 39,651 unique tags. These user-generated tags were moderately noisy due to orthographic variations like spelling, capitalization, and spacing. Therefore, we merge tags by (i) lower-casing the text and (ii) performing a manual merge for similar word forms (e.g., "excited" and "exciting"). To minimize noise, we retain only tags that have been + +used with at least five gifs and where those gifs have been used at least 1000 times in total; this process removes many low-frequency tags that are either overly-specific or idiosyncratic in their use. + +Finally, we performed a manual inspection of all remaining tags to remove tags that are too general (e.g., "emotion") and retain only noun, adjective, and verb tags (words or multi-word expressions) that describe specific emotions or actions. A total of 241 unique tags were retained (Appendix C). $6.0\%$ of gifs have at least one tag associated with them (mean 1.9 tags). However, these tagged gifs account for $38.7\%$ of the replies in our dataset, suggesting tags are only available for more-popular gifs. Our dataset represents roughly an order of magnitude more data and more tags than the closest related dataset of Chen et al. (2017) that contained 23K gifs with 17 manually-curated emotions. + +# 4Gif Reply Models + +We introduce a series of models for producing a gif response in conversation. Each model will select a gif from the 115K gifs in our dataset as a response to a text-based message. This task is related to but distinct from work on image-text matching (Lee et al., 2018), which aims to find an image describing a piece of text, or text-to-image (e.g., Wen et al., 2015; Xu et al., 2018), which generates an image from a text description. Here, we aim to select gifs that reflect natural continuations or reactions to a message in a dialog, akin to how gifs are used in social media. For all models, additional details on the training procedures and hyperparameters are provided in Appendix A. The three models that follow use varying degrees of information about the gifs and text to select a response. + +# 4.1 Tag-based Predictions + +The first model uses tags as a shared representation for characterizing gifs and text. Analogous to how object tags are used as anchor points for image-text matching (Li et al., 2020) and pivot languages are used in machine translation (Cheng et al., 2017), we use tags to bridge information between the text in a tweet and the visual content of a gif. Here, each gif becomes associated with a set of tags describing its conversational functions and for each text, we predict the set of tags for gifs responses to it—in essence, predicting what types of responses are most appropriate. We describe both of these processes next and how gifs are ultimately selected. + +Estimating Gif Tags Only $6.0\%$ of the gifs in our data have associated tags. Therefore we train a neural model to predict tags using known tags as training data. To capture any changes in emotion or imagery across the gif, we make separate predictions for four frames sampled across the gif (the same used in §3.2). Each frame is passed through an EfficientNet-based (Tan and Le, 2019) GIF encoder, shown in Figure 3, to extract a low-dimensional feature vector from each frame. These frame embeddings are fused using the attention mechanism from a transformer encoder layer. The output of the transformer feeds into a fully connected layer, which is trained as a multi-label classifier using binary cross-entropy to predict which tags should be present. + +Predicting Response Tags for Text For each message, we predict the $k$ -hot distribution of tags for a gif response by training a BERTweet model (Nguyen et al., 2020), which has been pre-trained on a large corpus of Twitter data (shown as "Tweet Encoder" in Figure 3). The model with an additional fully connected layer is trained as a multi-label classifier using binary cross-entropy, using the tags for the gifs used in reply (if known). + +Tag-based Gif Selection At inference time, given a message, we use the text-to-tag model to predict a $k$ -hot distribution over tags. Then, we select the gif whose estimated tag distribution is closest in Euclidean distance. + +# 4.2 CLIP variant + +The second model uses an end-to-end training approach based on the architecture of OpenAI CLIP (Radford et al., 2021). The architecture features two encoders, one for text and one for images. During training, the encoders are updated using contrastive loss that maximizes the cosine similarity of paired image-text representations and minimizes the cosine similarity of random pairs of images and texts. We replicate the CLIP architecture and training procedure, using BERTweet to encode text and EfficientNet (Tan and Le, 2019) to encode a composite image of four frames from the gif (compared with BERT and ResNet in their implementation). While originally designed to select an image for a text description, our model is trained to select a gif reply for a text message—a more challenging task than the image retrieval task used in the original CLIP setup, as the message may not contain words describing elements of the gif. At inference time, + +given a tweet, we use the trained tweet encoder to extract its representation and compute its cosine similarity with each encoded representation for our gifs. The gif with the highest cosine similarity is returned as the best response. + +# 4.3 PEPE THE KING PRAWN + +Our final model, KING PRAWN1 (referred to as "PEPE".) selects gif responses by using a richer set of multimodal features to create a gif representation. Rather than encode the gif solely from its image content, we use a multimodal encoder that captures (i) any text it might have, (ii) the types of objects present in the gif, and (iii) object regions as visual features. We encode these gif aspects using an OSCAR transformer (Li et al., 2020) to create a unified representation, shown in Figure 3 (bottom). Object names and regions of interest feature vectors are extracted using a pre-trained bottom-up attention model (Anderson et al., 2018). + +As input to the OSCAR encoder, the captions to each of the gif's four frames are concatenated together with an "[INTER_FRAME_SEP]" separator token. We filter object areas detected by the bottom-up attention model (Anderson et al., 2018) and we keep all objects with probability $>0.5$ . We then concatenate object names together with the same inter-frame separator between names of different frames. Together, the caption text, object names, and image-region features are fed into the OSCAR transformer encoder to generate a GIF feature vector; the transformer is initialized with the default OSCAR weights. We use BERTweet to encode text. The entire PEPE model is trained end-to-end using contrastive loss, similar to the CLIP model. + +# 5 Evaluation + +We initially evaluate the methods in two ways. First, we use traditional classification-based evaluation, testing whether the models can reproduce the observed gif replies. However, some messages could have multiple valid gif responses. Therefore, as a second test, we evaluate the model in a retrieval setting, measuring whether its most-probable responses are good quality for a message. + +Experimental Setup Models are trained and tested on a dataset containing 1,562,701 Tweet- + +![](images/2ca576ce886003c6f4eb8aa8849181a2c75755ca0b67e3fdcf33aebc490478c8.jpg) + +![](images/09cb8985a4c13357046246c48911809c9a42653784d90f2d1cb1c3d45f5414d9.jpg) + +![](images/c15f1c960a140b7b5d2f99897ec27922964d21b0714619e21aab30d01f3f2a72.jpg) +Figure 3: The different encoder modules used to construct the models in $\S 4$ . + +GIF pairs associated with 115,586 unique gifs, where 605,063 tweet-gif pairs are associated with at least one tag. Using the finalized 241 unique tags as classes for multi-label classification, we split the dataset by stratify on tags using the iterative train-test split method provided by scikit-multilearn library (Sechidis et al., 2011; Szymański and Kajdanowicz, 2017) to create a 80:10:10 train, dev, and test split which is finalized to train the models described in §4. Following BERTweet (Nguyen et al., 2020), we preprocess tweets in our dataset using NLTK TweetTokenizer for tokenization, emoji package to translate emotion icons, and converted mentions and links to special "@USER" and "HTTPURL" tokens. + +Annotated Data To test whether each model's predictions are valid responses, we annotate the ten most-probable gif predictions for a subset of the tweets in our test data. Many tweets in our test set require substantial context to understand due to having few tokens, linking to URLs that provide extra knowledge, mentioning other users in directed communication. These factors suggest social context or general knowledge aids in the recipient's understanding of the gif's intentions. While the model can still benefit from training on such examples, judging the appropriateness of response is difficult without access to the social context. Therefore, to reduce interpretation ambiguity, we annotate only tweets without URLs or user mentions and having at least 10 tokens. This process selects tweets with + +sufficient content to judge appropriateness independent of the larger social context. + +Two annotators (the authors) were shown a list of potential gif responses for a tweet and asked to judge whether this is an appropriate gif response (a binary rating). Gifs were selected from the ten most-probable replies for each system and collectively shown in random order to prevent knowing which system generated each reply. A total of 2,500 gif-tweet pairings were annotated. Annotators attained a Krippendorf's $\alpha$ of 0.462; while moderate agreement, this value is expected given known differences in how people interpret and value gif responses based on their familiarity with its content, message interpretation, and life-experience (Jiang et al., 2018). We follow the evaluation setup from other retrieval-based dialog systems (e.g. Yu et al., 2021; Kumar and Callan, 2020) and use normalized Discounted Cumulative Gain (nDCG), which measures whether more appropriate gif responses are ranked higher. A gif's appropriateness score is the sum of annotators' ratings. + +Results The PEPE model was able to identify relevant and good-quality gif responses, as shown by its performances on the test data (Table 1) and annotated data (Table 2). Performance on the test set is expected to be low, given the challenge of identifying the exact gif used for a tweet when multiple possible gifs are likely to be equally valid. However, the PEPE model is still able to identify the exact gif (out of $115\mathrm{K}$ ) in its top 10 predictions for $3\%$ of the data, substantially outperforming all + +
ModelTop-1Top-5Top-10
Tag-based0.0000000.0000920.000119
Random0.0000200.0000590.000158
CLIP variant0.0004880.0016690.002783
Distribution sampling0.0009960.0050980.009780
PEPE0.0053750.0187230.030918
+ +Table 1: Models' precision-at- $k$ on selecting the exact gif used as a response for a tweet in the test set; this performance is an underestimate of each model, as many model-predicted gifs may be appropriate. + +
ModelnDCG
Random0.3273
Tag-based0.4526
Distribution sampling0.4969
CLIP variant0.5934
PEPE0.8145
+ +other models. + +Performance on the annotated data (Table 2) provides a more realistic assessment of whether models can generate high-quality replies, as it measures whether the models' replies themselves were good. The PEPE model attains substantially higher performance $(p < 0.01)$ than other models. While the CLIP variant model performs well, the content-agnostic Distribution sampling baseline performs nearly as well. This baseline's high performance speaks to the multiple interpretations of gifs and the ease at which readers can make connections between a gif and message. Indeed, even the random-gif model has a non-zero nDCG, highlighting the ability for an arbitrary gif to still be considered appropriate. We speculate that popular gifs may be popular because of this ease of multiple interpretations. Table 4 shows the top predictions for models and baselines for two example messages, illustrating the variety of relevant gifs; the PEPE and random baseline replies for the second message exemplify the type of gifs that can be widely applied to many messages, often to humorous effects. + +Ablation study PEPE fuses multiple types of input, which may uniquely contribute to model's ability to select gif replies. To understand how these inputs each contribute, we performed an ablation study on the annotated test set by removing one input from Oscar GIF Encoder shown in Figure 3 (i.e., a gif's caption, object names, or objects' visual features) + +Table 2: Models' nDCG scores at proposing appropriate gif replies, measured from annotations on the top 10 most probable gif replies of each model. + +
ModelnDCG
PEPE0.8145
PEPE without object names0.7665
PEPE without caption0.7559
PEPE without object features0.7533
+ +Table 3: Results for ablated versions of PEPE where specific input is removed (cf. Table 2) show that all input forms contribute to the ability to select replies. + +and evaluating the model's resulting gifs on the same test instances. + +The ablated model performances, shown in Table 3, reveal that each input is useful for selecting gifs.2 Object features capture visual information about what specifically is present in the gif (beyond the discrete names of what is present, e.g., "person" or "building") and show that multimodality is important for high performance—predicting replies just from a gif's caption and categorized content are insufficient. Similarly, the caption of a gif (if present) is important, as the text can help make explicit the intended interpretation of a gif. + +# 6 Field Experiment + +To test the generalizability of our models and quality of their responses, we conduct a large-scale randomized controlled trial (RCT) that has the models respond to real users and measure their perception of reply quality.3 + +# 6.1 Experimental Setup + +Gifs were posted to the Imgur platform, which is a highly active social media community that supports both image and text-based interactions. On Imgur, users may create posts, which contain one or more images with optional commentary, or comment on posts or replies. Similar to pre-2018 Twitter, comments are limited to 140 characters. Imgur conversations are threaded and frequently contain both image and text comments. Like Reddit, users may upvote and downvote content, providing a score of how well it was received by the community; we use + +That wonderful feeling you get when you arrive to a business dinner that you're supposedly paying for...and realize you've forgotten your credit card + +![](images/35eff8fb8cdbf4169898f498c2fce0783d26ff2c06c0185afe451ce7fcb87974.jpg) + +![](images/dc0582bbea5ab4b08e3f0da20efc20e9976d3883a44e783648415dc1ffad1767.jpg) + +![](images/f37c75c9f9707300607b805b49b7040b0c28ed3a56b6ad16238c05b0f6d7d17b.jpg) + +![](images/0464b61aeedfe56f42c83138cefdcca5ab9946a55494f54af77bf0b00153f04a.jpg) + +![](images/e17bcc462f555640ed47d292878c1f82a0da21dd3f4c6d60d95db275d47d6aee.jpg) + +I'm convinced some of y'all don't get laid + +![](images/eaadf40f3925b05b2180967c854415ee0ee3f97b407bc797b94f5adc44445afa.jpg) + +![](images/f23e85a0e56d52c9f98a38b1bf21beabc9c27a201daada926fcc40844167d940.jpg) + +![](images/714d6675a5bb433eac90109f806b8a33db6e5cdf2f70c529853eb47b605d6300.jpg) + +![](images/de79642632daa68da2f1fbc43cb13208ef093fb1fb365d6e3bd118ce990e5c99.jpg) + +![](images/f1a60694e9d9f517fc5c9e1c75a939daa0649d36493515d6ddcc1dd4586485c4.jpg) + +Table 4: Model-selected replies to messages (paraphrased for privacy). Click an image to view the gif on Giphy. + +this score in our experiments to evaluate quality. + +Our experiment focuses on generating Gif-based replies to top-level text comments (comments made directly to the post). This setup mirrors the conversational data our models were trained on. Imgur supports several ways of filtering its stream of posts. To ensure that our replies have sufficient visibility, we select posts that have already receive 10 comments and appear in the "most viral" sorting. From these posts, we reply to the top-rated text comment. The RCT runs from 8 AM to 8 PM (local time), making at most 10 replies per hour. + +Not all topics or comments are suitable for automated responses and great care was taken to prevent potential harm to the community. Through multiple rounds of testing which replies would be responded to, we curated a list of keywords that could lead to potential controversial replies, such as terms about religion or race (full list in Appendix D). Any comment containing a token or lemma matching a word on this list is excluded and not replied to. As a further safeguard, experimenters monitored all replies to remove any that were deemed inappropriate. See the Ethics Section (\$9) for a longer discussion of safeguards. + +The field experiment consists of five arms, corresponding to the three trained models and the two baseline models. During each trial, one model is selected and generates a response; the trained model replies with the most probable gif. $^{4}$ + +Not all models are equally likely to perform well and so to make the most use of our trial budget, + +we use Thompson sampling (Russo et al., 2018) to randomly select which arm of the trial to use. Thompson sampling builds a probability model for the estimated reward of each arm (here, the score a reply receives) and samples from the model such that higher-rewarding arms are sampled more frequently. As a result, this method can provide tighter estimates for the reward of the most useful arms. Scores in Imgur have a skewed distribution, with few comments receiving very high scores and most receiving near the default score (1). Therefore, we use Poisson Thompson sampling. Some comments may be downvoted to receive scores below zero, so for simplicity, we truncate these scores to 0. + +We initialize the reward estimates for our experiment by selecting one of the five models in a round-robin manner to reply to an Imgur comment for 3 days. These initial scores act as priors for Thompson sampling to update Poisson distributions for each model. In the trial, we choose a model by sampling from the up distributions using all previous days' scores as the prior. The experiment ran from April 15th, 2021 to August 30th, 2021, and models generated a total of 8,369 replies. + +To evaluate the results of the RCT, we construct a Negative Binomial regression on the dependent variable of the score received for a model's reply, truncating negative scores to zero. The Negative binomial was chosen instead of Poisson due to over-dispersion in the score variable. The models are treated as a categorical variable, using the random model as a reference. Since the score will depend, in part, on the attention received by the parent post and comment (higher-rated comments are displayed first), we include linear effects for the post and parent comment. Finally, we include five text-related variables to control for the con + +![](images/642a12a786e29f19314b6df4dd1243067e14a7492a7bdf62b9e651f807be724e.jpg) +Figure 4: Negative Binomial regression coefficients for each model on predicting a gif reply's score, using the random-gif model as the reference category; bars show standard error and *** denotes significance at 0.01. + +tent of the parent comment: the topic distribution (Appendix Table 9) from a 10-topic model (dropping one topic due to collinearity), the sentiment and subjectivity of the message estimated using TextBlob library, the length of the comment, and whether the comment contained a question. + +# 6.2 Results + +The field experiment demonstrates that the PEPE model is able to generate significantly higher-scoring responses. Figure 4 shows the Negative Binomial regression coefficients for the three models and empirical distribution baseline, with the random gif model as a reference; full regression results are shown in Appendix Table 6. The PEPE model substantially outperforms all other models $(p < 0.01)$ in this real-world setting. Surprisingly, despite performing second-best in our annotated evaluations, the CLIP model performs worst, with its replies receiving fewer upvotes than the two baselines that randomly select gifs. We investigate potential explanations for these performances next. + +The Random and Distributional-sampling baseline models perform surprisingly well relative to models that take the text and gif content into account, with only the PEPE model outperforming them. The performance of the random baselines matches prior work showing people are still able to draw some connection between their interpretation and the reply (Madden, 2018, p.29). Further, we observed that, when the model's reply truly seemed random, some users replied say they upvoted solely because they enjoyed the gif. + +As a follow-up experiment, we tested whether models could be getting higher (or lower) scores by repeatedly picking the same gifs that are skewed towards a positive or negative reaction. Figure 5 shows the score distribution for the top ten most fre + +![](images/161ff9652cc0d73c1a09be59c8aeca2797d930dda725901eecbda47da2684f8d.jpg) +(a) Tag-based + +![](images/ebf77d50f5037032a70663b20ec05b0caeaf9305f260cde7586ab99ddb871ae4.jpg) +(b) CLIP variant + +![](images/cf4000b32d652620cbff5dc7fdfc23f48d37e3b5a59e57aa0bc6a15d4509c243.jpg) +(c) PEPE +Figure 5: Score distributions for most-frequently used gifs show few are universally skewed positive. Boxes show quartile ranges; gifs are in Appendix Table 7. + +sequently used gifs (visual examples in Appendix Table 7) for each of the three trained models and reveals surprisingly divergent behavior for how the community reacts. Each model had a different set of most-used gifs, indicating the models did not converge to a universal set of common replies. Indeed, a gif's frequency-of-use and mean reply score were uncorrelated in all three models ( $r \approx -0.01$ , $p > 0.73$ for all models). The most-used gifs for each model had average scores that were positive, but the distributions for each gif show that some uses were occasionally downvoted. This high variance in scores indicates that a gif's intrinsic qualities are not solely responsible for the received score and, instead, appropriate use in context is plays a significant part in community reception. + +We examined whether models relied on the same set of gifs. Figure 6 shows the distribution of gif + +![](images/9efcb9d4d163733b27eebbdd1da9e38de5dea5a6d5b1327506e918b44ce7606b.jpg) +Figure 6:Gif use frequency by each model, shown as frequency-vs-rank log-scaled with first-order line fit (jitter added for separation). + +uses by each model, indicating that the tag-based model relied frequently on a small set of gifs. However, the PEPE and CLIP variant models were substantially more varied, indicating they draw from the long-tail of possible gifs. + +Do any of our models spark more subsequent conversation? We fit a separate Negative Binomial regression on the total number of comments made to our reply, using the same IVs as the score regression and include the reply's score itself as another IV. This model (Appendix Table 8) shows that both the distributional-sampling baseline and PEPE models produced replies that led to fewer subsequent comments $(\mathrm{p} < 0.01)$ —despite the PEPE model having the most-upvoted replies. However, the score of the gif reply was positively associated $(\mathrm{p} < 0.01)$ indicating that more appropriate replies do receive more subsequent conversation. We speculate that the random models may have led to more conversation due to users replying to express confusion about why the particular gif was used. This result points to a need to understand what text and visual factors in gifs influence the volume of subsequent dialog and an opportunity to optimize gif models for both quality and number of conversation turns. + +# 7 Related Work + +This work draws upon two strands of research from dialog systems and multimodal NLP. Conversational dialog systems have traditionally been built upon large-scale dialog corpora from social media platforms (Bessho et al., 2012) such as Twitter. Our approaches are fundamentally information retrieval based systems that mirror the approach by text-based conversational systems that retrieve ex + +isting messages from a large social media corpus as potential replies and rank these to select a response. Our work mirrors models that use neural networks for ranking (Yan et al., 2016; Inaba and Takahashi, 2016; Penha and Hauff, 2021, e.g.); however, we note that many recent knowledge-grounded and open domain models use encoder-decoder methods to improve versatility and applicability (e.g., Ghazvininejad et al., 2018; Gao et al., 2019; Zhou et al., 2020). Generative approaches are likely inappropriate for gif-based conversation as gifs are more akin to mimetic artifacts that build on cultural knowledge (Eppink, 2014), making synthesizing a new gif from scratch likely less effective. + +All three models used here rely on joint embedding spaces for gif and text. Multiple works in NLP have been proposed to align these representations (Kiros et al., 2014; Wang et al., 2016), often for particular applications such as visual question answering (Antol et al., 2015). Recent work has focused on embeddings these media with a single encoder that takes both text and images as input (e.g., Wang et al., 2019; Chen et al., 2020), in contrast to our model that uses separate image and text encoders (Figure 3); these multimodal encoders are prohibitively computationally expensive to use in our setting during inference time, as the model would need to be run on each gif (and message) to rank replies, compared with our model that only needs to encode text. However, performance and efficiency improvements in aligning image and text representations would likely benefit our task. + +# 8 Conclusion + +People like using gifs in online conversations—gifs are a fun and playful way to communicate. However, modern NLP conversational agents operate only by text. Here, we introduce a new dataset of 1.56M conversation turns using gifs, including captions and metadata, and develop a new conversational model PEPE THE KING PRAWN that selects appropriate gif responses for messages through comparing encoded gif and text representations. In two evaluations, we show that PEPE is able to generate highly-relevant gif responses and in a large-scale RCT, we show that the gif replies from the PEPE model received significantly higher scores from the general public. Our work demonstrates the opportunity for using NLP methods to successfully engage in multimodal conversations. + +# 9 Ethics + +The interactive nature of the RCT necessitated a close consideration of ethical issues (Thieltges et al., 2016). Prior to beginning the RCT, the study team obtained IRB approval to interact with users. While necessary in the legal sense, IRB approval is not sufficient to justify the ethical grounds of the study. The primary risks of the study are if the automated models respond with an inappropriate gif or respond to a message that is not suitable for automated response (e.g., discussing the death of a loved one or making an offensive statement). These risks were mitigated in multiple ways throughout the dataset construction and field experiment. + +First, the selection criteria for which comments we reply to was designed to only reply to content that was already deemed appropriate by the community. By selecting only posts that had received sufficient upvotes to be called "viral" and were already receiving comments, we mitigate the risk of engaging in topics or conversations that are inappropriate according to the norms of the Imgur community, as these posts would be removed by moderators or would have received sufficient downvotes to stay in obscurity. + +Second, by focusing on the top-voted comment to these posts, we again reply to content that has already been deemed high-quality by the comment. This comment-level criteria substantially lowers the risk of our models commenting on inappropriate comments (e.g., a comment insulting another user), as these comments are readily downvoted by the community prior to our intervention. + +Third, we employed extensive filtering to avoid replying to any comment containing a potentially sensitive topic, e.g., a discussion of race or trauma (keywords are listed in Appendix D). The initial set of keywords was developed through examining potentially sensitive topics and then iteratively added to by simulating which messages our RCT would reply to and examining whether it would be appropriate. During the field RCT, experimenters continuously monitored the comments to ensure no harm was being done. Ultimately, only three comments were removed during the initial two days, which was due to a bug in the lemmatization and these comments should have been filtered out by our earlier criteria; these comments were removed quickly and we did not observe any notable response from the community. + +Fourth, one risk is replying with an inapproprii + +ate gif, which is mitigated by the use of Giphy to seed our initial gifs. As this platform is curated and does not host objectively offensive gifs (e.g., overly-violent content), our initial gif set is relatively free of objectionable gifs. Because our model learns directly from gifs' frequency of use, unless objectively offensive gifs are widely used, they are unlikely to be deployed from our RCT; we speculate that few objectively offensive gifs are widely used and, in practice, we have not identified any during the study period or when examining hundreds of random gifs in our data (or used in the RCT). + +Finally, one risk is that by learning gif responses from observed data, our models may reinforce cultural stereotypes that are encoded in the gif themselves (Erinn, 2019), e.g., the association of African American individuals with strong emotions. While our gif data is relatively clean of overtly offensive gif, we acknowledge that our model likely does inadvertently perpetuate some of these latent biases in the data. However, the success of our model suggests a future mitigation strategy for platforms suggesting gif: as biases become known, our approach can be used to suggest less-biased gif as potential responses to mitigate future harm. + +# Acknowledgments + +We thank the reviewers, area chairs, and senior area chairs for their thoughtful comments and feedback. We also thank the Blablablab for helpful feedback and letting us deploy PEPE to the group's Slack and putting up with the ridiculous (and hilarious) gif replies and Imgur for being a wonderful community. This material is based upon work supported by the National Science Foundation under Grant No. 2007251. + +# References + +Peter Anderson, Xiaodong He, Chris Buehler, Damien Teney, Mark Johnson, Stephen Gould, and Lei Zhang. 2018. Bottom-up and top-down attention for image captioning and visual question answering. In 2018 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2018, Salt Lake City, UT, USA, June 18-22, 2018, pages 6077-6086. IEEE Computer Society. +Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C. Lawrence Zitnick, and Devi Parikh. 2015. VQA: visual question answering. In 2015 IEEE International Conference on + +Computer Vision, ICCV 2015, Santiago, Chile, December 7-13, 2015, pages 2425-2433. IEEE Computer Society. +Saeideh Bakhshi, David A. Shamma, Lyndon Kennedy, Yale Song, Paloma de Juan, and Joseph Jofish Kaye. 2016. Fast, cheap, and good: Why animated gifs engage us. In Proceedings of the 2016 CHI Conference on Human Factors in Computing Systems, San Jose, CA, USA, May 7-12, 2016, pages 575-586. ACM. +Michael S Bernstein, Margaret Levi, David Magnus, Betsy Rajala, Debra Satz, and Charla Waeiss. 2021. Esr: Ethics and society review of artificial intelligence research. *ArXiv* preprint, abs/2106.11521. +Fumihiro Bessho, Tatsuya Harada, and Yasuo Kuniyoshi. 2012. Dialog system using real-time crowdsourcing and Twitter large-scale corpus. In Proceedings of the 13th Annual Meeting of the Special Interest Group on Discourse and Dialogue, pages 227-231, Seoul, South Korea. Association for Computational Linguistics. +Elli Bourlai and Susan C Herring. 2014. Multimodal communication on twitter: "i have so many feels!". In Proceedings of the 2014 ACM conference on Web science, pages 171-175. +Weixuan Chen, Ognjen Oggi Rudovic, and Rosalind W Picard. 2017. Gifgif+: Collecting emotional animated gifs with clustered multi-task learning. In 2017 Seventh International Conference on Affective Computing and Intelligent Interaction (ACII), pages 510-517. IEEE. +Yen-Chun Chen, Linjie Li, Licheng Yu, Ahmed El Kholy, Faisal Ahmed, Zhe Gan, Yu Cheng, and Jingjing Liu. 2020. UNITER: Universal Image-Text representation learning. In ECCV. +Yong Cheng, Qian Yang, Yang Liu, Maosong Sun, and Wei Xu. 2017. Joint training for pivot-based neural machine translation. In Proceedings of the Twenty-Sixth International Joint Conference on Artificial Intelligence, IJCAI 2017, Melbourne, Australia, August 19-25, 2017, pages 3974-3980. ijcai.org. +Michelle Cohn, Chun-Yen Chen, and Zhou Yu. 2019. A large-scale user study of an Alexa Prize chatbot: Effect of TTS dynamism on perceived quality of social dialog. In Proceedings of the 20th Annual SIGdial Meeting on Discourse and Dialogue, pages 293-306, Stockholm, Sweden. Association for Computational Linguistics. +Yuning Du, Chenxia Li, Ruoyu Guo, Xiaoting Yin, Weiwei Liu, Jun Zhou, Yifan Bai, Zilin Yu, Yehua Yang, Qingqing Dang, et al. 2020. PP-OCR: A Practical Ultra lightweight OCR system. ArXiv preprint, abs/2009.09941. +Jason Eppink. 2014. A brief history of the gif (so far). Journal of visual culture, 13(3):298-306. + +Wong Erinn. 2019. Digital blackface: How 21st century internet language reinforces racism. +Hao Fang, Hao Cheng, Maarten Sap, Elizabeth Clark, Ari Holtzman, Yejin Choi, Noah A. Smith, and Mari Ostendorf. 2018. Sounding board: A user-centric and content-driven social chatbot. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Demonstrations, pages 96-100, New Orleans, Louisiana. Association for Computational Linguistics. +Jianfeng Gao, Michel Galley, and Lihong Li. 2019. Neural Approaches to Conversational AI: Question Answering, Task-oriented Dialogues and Social Chatbots. Now Foundations and Trends. +Marjan Ghazvininejad, Chris Brockett, Ming-Wei Chang, Bill Dolan, Jianfeng Gao, Wen-tau Yih, and Michel Galley. 2018. A knowledge-grounded neural conversation model. In Proceedings of the Thirty-Second AAAI Conference on Artificial 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 5110-5117. AAAI Press. +Carla F Griggio, Joanna Mcgrenere, and Wendy E Mackay. 2019. Customizations and expression breakdowns in ecosystems of communication apps. Proceedings of the ACM on Human-Computer Interaction, 3(CSCW):1-26. +Tim Highfield and Tama Leaver. 2016. Instagrammatics and digital methods: Studying visual social media, from selfies and gifs to memes and emoji. Communication research and practice, 2(1):47-62. +Chung Hoon Hong, Yuan Liang, Sagnik Sinha Roy, Arushi Jain, Vihang Agarwal, Ryan Draves, Zhizhuo Zhou, William Chen, Yujian Liu, Martha Miracky, et al. 2020. Audrey: A personalized open-domain conversational bot. In *Alexa Prize Proceedings*. +Pingping Huang, Jianhui Huang, Yuqing Guo, Min Qiao, and Yong Zhu. 2019. Multi-grained attention with object-level grounding for visual question answering. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3595-3600, Florence, Italy. Association for Computational Linguistics. +Michimasa Inaba and Kenichi Takahashi. 2016. Neural utterance ranking model for conversational dialogue systems. In Proceedings of the 17th Annual Meeting of the Special Interest Group on Discourse and Dialogue, pages 393-403, Los Angeles. Association for Computational Linguistics. +Jialun "Aaron" Jiang, Jed R Brubaker, and Casey Fiesler. 2017. Understanding diverse interpretations of animated GIFs. In Proceedings of the 2017 CHI Conference Extended Abstracts on Human Factors in Computing Systems, pages 1726-1732. + +Jialun "Aaron" Jiang, Casey Fiesler, and Jed R Brubaker. 2018. "The Perfect One" Understanding Communication Practices and Challenges with Animated GIFs. Proceedings of the ACM on human-computer interaction, 2(CSCW):1-20. +Daniel Jurafsky, Elizabeth Shriberg, Barbara Fox, and Traci Curl. 1998. Lexical, prosodic, and syntactic cues for dialog acts. In *Discourse Relations and Discourse Markers*. +Mahmoud Khademi. 2020. Multimodal neural graph memory networks for visual question answering. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7177-7188, Online. Association for Computational Linguistics. +Ryan Kiros, Ruslan Salakhutdinov, and Richard S Zemel. 2014. Unifying visual-semantic embeddings with multimodal neural language models. *ArXiv preprint*, abs/1411.2539. +Artie Konrad, Susan C Herring, and David Choi. 2020. Sticker and emoji use in facebook messenger: implications for graphicon change. Journal of Computer-Mediated Communication, 25(3):217-235. +Vaibhav Kumar and Jamie Callan. 2020. Making information seeking easier: An improved pipeline for conversational search. In *Findings of the Association for Computational Linguistics: EMNLP* 2020, pages 3971-3980, Online. Association for Computational Linguistics. +Kuang-Huei Lee, X. Chen, G. Hua, H. Hu, and Xiaodong He. 2018. Stacked cross attention for image-text matching. ArXiv preprint, abs/1803.08024. +Xiujun Li, Xi Yin, Chunyuan Li, Pengchuan Zhang, Xiaowei Hu, Lei Zhang, Lijuan Wang, Houdong Hu, Li Dong, Furu Wei, et al. 2020. Oscar: Object-semantics aligned pre-training for vision-language tasks. In European Conference on Computer Vision, pages 121-137. Springer. +John Savery Madden. 2018. The Phenomenological Exploration of Animated GIF Use in Computer-Mediated Communication. Ph.D. thesis, University of Oklahoma. +Luke Melas-Kyriazi, Alexander Rush, and George Han. 2018. Training for diversity in image paragraph captioning. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 757-761, Brussels, Belgium. Association for Computational Linguistics. +Kate M Miltner and Tim Highfield. 2017. Never gonna GIF you up: Analyzing the cultural significance of the animated GIF. Social Media+ Society, 3(3):2056305117725223. +Dat Quoc Nguyen, Thanh Vu, and Anh Tuan Nguyen. 2020. BERTweet: A pre-trained language model for English tweets. In Proceedings of the 2020 + +Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 9-14, Online. Association for Computational Linguistics. +Tianrui Niu, Fangxiang Feng, Lingxuan Li, and Xiaojie Wang. 2020. Image synthesis from locally related texts. In Proceedings of the 2020 International Conference on Multimedia Retrieval, pages 145-153. +Silvia Pareti and Tatiana Lando. 2018. Dialog intent structure: A hierarchical schema of linked dialog acts. In Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018), Miyazaki, Japan. European Language Resources Association (ELRA). +Gustavo Penha and Claudia Hauff. 2021. On the calibration and uncertainty of neural learning to rank models for conversational search. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 160-170, Online. Association for Computational Linguistics. +Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. 2021. Learning transferable visual models from natural language supervision. ArXiv preprint, abs/2103.00020. +Ashwin Ram, Rohit Prasad, Chandra Khatri, Anu Venkatesh, Raefer Gabriel, Qing Liu, Jeff Nunn, Behnam Hedayatnia, Ming Cheng, Ashish Nagar, et al. 2018. Conversational ai: The science behind the alexa prize. ArXiv preprint, abs/1801.03604. +Aditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray, Mark Chen, Rewon Child, Vedant Misra, Pamela Mishkin, Gretchen Kruegerand Sandhini Agarwal, and Ilya Sutskever. 2021. DALL-E: Creating images from text. https://openai.com/blog/dall-e/. +Daniel J Russo, Benjamin Van Roy, Abbas Kazerouni, Ian Osband, and Zheng Wen. 2018. A tutorial on thompson sampling. Foundations and Trends® in Machine Learning, 11(1):1-96. +Konstantinos Sechidis, Grigorios Tsoumakas, and Ioannis Vlahavas. 2011. On the stratification of multi-label data. Machine Learning and Knowledge Discovery in Databases, pages 145-158. +Piyush Sharma, Nan Ding, Sebastian Goodman, and Radu Soricut. 2018. Conceptual captions: A cleaned, hypernymed, image alt-text dataset for automatic image captioning. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2556-2565, Melbourne, Australia. Association for Computational Linguistics. + +Piotr Szymański and Tomasz Kajdanowicz. 2017. A network perspective on stratification of multi-label data. In First International Workshop on Learning with Imbalanced Domains: Theory and Applications, pages 22-35. PMLR. +Mingxing Tan and Quoc V. Le. 2019. Efficientnet: Rethinking model scaling for convolutional neural networks. In Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, volume 97 of Proceedings of Machine Learning Research, pages 6105-6114. PMLR. +Ying Tang and Khe Foon Hew. 2019. Emoticon, emoji, and sticker use in computer-mediated communication: A review of theories and research findings. International Journal of Communication, 13:27. +Andree Thieltges, Florian Schmidt, and Simon Hegelich. 2016. The devil's triangle: Ethical considerations on developing bot detection methods. In 2016 AAAI Spring Symposium Series. +Jackson Tolins and Patrawat Samermit. 2016. Gifs as embodied enactments in text-mediated conversation. Research on Language and Social Interaction, 49(2):75-91. +Liwei Wang, Yin Li, and Svetlana Lazebnik. 2016. Learning deep structure-preserving image-text embeddings. In 2016 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2016, Las Vegas, NV, USA, June 27-30, 2016, pages 5005-5013. IEEE Computer Society. +Zihao Wang, Xihui Liu, Hongsheng Li, Lu Sheng, Junjie Yan, Xiaogang Wang, and Jing Shao. 2019. CAMP: cross-modal adaptive message passing for text-image retrieval. In 2019 IEEE/CVF International Conference on Computer Vision, ICCV 2019, Seoul, Korea (South), October 27 - November 2, 2019, pages 5763-5772. IEEE. +Miaomiao Wen, Nancy Baym, Omer Tamuz, Jaime Teevan, Susan T Dumais, and Adam Kalai. 2015. Omg ur funny! computer-aided humor with an application to chat. In ICCC, pages 86-93. +Jun Xu, Haifeng Wang, Zheng-Yu Niu, Hua Wu, Wanxiang Che, and Ting Liu. 2020. Conversational graph grounded policy learning for open-domain conversation generation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 1835-1845, Online. Association for Computational Linguistics. +Tao Xu, Pengchuan Zhang, Qiuyuan Huang, Han Zhang, Zhe Gan, Xiaolei Huang, and Xiaodong He. 2018. Attngan: Fine-grained text to image generation with attentional generative adversarial networks. In 2018 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2018, Salt Lake City, UT, USA, June 18-22, 2018, pages 1316-1324. IEEE Computer Society. + +Rui Yan, Yiping Song, and Hua Wu. 2016. Learning to respond with deep neural networks for retrieval-based human-computer conversation system. In Proceedings of the 39th International ACM SIGIR conference on Research and Development in Information Retrieval, SIGIR 2016, Pisa, Italy, July 17-21, 2016, pages 55-64. ACM. +Shi Yu, Zhenghao Liu, Chenyan Xiong, Tao Feng, and Zhiyuan Liu. 2021. Few-shot conversational dense retrieval. ArXiv preprint, abs/2105.04166. +Li Zhou, Jianfeng Gao, Di Li, and Heung-Yeung Shum. 2020. The design and implementation of XiaoIce, an empathetic social chatbot. Computational Linguistics, 46(1):53-93. + +
CategorySubcategory
Cartoons & Comicsaqua teen hunger force
Celebritiesrichard pryor
Reactionsangry
Emotionshappy
Animebleach
Art & Designpsychedelic
Naturesunrise
Transportationbicycle
+ +Table 5: Examples of GIF categories on GIPHY + +# A Additional Details on Model Training + +Following, we provide additional details on how each of the three models was trained. + +# A.1 Tag-based Model + +EfficientNet-based Tag Classifier Gifs are reshaped to 224 by 224 pixel while keeping the aspect ratio by padding and normalized to a mean of 0.5 and standard deviation of 0.5 for each channel before feeding into the EfficientNet-based model. We selected unique GIFs from the finalized dataset that has at least one associated tag and using the iterative train test split on k-hot tag representation to select $5\%$ of those GIFs for validation. The EfficientNet tag classifier was trained for 100 epochs on a batch size of 32, using AdamW optimizer with learning rate 1e-5 and weight decay 1e-3. The best validation performance was achieved at the 40th epoch with macro-f1 of 0.30 in predicting 241 multi-label classes. Early experiment shows that transformer encoder layer (macro-f1 of 0.30) out performs linear layer (macro-f1 of 0.19) in fusing multi-frame gif features on the development set, therefore transformer encoder layer is used to fuse features of different frames in our implementation. Tweet-to-tag classifier Using the finalized dataset mentioned in §3, we use tweet as input, and the k-hot tag representation of that tweet instance as ground truth label to train the multi-label classifier along with the tweet encoder for 241 classes. Additionally, we filter out tweets from the finalized dataset that do not have corresponding twitter tags before training. The model with the best validation performance is selected to perform subsequent evaluation and field experiments. The tweet encoder was trained for 100 epochs with a batch size of 32. The learning rate was set to 1e-5 with 1e-3 weight decay using AdamW optimizer. The best + +validation macro-f1 was 0.07 achieved at the 70th epoch. + +# A.2 CLIP variant + +The evaluation performance for model selection is measured by nDCG. For every tweet-gif pair in the validation set, we measure the top 30 predicted GIFs from the model using the tweet as input. The relevance of an occurring ground truth gif in the top 30 predictions given a tweet is set 1 for the nDCG calculation. + +CLIP variant is trained on the same finalized dataset using contrastive loss. It was trained for 16 epochs with a batch size of 16 using AdamW optimizer of learning rate 1e-5 and weight decay 1e-3. Best validation performance is achieved at epoch 6 with an nDCG value of 0.015. + +We replace the Transformer encoder layer with a linear Layer on Efficient GIF Encoder from Figure 3, and use this as our GIF Encoder for the CLIP variant. Image inputs to the GIF encoder are normalized following the official CLIP implementation. + +# A.3 PEPE + +The PEPE model follows most configurations from the CLIP variant model, but replace the EfficientNet GIF encoder with an Oscar GIF encoder based on Oscar pre-trained multi-modal transformer (Li et al., 2020). + +Extra metadata are extracted from GIFs in the finalized dataset for further training. Captions within the GIF are extracted using PaddleOCR (Du et al., 2020), and only extracted text with probability greater than 0.9 are kept as caption metadata. + +Object tags and their corresponding features are extracted with bottom-up attention (Anderson et al., 2018) using py-bottom-up-attention package. Object instances are filtered to only keep instances that have a score higher than 0.5, then object tags and their corresponding features are extracted from these instances. Final object features of dimension 2054 are obtained by concatenating feature output with dimension 2048 from Faster-RCNN with scaled box position coordinates of the object following (Li et al., 2020). + +The PEPE model is trained on the finalized dataset with extracted caption and object metadata. It was trained for 16 epochs with a batch size of 8 using AdamW optimizer of learning rate 1e-6 and weight decay 1e-3. Preprocessing for GIFs is + +![](images/2a0242abf4cbd4f77908f26b0cbbf58e48ead848249e9e29e7cd521077bdc62e.jpg) +Figure 7: A diagram of the pipeline used to collect, canonicalize, and filter gif-reply data from Twitter. + +![](images/b24391a2d9587fcd1546e00017efb0048dedae828eb6ac41494a48b687664148.jpg) +Figure 8: Matching Animated GIFs from Twitter with GIPHY gif using Image Average Hash + +the same as the Tag-based model. Max sequence length is set to 256 tokens for the Oscar transformer. Best evaluation performance is achieved at epoch 12 with an nDCG score of 0.007. + +B GIF categories on GIPHY + +
CategorySubcategory
Reactionswhat
Reactionshair flip
Reactionsbored
Reactionsfrown
Reactionsslow clap
Reactionsmic drop
Reactionsgoodbye
Reactionsmeh
Reactionsscared
Reactionsdo not want
Reactionsconfused
Reactionsdrunk
Reactionswow
Reactionsmad
Reactionsawesome
Reactionsplease
+ +Reactions thumbs down + +Reactions frustrated + +Reactions oh snap + +Reactions disgusted + +Reactions rejected + +Reactions embarrassed + +Reactions hug + +Reactions yolo + +Reactions interested + +Reactions thank you + +Reactions sarcastic + +Reactions shocked + +Reactions cool story bro + +Reactions middle finger + +Reactions you got this + +Reactions whatever + +Reactions omg + +Reactions deal with it + +Reactions sigh + +Reactions oops + +Reactions angry + +Reactions finger guns + +Reactions good luck + +
Dependent variable:
Gif reply score
post score-0.0002*** (0.00003)
comment score0.001*** (0.0001)
CLIP variant model-0.161*** (0.058)
Distribution-sampling model0.057 (0.056)
PEPE model0.223*** (0.051)
Tag-based model-0.017 (0.055)
number of days after reply0.003*** (0.0005)
comment text polarity-0.039 (0.058)
comment text subjectivity-0.033 (0.052)
topic 0 (Politics related)0.078 (0.155)
topic 1 (Family & Pets related)0.300** (0.148)
topic 2 (Employment related)-0.119 (0.184)
topic 3 (Social media related)0.140 (0.165)
topic 4 (Transportation related)-0.172 (0.188)
topic 5 (Food related)0.133 (0.194)
topic 6 (COVID related)-0.082 (0.200)
topic 7 (Entertainment related)-0.057 (0.161)
topic 8 (People related)0.272 (0.198)
comment is a question0.068 (0.049)
length of parent comment-0.003 (0.002)
intercept0.231** (0.115)
Observations8,369
Log Likelihood-14,899.820
θ0.548*** (0.013)
Akaike Inf. Crit.29,841.640
Note:*p<0.1; **p<0.05; ***p<0.01
+ +Table 6: Negative Binomial regression on score of the gif reply. The random-gif baseline is set as the reference category for model comparison. + +Reactions abandon thread + +Reactions excited + +Reactions suspicious + +Reactions win + +Reactions applause + +Reactions popcorn + +Reactions sleepy + +Reactions nod + +Reactions awww + +Reactions disappointed + +Reactions ugh + +Reactions laughing + +Reactions oh no you didnt + +Reactions smh + +Reactions agree + +Reactions serious + +Reactions party hard + +Reactions + +Reactions ok + +Reactions help + +Reactions smile + +Reactions incredulous + +Reactions yawn + +Reactions idk + +Reactions sexy + +Reactions fist bump + +Reactions dancing + +Reactions nom + +Reactions eww + +Reactions hello + +Reactions not bad + +Reactions success + +Reactions burn + +Reactions proud + +Reactions i give up + +Reactions hearts + +Reactions pleased + +Reactions fml + +Reactions sorry + +Reactions aroused + +Reactions happy dance + +Reactions good job + +Reactions wtf + +Reactions seriously + +Reactions want + +Reactions rage + +Reactions table flip + +Reactions love + +Reactions amused + +Reactions flirt + +Reactions judging you + +Transportation truck + +Transportation spaceship + +Transportation van + +Transportation submarine + +Transportation motorcycle + +Transportation bmw + +Transportation helicopter + +Transportation chevrolet + +Transportation volkswagen + +Transportation boat + +Transportation bus + +Transportation porsche + +Transportation tank + +Transportation audi + +Transportation toyota + +Transportation airplane + +Transportation hovercraft + +Transportation nissan + +Transportation bicycle + +Transportation train + +Transportation rocket + +Transportation yacht + +Transportation ferrari + +Transportation honda + +Transportation sailboat + +Transportation car + +Transportation Tesla + +Holidays mardi gras + +Holidays oktoberfest + +Holidays kwanzaa + +Holidays fathers day + +Holidays fourth of july + +Holidays mothers da + +Holidays yom kippur + +Holidays st patricks day + +Holidays memorial day + +Holidays cinco de mayo + +Holidays labor day + +Holidays rosh hashanah + +Holidays new years + +Holidays passover + +Science global warming + +Science astronomy + +Science physics + +Science laser + +Science stars + +Science robot + +Science atoms + +Science meteor + +
SciencebubblesGreetingshappy anniversary
SciencemedicineGreetingshey
SciencenebulaGreetingswelcome
SciencetechnologyGreetingscheers
SciencemathematicsGreetingsbest friends
SciencechemistryTVworkaholics
SciencebiologyTVsuccession
ScienceplanetsTVblackish
SciencemagnetsTVshark tank
SciencemoleculesTVbig brother
ScienceasteroidsTVvanderpump rules
SciencespaceTVafv
Sciencebill nyeTVtwin peaks
ScienceengineeringTVits always sunny in philadelphia
Sciencediy
SciencenuclearTVreal housewives of new york city
Sciencecomputers
Fashion & BeautychanelTVseinfeld
Fashion & Beautyalexander mcqueenTVamerican horror story
Fashion & BeautymodelTVmodern family
Fashion & Beautyvictorias secretTVpoldark
Fashion & BeautypradaTVstranger things
Fashion & Beautykarlie klossTVlaw and order svu
Fashion & Beautyjessica stamTVbig mouth
Fashion & Beautyemily ratajkowskiTVgreys anatomy
Fashion & Beautymiranda kerrTVbachelor in paradise
Fashion & Beautykate uptonTVi love lucy
Fashion & Beautylouis vuittonTVthe voice
Fashion & BeautymakeupTVboy meets world
Fashion & Beautykate mossTVthe bachelorette
Fashion & Beautycara delevingneTVnew girl
Fashion & BeautyrunwayTVsouth park
Fashion & Beautyjourdan dunnTVsaturday night live
Fashion & Beautyjulia nobisTVsaved by the bell
Fashion & BeautyjewelryTVreal housewives of new jersey
Fashion & Beautybeauty
Fashion & Beautychanel imanFood & Drinkpancakes
Fashion & Beautychristian diorFood & Drinksandwich
Fashion & Beautymarc jacobsFood & Drinkhappy hour
Fashion & BeautyshoesFood & Drinksushi
Fashion & BeautydressFood & Drinksteak
Fashion & BeautygucciFood & Drinkpasta
Greetingsget wellFood & Drinkfrench toast
GreetingsbyeFood & Drinkmimosa
Greetingsim outFood & Drinktea
GreetingssympathyFood & Drinkwhiskey
Greetingsthank youFood & Drinkpickle
Greetingsnew babyFood & Drinkcake
Greetingsim sorryFood & Drinkegg roll
GreetingscongratulationsFood & Drinkbroccoli
+ +Food & Drink vodka + +Food & Drink bread + +Food & Drink cookie + +Food & Drink taco + +Food & Drink cheese + +Food & Drink brunch + +Food & Drink french fries + +Food & Drink apple + +Food & Drink orange fruit + +Food & Drink brownies + +Food & Drink wine + +Food & Drink ham + +Food & Drink salad + +Food & Drink pie + +Food & Drink soda + +Food & Drink beer + +Food & Drink burrito + +Food & Drink banana + +Gaming donkey kong + +Gaming maxpayne + +Gaming gears of war + +Gaming streets of rage + +Gaming starfox + +Gaming metroid + +Gaming sega + +Gaming prince of persia + +Gaming sprite + +Gaming final fantasy + +Gaming wolfenstein 3d + +Gaming call of duty + +Gaming earthbound + +Gaming tetris + +Gaming video game physics + +Gaming ninto + +Gaming pacman + +Gaming game boy + +Gaming tomb raider + +Gaming super mario + +Gaming sonic the hedgehog + +Gaming the last of us + +Gaming half life + +Gaming dead space + +Gaming nes + +Gaming super nintendon + +Gaming animal crossing + +Gaming n64 + +Gaming atari + +Gaming the sins + +Gaming bioshock + +Gaming portal + +Gaming destiny the game + +Gaming 8bit + +Gaming galaga + +Gaming kirby + +Gaming mortalkombat + +Gaming starcraft + +Gaming duck hunt + +Gaming skyrim + +Gaming grand theft auto + +Gaming mods + +Gaming metal gear solid + +Gaming world of warfare + +Gaming super smash bros + +Interests new york city + +Interests vampire + +Interests ballet + +Interests summer + +Interests butt + +Interests winter + +Interests tumble + +Interests roller coaster + +Interests robot + +Interests iphone + +Interests work + +Interests theme park + +Interests zombie + +Interests party + +Interests baby + +Interests lgbt + +Interests internet + +Interests boy + +Interests alien + +Interests girl + +Interests vacation + +Interests boobs + +Interests ghost + +Interests autumn + +Interests spring + +Interests clown + +Celebrities jean claude van damme + +Celebrities paul scheer + +Celebrities denzel washington + +Celebrities bryan cranston + +Celebrities chris pratt + +Celebrities johnny depp + +Celebrities stephen colbert + +Celebrities emma watson + +Celebrities macaulay culkin + +Celebrities heath ledger + +Celebrities jim gaffigan + +Celebrities mr.t + +Celebrities danny mcbride + +Celebrities michael fassbender + +Celebrities seth rogen + +Celebrities elijah wood + +Celebrities Jon Hamm + +Celebrities tom hanks + +Celebrities kate upton + +Celebrities arnold Schwarzenegger + +Celebrities tom hiddleston + +Celebrities alpacino + +Celebrities sean connery + +Celebrities javier bardem + +Celebrities ken jeong + +Celebrities will smith + +Celebrities maya rudolph + +Celebrities jack mcbrayer + +Celebrities leonardo dicaprio + +Celebrities clint eastwood + +Celebrities robert downey jr + +Celebrities michael ian black + +Celebrities adrien brody + +Celebrities tom hardy + +Celebrities joseph gordon levitt + +Celebrities mark ruffalo + +Celebrities adam baldwin + +Celebrities rebel wilson + +Celebrities jim carrey + +Celebrities melissa marccarthy + +Celebrities ashley benson + +Celebrities rob huebel + +Celebrities julianne moore + +Celebrities hayden panettiere + +Celebrities anna hendrick + +Celebrities will forte + +Celebrities ryan gosling + +Celebrities andrew garfield + +Celebrities nick offerman + +Celebrities weird al yankovic + +Celebrities will arnett + +Celebrities bruce lee + +Celebrities christian bale + +Celebrities paul dano + +Celebrities eddie murphy + +Celebrities sam rockwell + +Celebrities mike tyson + +Celebrities Jude law + +Celebrities rooney mara + +Celebrities adam sandler + +Celebrities chris hemsworth + +Celebrities kristen wiig + +Celebrities james franco + +Celebrities adam scott + +Celebrities seth green + +Celebrities jeremy renner + +Celebrities morgan freeman + +Celebrities bradley cooper + +Celebrities dave chappelle + +Celebrities rachel mccadams + +Celebrities nicolas cage + +Celebrities megan fox + +Celebrities robert redford + +Celebrities elizabeth banks + +Celebrities Liam neeson + +Celebrities willem dafoe + +Celebrities jonah hill + +Celebrities michael cera + +Celebrities charlie sheen + +Celebrities emma roberts + +Celebrities Jon stewart + +Celebrities patton oswalt + +Celebrities samuel1jackson + +Celebrities alison brie + +Celebrities matt lucas + +Celebrities ellen page + +Celebrities amanda bynes + +Celebrities jake gyllenhaal + +Celebrities rob lowe + +Celebrities steve carell + +Celebrities conan obrien + +Celebrities cillian murphy + +Celebrities mindy kaling + +Celebrities ben stiller + +Celebrities john travolta + +Celebrities gary oldman + +Celebrities amy poehler + +Celebrities ian somerhalder + +Celebrities richard pryor + +Celebrities bruce willis + +Celebrities daniel day lewis + +Celebrities chuck norris + +Celebrities ed helms + +Celebrities don cheekle + +Celebrities michael caine + +Celebrities george carlin + +Celebrities alia shawkat + +Celebrities emma stone + +Celebrities adam devine + +Celebrities larry david + +Celebrities taylor kitsch + +Celebrities matthew perry + +Celebrities dave franco + +Celebrities harrison ford + +Celebrities olivia munn + +Celebrities emily blunt + +Celebrities mila kunis + +Celebrities ru paul + +Celebrities jason bateman + +Celebrities anne hathaway + +Celebrities tracy morgan + +Celebrities natalie portman + +Celebrities brad pitt + +Celebrities tom cruise + +Celebrities sylvester stallone + +Celebrities tina fey + +Celebrities dolph lundgren + +Celebrities tony hale + +Celebrities donald glover + +Celebrities paul rudd + +Celebrities angelina jolie + +Celebrities scarlett johansson + +Celebrities david cross + +Celebrities alecbaldwin + +Celebrities david duchovny + +Celebrities will ferrell + +Celebrities chris rock + +Celebrities adam brody + +Celebrities jennifer lawrence + +Celebrities aubrey plaza + +Celebrities jackie chan + +Celebrities alexa chung + +Celebrities ricky gervais + +Celebrities jessica walter + +Actions cooking + +Actions fighting + +Actions smiling + +Actions laughing + +Actions dreaming + +Actions crying + +Actions spinning + +Actions tossing drink + +Actions sleeping + +Actions eating + +Actions sneezing + +Actions singing + +Actions pout + +Actions slapping + +Actions finger guns + +Actions running + +Actions swimming + +Actions falling + +Actions smoking + +Actions flirting + +Actions dancing + +Actions breaking up + +Actions drinking + +Actions fainting + +Emotions shocked + +Emotions bored + +Emotions unimpressed + +Emotions sick + +Emotions stressed + +Emotions nervous + +Emotions sad + +Emotions relaxed + +Emotions sassy + +Emotions tired + +Emotions reaction + +Emotions hungry + +Emotions scared + +Emotions angry + +Emotions drunk + +Emotions lonely + +Emotions pain + +Emotions excited + +Emotions happy + +Emotions surprised + +Emotions inspired + +Emotions suspicious + +Emotions frustrated + +Emotions love + +Emotions embarrassed + +Emotions disappointed + +Sports hockey + +Sports rugby + +Sports nhl + +Sports rock climbing + +Sports diving + +Sports formula one + +Sports rowing + +Sports skydiving + +Sports mma + +Sports lacrosse + +Sports ufc + +Sports volleyball + +Sports softball + +Sports mlb + +Sports martial arts + +Sports horse racing + +Sports skiing + +
SportsswimmingAdjectivesslow motion
Sportsroller skatingAdjectivescute
SportsfootballAdjectivescold
SportstennisAdjectivesfunny
SportsnbaAdjectivesweird
SportsboxingAdjectivestrippy
SportsparkourAdjectivesblack and white
SportsnascarAdjectivespretty
SportsgolfAdjectivesscary
Art & DesignartAdjectivescreepy
Art & DesigntypographyAdjectiveshd
Art & DesignillustrationAnimalslizard
Art & DesigntransparentAnimalsmeerkat
Art & DesignglitchAnimalsotter
Art & DesignpixelAnimalscow
Art & DesignmorphAnimalscaterpillar
Art & Designblack and whiteAnimalskoala
Art & DesigngeometryAnimalscorgi
Art & DesigncollageAnimalspenguin
Art & DesignarchitectureAnimalsduck
Art & DesignpsychedelicAnimalselephant
Art & Design3dAnimalsraccoon
Art & Designmash upAnimalshippo
Art & DesignphotographyAnimalskangaroo
Art & DesignloopAnimalschicken
Art & DesigncinemaggraphAnimalsmonkey
Art & DesignsculptureAnimalsferret
Art & DesigntimelapseAnimalsseal
Art & DesigndesignAnimalsowl
Art & DesignanimationAnimalsjellyfish
Memessips teaAnimalsbulldog
Memessteal yo girlAnimalscrab
MemesarthurAnimalsbutterfly
Memescrying dawsonAnimalsgiraffe
MemesconfusedAnimalspanda
Memesdeal with itAnimalspig
Memeslike a bossAnimalsred panda
Memeshair flipAnimalsgrumpy cat
Memesforever aloneAnimalssheep
Memeslook at all the fucks i giveAnimalsturtle
MemescucaAnimalswolf
Memesjudge judyAnimalslion
MemesfeelsAnimalsbird
MemesfailAnimalshamster
Memesdank memesAnimalspolar bear
AdjectivesvintageAnimalsgoat
AdjectivessexyAnimalswhale
AdjectivesbrightAnimalsmouse
AdjectivesdarkAnimalscamel
AdjectiveshotAnimalschihuahua
+ +Animals skunk + +Animals squirrel + +Animals frog + +Animals horse + +Animals pug + +Animals tiger + +Animals unicorn + +Animals bear + +Animals poodle + +Movies the fifth element + +Movies the breakfast club + +Movies addams family + +Movies breakfast at tiffanys + +Movies cry baby + +Movies donnie darko + +Movies waynes world + +Movies say anything + +Movies the godfather + +Movies blue velvet + +Movies the princess bride + +Movies clueless + +Movies ghostbusters + +Movies spiderman + +Movies sixteen candles + +Movies aceventura + +Movies the blues brothers + +Movies fight club + +Movies indiana jones + +Movies the notebook + +Movies get out + +Movies the matrix + +Movies star wars + +Movies night of the living dead + +Movies the shining + +Movies 500 days of summer + +Movies bladerunner + +Movies elf + +Movies the big lebowski + +Movies some like it hot + +Movies american psycho + +Movies easy rider + +Movies reservoir dogs + +Movies - Texas chainsaw massacre + +Movies the avengers + +Movies beetlejuice + +Movies labyrinth + +Movies scarface + +Movies spring breakers + +Movies rocky + +Movies pretty in pink + +Movies the dark knight + +Movies citizenkane + +Movies edward scissorhands + +Movies kill bill + +Movies casablanca + +Movies pulp fiction + +Movies terminator + +Movies zoolander + +Movies bridesmaids + +Movies dodgeball + +Movies heathers + +Movies lost boys + +Movies the goonies + +Movies hocus pocus + +Movies the hangover + +Identity native american + +Identity muslim + +Identity love is love + +Identity bisexual + +Identity asian + +Identity times up + +Identity queer + +Identity non binary + +Identity gay + +Identity lesbian + +News & Politics republican + +News & Politics cory booker + +News & Politics economy + +News & Politics irs + +News & Politics democrat + +News & Politics supreme court + +News & Politics bernie sanders + +News & Politics bill clinton + +News & Politics kamala harris + +News & Politics julian castro + +News & Politics white house + +News & Politics senate + +News & Politics joe biden + +News & Politics president + +News & Politics tax day + +News & Politics Elizabeth warren + +News & Politics pete buttigieg + +News & Politics protest + +News & Politics climate change + +News & Politics nancy pelosi + +News & Politics congress + +News & Politics rbg + +News & Politics taxes + +Cartoons & Comics snow white + +Cartoons & Comics peter pan + +Cartoons & Comics doug + +Cartoons & Comics mulan + +Cartoons & Comics harvey birdman + +Cartoons & Comics the critic + +Cartoons & Comics hotel transylvania + +Cartoons & Comics gi joe + +Cartoons & Comics wile e coyote + +Cartoons & Comics popeye + +Cartoons & Comics regular show + +Cartoons & Comics aeon flux + +Cartoons & Comics the little mermaid + +Cartoons & Comics fosters home for imaginary friends + +Cartoons & Comics animaniacs + +Cartoons & Comics gumby + +Cartoons & Comics adult swim + +Cartoons & Comics the jetsons + +Cartoons & Comics muppet babies + +Cartoons & Comics beavis and butthead + +Cartoons & Comics archie comics + +Cartoons & Comics mickey mouse + +Cartoons & Comics captain planet + +Cartoons & Comics peanuts + +Cartoons & Comics ren and stimpy + +Cartoons & Comics underdog + +Cartoons & Comics george of the jungle + +Cartoons & Comics gravity falls + +Cartoons & Comics grinch who stole christmas + +Cartoons & Comics mr magoo + +Cartoons & Comics top cat + +Cartoons & Comics dexters laboratory + +Cartoons & Comics tangled + +Cartoons & Comics Betty boop + +Cartoons & Comics king of the hill + +Cartoons & Comics pink panther + +Cartoons & Comics tailspin + +Cartoons & Comics tweety bird + +Cartoons & Comics disney + +Cartoons & Comics sleeping beauty + +Cartoons & Comics aladdin + +Cartoons & Comics toy story + +Cartoons & Comics alvin and the chipmunks + +Cartoons & Comics teen titans + +Cartoons & Comics tom and jerry + +Cartoons & Comics minnie mouse + +Cartoons & Comics my little pony + +Cartoons & Comics the incredibles + +Cartoons & Comics pinocchio + +Cartoons & Comics rockos modern life + +Cartoons & Comics jem and the holograms + +Cartoons & Comics the flintstones + +Cartoons & Comics garfield + +Cartoons & Comics looney tunes + +Cartoons & Comics calvin and hobbes + +Cartoons & Comics batman + +Cartoons & Comics rugrats + +Cartoons & Comics home movies + +Cartoons & Comics scooby doo + +Cartoons & Comics speed racer + +Cartoons & Comics the venture bros + +Cartoons & Comics daffy duck + +Cartoons & Comics wall e + +Cartoons & Comics cars + +Cartoons & Comics 101 dalmatians + +Cartoons & Comics beauty and the beast + +Cartoons & Comics porky pig + +Cartoons & Comics schoolhouse rock + +Cartoons & Comics rocky and bullwinkle + +Cartoons & Comics sealab 2021 + +Cartoons & Comics hey arnold + +Cartoons & Comics josie and the pussycats + +Cartoons & Comics arthur + +Cartoons & Comics aqua teen hunger force + +Cartoons & Comics magical game time + +Cartoons & Comics space ghost + +Cartoons & Comics cartoon network + +Cartoons & Comics family guy + +Cartoons & Comics the lion king + +Cartoons & Comics winnie the pooh + +Cartoons & Comics phinas and ferb + +Cartoons & Comics homestuck + +Cartoons & Comics daria + +Cartoons & Comics fat albert + +Cartoons & Comics the oatmeal + +Cartoons & Comics yogi bear + +Cartoons & Comics fantasia + +Cartoons & Comics bambi + +Cartoons & Comics samurai jack + +Cartoons & Comics the powerpuff girls + +Cartoons & Comics cyanide and happiness + +Cartoons & Comics teenage mutant ninja turtles + +Cartoons & Comics -pocahontas + +Cartoons & Comics voltron + +Cartoons & Comics south park + +Cartoons & Comics finding nemo + +Cartoons & Comics metalocaypse + +Cartoons & Comics dreamworks + +Cartoons & Comics alice in wonderland + +Cartoons & Comics johnny bravo + +Decades 80s + +Decades vintage + +Decades 30s + +Decades 60s + +Decades 50s + +Decades 70s + +Decades 40s + +Decades 90s + +Decades 20s + +Weird 80s + +Weird vintage + +Weird ghost + +Weird zombie + +Weird morph + +Weird psychedelic + +Weird vampire + +Weird alien + +Weird 90s + +Weird robot + +Weird clown + +Stickers cat stickers + +Stickers excited stickers + +Stickers love stickers + +Stickers animatedtext stickers + +Stickers emoji stickers + +Stickers weird stickers + +Stickers high five stickers + +Stickers birthday stickers + +Stickers party stickers + +Stickers cheeseburger stickers + +Stickers happy stickers + +Stickers dinosaur stickers + +Nature sun + +Nature waves + +Nature wind + +Nature river + +Nature mist + +Nature desert + +Nature moon + +Nature waterfall + +Nature stars + +Nature tsunami + +Nature coral + +Nature glacier + +Nature weather + +Nature beach + +Nature sunrise + +Nature comet + +Nature ocean + +Nature ice + +Nature crystals + +Nature forest + +Nature sunset + +Nature fire + +Nature lava + +Nature reef + +Nature tornado + +Nature northern lights + +Nature landscape + +Nature prairie + +Nature night + +Nature plants + +Nature cave + +Nature trees + +Nature constellations + +Nature clouds + +Nature hurricane + +Nature sand + +Nature mushrooms + +Nature snow + +Nature geyser + +Nature lake + +Nature mountains + +Nature smoke + +Nature rainbow + +Music action bronson + +Music adele + +Music frank ocean + +Music kendrick lamar + +Music the beatles + +Music mc hammer + +Music zayn malik + +Music nicki minaj + +Music backstreet boys + +Music lizzo + +Music cl + +Music snoop dogg + +Music madonna + +Music usher + +Music vampire weekend + +Music the rolling stones + +Music g dragon + +Music jenniferlopez + +Music janet jackson + +Music destinys child + +Music lady gaga + +Music jay z + +Music elvis presley + +Music bruno mars + +Music cardib + +Music tlc + +Music david bowie + +Music coldplay + +Music kpop + +Music missy elliott + +Music solange + +Music whitney houston + +Music carry underwood + +Music shakira + +Music britney spears + +Music lil nas x + +Music mariah carey + +Music selena gomez + +Anime samurai champloo + +Anime fullmetal alchemist + +Anime bleach + +Anime spaceship battleship yamato + +Anime manga + +Anime hetalia + +Anime princess mononoke + +Anime my neighbor totoro + +Anime cowboy bebop + +Anime kawaii + +Anime kiba + +Anime berserk + +Anime evangelion + +Anime black lagoon + +Anime inuyasha + +Anime ninja scroll + +Anime sakura + +Anime hayao miyazaki + +Anime cardcaptor sakura + +Anime rock lee + +Anime code geass + +Anime kakashi hatake + +Anime hinata hyuga + +Anime death note + +Anime gundam + +# C List of selected tags from GIPHY + +adorable, agreed, amazing, amused, angry, annoyed, anxiety, anxious, applause, approval, approve, aw, awesome, awkward, bad, beautiful, best wishes, blank stare, blink, blush, bored, bow, bravo, but why, buy, bye, captivated, celebrate, cheeky, cheering, cheers, clap, come on, comic, compliment, compliments, concerned, confused, congratulations, cool, crazy, creeping, cringe, crushing, cry, curtsy, cute, damn, dance, dancing, deadpan stare, debate, depressed, dickhead, disagree, dis + +appointed, disapprove, disbelief, disgust, dislike, diss, divertente, dont care, doubt, doubtful, drink, drinking, drunk, dubious, dying, eating, eating popcorn, embarassed, engrossed, ennui, excited, face palm, faint, fingers crossed, flirt, flushed, freaking out, frustrated, fuck, fun, funny, gagging, get well, glare, good luck, gossip, grateful, gratitude, great, great job, grin, huhahah, happy, happy dance, head shake, hide, high five, hilarious, honestly, hope, horror, hugs, hugs love, hysterical, ill, impressed, incredulous, insult, interested, interesting, judge, judging you, just, keep going, kiss, laugh, leaving, lets go, lies, like, looking, looking around, love you, lovely, luv u, luv you, mad, mind blown, mock, motivational, moved, muah, much appreciated, nah, nasty, need, nervous, nice one, no, nod, not amused, not funny, not interested, oh shit, overwhelmed, panic, partying, perfect, pissed, please, pleased, pointing, praise, pray, pregnant, proud, pumped, questioning, raises hand, realization, relief, respect, reunited, roast, roll eyes, sad, sadness. salute, sarcastic, savage, scared, scary. screaming. secret. seriously. sexy. shame. shock. shook. shrug. shut up. shy. sighs. sips tea. sitting. sleepy. sloth. smart. smile. smug. sobbing. sorpren. sorry. spit. stoked. stressed. stunned. success. sudden realization. surprise. suspicious. sweating. swoon. swooning take notes. tantrum tears. thank. think. thirsty. thumbs down. thumbs up. tired. too funny. touched. unamused. unbelievable. uncomfortable. unhappy. unimpressed. unsure. upset. vomit. waiting wave. weary. weird whatever will wince wink wrestling yawn yell yes yum + +# D List of filtering keywords on Imgur experiment + +depression, depressing, mental, health, death, dead, alcohol, alcoholism, weed, drugs, addiction, covid, beer, stoned, black, white, arabic, hispanic, latino, latinx, police, cop, racism, racists, race, sexism, sexist, sexy, armed, overthrow, government, republican, democrats, maga, liberal, liberals, conservative, conservatives, offender, victim, disability, disabled, jerking, PD, gun, shots, fired, cops, officer, officers, killing, murder, murdered, kill, kills, killed, murders, shoot, taser, bystander, trigger, handgun, pansexual, sexuality, homosexual, gay, lesbian, corona, virus, coronavirus, vaccine, vaccinated, viruses, vaccination, die, fascist, fascists, antifa, sharia, islam, islamic, christian, Jewish, muslim, blasphemy, blasphemic, death, conviction + +church, priest, pastor, religious, religion, sharia, shia, sunni, judge, bible, qaran, torah, hindu, hindus, christians, jew, jews, muslims, islamist, execute, murder, captive, captives, malpractice, insurance, insured, threat, threatening, war, troops, violence, fighting, conflict, medicine, prescription, drug, dying, hospice, life, doctor, hospital, nurse, pedophiles, pedophile, bitch, republicans, democrat, coup, tax, recession, pedo, criminal, criminals, politician, politicians, health, healthcare, america, american, voter, voting, votes, vote, voters, citizen, immigrants, immigrant, citizens, canadian, canada, eu, european, trump, red, blue, cancer, slavery, slaves, slave, disease, sickness, sorry, nazi, nazis, death, pro-death, pro-life, profile, abortion, aborted, aborting, victims, jail, whore, slut, rape, raped, raping, behead, beheadings, beheaded, torture, tortured, torturing, taliban, afghanistan, soldier, soldiers, kabul + +
Tag basedCLIP variantPEPE
2gG2xiMTtFwsglvesfEtobCSbsHzC8dtnYri4n2Fmig
fnjxvV295sWEJjvwXUm9d3Xif3ShZ42CxlWP5wWf7GR2nhgamhRnEuA
BAPSj0xM1cFe8f9k1tV7HyORcngKF8v5gw0VWGbgnM8w
YOU OKAY, MANTWE REALLY LHER DOW
iSvRxNTAcup6DVfLPloitbnzQ1JQ8Iizx8wiXTrbbYMQBCMM
3oEjHLcg4QMU5umb9mbfrlODgSLqXsS65ODCwM00NVmEyLsX3
aKrTvuOv4hlKM4HmjGg306HiLHWIm2f26AHLBZUC1n53ozi8
3oKPIIIDN24q8Awtwc7J26CGAahos6d5S1A63o8doT9BL7dgtolp7O
jlu44mYwUItSHTW3tj8hZ9FMolyKc0X8BSr7Fq6Bdi3coEWQ
jTrWAzlFGfvVY34PSJiqkHA3DmB8GjORY0303oEjHAUOqG3lSS0f1C
1396L17pwHWOIJrTGOOzcnk3PzLDHqWs6TbKzyMcEfDh4Jiw
+ +Table 7: Examples of top 10 most frequently used gifs across all models in the RCT. Click an image to view the gif on Giphy. Images are ordered from most-used (top) to tenth-most (bottom). + +
Dependent variable:
Cumulative number of replies received
gif reply score0.096*** (0.010)
post score-0.0004*** (0.0001)
comment score0.0002 (0.0002)
CLIP variant model-0.196 (0.152)
distribution-sampling model-0.664*** (0.160)
PEPE model-0.450*** (0.138)
Tag-based model-0.195 (0.146)
number of days after reply-0.001 (0.001)
comment text polarity0.048 (0.164)
comment text subjectivity-0.055 (0.147)
topic 0 (Politics related)-0.275 (0.430)
topic 1 (Family & Pets related)-0.264 (0.412)
topic 2 (Employment related)-1.182** (0.549)
topic 3 (Social media related)1.381*** (0.421)
topic 4 (Transportation related)-0.021 (0.514)
topic 5 (Food related)-0.896 (0.567)
topic 6 (COVID related)-0.459 (0.564)
topic 7 (Entertainment related)-0.529 (0.452)
topic 8 (People related)-1.776*** (0.647)
comment is a question0.114 (0.133)
length of parent comment0.0003 (0.007)
intercept-1.877*** (0.313)
Observations8,369
Log Likelihood-2,466.965
θ0.143*** (0.013)
Akaike Inf. Crit.4,977.930
Note:*p<0.1; **p<0.05; ***p<0.01
+ +Table 8: Negative Binomial regression on cumulative number of replies received. The random-gif baseline is set as the reference category for model comparison. + +
TopicDirichlet parameterKeywords
00.1172people fuck trump shit make thing country n’t vote fucking
10.20164good time love kid make cat dog day year guy
20.09554pay work money people make job year buy time company
30.11245post make read people good time thing imgur video work
40.06541car live year drive day place time road city back
50.05672eat make food good water drink taste cheese pizza coffee
60.06662people covid die vaccine life make work problem mask n’t
70.0888movie play game good watch show love great time song
80.02752wear mask red shirt woman hair white man hat black
90.14292back make put hand time guy car head thing big
+ +Table 9: Topic modeling keywords for Imgur Comments \ No newline at end of file diff --git a/ananimatedpicturesaysatleastathousandwordsselectinggifbasedrepliesinmultimodaldialog/images.zip b/ananimatedpicturesaysatleastathousandwordsselectinggifbasedrepliesinmultimodaldialog/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..006d1b999198e462c7ff1e1fc66dacb95af0ead2 --- /dev/null +++ b/ananimatedpicturesaysatleastathousandwordsselectinggifbasedrepliesinmultimodaldialog/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:13942ef8723be24e1724dae69a1cc5d1093d6fe8bce20102a2a97a1d88b0ddd5 +size 1632762 diff --git a/ananimatedpicturesaysatleastathousandwordsselectinggifbasedrepliesinmultimodaldialog/layout.json b/ananimatedpicturesaysatleastathousandwordsselectinggifbasedrepliesinmultimodaldialog/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..55ef71c3a6389321d194664fa19bcd53dbcf39ea --- /dev/null +++ b/ananimatedpicturesaysatleastathousandwordsselectinggifbasedrepliesinmultimodaldialog/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21b4912074552e6d3e0b94d6ac48f6286cb9c7d07409f05328849cada59756d0 +size 1333808 diff --git a/anedgeenhancedhierarchicalgraphtotreenetworkformathwordproblemsolving/5b555111-13d3-4fe2-ab62-1cfc07085c88_content_list.json b/anedgeenhancedhierarchicalgraphtotreenetworkformathwordproblemsolving/5b555111-13d3-4fe2-ab62-1cfc07085c88_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a06c3ec468333bc91bf8b300afabc192c80be4a9 --- /dev/null +++ b/anedgeenhancedhierarchicalgraphtotreenetworkformathwordproblemsolving/5b555111-13d3-4fe2-ab62-1cfc07085c88_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f331a2daa277ad632e3f6c1db33cc58f1439a0f9a804f912be9a4e0874c4591a +size 72103 diff --git a/anedgeenhancedhierarchicalgraphtotreenetworkformathwordproblemsolving/5b555111-13d3-4fe2-ab62-1cfc07085c88_model.json b/anedgeenhancedhierarchicalgraphtotreenetworkformathwordproblemsolving/5b555111-13d3-4fe2-ab62-1cfc07085c88_model.json new file mode 100644 index 0000000000000000000000000000000000000000..6f95264e9a2f9ba12a73e948c1bd9cb314b4dfd1 --- /dev/null +++ b/anedgeenhancedhierarchicalgraphtotreenetworkformathwordproblemsolving/5b555111-13d3-4fe2-ab62-1cfc07085c88_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a90169e7704d39746b18e3d6cf948aa0dd9a64b271b6e46f58b8e21f6ade9551 +size 87571 diff --git a/anedgeenhancedhierarchicalgraphtotreenetworkformathwordproblemsolving/5b555111-13d3-4fe2-ab62-1cfc07085c88_origin.pdf b/anedgeenhancedhierarchicalgraphtotreenetworkformathwordproblemsolving/5b555111-13d3-4fe2-ab62-1cfc07085c88_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9b314313f051170e2d2215e51a45ab0afadb5031 --- /dev/null +++ b/anedgeenhancedhierarchicalgraphtotreenetworkformathwordproblemsolving/5b555111-13d3-4fe2-ab62-1cfc07085c88_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:814ac41292a46d460fe0b200c7630245d322322759c2b508b40a6a63d1ebe2c1 +size 1390930 diff --git a/anedgeenhancedhierarchicalgraphtotreenetworkformathwordproblemsolving/full.md b/anedgeenhancedhierarchicalgraphtotreenetworkformathwordproblemsolving/full.md new file mode 100644 index 0000000000000000000000000000000000000000..875503139e8d1beeefe0107f2ad56da11eb271fc --- /dev/null +++ b/anedgeenhancedhierarchicalgraphtotreenetworkformathwordproblemsolving/full.md @@ -0,0 +1,343 @@ +# An Edge-Enhanced Hierarchical Graph-to-Tree Network for Math Word Problem Solving + +Qinzhuo Wu, Qi Zhang* Zhongyu Wei + +Shanghai Key Laboratory of Intelligent Information Processing, + +School of Computer Science, Fudan University, Shanghai, China + +(qzwu17,qz,zywei)@fudan.edu.cn + +# Abstract + +Math word problem solving has attracted considerable research interest in recent years. Previous works have shown the effectiveness of utilizing graph neural networks to capture the relationships in the problem. However, these works did not carefully take the edge label information and the long-range word relationship across sentences into consideration. In addition, during generation, they focus on the most relevant areas of the currently generated word, while neglecting the rest of the problem. In this paper, we propose a novel Edge-Enhanced Hierarchical Graph-to-Tree model (EEH-G2T), in which the math word problems are represented as edge-labeled graphs. Specifically, an edge-enhanced hierarchical graph encoder is used to incorporate edge label information. This encoder updates the graph nodes hierarchically in two steps: sentence-level aggregation and problem-level aggregation. Furthermore, a tree-structured decoder with a split attention mechanism is applied to guide the model to pay attention to different parts of the input problem. Experimental results on the MAWPS and Math23K dataset showed that our EEH-G2T can effectively improve performance compared with state-of-the-art methods. + +# 1 Introduction + +Math word problem solving is an important natural language processing (NLP) task that has recently been attracting increasing research interests. Math word problems are narrative text that describe a scene with several math variables and ask a question about an unknown quantity. A simple example is illustrated in Figure 1. Based on the given problem, the target is to infer the difference between the number of boxes of apples and pears. + +Problem: Store sold 360 kilograms of apples, + +![](images/172dc028cd987947b3bfe121aebd82ad9b3ef71dd52ee981f52552ea66fc3aa0.jpg) + +If a box of fruit weighs 24 kilograms, how many boxes of pears are less than apples? + +Expression: (360/24) - (240/24) + +![](images/fab74a4efcdcbdda014894b6bd839c44f743b44c06bb518d0ed85ce3b32a8171.jpg) +Figure 1: An example of a math word problem. The top part of the figure shows the different types of edges connected to the word "pear" in the graph. The bottom part of the figure shows the expressions generated by Graph2Tree (Zhang et al., 2020b) and EEH-G2T. + +- / 240 24 / 360 34 + +(a) Graph2Tree + +- /36024/24024 + +(b) EEH-G2T + +Previous works (Wang et al., 2017; Huang et al., 2018; Wang et al., 2019) used sequence-to-sequence (seq2seq) methods with an attention mechanism (Bahdanau et al., 2014) to generate math expression sequences from math word problems. To capture the structural information of math expressions, many works (Liu et al., 2019; Xie and Sun, 2019; Zhang et al., 2020a) treat math expressions as binary trees and propose several sequence-to-tree (seq2tree) frameworks. These tasks are designed to obtain the pre-order sequence of the expression tree, and they generate the current node based on its parent node and sibling node at each time step. Some works that represent problems as graphs also show better performance. Graph2Tree (Zhang et al., 2020b) connects each number in the problem with its nearby nouns to enrich the quantity representations. KA-S2T (Wu + +![](images/a446fa718cce9470c9b788e4ab60064a36f8cf7f4d0ae3a6b3f713c7269b8d38.jpg) +Figure 2: The attention matrices of Graph2Tree and EEH-G2T. Each row corresponds to a word in the problem, and each column corresponds to a word in the expression. The darker areas of the matrix indicate higher attention scores. + +et al., 2020) connects words with its category in the external knowledge base to capture common sense information. + +Although these methods report promising results, several challenges still remain. 1) Long-range word relationships across sentences should be taken into consideration. As shown in Figure 1, the word "pear" in the second sentence should be associated to the word "pear" in the last sentence. Without long-range relationships, it is difficult for the model to connect these two words that are 15 steps apart. 2) Previous methods did not carefully take the edge label information into consideration. In figure 1, the label on the edge between "kilograms" and "pear" is nmod (noun compound modifier), while the label "category" on the edge between "apples" and "pears" means they belong to the same category in the external knowledge base. Such edge labels can also provide rich syntactic and semantic information. 3) When generating expressions, previous methods tend to focus on the areas in the problem that are most relevant to the currently generated words, and ignore the semantic clues provided by the rest of the problem. As shown in Figure 2, to generate "360" instead of "240" at time step 3, the model needs to pay attention to the entire problem to obtain important clues that the current sub-expression "/360 24" is the number of apple boxes and 360 is the weight of the apples. However, previous methods focused on the problem areas that are most relevant to the currently generated word (i.e., the number 360 + +itself), without noticing the rest of the problem. + +To tackle these challenges, we propose a novel Edge-Enhanced Hierarchical Graph-to-Tree framework (EEH-G2T) for math word problem solving. EEH-G2T represents each math word problem as a graph in which the nodes are connected by labeled edges. To obtain the edge-aware problem representations, we propose an edge-enhanced hierarchical graph encoder that explicitly incorporates edge label information. In addition, the hierarchical encoder updates the nodes in two steps: sentence-level aggregation and problem-level aggregation. This hierarchical structure can first capture the local relations between words within the sentence and then capture the long-range dependencies between words across sentences. Further, we use a split attention mechanism to guide the decoder to pay attention to different parts of the entire input problem, not just the most relevant part of the currently generated word. + +The main contributions of this paper can be summarized as follows: + +- We propose an edge-enhanced hierarchical graph encoder to incorporate edge label information. Additionally, the encoder updates the graph nodes in two steps, namely sentence-level aggregation and problem-level aggregation. +- We propose a split attention mechanism to guide the decoder to pay attention to different parts of the entire input problem during the generation. +- We conducted experiments on two commonly used math word problem solving datasets, MAWPS and Math23K. Experimental results prove that our approach can effectively improve the performance compared with state-of-the-art methods. + +# 2 Models + +# 2.1 Problem Formulation + +In this work, we focus on generating math expressions for the given math word problems. We denote the text of a math word problem as a sequence of words and number symbols. $\mathrm{X} = (x_{1}, x_{2}, \ldots, x_{m})$ is a math word problem with m words. Our model aims to generate a math expression $\mathrm{Y} = (y_{1}, y_{2}, \ldots, y_{T})$ . Here, $\mathrm{Y}$ is a pre-order traversal + +# Math Word Problem Sequence + +Store sold 360 kilograms of apples , 240 kilograms of pears . + +If a box of fruit weighs 24 kilograms , how many boxes of pears are less than apples ? + +![](images/7eb48e3e052b7802edc5f610d430803795f77afb69568f038c2217e62b26af70.jpg) +Dependency Tree from Stanford Parser + +![](images/20276f528952ce281342aef75cbfc1460102cf134bd52b6e96ea32c0c887c979.jpg) +Math Word Problem Graph +Figure 3: The procedure for construction of a edge-labeled graph is described here. For brevity, we omit some self-node edges and the labels of some neighbor edges and dependency edges. Given a math word problem, we first use the Stanford Corenlp toolkit to parse it into a dependency tree, and extract the relationships between nouns from the external knowledge bases. Based on these, we construct the edge-labeled graph, as shown in the bottom part of the figure (See Section 2.2 for more details). + +sequence of a math expression tree, which can be executed to generate the answer to problem X. + +Formally, math word problem X can be represented by a graph $\mathrm{G} = (\mathrm{V},\mathrm{E})$ , where $\mathrm{V}$ and $\mathrm{E}$ are the set of nodes $x_{i}$ and the set of edges $e_{ij}$ . Here, each node in the graph is associated with a word $x_{i}$ in the problem. $e_{ij}\in \mathbf{E}$ denotes that there is an edge between the node pair $(x_{i},x_{j})$ . $L(e_{ij})$ denotes the label of edge $e_{ij}$ (e.g., self-node, category, neighbor), see section 2.2 for more details. + +# 2.2 Edge-labeled Graph + +# 2.2.1 Graph Construction + +This section introduces how to construct an edge-labeled graph that contains both the local relations between nodes within a sentence and the long-range relations between nodes across sentences. Our model extracts these relations from the problem's dependency tree and external knowledge base. We use the Stanford Corenlp toolkit (Manning et al., 2014) to parse each math word problem into a dependency tree. The toolkit analyzes the grammatical structure of a sentence and establishes relationships between "head" words and words which modify those heads. In addition, inspired by Wu et al. (2020), we collected word + +category information from external knowledge bases. An illustrative example is shown in Figure 3. Specifically, given a math word problem X, its dependency tree, and word category information, our model constructs a graph according to the following steps. + +- Self node & Neighbor: We define each word $x_{i}$ in the problem X as a node. Each word node $x_{i}$ is connected to its adjacent word nodes $(x_{i - 1}, x_{i + 1})$ in the problem. These edges are labeled as "neighbor". Also, to incorporate the node's own information into the problem representations, we connect each node to itself and label the edge as "self node". +- Dependency (edges within sentences): The dependency tree is a structured representation that contains various grammatical relationships between word pairs. Following Zhang et al. (2020b), we prune the output dependency tree to remove unimportant components, that is, remove edges connected to conjunctions, prepositions or punctuation. Based on the dependency tree, we establish relationships between nodes within the sentence, and keep the edge labels (e.g., nmod, nummod, appos). For example, “360” + +![](images/4543bb62fdebdd638c1ab58faba68eb2116647bb48b07848eda0d8b791624da2.jpg) +(a) Edge-Enhanced Hierarchical Graph Encoder +Figure 4: Main structure of our proposed EEH-S2T model. In Section 2.2, we first introduce how to construct and initialize an edge-labeled graph for a math word word problem. The left side of this figure shows (a) an edge-enhanced hierarchical graph encoder that updates the graph nodes in two steps, namely sentence-level aggregation and problem-level aggregation (Section 2.3). The right side of this figure shows (b) a tree-structured decoder. The decoder uses a split attention mechanism to guide the decoder to pay attention to different parts of the entire input problem during generation (Section 2.4). + +and "kilograms" are connected by the edge "nummod" in Figure 3. + +# - Same & Category (edges across sentences): + +To further capture the connection across sentences, if the same word exists in two sentences and it is a noun, then we connect these two nodes and label the edge as "same". If two words belong to the same category in the external knowledge base, we also add a connection for their nodes and label the edge as "category". For example, "apples" and "pears" are connected by the edge "category" in Figure 3. + +# 2.2.2 Graph Initialization + +To initialize the node representations of the graph, we use a BiLSTM (Hochreiter and Schmidhuber, 1997) to encode the words in the math word problem $\mathrm{X} = (x_{1}, x_{2}, \ldots, x_{m})$ . Here, $\mathbf{H}^{0} = (\mathbf{h}_{1}^{0}, \mathbf{h}_{2}^{0}, \ldots, \mathbf{h}_{\mathbf{m}}^{0}) \in \mathbb{R}^{m*d}$ is the initial node representations of its graph $G$ , where $m$ is the number of nodes and $d$ is the dimension of the node representation. The representation $\mathbf{h}_{\mathbf{i}}^{0}$ of node $x_{i}$ is + +calculated as follows: + +$$ +\mathbf {h} _ {\mathbf {i}} ^ {\mathbf {0}} = \operatorname {B i L S T M} (\operatorname {E m b e d} (x _ {i}), \mathbf {h} _ {\mathbf {i} - \mathbf {1}} ^ {\mathbf {0}}), \quad (1) +$$ + +where $\operatorname{Embed}(\cdot)$ is an embedding layer. + +For each edge $e_{ij}$ , we initialize the edge representation $\mathbf{e}_{\mathbf{ij}}^0$ based on the edge embedding and its neighbor node representations $\mathbf{h}_{\mathbf{i}}^{0}, \mathbf{h}_{\mathbf{j}}^{0}$ : + +$$ +\mathbf {e} _ {\mathbf {i j}} ^ {\mathbf {0}} = \operatorname {W} _ {\mathrm {e}} [ \operatorname {E m b e d} \left(e _ {i j}\right): \mathbf {h} _ {\mathbf {i}} ^ {\mathbf {0}}: \mathbf {h} _ {\mathbf {j}} ^ {\mathbf {0}} ], \tag {2} +$$ + +where $\mathrm{W_e}$ is a weight matrix and [.:] is the concatenation operation. + +# 2.3 Edge-Enhanced Hierarchical Graph Encoder + +After initializing the graph, EEH-G2T uses an edge-enhanced hierarchical graph encoder to obtain the edge-aware problem representations. It hierarchically updates the nodes in two steps: sentence-level aggregation and problem-level aggregation. We divide math word problems into short sentences based on commas and periods. For example, the problem in Figure 1 has four sentences. + +Sentence-level Aggregation. + +To capture the local relations between words, EEH-G2T first recursively aggregate the node representation with its related nodes within the sentence. Let A denote the local relationship matrix, where $\mathrm{A_{ij} \in \{0,1\}}$ denotes whether there is an edge between $x_i$ and $x_j$ . Formally, $\mathrm{A_{ij} = 1}$ if $e_{ij} \in \mathbf{E}$ and $x_i, x_j$ in the same sentence, otherwise $\mathrm{A_{ij} = 0}$ . The initial node representations $\mathbf{H^0} = (\mathbf{h_1^0}, \mathbf{h_2^0}, \dots, \mathbf{h_m^0})$ are aggregated with a two-layer graph convolutional network (GCN) (Kipf and Welling, 2017). The aggregation functions are as follows: + +$$ +\mathbf {H} ^ {1} = \sigma (\mathrm {A} \mathbf {H} ^ {0} \mathrm {W} _ {\mathrm {g}}). \qquad (3) +$$ + +Here, $\mathrm{W_g}$ is a weight matrix and $\sigma$ is a relu activate function. After sentence-level aggregation, we obtain the node representations $\mathbf{H}^1 = (\mathbf{h}_1^1,\mathbf{h}_2^1,\dots ,\mathbf{h}_{\mathbf{m}}^1)$ . + +# Problem-level Aggregation. + +Then, EEH-G2T use an attentive problem-level aggregation to capture long-range dependencies across sentences. Inspired by GAT (Velicković et al., 2018), we use the multi-head attention in GAT with M independent attention mechanisms: + +$$ +\beta_ {i j} = \sigma (w _ {a} ^ {T} [ \mathrm {W _ {a} h _ {i} ^ {l}}: \mathrm {W _ {b} h _ {j} ^ {l}}: \mathrm {W _ {c} e _ {i j} ^ {0}} ]), +$$ + +$$ +\alpha_ {i j} = \frac {\exp \left(\beta_ {\mathrm {i j}}\right)}{\sum_ {e _ {i j} \in \mathrm {E}} \exp \left(\beta_ {\mathrm {i j}}\right)}, \tag {4} +$$ + +$$ +\mathbf{h_{i}} = \big||\sum_{1,\ldots ,\mathrm{M}}\alpha_{ij}\mathrm{W_{j}}\mathbf{h_{j}^{1}}. +$$ + +Here, $w_{a}^{T}, \mathrm{W}_{\mathrm{a}}, \mathrm{W}_{\mathrm{b}}, \mathrm{W}_{\mathrm{c}}, \mathrm{W}_{\mathrm{j}}$ are weight vector and matrices. $\sigma$ is a LeakyRelu activate function (Xu et al., 2015). $||$ is the concatenation operation. $\alpha_{ij}$ is the normalized attention weight of the node $x_{j}$ for node $x_{i}$ via the softmax function. After problem-level aggregation, we obtain the final problem representations $\mathbf{H} = (\mathbf{h}_1, \mathbf{h}_2, \dots, \mathbf{h}_{\mathbf{m}})$ . + +# 2.4 Tree-structured Decoder + +The structure of the decoder is similar to other state-of-the-art Seq2Tree models (Xie and Sun, 2019; Zhang et al., 2020b; Wu et al., 2020). The decoder is an attention-based Gated Recurrent Unit (GRU) (Chung et al., 2014) whose goal is to generate pre-order traversal of expression trees. The hidden state $\mathbf{s}_{\mathrm{t}}$ is updated as follows: + +$$ +\mathbf {s} _ {\mathbf {t} + \mathbf {1}} = \operatorname {B i L S T M} \left(\left[ \operatorname {E m b e d} \left(y _ {t}\right): \mathbf {c} _ {\mathbf {t}}: \mathbf {r} _ {\mathbf {t}} \right], \mathbf {s} _ {\mathbf {t}}\right). \tag {5} +$$ + +At time step 1, we use the last problem representations $\mathbf{h}_{\mathbf{m}}$ to initialize the decoder hidden state + +$s_1$ . Here, $\operatorname{Embed}(y_t)$ denotes the embedding of the last generated word $y_t$ ; $\mathbf{c_t}$ denotes the context state of the problem representations, and $\mathbf{r_t}$ denotes the context state of the currently generated expression. Split Attention Mechanism. + +Figure 4 shows the input of our proposed split attention mechanism, which is the final problem representations of the graph encoder. EEH-G2T first uses an attention mechanism to compute the overall attention vector $\hat{\alpha}$ on the problem representations. Then, EEH-G2T divides the input math word problem into K parts, conducts attention operations on each part, and obtains K split attention vectors $(\alpha^{1},\alpha^{2},\dots,\alpha^{K})$ . The size of each split attention vector is $\mathbb{R}^{(m / K)}$ . In Figure 1, when the decoder generates $y_{3} = 360$ , EEH-G2T notices that the word most relevant to the current decoder state is "360" in the first sentence. At the same time, EEH-G2T obtains crucial semantic clues from the other parts, that is, the problem asks how many pear boxes are less than the apple boxes. Based on K attention vectors, the problem context state $\mathbf{c}_{\mathbf{t}}$ is calculated as follows: + +$$ +\hat {\alpha} _ {t i} = \operatorname {s o f t m a x} \left(\mathrm {W} _ {\mathrm {s}} \left[ \mathbf {s} _ {\mathbf {t}}: \mathbf {r} _ {\mathbf {t}} \right] + \mathrm {W} _ {\mathrm {h}} \mathbf {h} _ {\mathbf {i}}\right), +$$ + +$$ +\alpha_ {t i} ^ {k} = \operatorname {s o f t m a x} _ {\substack {W _ {s} [ \mathbf {s} _ {t}: \mathbf {r} _ {t} ] + W _ {h} h _ {i + k} \frac {m}{K}}} (6) +$$ + +$$ +\mathbf {c _ {t}} = \sum_ {i = 1} ^ {m} \hat {\alpha} _ {t i} \mathbf {h _ {i}} + \sum_ {k = 1} ^ {K} \sum_ {i = 1} ^ {m / K} \alpha_ {t i} ^ {k} \mathbf {h _ {i + k}} _ {\mathbf {K}} ^ {\underline {{m}}}, +$$ + +where $\mathrm{W_s}$ , $\mathrm{W_h}$ are the weight matrices. $\alpha_{ti}^{k}$ denotes the attention distribution on the $k$ -th part of the problem representations at time step $t$ . + +# Expression Aggregation Mechanism. + +Following (Wu et al., 2020), we use a state aggregation mechanism to compute the expression context state $\mathbf{r}_{\mathrm{t}}$ : + +$$ +\mathbf {r} _ {\mathrm {t} + \mathbf {1}} = \sigma \left(\mathrm {W} _ {\mathrm {r}} \left[ \mathbf {r} _ {\mathrm {t}}: \mathbf {r} _ {\mathrm {t}, \mathbf {p}}: \mathbf {r} _ {\mathrm {t}, \mathbf {l}}: \mathbf {r} _ {\mathrm {t}, \mathbf {r}} \right]\right), \tag {7} +$$ + +$\sigma$ is a sigmoid function and $\mathrm{W_r}$ is a weight matrix. At time step 1, we use the decoder state $s_1$ to initialize expression context state $r_1$ . For each node in the currently generated expression tree, $\mathbf{r}_{\mathbf{t},\mathbf{p}}$ , $\mathbf{r}_{\mathbf{t},\mathbf{l}}$ and $\mathbf{r}_{\mathbf{t},\mathbf{r}}$ represent the expression context state of the parent node, left child node, and right child node of the current node. If the current node does not have parent or child node at this time step, we pad it with a PAD vector. + +Finally, we use a copying mechanism (Gulcehre et al., 2016) so that the model either generate a word from the vocabulary or copy a word from + +the input problem X. At time step t, based on the decoder state $\mathbf{s_t}$ , the problem context state $\mathbf{c_t}$ and the expression context state $\mathbf{r_t}$ , EEH-G2T calculates a copy gate value $g_{t} \in (0,1)$ to determine whether the word $y_{t}$ is generated or copied: + +$$ +\begin{array}{l} g _ {t} = \sigma \left(\mathrm {W} _ {\mathrm {s}} \mathbf {s} _ {\mathbf {t}} + \mathrm {W} _ {\mathrm {c}} \mathbf {c} _ {\mathbf {t}} + \mathrm {W} _ {\mathrm {r}} \mathbf {r} _ {\mathbf {t}}\right), \\ \mathbf {P} _ {\mathbf {c}} \left(y _ {t}\right) = \sum_ {y _ {t} = x _ {i}} \hat {\alpha} _ {t i}, \tag {8} \\ \end{array} +$$ + +$$ +\mathbf {P} _ {\mathbf {g}} \left(y _ {t}\right) = \operatorname {s o f t m a x} \left(\mathrm {W} _ {\mathbf {g}} \left[ \mathbf {s} _ {\mathbf {t}}: \mathbf {c} _ {\mathbf {t}}: \mathbf {r} _ {\mathbf {t}} \right]\right), +$$ + +$$ +\mathbf {P} (y _ {t} | y _ {< t}, \mathrm {X}) = g _ {t} \mathbf {P} _ {\mathbf {c}} (y _ {t}) + (1 - g _ {t}) \mathbf {P} _ {\mathbf {g}} (y _ {t}). +$$ + +$\mathrm{W_s}, \mathrm{W_c}, \mathrm{W_r}$ and $\mathrm{W_g}$ are weight matrices. $\hat{\alpha}_{ti}$ is the overall attention vector in the split attention mechanism. The probability distribution $\mathbf{P}(y_t | y_{3. We used 300-dimensional Glove word embeddings (Pennington et al., 2014). The hidden size is 512. The batch size is 64. The number of heads M in problem-level aggregation is 8. The number K of split attention vectors is 2. We set the learning rate of the Adam optimizer (Kingma and Ba, 2014) to 0.001, and the dropout is 0.5. + +During training, it took 120 epochs to train the model. During decoding, we used a beam search with a beam size of 5. We used the same parameter settings for both Math23K and MAWPS datasets. The hyper-parameters are tuned on the valid set. + +# 3.3 Baselines + +We compare the performance of our model with the following baselines: DNS (Wang et al., 2017) is a seq2seq model that consists of a two-layer GRU encoder and a two-layer LSTM decoder. MathEN (Wang et al., 2018) is a seq2seq model with a bidirectional LSTM encoder and an attention mechanism. Recu-RNN (Wang et al., 2019) uses recursive neural networks on the predicted tree structure templates. Tree-Dec (Liu et al., 2019) is a seq2tree model with a tree-structured decoder, which generates each node based on its parent and sibling node. GTS (Xie and Sun, 2019) is a seq2tree model that generates expression trees in a goal-driven manner. It generates each node based on its parent node and its left sibling subtree embedding. KA-S2T (Wu et al., 2020) is a graph-to-tree model with commonsense knowledge from the external knowledge base. It uses a state aggregation mechanism to recursively aggregate neighbors of each node in the expression tree. Graph2Tree (Zhang et al., 2020b) is a graph-to-tree model that leverages the nouns nearby the numbers to enrich the quantity representations in the problem. + +# 3.4 Results Analysis + +Table 1 summarizes the performance of our EEHG2T in comparison with other baselines. We + +
ModelsMAWPSMath23K
DNS59.5%58.1%
Math-EN69.2%66.7%
Recu-RNN66.8%66.9%
Tree-Dec-69.0%
GTS82.6%75.6%
KA-S2T-76.3%
Graph2Tree83.7%77.4%
EEH-G2T84.8%78.5%
+ +Table 1: Answer accuracy of EEH-G2T and other state-of- the-art models on the MAWPS and Math23K datasets. + +
ModelsMath23K
EEH-G2T (full model)78.5%
only sentence-level aggregation77.4%
only problem-level aggregation77.8%
remove graph structure76.5%
remove edge label information78.1%
remove split attention mechanism77.7%
+ +can observe that: 1) Two graph-to-tree model, KA-S2T and Graph2Tree, performed significantly better than the Seq2Tree model GTS, showing that the graph structure in the encoder is effective in enriching the problem representations. 2) Our proposed EEH-G2T outperformed all the other baselines, which proved the effectiveness of using an edge-enhanced hierarchical graph encoder and split attention mechanism. + +# 3.5 Ablation Study + +# Effect of Hierarchical Graph Encoder. + +As shown in Table 2, we estimate the effectiveness of the proposed hierarchical graph encoder. From the results, both sentence-level aggregation and problem-level aggregation improve the performance. Removing the sentence-level aggregation reduces answer accuracy by $1.1\%$ , and removing the problem-level aggregation reduces answer accuracy by $0.7\%$ . When we remove the both aggregation mechanisms and use the initial node representations as the final problem representations, the answer accuracy decreases by $2.0\%$ . We believe that the superior performance of the hierarchical graph encoder is because it captures both the local relations between words + +Table 2: Ablation analysis of edge-enhanced hierarchical graph encoder and split attention mechanism used in EEH-G2T. + +
ModelsMath23K
EEH-G2T (full model)78.5%
- self node64.2%
- neighbor node77.4%
- dependency76.9%
- category77.6%
- same word76.0%
+ +Table 3: Ablation analysis on reducing the edge categories used in EEH-G2T. + +
NumMath23K
K=077.7%
K=178.1%
K=278.5%
K=377.5%
K=476.2%
K=574.8%
+ +Table 4: The performance of EEH-G2T with different number of split vectors on the Math23K valid set. + +within a sentence and the long-range relations between words across sentences. + +# Effect of Edge Label Information and Split Attention Mechanism. + +To prove the effectiveness of edge label information and split attention mechanism in the proposed EEH-G2T, we conduct ablation experiments on the Math23K dataset as shown in Table 2. We observe a slight accuracy drop by $0.4\%$ after removing the edge label information, demonstrating that edge labels provide syntactic and semantic information to enrich the problem representations. Moreover, removing the split attention mechanism leads to a drop by $0.8\%$ , which verifies the effectiveness of using a split attention mechanism. + +# Effect of Different Edge Categories. + +Table 3 shows the performance when removing one edge category at a time. We can see that all the edge categories have positive effects on the model performance. The performance of the model without "self node" edges drops the most, because "self node" allows the model to keep the information of the node itself. Additionally, removing "category" and "neighbor node" edges will slightly reduce model performance. Without "dependency" and "same word" edges, model accuracy will drop to $76.9\%$ and $76.0\%$ . + +# Split Number in Split Attention Mechanism. + +To explore the impact of the number K of split vectors, we conduct the parameter experiment on + +![](images/6456f6281948a8e55b54518e833dd808b531415f4d1957f174ded1901d665a42.jpg) +Figure 5: Two examples of generated expressions by Graph2Tree (Zhang et al., 2020b) and EEH-G2T. + +the Math23K valid set by varying the split number K from 0 to 5. As shown in Table 4, when the number K increases from 0 to 2, noticeable improvements are remarked on answer accuracy. These result once again confirms the effectiveness of the split attention mechanism because it allows the model to pay attention to different parts of the input problem. The performance starts to drop since $\mathrm{K}\geq 3$ . This is probably because more splits means that the problem is split into more parts, so that the model can obtain more information. However, too many splits may break the problem into small fragments, leading to noise. We set the number K of split vectors to 2 in other experiments. + +# 3.6 Case Study + +Figure 5 lists two examples generated by Graph2Tree and our EEH-G2T model. In Problem 1, Graph2Tree missed the information that there are fewer science books than story books, and incorrectly generated “- $20\%$ (1/3)”. With split attention mechanism, EEH-G2T can better capture this information from the enature problem. In Problem 2, Graph2Tree incorrectly uses Ben's production speed to subtract Alan's production speed. With hierarchical graph encoder, EEH-G2T can build long-range relations across sentences and therefore generate correct results. + +# 4 Related Work + +Math Word Problem Solving: Solving math word problems has long been a very popular task and various methods have been proposed in the + +past few years (Ling et al., 2017; Wang et al., 2017, 2018). Previous methods usually treated the math word problem as a sequence, and use the same linear encoder to encode math word problems (Liu et al., 2019; Xie and Sun, 2019). Recently, many works that treat math word problems as graphs have shown better performance. Zhang et al. (2020b) connects each number in the problem with nearby nouns to enrich the problem representations. Wu et al. (2020) connects words that belong to the same category in the external knowledge base to capture common sense information. Li et al. (2020) construct an input graph from both the math problem and its corresponding dependency tree to incorporate structural information. However, these methods only capture the local neighbor information of nodes as additional features to enrich the problem representations and ignore the long-range relations across sentences. + +In this paper, we propose an edge-enhanced hierarchical graph encoder that captures both the local relations between words within a sentence and the long-range relations between words across sentences. To further guide the decoder to pay attention to different parts of the entire input problem, we propose a split attention mechanism. Graph Neural Networks: Many works on graph neural networks (GNNs) have been applied to a variety of tasks in recent years, such as node classification (Veličković et al., 2018; Klicpera et al., 2019), relation extraction (Zhang et al., 2018; Sahu et al., 2019), and code summarization (Zügner et al., 2021; Liu et al., 2021). Sahu et al. (2019) proposed a labeled edge graph convolutional neural network model on a document-level graph for inter-sentence relation extraction. (Cui et al., 2020) simultaneously exploits syntactic structure and typed dependency labels to improve neural event detection. Inspired by such works, we also leverage edge label information to enrich the problem representations. + +# 5 Conclusion + +In this study, we proposed a novel edge-enhanced hierarchical graph-to-tree model called EEH-G2T for the math word problem solving task. We used an edge-enhanced hierarchical graph encoder that updates the graph nodes in two steps, namely sentence-level aggregation and problem-level aggregation. Additionally, edge label information was incorporated into the model to enrich the + +problem representations. We proposed a split attention mechanism to guide the decoder to pay attention to different parts of the entire input problem during generation. Experimental results confirmed that the proposed model, EEH-G2T, outperformed other state-of-the-art models. + +# Acknowledgments + +The authors wish to thank the anonymous reviewers for their helpful comments. This work was partially funded by China National Key R&D Program (No. 2018YFB1005104), National Natural Science Foundation of China (No. 62076069, 61976056), Shanghai Municipal Science and Technology Major Project (No.2021SHZDZX0103). + +# References + +Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. 2014. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473. +Junyoung Chung, Caglar Gulcehre, Kyunghyun Cho, and Yoshua Bengio. 2014. Empirical evaluation of gated recurrent neural networks on sequence modeling. In NIPS 2014 Workshop on Deep Learning, December 2014. +Shiyao Cui, Bowen Yu, Tingwen Liu, Zhenyu Zhang, Xuebin Wang, and Jinqiao Shi. 2020. Edge-enhanced graph convolution networks for event detection with syntactic relation. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 2329-2339, Online. Association for Computational Linguistics. +Zhendong Dong, Qiang Dong, and Changling Hao. 2010. HowNet and its computation of meaning. In *Coling* 2010: Demonstrations, pages 53-56, Beijing, China. Coling 2010 Organizing Committee. +Caglar Gulcehre, Sungjin Ahn, Ramesh Nallapati, Bowen Zhou, and Yoshua Bengio. 2016. Pointing the unknown words. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 140-149, Berlin, Germany. Association for Computational Linguistics. +Sepp Hochreiter and Jürgen Schmidhuber. 1997. Long short-term memory. Neural computation, 9:1735-80. +Danqing Huang, Jin-Ge Yao, Chin-Yew Lin, Qingyu Zhou, and Jian Yin. 2018. Using intermediate representations to solve math word problems. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 419-428, Melbourne, Australia. Association for Computational Linguistics. + +Diederik P Kingma and Jimmy Ba. 2014. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980. +Thomas N Kipf and Max Welling. 2017. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations. +Johannes Klicpera, Stefan Wei $\beta$ enberger, and Stephan Gunnemann. 2019. Diffusion improves graph learning. In Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc. +Rik Koncel-Kedziorski, Subhro Roy, Aida Amini, Nate Kushman, and Hannaneh Hajishirzi. 2016. MAwPS: A math word problem repository. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1152-1157, San Diego, California. Association for Computational Linguistics. +Shucheng Li, Lingfei Wu, Shiwei Feng, Fangli Xu, Fengyuan Xu, and Sheng Zhong. 2020. Graph-to-tree neural networks for learning structured input-output translation with applications to semantic parsing and math word problem. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 2841-2852, Online. Association for Computational Linguistics. +Wang Ling, Dani Yogatama, Chris Dyer, and Phil Blunsom. 2017. Program induction by rationale generation: Learning to solve and explain algebraic word problems. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 158-167, Vancouver, Canada. Association for Computational Linguistics. +Qianying Liu, Wenyv Guan, Sujian Li, and Daisuke Kawahara. 2019. Tree-structured decoding for solving math word problems. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 2370-2379, Hong Kong, China. Association for Computational Linguistics. +Shangqing Liu, Yu Chen, Xiaofei Xie, Jing Kai Siow, and Yang Liu. 2021. Retrieval-augmented generation for code summarization via hybrid {gnn}. In International Conference on Learning Representations. +Christopher D. Manning, Mihai Surdeanu, John Bauer, Jenny Finkel, Steven J. Bethard, and David McClosky. 2014. The Stanford CoreNLP natural language processing toolkit. In Association for Computational Linguistics (ACL) System Demonstrations, pages 55-60. +Jiaju Mei. 1985. Tongyi ci cilin. Shangai cishu chubanshe. + +Jeffrey Pennington, Richard Socher, and Christopher Manning. 2014. GloVe: Global vectors for word representation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1532-1543, Doha, Qatar. Association for Computational Linguistics. +Sunil Kumar Sahu, Fenia Christopoulou, Makoto Miwa, and Sophia Ananiadou. 2019. Intersentence relation extraction with document-level graph convolutional neural network. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4309-4316, Florence, Italy. Association for Computational Linguistics. +Petar Velicković, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. 2018. Graph attention networks. In International Conference on Learning Representations. +Lei Wang, Yan Wang, Deng Cai, Dongxiang Zhang, and Xiaojiang Liu. 2018. Translating a math word problem to a expression tree. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1064-1069, Brussels, Belgium. Association for Computational Linguistics. +Lei Wang, Dongxiang Zhang, Jipeng Zhang, Xing Xu, Lianli Gao, Bing Tian Dai, and Heng Shen. 2019. Template-based math word problem solvers with recursive neural networks. Proceedings of the AAAI Conference on Artificial Intelligence, 33:7144-7151. +Yan Wang, Xiaojiang Liu, and Shuming Shi. 2017. Deep neural solver for math word problems. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 845-854, Copenhagen, Denmark. Association for Computational Linguistics. +Qinzhuo Wu, Qi Zhang, Jinlan Fu, and Xuanjing Huang. 2020. A knowledge-aware sequence-to-tree network for math word problem solving. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 7137-7146, Online. Association for Computational Linguistics. +Zhipeng Xie and Shichao Sun. 2019. A goal-driven tree-structured neural model for math word problems. In Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence, IJCAI-19, pages 5299-5305. International Joint Conferences on Artificial Intelligence Organization. +Bing Xu, Naiyan Wang, Tianqi Chen, and Mu Li. 2015. Empirical evaluation of rectified activations in convolutional network. arXiv preprint arXiv:1505.00853. +Jipeng Zhang, Roy Ka-Wei Lee, Ee-Peng Lim, Wei Qin, Lei Wang, Jie Shao, and Qianru Sun. 2020a. + +Teacher-student networks with multiple decoders for solving math word problem. In Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence, IJCAI-20, pages 4011-4017. International Joint Conferences on Artificial Intelligence Organization. Main track. +Jipeng Zhang, Lei Wang, Roy Ka-Wei Lee, Yi Bin, Yan Wang, Jie Shao, and Ee-Peng Lim. 2020b. Graph-to-tree learning for solving math word problems. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 3928-3937, Online. Association for Computational Linguistics. +Yuhao Zhang, Peng Qi, and Christopher D. Manning, 2018. Graph convolution over pruned dependency trees improves relation extraction. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2205-2215, Brussels, Belgium. Association for Computational Linguistics. +Daniel Zügner, Tobias Kirschstein, Michele Catasta, Jure Leskovec, and Stephan Gunnemann. 2021. Language-agnostic representation learning of source code from structure and context. In International Conference on Learning Representations. \ No newline at end of file diff --git a/anedgeenhancedhierarchicalgraphtotreenetworkformathwordproblemsolving/images.zip b/anedgeenhancedhierarchicalgraphtotreenetworkformathwordproblemsolving/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d087361f9ee19d88135ba6b849348f83df6412f2 --- /dev/null +++ b/anedgeenhancedhierarchicalgraphtotreenetworkformathwordproblemsolving/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:642e3eb041ea75358889ba1afd2a343965abcc609027387d88839da19c6039e3 +size 535687 diff --git a/anedgeenhancedhierarchicalgraphtotreenetworkformathwordproblemsolving/layout.json b/anedgeenhancedhierarchicalgraphtotreenetworkformathwordproblemsolving/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a79ed409516c894b14d30c6133a9c052953c547b --- /dev/null +++ b/anedgeenhancedhierarchicalgraphtotreenetworkformathwordproblemsolving/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ec2d368a52646be8c3ba5992f5d014efbf0d9892e81caa9ba745e9b100d1d37 +size 371300 diff --git a/aneuralgraphbasedlocalcoherencemodel/3cd3a1c2-d951-4532-b7ac-2b76a936adc7_content_list.json b/aneuralgraphbasedlocalcoherencemodel/3cd3a1c2-d951-4532-b7ac-2b76a936adc7_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..260e6a57b1d8c6523d79c364e78774a5171228ac --- /dev/null +++ b/aneuralgraphbasedlocalcoherencemodel/3cd3a1c2-d951-4532-b7ac-2b76a936adc7_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9bc06c88d3aa77370d5f57016a260d6a15cc039333094c3fc076ece232fd6c39 +size 42067 diff --git a/aneuralgraphbasedlocalcoherencemodel/3cd3a1c2-d951-4532-b7ac-2b76a936adc7_model.json b/aneuralgraphbasedlocalcoherencemodel/3cd3a1c2-d951-4532-b7ac-2b76a936adc7_model.json new file mode 100644 index 0000000000000000000000000000000000000000..460de0bb4bbc7bafdf5faa630375170584ba452e --- /dev/null +++ b/aneuralgraphbasedlocalcoherencemodel/3cd3a1c2-d951-4532-b7ac-2b76a936adc7_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8161ac8ed7bf81bc582f2e0d9ad4a361c94014090e220636d990dc324144e01 +size 50404 diff --git a/aneuralgraphbasedlocalcoherencemodel/3cd3a1c2-d951-4532-b7ac-2b76a936adc7_origin.pdf b/aneuralgraphbasedlocalcoherencemodel/3cd3a1c2-d951-4532-b7ac-2b76a936adc7_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..be1c5155be6907ae66e904495ebbed7305c710cb --- /dev/null +++ b/aneuralgraphbasedlocalcoherencemodel/3cd3a1c2-d951-4532-b7ac-2b76a936adc7_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:804352c06cc5a005e9dc255b50a643beba9b3a9ef189a99584f17b920cd0cbd0 +size 349456 diff --git a/aneuralgraphbasedlocalcoherencemodel/full.md b/aneuralgraphbasedlocalcoherencemodel/full.md new file mode 100644 index 0000000000000000000000000000000000000000..72bda7dbee51ab6cefcdab8dd2fd690547ba0062 --- /dev/null +++ b/aneuralgraphbasedlocalcoherencemodel/full.md @@ -0,0 +1,178 @@ +# A Neural Graph-based Local Coherence Model + +Mohsen Mesgar and Leonardo F. R. Ribeiro and Iryna Gurevych + +Ubiquitous Knowledge Processing Lab (UKP Lab) + +Department of Computer Science + +Technical University of Darmstadt + +www.ukp.tu-darmstadt.de + +# Abstract + +Entity grids and entity graphs are two frameworks for modeling local coherence. These frameworks represent entity relations between sentences and then extract features from such representations to encode coherence. The benefits of convolutional neural models for extracting informative features from entity grids have been recently studied. In this work, we study the benefits of Relational Graph Convolutional Networks (RGCN) to encode entity graphs for measuring local coherence. We evaluate our neural graph-based model for two benchmark coherence evaluation tasks: sentence ordering (SO) and summary coherence rating (SCR). The results show that our neural graph-based model consistently outperforms the neural grid-based model for both tasks. Our model performs competitively with a strong baseline coherence model, while our model uses $50\%$ fewer parameters. Our work defines a new, efficient, and effective baseline for local coherence modeling1. + +# 1 Introduction + +Local coherence is a discourse property that distinguishes a high-quality text from a random sequence of sentences. Modeling local coherence is crucial for various downstream NLP applications, e.g., summary evaluation and generation (Barzilay and Lapata, 2008; Parveen et al., 2016), readability assessment (Barzilay and Lapata, 2008; Mesgar and Strube, 2014), essay scoring (Burstein et al., 2010; Mesgar and Strube, 2016), dialogue evaluation and generation (Mesgar et al., 2020, 2021), and machine translation (Born et al., 2017; Kuang et al., 2018). + +Motivated by the Centering theory (Joshi and Weinstein, 1981), many approaches to local coherence modeling rely on entity relations between sentences. The entity grid (Barzilay and Lapata, 2005, + +2008) and the entity graph (Guinaudeau and Strube, 2013) are two well-studied frameworks for representing entity relations in a text. Entity grid-based models use grids while entity graph-based models use graphs to capture entity relations between sentences. Several methods have been proposed to enrich these representations and also to extract features from these representations to model local coherence. Recent work shows the effectiveness of convolutional neural networks (CNNs) for extracting features from entity grids to encode coherence (Tien Nguyen and Joty, 2017; Joty et al., 2018). Pre-trained transformer-based encoders can also capture relations between tokens in a text (Devlin et al., 2019). However, these encoders are potentially incapable of capturing long-distance relations (Martins et al., 2021), specifically where the text length is greater than the maximum input length in these encoders. + +In this work, we revisit graph-based coherence assessment by introducing a neural graph-based coherence model. To do so, we represent a text via a graph (Figure 1) since a graph can capture long-distance relations in a text. Such a graph contains two types of edges: (1) Edges that capture entity-based relations between sentences, and (2) edges that capture the linear order of sentences in the text. To encode such graphs, we adapt Relational Graph Convolutional Networks (RGCNs) (Schlichtkrull et al., 2018). RGCNs encode nodes of a graph into vectors using the graph's connectivity structure and any feature information captured in the graph, such as edge types. We then apply a self-attention layer to these node vectors to capture to what extent each sentence of the text is crucial for estimating the coherence of the entire text. We finally use an output layer to transform the outputs of the self-attention layer to a score, which estimates the coherence degree of the text. Figure 2 depicts an overview of our model. + +We evaluate our model for two benchmark co + +$s_1$ : LDI Crop., Cleveland, said it will offer $50 million in commercial paper backed by lease- rental receivables. + +$s_2$ : The program matches funds raised from the sale of the commercial paper with small to medium-sized leases. + +s3: LDI leases and sells data-processing telecommunications and other high-tech equipment. + +s4: LDI termed the paper 'non-resource financing', meaning that investors would be repaid from the lease receivables, rather than directly by LDI Corp. + +(a) + +![](images/02f42e2e1c60f4b85c0cb54514cfc91ae75add7c9c8bfc5d7eeac2d5e524ca04.jpg) +Figure 1: A sample text in which entity mentions shown by bold (a), and its corresponding graph (b). + +![](images/5a97d3cc5f88daa2e9306321c877af7692d99fd9e64f9bd56288c03571e00067.jpg) +Figure 2: An overview of our coherence model. + +hence evaluation tasks: (1) Sentence Ordering (SO) on the Wall Street Journal (WSJ) corpus, and (2) Summary Coherence Rating (SCR) on the Document Understanding Conference (DUC 2003) corpus. The results of our experiments confirm that our model consistently outperforms the neural grid-based coherence models (Tien Nguyen and Joty, 2017; Joty et al., 2018) by about $3.10\%$ for SO and $1.2\%$ for SCR. Our model performs on par with a recent coherence model (Moon et al., 2019), while our model uses $50\%$ fewer parameters. + +# 2 Method + +# 2.1 Graph Representations + +For a text as a sequence of sentences $T = (s_1, \ldots, s_n)$ , we construct a graph $\mathcal{G} = (\mathcal{V}, \mathcal{E}, \mathcal{R})$ in which $\mathcal{V}$ is the set of nodes, $\mathcal{E}$ is the set of edges, and $\mathcal{R}$ denotes the label set for edges (Figure 1). Each node $v_i \in \mathcal{V}$ is corresponded with a sentence $s_i$ in the text $T$ . We connect the nodes in a graph by two types of edges: (1) Edges with "adj" labels which connect nodes associated with any two adjacent sentences in the text to capture their linear order; and (2) Edges with "ent" labels which capture entity relations between sentences. We add an entity edge between nodes $v_i$ and $v_j$ if sentence $s_i$ precedes sentence + +$s_j$ and these sentences contain co-referring entity mentions. Edge directions capture the order of sentences. We use boldface notations for variables that refer to vectors or matrices. + +# 2.2 Neural Graph-based Model + +Our model consists of three layers (Figure 2): an RGCN, a self-attention, and an output layer. + +RGCN As nodes in a graph represent sentences in a text, we first map sentences to vectors in an embedding space. Given sentence $s = (t_1, \dots, t_{|s|})$ with $|s|$ tokens, we first map each token $t$ to its corresponding embeddings $t$ . We then apply BiLSTM to embeddings of tokens to condition each token representation on the representations of its neighboring tokens in the sentence. : + +$$ +\overrightarrow {\boldsymbol {H}}, \overleftarrow {\boldsymbol {H}} = \operatorname {B i L S T M} \left(\left[ \boldsymbol {t} _ {1}, \boldsymbol {t} _ {2}, \dots , \boldsymbol {t} _ {| \boldsymbol {s} |} \right]\right). \tag {1} +$$ + +The reason that we use BiLSTM (instead of transformer-based encoders like BERT) is that we aim to keep our model's size in terms of the number of parameters efficient. We concatenate the output vectors associated with the last tokens in the left-to-right $(\overrightarrow{H})$ and right-to-left $(\overleftarrow{H})$ LSTM directions to obtain the sentence vector $s = [\overrightarrow{H}_{|s|};\overleftarrow{H}_{|s|}]$ , where “;” is the concatenation function. + +We adapt an RGCN layer to take these sentence vectors and enrich them with the graph structure of the text as well as edge types as follows: + +$$ +\boldsymbol {v} _ {i} = \sigma \left(\sum_ {r \in \mathcal {R}} \sum_ {j \in \mathcal {N} _ {r} (v _ {i})} \frac {1}{| \mathcal {N} _ {r} (v _ {i}) |} \boldsymbol {s} _ {j} \boldsymbol {W} _ {r}\right), \tag {2} +$$ + +where $\mathbf{W}_r\in \mathbb{R}^{d\times d}$ encodes the label $r\in \mathcal{R}$ between node $v_{j}$ and $v_{i}$ . The set $\mathcal{N}_r(v_i)$ contains the nodes connected to $v_{i}$ by edges with label $r$ . + +Self-attention We use a multi-head self-attention (Vaswani et al., 2017) layer to estimate to what extent each sentence contributes to the coherence representation of a text. Each + +attention head computes a representation $\mathbf{z}_i$ of node vector $\mathbf{v}_i$ as follows: + +$$ +\boldsymbol {z} _ {\boldsymbol {i}} = \sum_ {j = 1} ^ {n} \alpha_ {i j} \left(\boldsymbol {v} _ {\boldsymbol {j}} \boldsymbol {W} _ {\boldsymbol {a}}\right), \tag {3} +$$ + +where $W_{a}\in \mathbb{R}^{d\times d}$ is learning parameters. We define attention weights $\alpha_{ij}$ as follows: + +$$ +\begin{array}{l} \alpha_ {i j} = \frac {\exp (e _ {i j})}{\sum_ {k = 1} ^ {n} \exp (e _ {i k})}, \\ e _ {i j} = \frac {\left(\mathbf {W} _ {q} \mathbf {v} _ {i}\right) ^ {\top} \left(\mathbf {W} _ {k} \mathbf {v} _ {j}\right)}{d _ {s}}, \\ \end{array} +$$ + +where $e_{ij}$ is the attention function, and $\mathbf{W}_q,\mathbf{W}_k\in$ $\mathbb{R}^{d\times d}$ are its parameters. $d_{s}$ is the dimension of the input vectors. $K$ independent attention heads are concatenated and linearly transformed to obtain final node representations, $\pmb {v}_i = [z_i^{(1)};\dots;z_i^{(K)}]W_c$ + +Output layer We then apply a mean pooling to the output vectors of the attention layer to obtain a vector representing the coherence of the entire text. We map this vector to a score as follows: + +$$ +c = \left(\frac {1}{n} \sum_ {i = 1} ^ {n} \boldsymbol {v} _ {\boldsymbol {i}}\right) \boldsymbol {w} _ {\boldsymbol {o}} + b _ {o}, \tag {4} +$$ + +where $\boldsymbol{w}_o \in \mathbb{R}^d$ and $b_{o} \in \mathbb{R}$ are trainable parameters of the output layer. The output of the model $c$ estimates the coherence degree of the entire text $T$ . + +# 2.3 Training and Evaluation + +We train our model in a ranking scenario (Joty et al., 2018). Given $T^{+}$ as a text with a coherence degree higher than that of text $T^{-}$ , we update parameters of our model with respect to the following loss function $\mathcal{L}(\Theta) = \max \{0, \tau - c^{+} + c^{-}\}$ , where $c^{+}$ and $c^{-}$ are the coherence degrees our model estimates for text $T^{+}$ and text $T^{-}$ , respectively. $\tau$ is the margin, $\Theta$ indicates all trainable parameters in our model. During training, our model shares all the layers to obtain $c^{+}$ and $c^{-}$ . Once the model is trained for a task, we use it to score any text independently during evaluation for that task. + +# 3 Experiments + +We evaluate our model for two benchmark tasks for coherence modeling: sentence ordering (SO) and summary coherence rating (SCR). In SO, a text is compared with random permutations of its sentences (Barzilay and Lapata, 2008). A coherence + +
# Texts# PairsAvg. # Sent.
Train12402374422.49
Dev138267818.85
Test10532041121.74
+ +Table 1: Data splits used for sentence ordering. + +model should ideally rank a text higher than its permutations concerning coherence. In SCR, we deal with ranking summary texts, where each summary text comes with a coherence rating assigned by human judges (Barzilay and Lapata, 2008). Given a pair of summary texts with different coherence ratings, a coherence model is expected to rank them properly with respect to their coherence ratings. + +Datasets For SO, we follow prior work (Moon et al., 2019; Joty et al., 2018; Tien Nguyen and Joty, 2017) and use the Wall Street Journal (WSJ) English news corpus. We use the same data splits and text permutations as used by Moon et al. (2019). Sections 00-13 of WSJ are used for training and sections 14-24 for testing (Table 1). We randomly select $10\%$ of texts from the training set for development purposes. We compare any of these texts with 20 permutations. + +For SCR, we use the dataset proposed by Barzilay and Lapata (2008) and used by prior work for coherence evaluation (Guinaudeau and Strube, 2013; Tien Nguyen and Joty, 2017). The dataset comprises texts from the DUC-2003 corpus, which contains English summaries produced by human experts and extractive summarization systems. Seven human annotators judged the summaries in a seven-point scale to rate how coherent the summaries were without having seen the source texts. For any summary in this dataset, the average of seven ratings, each assigned by a human judge, is taken as the coherence rating of the summary. Each data point in this dataset is a pair consisting of two summaries of the same text, where the rating of one of the summaries is higher than the rating of the other one. The training set contains 144 pairs, among which 14 pairs are used for development. The test set contains 80 pairs. + +Settings We compare our model (Section 2) with the following coherence models: EntGraph (Guinaudeau and Strube, 2013), Neural EntGrid (Tien Nguyen and Joty, 2017), Lex. Neural EntGrid (Joty et al., 2018), and Moon et al. (2019). We use the source code of the model proposed by Moon et al. (2019) to reproduce their + +
ModelSOSCR
EntGraph80.0080.0
Neural EntGrid85.9386.3
Lex. Neural EntGrid88.51-
Moon et al. (2019)90.6975.0
Ours92.4187.5
+ +Table 2: Results in accuracy $(\%)$ for sentence ordering (SO) and summary coherence rating (SCR). + +results on our machines. For others, we report the results from their papers. We use word2vec (Mikolov et al., 2013) as word embeddings since we aim to compare with Lex. Neural EntGrid in identical settings. Additionally, it keeps the number of parameters in our model low. We leave the study about the impact of different embeddings on the performance of our model for future work. We construct our graphs using the grids identical with those used by Neural EntGrid where all nouns are taken as entity mentions, and the string match approach is used to detect coreferent mentions. The batch sizes for training and evaluation is 5, $\tau$ is set to 5, and we train our model up to 5 epochs. The sizes of the word vectors, the BiLSTM and the RGCN layer are 300, 256 and 512, respectively. We optimize the parameters by Adam with a learning rate 0.0001 and L2 regularization. We use only one RGCN layer and one head for our attention. At each epoch we evaluate the model on the validation set. We use the model with the best scores on the validation set for evaluations on the test set. We run all experiments on a V100 GPU where each run of our model takes on average about 5 hours. We use accuracy as the evaluation metric, which corresponds to the number of correct rankings divided by the number of comparisons. + +# 4 Results and Discussion + +Table 2 shows the accuracy of the examined models for the SO and SCR tasks. Overall, our neural graph-based coherence model outperforms the examined baseline coherence models for both tasks. + +Our model performs substantially better than EntGraph. Similar to EntGraph, we use graphs to represent relations between sentences. However, EntGraph relies on merely entity-based relations to construct graphs and uses a heuristically-defined feature (i.e., the average outdegree of nodes in a graph) to estimate the text coherence. Our model + +performs better because our graphs contain edges for capturing linear order of sentences as well as entity-based relations. Moreover, our model adapts RGCN to extract features for estimating coherence. + +Our model also outperforms the examined entity grid-based models. The Neural EntGrid and Lex. Neural EntGrid models represent entity relations in text by entity grids and then apply CNNs to these grids to extract features for modeling the text coherence. Differently, our model uses graphs to represent relations between sentences and applies RGCN to learn features from graphs. + +Our model slightly outperforms the model proposed by Moon et al. (2019). We note that the best results for M&M are 92.93 for SO and 83.8 for SCR, achieved with ELMo as word embeddings. We compare with their Word2Vec setting to study the influence of our models, not word embeddings. Moon et al. (2019)'s model uses no explicit representations of text structure (neither graphs nor grids). It captures linear relations between adjacent sentences using a neural bilinear layer, and their relations with a global representation of a text using a CNN-based module. This model is trained by a language model loss together with a ranking loss specifically designed for SO. Our model achieves scores similar to those of (Moon et al., 2019)'s model, while our model is simpler and smaller. We compare the number of our model's parameters with that of the (Moon et al., 2019)'s model for SO. For a fair comparison, we use identical settings for encoding sentences in both models. The number of our model's parameters $(\approx 5.0\mathrm{M})$ is almost half of that in the (Moon et al., 2019)'s model $(\approx 9.5\mathrm{M})$ , indicating that our model compete with this model while using $50\%$ fewer number of parameters. + +Note that the Neural EntGrid's score for SCR is its best performing results, where the model is first pretrained for SO and then fine-tuned on the training set of the SCR's dataset. Our model outperforms the Neural EntGrid model while our model is trained for SCR from scratch, i.e., without pretraining. It is worth noting that the size of the test split used for SCR is small (80 text pairs). The improvements achieved by our model translates into the fact that our model makes 10 and 6 out of 80 correct rankings more than what Neural EntGrid and the (Moon et al., 2019)'s model make, respectively. However, such improvements on the SCR's dataset are important as texts in this dataset are associated with human-provided coherence ratings. + +
ModelSOSCR
Ours92.4187.5
Ours w/o ent.91.8985.0
Ours w/o adj.90.0587.5
+ +Table 3: The impact of different edge types. + +Table 3 depicts the accuracy of our model when different edge sets are used to construct graphs. "Ours w/o ent." shows our model trained on graphs with only adjacent edges. "Ours w/o adj." shows our model trained on graphs with only entity edges. We observe that edges with "adj" labels are more predictive signals than entity-based edges for SO. This observation intuitively makes sense as perturbations may change the order of only adjacent sentences. For SCR, entity-based relations are more predictive. Summary texts are supposed to express information about entities from source documents in a few sentences. Interestingly, by removing edges with "adj" labels, the performance of our model does not decrease for SCR. In sum, our model performs its best for both tasks when both edge types are used to construct graphs. + +# 5 Conclusions + +We introduced a neural graph-based model for local coherence assessment. We construct a graph of relations among sentences in a text using entity-based and linear relations between sentences. We apply relational graph convolutional networks to such graphs to extract features encoding coherence. Our model outperforms its counterparts for sentence ordering and summary coherence rating. The high performance of current coherence models on tasks with synthetic data possibly being not representative of real-life performance (Mohiuddin et al.). So, we aim to further study the performance of our model for tasks with natural data. + +# Acknowledgements + +This work has been supported by the DFG-funded research training group "Adaptive Preparation of Information form Heterogeneous Sources" (AIPHES, GRK 1994/1) and the German Research Foundation through the German-Israeli Project Cooperation (DIP, grant DA 1600/1-1 and grant GU 798/17-1). We thank anonymous reviewers for their constructive suggestions. + +# References + +Regina Barzilay and Mirella Lapata. 2005. Modeling local coherence: An entity-based approach. In Proceedings of the 43rd Annual Meeting of the Association for Computational Linguistics, Ann Arbor, Mich., 25-30 June 2005, pages 141-148. +Regina Barzilay and Mirella Lapata. 2008. Modeling local coherence: An entity-based approach. Computational Linguistics, 34(1):1-34. +Leo Born, Mohsen Mesgar, and Michael Strube. 2017. Using a graph-based coherence model in document-level machine translation. In Proceedings of the Third Workshop on Discourse in Machine Translation, Copenhagen, Denmark, 8 September, 2017, pages 26-35. +Jill Burstein, Joel Tetreault, and Slava Andreyev. 2010. Using entity-based features to model coherence in student essays. In Proceedings of Human Language Technologies 2010: The Conference of the North American Chapter of the Association for Computational Linguistics, Los Angeles, Cal., 2-4 June 2010, pages 681-684. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 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, Volume 1 (Long and Short Papers), Minneapolis, Minnesota, 2-7 June 2019, pages 4171-4186. +Camille Guinaudeau and Michael Strube. 2013. Graph-based local coherence modeling. In Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), Sofia, Bulgaria, 4-9 August 2013, pages 93-103. +Aravind K. Joshi and Scott Weinstein. 1981. Control of inference: Role of some aspects of discourse structure - centering. In Proceedings of the 7th International Joint Conference on Artificial Intelligence, Vancouver, B.C., Canada, 24-28 August 1981, pages 385-387. +Shafiq Joty, Muhammad Tasnim Mohiuddin, and Dat Tien Nguyen. 2018. Coherence modeling of asynchronous conversations: A neural entity grid approach. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), Melbourne, Australia, 15-20 July 2018, pages 558-568. +Shaohui Kuang, Deyi Xiong, Weihua Luo, and Guodong Zhou. 2018. Modeling coherence for neural machine translation with dynamic and topic caches. In Proceedings of the 27th International Conference on Computational Linguistics, Santa Fe, New Mexico, USA, 20-26 August 2018, pages 596-606. + +Pedro Henrique Martins, Zita Marinho, and Andre F. T. Martins. 2021. $\infty$ -former: Infinite memory transformer. arXiv:2109.00301. +Mohsen Mesgar, Sebastian Bucker, and Iryna Gurevych. 2020. Dialogue coherence assessment without explicit dialogue act labels. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), Online, 5-10 July, 2020, pages 1439-1450. +Mohsen Mesgar, Edwin Simpson, and Iryna Gurevych. 2021. Improving factual consistency between a response and persona facts. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, Online, 19-23 April 2021, pages 549-562. +Mohsen Mesgar and Michael Strube. 2014. Normalized entity graph for computing local coherence. In Proceedings of TextGraphs-9: Graph-based Methods for Natural Language Processing, Workshop at EMNLP 2014, Doha, Qatar, 29 October 2014, pages 1-5. +Mohsen Mesgar and Michael Strube. 2016. Lexical coherence graph modeling using word embeddings. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, San Diego, Cal., 12-17 June 2016, pages 1414-1423. +Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. 2013. Efficient estimation of word representations in vector space. In Proceedings of the ICLR 2013 Workshop Track. +Tasnim Mohiuddin, Prathyusha Jwalapuram, Xiang Lin, and Shafiq Joty. Rethinking coherence modeling: Synthetic vs. downstream tasks. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, Online, 19-23 April 2021, pages 3528-3539. +Han Cheol Moon, Tasnim Mohiuddin, Shafiq Joty, and Chi Xu. 2019. A unified neural coherence model. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, Hong Kong, China, 3-7 November 2019, pages 2262-2272. +Daraksha Parveen, Mohsen Mesgar, and Michael Strube. 2016. Generating coherent summaries of scientific articles using coherence patterns. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, Austin, Tex., 1-5 November 2016, pages 772-783. +Michael S. Schlichtkrull, Thomas N. Kipf, Peter Bloem, Rianne van den Berg, Ivan Titov, and Max Welling. 2018. Modeling relational data with graph convolutional networks. In Proceedings of the Semantic Web - 15th International Conference, ESWC + +2018, Crete, Greece, 3-7 June, 2018, pages 593-607. +Dat Tien Nguyen and Shafiq Joty. 2017. A neural local coherence model. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), Vancouver, Canada, 30 July-4 August 2017, pages 1320-1330. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA., USA, 4-9 December 2017, pages 6000-6010. \ No newline at end of file diff --git a/aneuralgraphbasedlocalcoherencemodel/images.zip b/aneuralgraphbasedlocalcoherencemodel/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..5d92aa42f45b17498ea5fea1ed36ab37d3562838 --- /dev/null +++ b/aneuralgraphbasedlocalcoherencemodel/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c73f0504dc3907558de1c97dbcf50e3873599a3ff7d3ede6641ced02d3d558c7 +size 100337 diff --git a/aneuralgraphbasedlocalcoherencemodel/layout.json b/aneuralgraphbasedlocalcoherencemodel/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..1f31ce992e732358dfcf6b0b56c030bfce31df28 --- /dev/null +++ b/aneuralgraphbasedlocalcoherencemodel/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae86f1485b146c37d7eac89c53015156688c32f02aef854b33bf877ed450b979 +size 209798 diff --git a/anexplicitjointandsupervisedcontrastivelearningframeworkforfewshotintentclassificationandslotfilling/7baef748-cfad-4463-81bd-16bebaaa81b5_content_list.json b/anexplicitjointandsupervisedcontrastivelearningframeworkforfewshotintentclassificationandslotfilling/7baef748-cfad-4463-81bd-16bebaaa81b5_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..f30adac95dfdd8be4a071a45e16173badcc89eab --- /dev/null +++ b/anexplicitjointandsupervisedcontrastivelearningframeworkforfewshotintentclassificationandslotfilling/7baef748-cfad-4463-81bd-16bebaaa81b5_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:09549507a12aff3e9b1ea3599d68dbe8f7c4b8d9b5dd4118b26cb302db276365 +size 84389 diff --git a/anexplicitjointandsupervisedcontrastivelearningframeworkforfewshotintentclassificationandslotfilling/7baef748-cfad-4463-81bd-16bebaaa81b5_model.json b/anexplicitjointandsupervisedcontrastivelearningframeworkforfewshotintentclassificationandslotfilling/7baef748-cfad-4463-81bd-16bebaaa81b5_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e7c9be0f132a26acae9accdb36f2fca40d98c1cb --- /dev/null +++ b/anexplicitjointandsupervisedcontrastivelearningframeworkforfewshotintentclassificationandslotfilling/7baef748-cfad-4463-81bd-16bebaaa81b5_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb8a2e8c93e6717c088ec5ce0e541c0b9600877123d21b93e4fe4c2d2bb1086d +size 100858 diff --git a/anexplicitjointandsupervisedcontrastivelearningframeworkforfewshotintentclassificationandslotfilling/7baef748-cfad-4463-81bd-16bebaaa81b5_origin.pdf b/anexplicitjointandsupervisedcontrastivelearningframeworkforfewshotintentclassificationandslotfilling/7baef748-cfad-4463-81bd-16bebaaa81b5_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a8be8fdf98b0b77b7b7aaf127a3e5c0c8de6b8d8 --- /dev/null +++ b/anexplicitjointandsupervisedcontrastivelearningframeworkforfewshotintentclassificationandslotfilling/7baef748-cfad-4463-81bd-16bebaaa81b5_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ead83be85b31d9f5d385dbd56e6e719d95e26a86f7731064f24a41fcd74e5979 +size 1385056 diff --git a/anexplicitjointandsupervisedcontrastivelearningframeworkforfewshotintentclassificationandslotfilling/full.md b/anexplicitjointandsupervisedcontrastivelearningframeworkforfewshotintentclassificationandslotfilling/full.md new file mode 100644 index 0000000000000000000000000000000000000000..6f8cd7e062d9d907793b91774e7fa58b3a5c57cd --- /dev/null +++ b/anexplicitjointandsupervisedcontrastivelearningframeworkforfewshotintentclassificationandslotfilling/full.md @@ -0,0 +1,346 @@ +# An Explicit-Joint and Supervised-Contrastive Learning Framework for Few-Shot Intent Classification and Slot Filling + +Han Liu $^{1,2}$ Feng Zhang $^{1,2,3}$ Xiaotong Zhang $^{1,2*}$ Siyang Zhao $^{1,2}$ Xianchao Zhang $^{1,2}$ + +School of Software, Dalian University of Technology1 + +Key Laboratory for Ubiquitous Network and Service Software of Liaoning Province $^{2}$ +School of Electronics Engineering and Computer Science, Peking University $^{3}$ +{hanliu, zhangxt}@dlut.edu.cn, zhangfeng@stu.pku.edu.cn +zhao_siyang@mail.dlut.edu.cn, xczhang@dlut.edu.cn + +# Abstract + +Intent classification (IC) and slot filling (SF) are critical building blocks in task-oriented dialogue systems. These two tasks are closely-related and can flourish each other. Since only a few utterances can be utilized for identifying fast-emerging new intents and slots, data scarcity issue often occurs when implementing IC and SF. However, few IC/SF models perform well when the number of training samples per class is quite small. In this paper, we propose a novel explicit-joint and supervised-contrastive learning framework for few-shot intent classification and slot filling. Its highlights are as follows. (i) The model extracts intent and slot representations via bidirectional interactions, and extends prototypical network to achieve explicit-joint learning, which guarantees that IC and SF tasks can mutually reinforce each other. (ii) The model integrates with supervised contrastive learning, which ensures that samples from same class are pulled together and samples from different classes are pushed apart. In addition, the model follows a not common but practical way to construct the episode, which gets rid of the traditional setting with fixed way and shot, and allows for unbalanced datasets. Extensive experiments on three public datasets show that our model can achieve promising performance. + +# 1 Introduction + +With the vigorous development of conversational AI, task-oriented dialogue systems have been widely-used in many applications, e.g., virtual personal assistants like Apple Siri and Google Assistant, and chatbots deployed in various domains (Liu et al., 2019a; Yan et al., 2020). Intent classification (IC) and slot filling (SF) are key components in task-oriented dialogue systems, and their performance will directly affect the downstream dialogue management and natural language generation tasks + +(Xu and Sarikaya, 2013). Traditional IC/SF models have achieved impressive performance (Gupta et al., 2019), but they often require large amount of labeled instances per class, which is expensive and unachievable in industry especially in the initial phase of a dialogue system. + +Few-shot learning aims to solve the data scarcity issue, which can recognize novel categories effectively with only a handful of labeled samples by leveraging the prior knowledge learned from previous categories. Most few-shot learning studies concentrate on computer vision domain (Fei-Fei et al., 2006; Finn et al., 2017; Jung and Lee, 2020). Recently, to handle various new or unacquainted intents popped up quickly from different domains, some few-shot IC/SF models are proposed (Geng et al., 2020; Hou et al., 2020). Nevertheless, these methods usually focus on a single task and do not attempt to address these two tasks simultaneously. + +Intuitively, IC and SF are two complementary tasks and the information of one task can be utilized in the other task to improve the performance. Existing joint IC and SF models have achieved impressive performance in supervised learning scenarios (Weld et al., 2021). But only a couple of methods are custom-designed for few-shot joint IC and SF task. Krone et al. (2020) directly apply the popular few-shot learning models MAML and prototypical network to explore the few-shot joint IC and SF. During the same period, Bhathiya and Thayasivam (2020) also attempt to utilize MAML to deal with this problem in a similar way. Though these models outperform the single task model, they just implicitly model the relationship between IC and SF. The mutual interaction between IC and SF in these methods is still unknowable, which seems to be a black box (not using a concrete formula to characterize the interaction), thus difficult to analyze the internal mechanism. + +In this paper, we propose to model the relationship between IC and SF precisely and clearly, as + +![](images/bf75018fe5790f08e8fe3e4037d4fe5aca0b186f7525a15489187ee6e1295412.jpg) +Figure 1: Illustration of our framework. In the training process, labeled utterances from support set and query set are first encoded by pre-processing module. Meanwhile, intent and slot labels' descriptions are fed into pre-processing module to generate intent embedding matrix and slot embedding matrix. Then the two matrices and utterance's embedding are fed into explicit joint learning module, while utterance's embedding is put forward into supervised contrastive learning module. In explicit joint learning module, intent and slot extractors are used to extract intent and slot information, which leverage the attention mechanism. Then, we can obtain slot-attention-based intent representation and intent-attention-based slot representation. Next, prototypical network uses intent labels to guide slot embedding learning and vice versa. In supervised contrastive learning module, we construct contrastive samples for each query instance using support set. And the SCL loss function can push samples from the same class more close and samples from different classes further apart. In the testing process, prototypical network is used to predict intent and slot labels, while supervised contrastive learning module is disabled. + +well as integrating with contrastive learning. As illustrated in Figure 1, our framework consists of two main components. First, we present an explicit-joint learning framework for few-shot intent classification and slot filling, which effectively utilizes the bidirectional connection between IC and SF via leveraging slot-attention-based intent representation and intent-attention-based slot representation. In addition, we integrate with supervised contrastive learning to obtain more class-discriminative embeddings, which is a strong complementary part to improve our framework. + +To verify the effectiveness of the proposed model, we conduct extensive experiments on three public datasets. Catering to the unbalanced datasets and very limited labeled samples in real application scenarios, we adopt a not common but practical way to construct the episode for few-shot learning, i.e., in each episode, the way and shot are variable. The empirical study validates our proposal and shows promising results of our framework on IC and SF tasks. + +# 2 Related Work + +Few-shot learning Few-shot learning aims to use the knowledge learned from seen classes, of which abundant labeled samples are available for training, to recognize unseen classes, of which limited labeled samples are provided (Wang et al., 2020a). It has been widely studied in computer vision such as classification (Fei-Fei et al., 2006; Wang et al., 2020b), segmentation (Wang et al., 2019; Rakelly et al., 2018) and generation (Liu et al., 2019b). Recently it has been expanded to natural language processing such as intent detection (Yu et al., 2021; Kumar et al., 2021). + +Few-shot classification is an important and challenging task. Several methods have been proposed to tackle this problem. In particular, several metric-based methods (Vinyals et al., 2016; Snell et al., 2017; Yu et al., 2018; Geng et al., 2019; Bao et al., 2020) have been proposed, which first learn an embedding space and then utilize a metric to classify instances of new categories according to prox + +imities with the labeled examples. In addition to metric-based methods, some optimization-based approaches (Ravi and Larochelle, 2017; Finn et al., 2017; Yoon et al., 2018) have also been explored for few-shot classification. + +Contrastive learning Contrastive learning applied to self-supervised representation learning has seen a resurgence of interest in recent years, leading to state-of-the-art performance in unsupervised training of deep image models (Chen et al., 2020). Khosla et al. (2020) extend the self-supervised batch contrastive approach to the fully-supervised setting, allowing us to effectively leverage label information. Recently, Gunel et al. (2020) propose a novel objective function that contains a supervised contrastive learning term for fine-tuning pre-trained language models, which improves the model generalization ability significantly. + +Joint intent classification and slot filling Due to the close relationship between IC and SF, Liu and Lane (2016); Zhang and Wang (2016); Goo et al. (2018); Qin et al. (2019, 2021) propose joint models to consider the correlation between these two tasks. These models can be classified into two categories. One type of approaches (Liu and Lane, 2016; Zhang and Wang, 2016) adopt a multitask framework to solve these two tasks simultaneously. Although these models outperform the single-task model, they just model the relationship implicitly by sharing the encoder parameters. The other type of approaches (Goo et al., 2018; Qin et al., 2019) explicitly adopt the intent information to guide the slot filling task. Qin et al. (2021) further propose a co-interactive transformer which considers the cross-impact between these two tasks. These explicit-joint learning models have achieved very remarkable performance, but they mainly focus on the traditional supervised learning setting. + +# 3 Problem Definition + +A labeled utterance with $T$ words (tokens) can be represented as $(x,t,y)$ , where $x = (w_{1},w_{2},\dots,w_{T})$ is an utterance with $T$ words, $t = (t_1,t_2,\dots,t_T)$ is composed of slot labels of each word in $x$ , $y$ is the intent label of $x$ . In this paper, few-shot classification is conducted via episode learning strategy. In the training period, we partition the training set into multiple episodes. Each episode consists of a support set $\mathcal{S}$ and a query set $\mathcal{Q}$ . In particular, we randomly select + +
SymbolExplanation
Cset of intent classes in each episode
Ssupport set of an episode
Qquery set of an episode
Scset of support data in the c-th class
Qcset of query data in the c-th class
xan utterance with T words, x = (w1, ..., wT)
tslot labels of each word in x, t = (t1, ..., tT)
yintent label of utterance x
kcnumber of supports in Sc
kqnumber of queries in Qc
Hpre-processed utterance embedding
EIintent label embedding
ESslot label embedding
HIslot-attention-based intent representation
HSintent-attention-based slot representation
csentence embedding of utterance x
+ +Table 1: Symbol explanation. + +$N$ classes from the training classes, and obtain a class set $\mathcal{C}$ in each episode. Then the support set is formed by randomly selecting $k_{c}$ labeled samples (utterances) from each of the $N$ classes, i.e., $\mathcal{S} = \bigcup_{c\in \mathcal{C}}\mathcal{S}_c$ , where $\mathcal{S}_c = \{(x^i,t^i,y_c)|i\in (1,\dots,k_c)\}$ . And a fraction of the remainder of these $N$ classes' samples ( $k_{q}$ examples per class) serve as the query set, i.e., $\mathcal{Q} = \bigcup_{c\in \mathcal{C}}\mathcal{Q}_c$ , where $\mathcal{Q}_c = \{(x^j,t^j,y_c)|j\in (1,\dots,k_q)\}$ . In the test period, we also partition the test set into multiple episodes. Each episode contains a support set $\mathcal{S} = \bigcup_{c\in \mathcal{C}}\mathcal{S}_c$ , where $\mathcal{S}_c = \{(x^i,t^i,y_c)|i\in (1,\dots,k_c)\}$ , and a query set $\mathcal{Q} = \bigcup_{c\in \mathcal{C}}\mathcal{Q}_c$ , where $\mathcal{Q}_c = \{x^j |j\in (1,\dots,k_q)\}$ . There is no overlap between the training classes and test classes. Table 1 summarizes the symbol explanation in details. + +# 4 Approach + +# 4.1 Pre-processing + +Given an utterance $x = (w_{1}, w_{2}, \dots, w_{T})$ with $T$ words (tokens), each word in the utterance can obtain its word embedding by BERT (Devlin et al., 2019). And each word can be further encoded using a recurrent neural network such as bidirectional LSTM, i.e., + +$$ +\begin{array}{l} \overrightarrow {\boldsymbol {h}} _ {t} = \operatorname {L S T M} _ {f w} \left(w _ {t}, \overrightarrow {\boldsymbol {h}} _ {t - 1}\right), \\ \overleftarrow {\boldsymbol {h}} _ {t} = \operatorname {L S T M} _ {b w} \left(w _ {t}, \overleftarrow {\boldsymbol {h}} _ {t + 1}\right), \tag {1} \\ \end{array} +$$ + +where $\mathrm{LSTM}_{fw}$ and $\mathrm{LSTM}_{bw}$ denote the forward and backward LSTM respectively, and $\overrightarrow{\pmb{h}}_t\in \mathbb{R}^{d_h}$ and $\overleftarrow{\pmb{h}}_t\in \mathbb{R}^{d_h}$ are the hidden states of the $t$ -th word learned from $\mathrm{LSTM}_{fw}$ and $\mathrm{LSTM}_{bw}$ respectively. The entire hidden state of the $t$ -th word + +is represented by concatenating $\vec{\pmb{h}}_t$ and $\vec{\pmb{h}}_t$ , i.e., $\pmb{h}_t = [\vec{\pmb{h}}_t, \vec{\pmb{h}}_t]$ , and the hidden state matrix of the utterance is $\pmb{H} = [h_1, h_2, \dots, h_T]^\top \in \mathbb{R}^{T \times 2d_h}$ . To express concisely, we use $d = 2d_h$ to represent the dimension of hidden state and obtain $\pmb{H} \in \mathbb{R}^{T \times d}$ . + +# 4.2 Extracting Intent and Slot Representations via Bidirectional Interaction + +To explicitly establish the interaction between intent classification and slot filling, for each utterance, we first use the attention mechanism over slot and intent label descriptions to get the initial intent and slot representations (Cui and Zhang, 2019; Qin et al., 2021). Then, these initial representations are concatenated with the utterance embedding matrix to produce the final slot-attention-based intent representation and intent-attention-based slot representation. + +In particular, we first use the embeddings of intent labels' descriptions to produce intent embedding matrix $\pmb{E}_I \in \mathbb{R}^{|\mathcal{C}_{\text{intent}}| \times d}$ , and use the embeddings of slot labels' descriptions to produce slot embedding matrix $\pmb{E}_S \in \mathbb{R}^{|\mathcal{C}_{\text{slot}}| \times d}$ , where $|\mathcal{C}_{\text{intent}}|$ is the number of intents in the episode, $|\mathcal{C}_{\text{slot}}|$ is the number of slots in the episode, $d$ is the dimension of hidden state. $\pmb{E}_I$ and $\pmb{E}_S$ are initialized by pre-processing intent and slot labels' descriptions, and they are learnable and can be updated during training. Then we calculate slot-attention-based intent representation and intent-attention-based slot representation as follows. + +# Slot-attention-based Intent Representation + +$$ +\boldsymbol {H} _ {I} = \operatorname {s o f t m a x} \left(\boldsymbol {H} \left(\boldsymbol {E} _ {S}\right) ^ {T}\right) \boldsymbol {E} _ {S} \| \boldsymbol {H}. \tag {2} +$$ + +# Intent-attention-based Slot Representation + +$$ +\boldsymbol {H} _ {S} = \operatorname {s o f t m a x} \left(\boldsymbol {H} \left(\boldsymbol {E} _ {I}\right) ^ {T}\right) \boldsymbol {E} _ {I} \mid \mid \boldsymbol {H}. \tag {3} +$$ + +Here $\pmb{H}_{I} = (\pmb{h}_{1}^{I},\pmb{h}_{2}^{I},\dots,\pmb{h}_{T}^{I})\in \mathbb{R}^{T\times 2d}$ , $\pmb{H}_{S} = (\pmb{h}_{1}^{S},\pmb{h}_{2}^{S},\dots,\pmb{h}_{T}^{S})\in \mathbb{R}^{T\times 2d}$ , and they carry the corresponding intent and slot information respectively. + +# 4.3 Explicit Joint Learning with Prototypical Networks + +Inspired by (Krone et al., 2020), we also extend the prototypical networks to perform joint intent classification and slot filling. Different from (Krone et al., 2020), when calculating the prototype of slot label, instead of only considering the words in the + +front, we use the window strategy to take the contextual words into account simultaneously, which seems more reasonable. + +In general, for each intent class or slot class, its corresponding prototype is the mean vector of the sample embeddings in that class. Given a support set, $S_{c} = \{(x^{i},t^{i},y_{c})|i\in (1,\dots,k_{c})\}$ is the set of support data with intent class $c$ , where $x^{i} = (w_{1}^{i},w_{2}^{i},\dots,w_{T}^{i})$ is the $i$ -th utterance, and $t^i = (t_1^i,t_2^i,\dots,t_T^i)$ is the corresponding slot labels. $S_{o} = \{(x^{i},t^{i},y^{i})|t_{j}^{i} = o\}$ is the set of support data with slot label $o$ . The prototype $p_c$ of intent label $c$ and the prototype $p_o$ of slot label $o$ can be computed as follows: + +$$ +\boldsymbol {p} _ {c} = \frac {1}{| \mathcal {S} _ {c} |} \sum_ {\boldsymbol {x} ^ {i} \in \mathcal {S} _ {c}} \boldsymbol {c} ^ {i}, \tag {4} +$$ + +$$ +\boldsymbol {p} _ {o} = \frac {1}{| \mathcal {S} _ {o} |} \sum_ {x ^ {i} \in \mathcal {S} _ {o}} \frac {1}{2 l + 1} \sum_ {k = j - l} ^ {j + l} \left(\boldsymbol {h} _ {k} ^ {S}\right) ^ {i}, \tag {5} +$$ + +where $\pmb{c}^i = \text{mean}(\pmb{H}_I) \in \mathbb{R}^{2d}$ is the embedding of the $i$ -th utterance $x^i$ . $\frac{1}{2l + 1} \sum_{k = j - l}^{j + l} (\pmb{h}_k^S)^i$ is the embedding of $j$ -th word with slot label $o$ , which considers the contextual words simultaneously with the window size $2l + 1$ . + +Given a query data $(x^{*},t^{*},y^{*})\in \mathcal{Q}$ , we compute the conditional probability $p(y = c|x^*,S)$ to predict its intent based on negative squared Euclidean distance. + +$$ +p (y = c \mid x ^ {*}, \mathcal {S}) = \frac {\exp \left(- \left\| \boldsymbol {c} ^ {*} - \boldsymbol {p} _ {c} \right\| _ {2} ^ {2}\right)}{\sum_ {c ^ {\prime}} \exp \left(- \left\| \boldsymbol {c} ^ {*} - \boldsymbol {p} _ {c ^ {\prime}} \right\| _ {2} ^ {2}\right)}. \tag {6} +$$ + +Here $c^*$ is the embedding of $x^*$ . Similarly, we can compute the conditional probability $p(t_j = o|x^*, S)$ to predict the slot. + +Finally, we perform the cross-entropy loss on all query instances to construct the IC and SF prototypical loss functions. + +$$ +\mathcal {L} _ {I C _ {p n}} = \frac {1}{| \mathcal {Q} |} \sum_ {x ^ {*} \in \mathcal {Q}} - \log p (y = y ^ {*} \mid x ^ {*}, \mathcal {S}). \tag {7} +$$ + +$$ +\mathcal {L} _ {S F _ {p n}} = \frac {1}{| \mathcal {Q} |} \sum_ {x ^ {*} \in \mathcal {Q}} \sum_ {t _ {j} ^ {*} \in t ^ {*}} - \log p (t _ {j} = t _ {j} ^ {*} \mid x ^ {*}, \mathcal {S}). \tag {8} +$$ + +# 4.4 Integrating with Supervised Contrastive Learning + +Supervised contrastive learning has achieved great success in computer vision, which aims to maximize similarities between instances from the same + +class and minimize similarities between instances from different classes. Here we integrate with supervised contrastive learning to generate better intent representations and slot representations. + +We first construct contrastive samples for each query instance using support set. For a query instance $x$ , we can take the support instances which have the same label with $x$ as the positive samples, and the negative samples are those with different labels. Then for an episode, the SCL loss of IC can be written as: + +$$ +\begin{array}{l} \mathcal {L} _ {I C _ {s c l}} = \frac {1}{| \mathcal {Q} |} \sum_ {x ^ {i} \in \mathcal {Q}} - \frac {1}{N _ {y ^ {i}}} \sum_ {x ^ {j} \in \mathcal {S}} \mathbf {1} _ {y ^ {i} = y ^ {j}} \tag {9} \\ \log \frac {e x p (\mathbf {z} ^ {i} \cdot \mathbf {z} ^ {j} / \tau)}{\sum_ {x ^ {k} \in \mathcal {S}} e x p (\mathbf {z} ^ {i} \cdot \mathbf {z} ^ {k} / \tau)}, \\ \end{array} +$$ + +where $\mathbf{z}^i\cdot \mathbf{z}^j$ means the inner product of the two vectors. $(x^{i},t^{i},y^{i})$ is a query instance in query set $\mathcal{Q}$ $N_{y^i}$ is the total number of utterances in support set which have the same intent label $y^{i}$ $\mathbf{z}^i = mean(\mathbf{H})$ is the pre-processed embedding of $x^i$ . $\tau >0$ is an adjustable scalar parameter which can control the separation degree of classes. + +To analyze Eq. (9), we can do some simple formula manipulation as below. + +$$ +\mathcal {L} _ {I C _ {s c l}} = \frac {1}{| \mathcal {Q} |} \sum_ {x ^ {i} \in \mathcal {Q}} - \frac {1}{N _ {y ^ {i}}} \mathcal {L} _ {s c l}, +$$ + +$$ +\begin{array}{l} \mathcal {L} _ {s c l} = \sum_ {x ^ {j} \in \mathcal {S}} \mathbf {1} _ {y ^ {i} = y ^ {j}} \log \frac {\exp (\mathbf {z} ^ {i} \cdot \mathbf {z} ^ {j} / \tau)}{\sum_ {x ^ {k} \in \mathcal {S}} \exp (\mathbf {z} ^ {i} \cdot \mathbf {z} ^ {k} / \tau)} \\ = \underbrace{\sum_{x^{j}\in\mathcal{S}}\mathbf{1}_{y^{i} = y^{j}}(\frac{\mathbf{z}^{i}\cdot\mathbf{z}^{j}}{\tau})}_{positive} - \sum_{x^{j}\in \mathcal{S}}\mathbf{1}_{y^{i} = y^{j}}log\underbrace{\sum_{x^{k}\in\mathcal{S}}exp(\frac{\mathbf{z}^{i}\cdot\mathbf{z}^{k}}{\tau})}_{positive + negative}. \\ \end{array} +$$ + +According to the above formula, if we want to minimize $\mathcal{L}_{IC_{scl}}$ , we must maximize $\mathcal{L}_{scl}$ , where we need to maximize the positive term and minimize the positive + negative term, so the negative term will be decreased. Intuitively, the supervised contrastive learning term can push samples from the same class close and samples from different classes further apart. + +In a similar manner, the SCL loss of SF for an episode can be written as: + +$$ +\begin{array}{l} \mathcal {L} _ {S F _ {s c l}} = \frac {1}{| \mathcal {Q} _ {s} |} \sum_ {w _ {i} \in \mathcal {Q} _ {s}} - \frac {1}{N _ {t _ {i}}} \sum_ {w _ {j} \in \mathcal {S} _ {s}} \tag {10} \\ \mathbf {1} _ {t _ {i} = t _ {j}} \log \frac {\exp (\pmb {h} _ {i} \cdot \pmb {h} _ {j} / \tau)}{\sum_ {w _ {k} \in \mathcal {S} _ {s}} \exp (\pmb {h} _ {i} \cdot \pmb {h} _ {k} / \tau)}, \\ \end{array} +$$ + +where $\pmb{h}_i$ and $\pmb{h}_j$ are the embedding representations of $w_i$ and $w_j$ . $\pmb{h}_i \cdot \pmb{h}_j$ means the inner product of $\pmb{h}^i$ and $\pmb{h}^j$ . $\mathcal{Q}_s$ represents the set of words in query set, and $S_s$ represents the set of words in support set. $N_{t_i}$ is the total number of words in support set which have the same slot label $t_i$ . Here the same word in different utterances are considered repeatedly, and the words with slot label "Other" are ignored. Note that different from the symbol $t^i$ which represents the slot labels of each word in an utterance $x^i$ , $t_i$ represents the slot label of $w_i$ . + +Combining Eq. (7), (8), (9) and (10), the overall loss function of the proposed framework is: + +$$ +\mathcal {L} = \mathcal {L} _ {I C _ {p n}} + \lambda \mathcal {L} _ {S F _ {p n}} + \gamma \mathcal {L} _ {I C _ {s c l}} + \delta \mathcal {L} _ {S F _ {s c l}}, \tag {11} +$$ + +where $\lambda, \gamma$ and $\delta$ are trade-off hyperparameters. + +# 5 Experiments + +# 5.1 Episode Construction + +In this section, we outline the method of sampling episodes used in (Triantafillou et al., 2020) and (Krone et al., 2020), which allows that the "way" $N$ and the "shot" $k_{c}$ are variable in each episode, and can cater the unbalanced datasets and very limited labeled instances in real application scenarios. Given a data split which contains $|C_{split}|$ intent classes, there are two steps to construct an episode. + +Step 1: Sampling the class set for each episode. (i) We sample the class number $N$ uniformly from the range $[3, |C_{split}|]$ . +(ii) We sample $N$ intent classes from the data split at random. + +Step 2: Sampling the samples for each episode. + +(i) Computing the query set size of each class by: + +$$ +k _ {q} = \min \{1 0, (\min _ {c \in \mathcal {C}} \lfloor 0. 5 * | U (c) | \rfloor) \}, +$$ + +where $\mathcal{C}$ is the set of selected classes, and $U(c)$ denotes the set of utterances belonging to class $c$ . + +(ii) Computing the total support set size $|\mathcal{S}|$ by: + +$$ +\min \left\{U _ {\max }, \sum_ {c \in \mathcal {C}} \lceil \beta \min \{2 0, | U (c) | - k _ {q} \} \rceil \right\}, +$$ + +where $\beta$ is a scalar sampled uniformly from interval $(0,1]$ , and $U_{max}$ is the maximum support set size. +(iii) Computing the number of shots $k_{c}$ of each class by: + +$$ +k _ {c} = \min \left\{\left\lfloor R _ {c} * \left(\left| \mathcal {S} \right| - \left| \mathcal {C} \right|\right) \right\rfloor + 1, \left| U (c) \right| - k _ {q} \right\}, +$$ + +where the parameter $R_{c}$ is computed by: + +$$ +R _ {c} = \frac {\exp (\alpha_ {c}) | U (c) |}{\sum_ {c ^ {\prime} \in \mathcal {C}} \exp (\alpha_ {c ^ {\prime}}) | U (c ^ {\prime}) |}, +$$ + +where $\alpha_{c}$ is sampled uniformly from the interval $[log(0.5), log(2))$ . + +# 5.2 Datasets + +We conduct experiments on three benchmark datasets ATIS (Hemphill et al., 1990), SNIPS (Coucke et al., 2018), and TOP (Gupta et al., 2018). In pre-processing procedure, we follow (Krone et al., 2020) to modify slot label name by adding the associated intent label name as a prefix to each slot. + +We divide the dataset into train set $(70\%)$ , development set $(15\%)$ , and test set $(15\%)$ respectively. For the SNIPS dataset, we choose not to form a development set. This is because that there are only 7 intents in the SNIPS dataset, and we require a minimum of 3 intents per split. Table 2 provides the detailed dataset statistics. + +# 5.3 Baselines + +Following the work of Amazon AI (Krone et al., 2020), we compare our framework with some popular few-shot models: first order approximation of model agnostic meta learning (foMAML) (Finn et al., 2017)), prototypical networks (Proto), and a fine-tuning method (Fine-tune) (Goyal et al., 2018). For each model, its embedding layer could be GloVe word embeddings (GloVe), GloVe word embeddings concatenated with ELMo embeddings (ELMo), or BERT embeddings (BERT). + +Furthermore, we can train the above models with two modes. One is to train and test the model on a single dataset, the other is to apply joint training approach to train the model on all the three datasets and test it on a single dataset. For example, SNIPS means we train and test the baseline on SNIPS dataset, and SNIPS (joint) means we train the baseline on all the three datasets but test it on SNIPS dataset. + +
SplitATISSNIPSTOP
#Utt#In#Utt#In#Utt#In
Train4,37358,230420,3457
Dev6696--4,3335
Test82976,25434,4266
Total5,8711814,484729,10418
+ +Table 2: Detailed statistics on utterance (Utt) and intent (In) counts for ATIS, SNIPS and TOP. + +The above baselines have been performed by Krone et al. (2020), we directly reuse their reported results. And as the second training mode is time consuming, we train our proposed model with the first mode. + +In addition, we compare with the latest method Retriever (Yu et al., 2021), which is a span-level retrieval method that learns similar contextualized representations for spans with the same label via a novel batch-softmax objective. + +We also evaluate our framework under three cases: our framework (o, o), our framework (w, o) and our framework (w, w), where our framework (o, o) represents $\mathcal{L} = \mathcal{L}_{IC_{pn}} + \lambda \mathcal{L}_{SF_{pn}}$ , our framework (w, o) represents $\mathcal{L} = \mathcal{L}_{IC_{pn}} + \lambda \mathcal{L}_{SF_{pn}} + \gamma \mathcal{L}_{IC_{scl}}$ , our framework (w, w) represents $\mathcal{L} = \mathcal{L}_{IC_{pn}} + \lambda \mathcal{L}_{SF_{pn}} + \gamma \mathcal{L}_{IC_{scl}} + \delta \mathcal{L}_{SF_{scl}}$ . Our framework (w, w) is the whole model. + +# 5.4 Implementation Details + +Parameter Settings In this paper, the dimension of hidden state is set to 1536 ( $d = 1536$ ). We freeze 6 layers of BERT, and train all models using AdamW (Loshchilov and Hutter, 2019) optimizer with the initial learning rate $1 \times 10^{-4}$ and the dropout ratio 0.1. All the models are trained for 30 epochs. For hyperparameters $\lambda$ , $\gamma$ and $\delta$ , we use the grid searching method to determine them in the range (0, 1). For the hyperparameter $\tau$ , we set $\tau = 0.1$ consistently. + +Evaluation Metrics We evaluate the performance of intent classification and slot filling with accuracy (Acc) and F1 score (F1), respectively. + +# 5.5 Result Analysis + +IC Performance Table 3 summarizes the average IC accuracy over 100 test episodes when the maximum support set size $U_{max} = 20$ , where the top 2 results are highlighted in bold. We could make the following observations. (1) When comparing with the baselines that use the same word embeddings (BERT), our framework (w, w) improves upon the strong baseline BERT+Proto by nearly $4\%$ , $22\%$ and $10\%$ on SNIPS, ATIS and TOP respectively, which shows the superiority of our proposed model. (2) When comparing with all the baselines, our framework (w, w) improves upon the strong baseline ELMo+Proto by nearly $15\%$ and $12\%$ on ATIS and TOP respectively. (3) On SNIPS dataset, our framework (w, w) performs a little worse than ELMo+Fine-tune with joint train + +
Embed.AlgorithmIC Accuracy (mean +/- std)
SNIPSSNIPS (joint)ATISATIS (joint)TOPTOP (joint)
GloVeFine-tune69.52 +/- 2.8870.25 +/- 1.8549.50 +/- 0.6558.26 +/- 1.1237.58 +/- 0.5440.93 +/- 2.77
GloVefoMAML61.08 +/- 1.5059.67 +/- 2.1254.66 +/- 1.8245.20 +/- 1.4733.75 +/- 1.3031.48 +/- 0.50
GloVeProto68.19 +/- 1.7668.77 +/- 1.6065.46 +/- 0.8163.91 +/- 1.2743.20 +/- 0.8538.65 +/- 1.35
ELMoFine-tune85.53 +/- 0.3587.64 +/- 0.7349.25 +/- 0.7458.69 +/- 1.5645.49 +/- 0.6147.63 +/- 2.75
ELMofoMAML78.90 +/- 0.7778.86 +/- 1.3153.90 +/- 0.9652.47 +/- 2.8638.67 +/- 1.0236.49 +/- 0.99
ELMoProto83.54 +/- 0.4085.75 +/- 1.5765.95 +/- 2.2965.19 +/- 1.2950.57 +/- 2.8150.64 +/- 2.72
BERTFine-tune76.04 +/- 8.8477.53 +/- 5.6943.76 +/- 4.6150.73 +/- 3.8639.21 +/- 3.0940.86 +/- 3.75
BERTfoMAML67.36 +/- 1.0368.37 +/- 0.4850.27 +/- 0.6948.80 +/- 2.8238.50 +/- 0.4336.20 +/- 1.21
BERTProto81.39 +/- 1.8581.44 +/- 2.9158.84 +/- 1.3358.82 +/- 1.5552.76 +/- 2.2652.64 +/- 2.58
Retriever68.81 +/- 0.3249.22 +/- 0.7950.67 +/- 0.44
our framework (o, o)84.61 +/- 0.7876.09 +/- 3.7559.63 +/- 1.48
our framework (w, o)85.81 +/- 0.4580.37 +/- 0.5862.81 +/- 0.96
our framework (w, w)85.15 +/- 0.6780.44 +/- 0.6262.85 +/- 0.33
+ +Table 3: Average IC accuracy on 100 test episodes when $U_{max} = 20$ . + +
Embed.AlgorithmIC Accuracy (mean +/- std)
SNIPSSNIPS (joint)ATISATIS (joint)TOPTOP (joint)
GloVeFine-tune72.24 +/- 2.5873.00 +/- 1.8449.91 +/- 1.9056.07 +/- 2.9439.66 +/- 1.3441.10 +/- 0.65
GloVefoMAML66.75 +/- 1.2867.34 +/- 2.6254.92 +/- 0.8758.46 +/- 1.9133.62 +/- 1.5335.68 +/- 0.62
GloVeProto70.45 +/- 0.4972.66 +/- 1.9670.25 +/- 0.3969.58 +/- 0.4148.84 +/- 1.5946.85 +/- 0.86
ELMoFine-tune87.69 +/- 1.0588.90 +/- 0.1849.42 +/- 0.7956.99 +/- 2.1247.44 +/- 1.6148.87 +/- 0.54
ELMofoMAML80.80 +/- 0.4781.62 +/- 1.0759.10 +/- 2.5256.16 +/- 1.3441.80 +/- 1.4936.24 +/- 0.79
ELMoProto86.76 +/- 1.6287.74 +/- 1.0870.10 +/- 1.2671.89 +/- 1.4558.60 +/- 1.9156.87 +/- 0.39
BERTFine-tune76.66 +/- 8.6879.53 +/- 4.2544.08 +/- 6.0549.71 +/- 3.8440.05 +/- 2.3540.46 +/- 1.74
BERTfoMAML70.43 +/- 1.5672.79 +/- 1.1151.36 +/- 3.7450.25 +/- 0.8836.15 +/- 2.1735.24 +/- 0.35
BERTProto83.51 +/- 0.8886.29 +/- 1.0966.89 +/- 2.3165.70 +/- 2.3161.30 +/- 0.3262.51 +/- 1.79
Retriever71.98 +/- 0.4254.79 +/- 0.2751.78 +/- 0.61
our framework (o, o)86.35 +/- 1.3284.92 +/- 1.7567.98 +/- 1.21
our framework (w, o)86.46 +/- 0.8986.85 +/- 0.5968.74 +/- 0.61
our framework (w, w)86.79 +/- 0.3786.29 +/- 0.4268.51 +/- 0.77
+ +Table 4: Average IC accuracy on 100 test episodes when $U_{max} = 100$ . + +ing mode. This is because that ELMo+Fine-tune with joint training mode trains the model on all the three datasets, but our framework only trains the model on SNIPS. In addition, the word embeddings of ELMo seem more suitable for SNIPS. + +Table 4 shows the average IC accuracy over 100 test episodes when the maximum support set size $U_{max} = 100$ , where the top 2 results are highlighted in bold. We could make the similar observations. (1) Our framework (w, w) performs the best when comparing with the baselines that use the same word embeddings. (2) Except for SNIPS on which ELMo+Fine-tune and ELMo+Proto get the best two results, our framework (w, w) always performs better than other baselines. + +SF Performance Table 5 and Table 6 summarize the average SF F1 score over 100 test episodes when the maximum support set size $U_{max} = 20$ + +and $U_{max} = 100$ respectively, where the top 2 results are highlighted in bold. It can be seen that (1) When comparing with the baselines that use the same word embeddings (BERT), our framework (w, w) performs the best on all the datasets. (2) When comparing with all the baselines, our framework (w, w) can also obtain satisfactory performance in most cases. + +# 5.6 Ablation Study + +Explicit-Joint Learning To verify the effectiveness of slot-attention-based intent representation and intent-attention-based slot representation, we make the ablation study. The results when $U_{max} = 20$ are shown in Table 7. Our framework (o, o) is the model that only contains explicit-joint learning. Only slot-to-intent represents the model that only uses slot-attention-based intent representation while replacing intent-attention-based slot repre + +
Embed.AlgorithmSF F1 Score (mean +/- std)
SNIPSSNIPS (joint)ATISATIS (joint)TOPTOP (joint)
GloVeFine-tune6.72 +/- 1.246.68 +/- 0.402.57 +/- 1.2113.22 +/- 1.070.90 +/- 0.510.76 +/- 0.21
GloVefoMAML14.07 +/- 1.0112.91 +/- 0.4318.44 +/- 0.9116.91 +/- 0.325.34 +/- 0.439.22 +/- 1.03
GloVeProto29.63 +/- 0.7527.75 +/- 2.5231.19 +/- 1.1538.45 +/- 0.9710.65 +/- 0.8318.55 +/- 0.35
ELMoFine-tune22.02 +/- 1.1316.00 +/- 2.077.47 +/- 2.607.19 +/- 1.711.26 +/- 0.461.17 +/- 0.32
ELMofoMAML33.81 +/- 0.3332.82 +/- 0.8427.58 +/- 1.2524.45 +/- 1.2022.35 +/- 1.2315.53 +/- 0.64
ELMoProto59.88 +/- 0.5359.73 +/- 1.7233.97 +/- 0.3840.90 +/- 2.2120.12 +/- 0.2528.97 +/- 0.82
BERTFine-tune12.47 +/- 0.318.75 +/- 0.289.24 +/- 1.6715.93 +/- 3.103.15 +/- 0.281.08 +/- 0.30
BERTfoMAML12.72 +/- 0.1213.28 +/- 0.5318.91 +/- 1.0116.05 +/- 0.325.93 +/- 0.438.23 +/- 0.81
BERTProto42.09 +/- 1.1143.77 +/- 0.5437.61 +/- 0.8239.27 +/- 1.8420.81 +/- 0.4028.24 +/- 0.53
Retriever48.30 +/- 0.0564.14 +/- 0.9934.77 +/- 0.34
our framework (o, o)50.03 +/- 0.5961.79 +/- 3.0638.41 +/- 1.02
our framework (w, o)50.77 +/- 0.9262.73 +/- 0.5338.82 +/- 0.87
our framework (w, w)52.82 +/- 0.7063.65 +/- 0.5539.92 +/- 0.42
+ +Table 5: Average SF F1 score on 100 test episodes when $U_{max} = 20$ . + +
Embed.AlgorithmSF F1 Score (mean +/- std)
SNIPSSNIPS (joint)ATISATIS (joint)TOPTOP (joint)
GloVeFine-tune7.06 +/- 1.877.76 +/- 0.912.72 +/- 1.6517.20 +/- 3.031.26 +/- 0.440.67 +/- 0.33
GloVefoMAML16.77 +/- 0.6716.53 +/- 0.3217.80 +/- 0.4223.33 +/- 2.894.11 +/- 0.819.89 +/- 1.13
GloVeProto31.57 +/- 1.2831.17 +/- 1.3131.32 +/- 2.7941.07 +/- 1.149.99 +/- 1.0818.93 +/- 0.77
ELMoFine-tune22.37 +/- 0.9117.09 +/- 2.578.93 +/- 2.8611.09 +/- 2.002.04 +/- 0.411.03 +/- 0.24
ELMofoMAML36.10 +/- 1.4937.33 +/- 0.2426.91 +/- 2.6426.37 +/- 0.1518.32 +/- 0.5216.55 +/- 0.79
ELMoProto62.71 +/- 0.4062.14 +/- 0.7535.20 +/- 2.4641.28 +/- 2.7318.44 +/- 2.4128.33 +/- 1.33
BERTFine-tune14.71 +/- 0.4310.50 +/- 0.9011.53 +/- 1.4620.41 +/- 1.854.98 +/- 0.661.48 +/- 0.85
BERTfoMAML14.99 +/- 1.2915.83 +/- 0.9417.68 +/- 2.4217.11 +/- 1.313.37 +/- 0.3610.58 +/- 0.45
BERTProto46.50 +/- 0.7548.77 +/- 0.7140.63 +/- 3.3743.10 +/- 1.7620.58 +/- 2.2728.92 +/- 1.09
Retriever49.39 +/- 0.7868.13 +/- 3.0637.12 +/- 0.84
our framework (o, o)54.29 +/- 0.9959.13 +/- 1.6938.74 +/- 1.53
our framework (w, o)54.52 +/- 0.3162.01 +/- 0.5038.40 +/- 0.21
our framework (w, w)55.19 +/- 0.4164.95 +/- 1.1140.88 +/- 0.63
+ +Table 6: Average SF F1 score on 100 test episodes when ${U}_{max} = {100}$ . + +
ModelSNIPSATISTOP
IC AccSF F1IC AccSF F1IC AccSF F1
only intent-to-slot81.2049.5772.9059.2757.1136.12
only slot-to-intent82.7548.9573.5754.7358.3934.43
our framework (o, o)84.6150.0376.0961.7959.6338.41
+ +Table 7: Ablation study on the ATIS, SNIPS and TOP datasets when $U_{max} = 20$ . + +sensation with pure slot representation. Similarly, we have the only intent-to-slot model. From the results, it can be seen that our framework (o, o) performs better than the other two baselines, which demonstrates the effectiveness of extracting intent and slot representations via bidirectional interaction. + +Supervised Contrastive Learning Our proposed objective function includes a cross entropy (CE) term of prototypical network and supervised contrastive learning (SCL) term, the latter aims to + +push samples in the same class close and samples in different classes further apart. By comparing the results of our framework (w, o) with our framework (o, o) in Table 3 and Table 4, we can get that the term $\mathcal{L}_{IC_{scl}}$ brings nearly $0.1\% \sim 4.3\%$ improvement for IC accuracy. By comparing the results of our framework (w, w) with our framework (w, o) in Table 5 and Table 6, it can be seen that the term $\mathcal{L}_{SF_{scl}}$ brings nearly $0.6\% \sim 2.9\%$ improvement for SF F1 score. The performance improvement demonstrates the effectiveness of the SCL loss for both IC and SF tasks. + +Figure 2 visualizes the distribution of sentence embeddings in TOP dataset, we can observe that the original distribution is random in Pic.1. As shown in Pic.2, CE can separate the data in different classes to some extent. In Pic.3, SCL term further encourages more compact clustering of the data points in the same class. + +![](images/408e6da88088a1f104b3f22894f1bfe2cbd0fffb4e937e575e114bbd57efdfde.jpg) +(a) Pic.1: Original + +![](images/a5de7b8ae5bd362766aa74f9924b1452427f414ab411e2eab3bd4a198a6d2826.jpg) +(b) Pic.2: CE +Figure 2: Pic.1 shows sentence embeddings obtained from original pre-processing model without any training process. Pic.2 shows sentence embeddings via training the model with cross entropy (CE) loss of prototypical network. Pic.3 shows sentence embeddings via training the model with cross entropy (CE) and supervised contrastive loss (SCL). All the data are from TOP dataset. Data points with the same color come from the same class. + +![](images/0cb8e948a8b070cd0d6aca1b1361dbfa06b0385f8847d5ef7eb2512442eff67d.jpg) +(c) Pic.3: $\mathrm{CE + SCL}$ + +# 6 Conclusion + +In this paper, we propose a new and practicable framework for few-shot intent classification and slot filling. The performance gains of our method come from two aspects: explicit-joint learning and supervised-contrastive learning. By explicit-joint learning, we can effectively utilize the close relationship between IC and SF tasks. By supervised-contrastive learning, we can obtain more class-indicative representations. We thoroughly evaluate our framework on few-shot IC and SF tasks and achieve impressive performance on three public datasets SNIPS, ATIS and TOP. In future work, we plan to explore more explicit-joint learning strategies and extend our framework to deal with multiple-intent classification. + +# Acknowledgements + +The authors are grateful to the anonymous reviewers for their valuable comments and suggestions. This work was supported by National Natural Science Foundation of China (No. 62106035, 61876028), and the Fundamental Research Funds for the Central Universities (No. DUT20RC(3)040, No. DUT20RC(3)066). + +# References + +Yujia Bao, Menghua Wu, Shiyu Chang, and Regina Barzilay. 2020. Few-shot text classification with distributional signatures. In International Conference on Learning Representations (ICLR). +Hemanthage S Bhathiya and Uthayasanker Thayasi-vam. 2020. Meta learning for few-shot joint intent detection and slot-filling. In International Conference on Machine Learning Technologies (ICMLT), pages 86-92. + +Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey E. Hinton. 2020. A simple framework for contrastive learning of visual representations. In International Conference on Machine Learning (ICML), pages 1597-1607. +Alice Coucke, Alaa Saade, Adrien Ball, Théodore Bluche, Alexandre Caulier, David Leroy, Clément Doumouro, Thibault Gisselbrecht, Francesco Caltagirone, Thibaut Lavril, Maël Primet, and Joseph Dureau. 2018. Snips voice platform: an embedded spoken language understanding system for private-by-design voice interfaces. CoRR, abs/1805.10190. +Leyang Cui and Yue Zhang. 2019. Hierarchically-refined label attention network for sequence labeling. In Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4113-4126. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: pre-training of deep bidirectional transformers for language understanding. In Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), pages 4171-4186. +Li Fei-Fei, Rob Fergus, and Pietro Perona. 2006. One-shot learning of object categories. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 28(4):594-611. +Chelsea Finn, Pieter Abbeel, and Sergey Levine. 2017. Model-agnostic meta-learning for fast adaptation of deep networks. In International Conference on Machine Learning (ICML), pages 1126-1135. +Ruiying Geng, Binhua Li, Yongbin Li, Jian Sun, and Xiaodan Zhu. 2020. Dynamic memory induction networks for few-shot text classification. In Annual Meeting of the Association for Computational Linguistics (ACL), pages 1087-1094. +Ruiying Geng, Binhua Li, Yongbin Li, Yuxiao Ye, Ping Jian, and Jian Sun. 2019. Few-shot text classification with induction network. In Conference on Empirical Methods in Natural Language Processing (EMNLP). + +Chih-Wen Goo, Guang Gao, Yun-Kai Hsu, Chih-Li Huo, Tsung-Chieh Chen, Keng-Wei Hsu, and Yun-Nung Chen. 2018. Slot-gated modeling for joint slot filling and intent prediction. In Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), pages 753-757. +Anuj Kumar Goyal, Angeliki Metallinou, and Spyros Matsoukas. 2018. Fast and scalable expansion of natural language understanding functionality for intelligent agents. In Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), pages 145-152. +Beliz Gunel, Jingfei Du, Alexis Conneau, and Ves Stoyanov. 2020. Supervised contrastive learning for pre-trained language model fine-tuning. CoRR, abs/2011.01403. +Arshit Gupta, John Hewitt, and Katrin Kirchhoff. 2019. Simple, fast, accurate intent classification and slot labeling for goal-oriented dialogue systems. In Annual SIGdial Meeting on Discourse and Dialogue (SIGDIAL), pages 46-55. +Sonal Gupta, Rushin Shah, Mrinal Mohit, Anuj Kumar, and Mike Lewis. 2018. Semantic parsing for task oriented dialog using hierarchical representations. In Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2787-2792. +Charles T. Hemphill, John J. Godfrey, and George R. Doddington. 1990. The ATIS spoken language systems pilot corpus. In Proceedings of the Workshop on Speech and Natural Language. +Yutai Hou, Wanxiang Che, Yongkui Lai, Zhihan Zhou, Yijia Liu, Han Liu, and Ting Liu. 2020. Few-shot slot tagging with collapsed dependency transfer and label-enhanced task-adaptive projection network. In Annual Meeting of the Association for Computational Linguistics (ACL), pages 1381-1393. +Hong-Gyu Jung and Seong-Whan Lee. 2020. Few-shot learning with geometric constraints. IEEE Transactions on Neural Networks and Learning Systems (TNNLS). +Prannay Khosla, Piotr Teterwak, Chen Wang, Aaron Sarna, Yonglong Tian, Phillip Isola, Aaron Maschinot, Ce Liu, and Dilip Krishnan. 2020. Supervised contrastive learning. In Advances in Neural Information Processing Systems (NeurIPS). +Jason Krone, Yi Zhang, and Mona T. Diab. 2020. Learning to classify intents and slot labels given a handful of examples. CoRR, abs/2004.10793. +Manoj Kumar, Varun Kumar, Hadrien Glaude, Cyprien de Lichy, Aman Alok, and Rahul Gupta. 2021. Protoda: Efficient transfer learning for few-shot intent classification. In IEEE Spoken Language Technology Workshop (SLT), pages 966-972. + +Bing Liu and Ian R. Lane. 2016. Attention-based recurrent neural network models for joint intent detection and slot filling. In Annual Conference of the International Speech Communication Association (INTERN-SPEECH), pages 685-689. +Han Liu, Xiaotong Zhang, Lu Fan, Xuandi Fu, Qimai Li, Xiao-Ming Wu, and Albert Y. S. Lam. 2019a. Reconstructing capsule networks for zero-shot intent classification. In Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4798-4808. +Ming-Yu Liu, Xun Huang, Arun Mallya, Tero Karras, Timo Aila, Jaakko Lehtinen, and Jan Kautz. 2019b. Few-shot unsupervised image-to-image translation. In IEEE International Conference on Computer Vision (ICCV), pages 10550-10559. +Ilya Loshchilov and Frank Hutter. 2019. Decoupled weight decay regularization. In International Conference on Learning Representations (ICLR). +Libo Qin, Wanxiang Che, Yangming Li, Haoyang Wen, and Ting Liu. 2019. A stack-propagation framework with token-level intent detection for spoken language understanding. In *Conference on Empirical Methods in Natural Language Processing* (EMNLP), pages 2078-2087. +Libo Qin, Tailu Liu, Wanxiang Che, Bingbing Kang, Sendong Zhao, and Ting Liu. 2021. A co-interactive transformer for joint slot filling and intent detection. In IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 8193-8197. +Kate Rakelly, Evan Shelhamer, Trevor Darrell, Alexei A. Efros, and Sergey Levine. 2018. Few-shot segmentation propagation with guided networks. CoRR, abs/1806.07373. +Sachin Ravi and Hugo Larochelle. 2017. Optimization as a model for few-shot learning. In International Conference on Learning Representations (ICLR). +Jake Snell, Kevin Swersky, and Richard Zemel. 2017. Prototypical networks for few-shot learning. In Advances in Neural Information Processing Systems (NeurIPS), pages 4077-4087. +Eleni Triantafillou, Tyler Zhu, Vincent Dumoulin, Pascal Lamblin, Utku Evci, Kelvin Xu, Ross Goroshin, Carles Gelada, Kevin Swersky, Pierre-Antoine Manzagol, and Hugo Larochelle. 2020. Meta-dataset: A dataset of datasets for learning to learn from few examples. In International Conference on Learning Representations (ICLR). +Oriol Vinyals, Charles Blundell, Timothy Lillicrap, Daan Wierstra, et al. 2016. Matching networks for one shot learning. In Advances in Neural Information Processing Systems (NeurIPS), volume 29, pages 3630-3638. + +Kaixin Wang, Jun Hao Liew, Yingtian Zou, Daquan Zhou, and Jiashi Feng. 2019. Panet: Few-shot image semantic segmentation with prototype alignment. In IEEE International Conference on Computer Vision (ICCV), pages 9196-9205. +Yaqing Wang, Quanming Yao, James T. Kwok, and Lionel M. Ni. 2020a. Generalizing from a few examples: A survey on few-shot learning. ACM Computing Surveys, 53(3):63:1-63:34. +Yikai Wang, Chengming Xu, Chen Liu, Li Zhang, and Yanwei Fu. 2020b. Instance credibility inference for few-shot learning. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 12833-12842. +Henry Weld, Xiaoqi Huang, Siqi Long, Josiah Poon, and Soyeon Caren Han. 2021. A survey of joint intent detection and slot-filling models in natural language understanding. CoRR, abs/2101.08091. +Puyang Xu and Ruhi Sarikaya. 2013. Convolutional neural network based triangular CRF for joint intent detection and slot filling. In IEEE Workshop on Automatic Speech Recognition and Understanding (ASRU Workshop), pages 78-83. +Guangfeng Yan, Lu Fan, Qimai Li, Han Liu, Xiaotong Zhang, Xiao-Ming Wu, and Albert Y. S. Lam. 2020. Unknown intent detection using gaussian mixture model with an application to zero-shot intent classification. In Annual Meeting of the Association for Computational Linguistics (ACL), pages 1050-1060. +Jaesik Yoon, Taesup Kim, Ousmane Dia, Sungwooong Kim, Yoshua Bengio, and Sungjin Ahn. 2018. Bayesian model-agnostic meta-learning. In Annual Conference on Neural Information Processing Systems (NeurIPS), pages 7343-7353. +Dian Yu, Luheng He, Yuan Zhang, Xinya Du, Panupong Pasupat, and Qi Li. 2021. Few-shot intent classification and slot filling with retrieved examples. In Proceedings of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), pages 734-749. +Mo Yu, Xiaoxiao Guo, Jinfeng Yi, Shiyu Chang, Saloni Potdar, Yu Cheng, Gerald Tesauro, Haoyu Wang, and Bowen Zhou. 2018. Diverse few-shot text classification with multiple metrics. In Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), pages 1206-1215. +Xiaodong Zhang and Houfeng Wang. 2016. A joint model of intent determination and slot filling for spoken language understanding. In International Joint Conference on Artificial Intelligence (IJCAI), pages 2993-2999. \ No newline at end of file diff --git a/anexplicitjointandsupervisedcontrastivelearningframeworkforfewshotintentclassificationandslotfilling/images.zip b/anexplicitjointandsupervisedcontrastivelearningframeworkforfewshotintentclassificationandslotfilling/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..bc17f6bf95e54eafe7d1ad8217cf1c56737ae3cc --- /dev/null +++ b/anexplicitjointandsupervisedcontrastivelearningframeworkforfewshotintentclassificationandslotfilling/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:806f9db2cfa580423b02334b65dea598abe55146f9932da08c8acdededbdda0e +size 918351 diff --git a/anexplicitjointandsupervisedcontrastivelearningframeworkforfewshotintentclassificationandslotfilling/layout.json b/anexplicitjointandsupervisedcontrastivelearningframeworkforfewshotintentclassificationandslotfilling/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d25154a29986672cc4c2672c63bd1551fd40f686 --- /dev/null +++ b/anexplicitjointandsupervisedcontrastivelearningframeworkforfewshotintentclassificationandslotfilling/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:47fa0bf98f1c7c73443ede7395834c439cdc515505d2109b0a894cd9ecd0b895 +size 436970 diff --git a/anexploratorystudyonlongdialoguesummarizationwhatworksandwhatsnext/c285b917-d887-4e94-9dce-62b9a81bed48_content_list.json b/anexploratorystudyonlongdialoguesummarizationwhatworksandwhatsnext/c285b917-d887-4e94-9dce-62b9a81bed48_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..2789deff213f951551097b052edc652e2b24900a --- /dev/null +++ b/anexploratorystudyonlongdialoguesummarizationwhatworksandwhatsnext/c285b917-d887-4e94-9dce-62b9a81bed48_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15a52668a9d753ecc58fab7432e1a54f21c2a0df086a79e0ec41a4fe6ba419b3 +size 52898 diff --git a/anexploratorystudyonlongdialoguesummarizationwhatworksandwhatsnext/c285b917-d887-4e94-9dce-62b9a81bed48_model.json b/anexploratorystudyonlongdialoguesummarizationwhatworksandwhatsnext/c285b917-d887-4e94-9dce-62b9a81bed48_model.json new file mode 100644 index 0000000000000000000000000000000000000000..8798fe203c39d709a8b8916d16e0aaae0964eca8 --- /dev/null +++ b/anexploratorystudyonlongdialoguesummarizationwhatworksandwhatsnext/c285b917-d887-4e94-9dce-62b9a81bed48_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ffde5968d2d603f39a7f776a2a7e1b68029cc959bbae2ed82d7fe2d337346bca +size 64795 diff --git a/anexploratorystudyonlongdialoguesummarizationwhatworksandwhatsnext/c285b917-d887-4e94-9dce-62b9a81bed48_origin.pdf b/anexploratorystudyonlongdialoguesummarizationwhatworksandwhatsnext/c285b917-d887-4e94-9dce-62b9a81bed48_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e88e8d1390e704477856355ea8d66cf236e7bef7 --- /dev/null +++ b/anexploratorystudyonlongdialoguesummarizationwhatworksandwhatsnext/c285b917-d887-4e94-9dce-62b9a81bed48_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da642cbc61198cd58f2740a99b79099858127dd794fa1b8988b578a392497470 +size 411815 diff --git a/anexploratorystudyonlongdialoguesummarizationwhatworksandwhatsnext/full.md b/anexploratorystudyonlongdialoguesummarizationwhatworksandwhatsnext/full.md new file mode 100644 index 0000000000000000000000000000000000000000..4260efba3dbcaa2ca841a8f90a8a86bd0e36a0d8 --- /dev/null +++ b/anexploratorystudyonlongdialoguesummarizationwhatworksandwhatsnext/full.md @@ -0,0 +1,194 @@ +# An Exploratory Study on Long Dialogue Summarization: What Works and What's Next + +Yusen Zhang\* Ansong Ni\*† Tao Yu† Rui Zhang\* +Chenguang Zhu Budhaditya Deb Asli Celikyilmaz‡ +Ahmed Hassan Awadallah Dragomir Radev† + +\*Penn State University Yale University Microsoft Research Facebook AI Research + +{yfz5488, rmz5227}@psu.edu asli.ca@live.com +{ansong.ni, tao.yu, dragomir.radev}@yale.edu +{chezhu, Budha.Deb, hassanam}@microsoft.com + +# Abstract + +Dialogue summarization helps readers capture salient information from long conversations in meetings, interviews, and TV series. However, real-world dialogues pose a great challenge to current summarization models, as the dialogue length typically exceeds the input limits imposed by recent transformer-based pretrained models, and the interactive nature of dialogues makes relevant information more context-dependent and sparsely distributed than news articles. In this work, we perform a comprehensive study on long dialogue summarization by investigating three strategies to deal with the lengthy input problem and locate relevant information: (1) extended transformer models such as Longformer, (2) retrieve-then-summarize pipeline models with several dialogue utterance retrieval methods, and (3) hierarchical dialogue encoding models such as HMNet. Our experimental results on three long dialogue datasets (QMSum, MediaSum, SummScreen) show that the retrieve-then-summarize pipeline models yield the best performance. We also demonstrate that the summary quality can be further improved with a stronger retrieval model and pretraining on proper external summarization datasets. + +# 1 Introduction + +Large amount of dialogue data have been produced in meetings, TV series, and interviews (Chen et al., 2021; Zhong et al., 2021; Zhu et al., 2021). Dialogue summarization aims to generate a short summary for long dialogues to help the readers capture important information more efficiently. + +A number of existing works on dialogue summarization focus on extracting the main events of a short conversation (Gliwa et al., 2019; Rohde et al., 2021). However, unlike the short dialogues + +which contains less than 20 utterances, some tasks for summarizing much longer dialogues have been proposed recently (Chen et al., 2021; Zhong et al., 2021). These datasets are usually derived from meetings and interviews, with hundreds of turns in each dialogue. The length of such dialogues typically exceeds the input limits imposed by recent transformer-based models (Lewis et al., 2020), making it difficult to train an end-to-end summarization model for such tasks. This poses the challenge: How can we effectively use the current neural summarization models on dialogues that greatly exceed their length limits? + +Additionally, compared with document summarization, dialogues are interactive in nature, makes it more context-dependent and the information in dialogues is more sparsely distributed. Besides, the informal language used in dialogues leads to difficulties in modeling relevance and salience. To solve these issues, hierarchical methods are proposed to model the dialogues at turn level (Zhu et al., 2020a; Rohde et al., 2021). However, generating a short summary that contains all the salient information remains challenging. + +In this paper, we systematically investigate these issues on dialog summarization: we first explore the various solutions to the lengthy input problem. Then, we analyze and compare the methods to improve generic summarization models on challenging dialogue datasets. To address the long input issue, we investigate extended transformer models such as Longformer (Beltagy et al., 2020), and several dialogue utterance retrieval methods for a retrieve-then-summarize pipeline model, as well as hierarchical dialogue encoding models. For the specific challenges in dialogues, we explore different datasets for pretraining to test the transferability between similar summarization tasks. We evaluate these models on three recent long dialogue summarization datasets: QMSum for meetings (Zhong et al., 2021), MediaSum for inter + +views (Zhu et al., 2021), SummScreen for TV series transcripts (Chen et al., 2021). In our experiments, we find that the pipeline method with a dialogue utterance retrieval model yields the best performance, and it can be further improved with a stronger retrieval model. Our experiment results also suggest that pretraining on proper external summarization datasets can effectively improve the performance of dialogue summarization models. + +# 2 Related Work + +Long Sequence Summarization Recent summarization models are based on Transformer (Vaswani et al., 2017) that has a quadratic time and memory complexity with respect to the input length, preventing it from being used for longer sequences. To address this issue, Beltagy et al. (2020) used the sliding window and global attention, while Zaheer et al. (2020) used a combination of random, sliding window and global attention mechanism to reduce the quadratic complexity to close-linear. Previous benchmarks for long sequence summarization mostly focus on documents instead of dialogues: PUBMED and ARXIV (Cohen et al., 2018) consists of scientific papers which are typically very long; BILLSUM (Kornilova and Eidelman, 2019) is a corpus of U.S. Congressional bills and their summaries; BIGPATENT (Sharma et al., 2019) contains 1.3 million U.S. patent files and human-written summaries. + +Dialogue Summarization Dialogue summarization aims to generate concise summaries for dialogues, such as meetings (McCowan et al., 2005; Janin et al., 2003; Zhong et al., 2021; Shang et al., 2018; Zhu et al., 2020a), TV series (Chen et al., 2021), interviews (Zhu et al., 2021), and chitchat (Gliwa et al., 2019; Zhao et al., 2020; Chen and Yang, 2021). Some summarization datasets (not limited to dialogues) contain queries asking for summarizing specific parts of dialogues (Zhong et al., 2021; Nema et al., 2017), while others only need to summarize whole dialogues (Chen et al., 2021; Gliwa et al., 2019; Hermann et al., 2015). As for dialogue summarization models, Zhu et al. (2020b) described a hierarchical model for both inner- and cross-utterance attention, while Chen and Yang (2020) proposed a multi-view decoder to leverage different extracted views of dialogues, such as topic view and stage view. + +
QMSumSummScreenMediaSum*
SourceMeetingTV SeriesInterviews
Query-basedYESNONO
# examples1.8k26.9k463.6k
# input tokens9069.86612.51553.7
# summary tokens69.6337.414.4
# speakers9.228.36.5
+ +Table 1: Comparison between three long dialogue summarization datasets we mainly study in this work. Numbers in the table are averaged across all samples. (*: MediaSum is only used for pretraining) + +# 3 Methodology + +In this section, we will introduce the dataset used to evaluate and pretrain the model, two types of summary models, and the details of the experiment setup. + +# 3.1 Datasets + +To explore the problems in long dialogue summarization, we leverage three different long dialogue summarization tasks as main datasets: + +QMSum (Zhong et al., 2021) is a query-based multi-domain meeting summarization dataset annotated by humans. It contains 1,808 queries together with 232 long meeting transcripts, with topics as software product, academics, and committee meetings. QMSum also contains annotated gold spans which could be used as the gold labels for training the retrievers; + +MediaSum (Zhu et al., 2021) is a large-scale media interview dataset consisting of 463.6K transcripts collected from NPR and CNN. Because MediaSum contains short summaries, i.e. only a short sentence representing the topic, we only use this dataset for pretraining and analysis. Due to the huge size of this dataset, 20k samples are randomly extracted for pretraining; + +SummScreen (Chen et al., 2021) is a dialogue summarization dataset consisting of 26.9k pairs of TV series transcripts and human-annotated summaries. It comes with two sources for recaps, and in this work, we choose one of them,i.e. "Forever Dreaming", for which we call SummScreen-FD as our benchmark. + +Tab. 1 shows the statistics for these three long dialogue datasets. Additionally, we also consider CNN/Dailymail (Hermann et al., 2015) (CNN/DM), XSum (Narayan et al., 2018), and SAMSum (Gliwa et al., 2019) as datasets for pretraining in our experiments. + +# 3.2 Models + +# 3.2.1 Retrieve-then-summarize Pipeline + +Dialogues tend to be relatively long, and most existing summarization models cannot process such long inputs. The two-stage retrieve-then-summarize pipeline first retrieves the most relevant subtext in the dialogue and then feeds to a summarizer. We experiment with the following retrievers: + +- TF-IDF (Jones, 1972) Based on bag-of-words representation, TF-IDF measuers term frequency (TF) and normalizes them with inversed document frequency (IDF); +- BM25 (Robertson and Zaragoza, 2009) Similar to TF-IDF but accounts for document length and term saturation; +- Locator The utterance locator model proposed by Zhong et al. (2021) using convolution neural networks with BERT (Devlin et al., 2019). + +For TF-IDF and BM25, we limit the number of retrieved utterances to be at most $10\%$ of the whole dialogue, while we directly use the utterances predictor by Locator in its setting. After retrieval, we use the BART-large model fine-tuned on the output of the various retrievers to produce the summary. + +# 3.2.2 End-to-end Summarization Models + +To study how current state-of-the-art neural summarizers perform on long dialogue summarization, we choose the following three models: + +BART (Lewis et al., 2020) is a transformer-based encoder-decoder model which obtains a number of state-of-the-art results on various text generation tasks. We use this model as our baseline summarization model for studying its ablations under different settings. The maximum number of input tokens is 1,024 so we truncate the input when it exceeds such limit. + +HMNet (Zhu et al., 2020a) is a hierarchical network for dialogue summarization. It models the structure of the dialogue, using a token level encoder to encode each sentence and a turn level encoder for aggregating each turn. We use HMNet as a representative for the hierarchical type of models and compare it with other baselines. Due + +to the limitation of the memory cost, we constrain the maximum number of tokens to be 8,192 for HMNet, which is 8x as large as BART mentioned above. + +Longformer (Beltagy et al., 2020) adapts the self-attention mechanism from full attention matrix to sliding window attention + global attention, which is more memory efficient. Longformer can accept up to 16K tokens and has shown improvement over long document summarization using its long-encoder-decoder (LED) variant. We allow the maximum input of 4,096 tokens for Longformer and cutoff the rest of the input, as we found further increasing such limit yields no improvements. + +To incorporate queries in QMSum for these end-to-end models, we simply append the queries to the front of the meeting transcripts, as it is a standard practice for query-based summarization and also question answering (Devlin et al., 2019). + +# 3.3 Experiment Setup + +For a fair comparison between all models, we fit all of the models into the same RTX 8000 GPU with 48 GiB of GPU memory. We adopt the fairseq3 implementation for BART, and the original code base for both Longformer4 and HMNet5. We inherit the hyperparameters for all those models for fine-tuning in our experiments.6 Our most expensive experiments are fine-tuning for HMNet and Longformer, which take around 8 hours, while the runtime for BART model is less than one hour. We use ROUGE (Lin, 2004) as our main evaluation metric and pyrouge library7 as the ROUGE implementation throughout all experiments. + +# 4 Result and Analysis + +Here we demonstrate our findings in four corresponding subsections. We also show some concrete examples and perform qualitative analysis in $\S 4.5$ + +# 4.1 Dealing with Long Dialogues + +We compare several methods for addressing the long input issue for dialogue summarization, including different utterance retrieval methods describe in § 3.2.1 for a retrieve-then-summarize framework, heuristics for shortening the dialogue + +3https://github.com/pytorch/fairseq +4https://github.com/allenai/longformer +$^{5}$ https://github.com/microsoft/HMNet +For more implementation details, please refer to our experiment code: https://github.com/chatc/LongDialSumm. +7https://github.com/bheinzerling/pyrouge + +
MethodsR-1R-2R-L
Retrieve-then-summarize
Random31.17.920.9
TF-IDF32.58.521.4
BM2532.99.022.0
Locator29.97.619.6
Gold span36.614.025.5
End-to-end (Cutoff at max # tokens)
BART-large(1024)32.68.721.6
Longformer-large(4096)31.67.820.5
+ +Table 2: Comparison of different methods for addressing the length of the dialogues on QMSum. All "retrieve-then-summarize" pipelines use BART-Large as a backend for summarization. "Gold span" denotes the annotated relevant turns in QMSum. + +as well as baseline methods to establish reasonable bounds. From Tab. 2, we can see that even in the query-based dialogue summarization with QM-Sum, randomly selecting utterances still presents a strong baseline. Over different modeling choices, the retrieve-then-summarize framework generally works better than end-to-end learning with dialogue cutoff at maximum input length. We do not observe an advantage of using Longformer over the BART model. This raises the question on whether all utterances in the dialogue are needed to produce a good summary or irrelevant utterances would add more noise. Moreover, we notice that all these methods present a non-trivial gap with the summarization performance on the gold span, which uses relevant utterances annotated by humans. This suggests that there is plenty room for improvement if a better utterance retrieval method is developed. + +# 4.2 Robustness to Input Length + +As we discussed, some dialogues (e.g., QMSum) contain more than 20k tokens. They exceed the input limitation of most existing summarization models. In this section, we further analyze the performance of summarization models as the input length changes. To compare the robustness between two types of models (mainly BART and HMNet), we divide the test dialogues by the number of tokens. As we can see in Fig. 1, the performance of the BART model decreases sharply when the dialogue input becomes longer while the HMNet shows the opposite effect. This could be the result of their unique properties: BART is pretrained on the datasets with a limited length (i.e., 1,024) and the input has to be truncated to fit the limitation, while HMNet obtains more information when the + +![](images/a7fa9b7ee72ff129ea911adf2b1abd6f72ea97ac44c1c4c363c641f82e327ce3.jpg) +Figure 1: The ROUGE-L F1 scores of BART and HMNet on QMSum stratified by the number of input dialogue tokens. + +input is longer. However, the overall performance of HMNet is worst than BART. + +# 4.3 Incorporating Queries + +Certain dialogue summarization tasks, such as QMSum, require generating a summary based on a specific question about the dialogue (e.g., opinion of a speaker or conclusion to a topic). In this section, we study the influence of incorporating queries in dialogue summarization. Tab. 4 shows the performance of two models, BART and HMNet, on QMSum with and without queries at the beginning of the input. For the input to the two models, we use the gold relevant text spans given a query in QMSum to avoid the influences of retrieval models. The results show that encoding queries has a large impact on both types of models, especially for BART, even if the gold utterances are given. + +# 4.4 Transfer Ability between Different Tasks + +Pretraining has been shown effective for document summarization by introducing external knowledge from other similar tasks (Hermann et al., 2015; Fabbri et al., 2019). We hypothesize that it is especially important for dialogue summarization because the dataset size is usually small. Therefore, we study the transfer learning between different dialogue summarization tasks via pretraining. Tab. 3 shows the performance of BART-large models that are pretrained using different datasets and later fine-tuned on QMSum and SummScreen-FD. The results show that BART-large pretrained on CNN/Dailymail dataset (BART-CNN) yields the best performance after finetuning, though CNN/Dailymail consists of News articles and is not in dialogue format. We also note that pretraining on external datasets can also hurt the performance, and thus such pretraining datasets need to + +
QMSumSummScreen-FD
ROUGE-1ROUGE-2ROUGE-LROUGE-1ROUGE-2ROUGE-L
BART-Large36.5614.0525.5427.124.8816.82
+ XSum34.9013.4924.9027.174.5917.02
+ MediaSum34.2313.0625.2127.735.0317.09
+ CNN/DM39.8815.9428.0228.865.5517.39
+ CNN/DM-SAMSum35.4612.5224.6228.155.4117.25
+ CNN/DM-MediaSum36.7913.6925.9428.685.3117.42
+ +Table 3: The performance of BART-large models that are pretrained on various summarization datasets. + +
ROUGE-1ROUGE-2ROUGE-L
BART-CNN
w/o Query34.4811.523.11
w/ Query39.8815.9428.02
HMNet
w/o Query35.110.130.8
w/ Query36.810.931.9
+ +Table 4: The performance comparison between BART and HMNet models on the query-based meeting summarization QMSum dataset. + +be carefully chosen. + +We also analyze the performance of BART-large by pretraining it on more than one dataset to test if BART-large can be further improved. We use the BART-large model pretrained on CNN/DM (BARTCNN) as baseline model since BART-CNN yields the best performance compared with the others. And then pretrain the same BART-CNN model on SAMSum and MediaSum separately. However, Tab. 3 shows that after pretraining BARTCNN on these two datasets, ROUGE scores decrease sharply on QMSum dataset, and lightly on SummScreen-FD dataset except for ROUGE-L. This result demonstrates that pretraining on multiple dataset may not further improve the performance of the pretrained models. + +# 4.5 Case Study + +We exam several summaries generated by BARTlarge model pretrained on three different datasets. We found that the BART-CNN model yields the best output with the least number of syntax errors and the closest content to the desired ones, while the output of BART-MediaSum model is usually shorter than Gold resulting in incomplete generation, and BART-XSum model usually predicts summaries with errors and duplication. This could be the result of data bias of pretraining datasets — Summaries in MediaSum and XSum are shorter than CNN/DM. However, despite the better performance of BART-CNN model, these cut-off models + +fail to predict some part of the gold summary when the number of tokens in input dialogue is larger than the maximum input length of the model. For concrete examples, please refer to Appendix A. + +# 5 Conclusion and Future Work + +We first explore the lengthy input problem of dialogue summarization through experiments on transformers and retrieval models. We conclude that the retrieve-summarize pipeline results in the best performance. Then, the experiments demonstrate the important role of queries and robustness to input length for different types of models. We found that adding a single query sentence in the input greatly improves ROUGE scores on QMSum. Additionally, BART performs worse when the input is beyond 512 tokens, even with extended positional embeddings; on the contrary, the hierarchical model performs better for longer inputs. We also test the transferability of summarization datasets by pretraining the language model on similar tasks. We conclude that the BART-large model pretrained on CNN/DM yields the best performance on both QMSum and SummScreen-FD. + +For future work on solving the long input problem, we found that using an utterance retrieval model for summarization is a promising direction, yet modeling relevance between query and dialogue utterances remains a challenging task. And for the summarization models, it is worth exploring methods to 1) pretrain on valuable datasets for dialogue summarization, 2) better fuse the queries into the neural models, and 3) make the model robust to the input length (like HMNet) and maintain the high performance in the meantime (like BART). + +# Acknowledgments + +The authors would like to thank Ming Zhong, Da Yin, Yang Liu for their discussions and anonymous reviewers for their helpful comments. This work is supported in part by a grant from Microsoft Research. + +# References + +Iz Beltagy, Matthew E Peters, and Arman Cohan. 2020. Longformer: The long-document transformer. ArXiv preprint, abs/2004.05150. +Jiaao Chen and Diyi Yang. 2020. Multi-view sequence-to-sequence models with conversational structure for abstractive dialogue summarization. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4106-4118, Online. Association for Computational Linguistics. +Jiaao Chen and Diyi Yang. 2021. Structure-aware abstractive conversation summarization via discourse and action graphs. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1380-1391, Online. Association for Computational Linguistics. +Mingda Chen, Zewei Chu, Sam Wiseman, and Kevin Gimpel. 2021. Summscreen: A dataset for abstractive screenplay summarization. ArXiv preprint, abs/2104.07091. +Arman Cohan, Franck Dernoncourt, Doo Soon Kim, Trung Bui, Seokhwan Kim, Walter Chang, and Nazli Goharian. 2018. A discourse-aware attention model for abstractive summarization of long documents. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), pages 615-621, New Orleans, Louisiana. Association for Computational Linguistics. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 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, Volume 1 (Long and Short Papers), pages 4171-4186, Minneapolis, Minnesota. Association for Computational Linguistics. +Alexander Fabbri, Irene Li, Tianwei She, Suyi Li, and Dragomir Radev. 2019. Multi-news: A large-scale multi-document summarization dataset and abstractive hierarchical model. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1074-1084, Florence, Italy. Association for Computational Linguistics. +Bogdan Gliwa, Iwona Mochol, Maciej Biesek, and Aleksander Wawer. 2019. SAMSum corpus: A human-annotated dialogue dataset for abstractive summarization. In Proceedings of the 2nd Workshop on New Frontiers in Summarization, pages 70-79, Hong Kong, China. Association for Computational Linguistics. +Karl Moritz Hermann, Tomás Kocisky, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman, + +and Phil Blunsom. 2015. Teaching machines to read and comprehend. In Advances in Neural Information Processing Systems 28: Annual Conference on Neural Information Processing Systems 2015, December 7-12, 2015, Montreal, Quebec, Canada, pages 1693-1701. +Adam Janin, Don Baron, Jane Edwards, Dan Ellis, David Gelbart, Nelson Morgan, Barbara Peskin, Thilo Pfau, Elizabeth Shriberg, Andreas Stolcke, et al. 2003. The icsi meeting corpus. In 2003 IEEE International Conference on Acoustics, Speech, and Signal Processing, 2003. Proceedings.(ICASSP'03), volume 1, pages I-I. IEEE. +Karen Sparck Jones. 1972. A statistical interpretation of term specificity and its application in retrieval. Journal of documentation. +Anastassia Kornilova and Vladimir Eidelman. 2019. BillSum: A corpus for automatic summarization of US legislation. In Proceedings of the 2nd Workshop on New Frontiers in Summarization, pages 48-56, Hong Kong, China. Association for Computational Linguistics. +Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. 2020. BART: Denoising sequence-to-sequence pretraining for natural language generation, translation, and comprehension. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7871-7880, Online. Association for Computational Linguistics. +Chin-Yew Lin. 2004. ROUGE: A package for automatic evaluation of summaries. In Text Summarization Branches Out, pages 74-81, Barcelona, Spain. Association for Computational Linguistics. +Iain McCowan, Jean Carletta, Wessel Kraaij, Simone Ashby, S Bourban, M Flynn, M Guillemot, Thomas Hain, J Kadlec, Vasilis Karaiskos, et al. 2005. The ami meeting corpus. In Proceedings of the 5th International Conference on Methods and Techniques in Behavioral Research, volume 88, page 100. Cite-seer. +Shashi Narayan, Shay B. Cohen, and Mirella Lapata. 2018. Don't give me the details, just the summary! topic-aware convolutional neural networks for extreme summarization. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1797-1807, Brussels, Belgium. Association for Computational Linguistics. +Preksha Nema, Mitesh M. Khapra, Anirban Laha, and Balaraman Ravindran. 2017. Diversity driven attention model for query-based abstractive summarization. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1063-1072, Vancouver, Canada. Association for Computational Linguistics. + +Stephen Robertson and Hugo Zaragoza. 2009. The probabilistic relevance framework: Bm25 and beyond. Foundations and Trends in Information Retrieval, 3(4):333-389. +Tobias Rohde, Xiaoxia Wu, and Yinhan Liu. 2021. Hierarchical learning for generation with long source sequences. ArXiv preprint, abs/2104.07545. +Guokan Shang, Wensi Ding, Zekun Zhang, Antoine Tixier, Polykarpos Meladianos, Michalis Vazirgiannis, and Jean-Pierre Lorre. 2018. Unsupervised abstractive meeting summarization with multisentence compression and budgeted submodular maximization. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 664-674, Melbourne, Australia. Association for Computational Linguistics. +Eva Sharma, Chen Li, and Lu Wang. 2019. BIG-PATENT: A large-scale dataset for abstractive and coherent summarization. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 2204-2213, Florence, Italy. Association for Computational Linguistics. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pages 5998-6008. +Manzil Zaheer, Guru Guruganesh, Avinava Dubey, Joshua Ainslie, Chris Alberti, Santiago Ontonon, Philip Pham, Anirudh Ravula, Qifan Wang, Li Yang, et al. 2020. Big bird: Transformers for longer sequences. ArXiv preprint, abs/2007.14062. +Lulu Zhao, Weiran Xu, and Jun Guo. 2020. Improving abstractive dialogue summarization with graph structures and topic words. In Proceedings of the 28th International Conference on Computational Linguistics, pages 437-449, Barcelona, Spain (Online). International Committee on Computational Linguistics. +Ming Zhong, Da Yin, Tao Yu, Ahmad Zaidi, Mutethia Mutuma, Rahul Jha, Ahmed Hassan Awadallah, Asli Celikyilmaz, Yang Liu, Xipeng Qiu, and Dragomir Radev. 2021. QMSum: A new benchmark for query-based multi-domain meeting summarization. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 5905-5921, Online. Association for Computational Linguistics. +Chenguang Zhu, Yang Liu, Jie Mei, and Michael Zeng. 2021. MediaSum: A large-scale media interview dataset for dialogue summarization. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: + +Human Language Technologies, pages 5927-5934, Online. Association for Computational Linguistics. +Chenguang Zhu, Ruochen Xu, Michael Zeng, and Xuedong Huang. 2020a. A hierarchical network for abstractive meeting summarization with cross-domain pretraining. In *Findings of the Association for Computational Linguistics: EMNLP* 2020, pages 194-203, Online. Association for Computational Linguistics. +Chenguang Zhu, Ruochen Xu, Michael Zeng, and Xuedong Huang. 2020b. A hierarchical network for abstractive meeting summarization with cross-domain pretraining. In *Findings of the Association for Computational Linguistics: EMNLP* 2020, pages 194–203, Online. Association for Computational Linguistics. + +# A Generated Cases + +Tab. 5 shows some concrete sample summaries generated by BART-large model pretrained on various datasets. + +
QMSumSummScreen-FD
MediaSumTranscribers are working on transcribing the data from the corpus . The next step is to insure that the data are clean first , and then channelized. The transcribers are also working on ensuring that the mark-up is consistent all the way throughout .Sydney and Will are sent to a secret CIA project to find out if their father is alive or dead . Meanwhile , Sydney and Vaughn are sent to a secret CIA facility to find out what Irina is up to .
XSumThe transcribers have transcribed about thirty-five hours of transcripts from the corpus . The next step is to insure that the data is clean first , and then channelized . The transcribers are working on is to insure that the data is clean first , and then channelized . The transcribers are also incorporating additional conventions that Liz requested in terms of having a systematic handling of numbers , acronyms and acronyms which I had n’t been specific about .Sydney and Will are shocked to learn that Sydney’s father , who was killed in Madagascar , is alive and working for the CIA . Will is also shocked to learn that Sydney’s mother , who was killed in the Rambaldi experiment , is alive . Will is also shocked to learn that Sydney’s father is a scientist . Will is also shocked to learn that Sydney’s mother is a scientist . Will is also shocked to learn that Sydney’s mother is a scientist . …
CNNThe team was working on transcribing the data , and the next step was to ensure that the data was clean first , and then channelized . The team was working on ensuring that the data was spell-checked , that the mark-up was consistent all the way throughout , and that they incorporated additional conventions that Liz requested in terms of having a systematic handling of numbers , acronyms , and acronyms which they had n’t been specific about .Sydney and Will investigate the death of her father , who was killed in a Russian KGB operation in 1982 . They discover that the Rambaldi device was a Russian spy device , which was used to test the IQ of children . Sydney’s father was a KGB agent , and she is now a KGB agent . She is also a double agent , and she is working for the CIA . She is also working for the CIA to find out who is behind the death of her father . Meanwhile , Irina is worried about her father’s death , and she is worried about her relationship with Vaughn .
GoldEfforts by speaker fe008 are in progress to ensure that transcripts are clean ( i.e . spell checked ) , channelized , and conform to set conventions regarding the coding of numbers , acronyms , and explicit comments ( e.g . door slams , coughs , and laughter ) . Subsequent efforts by speaker fe008 will be to tighten up boundaries on the time bins . Inter-annotator agreement was reported to be very good .Speaker mn014 ’s multi-channel speech/non-speech segmenter is in use .Sydney races to find a cure for Vaughn , but in order to find the antidote , Sydney must make a deal with Sark that could endanger Sloane’s life . Meanwhile , Will continues his research for Vaughn and discovers some disturbing inconsistencies involving 20-year - old standardized IQ tests . Sydney finds out that Vaughn has a girlfriend .
+ +Table 5: Sample output summaries of various pretrained models on QMSum and SummScreen. The summary $S$ of row $X$ ,column $Y$ indicates that BART-large model which is pretrained on $X$ dataset generates summary $S$ from test set of $Y$ . The errors and duplication are marked in red. The out-of-boundary contents are marked in grey. Tokens marked in brown indicate the keywords emerged in Gold summary. \ No newline at end of file diff --git a/anexploratorystudyonlongdialoguesummarizationwhatworksandwhatsnext/images.zip b/anexploratorystudyonlongdialoguesummarizationwhatworksandwhatsnext/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..eb412fcb87ebdf8dab9931aa0e523fdd1e8a3e15 --- /dev/null +++ b/anexploratorystudyonlongdialoguesummarizationwhatworksandwhatsnext/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:699e15d3fad2915c1b9d3151bfbbfa4c56de3b505f998dac8ffc5f08af750793 +size 354485 diff --git a/anexploratorystudyonlongdialoguesummarizationwhatworksandwhatsnext/layout.json b/anexploratorystudyonlongdialoguesummarizationwhatworksandwhatsnext/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..477f59817379ed68d8a3649ba3dc411365810397 --- /dev/null +++ b/anexploratorystudyonlongdialoguesummarizationwhatworksandwhatsnext/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a4c1b60b3ff0a5d77c931e7fb736def4f1c692a94877cf0a3660827d999be18 +size 200939 diff --git a/aniterativemultiknowledgetransfernetworkforaspectbasedsentimentanalysis/c095bbb5-9c36-4b1f-a6ad-269154190c13_content_list.json b/aniterativemultiknowledgetransfernetworkforaspectbasedsentimentanalysis/c095bbb5-9c36-4b1f-a6ad-269154190c13_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..f5311743b9e68ed59b6780a1a99ad852b2d3cc1e --- /dev/null +++ b/aniterativemultiknowledgetransfernetworkforaspectbasedsentimentanalysis/c095bbb5-9c36-4b1f-a6ad-269154190c13_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eeb28a4d486f223f9a11e1b7626a5c9e90a99a79c9aae09528c7b15c4b412f40 +size 97081 diff --git a/aniterativemultiknowledgetransfernetworkforaspectbasedsentimentanalysis/c095bbb5-9c36-4b1f-a6ad-269154190c13_model.json b/aniterativemultiknowledgetransfernetworkforaspectbasedsentimentanalysis/c095bbb5-9c36-4b1f-a6ad-269154190c13_model.json new file mode 100644 index 0000000000000000000000000000000000000000..34b258564cf50558cf6130768256de90ad311560 --- /dev/null +++ b/aniterativemultiknowledgetransfernetworkforaspectbasedsentimentanalysis/c095bbb5-9c36-4b1f-a6ad-269154190c13_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e9b6814ca50e71a501eb87b8752e10abda2bdb096d476e93218797c676a6097 +size 122391 diff --git a/aniterativemultiknowledgetransfernetworkforaspectbasedsentimentanalysis/c095bbb5-9c36-4b1f-a6ad-269154190c13_origin.pdf b/aniterativemultiknowledgetransfernetworkforaspectbasedsentimentanalysis/c095bbb5-9c36-4b1f-a6ad-269154190c13_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..302d93228588fe1f2e4c382ad353007dcb1a3131 --- /dev/null +++ b/aniterativemultiknowledgetransfernetworkforaspectbasedsentimentanalysis/c095bbb5-9c36-4b1f-a6ad-269154190c13_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d6479ad13164be9b00136b87ff469b5967d27af8e531cd08e8619c284c5356ba +size 1190988 diff --git a/aniterativemultiknowledgetransfernetworkforaspectbasedsentimentanalysis/full.md b/aniterativemultiknowledgetransfernetworkforaspectbasedsentimentanalysis/full.md new file mode 100644 index 0000000000000000000000000000000000000000..7acc9430768714900b8bf4df0c84a5bef7a37cfb --- /dev/null +++ b/aniterativemultiknowledgetransfernetworkforaspectbasedsentimentanalysis/full.md @@ -0,0 +1,413 @@ +# An Iterative Multi-Knowledge Transfer Network for Aspect-Based Sentiment Analysis + +Yunlong Liang $^{1,2*}$ , Fandong Meng $^{2}$ , Jinchao Zhang $^{2}$ , Yufeng Chen $^{1}$ , Jinan Xu $^{1\dagger}$ and Jie Zhou $^{2}$ + +1Beijing Key Lab of Traffic Data Analysis and Mining, Beijing Jiaotong University, Beijing, China + +$^{2}$ Pattern Recognition Center, WeChat AI, Tencent Inc, China + +{yunlongliang, chenyf, jaxu}@bjtu.edu.cn + +{fandongmeng, dayerzhang, withtomzhou}@tencent.com + +# Abstract + +Aspect-based sentiment analysis (ABSA) mainly involves three subtasks: aspect term extraction, opinion term extraction, and aspect-level sentiment classification, which are typically handled in a separate or joint manner. However, previous approaches do not well exploit the interactive relations among three subtasks and do not pertinently leverage the easily available document-level labeled domain/sentiment knowledge, which restricts their performances. To address these issues, we propose a novel Iterative Multi-Knowledge Transfer Network (IMKTN) for end-to-end ABSA. For one thing, through the interactive correlations between the ABSA subtasks, our IMKTN transfers the task-specific knowledge from any two of the three subtasks to another one at the token level by utilizing a well-designed routing algorithm, that is, any two of the three subtasks will help the third one. For another, our IMKTN pertinently transfers the document-level knowledge, i.e., domain-specific and sentiment-related knowledge, to the aspect-level subtasks to further enhance the corresponding performance. Experimental results on three benchmark datasets demonstrate the effectiveness and superiority of our approach. + +# 1 Introduction + +Aspect-based sentiment analysis (ABSA) has drawn increasing attention in the community, which includes three subtasks: aspect term extraction (AE), opinion term extraction (OE) and aspect-level sentiment classification (SC). The first two subtasks aim to extract the aspect term and the opinion term appearing in one sentence, respectively. The goal of the SC subtask is to detect + +the sentiment polarity towards the extracted aspect term. + +Most existing studies generally handle each task separately (Tang et al., 2016; Wang et al., 2016b; Hu et al., 2019b) or take OE as auxiliary task for AE or SC (Wang et al., 2017; Li et al., 2018b; He et al., 2019), where these separate approaches need to be pipelined or integrated together for practical use. Recently, some researches point out that joint methods can achieve promising performance than separate ones, where only two subtasks are coupled, such as $\langle \mathrm{AE}, \mathrm{OE} \rangle$ (Wang et al., 2017; Dai and Song, 2019) or $\langle \mathrm{AE}, \mathrm{SC} \rangle$ (Luo et al., 2019; Zhou et al., 2019; He et al., 2019; Liang et al., 2021). More recently, Chen and Qian (2020) focus on modeling the interactive relations, i.e., bidirectional $\mathrm{AE} \leftrightarrow \mathrm{OE}$ , unidirectional $\mathrm{AE} \rightarrow \mathrm{SC}$ and unidirectional $\mathrm{OE} \rightarrow \mathrm{SC}$ with a collaborative learning framework. To further enhance these subtasks, several researchers seek to the external accessible document-level corpora (containing domain-specific/sentiment-related knowledge1) due to the limited aspect-level data (Dai and Song, 2019; Chen and Qian, 2019; He et al., 2018, 2019). As a better case, He et al. (2019) merge the document-level domain-specific and sentiment-related knowledge together to enhance the AE and SC subtasks, where the two kinds of knowledge are indiscriminate.2 Despite their effectiveness, we argue that the above methods are insufficient to yield satisfactory results for end-to-end ABSA task due to 1) they merely couple two subtasks or not modeling all bidirectional interactive relations among three subtasks (AE $\leftrightarrow$ OE, AE $\leftrightarrow$ SC and OE $\leftrightarrow$ SC), and 2) the document-level domain-specific/sentiment-related knowledge is coarsely used, which is insufficient + +to exert their advantages. + +First, the interactive relations among three aspect-level subtasks are mutually collaborative. For instance, in the sentence "The fish is very delicious," the opinion term "delicious" indicates that the sentiment polarity of the aspect term "fish" is positive, suggesting the strong interactive correlation among them. Conversely, given the aspect term "fish" and its sentiment polarity positive, the word "delicious" rather than other words (e.g., "very") in the sentence will be easily extracted as an opinion term. Therefore, the bidirectional relations between three aspect-level subtasks are closely related and they can incrementally promote one another, as shown in the left part of Fig. 1. + +Second, the document-level corpora, which contain domain-specific and sentiment-related knowledge, should be pertinently utilized for enhancing the three aspect-level subtasks of ABSA. In fact, most aspect and opinion terms own distinct domain-specific properties (Peng et al., 2018) while sentiment polarities (i.e., positive, negative, and neutral) are typically domain-invariant. For instance, the aspect term "fish" and the opinion term "delicious" reflect distinct domain-specific characteristics, indicating that they belong to Restaurant domain rather than Laptop domain. Conversely, the domain-specific properties can help distinguish these aspect and opinion terms from other domains or background words (e.g., "very"). Therefore, the domain-specific knowledge should be pertinently leveraged to help identify the aspect term and the opinion term rather than on judging sentiment polarity. Meanwhile, the sentiment-related knowledge should be targeted at benefiting the SC subtask rather than the AE and OE subtasks, as shown in the right part of Fig. 1. + +Therefore, we propose an Iterative Multi-Knowledge Transfer Network (IMKTN) to fully exploit the interactive relations via transferring knowledge at both the token level and the document level for the ABSA task. Partially inspired by the superiority of capsule network in distinguishing different features by feature clustering (Sabour et al., 2017), we design a novel routing algorithm, which can mutually transfer task-specific knowledge among the three aspect-level subtasks, as illustrated in the left part of Fig. 1. Furthermore, IMKTN employs a more fine-grained way to pertinently transfer document-level knowledge to aspect-level subtasks, as shown in the right part + +![](images/4fcdce97262f7c926b81831661b1a095fc8aeeb045fa290de7b03e3c01c3ef19.jpg) +Figure 1: The interactive relations among three aspect-level subtasks (the left) and two document-level subtasks (the right), which are explicitly modeled through knowledge transferring. Three aspect-level subtasks are highly semantic correlated, and thus can incrementally facilitate one another through task-specific knowledge transfer. The domain-specific knowledge from domain classification is only transferred to aspect and opinion term extraction, and the sentiment-related knowledge from document-level sentiment classification is only for aspect-level sentiment classification. + +of Fig. 1, where the knowledge from domain classification subtask only serves for the AE and OE subtasks while the knowledge from document-level sentiment classification subtask only helps the SC subtask. All multi-knowledge transfer processes are iteratively conducted for fully exploiting the knowledge in all tasks to enhance the ABSA task. + +In summary, our contributions are three-fold: + +- We propose an iterative multi-knowledge transfer network for the ABSA task, which can well exploit the interactive relations via transferring the task-specific knowledge from any two of the three aspect-level subtasks to the third one for mutual promotion using a well-designed routing algorithm. +- We propose a more fine-grained way to pertinently transfer the document-level knowledge to further enhance the aspect-level tasks. +- Our approach ${}^{3}$ significantly outperforms the existing methods and achieves new state-of-the-art results on three benchmark datasets, namely SemEval14 (Restaurant14 and Laptop14) (Pontiki et al., 2014) and SemEval15 (Restaurant15) (Pontiki et al., 2015). + +# 2 Task Definition + +In this section, we formulate the aspect-level tasks and document-level tasks, where the document-level tasks are taken as auxiliary tasks for improving the aspect-level tasks. + +![](images/a4546cfaded633ea44a3c54b4be0db24fd50531fb1e1ff5014a096f7ca8484e9.jpg) +Figure 2: The model architecture of IMKTN. AE: aspect term extraction; OE: opinion term extraction; SC: aspect-level sentiment classification. To fully exploit the inter-task correlations among the three aspect-level subtasks for mutual promotion, the knowledge from them is mutually transferred to each other via the "Routing Block". Besides, the knowledge from $CNN^{ddc}$ is only transferred to the AE and OE subtasks. The knowledge from $CNN^{dsc}$ is only transferred to the SC subtask. In summary, all the multi-knowledge transfer processes are iteratively conducted for adequately exploiting the knowledge from all the subtasks to enhance the ABSA task. + +Aspect-Level Tasks. Following (Chen and Qian, 2020), the ABSA task is formulated as three sequence labeling subtasks. Given an input sentence $\mathrm{S} = \{w_i\}_{i=1}^n$ with $n$ words: 1) For the AE subtask, we aim to inference a tag sequence $\mathrm{Y}^{ae} = \{y_i^{ae}\}_{i=1}^n$ , where $y_i^{ae} \in \mathcal{Y}^{ae} = \{\mathrm{BA}, \mathrm{IA}, \mathrm{O}\}$ denotes the beginning and the inside of an aspect term, and other words. 2) For the OE subtask, we aim to inference a tag sequence $\mathrm{Y}^{oe} = \{y_i^{oe}\}_{i=1}^n$ , where $y_i^{oe} \in \mathcal{Y}^{oe} = \{\mathrm{BP}, \mathrm{IP}, \mathrm{O}\}$ denotes the beginning and the inside of an opinion term, and other words. 3) For the SC subtask, we aim to inference a tag sequence $\mathrm{Y}^{sc} = \{y_i^{sc}\}_{i=1}^n$ , where $y_i^{sc} \in \mathcal{Y}^{sc} = \{\mathrm{pos}, \mathrm{neg}, \mathrm{neu}\}$ denotes positive, negative and neutral sentiment polarities. + +Document-Level Tasks. This work contains two document-level subtasks: domain classification (DDC) and sentiment classification (DSC). For an input document $\mathrm{D} = \{\mathrm{S}_1, \mathrm{S}_2, \dots, \mathrm{S}_m\}$ with $m$ sentences, the DDC and DSC aim to predict a domain label $\mathrm{Y}^{ddc} \in \{\text{Laptop}, \text{Restaurant}\}$ and a sentiment label $\mathrm{Y}^{dsc} \in \mathcal{V}^{sc}$ , respectively. + +# 3 Model + +As shown in Fig. 2, the IMKTN consists of four parts: 1) Shared Encoder, for extracting n-gram features; 2) Task-Specific Layers, for capturing sentence representations; 3) Aspect-Level Knowledge Transfer, including three Routing Blocks, for fully transferring knowledge among the aspect-level subtasks for mutual reinforcing; and 4) Document-Level Knowledge Transfer, for pertinently transfer + +ring document-level knowledge to corresponding aspect-level tasks. Finally, multi-source information is aggregated for the next iteration. + +# 3.1 Shared Encoder + +We apply two modules to extract sentence features, 1) we adopt Convolutional Neural Network (CNN) (Kim, 2014) as the feature extractor (Kalchbrenner et al., 2014); 2) we investigate a more powerful encoder (i.e., BERT (Devlin et al., 2018)) as the backbone. The encoder is shared by the three aspect-level tasks and the two document-level tasks for providing common features. + +# 3.2 Task-Specific Layers + +Based on the Shared Encoder, 1) we design three aspect-level task-specific layers: $CNN^{ae}$ , $CNN^{oe}$ and $CNN^{sc}$ , aiming to generate aspect-related knowledge, opinion-related knowledge, and sentiment-related knowledge, respectively; and 2) two document-level task-specific layers: $CNN^{ddc}$ and $CNN^{dsc}$ , for producing domain-specific features and sentiment features, respectively. + +# 3.3 Aspect-Level Knowledge Transfer + +As shown in Fig. 2, we design an aspect-level knowledge transfer layer, consisting of three Routing Blocks, to take full advantage of the inter-task knowledge among the three aspect-level subtasks. + +Routing Block. The routing block serves for transferring knowledge among the aspect-level subtasks as shown in the "Routing Block" part of Fig. 2. Taking the "Routing Block #SC" for example, its + +![](images/77c6f3098b997bf775857ba32e01b7e258369f2c9b348071655b53b048df8f24.jpg) +Figure 3: An example of the internal structure of "Routing Block #SC" as shown in Fig. 2. The knowledge of the AE and OE subtasks is transferred to the SC subtask through iter rounds of iteration, that is, the AE and OE subtasks will help the SC subtask. + +internal structure is shown in Fig. 3, in which the knowledge from AE and OE is transferred to SC for enhancing its performance via our routing algorithm. We use the same algorithm to transfer knowledge from OE and SC to AE through the "Routing Block #AE", from AE and SC to OE through the "Routing Block #OE". In the conventional routing algorithm (Sabour et al., 2017), the high-level capsules are in a predefined fixed number, e.g., the total number of categories. While in our task, the high-level capsules are in dynamic numbers, where the number is determined by the sentence length. To this end, we propose a new routing algorithm, which is elaborated in detail below. + +We show the whole routing process in Algorithm 1 by taking "transferring knowledge from OE to SC" as example. Specifically, the inputs of Algorithm 1 are the representation of OE $(\mathbf{h}_i^{oe} \in \mathbb{R}^{d_h})$ and iteration number (iter) (line 1). The $b_{j|i}$ is the probability indicating that the representation of the $i$ -th token in OE agrees to be routed to the representation of the $j$ -th token in SC, which is initialized with zero (line 2). The $\mathbf{W}^p \in \mathbb{R}^{n \times d_h \times d_o}$ is position-aware transformation matrix, which is realized via adding positional encoding (Vaswani et al., 2017), i.e., using AddPos( $\cdot$ ) function to obtain the shared transformation matrix $\mathbf{W}$ (line 3), where $\mathbf{W} \in \mathbb{R}^{d_h \times d_o}$ . $PE_{(*)}$ is defined as: + +$$ +P E _ {(p o s, 2 p)} = \sin (p o s / 1 0 0 0 0 ^ {2 p / d _ {m o d e l}}), +$$ + +$$ +P E _ {(p o s, 2 p + 1)} = \cos (p o s / 1 0 0 0 0 ^ {2 p / d _ {m o d e l}}), +$$ + +where $pos$ is token position in sentence, $p$ is the positional index of the dimension and $d_{model}$ is the input dimension. By doing so, the Algorithm can output capsules in dynamic numbers determined + +# Algorithm 1 Routing + +1: procedure ROUTING ALGORITHM $(\mathbf{h}_i^{oe},iter)$ + +2: $\forall i\in OE,\forall j\in SC,1\leq i,j\leq n,b_{j|i}\gets 0.$ +3: $\mathbf{W}^p = \mathrm{AddPos}(\mathrm{tile}^a (\mathbf{W},n),PE_{(pos,2p)},PE_{(pos,2p + 1)})$ +4: $\hat{\mathbf{u}}_{j|i} = \mathbf{h}_i^{oe}\mathbf{W}_{ij}^p$ +5: for iter iterations do +6: $\forall i\in OE:\mathbf{c}_i\gets \mathrm{softmax}(\mathbf{b}_i)$ +7: $\forall j\in SC\colon \mathbf{s}_j\gets \Sigma_i c_{j|i}\hat{\mathbf{u}}_j|i$ +8: $\forall j\in SC:\mathbf{v}_j^{oe}\gets \mathrm{squash}(\mathbf{s}_j)$ +9: $\forall i\in OE.\forall j\in SC:b_{j|i}\gets b_{j|i} + \hat{\mathbf{u}}_{j|i}\cdot \mathbf{v}_j^{oe}$ +10: end for +11: Return $\mathbf{v}_j^{oe}$ +12: end procedure + +The tile operation of Tensorflow (Abadi et al., 2016). + +by the sentence length. The $\hat{\mathbf{u}}_{j|i}$ denotes the resulting opinion knowledge vector generated by multiplying the representation $\mathbf{h}_i^{o e}$ with the specially-designed transformation matrix $\mathbf{W}^p$ (line 4). + +During each iteration (line 5), the coupling coefficients between low-level capsules $\mathbf{h}_i^{oe}$ and high-level capsules $\mathbf{v}$ are obtained by applying the softmax function (line 6). Then $\mathbf{s}_j$ is calculated by aggregating all opinion vectors with $c_{j|i}$ as weights, voting for the sentiment polarity of the $j$ -th token (line 7). After that the squash $(\mathbf{s}_j) = \frac{||\mathbf{s}_j||^2}{1 + ||\mathbf{s}_j||^2} \cdot \frac{\mathbf{s}_j}{||\mathbf{s}_j||}$ scales the output $\mathbf{s}_j$ non-linearly to $0 \sim 1$ (line 8). Once the $\mathbf{v}_j$ is updated in the current iteration, the probability $b_{j|i}$ becomes larger if the dot product $\hat{\mathbf{u}}_{j|i} \cdot \mathbf{v}_j^{oe}$ is large (line 9). That is, when the $\hat{\mathbf{u}}_{j|i}$ is more similar to the $\mathbf{v}_j^{oe}$ , the dot product is larger, meaning that it is more likely to route this opinion knowledge to the $j$ -th token and thus affects its sentiment polarity. Therefore, larger $b_{j|i}$ will lead to a larger agreement value $c_{j|i}$ between the opinion knowledge of the $i$ -th token and the sentiment representation of the $j$ -th token in the next iteration. In contrast, it generates low $c_{j|i}$ when there is no correlation between $\hat{\mathbf{u}}_{j|i}$ and $\mathbf{v}_j^{oe}$ . After iter rounds of iteration, agreement values learned via the routing process ensure the opinion knowledge will be sent to the appropriate sentiment representation. + +Similarly, we obtain the knowledge $\mathbf{v}_j^{ae}$ , which is transferred from AE to SC, indicating which token should be correctly labeled with the sentiment polarity. Then the knowledge from AE and OE subtasks is combined as follows: + +$$ +\mathbf {h} _ {j} ^ {s c} = \operatorname {C o n c a t} \left(\mathbf {h} _ {j} ^ {s c}, \mathbf {v} _ {j} ^ {a e}, \mathbf {v} _ {j} ^ {o e}\right), +$$ + +where $\mathbf{h}_j^{sc} \in \mathbb{R}^{d_h + 2d_o}$ is the $j$ -th hidden state of the SC subtask (we set dimension size of all output capsules to $d_o$ ). + +Through the process above, the multi-knowledge + +transfer in "Routing Block #SC" is finished, which determines the sentiment polarity of each token in SC. Similarly, we achieve multi-knowledge transfer in "Routing Block #OE" and "Routing Block #AE" in Fig. 2. By doing so, three aspect-level subtasks are interacted with one another to fully exploit the inter-task correlations. + +# 3.4 Document-Level Knowledge Transfer + +We design the following two ways to pertinently transfer document-level knowledge to corresponding aspect-level tasks. (1) We transfer domain-specific knowledge $(a_{i}^{ddc(t)}$ and $a_{i}^{ddc(t)}$ ) from the DDC subtask to the AE and OE subtasks: + +$$ +\mathbf {h} _ {i} ^ {q (t + 1)} = f _ {1} ([ \mathbf {h} _ {i} ^ {q (t)}; \hat {\mathbf {y}} _ {i} ^ {a e (t)}; \hat {\mathbf {y}} _ {i} ^ {o e (t)}; \hat {\mathbf {y}} _ {i} ^ {s c (t)}; y _ {i} ^ {d d c (t)}; a _ {i} ^ {d d c (t)} ]), +$$ + +where $q \in \{ae, oe\}$ , $t$ is the iteration number $(0 \leq t \leq T)$ , $[\cdot; \cdot]$ denotes concatenation operation, $f_1(\cdot)$ is fully-connected layer and $\hat{\mathbf{y}}_i^{o(t)}$ is the prediction on the $i$ -th token at the $t$ -th iteration, which is proved helpful in (He et al., 2019), $o \in \{ae, oe, sc\}$ . (2) We transfer sentiment-related knowledge $(\hat{\mathbf{y}}^{dsc(t)}$ and $a_i^{dsc(t)}$ from the DSC subtask to the SC subtask: + +$$ +\begin{array}{l} \mathbf {h} _ {i} ^ {s c (t + 1)} = f _ {2} ([ \mathbf {h} _ {i} ^ {s c (t)}; \hat {\mathbf {y}} _ {i} ^ {a e (t)}; \hat {\mathbf {y}} _ {i} ^ {o e (t)}; \hat {\mathbf {y}} _ {i} ^ {s c (t)}; \\ \hat {\mathbf {y}} ^ {d s c (t)}; a _ {i} ^ {d s c (t)} ], \\ \end{array} +$$ + +where $f_{2}(\cdot)$ is fully-connected layer. $a_{i}^{s(t)}$ ( $s \in \{ddc, dsc\}$ ) is the self-attention weight (at the document level): + +$$ +a _ {i} ^ {s (t)} = \frac {\exp (\mathbf {h} _ {i} ^ {s (t)} \mathbf {W} ^ {s})}{\sum_ {k = 1} ^ {n} \exp (\mathbf {h} _ {k} ^ {s (t)} \mathbf {W} ^ {s})}, +$$ + +where $\mathbf{W}^s$ is the trainable parameter. The document representation is computed by + +$$ +\mathbf {h} ^ {s (t)} = \sum_ {i = 1} ^ {n} a _ {i} ^ {s (t)} \mathbf {h} _ {i} ^ {s (t)}. +$$ + +Then a fully-connected layer with softmax function is applied to map $\mathbf{h}^{s(t)}$ to $\hat{\mathbf{y}}^{s(t)}$ . + +Overall, the IMKTN can fully perform knowledge transfer via the routing algorithm and pertinently incorporate the document-level knowledge to enhance the corresponding aspect-level tasks through such $T$ rounds of iteration. + +
DatasetsTrainTest
#sent#aspect#opinion#sent#aspect#opinion
D1Restaurant143,0443,6993,4848001,1341,008
D2Laptop143,0482,3732,504800654674
D3Restaurant151,3151,1991,210685542510
+ +Table 1: Dataset statistics. #sent: sentences, #aspect: aspect terms and #opinion: opinion terms. + +# 3.5 Training + +For training, we minimize the loss on each token of aspect-level tasks and each instance of document-level tasks with the cross-entropy function. The aspect-level loss functions are written as follows: + +$$ +\mathcal {J} _ {a} = \lambda_ {1} \mathcal {L} _ {a e} + \lambda_ {2} \mathcal {L} _ {o e} + \lambda_ {3} \mathcal {L} _ {s c}, +$$ + +$$ +\mathcal {L} _ {o} = \frac {1}{n} \sum_ {i = 1} ^ {n} \left(\min \left(- \sum_ {r = 0} ^ {C _ {1}} \mathbf {y} _ {i, r} ^ {o} \log \left(\hat {\mathbf {y}} _ {i, r} ^ {o (T)}\right)\right), \right. +$$ + +where $\lambda_{1},\lambda_{2}$ and $\lambda_{3}$ are discount coefficients, $o\in$ $\{ae,oe,sc\}$ n is the sentence length, $C_1$ is the class number, $\mathbf{y}_{i,r}^{o}$ denotes the ground-truth and $\hat{\mathbf{y}}_{i,r}^{o(T)}$ denotes the predictions with $T$ times iteration. The document-level loss functions are formulated as follows: + +$$ +\mathcal {J} _ {d} = \lambda_ {4} \mathcal {L} _ {d d c} + \lambda_ {5} \mathcal {L} _ {d s c}, +$$ + +$$ +\mathcal {L} _ {s} = m i n (- \sum_ {r = 0} ^ {C _ {2}} \mathbf {y} _ {r} ^ {s} \mathrm {l o g} (\hat {\mathbf {y}} _ {r} ^ {s (T)})), +$$ + +where $\lambda_4$ and $\lambda_5$ are discount coefficients, $s \in \{ddc, dsc\}$ , $C_2$ is the class number, $\mathbf{y}_r^s$ denotes the ground-truth and $\hat{\mathbf{y}}_r^{s(T)}$ denotes the predictions after $T$ times iteration. + +For training the whole model, we firstly train the network with document-level tasks for a few epochs to generate reasonable features for aspect-level tasks. Then we train the network on the aspect-level and document-level corpus alternately, to minimize the corresponding loss. + +# 4 Experiments + +# 4.1 Experimental Settings + +Datasets. We evaluate our model on three benchmark datasets from SemEval 2014 (Restaurant14 and Laptop14) (Pontiki et al., 2014) and SemEval 2015 (Restaurant15) (Pontiki et al., 2015), the data statistics of which is shown in Tab. 1. The opinion terms of these three datasets are annotated by Wang et al. (2016a). We adopt two document-level datasets from He et al. (2019), which include 30k instances of Yelp restaurant domain and 30k instances of Amazon electronic domain, respectively. + +We merge the two datasets with domain labels for domain classification. We use the Yelp data when training on D1 and D3, and use the Amazon data for D2, due to the domain-specific properties. + +Implementation Details. For fair comparison, we train our models with the same settings as comparison models (Chen and Qian, 2020). We tune the iteration number $T$ and the routing number iter on each validation set. More implementation and tuning details are given in Appendix A and B. + +Evaluation Metrics. Following (Chen and Qian, 2020), four metrics are applied for evaluation, and the average score over 5 runs with random initialization is reported in all experiments. We use F1-ae, F1-oe and F1-sc to denote the F1-score of each subtask. We use F1-score denoted as F1-absa to measure the complete ABSA, where an extracted aspect term is taken as correct only when the span and the sentiment are both correct. + +# 4.2 Comparison Models + +To validate the performance of our proposed model on the ABSA task, we conduct contrast experiments with the following methods: + +Pipeline Models. We respectively select two top performing models for AE: CMLA (Wang et al., 2017) and DECNN (Xu et al., 2018), and SC: TNet (Li et al., 2018a) and TCap (Chen and Qian, 2019), to construct $2 \times 2$ pipeline baselines. SPANBERT (Hu et al., 2019b) utilizes $BERT_{LARGE}$ as backbone networks for AE and SC subtasks. + +Integrated Models. MNN (Wang et al., 2018) and INABSA (Li et al., 2019a): Both models handle the aspect term-polarity co-extraction as a sequence labeling problem with a unified tagging scheme. + +Joint Models. The joint models including DOER (Luo et al., 2019), Span-based (Zhou et al., 2019), IMN (He et al., 2019), DREGCN (Liang et al., 2021), and RACL (Chen and Qian, 2020) are used to compare with ours, which are introduced in §1 part. + +For fair comparison, we validate IMKTN based on two encoders. 1) Based on CNN, we use GloVe embeddings (Pennington et al., 2014) and denote it as IMKTN-GloVe. 2) Based on + +$BERT_{LARGE}$ (Devlin et al., 2018), we fine-tune it for ABSA, denoted as IMKTN-BERT). + +# 4.3 Main Results + +Results in Tab. 2 are divided into four groups: M1~M4, M5~M6, and M7~M12 are GloVe-based pipeline, integrated, and joint models, respectively. M13~M17 are BERT-based models. + +1) Among all GloVe-based models (M1~M12), our IMKTN-GloVe significantly surpasses other baselines in most cases, and achieves 2.13%, 2.33%, and 2.86% absolute gains over RACL in terms of the overall metric F1-absa on three datasets. This suggests that the inter-task correlations and document-level knowledge have an overall positive impact on these subtasks, and demonstrates the superiority of our model. Furthermore, IMKTN-GloVe also obtains the best or the second best results on all subtasks, which further shows the effectiveness of our model. Another observation is that the joint models (M7~M12) perform better than pipeline and integrate models (M1~M6). + +2) All BERT-based models get higher results than GloVe-based models thanks to the large-scale external knowledge (M13~M17 vs. M1~M12). Among all BERT-based Models, we observe that IMKTN-BERT significantly outperforms other BERT-based models, which suggests the effectiveness of our approach by transferring multi-source knowledge even based on the strong baseline and yields new state-of-the-art results on most metrics. + +# 5 Analysis and Discussion + +# 5.1 Whether Three Aspect-Level Subtasks Promote Each Other? + +We evaluate the aspect-opinion pair F1 and aspect-opinion-sentiment triplet F1 on the test set (Fan et al., 2019; Peng et al., 2020; Xu et al., 2020b), for verifying whether the multi-knowledge transferring can help each other. The results are shown in Tab. 3, where IMKTN-D denotes removing all document-level knowledge transferring. We can see that our IMKTN-D can surpass the comparison models by a large margin under two settings. Particularly, in the aspect-opinion-sentiment triplet setting, IMKTN-D significantly outperforms other baselines, suggesting that inter-task knowledge transferring has an overall positive impact on these + +
ModelsRestaurant14 (D1)Laptop14 (D2)Restaurant15 (D3)
F1-aeF1-oeF1-scF1-absaF1-aeF1-oeF1-scF1-absaF1-aeF1-oeF1-scF1-absa
M1CMLA-TNet*81.9183.8469.6964.4977.4976.0668.3055.9467.7370.5662.2755.00
M2CMLA-TCap*82.4582.6772.2365.3476.8077.3369.5255.5668.5571.0766.4555.47
M3DECNN-TNet*82.79-70.4565.8079.38-68.6957.3968.52-62.4155.69
M4DECNN-TCap*82.79-71.7766.8479.38-69.6157.7168.52-63.6056.22
M5MNN*83.0584.5568.4563.8776.9477.7765.9853.8070.2469.3857.9056.57
M6INABSA*83.9284.9768.3866.6077.3476.6268.2455.8869.4071.4358.8157.38
M7DOER*84.63-64.5068.5580.21-60.1856.7167.47-36.7650.31
M8Span-based84.13-69.7368.2278.43-69.7757.5769.96-59.9558.97
M9IMN‡83.3385.6175.6669.5477.9677.5172.0258.3770.0471.9471.7659.18
M10DREGCN‡85.9386.0573.3270.2179.4575.4073.4661.6071.0070.5573.3561.06
M11RACL*85.3785.3274.4670.6781.9979.7671.0960.6372.8278.0668.6960.31
M12IMKTN-GloVe87.91†87.65†76.66†72.80†83.19†81.82†74.93†62.96†74.96†74.4875.39†63.17†
M13SPAN-BERT*86.71-71.7573.6882.34-62.5061.2574.63-50.2862.29
M14IMN-BERT*84.0685.1075.6770.7277.5581.0075.5661.7369.9073.2970.1060.22
M15DREGCN-BERT‡87.0086.9575.7972.6079.7879.2176.3763.0473.3072.6073.0262.37
M16RACL-BERT*86.3887.1881.6175.4281.7979.7273.9163.4073.9976.0074.9166.05
M17IMKTN-BERT87.13†88.62†81.3576.75†83.89†81.90†76.42†65.74†74.6376.79†76.85†68.33†
+ +Table 2: Model comparison. We separate the results into the GloVe-based (M1~M12) and BERT-based (M13~M17) methods for fair comparison. Following RACL (Chen and Qian, 2020), we report average results over 5 runs with random initialization. The results with the symbol “*” refer to RACL. “‡” indicates that the results are referred to the original paper. “†” denotes our method is statistically significant (Koehn, 2004) better than RACL ( $p$ -value $< 0.05$ ), which is the best previous model. + +
ModelsD1D2D3
Aspect-Oinion PairIMN‡54.9454.8756.45
DREGCN‡53.7654.8955.23
RACL‡54.6754.7556.74
IMKTN-D56.74†56.60†58.32†
Aspect-Oinion-Sentiment TripletIMN‡50.9541.2145.65
DREGCN‡49.3241.9744.38
RACL‡50.6541.5545.45
IMKTN-D52.45†44.82†48.50†
+ +Table 3: F1 scores $(\%)$ . The aspect-sentiment pair results are shown in Tab. 2, i.e., F1-absa score. "n": results are generated by running their official code. "†": significantly better than RACL ( $p$ -value $< 0.05$ ). + +
#MethodsF1-aeF1-oeF1-sc
0Coarse way81.0685.0265.44
1Fine-Grained way82.2586.3668.80
+ +aspect-level subtasks and hence the aspect-level subtasks indeed can promote each other. + +# 5.2 Whether Pertinently Transferring Document-Level Knowledge Helps Aspect-Level Subtasks More? + +In Tab. 4, the "Coarse way" (He et al., 2019) indicates that the knowledge from DDC and DSC is merged to indistinguishably enhance all aspect-level tasks. By contrast, the "Fine-Grained way" is to pertinently transfer the knowledge, i.e., the + +Table 4: F1 (%) on the validation set of D1. + +
#ModelsD1D2D3
0w/o AE KT1.05/1.98↓1.56/1.44↓1.45/3.45↓
1w/o OE KT0.98/0.45↓0.96/0.52↓1.13/2.09↓
2w/o SC KT1.89/2.78↓1.83/2.23↓2.38/4.54↓
3w/o DDC1.88/2.03↓1.87/1.82↓1.54/3.37↓
4w/o DSC2.37/2.77↓2.13/2.43↓2.87/5.04↓
+ +Table 5: Ablation study. “↓” denotes a performance drop of “IMKTN-GloVe/IMKTN-BERT” on the validation set (F1-absa). “KT”: knowledge transferring. + +knowledge from DDC only transferred to AE and OE subtasks, and the knowledge from DSC only transferred to SC subtask. The results show that pertinently transferring document-level knowledge helps aspect-level subtasks more, which is consistent with our intuition that the domain-specific knowledge prefers to promote the AE and OE subtasks, and the sentiment-related knowledge tends to improve the SC subtask. Therefore, a fine-grained way is very necessary to enhance the ABSA. + +# 5.3 Ablation Study + +Tab. 5 shows the impact of different knowledge, where we remove one knowledge at a time. We conclude that: (1) once any of the aspect-level subtask knowledge transfer is removed (rows $0\sim 2$ ), scores on three benchmark datasets decrease under the both setting (i.e., GloVe and $BERT_{LARGE}$ ), showing that the three aspect-level subtasks are + +highly semantically correlated and thus can incrementally boost one another. (2) we also observe obvious drops when removing the document-level knowledge, especially when the DSC subtask is removed, suggesting that pertinently transferring the document-level knowledge significantly benefits the corresponding aspect-level tasks (rows $3\sim 4$ + +# 5.4 Why using Capsule Network? + +In our preliminary experiments, we conduct some experiments to investigate how to effectively transfer knowledge between different tasks. The results are shown in Tab. 6, where the capsule network (row 3) performs the best. The reason is capsules in adjacent layers connected by dynamic routing, which has the ability to distinguish different features by feature clustering (Sabour et al., 2017). This coincides with our motivation, i.e., transferring related features from two subtasks to the third one through the bidirectional interactive relations for mutual promotion (feature clustering). However, other methods (rows $0\sim 2$ ) have no such dynamic routing mechanism and thus cannot dynamically conduct feature extraction and clustering, leading to unsatisfactory results. Therefore, we select the capsule network. + +# 5.5 Case Study and Visualization + +To provide an understanding of how the multi-knowledge transfer works, in Fig. 4, $^{6}$ we take the knowledge transfer from OE and AE to SC for example to visualize the agreement value $c_{j|i}$ . Fig. 4(a) and Fig. 4(c) are the cases of transferring knowledge from OE to SC. Fig. 4(a) shows that the knowledge of opinion term "longer" from the OE subtask is mainly sent to aspect term "battery" of the SC subtask and Fig. 4(c) shows the same phenomenon (the knowledge of opinion term "not terrible" from the OE subtask is mainly sent to the aspect term "prices") though it is a negation sentence, indicating that the opinion word affects the sentiment polarity of the aspect term, i.e., the former (AE) is naturally correlated with the latter (SC). Particularly, in Fig. 4(c), negation information can be effectively transferred to the aspect term "prices" via the routing algorithm and affects its sentiment polarity. Fig. 4(b) and Fig. 4(d) are the cases of transferring knowledge from AE to SC, showing that the aspect-related knowledge is mainly transferred to the aspect term "battery" and "prices", + +
#MethodsD1D2D3
0Concat60.5650.1167.73
1LSTM60.7751.1966.93
2Attention61.3652.4968.02
3Capsule62.8954.1070.36
+ +Table 6: F1-absa $(\%)$ on the validation set. Apart from using "Routing Blocks" in Fig. 2, we also try the following three methods. i): We directly concatenate the task-specific features (row 0). ii) We use an LSTM to sequentially read the task-specific features for transferring knowledge (row 1). iii) We apply attention to calculate the score between the task-specific features, and then take the score as the weight to conduct the task-specific knowledge transferring (row 2). + +![](images/76db334fc39298d827e0c4d08cb512744c7f8aadbb1f85371842d0e57ea648ad.jpg) + +![](images/ff48cba154207a17ea28b764f75af85e6601808ac5ac5895a19978b84f63dd57.jpg) +SC(j) + +![](images/fdd8604242d3db9972ba3745b7a2ff2438a23bd8a991e7adff835aca71e37dce.jpg) +SC(j) +(c) OE $\rightharpoondown$ SC +Figure 4: Visualization of $c_{j|i}$ . The darker the color is, the more knowledge is transferred. + +![](images/efa0096cbcb7cd1bfe1b9793ce0bc4c72f7211cd7acc8c477f885785849374b8.jpg) +(d) AE -> SC + +voting for them to be aspect terms. Therefore, the AE subtask can help the aspect-level sentiment classification to judge whether the word should own sentiment polarity or not. Besides, we also present thorough error analysis in Appendix C. + +# 6 Related Work + +Aspect-Based Sentiment Analysis. Existing models typically handle the ABSA task independently or jointly. Apparently, separately treating each subtask cannot exploit the inter-task correlations, leading to restricted performances, such as AE (Qiu et al., 2011; Liu et al., 2013, 2014, 2015; Yin et al., 2016; Li and Lam, 2017; Li et al., 2018b; Angelidis and Lapata, 2018; Ma et al., 2019, etc) and SC (Dong et al., 2014; Nguyen and Shirai, 2015; Vo and Zhang, 2015; Chen et al., 2017; Wang et al., 2018; Ma et al., 2018; Hu et al., 2019a; Liang et al., 2019; Bao et al., 2019; Sun et al., 2019; Tang + +et al., 2019,?; Xu et al., 2020a, etc). By contrast, the integrated or joint methods (Wang et al., 2016a; Mitchell et al., 2013; Zhang et al., 2015; Li and Lu, 2017; Schmitt et al., 2018; Li et al., 2019b; Lin and Yang, 2020; Liang et al., 2021; Chen and Qian, 2020) can model the interactive correlations and thus achieve promising results. Different from above studies, we focus on exploiting the inter-task correlations among the three aspect-level subtasks and thus incrementally boost one another. Besides, we observe the task characteristics and then use the document-level corpora to pertinently help the corresponding aspect-level subtasks. + +Capsule Network. Capsule network (Sabour et al., 2017) has been widely applied in many natural language processing tasks. In ABSA, Wang et al. (2019) focus on building multiple capsules for aspect category sentiment analysis, which do not employ the routing procedure. Chen and Qian (2019) construct a transfer capsule network for transferring semantic knowledge from DSC to SC via sharing the encoder, which utilizes the vanilla capsule network only for the SC subtask. Du et al. (2019) combine capsule network with interactive attention to model the interactive relationship between the given aspect term and context for the SC subtask. Jiang et al. (2019) release a new large-scale multi-aspect multi-sentiment dataset and use capsule network building a strong baseline. Unlike these methods, we pay attention to the end-to-end ABSA task rather than the individual subtask, and propose a dynamic-length to dynamic-length routing algorithm, which can efficiently perform the multi-knowledge transfer. + +# 7 Conclusion + +In this paper, we propose an iterative multi-knowledge transfer network for the ABSA task, which can fully exploit the inter-task correlations among the three aspect-level subtasks with the proposed routing algorithm. Moreover, we design a more fine-grained method enabling our model to incorporate the document-level knowledge for pertinently enhancing the corresponding aspect-level tasks. Experimental results on three benchmark datasets demonstrate the effectiveness of our proposed approach, which yields state-of-the-art performance on most metrics. + +# Acknowledgements + +The research work described in this paper has been supported by the National Key R&D Program of China (2019YFB1405200) and the National Nature Science Foundation of China (No. 61976015, 61976016, 61876198 and 61370130). The authors would like to thank the anonymous reviewers for their valuable comments and suggestions to improve this paper. + +# References + +Martín Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, Manjunath Kudlur, Josh Levenberg, Rajat Monga, Sherry Moore, Derek G. Murray, Benoit Steiner, Paul Tucker, Vijay Vasudevan, Pete Warden, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. 2016. Tensorflow: A system for large-scale machine learning. In USENIX, pages 265-283. +Stefanos Angelidis and Mirella Lapata. 2018. Summarizing opinions: Aspect extraction meets sentiment prediction and they are both weakly supervised. In EMNLP, pages 3675-3686. +Lingxian Bao, Patrik Lambert, and Toni Badia. 2019. Attention and lexicon regularized LSTM for aspect-based sentiment analysis. In ACL, pages 253-259. +Peng Chen, Zhongqian Sun, Lidong Bing, and Wei Yang. 2017. Recurrent attention network on memory for aspect sentiment analysis. In EMNLP, pages 452-461. +Zhuang Chen and Tieyun Qian. 2019. Transfer capsule network for aspect level sentiment classification. In ACL, pages 547-556. +Zhuang Chen and Tieyun Qian. 2020. Relation-aware collaborative learning for unified aspect-based sentiment analysis. In ACL, pages 3685-3694. +Hongliang Dai and Yangqiu Song. 2019. Neural aspect and opinion term extraction with mined rules as weak supervision. In ACL, pages 5268-5277. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. BERT: pre-training of deep bidirectional transformers for language understanding. CoRR, abs/1810.04805. +Li Dong, Furu Wei, Chuanqi Tan, Duyu Tang, Ming Zhou, and Ke Xu. 2014. Adaptive recursive neural network for target-dependent twitter sentiment classification. In ACL, pages 49-54. +Chunning Du, Haifeng Sun, Jingyu Wang, Qi Qi, Jianxin Liao, Tong Xu, and Ming Liu. 2019. Capsule network with interactive attention for aspect-level sentiment classification. In EMNLP, pages 5492-5501. + +Zhifang Fan, Zhen Wu, Xin-Yu Dai, Shujian Huang, and Jiajun Chen. 2019. Target-oriented opinion words extraction with target-fused neural sequence labeling. In *NAACL*, pages 2509-2518. +Xavier Glorot and Yoshua Bengio. 2010. Understanding the difficulty of training deep feedforward neural networks. In AISTATS, pages 249-256. +Ruidan He, Wee Sun Lee, Hwee Tou Ng, and Daniel Dahlmeier. 2018. Exploiting document knowledge for aspect-level sentiment classification. In ACL, pages 579-585. +Ruidan He, Wee Sun Lee, Hwee Tou Ng, and Daniel Dahlmeier. 2019. An interactive multi-task learning network for end-to-end aspect-based sentiment analysis. In ACL, pages 504-515. +Mengting Hu, Shiwan Zhao, Li Zhang, Keke Cai, Zhong Su, Renhong Cheng, and Xiaowei Shen. 2019a. CAN: Constrained attention networks for multi-aspect sentiment analysis. In EMNLP, pages 4593-4602. +Minghao Hu, Yuxing Peng, Zhen Huang, Dongsheng Li, and Yiwei Lv. 2019b. Open-domain targeted sentiment analysis via span-based extraction and classification. In ACL, pages 537-546. +Qingnan Jiang, Lei Chen, Ruifeng Xu, Xiang Ao, and Min Yang. 2019. A challenge dataset and effective models for aspect-based sentiment analysis. In EMNLP, pages 6280-6285. +Nal Kalchbrenner, Edward Grefenstette, and Phil Blunsom. 2014. A convolutional neural network for modelling sentences. In ACL, pages 655-665. +Yoon Kim. 2014. Convolutional neural networks for sentence classification. In EMNLP, pages 1746-1751. +Diederik P. Kingma and Jimmy Ba. 2014. Adam: A method for stochastic optimization. CoRR, abs/1412.6980. +Philipp Koehn. 2004. Statistical significance tests for machine translation evaluation. In EMNLP, pages 388-395. +Hao Li and Wei Lu. 2017. Learning latent sentiment scopes for entity-level sentiment analysis. In AAAI. +Xin Li, Lidong Bing, Wai Lam, and Bei Shi. 2018a. Transformation networks for target-oriented sentiment classification. In ACL, pages 946-956. +Xin Li, Lidong Bing, Piji Li, and Wai Lam. 2019a. A unified model for opinion target extraction and target sentiment prediction. In AAAI, pages 6714-6721. +Xin Li, Lidong Bing, Piji Li, Wai Lam, and Zhimou Yang. 2018b. Aspect term extraction with history attention and selective transformation. In *IJCAI*, pages 4194-4200. + +Xin Li, Lidong Bing, Wenxuan Zhang, and Wai Lam. 2019b. Exploiting BERT for end-to-end aspect-based sentiment analysis. In EMNLP, pages 34-41. +Xin Li and Wai Lam. 2017. Deep multi-task learning for aspect term extraction with memory interaction. In EMNLP, pages 2886-2892. +Yunlong Liang, Fandong Meng, Jinchao Zhang, Yufeng Chen, Jinan Xu, and Jie Zhou. 2021. A dependency syntactic knowledge augmented interactive architecture for end-to-end aspect-based sentiment analysis. Neurocomputing, 454:291-302. +Yunlong Liang, Fandong Meng, Jinchao Zhang, Jinan Xu, Yufeng Chen, and Jie Zhou. 2019. A novel aspect-guided deep transition model for aspect based sentiment analysis. In EMNLP, pages 5572-5584. +Peiqin Lin and Meng Yang. 2020. A shared-private representation model with coarse-to-fine extraction for target sentiment analysis. In *Findings of the EMNLP*, pages 4280-4289, Online. +Kang Liu, Liheng Xu, and Jun Zhao. 2013. Syntactic patterns versus word alignment: Extracting opinion targets from online reviews. In ACL, pages 1754-1763. +Kang Liu, Liheng Xu, and Jun Zhao. 2014. Extracting opinion targets and opinion words from online reviews with graph co-ranking. In ACL, pages 314-324. +Pengfei Liu, Shafiq Joty, and Helen Meng. 2015. Fine-grained opinion mining with recurrent neural networks and word embeddings. In EMNLP, pages 1433-1443. +Huaishao Luo, Tianrui Li, Bing Liu, and Junbo Zhang. 2019. DOER: Dual cross-shared RNN for aspect term-polarity co-extraction. In ACL, pages 591-601. +Dehong Ma, Sujian Li, Fangzhao Wu, Xing Xie, and Houfeng Wang. 2019. Exploring sequence-to-sequence learning in aspect term extraction. In ACL, pages 3538-3547. +Yukun Ma, Haiyun Peng, and Erik Cambria. 2018. Targeted aspect-based sentiment analysis via embedding commonsense knowledge into an attentive LSTM. In AAAI. +Margaret Mitchell, Jacqui Aguilar, Theresa Wilson, and Benjamin Van Durme. 2013. Open domain targeted sentiment. In EMNLP, pages 1643-1654. +Thien Hai Nguyen and Kiyoaki Shirai. 2015. PhraseRNN: Phrase recursive neural network for aspect-based sentiment analysis. In EMNLP, pages 2509-2514. +Haiyun Peng, Lu Xu, Lidong Bing, Fei Huang, Wei Lu, and Luo Si. 2020. Knowing what, how and why: A near complete solution for aspect-based sentiment analysis. the AAAI, 34:8600-8607. + +Minlong Peng, Qi Zhang, Yu-gang Jiang, and Xuanjing Huang. 2018. Cross-domain sentiment classification with target domain specific information. In ACL, pages 2505-2513. +Jeffrey Pennington, Richard Socher, and Christopher Manning. 2014. Glove: Global vectors for word representation. In EMNLP, pages 1532-1543. +Maria Pontiki, Dimitris Galanis, Haris Papageorgiou, Suresh Manandhar, and Ion Androutsopoulos. 2015. SemEval-2015 task 12: Aspect based sentiment analysis. In SemEval 2015, pages 486-495. +Maria Pontiki, Dimitris Galanis, John Pavlopoulos, Harris Papageorgiou, Ion Androutsopoulos, and Suresh Manandhar. 2014. Semeval-2014 task 4: Aspect based sentiment analysis. In SemEval 2014, pages 27-35. +Guang Qiu, Bing Liu, Jiajun Bu, and Chun Chen. 2011. Opinion word expansion and target extraction through double propagation. Computational linguistics, 37(1):9-27. +Sara Sabour, Nicholas Frosst, and Geoffrey E Hinton. 2017. Dynamic routing between capsules. In NIPS, pages 3856-3866. +Martin Schmitt, Simon Steinheber, Konrad Schreiber, and Benjamin Roth. 2018. Joint aspect and polarity classification for aspect-based sentiment analysis with end-to-end neural networks. In EMNLP, pages 1109-1114. +Kai Sun, Richong Zhang, Samuel Mensah, Yongyi Mao, and Xudong Liu. 2019. Aspect-level sentiment analysis via convolution over dependency tree. In EMNLP, pages 5683-5692. +Duyu Tang, Bing Qin, Xiaocheng Feng, and Ting Liu. 2016. Effective lstms for target-dependent sentiment classification. In COLING, pages 3298-3307. +Jialong Tang, Ziyao Lu, Jinsong Su, Yubin Ge, Linfeng Song, Le Sun, and Jiebo Luo. 2019. Progressive self-supervised attention learning for aspect-level sentiment analysis. In ACL, pages 557-566. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In NIPS, pages 5998-6008. +Duy-Tin Vo and Yue Zhang. 2015. Target-dependent twitter sentiment classification with rich automatic features. In *IJCAI*. +F. Wang, M. Lan, and W. Wang. 2018. Towards a one-stop solution to both aspect extraction and sentiment analysis tasks with neural multi-task learning. In IJCNN, pages 1-8. +Shuai Wang, Sahisnu Mazumder, Bing Liu, Mianwei Zhou, and Yi Chang. 2018. Target-sensitive memory networks for aspect sentiment classification. In ACL, pages 957-967. + +Wenya Wang, Sinno Jialin Pan, Daniel Dahlmeier, and Xiaokui Xiao. 2016a. Recursive neural conditional random fields for aspect-based sentiment analysis. In EMNLP, pages 616-626. +Wenya Wang, Sinno Jialin Pan, Daniel Dahlmeier, and Xiaokui Xiao. 2017. Coupled multi-layer attentions for co-extraction of aspect and opinion terms. In AAAI. +Yequan Wang, Minlie Huang, xiaoyan zhu, and Li Zhao. 2016b. Attention-based LSTM for aspect-level sentiment classification. In EMNLP, pages 606-615. +Yequan Wang, Aixin Sun, Minlie Huang, and Xiaoyan Zhu. 2019. Aspect-level sentiment analysis using as-capsules. In WWW, pages 2033-2044. +Hu Xu, Bing Liu, Lei Shu, and Philip Yu. 2020a. DomBERT: Domain-oriented language model for aspect-based sentiment analysis. In *Findings of the EMNLP*, pages 1725–1731. +Hu Xu, Bing Liu, Lei Shu, and Philip S. Yu. 2018. Double embeddings and CNN-based sequence labeling for aspect extraction. In ACL, pages 592-598. +Lu Xu, Hao Li, Wei Lu, and Lidong Bing. 2020b. Position-aware tagging for aspect sentiment triplet extraction. In the EMNLP, pages 2339-2349. +Yichun Yin, Furu Wei, Li Dong, Kaimeng Xu, Ming Zhang, and Ming Zhou. 2016. Unsupervised word and dependency path embeddings for aspect term extraction. CoRR, abs/1605.07843. +Meishan Zhang, Yue Zhang, and Duy-Tin Vo. 2015. Neural networks for open domain targeted sentiment. In EMNLP, pages 612-621. +Yan Zhou, Longtao Huang, Tao Guo, Jizhong Han, and Songlin Hu. 2019. A span-based joint model for opinion target extraction and target sentiment classification. In *IJCAI*, pages 5485-5491. + +# Appendix + +# A Implementation Details + +Following (Chen and Qian, 2020), we use 300d GloVe released by Pennington et al. (2014) as general-specific embeddings and the embeddings released by Xu et al. (2018) as domain-specific embeddings. Our models are trained by Adam optimizer (Kingma and Ba, 2014), with learning rate $\eta_0 = 10^{-4}$ , and batch size is set to 32. When training, we randomly sample $20\%$ of each training data as the validation set and the remaining $80\%$ as training set. + +We following (Chen and Qian, 2020) fix the domain-specific and general-specific word embeddings in all models, where the domain-specific embedding vectors are 100 dimensions. The trainable weight matrices in the CNN are initialized by following the Glorot Uniform strategy (Glorot and Bengio, 2010). Besides, all biases are initialized as zero. We tune the number of CNN layer on the validation set of each dataset. Finally, The CNN layer number in the shared encoder is set to 2, and is fixed as 2, 2, 1 for the ATE subtask, the OTE subtask, and the ASC subtask in task-specific layers, respectively. The CNN layer in the shared encoder has 150 filters with kernel size $\mathrm{k} = 3$ and 150 filters with kernel size $\mathrm{k} = 5$ . The CNN layers in each task-specific encoder have 300 filters with kernel size $\mathrm{k} = 5$ per layer. The activation function is ReLu for each CNN layer. Dropout is employed after the embedding layer and each CNN layer, which is empirically set to 0.5. The discount coefficients $\lambda_{1}, \lambda_{2}, \lambda_{3}, \lambda_{4}$ and $\lambda_{5}$ in loss functions are not fine-tuned and empirically set to 1.0. + +Since the extracted aspect term may consist of several tokens and the predicted polarity of each token may be inconsistent, we thus following (Chen and Qian, 2020) only take the sentiment polarity of the first token of the current aspect term as the sentiment label for measuring the performance. We also note that only aspect terms have sentiment annotations and thus following (Chen and Qian, 2020) only consider ASC predictions on these aspect term-related tokens for computing the ASC loss and ignore the sentiments predicted on other tokens. + +For training, we first train the model with document-level tasks for five epochs, and then alternately train our model on aspect-level tasks with 2 epochs and document-level tasks with 1 epoch. Finally, we train the model for a fixed number of epochs, and obtain the best results at the epoch with the best F1-absa score on the validation set for producing the testing results, as did in (He et al., 2019). + +In our experiments, following (Chen and Qian, 2020), we also use $BERT_{LARGE}$ (Devlin et al., 2018) as the backbone to further investigate our model performance. + +The neural model is implemented in Keras and all computations are done on an NVIDIA Tesla V100 GPU, where each experiment runs about $1\sim 3$ hours. Hyperparameter configurations for best + +performing models have explained above. The method of choosing hyperparameter values is manual tuning on the validation and the criterion used to select is F1-absa. The downloadable version of used data can be found in: https://github.com/ruidan/IMN-E2E-ABSA, provided by IMN (He et al., 2019), where we use this data without any pre-processing. + +# B Experiments of Hyperparameters + +# Impact of Iteration Number: $T$ . + +As an important hyperparameter, we investigate the impact of iterations $T$ . Tab. 7 shows the change of F1-absa on the validation set of each dataset. We find that the best results can be obtained when $T$ equals 1, 2, and 4, respectively. There is no consistent conclusion about how to set this parameter. In general, $T$ is set to 1, 2, and 4 on D1, D2, and D3 in our experiments, respectively. + +
T012345
D162.7863.5663.1463.4463.0062.34
D253.3455.2556.2256.0755.4754.88
D365.0465.7265.8865.7266.3565.78
+ +# Impact of Routing Number: iter. + +Tab. 8 (in the next page) shows the impact of the maximum number of the routing number iter of the routing algorithm on the validation set of each dataset. The results demonstrate that the model achieves the best results when routing number equals 3 and further iterations do not further improve the performance. In general, the routing number is fixed to 3 in our experiments. + +Table 7: F1-absa (%) scores with different $T$ values. Average results over 5 runs on the validation set are reported. + +
iter12345
D163.0663.8064.5264.0264.25
D256.2856.4757.1456.7056.47
D365.7166.3266.7566.0366.00
+ +Table 8: F1-absa $(\%)$ scores with different routing number in Routing Block. Average results over 5 runs on the validation set are reported. + +# C Error Analysis + +We have checked some error examples and made a thorough error analysis, which can be roughly divided into 3 types. 1) Due to aspect extraction and + +
SentenceThe service is slow.
Aspectservice
Opinionslow
Sentiment Polaritynegative
Aspect-Sentiment Pairservice-negative
Aspect-Opinion Pairservice-slow
Aspect-Opinion-Sentiment Tripletservice-slow-negative
+ +Table 9: The example of Aspect-Sentiment Pair, Aspect-Opinion Pair, and Aspect-Opinion-Sentiment Triplet. + +opinion extraction are not always correctly identified, the Aspect-Oinion-Sentiment triplet is hard to handle. 2) The imbalanced label distribution in the training corpus. 3) The complex instances are hard to correctly deal with, such as the sentence that has multiple aspects and opinions, which are hardly effectively learned. For instance, in the sentence "coffee is a better deal than overpriced cosine sandwiches", where two opinion terms "better" and "overpriced", and two aspect terms "coffee" and "cosi sandwiches" are mentioned, where the sentiment polarities of them are "positive" and "negative", respectively. In this case, our IMKTN correctly extracted all aspect terms, and the IMKTN successfully detected the opinion term "better" but failed to identify the opinion term "overpriced", i.e., the OTE subtask failed partly, where the IMKTN made right sentiment classification for the aspect term "coffee" but assigned wrong sentiment polarity ("positive") to the aspect term "cosi sandwiches". The reason may be that the knowledge from the opinion term "better" contributed to the right sentiment classification for "coffee" but led to the wrong sentiment classification for "cosi sandwiches". If the opinion term "overpriced" can be successfully identified, it may contribute to the right classification for "cosi sandwiches" with our routing algorithm. \ No newline at end of file diff --git a/aniterativemultiknowledgetransfernetworkforaspectbasedsentimentanalysis/images.zip b/aniterativemultiknowledgetransfernetworkforaspectbasedsentimentanalysis/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..833752bb10d5cbccaf7450f72076530c03f71fe9 --- /dev/null +++ b/aniterativemultiknowledgetransfernetworkforaspectbasedsentimentanalysis/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a728e3d303cfb0063dcbfb5e77f332d07185be5549f5d35c0eae17f6ca706fe2 +size 520880 diff --git a/aniterativemultiknowledgetransfernetworkforaspectbasedsentimentanalysis/layout.json b/aniterativemultiknowledgetransfernetworkforaspectbasedsentimentanalysis/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..64d5e6ff75de997df48fb95ac29f7474225ac5ab --- /dev/null +++ b/aniterativemultiknowledgetransfernetworkforaspectbasedsentimentanalysis/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d4b52e09958e3001c2db523e73236b649c450c575a4e615ddfa838a8fe890bcc +size 525026 diff --git a/anuncertaintyawareencoderforaspectdetection/f669a7de-1c6e-4094-8935-c4bc47af55e5_content_list.json b/anuncertaintyawareencoderforaspectdetection/f669a7de-1c6e-4094-8935-c4bc47af55e5_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..fa6cab841a1987fcedb9a952e93b188cb9c34537 --- /dev/null +++ b/anuncertaintyawareencoderforaspectdetection/f669a7de-1c6e-4094-8935-c4bc47af55e5_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6fb5222ed95fb3918adb044b1fb2e00161fae5fae509ba48cf1e0e802b1b0cd7 +size 69482 diff --git a/anuncertaintyawareencoderforaspectdetection/f669a7de-1c6e-4094-8935-c4bc47af55e5_model.json b/anuncertaintyawareencoderforaspectdetection/f669a7de-1c6e-4094-8935-c4bc47af55e5_model.json new file mode 100644 index 0000000000000000000000000000000000000000..67d1d5f8159f4f378384f1cffeff62ec254ab3d6 --- /dev/null +++ b/anuncertaintyawareencoderforaspectdetection/f669a7de-1c6e-4094-8935-c4bc47af55e5_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e0aafa86ecd70782e9d03c27ad731b82ddbf9420e0b36d8c55281d051a341e8 +size 82058 diff --git a/anuncertaintyawareencoderforaspectdetection/f669a7de-1c6e-4094-8935-c4bc47af55e5_origin.pdf b/anuncertaintyawareencoderforaspectdetection/f669a7de-1c6e-4094-8935-c4bc47af55e5_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..63ab72d459941352522981e548108e9b0b8b6533 --- /dev/null +++ b/anuncertaintyawareencoderforaspectdetection/f669a7de-1c6e-4094-8935-c4bc47af55e5_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b601e065f3cd3600e4052327041497553fe80a4ec51a77dda64925bfe28d5ed +size 701243 diff --git a/anuncertaintyawareencoderforaspectdetection/full.md b/anuncertaintyawareencoderforaspectdetection/full.md new file mode 100644 index 0000000000000000000000000000000000000000..6d3fe94b50be3516470c63a2fa18353117e975dd --- /dev/null +++ b/anuncertaintyawareencoderforaspectdetection/full.md @@ -0,0 +1,306 @@ +# An Uncertainty-Aware Encoder for Aspect Detection + +Thi-Nhung Nguyen1, Kiem-Hieu Nguyen1, Young-In Song2 and Tuan-Dung Cao1 + +1 School of Information Technology and Communication, Hanoi University of Science and Technology, Hanoi, Vietnam + +2 Naver + +nguyennhung0799@gmail.com,{hieunk,dungct}@soict.hust.edu.vn, song-youngin@navercorp.com + +# Abstract + +Aspect detection is a fundamental task in opinion mining. Previous works use seed words either as priors of topic models, as anchors to guide the learning of aspects, or as features of aspect classifiers. This paper presents a novel weakly-supervised method to exploit seed words for aspect detection based on an encoder architecture. The encoder maps segments and aspects into a low-dimensional embedding space. The goal is approximating similarity between segments and aspects in the embedding space and their ground-truth similarity generated from seed words. An objective function is proposed to capture the uncertainty of ground-truth similarity. Our method outperforms previous works on several benchmarks in various domains. + +# 1 Introduction + +Aspect detection is essential for downstream tasks in opinion mining such as aspect-based sentiment analysis and opinion summarization (Zhang and Liu, 2014; Angelidis and Lapata, 2018). Given an input review segment, for instance, in the restaurant domain, "Nevertheless the food itself is pretty good," we need to detect its aspect category on which opinions have been expressed (e.g., Location, Drinks, Food, Ambience, and Service). The supervised approach requires a large amount of examples (Zhang et al., 2018; Poria et al., 2016). Its unsupervised counterpart learns aspects using techniques such as topic models and autoencoders. The learned aspects are then manually mapped to golden aspects for prediction. Weakly-supervised methods aim at using minimal supervision in terms of seed words to learn aspect predictors. + +The topic modeling approach assumes that review contents are generated from aspect probability distributions. Topic models try to learn these distributions using estimators such as maximum likelihood estimation. Seed words are injected into topic + +models as prior knowledge to guide the estimation of aspect distributions (Mukherjee and Liu, 2012; Chen et al., 2014). The independence assumption in topic models, i.e., the words in a review segment are generated independently from each other, leads to generating incoherent aspects. This phenomenon is more severe as many review segments only have a few words. Wang et al. (2015) propose using a restricted Boltzmann machine for joint aspect detection and sentiment classification. However, their model requires various linguistic tools and external resources including part-of-speech tagging, tfidf weighting, SentiWordNet, and aspect and sentiment seed words. The aspect seed words are acquired by learning a Latent Dirichlet Allocation on raw segments and manually mapping the learned topics to golden aspects, while the sentiment seed words are acquired based on SentiWordNet. + +To overcome this shortage, the neural approach leverages rich representation from contextual language models to capture semantic similarity between words frequently co-occurring in the same contexts (He et al., 2017). Model parameters are learned in neural frameworks such as autoencoder, joint learning or knowledge distillation. Huang et al. (2020) construct word embeddings and explicit aspect embeddings by jointly learning a skip-gram style language model and maximizing the likelihood of aspects and sentiments given seed words. Their model is further reinforced by knowledge distillation based on pseudo-labels from previously learned aspect embeddings, and later by self-training, both with a Convolutional Neural Network (CNN) classifier. In a recent study, Shi et al. (2020) use a contrastive loss to learn aspect embeddings and manually map them to golden aspects. Their model is further enhanced by knowledge distillation with a contextual language model encoder (Sanh et al., 2019). Karamanolakis et al. (2019) co-train student-teacher classifiers in a knowledge distillation framework. The teacher is + +designed as a bag-of-seed-words classifier with the weights updated during iterative co-training. Another direction is directly using pre-trained embeddings of aspect labels as aspect vectors and scoring against segment vectors with cosine similarity for prediction (Tulkens and van Cranenburg, 2020). + +In this paper, we propose a novel weakly-supervised method to exploit seed words for aspect detection. Our motivation is from the success of using uncertainty in matrix factorization-based collaborative filtering for movie recommendation from implicit feedback (Hu et al., 2008). The authors show that by adding a confidence score for each user-item pair, their model could learn better from both positive and negative pairs. In our work, we define a confidence score so that ambivalent segments will have a low score. The proposed model is now aware of this ambivalence in learning via a specific designed objective function. Our contributions are as follows: + +- A simple and effective encoder architecture is proposed for aspect detection. The goal is to represent segments and aspects in a common latent space. The encoder strives to learn a mapping function that approximates similarity in the latent space and ground-truth similarity generated from the given seed words. +Inspired by collaborative filtering from implicit feedback (Hu et al., 2008), an uncertainty-aware objective function is proposed to effectively exploit seed words for weakly-supervised learning. +- A selective mechanism is proposed to learn a particularly challenging aspect, namely General, based on its seed words. +- The proposed model achieves state-of-the-art performance on several benchmark datasets in various domains. + +# 2 Unsupervised and Weakly-supervised Neural Aspect Detection + +Due to its independence assumption, topic models could generate incoherent aspects. He et al. (2017) propose an autoencoder that aims at learning coherent aspects by leveraging word co-occurrence in neural word embeddings. Following this line of research, many works have investigated neural networks for unsupervised aspect detection (Angelidis and Lapata, 2018; Luo et al., 2019; Shi et al., 2020). + +However, their unsupervised nature requires additional human effort for manual aspect mapping. Weakly-supervised methods have exploited seed words to overcome this shortage and to enhance aspect learning (Karamanolakis et al., 2019; Tulkens and van Cranenburg, 2020; Huang et al., 2020). In this section, we discuss the key ingredients of unsupervised and weakly-supervised neural models, focusing on representation, aspect mapping, seed words, and the General aspect. + +# 2.1 Segment and aspect representation + +Segments are input data for learning autoencoders and aspect classifiers. In the series of autoencoders models, the segments are represented as the weighted sum of word embeddings with the weights estimated from an attention mechanism (He et al., 2017; Angelidis and Lapata, 2018; Shi et al., 2020). In these models, the word embeddings are loaded from pre-trained in-domain word2vec and are fixed during training. In aspect classifiers, the segments are represented using various encoding paradigms, such as the mean of word embeddings (Huang et al., 2020), word embeddings with attention (Tulkens and van Cranenburg, 2020), CNNs (Huang et al., 2020), BERT (Devlin et al., 2019; Karamanolakis et al., 2019; Shi et al., 2020), or bag-of-words (Karamanolakis et al., 2019). + +Previous works represent aspects as explicit parameterized vectors and learn these vectors during training (He et al., 2017; Angelidis and Lapata, 2018; Shi et al., 2020; Huang et al., 2020). In another direction, the embeddings of aspect labels (i.e., 'food' or 'ambience') could be used to represent aspects (Tulkens and van Cranenburg, 2020). + +# 2.2 Exploiting seed words + +Unsupervised methods require human effort to manually map learned aspects to golden aspects using a many-to-one mapping (He et al., 2017) or its recent variant (Shi et al., 2020). By leveraging a few seed words, weakly-supervised methods directly learn golden aspects and require no manual mapping (Angelidis and Lapata, 2018; Huang et al., 2020). Karamanolakis et al. (2019) propose a knowledge distillation framework in which the teacher is a bag-of-seed-words classifier. + +# 2.3 The General aspect + +Based on its content, a segment could be classified into a homogeneous typical aspect (e.g., Food or + +I purchased this case. + +My wife is trying to convince me to return it. + +We'll just keep it. + +And that's the most important feature in a case. + +I am going to contact Kensington about a refund. + +Figure 1: Five examples of General in the Laptop Bags domain demonstrating the variety of this aspect. + +Ambience) or a more heterogeneous General aspect. General is an aspect of which contents largely vary. A segment in this aspect could express an overall review of a product, background information, or even irrelevant contents (see Figure 1 for examples). Therefore, it is challenging to detect the segments belonging to this type of aspect. Previous works simply treat General equally to the typical aspects (He et al., 2017; Angelidis and Lapata, 2018; Shi et al., 2020). In some cases, General is ignored in the evaluation (He et al., 2017; Huang et al., 2020). In (Karamanolakis et al., 2019), a segment is classified as General if it does not contain any seed word of the typical aspects. + +# 3 Method + +The Aspect Detection problem is defined as assigning a review segment to one of the $K$ pre-defined aspect categories. In the unsupervised settings, a corpus of review segments is given. In the weakly-supervised setting as in this work, the segment corpus and sets of seed words for aspect categories are given. As in the literature, we assume that the seed words have already been acquired manually or been extracted automatically from a small number of labeled examples. + +Our model is depicted in Figure 2: Firstly, the encoder maps an input segment and the aspects into the same embedding space. For General, the encoder takes all its seed word embeddings as an embedding matrix. Otherwise, the segment and the typical aspects are encoded as mean of their (seed) word embeddings. A similarity function in the embedding space is defined as the dot product of a segment vector and an aspect vector. Finally, the objective function approximates this similarity and the ground-truth similarity generated from the seed words. For the General aspect, the objective function performs a global max pooling over the similarities between the segment and the seed words of General to select the best seed word for updating. + +The encoder is an embedding-lookup table and + +is identical to the word embeddings matrix $\mathbf{W} \in \mathbb{R}^{V \times d}$ where $V$ is the vocabulary size and $d$ is the dimension of word vectors. $\mathbf{W}$ is initialized by pre-trained in-domain word embeddings. For this task, we used the Skip-gram model (Mikolov et al., 2013). We are going into the details of our model in the subsequent sections. Section 3.4 is dedicated to the generation of ground-truth similarity from seed words. + +# 3.1 Segment and typical aspect embeddings + +A segment is encoded as mean of its word embeddings: + +$$ +\boldsymbol {x} = \operatorname {m e a n} \left(\boldsymbol {w} _ {1}, \boldsymbol {w} _ {2},.., \boldsymbol {w} _ {n}\right), \tag {1} +$$ + +in which $\pmb{w}_i$ is a $d$ -dimensional vector of the $i^{\mathrm{th}}$ word of the segment and $n$ is the segment length. + +Similarly, a typical aspect $\pmb{a}_i$ is mean of its seed word vectors: + +$$ +\boldsymbol {a} _ {i} = \operatorname {m e a n} \left(\boldsymbol {w} _ {i, 1} ^ {(a)}, \boldsymbol {w} _ {i, 2} ^ {(a)},.., \boldsymbol {w} _ {i, l _ {i}} ^ {(a)}\right), \tag {2} +$$ + +in which $\boldsymbol{w}_{ij}^{(a)}$ is the vector of the $j^{\mathrm{th}}$ seed word of the $i^{\mathrm{th}}$ aspect, and $l_{i}$ is the number of seed words in the $i^{\mathrm{th}}$ aspect. Our assumption is that an aspect tends to form a cluster in the embedding space. The aspect could then be represented as the centroid of seed words. Those seed words, in turn, will pull the segments belonging to the aspect closer during learning, and will make the cluster more coherent. + +# 3.2 The General aspect embeddings + +For General, the encoder takes all its seed words to form an aspect matrix $G$ : + +$$ +\boldsymbol {G} = \left[ \boldsymbol {w} _ {1} ^ {(g)} \boldsymbol {w} _ {2} ^ {(g)}.. \boldsymbol {w} _ {l _ {g}} ^ {(g)} \right] \tag {3} +$$ + +where $\pmb{w}_j^{(g)}$ is the $j^{\mathrm{th}}$ seed word of General and $l_{g}$ is the number of seed words for this aspect. Among the seed words, the closest to the segment is selected, and only the embeddings of this one will be updated during back propagation (the second term of the objective function, as shown in Equation 4). + +Our intuition: The segments not belonging to a typical aspect could express anything, either an overall review of the object, background information, or even irrelevant contents. As we group them into an aspect with an umbrella term General, it is challenging to define this aspect. Its seed words, typically acquired by manual inspection or by automatic extraction from a small set of labeled examples, tend to be relevant but incoherent. We, + +![](images/24b7a104651ee81480dec21ecb58e067e1acb079e1bcad9e6171482c96be08aa.jpg) +Figure 2: Our Uncertainty-Aware Encoder: Segments are encoded as mean of word embeddings. Aspects are encoded as a function of seed words depending on the aspect type (i.e. a typical aspect or General). An objective function is designed to capture the uncertainty of ground-truth similarity generated from the given seed words. + +therefore, assume that the aspect contains several sub-clusters, and more importantly, the number of sub-clusters is unknown beforehand. In this way, using the best seed word as representative is a reasonable solution, with a condition that the seed words also scatter over the sub-clusters. Taking the best seed word has another advantage in parameter learning: For a typical aspect, all its seed words will be updated during back propagation. For General, only the best seed word will be updated while the other seed words in the same sub-cluster (if any) and in the other sub-clusters will not be affected. We will later demonstrate in our empirical experiments that this selection plays an important role in the model. + +# 3.3 Objective function + +The goal is to approximate similarity in the embedding space and ground-truth similarity. Minimizing mean squared error is a typical choice for this approximation. Inspired by weighted matrix factorization for collaborative filtering from implicit feedback (Hu et al., 2008), given the confidence of ground-truth, our objective function is defined as a mean weighted squared error loss as follows: + +$$ +\begin{array}{l} L = \frac {1}{| D |} \sum_ {\boldsymbol {x} \in D} \left(\sum_ {i = 1} ^ {k} c _ {i} \left(y _ {i} - \boldsymbol {x} ^ {T} \boldsymbol {a} _ {i}\right) ^ {2} \right. \tag {4} \\ + c ^ {(g)} (y ^ {(g)} - \max _ {1 \leq j \leq l _ {g}} \pmb {x} ^ {T} \pmb {w} _ {j} ^ {(g)}) ^ {2}), \\ \end{array} +$$ + +where $\mathbf{D}$ is the training corpus, $y_{i}$ and $c_{i}$ are the ground-truth similarity and confidence of the $i^{\text{th}}$ + +aspect, and $y^{(g)}$ and $c^{(g)}$ are the ground-truth similarity and confidence of General. + +For convenience, let's consider General as the $(\mathbf{k} + 1)^{\mathrm{th}}$ aspect: $\pmb{a}_{k + 1} = \pmb{w}_{j*}^{(g)}$ , where $j* = \arg \max_{1\leq j\leq l_g}(\pmb{x}^T\pmb{w}_j^{(g)})$ , $y_{k + 1} = y^{(g)}$ and $c_{k + 1} = c^{(g)}$ . The objective function could be shortened as follows: + +$$ +L = \frac {1}{| D |} \sum_ {\boldsymbol {x} \in D} \sum_ {i = 1} ^ {k + 1} c _ {i} \left(y _ {i} - \boldsymbol {x} ^ {T} \boldsymbol {a} _ {i}\right) ^ {2} \tag {5} +$$ + +# 3.4 Generating ground-truth similarity + +Generating ground-truth similarity is basically identical to predicting an unseen segment. However, instead of using an optimized encoder, we use a vanilla version of our encoder of which parameters are set-up by pre-trained word embeddings and no optimization is involved. The steps are straightforward: At first, the encoder maps an input segment and the aspects into a $d$ -dimensional space. The similarity between the segment and an individual aspect is then calculated using the dot product function: + +$$ +s _ {i} = \boldsymbol {x} ^ {T} \boldsymbol {a} _ {i}, 1 \leq i \leq k + 1. \tag {6} +$$ + +The ground-truth similarity is finally binarized as the following: + +$$ +y _ {i} = \left\{ \begin{array}{c c} 1 & i = \operatorname {a r g m a x} \left(s _ {i}\right) \\ & 1 \leq i \leq k + 1 \\ 0 & \text {o t h e r w i s e} \end{array} \right. \tag {7} +$$ + +Estimating the confidence of ground-truth binary similarity takes more steps. The similarity + +![](images/4e4e28114bff5ecf60090ee98c4a7cc2f80110aa05cbe691fb4e1872af9a1ae7.jpg) +Figure 3: An illustration of the confidence of ground-truth similarity. + +in Equation 6 is first scaled to the range of [0,1] using min-max normalization, i.e. the minimum and maximum scaled similarities will be 0 and 1 in that order: + +$$ +\bar {s} _ {i} = \frac {s _ {i} - s _ {\min}}{s _ {\max} - s _ {\min}} \tag {8} +$$ + +Later, an evidence term is defined so that: the most $(y = 1)$ and the least similar $(y = 0)$ aspects have an absolute evidence value $(e = 1)$ ; The other aspects with $y = 0$ and a similarity value $\bar{s} \leq 0.5$ will have a high evidence value; The rest aspects with $y = 0$ and a similarity value $\bar{s} > 0.5$ will have a low evidence value. + +$$ +e _ {i} = \left\{ \begin{array}{l l} 1 (= \bar {s} _ {i}) & y _ {i} = 1 \\ 1 - \bar {s} _ {i} & o t h e r w i s e \end{array} \right. \tag {9} +$$ + +Let's explain this intuition by an example (Figure 3): Suppose that we have to assign a review segment "Nevertheless the food itself is pretty good." to one of the aspects $\{(\mathrm{L})\text{ocation}, (\mathrm{D})\text{rinks}, (\mathrm{F})\text{ood}, (\mathrm{A})\text{mbience}, (\mathrm{S})\text{ervice}\}^{1}$ . Suppose that $\bar{s}_L = 1 > \bar{s}_D > 0.5 > \bar{s}_F > \bar{s}_A > \bar{s}_S = 0$ , the evidence of assigning to Location is $e_L = 1$ . The evidence of not assigning to Service is equally $e_S = 1$ . For Food and Ambience, the evidence of not assigning to these two aspects should be high since $\bar{s}_F < 0.5$ and $\bar{s}_A < 0.5$ . In the end, not assigning to Drinks should have a low evidence value as $\bar{s}_D > 0.5$ . + +We finally add a constant term to provide a minimal confidence value for each $y_{i}^{2}$ : + +$$ +c _ {i} = 1 + e _ {i}. \tag {10} +$$ + +# 4 Experiments + +In this part, we first describe the datasets used in our experiments in Section 4.1, following by the ex + +experimental settings (Section 4.2). The methods selected for comparison are introduced in Section 4.3. The evaluation results are finally discussed in Section 4.4. In all the experiments, our model is referred to as UCE, which stands for UnCertainty-aware Encoder. + +# 4.1 Datasets + +We evaluated our method on the following datasets (see Table 1 for the statistics of the datasets): + +OPOSUM: The dataset was first introduced in (Angelidis and Lapata, 2018). It contains Amazon product reviews across six domains: Laptop Bags (Bags), Bluetooth Headsets $(B / T)$ , Boots, Keyboards (KBs), Televisions (TVs), Vacuums (VCs). The dataset was already divided into train/dev/test sets. Like previous works, we used the dev sets to extract seed words. On this dataset, General is a major aspect, its proportion is in the range of $48 - 57\%$ across the six domains. + +Restaurant/Laptop: We used the same training and test data as in (Huang et al., 2020). Following previous works, we only evaluated on subsets of aspects. To extract seed words, we used Semeval-2016 (Pontiki et al., 2016) training sets. Only the examples belonging to an aspect of interest were taken. For Restaurant, as the number of such examples is quite large, we randomly selected a subset of $\frac{1}{6}$ data to be compatible with the other dev sets (the Dev column in Table 1). Note that previous works ignored the General aspect on these datasets. For a robust evaluation, we followed this setting in our experiments. + +
DatasetTrainDevTest
Restaurant17,027792643
Laptop14,683301307
Bags584,332598641
B/T1,419,812661656
Boots957,309548611
KBs603,379675681
TVs1,422,192699748
VCs1,453,651729725
+ +Table 1: Statistics of the datasets. + +# 4.2 Experiment settings + +For pre-processing, seed word extraction, hyperparameters settings, and evaluation metrics, we followed previous works for a fair and robust evaluation. + +Pre-processing: OPOSUM and Restaurant/Laptop were pre-processed similarly to (Shi et al., 2020) and (Huang et al., 2020), respectively. Like previous methods, we only focused on sentence-level segments. We fixed the sentence length at 30. Longer segments were truncated, shorter segments were padded. + +Seed words: Unless stated otherwise, seed words were extracted from the dev sets using the same extraction method as described in (Angelidis and Lapata, 2018). Given a small number of labeled examples, the method returns ranked lists of terms that are the most representative of aspects. For term scoring, they use a clarity function that measures how likely an individual term is observed in an aspect (Cronen-Townsend et al., 2002). + +Hyper-parameters: The best hyper-parameters and parameters were selected using the dev sets. Gensim3 was used to train Skip-gram with the following hyper-parameters: the embedding size to 200, the window size to 10, and the negative sample size to 5. Skip-gram was learned on the training data (the Train column in Table 1). To learn our models, we used the Adam optimizer (Kingma and Ba, 2017) with a learning rate of $1e - 5$ , a batch size of 512, and a weight decay of $1e - 5$ . Our best models used five seed words for typical aspects and 30 seed words for General. Section 5.1 discusses the number of seed words in more detail. + +Evaluation metrics: The average performance over five runs with different random seeds was reported. For comparison with the previous works, we used micro-averaged F1 for OPOSUM and Accuracy, Precision, Recall and macro-F1 for Restaurant/Laptop. + +# 4.3 Model comparison + +For a robust assessment, we compared our method with seven models and baselines on both data sets. + +Skip-gram baseline is a variant of our model without parameter learning. It uses the word embeddings from pre-trained Skip-gram to encode segments and aspects as mean of (seed) words. For all the aspects, we used five seed words4. Skip-gram + Max uses the maximum selective mechanism for the General aspect. + +ABAE (He et al., 2017) is an autoencoder that learns aspect embeddings by exploiting pre-trained + +word2vec. The learned topics were manually mapped to golden aspects. MATE (Angelidis and Lapata, 2018) improves ABAE by using seed words to learn an aspect matrix. ISWD (Karamanolakis et al., 2019) is a weakly-supervised student-teacher co-training framework. The teacher is a bag-of-seed-words classifier. The student is a neural classifier that uses word2vec/BERT to encode segments. Cat (Tulkens and van Cranenburgh, 2020) is a heuristic model that consists of a contrastive attention mechanism based on RBF kernels and that uses cosine similarity to assign aspects. JAsen (Huang et al., 2020) jointly learns word embeddings and aspect embeddings using manually collected aspect and sentiment seed words. It utilizes a CNN with pseudo labels to learn to classify aspects. The CNN classifier is further strengthened by knowledge distillation. SSCL (Shi et al., 2020) extends the idea of ABAE to learn aspect embeddings and uses the so-called High-Resolution-Selective-Mapping (HRSMap) for aspect mapping. Similar to ISWD and JAsen, their model is further strengthened via a BERT encoder and knowledge distillation. + +# 4.4 Evaluation results + +Overall results on all aspects on OPOSUM5 are reported in Table 2. ABAE reports the lowest F1. Interestingly, when equipped with HRSMap, it is dramatically improved. MATE falls behind the other weakly-supervised methods. Our guess is that its performance is affected by treating General equally to the other aspects. ISWD takes a significant step forward by co-training and specific treatment of General. + +The closest to ours is SSCL, which is only $1\%$ to our best model. Its idea is similar to ABAE, using a regressive autoencoder. However, it requires manual aspect mapping. Its best performed version is achieved by using BERT for encoding input segments. It can be seen from Table 2 that no individual method performs best across all the six domains. On average, our model reports the state-of-the-art on the dataset. + +In Table 4 and Table 5, we report the performance of UCE, Skip-gram and ISWD on typical aspects and General for OPOSUM. The results for typical aspects are calculated using weighted-F1. It can be seen that UCE outperforms both Skip-gram + +
MethodBagsB/TBootsKBsTVsVCsAVG
ABAE38.137.635.238.639.538.137.9
ABAE+HRSMap54.962.254.758.959.954.157.5
MATE46.252.245.643.548.842.346.4
ISWD61.466.552.057.563.060.460.2
SSCL65.569.560.462.367.061.064.3
Skip-gram38.636.830.832.431.432.434.0
Skip-gram + Max49.255.445.554.452.448.550.9
UCE63.768.162.967.368.062.665.4
+ +Table 2: Quantitative evaluation of aspect detection on Amazon product reviews. The results of ABAE and MATE were taken from (Angelidis and Lapata, 2018), ISWD from (Karamanolakis et al., 2019), ABAE+HRSMap and SSCL from (Shi et al., 2020). + +and ISWD on both typical aspects and General. + +The results on Restaurant/Laptop $^{6}$ are reported in Table 3. The weakly-supervised methods outperform their unsupervised counterparts by a large margin. UCE is superior on Laptop, but on Restaurant, it lags behind JASen. Their manual seed words provide a good testbed for evaluation. We further trained our model, replacing automatic seed words by these manual seed words while keeping the other settings identical (UCE $^{*}$ ). This replacement yielded a new state-of-the-art on Laptop and brought a remarkable improvement on the other. + +Despite its simplicity, Skip-gram performs comparably on both datasets. As shown in Table 2, there is a large gap between Skip-gram and the methods having a specific solution for General. As General was omitted on Restaurant/Laptop, it performs better. One can see that UCE significantly outperforms Skip-gram, showing the effectiveness of uncertainty-aware learning. + +When looking at performance on each aspect on the Restaurant/Laptop datasets, UCE outperforms Skip-gram on 11 out of 13 aspects, which shows a consistent improvement. On the OPOSUM dataset, UCE yields a remarkable improvement on 35 out of 54 aspects, including General, while it shows significantly less reduction on the others (mostly on recall). Our guess is that as a major aspect, General possibly makes a negative effect on the other aspects. + +Based on error analysis, we found that UCE correctly predicted some ambiguous examples. For example, the true label for the sentence "she replied, well it would be more convenient for us if you ordered now, since you are a larger party, and it + +might get crowded". is Service, but Skip-gram predicted Ambience. Perhaps "larger party" and "crowded" caused Skip-gram to make incorrect prediction. + +# 5 Analysis + +In this section, we conduct an in-depth analysis of our model on the number of seed words and embedding space learning. + +# 5.1 Number of seed words + +![](images/659ad77611802d3b6688bcf0664626be75b03dd4b69a04ead55e98642d17770f.jpg) +Figure 4: The performance of detecting typical aspects (square) and General (triangle) when the number of seed words varies. + +Firstly, the effect of the number of seed words $L$ on typical aspects was investigated. The results are demonstrated on the dev set of the OPOSUM Laptop Bags domain. $L$ was chosen in the range of [1, 50] with an interval of 5. The number of seed words for General was fixed to 30. As shown in Figure 4, the performance reaches a peak at 5 seed words. It gradually decreases when more seed words are added. + +The effect of choosing $L$ for General is similarly studied. Here, the number of seed words for the + +
MethodRestaurantLaptop
AccPrecisionRecallmacro-F1AccPrecisionRecallmacro-F1
ABAE67.346.650.845.359.860.059.656.2
CAT66.349.250.646.258.065.259.958.6
JASen83.864.773.066.371.069.671.369.7
Skip-gram67.553.762.353.567.869.570.267.4
UCE*83.166.167.466.172.072.973.972.2
UCE77.556.764.758.871.372.272.771.3
+ +Table 3: Quantitative evaluation of aspect detection on Restaurant and Laptop reviews. The results of ABAE, CAT and JASen were taken from (Huang et al., 2020). + +
ModelBagsB/TBootsKbsTVsVCs
Skip-gram48.159.550.567.160.259.2
ISWD70.978.267.975.275.274.5
UCE72.577.572.679.178.175.5
+ +Table 4: The performance of UCE on the General aspect on OPOSUM. The performance of ISWD is reported by running their code available at https://github.com/gkaramanolakis/ISWD. + +
ModelBagsB/TBootsKbsTVsVcs
Skip-gram46.547.437.241.342.739.1
ISWD41.242.031.626.940.440.5
UCE49.448.445.748.047.641.2
+ +Table 5: The performance of UCE on typical aspects on OPOSUM. + +typical aspects is fixed to 5. As can be seen in Figure 4, adding more seed words results in a steady improvement until $L$ reaches 30. After that, the performance slightly decreases. + +# 5.2 Embedding space learning + +![](images/ea382f3a82ae94f8b2e232bc311c7a8f51bfb7625efdd013110f9969dd6df8e1.jpg) +Figure 5: The embeddings space before (left) and after (right) learning. Each data point is a review segment in the test set of Restaurant. The segments of the same aspect have the same color (Location: dark blue, Drink: red, Food: pink, Ambience: light blue, Service: green). + +Here, we focus on analyzing the embedding space before and after parameter learning. T-SNE (van der Maaten and Hinton, 2008) was used to project high-dimensional segment vectors into + +a two-dimensional space. We used the test set of Restaurant for this visualization. + +Before learning, the two dominant aspects, i.e. Service and Food, overlap each other as shown in the right-top region of the left part of Figure 5. The two less frequent aspects, i.e., Ambience and Drink, scatter around the space. After learning, there is a clear distinction between Service and Food. Both Ambience and Drink are now more coherent. Since the number of the examples in Location is too small, we could not draw a conclusion on this aspect. Although Service and Food have been largely improved, one can see that these two dominant aspects still interfere with the other aspects, which could mislead the model in prediction. + +# 6 Conclusions and Future Work + +In this paper, we have presented a novel neural encoder for aspect detection. Uncertain-aware learning has been proposed to exploit seed words for the task. The model has a selective mechanism to effectively detect the General aspect. Our method consistently achieves the state-of-the-art on several benchmarks. + +However, there is still a large room for improvement. Firstly, one should further investigate the distribution of aspects, possibly taking the many-to-one mapping, HRSMap and our selective mechanism as a starting point. In addition to heterogeneity, aspects in related domains typically form a hierarchical structure. Secondly, more general settings should be based on. For example, a segment might belong to multiple aspect categories. Thirdly, as seed words play a central role in weakly-supervised methods, more attention should be paid to the methods to extract this resource. Last but not least, the multi-task perspective is a potential direction, by simultaneously resolving aspect detection, aspect term extraction and sentiment analysis. + +# Acknowledgements + +We would like to thank anonymous reviewers for their constructive feedback. This work was supported by the collaboration program Naver x HUST, funded by Naver corporation. + +# References + +Stefanos Angelidis and Mirella Lapata. 2018. Summarizing opinions: Aspect extraction meets sentiment prediction and they are both weakly supervised. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 3675-3686, Brussels, Belgium. Association for Computational Linguistics. +Zhiyuan Chen, Arjun Mukherjee, and Bing Liu. 2014. Aspect extraction with automated prior knowledge learning. In Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 347-358, Baltimore, Maryland. Association for Computational Linguistics. +Steve Cronen-Townsend, Yun Zhou, and W. Bruce Croft. 2002. Predicting query performance. In Proceedings of the 25th Annual International ACM SIGIR Conference on Research and Development in Information Retrieval, SIGIR '02, page 299-306, New York, NY, USA. Association for Computing Machinery. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 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, Volume 1 (Long and Short Papers), pages 4171-4186, Minneapolis, Minnesota. Association for Computational Linguistics. + +Ruidan He, Wee Sun Lee, Hwee Tou Ng, and Daniel Dahlmeier. 2017. An unsupervised neural attention model for aspect extraction. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 388-397, Vancouver, Canada. Association for Computational Linguistics. +Y. Hu, Y. Koren, and C. Volinsky. 2008. Collaborative filtering for implicit feedback datasets. In 2008 Eighth IEEE International Conference on Data Mining, pages 263-272. +Jiaxin Huang, Yu Meng, Fang Guo, Heng Ji, and Jiawei Han. 2020. Weakly-supervised aspect-based sentiment analysis via joint aspect-sentiment topic embedding. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6989-6999, Online. Association for Computational Linguistics. +Giannis Karamanolakis, Daniel Hsu, and Luis Gravano. 2019. Leveraging just a few keywords for fine-grained aspect detection through weakly supervised co-training. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 4611-4621, Hong Kong, China. Association for Computational Linguistics. +Diederik P. Kingma and Jimmy Ba. 2017. Adam: A method for stochastic optimization. +Ling Luo, Xiang Ao, Yan Song, Jinyao Li, Xiaopeng Yang, Qing He, and Dong Yu. 2019. Unsupervised neural aspect extraction with sememes. In *IJCAI*, pages 5123-5129. +Tomás Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. 2013. Efficient estimation of word representations in vector space. In 1st International Conference on Learning Representations, ICLR 2013, Scottsdale, Arizona, USA, May 2-4, 2013, Workshop Track Proceedings. +Arjun Mukherjee and Bing Liu. 2012. Aspect extraction through semi-supervised modeling. In Proceedings of the 50th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 339-348. +Maria Pontiki, Dimitrios Galanis, Haris Papageorgiou, Ion Androutsopoulos, Suresh Manandhar, Mohammad Al-Smadi, Mahmoud Al-Ayyoub, Yanyan Zhao, Bing Qin, Orphée De Clercq, et al. 2016. Semeval-2016 task 5: Aspect based sentiment analysis. In International workshop on semantic evaluation, pages 19-30. +Soujanya Poria, Erik Cambria, and Alexander Gelbukh. 2016. Aspect extraction for opinion mining with a deep convolutional neural network. *Know.-Based Syst.*, 108(C):42-49. + +Victor Sanh, Lysandre Debut, Julien Chaumont, and Thomas Wolf. 2019. Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108. +Tian Shi, Liuqing Li, Ping Wang, and Chandan K. Reddy. 2020. A simple and effective self-supervised contrastive learning framework for aspect detection. +Stéphan Tulkens and Andreas van Cranenburg. 2020. Embarrassingly simple unsupervised aspect extraction. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 3182-3187, Online. Association for Computational Linguistics. +Laurens van der Maaten and Geoffrey Hinton. 2008. Visualizing data using t-sne. Journal of Machine Learning Research, 9(86):2579-2605. +Linlin Wang, Kang Liu, Zhu Cao, Jun Zhao, and Gerard De Melo. 2015. Sentiment-aspect extraction based on restricted boltzmann machines. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 616-625. +Lei Zhang and Bing Liu. 2014. Aspect and Entity Extraction for Opinion Mining, pages 1-40. Springer Berlin Heidelberg, Berlin, Heidelberg. +Lei Zhang, Shuai Wang, and Bing Liu. 2018. Deep learning for sentiment analysis: A survey. CoRR, abs/1801.07883. \ No newline at end of file diff --git a/anuncertaintyawareencoderforaspectdetection/images.zip b/anuncertaintyawareencoderforaspectdetection/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..71a0423ae5d6e1a34839e009ba92ef03f43e1836 --- /dev/null +++ b/anuncertaintyawareencoderforaspectdetection/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8eb7a011cac3643bea90c02544ffcc804220a05cbc595ff35b7efb1e1e7096fe +size 329372 diff --git a/anuncertaintyawareencoderforaspectdetection/layout.json b/anuncertaintyawareencoderforaspectdetection/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..4522c957441624a8e4d17e027bcbcf140e921af0 --- /dev/null +++ b/anuncertaintyawareencoderforaspectdetection/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:71f06c43df6eb9c42d41f15e7b482ac81d3418bbf1b56030eaf5c72dde505baf +size 312050 diff --git a/anunsupervisedframeworkfortracingtextualsourcesofmoralchange/2e710951-0358-46e5-9c88-d94d1f830962_content_list.json b/anunsupervisedframeworkfortracingtextualsourcesofmoralchange/2e710951-0358-46e5-9c88-d94d1f830962_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..509a89e983f8fd6bb50b829028afb9a39aa7cf32 --- /dev/null +++ b/anunsupervisedframeworkfortracingtextualsourcesofmoralchange/2e710951-0358-46e5-9c88-d94d1f830962_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6da607eb6fbf989314cc4947cb73dc12d625c9885cec58b998516b31aa90824 +size 81667 diff --git a/anunsupervisedframeworkfortracingtextualsourcesofmoralchange/2e710951-0358-46e5-9c88-d94d1f830962_model.json b/anunsupervisedframeworkfortracingtextualsourcesofmoralchange/2e710951-0358-46e5-9c88-d94d1f830962_model.json new file mode 100644 index 0000000000000000000000000000000000000000..44b261143bb9c3ed6e9cf77ef2cfad973f89ef90 --- /dev/null +++ b/anunsupervisedframeworkfortracingtextualsourcesofmoralchange/2e710951-0358-46e5-9c88-d94d1f830962_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d47c04d35875069a653fc0e5d103efeac63409b8cef4610f36d84ff8efec63d +size 101445 diff --git a/anunsupervisedframeworkfortracingtextualsourcesofmoralchange/2e710951-0358-46e5-9c88-d94d1f830962_origin.pdf b/anunsupervisedframeworkfortracingtextualsourcesofmoralchange/2e710951-0358-46e5-9c88-d94d1f830962_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..77814fd3d074e8a6100662096356fa8895e20a34 --- /dev/null +++ b/anunsupervisedframeworkfortracingtextualsourcesofmoralchange/2e710951-0358-46e5-9c88-d94d1f830962_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3df31898304f57aae3e6baade704771534fbb86426c945d0b67e6e3f4537446b +size 9016760 diff --git a/anunsupervisedframeworkfortracingtextualsourcesofmoralchange/full.md b/anunsupervisedframeworkfortracingtextualsourcesofmoralchange/full.md new file mode 100644 index 0000000000000000000000000000000000000000..111f6b6fb0933042d468b5a0abe137f3bfe267c0 --- /dev/null +++ b/anunsupervisedframeworkfortracingtextualsourcesofmoralchange/full.md @@ -0,0 +1,321 @@ +# An unsupervised framework for tracing textual sources of moral change + +Aida Ramezani $^{1*}$ , Zining Zhu $^{1,2*}$ , Frank Rudzicz $^{1,2,3}$ , Yang Xu $^{1,2,4}$ + +$^{1}$ Department of Computer Science, University of Toronto, Toronto, Canada + +$^{2}$ Vector Institute for Artificial Intelligence, Toronto, Canada + +3 St. Michael's Hospital, Toronto, Canada + +$^{4}$ Cognitive Science Program, University of Toronto, Toronto, Canada + +{armzn, zining, frank, yangxu}@cs.toronto.edu + +# Abstract + +Morality plays an important role in social wellbeing, but people's moral perception is not stable and changes over time. Recent advances in natural language processing have shown that text is an effective medium for informing moral change, but no attempt has been made to quantify the origins of these changes. We present a novel unsupervised framework for tracing textual sources of moral change toward entities through time. We characterize moral change with probabilistic topical distributions and infer the source text that exerts prominent influence on the moral time course. We evaluate our framework on a diverse set of data ranging from social media to news articles. We show that our framework not only captures fine-grained human moral judgments, but also identifies coherent source topics of moral change triggered by historical events. We apply our methodology to analyze the news in the COVID-19 pandemic and demonstrate its utility in identifying sources of moral change in high-impact and real-time social events. + +# 1 Introduction + +From ancient Greek scholars to philosophers of the past centuries, morality has been a subject of central importance in human history (Plato and Bloom, 1968; Aristotle et al., 2009; Hume, 1739; Smith, 1759; Kant, 1785; Nietzsche, 1887). Despite this importance, people's morals are not static but change over time (Bloom, 2010). Recent advances in natural language processing (NLP) have shown that text can inform moral sentiment and its change over time (e.g., how slavery was increasingly perceived to be morally wrong) (Xie et al., 2019; Garten et al., 2016). However, critically under-explored are the origins of these changes. We present a framework for tracing textual sources of moral change that requires minimal human intervention or supervision. + +The study of moral sentiment is a prominent subject in social psychology (Piaget, 1932; Kohlberg, 1969; Kohlberg and Hersh, 1977; Haidt, 2001; Pizarro and Bloom, 2003), and the advent of Moral Foundations Theory (Graham et al., 2013) has provided an impetus for text-based analysis of moral sentiment in natural language processing. Existing studies range from moral sentiment classification to temporal inference of moral sentiment change (e.g., Garten et al., 2016; Mooijman et al., 2018; Lin et al., 2018; Xie et al., 2020, 2019). + +The problem we focus on here is how moral perception toward entities (e.g., political leaders) varies through time, and whether textual analysis can help extract the sources of this variation. For instance, an entity like Bill Clinton could be applauded for charity at one time but deprecated for a sex scandal at another time. Similarly, moral sentiment toward a more general entity like policemen could undergo a negative shift due to acts on racial discrimination. Existing methods for moral sentiment detection typically take an aggregate approach and do not focus on analyzing moral sentiment of entities (Garten et al., 2016; Lin et al., 2018; Mooijman et al., 2018; Xie et al., 2019). Here, we develop a methodology to identify textual sources that give rise to moral sentiment change toward an entity. Our work takes a similar approach to detecting sources of gender bias in text by locating a set of documents that influence gender bias in word embeddings (Brunet et al., 2019). + +We propose a probabilistic unsupervised framework informed by both textual inference of moral sentiment and dynamic topic model (Blei and Lafferty, 2006). Capturing events as topic distributions, we approach this problem by decomposing textual mentions of an entity into topics and quantifying the contributions of different topics toward moral sentiment of an entity. We attribute the origins of moral change as topics that contribute saliently to changes in the time course of moral + +![](images/ccd56b13013a9336e69a916c25328735149e444c5cbabc21892683b8be76c03e.jpg) +a) + +![](images/f1d1b37a4f3500def02f1440cc2e005e6ac0b001a2564ccfc4dca98f7d4a481d.jpg) +b) +Figure 1: Graphical model and illustration of our framework for topic-based source analysis of moral change. + +sentiment. We compare this approach with classic work on influence function (Cook and Weisberg, 1980), which has been used to quantify the effect of samples in statistical estimation (see also Koh and Liang, 2017; Brunet et al., 2019). + +Figure 1 illustrates our framework. Figure 1a shows the generative process in our topic-based approach. Given an entity (e.g., Donald Trump) and its mentions in a set of documents (e.g., tweets or news articles), we wish to infer the most salient source topic(s) that gave rise to changes in the moral sentiment time course about that entity. Here as an illustration the moral sentiment toward Donald Trump is analyzed through a set of news articles. Each article includes mentions of this entity, specified as topical distributions that contribute toward the perceived moral sentiment of the entity (see Figure 1b). As moral sentiment of the entity changes over time, our framework uses probabilistic inference jointly with change point analysis to extract the most salient topic and its relevant source documents that underlie these changes. We show how our approach predicts fine-grained human moral judgment variation across topics and identifies influential and coherent text as the sources of moral change for both historical and modern events. + +# 2 Related work on textual inference of moral sentiment in NLP + +The development of Moral Foundations Theory (MFT) jointly with Moral Foundations Dictionary (MFD) (Graham et al., 2009, 2013) has propelled + +recent research in the natural language processing community to explore automated textual inference of moral sentiment. MFT sought to explain the cultural variation in morality and moral concerns along five or six moral foundations, each organized in terms of the polarities virtue $(+)$ and vice $(-)$ . + +The computational methods using MFT tend to rely on supervised approaches to predicting the moral sentiment reflected in text (Garten et al., 2016; Lin et al., 2018; Mooijman et al., 2018; Xie et al., 2020). Other related work has characterized moral biases in language models (Schramowski et al., 2019; Jentzsch et al., 2019; Xie et al., 2019), and contributed new datasets for tasks such as automatic ethical judgment and inference of sociomoral norms (Hoover et al., 2020; Lourie et al., 2020; Forbes et al., 2020). Existing work has also studied moral sentiment change over time (Xie et al., 2019) showing how word embeddings capture hidden moral biases underlying different concepts (e.g., slavery) in history. This model uses MFD words as seeds and a hierarchical framework to capture moral change in three tiers: moral relevance, moral polarity, and fine-grained moral foundations. $^{1}$ + +Here we go beyond this line of research by developing an unsupervised framework that automatically identifies sources of moral change toward entities in text. + +# 3 Methodology + +We formulate textual source tracing of moral change as a probabilistic inference problem. This model allows us to identify the sources of change at the topic level (source topic), as well as retrieve a set of related documents (source documents) underlying the detected moral change. To do so, we need to quantify 1) the moral time course of an entity based on textual input, and 2) the influence of topics on the changes in moral time course. + +Quantification of moral time course. We estimate the moral sentiment along moral dimension $m$ for entity $e$ at time point $t$ as follows: + +$$ +P (m | e, t) = \frac {\sum_ {d \in D _ {e , t}} P _ {e} (m | d)}{| D _ {e , t} |} \tag {1} +$$ + +Here $D_{e,t}$ is the set of documents (indexed by $d$ ) at time point $t$ that contain entity $e$ at least once. For example, $D_{e,t}$ can be all the documents in our corpus that are published in $t =$ December 1997, and include a mention of entity $e =$ Bill Clinton. Moral dimension $m$ can be moral relevance, moral polarity, or one of the moral foundations in MFT. + +To construct a vector representation for a document, we exclude all the sentences in $d$ that do not include any mentions of entity $e$ . After lemmatizing the rest of the document using spaCy English model, we remove 1) function words, 2) entity $e$ and its mentions, and 3) words that are classified as morally irrelevant by the centroid model following Xie et al. (2019). We then derive the vector representation of document $d$ by taking an average of the semantic vector representations (i.e., word embeddings) of the remaining words: $V_{d} = \frac{1}{|d|}\sum_{w\in d}V_{w}$ . Here $V_{d}$ is the vector representation of document $d$ , and $V_{w}$ is the vector representation of lemma $w$ . + +To estimate $P_{e}(m|d)$ , we use the centroid model in Xie et al. (2019). This model estimates this probability by comparing the similarity of an input vector (i.e., $V_{d}$ ) to each of its centroids. The centroids of this model in the moral relevance tier are the average word embeddings of MFD words and a set of morally neutral words. For moral polarity, the centroids are based on moral virtue and vice words from MFD. For the fine-grained tier, there are 10 centroids, each being the average word embeddings of the words in a moral foundation. + +Quantification of textual source and influence of moral change. To quantify sources of moral change, we first use the dynamic topic model (Blei and Lafferty, 2006) to infer emerging topics based on the temporal collection of documents that contain entity $e$ (illustrated in Figure 1). Using a dynamic topic model offers the flexibility to update old and dated topics with emerging topics over time. For entity $e$ with $k$ associated topics, we then define metric $\Delta S$ to quantify the influence of each topic on moral change toward this entity in time window $t \sim t + \Delta t$ (excluding $t$ ). Similar to Equation 1, $t$ is a point in time, e.g., December 1997, and $\Delta t$ is a time period, e.g., 3 months. Formally, + +this metric is as follows: + +$$ +\begin{array}{l} \Delta S (e, m, o, t, \Delta t) = \\ \left| P (m \mid e, t \sim t + \Delta t, t o p i c \neq o) - P (m \mid e, t) \right| \tag {2} \\ \end{array} +$$ + +Here $o$ represents a topic ranging from 1 to $k$ , and $\Delta S$ measures the degree to which removing a topic can restore the moral sentiment to its base state. The topic with the lowest $\Delta S$ is the most influential source for the change. We derive $P(m|e, t \sim t + \Delta t, \text{topic} \neq o)$ as follows: + +$$ +\begin{array}{l} P (m | e, t \sim t + \Delta t, t o p i c \neq o) \\ = \sum_ {d \in D _ {e, t \sim t + \Delta t}} P _ {e} (m | d) P (d | t o p i c \neq o) \\ \propto \sum_ {d \in D _ {e, t \sim t + \Delta t}} P _ {e} (m | d) P (t o p i c \neq o | d) \\ \propto \sum_ {d \in D _ {e, t \sim t + \Delta t}} P _ {e} (m | d) (1 - P (\text {t o p i c} = o | d)) \tag {3} \\ \end{array} +$$ + +We estimate $P(\text{topic} = o|d)$ from the dynamic topic model. Similar to Equation 1, $D_{e,t\sim t + \Delta t}$ represents the documents that contain entity $e$ appearing within time window $t\sim t + \Delta t$ . Without loss of generality, we assume a uniform prior for the distribution of the documents, so $P(d)$ is constant. + +We detect significant changes in moral time course using an established method for changepoint detection (Kulkarni et al., 2015). Given a time series as the input, this method first generates random perturbations of the time series and compares the magnitude of the mean shift before and after a time point in the original series to that in the random perturbations, for all the points in the time course individually. The outputs of the algorithm will be the time points with the most significant mean shifts (i.e., lowest p-values) as the change points. We consider a sliding window with a size of $W_{t}$ time points and a step size of $W_{s}$ and run the change point detection algorithm on the moral sentiment time series of an entity by estimating the probability in Equation 1 incrementally over time. This gives change point(s) $t$ and the relevant time window(s) $\Delta t$ which we use in Equations 2 and 4. We find $W_{t} = 7$ and $W_{s} = 3$ to be reasonable choices. + +We define $\Delta J$ to quantify the degree of influence of a set of documents $D^{*}$ (appearing at time $t\sim t + \Delta t$ ) on moral change toward entity $e$ in moral dimension $m$ at time $t$ . We compute this by + +calculating how the entity-based moral change is impacted by the removal of $D^{*}$ , formally as: + +$$ +\Delta J (e, m, D ^ {*}, t, \Delta t) = +$$ + +$$ +\left| P (m | e, t \sim t + \Delta t, D _ {e, t \sim t + \Delta t} \backslash D ^ {*}) - P (m | e, t) \right| \tag {4} +$$ + +Here $P(m|e,t\sim t + \Delta t,D_{e,t\sim t + \Delta t}\setminus D^{*})$ is calculated using Equation 1 over the documents including entity $e$ appearing at $t\sim t + \Delta t$ excluding set $D^{*}$ . The difference between $\Delta S$ and $\Delta J$ is that $\Delta S$ measures the influence of a topic over all the documents in a probabilistic setting, whereas $\Delta J$ measures the influence of a set of documents regardless of their topic associations. + +# 4 Experiments and results + +We evaluate and apply our framework in three diverse and real-world settings. + +# 4.1 Datasets + +Moral Foundations Twitter Corpus (MFTC). We use Moral Foundations Twitter Corpus (Hoover et al., 2020) for the first case study. This corpus provides a large set of human judgments along different moral dimensions for tweets divided into distinct topics. Each tweet is hand-annotated for the 10 foundation categories and moral relevance. Using Twitter Developer Account, we were able to extract 21,482 tweets falling under six topic domains specified in the original dataset: ALM (all lives matter), BLM (black lives matter), Baltimore, Davidson, Election, and Sandy. + +New York Times Annotated Corpus (NYT). We use the New York Times Annotated Corpus (Sandhaus, 2008) for the second case study. This dataset contains over 1.8 million news articles published in the New York Times from 1987 to 2007. + +COVID-19 News Dataset (COVID). We use AYLIEN Free Coronavirus Dataset in the third case study. This dataset contains more than 1,500,000 annotated English news articles relevant to the COVID-19 pandemic. We include the articles published in well-known United States news agencies from January, 2020 to the end of July 2020. We extracted a total number of 94,732 articles from CNN, Foxnews, NBC News, The New York Times, USA Today, abc News, CBS News, Washington Post, MSNBC News, and Los Angeles Times. + +# 4.2 Evaluation on human moral judgment + +Human moral sentiment toward entities may vary across topical contexts. As an initial study, we show how this variation is present in social media and can be captured by a topic-based approach where topic information is given. We use the MFTC tweet data for evaluation, based on the moral judgment of tweets in 6 topics: ALM, BLM, Baltimore, Davidson, Election, and Sandy. We summarize the human moral judgment of entities across topics using a count-based measure. Specifically, we compute the empirical probability $\widehat{P}(m|e,o)$ for moral dimension $m$ , entity $e$ , and topic $o$ as $\widehat{P}(m|e,o) = \frac{\text{count}(m,e,o)}{\text{count}(e,o)}$ . Here $\text{count}(e,o)$ is the number of tweets in topic $o$ that contain entity $e$ . To calculate $\text{count}(m,e,o)$ , we count the number of tweets from topic $o$ that contain entity $e$ , and were annotated with moral sentiment dimension $m$ in MFTC. To prepare ground-truth data, we take the following steps: 1) For the moral relevance dimension, if more than half of the annotators annotate a tweet "non-moral", we consider the tweet as morally irrelevant. 2) For the moral polarity dimension, if the majority of annotations fall under the positive fine-grained categories, the moral polarity of the tweet is positive (and negative otherwise). 3) For the foundation categories, each tweet is given the label of the category receiving the majority vote from the annotators. If more than one category satisfies this condition, we randomly assign one of them to the tweet. We also used graded proportions instead of binary ground-truth labels and obtained similar results. We analyzed moral judgment on the 53 most frequent entities in the MFTC that appear under at least two topics. The entities include hashtags, mentions, and the named entities such as people, organizations, groups, and concepts. $^5$ + +We first consider a topic-based model that explicitly uses topic information and applies static word embeddings to infer moral sentiment variation across topics. For each moral dimension $m$ , entity $e$ , and topic $o$ we derive the following probability using the methodology from Section 3: $P(m|e,o) \propto \sum_{d\in tweet}P_e(m|d)P(o|d)$ . We use Word2Vec word embeddings (Mikolov et al., 2013) to represent each tweet as a single vector. We also + +
Moral FoundationTopic-based Model (Static Embedding)Topic-free Model (Static Embedding)Topic-free Model (Contextual Embedding)
\(F_1\)Pearson's rn\(F_1\)Pearson's rn\(F_1\)Pearson's rn
Moral Relevance10.30719510.098-19510.103-195
Moral Polarity0.9470.8081710.9470.6381710.8410.763127
Authority0.9240.2851570.6890.199-1570.6990.30594
Subversion0.8770.2511430.705-0.028-1430.7770.242-110
Care0.9240.5001570.6890.3281570.6990.45194
Harm0.8770.060-1430.7050.036-1430.7770.286110
Fairness0.9240.5871570.6890.3911570.6990.55194
Cheating0.8770.3411430.7050.193-1430.7770.125-110
Loyalty0.9240.6341570.6890.5241570.6990.236-94
Betrayal0.8770.125-1430.7050.045-1430.777-0.104-110
Sanctity0.9240.5261570.6890.3541570.6990.36694
Degradation0.8770.3861430.7050.4341430.7770.524110
+ +Table 1: Evaluation of topic-based and topic-free models in predicting fine-grained human moral judgments, based on both $\mathrm{F}_1$ score and Pearson's correlation. Superscript minus sign under "Pearson's r" indicates $p > 0.05$ (Bonferroni corrected). + +consider two alternative topic-free models using static and contextual embeddings, where topic information is discarded in moral sentiment inference, i.e., $P(m|e,o) = P(m|e)$ . We use BERT (Devlin et al., 2019) in the contextual embedding model to represent tweets. Similarly for the centroid model, instead of using the static embeddings of the seed words in MFD, we use BERT to embed their definitions from the online version of the Oxford English Dictionary (OED). + +Each model infers $P(m|e,o)$ for all entities, topics, and moral dimensions. We compare these probabilities with ground-truth moral judgments $\widehat{P}(m|e,o)$ using both $\mathrm{F}_1$ score and Pearson's correlation. We consider estimates of $\widehat{P}(m|e,o)$ and $P(m|e,o)$ meaningful if 1) the entity appears in at least one of the tweets in topic $o$ , and 2) there is at least one tweet in topic $o$ containing entity $e$ that satisfies the 3-tier hierarchical structure, i.e., moral polarity of an entity is only estimated when it is morally relevant, and virtuous/vice moral foundations sentiments are estimated only for morally positive/negative input. A correlation test is performed on the samples that satisfy the two criteria in both model and human judgment. $\mathrm{F}_1$ score quantifies the proportion of samples that they agree on. + +Table 1 summarizes our results in this task. We observe that the topic-based model best accounts for the variation in human moral judgment across topics for the entities analyzed, both in terms of the $\mathrm{F}_1$ scores and fine-grained correlation values. + +For example, the entity $USA$ bears an overall negative moral polarity, while the same entity appears more morally positive in tweets concerning the topic Election. Another example is that the entity CNN displays a negative moral polarity across all topics, but shifts to a morally positive sentiment under the topic ALM. Our topic-based model with static embedding captures both of these variations. These initial results provide strong support to our presumption that moral sentiment toward entities may vary across context. We next apply our framework to diachronic data where neither topic information nor change point is provided. + +# 4.3 Evaluation on moral source identification from news of historical events + +In the second case study, we use the NYT dataset to evaluate the topic-based source model against prominent historical events in the United States from the $20^{\text{th}}$ and $21^{\text{st}}$ centuries, and analyze the entities associated with each event. We assess the topic-based source model on its ability to identify the moral changes at the historical incidents and locate topics and source text (i.e., news articles) relevant to these events. We also use the established influence function (Cook and Weisberg, 1980) as a baseline model for comparison. + +Evaluation metrics. We consider a baseline inspired by influence function (Cook and Weisberg, 1980) to retrieve a set of documents as the textual source of moral change. We compare this set to the documents retrieved by the topic-based source + +![](images/696aa4f1aceb14c01c6855d83ce42aab4213858451e6076745137f67e0f5aaea.jpg) +Figure 2: Illustration of metrics quantifying the effectiveness of models for tracing sources of moral sentiment change based on NYT news about Bill Clinton from 1997-12 to 1998-03. a) Comparing the degree of influence $(\Delta J)$ of different methods on restoring the change to its baseline (horizontal dash): smaller $\Delta J$ indicates greater influence. b) Expected coherence of source documents $(E[H])$ of different methods. + +![](images/c5e0138b4ee2c8ebdb420372cfb3c008ad58c8c7a0538175d640c3fd354c86c0.jpg) + +model based on the metrics of 1) degree of influence and 2) coherence of the retrieved source. + +To assess models based on degree of influence, we use $\Delta J$ . We first generate a null distribution via perturbing the dataset. The dataset used here is a set of documents published in $t \sim t + \Delta t$ that mention entity $e$ (i.e., $D_{e,t \sim t + \Delta t}$ ). To construct the null distribution, we choose a random set of documents from $D_{e,t \sim t + \Delta t}$ , denoted as $D^{*}$ , and measure the influence of set $D^{*}$ on moral sentiment at a change point using $\Delta J$ in Equation 4. We repeat this process until we generate 10,000 random document sets. The set of documents that minimizes $\Delta J$ significantly ( $\alpha = 0.05$ ) compared to the null distribution would be the source text. These documents form a subset that provides the maximal perturbation to the moral sentiment estimated at the change point. For the topic-based model, we select the source set by choosing documents with the highest $p(\text{topic} = o|d)$ , where $o$ is the topic minimizing Equation 2. The size of the source documents set for both the influence function and topic-based model would be $10\%$ of $|D_{e,t \sim t + \Delta t}|$ . We then compare $\Delta J$ of these two sets. A lower value for $\Delta J$ indicates greater influence and hence a more effective identification of the source documents. + +We define $E[H]$ to assess the coherence in the retrieved source documents. $E[H]$ is the average pairwise cosine similarity among a set of retrieved documents (i.e., news articles in this case). We consider coherence a desirable property because the sources responsible for moral change toward an entity should ideally reflect a consistent set of content. The coherence metric evaluates whether the retrieved source documents indeed form a con + +sistent set of text. We use Word2Vec embeddings to estimate the cosine similarities of news articles based on their headlines. Equation 5 defines this metric for a document set $D$ . In this equation, $V_{h_{d_i}}$ corresponds to the vector representation of the headline of news article $d_i$ . For both the topic-based model and influence function, $E[H]$ is estimated on the same set of documents as for $\Delta J$ : + +$$ +E [ H ] = \frac {1}{| D | (| D | - 1)} \sum_ {d _ {i} \in D} \sum_ {\substack {d _ {j} \in D \\ i \neq j}} \frac {V _ {h _ {d _ {i}}} \cdot V _ {h _ {d _ {j}}}}{\| V _ {h _ {d _ {i}}} \| \| V _ {h _ {d _ {j}}} \|} \tag{5} +$$ + +We also consider a random baseline which arbitrarily retrieves the same number of documents as the topic-based and influence function methods. + +Figure 2 illustrates $\Delta J$ and $E[H]$ based on NYT news about entity Bill Clinton from 1997-12 to 1998-03. The degree of influence and the coherence under the topic-based model are greater than those of the influence function and the random baseline. In particular, we observe that the topic retrieved as the source of the negative change in moral polarity of Bill Clinton is associated with the Clinton-Lewinsky Scandal (salient topic words include lawyer, Starr, Lewinsky, Jones), while the articles selected by influence function (salient words include plan, political, senate, patience) and the random baseline (sample words include Iraq, Democrat, world, battle) show minimal agreement in the context and no relevance to the ground-truth historical scandal of the period. The table in Appendix B shows the headlines of randomly sampled articles retrieved as sources of moral sentiment change by the three models. + +For a more comprehensive evaluation, we se + +
EntityInitial pointEnding pointNInfluence comparisonCoherence comparison
George H. W. Bush ↓1990-071991-022829Topic-based Influence Function Random BaselineTopic-based Influence Function Random Baseline
The most salient topic words: iraq, iraq, kuwait, allied, ground, saddam hussein
Bill Clinton ↓1997-121998-031224Topic-based Influence Function Random BaselineTopic-based Influence Function Random Baseline
The most salient topic words: intern, willey, lawyer, starr, lewinsky, babbitt, ginsburg, accusation
Bill Clinton ↓1998-071998-122693Topic-based Influence Function Random BaselineTopic-based Influence Function Random Baseline
The most salient topic words: censure, impeachment, impeach, judiciary, hyde, perjury
George Bush ↓2001-082001-122058Topic-based Influence Function Random BaselineTopic-based Influence Function Random Baseline
The most salient topic words: al qaeda, taliban, bin laden, attack, afghan, hijacker
China ↓2003-022003-05741Topic-based Influence Function Random BaselineTopic-based Influence Function Random Baseline
The most salient topic words: sars, disease, respiratory, health, sar, outbreak, syndrome, hospital
Saddam Hussein ↓2003-042003-121546Topic-based Influence Function Random BaselineTopic-based Influence Function Random Baseline
The most salient topic words: dean, lieberman, kerry, howard, clark, nomination, gore
George Bush ↓2003-052003-12500Topic-based Influence Function Random BaselineTopic-based Influence Function Random Baseline
The most salient topic words: capture, iraq, blair, foreign, saddam hussein
+ +Table 2: Textual source analyses for moral change toward entities in historical events. Arrows show the directions of the moral polarity change. Column "N" shows the number of articles retrieved in each time window. The influence set size is $10\%$ of $N$ . Bars under "Influence comparison" show inverse $\Delta J_{s}$ (lengthier for greater influence) under the three methods. "Coherence comparison" compares mean coherence $(E[H])$ of source text retrieved. The most salient words under the topic-based method are provided. + +lect the following well-known historical events and entities: George H. W. Bush for Gulf War (1990-1991), Bill Clinton for the Clinton-Lewinsky Scandal (1997-1998), George W. Bush for September 11 attacks (2001), China for the SARS outbreak (2002-2004), George W. Bush and Saddam Hussein for the Iraq invasion (2003-2004). The time resolution for our analysis is by month. For each entity and event, we extract all the articles published in NYT that mention the entity at least once. We use the dynamic topic model to derive 10 topics for each of the entities in the mentioned periods. We focus on assessing the models along the moral polarity dimension that has relatively clear-cut ground-truth for the historical incidents. + +Table 2 summarizes the result per entity and event. First, all the topics identified by the topic-based source model align with the (advent of) his + +toral events. For instance, the negative change in the moral polarity toward George H. W. Bush detected between 1990-07 and 1991-02 is associated with the topic of Iraq and Saddam Hussein. Comparisons on $\Delta J$ between the topic-based model and influence function indicate that these methods are equally effective in terms of the influence of the source documents ( $p = 0.348$ via paired t-test), while the topic-based model significantly outperforms the random baseline ( $p < 0.01$ ). Moreover, the topic-based model significantly outperforms the influence function and the random baseline ( $p < 0.05$ ) in the expected coherence of the retrieved source documents (i.e., $E[H]$ ). This set of results shows that the topic-based model is on par with the established influence function retrieving influential source documents that underlie moral sentiment change, and it is significantly more ef + +fective in selecting coherent articles relevant to the source of moral change. It is also important to note that although the influence function is designed to retrieve the most influential documents, it is computationally prohibitive to exhaustively search all possible documents, and here we applied a random search. In contrast, the topic-based model can also retrieve a set of influential documents, but it does not require an exhaustive iteration through all possible sets. Figure 3 illustrates and interprets the source analysis for the Clinton-Lewinsky Scandal. + +# 4.4 Application to textual source analysis of moral change in COVID-19 news + +In the final case study, we apply our framework to textual source analyses of moral change in COVID-19 news. Differing from the NYT case where we focused on evaluating moral changes against known historical events, here we focus on a real-time exploratory analysis of the COVID-19 news for four entities: Donald Trump, Anthony Fauci, Andrew Cuomo, and China. $^{7}$ + +Figure 4 shows the moral source analysis of Donald Trump. The topics selected for each change point align well with the notable incidences in COVID-19 pandemic (as annotated), suggesting how such source events can be traced in short time windows from text. The top row shows the time course of moral relevance for Donald Trump. Some relevant topic words are china, blame, disinformation, and asian. The retrieved relevant words in the middle row, reflecting a moral polarity change are flynn, ratcliffe, fbi, and investigation. The bottom row shows similar analyses for subversion which is one of the 10 moral foundations. The changing point occurs at week of 2020-05-18, and the relevant terms include george floyd, police, protest, and riot. For a more in-depth analysis, we apply the topic-based source model to all four entities. The table in Appendix C summarizes the results. Certain events during the pandemic had significant impact on how the entities are morally portrayed in the news. For example, George Floyd incident is attributed to be the source of the increase in subversion for Donald Trump. The shift happens after the week starting on May $18^{\text{th}}$ , which is close to the incident date May $25^{\text{th}}$ . Our model also identifies context when an entity becomes morally relevant. For example, it finds an increase in moral relevance + +Topics +![](images/2fb308af6d12b2d1c2b072a0a735f422be8718635674aec808d8dfa76c709f80.jpg) +Change Point 1: News organizations begin +to report about the alleged sexual +relationship between Clinton and Lewinsky. +1: iraq, hussein, annan, saddam +2: netanyahu, israel, withdrawal, africa + +Topics +Figure 3: Textual source analysis of moral change toward Bill Clinton from 1997-1998. a) Changes in moral relevance and polarity. The vertical dashed line shows change point aligned with the start of the scandal. The bar plot below shows the topics and their relative contributions to the change. b) Fine-grained moral sentiment change toward Bill Clinton. The bottom plot shows the topical contributions in change along the Betrayal dimension from 1997-12 to 1998-04. Topic 10 is the most salient source. +![](images/d5ac4f644cafe180a2620ddb198d243083982a60d29560abe96036d53d19f717.jpg) +3: dayd1, internationala3, kaczynski, wei +4: hoffa, school, mayor, giuliani +5: tobacco, surplus, budget, care +6: plaintiff, judge, harassment, court +7: nato, czech, satcher, art +8:movie, scandal,film, story +9: republican, senator, gore, abortion +0: intern, willey, lawyer, starr +1: india, suharto, nuclear, annan +2: africa, ireland, israel, netanyahu +3: satellite, china, chinese, wang +4: school, khmer, pol, rouge +5: tobacco, industry, company, surplus +Intiff, harassment, judge, court +7: milosevic, kosovo, nato, art +8: beatty, movie, color, medium +9: republican, senate, senator, gingrich 10: millionaires +10: willey, privilege, starr, mcdougal + +for Anthony Fauci during June $22^{\mathrm{nd}}$ to July $27^{\mathrm{th}}$ with source topics concerning the conspiracy theories of COVID-19 treatment in social media, and the conflicts between Fauci and Trump. + +# 5 Discussion and conclusion + +We have presented an unsupervised framework that uses topical information to infer textual sources of moral change for entities. Our work extends existing NLP methods for moral change inference by + +![](images/925b3240812833194841a0720e17e6e7f59587f32cf24a9de257ddab453db1e4.jpg) + +![](images/d30365dc1a8f06011fd34e9b07a82ef4788374d3a5ecf25f746cf1dbc780bd56.jpg) + +![](images/a9375a44dbf7b39f57ca094988ef2de912cb1f804d4915a9ab22fd2e3698aed7.jpg) +Figure 4: Textual sources of moral change toward Donald Trump in COVID-19 news. Shaded boxes show the sliding windows where the change points are detected. The topic-based model finds the most salient topic, annotated with the headline of a high-probability article. + +identifying the origins of moral change over time. With evaluations on a diverse set of data, we show that our method captures both the fine-grained human moral judgments and coherent source text of moral change relevant to social events. + +Our approach differs from work on general sentiment inference, partly because moral sentiment has a more fine-grained and hierarchical structure that involves inference at three different tiers, e.g., moral relevance, moral polarity (vice vs. virtue), and moral foundations. Previous work has evaluated rigorously models that capture this 3-tier moral hierarchy (Xie et al., 2019). Our framework builds on this study by characterizing the textual source of moral change at each of the three tiers. Although moral polarity can overlap with general sentiments such as good and bad, our framework captures moral sentiment beyond this dichotomous dimension. For instance, an increase in the moral relevance of an entity can be driven by an increase in moral authority, which may or may not involve any positive or negative sentiment (see Appendix C for examples). In this respect, moral sentiment captured by our framework can be dissociated with sentiment portrayed in the traditional NLP literature. + +Our work makes minimal claims about the causes of moral change. Our focus here is to identify salient topics as the source of moral sentiment change. This topical information can be a proxy to world events that trigger changes in moral perception toward an entity. Identifying the causes of moral change beyond textual sources studied here can be an exciting yet challenging direction. + +Our framework also offers opportunities for further exploration of entity-based moral sentiment change. Future work may explore how different media platforms vary in the moral sentiments that they convey towards entities (e.g., public figures) and the sources of this variation. + +# Acknowledgements + +We thank Graeme Hirst, Jennifer Stellar, Lea Freermann, and Matthew Fienberg for their feedback on our manuscript. AR is funded partly by a Schwartz Reisman Institute for Technology and Society Graduate Fellowship. This work was supported by a NSERC Discovery Grant RGPIN-2018-05872, a SSHRC Insight Grant #435190272, and an Ontario ERA Award to YX. + +# Broader impact and ethical statement + +Our study applies natural language processing to the source identification of moral change triggered by high-impact historical and contemporary social events. The framework we have developed provides an automated and scalable tool for interdisciplinary scholars including computational linguists, psychologists, and social scientists to quantitatively investigate the origins of moral change. + +Some of our analyses on social media and news articles can be considered sensitive. The results that we report here do not represent our personal beliefs or opinions and could potentially be influenced by the biases contained in the datasets. + +# References + +Aristotle, W. D. Ross, and Lesley Brown. 2009. The Nicomachean ethics. Oxford University Press. +David M Blei and John D Lafferty. 2006. Dynamic topic models. In Proceedings of the 23rd International Conference on Machine Learning, pages 113-120. +Paul Bloom. 2010. How do morals change? Nature, 464(7288):490. + +Marc-Etienne Brunet, Colleen Alkalay-Houlihan, Ashton Anderson, and Richard Zemel. 2019. Understanding the origins of bias in word embeddings. In Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 803-811. PMLR. +R Dennis Cook and Sanford Weisberg. 1980. Characterizations of an empirical influence function for detecting influential cases in regression. Technometrics, 22(4):495-508. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 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, Volume 1 (Long and Short Papers), pages 4171-4186, Minneapolis, Minnesota. Association for Computational Linguistics. +Maxwell Forbes, Jena D Hwang, Vered Shwartz, Maarten Sap, and Yejin Choi. 2020. Social chemistry 101: Learning to reason about social and moral norms. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing. +Justin Garten, Reihane Boghrati, Joe Hoover, Kate M Johnson, and Morteza Dehghani. 2016. Morality between the lines: Detecting moral sentiment in text. In Proceedings of IJCAI 2016 workshop on Computational Modeling of Attitudes. +Jesse Graham, Jonathan Haidt, Sena Koleva, Matt Motyl, Ravi Iyer, Sean P Wojcik, and Peter H Ditto. 2013. Moral foundations theory: The pragmatic validity of moral pluralism. In Advances in Experimental Social Psychology, volume 47, pages 55-130. Elsevier. +Jesse Graham, Jonathan Haidt, and Brian A Nosek. 2009. Liberals and conservatives rely on different sets of moral foundations. Journal of Personality and Social Psychology, 96(5):1029. +Jonathan Haidt. 2001. The emotional dog and its rational tail: a social intuitionist approach to moral judgment. Psychological Review, 108(4):814. +Joe Hoover, Gwenyth Portillo-Wightman, Leigh Yeh, Shreya Havaldar, Aida Mostafazadeh Davani, Ying Lin, Brendan Kennedy, Mohammad Atari, Zahra Kamel, Madelyn Mendlen, et al. 2020. Moral Foundations Twitter Corpus: A collection of 35k tweets annotated for moral sentiment. Social Psychological and Personality Science, 11(8):1057-1071. +David Hume. 1739. A treatise of human nature. Clarendon Press. +Sophie Jentzsch, Patrick Schramowski, Constantin Rothkopf, and Kristian Kersting. 2019. The Moral Choice Machine: Semantics derived automatically from language corpora contain human-like moral + +choices. In Proceedings of the 2nd AAAI/ACM Conference on AI, Ethics, and Society. Palo Alto (California): Association for the Advancement of Artificial Intelligence. +Immanuel Kant. 1785. Groundwork for the Metaphysics of Morals. Oxford University Press. +Pang Wei Koh and Percy Liang. 2017. Understanding black-box predictions via influence functions. In Proceedings of the 34th International Conference on Machine Learning - Volume 70, ICML'17, page 1885-1894. JMLR.org. +Lawrence Kohlberg. 1969. *Stage and Sequence; The Cognitive-developmental Approach to Socialization*. Rand McNally. +Lawrence Kohlberg and Richard H Hersh. 1977. Moral development: A review of the theory. Theory into Practice, 16(2):53-59. +Vivek Kulkarni, Rami Al-Rfou, Bryan Perozzi, and Steven Skiena. 2015. Statistically significant detection of linguistic change. Proceedings of the 24th International Conference on World Wide Web, pages 625-635. +Ying Lin, Joe Hoover, Gwenyth Portillo-Wightman, Christina Park, Morteza Dehghani, and Heng Ji. 2018. Acquiring background knowledge to improve moral value prediction. In 2018 IEEE/ACM International Conference on Advances in Social Networks Analysis and Mining (ASONAM), pages 552-559. IEEE. +Nicholas Lourie, Ronan Le Bras, and Yejin Choi. 2020. Scruples: A corpus of community ethical judgments on 32,000 real-life anecdotes. arXiv preprint arXiv:2008.09094. +Tomas Mikolov, Kai Chen, Greg S. Corrado, and Jeffrey Dean. 2013. Efficient estimation of word representations in vector space. In International Conference on Learning Representations, 2013a. +Marlon Mooijman, Joe Hoover, Ying Lin, Heng Ji, and Morteza Dehghani. 2018. Moralization in social networks and the emergence of violence during protests. Nature Human Behaviour, 2(6):389-396. +Friedrich Wilhelm Nietzsche. 1887. Zur genealogie der moral: Eine streitschrift. CG Naumann. +Jean Piaget. 1932. The moral judgment of the child. London: Routledge and Kegan Paul. +David A Pizarro and Paul Bloom. 2003. The intelligence of the moral intuitions: A comment on Haidt (2001). Psychological review, 110(1):193-6; discussion 197-8. +Plato and Allan Bloom. 1968. The Republic. New York. + +Evan Sandhaus. 2008. The New York Times annotated corpus. Linguistic Data Consortium, Philadelphia, 6(12):e26752. +Patrick Schramowski, Cigdem Turan, Sophie Jentzsch, Constantin Rothkopf, and Kristian Kersting. 2019. Bert has a moral compass: Improvements of ethical and moral values of machines. arXiv preprint arXiv:1912.05238. +Adam Smith. 1759. The Theory of Moral Sentiments. McMaster University Archive for the History of Economic Thought. +Jing Yi Xie, Renato Ferreira Pinto Junior, Graeme Hirst, and Yang Xu. 2019. Text-based inference of moral sentiment change. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 4654-4663, Hong Kong, China. Association for Computational Linguistics. +Jing Yi Xie, Graeme Hirst, and Yang Xu. 2020. Contextualized moral inference. arXiv preprint arXiv:2008.10762. + +# A Details of data pre-processing + +We take the following steps in pre-processing for a document and a query entity: 1) We find all the mentions of the entity in the document using the co-reference resolution module specified in the paper. 2) We discard all the sentences in the document that do not include any mention of the entity. 3) We lemmatize the tokens in the documents using the spaCy English model. 4) We remove the entity with all its mentions, function words, and all the other words if they are classified as morally irrelevant using the centroid model following Xie et al. (2019). 5) We take an average of the word embeddings of the remaining tokens to derive the feature vector of the document. If the task is based on the BERT embeddings, we skip step 4, but to derive the vector representation of the document, we take an average of the tokens that pass through step 4 in the final layer. + +In Xie et al. (2019), the centroid model compares the Euclidean distance of an embedded input to the center of morally relevant words and the center of morally neutral words. The distances are then transformed to probabilities using a softmax function. + +Our framework models moral sentiment as a hierarchical concept under the three tiers of 1) moral relevance, 2) moral polarity, and 3) 10 fine-grained moral foundation categories. All the calculations for the moral sentiment dimensions are performed on the documents that satisfy this hierarchical framework. For instance, when estimating the moral polarity, the documents classified as morally irrelevant are discarded. Similarly, for each fine-grained category, we discard documents with an opposing moral polarity. + +# B Comparison of source news articles retrieved for Bill Clinton case study + +# Headlines of news articles retrieved by topic-based source model + +Lawyers for Jones Get More Response Time + +Whispered Secrets Start a Loud Debate + +Starr Is Right to Question White House Aide; Having It Both Ways + +Lewinsky's Bookstore Purchases Are Now Subject of a Subpoena + +# Headlines of news articles retrieved by influence function method + +A Waggish Tale In Washington... + +Starr Subpomanas Notes and Case Files of Lewinsky's Former Lawyer + +Would Punishing Iraq Carry Too High a Price? Vietnam's Lesson + +Day of Facing the Nation, Meeting the Press, Etc. + +# Headlines of news articles retrieved by random baseline + +Public Radio Hosts Drop In and Maybe Stay Too Long + +Book Agent Advised Taping Accusations + +After Derailing Trade Bill, Labor Sets Ambitious Goals + +Yes, a Surplus Would Help, But Tough Choices Remain + +Table 3: Headlines of 4 randomly sampled news articles retrieved by the three models as source for moral sentiment change toward Bill Clinton during Clinton-Lewinsky Scandal (1997-12 to 1998-03). + +# C Additional results from moral change source analysis for entities in COVID-19 news + +
EntityInitial pointEnding pointMoral DimensionTopic Words
Trump2020-03-232020-04-20Relevance ↑conspiracy, xenophobic, disinformation china, originate, blame, asian
2020-05-182020-06-22Relevance ↑juneteenth, police, black, floyd, racism, brutality, protest, racial, minneapolis
2020-04-202020-05-11Polarity ↓flynn, muir, mcenany, miller, obama collusion, ratcliffe, whistleblower killing, george floyd, protest, black minneapolis, peaceful, racism, murder
2020-05-182020-06-01Subversion ↑
Fauci2020-06-222020-07-27Relevance ↑sinclair, twitter, mikovit, conspiracy facebook, vaccine, mask, video
2020-06-292020-07-20Fairness ↑disapprove, statue, cain, goya, GOP electoral, biden, campaign, tulsa
Cuomo2020-05-112020-06-01Relevance ↑george floyd, cop, demonstration injustice, black, peaceful, protest, racism
2020-03-302020-05-04Polarity ↓14-day, death, flatten, epicenter lockdown, peak, social distancing, reopen
2020-05-252020-06-22Polarity ↓george floyd, cop, demonstration injustice, black, peaceful, protest, racism
2020-03-232020-04-13Cheating ↓14-day, death, flatten, epicenter lockdown, peak, social distancing, reopen
China2020-03-232020-04-20Relevance ↑blame, disinformation, trump, conspiracy accountable, downplay
2020-05-112020-05-25Relevance ↑hong kong, freedom, democracy, economic, tension, territory
2020-02-242020-03-23Polarity ↑iran, ban, passenger, flight quarantine, cruise, case, korea, japan
2020-05-112020-05-25Polarity ↑hong kong, freedom, democracy economic, tension, territory
2020-02-242020-03-23Authority ↑flu, disease, sick, test, care, influenza cough, respiratory, ventilator, Covid-19
+ +Table 4: Source analyses of moral sentiment change of entities in COVID-19 along different moral dimensions. Arrows indicate the polarities of change. The most salient words from the source topics are shown for each entity. \ No newline at end of file diff --git a/anunsupervisedframeworkfortracingtextualsourcesofmoralchange/images.zip b/anunsupervisedframeworkfortracingtextualsourcesofmoralchange/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..4c46be25f4847c6be09d7f4abd73fac394ca863c --- /dev/null +++ b/anunsupervisedframeworkfortracingtextualsourcesofmoralchange/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd194694fb281042df44ce1b83d76acac42a591c2498c934db6cce9783ec42f1 +size 771220 diff --git a/anunsupervisedframeworkfortracingtextualsourcesofmoralchange/layout.json b/anunsupervisedframeworkfortracingtextualsourcesofmoralchange/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..12c330f3c104e7c3ba8d506236cf2026cd147c76 --- /dev/null +++ b/anunsupervisedframeworkfortracingtextualsourcesofmoralchange/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d68e5d58459cd8688e12599ddf79c404e3758860199df0658ee4f8e6382ce4e7 +size 448261 diff --git a/anunsupervisedmethodforbuildingsentencesimplificationcorporainmultiplelanguages/c79a5878-3334-4bd7-8cfe-84333ffe9397_content_list.json b/anunsupervisedmethodforbuildingsentencesimplificationcorporainmultiplelanguages/c79a5878-3334-4bd7-8cfe-84333ffe9397_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..564ae3256e6641910bd0b79393af2eb3d1959ea3 --- /dev/null +++ b/anunsupervisedmethodforbuildingsentencesimplificationcorporainmultiplelanguages/c79a5878-3334-4bd7-8cfe-84333ffe9397_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c947e571e75bb52a636d23468ee8019df0f885fb3e8ea6e1b955c7cd6142a751 +size 81180 diff --git a/anunsupervisedmethodforbuildingsentencesimplificationcorporainmultiplelanguages/c79a5878-3334-4bd7-8cfe-84333ffe9397_model.json b/anunsupervisedmethodforbuildingsentencesimplificationcorporainmultiplelanguages/c79a5878-3334-4bd7-8cfe-84333ffe9397_model.json new file mode 100644 index 0000000000000000000000000000000000000000..ff4c149f67c8455eb5ec818a73dc01892d214e70 --- /dev/null +++ b/anunsupervisedmethodforbuildingsentencesimplificationcorporainmultiplelanguages/c79a5878-3334-4bd7-8cfe-84333ffe9397_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b03fb081e83ad3df56027178de1211bf9789e8884253ad30aaf1749091f0589a +size 99459 diff --git a/anunsupervisedmethodforbuildingsentencesimplificationcorporainmultiplelanguages/c79a5878-3334-4bd7-8cfe-84333ffe9397_origin.pdf b/anunsupervisedmethodforbuildingsentencesimplificationcorporainmultiplelanguages/c79a5878-3334-4bd7-8cfe-84333ffe9397_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1b5ae54a0ccf1540f64c4a6b4d1d44d28db61671 --- /dev/null +++ b/anunsupervisedmethodforbuildingsentencesimplificationcorporainmultiplelanguages/c79a5878-3334-4bd7-8cfe-84333ffe9397_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:939e92803222f39ce252ce7a680c011924a8a910a88585bd33c82fadbbce71c7 +size 986771 diff --git a/anunsupervisedmethodforbuildingsentencesimplificationcorporainmultiplelanguages/full.md b/anunsupervisedmethodforbuildingsentencesimplificationcorporainmultiplelanguages/full.md new file mode 100644 index 0000000000000000000000000000000000000000..a606f8c66418a6f118eda66c5a3c19e172438e6f --- /dev/null +++ b/anunsupervisedmethodforbuildingsentencesimplificationcorporainmultiplelanguages/full.md @@ -0,0 +1,320 @@ +# An Unsupervised Method for Building Sentence Simplification Corpora in Multiple Languages + +Xinyu Lu * Jipeng Qiang*† Yun Li Yunhao Yuan Yi Zhu + +Department of Computer Science, Yangzhou University, Jiangsu, China + +{181303216, jpqiang, liyun, yhyuan, zhuyi}@yzu.edu.cn + +# Abstract + +The availability of parallel sentence simplification (SS) is scarce for neural SS modelings. We propose an unsupervised method to build SS corpora from large-scale bilingual translation corpora, alleviating the need for SS supervised corpora. Our method is motivated by the following two findings: neural machine translation model usually tends to generate more high-frequency tokens and the difference of text complexity levels exists between the source and target language of a translation corpus. By taking the pair of the source sentences of translation corpus and the translations of their references in a bridge language, we can construct large-scale pseudo parallel SS data. Then, we keep these sentence pairs with a higher complexity difference as SS sentence pairs. The building SS corpora with an unsupervised approach can satisfy the expectations that the aligned sentences preserve the same meanings and have difference in text complexity levels. Experimental results show that SS methods trained by our corpora achieve the state-of-the-art results and significantly outperform the results on English benchmark WikiLarge. + +# 1 Introduction + +The task of sentence simplification (SS) is to rephrase a sentence into a form that is easier to read and understand while conveying the same meaning (Chandrasekar et al., 1996). SS is first used as a preprocessing task of machine translation, and then is used to increase accessibility for those with cognitive disabilities such as aphasia (Carroll et al., 1998), dyslexia (Rello et al., 2013), and autism (Evans et al., 2014). + +Most popular methods (Wubben et al., 2012a; Xu et al., 2016; Zhang and Lapata, 2017; Nisioi et al., 2017; Martin et al., 2020a) have addressed + +![](images/cae5442b48f0ce608e65f2e0ebf980e7804c1fdfe5876b7a34f213e848599cdf.jpg) +Figure 1: Example of English sentence simplification pair generated by machine translation pair. Large-scale machine translation pairs (e.g. English-German) are chosen as a source base. The sentence of bridge language (e.g. German) is translated into an English sentence. After pairing the results of the source (English) and the translated sentence, we can harvest large-scale pseudo sentence pairs, as the red dashed arrow shows. + +SS as a monolingual machine translation task that translating from complex sentences to simplified sentences, whose performance rely heavily on the quality of parallel SS corpus. However, much work (Woodsend and Lapata, 2011; Coster and Kauchak, 2011; Xu et al., 2016; Qiang and Wu, 2021) pointed out that the public English SS benchmark (WikiLarge (Zhang and Lapata, 2017)) which align sentences from English Wikipedia and Simple English Wikipedia are deficient, because they contain a large proportion of inaccurate or inadequate simplifications, which lead to SS methods that generalize poorly. Additionally, parallel SS corpus is difficult to obtain in all languages other than English. Therefore, in the paper, we focus on how to build SS corpora in multiple languages using an unsupervised method. + +Some work Kajiwara and Komachi (2018); Martin et al. (2020b) built pseudo parallel corpora by searching the nearest neighbor sentence for each sentence based on embedding model from a largescale text corpus. We can see that the built corpora are more like paraphrase corpora instead of SS corpora. It is because: (1) It only guarantees that the aligned sentences are highly similar, and cannot + +guarantee that the aligned sentences preserve the same meanings; and (2) Each sentence pair does not distinguish between the simple sentence and the complex sentence. + +In this paper, we present an unsupervised method to build SS parallel corpora based on a large-scale bilingual translation corpus. Many languages have large-scale training corpora, which lie at the core of the recent success of neural machine translation (NMT) models. If we plan to build a pseudo English SS corpus, the main idea of our method is demonstrated in Figure 1: we use a translator to translate the sentence in a bridge language (e.g., German) into English, and pair them as a pseudo SS sentence pair. The idea is motivated by the following two findings: + +(1) NMT models usually tend to generate more high-frequency tokens and less low-frequency tokens (Gu et al., 2020; Jiang et al., 2019). Considering that the higher the word frequency, the more simple the word is, this phenomenon could be beneficial to text simplification (Saggion, 2017; Qiang et al., 2020a). +(2) The difference of text complexity levels exists between the source and target language of translation corpus (Bentz et al., 2016). From the perspective of linguistics, word entropy, morphological complexity, and syntactic complexity vary between languages. A sentence with lower complexity is more likely to be translated into a simpler one. + +Each sentence pair in the pseudo SS corpus preserves the same meaning. We measure the difference of sentence complexity between the original sentence and the translated sentence using Flesch reading-ease score (Kincaid et al., 1975), and keep pairs with a higher complexity difference as SS corpus. For each remaining sentence pair, the sentence with a higher score will be treated as the simple sentence and the other sentence as the complex. + +The contributions of our paper are as follows: + +(1) We propose an unsupervised method to build SS corpora in multiple languages because our method can be used to languages with large-scale NMT resources. Our method can guarantee that the aligned sentences preserve the same meanings and have difference in text complexity levels. +(2) We provide SS corpora in three languages (English, French, and Spanish) to train SS models, alleviating the need for language-specific supervised corpora. We plan on making these resources + +publicly available after this paper is published1. + +(3) Experimental results show that SS methods on our English corpus significantly outperform the results on the English SS benchmark (WikiLarge). We adopt pre-trained language modeling BART on our English SS corpus to achieve the state-of-the-art in English with 42.69 SARI on ASSET and 41.97 SARI on TURKCORPUS datasets. + +# 2 Related Work + +# 2.1 Supervised Sentence Simplification + +Supervised sentence simplification (SS) methods treat sentence simplification task as monolingual machine translation task that translating from complex sentences to simplified sentences, requiring supervised parallel training corpora of complex-simple aligned sentences (Wubben et al., 2012a; Martin et al., 2020a; Nisioi et al., 2017; Xu et al., 2016; Zhang and Lapata, 2017; Scarton and Specia, 2018; Dong et al., 2019; Qiang et al., 2020b). The above methods have relied on WikiSmall (Zhu et al., 2010) or WikiLarge (Zhang and Lapata, 2017), which aligned sentences from English Wikipedia and Simple English Wikipedia. The two datasets have been criticized (Woodsend and Lapata, 2011; Coster and Kauchak, 2011; Xu et al., 2016; Qiang and Wu, 2021) because they contain a large proportion of inaccurate simplification (not aligned or only partially aligned) and inadequate simplification (not much simpler than complex sentence). Professional simplifications such as Newsela dataset (Xu et al., 2015) have high-quality sentence pairs. But, it is usually accompanied by restrictive licenses that prevent widespread usage and reproducibility. + +Researchers have attempted to design SS methods in other languages such as Spanish (Saggion et al., 2015), Portuguese (Aluisio et al., 2008), Japanese (Goto et al., 2015), French (Gala et al., 2020) and Italian (Brunato et al., 2015). But, these approaches are limited by the availability of parallel SS corpora. In this paper, we propose a general framework that can be used to obtain large-scale SS data for these languages to train neural SS methods. + +# 2.2 Unsupervised Sentence Simplification + +To overcome the scarcity of parallel SS corpus, unsupervised SS methods without using any parallel corpus have attracted much attention. Existing unsupervised SS methods can be divided into two + +classifications. The first scheme focuses on how to design an unsupervised SS method, and the second scheme concentrates on how to build a parallel SS corpus. + +Narayan and Gardent (2015) and Kumar et al. (2020) are the pipeline-based unsupervised framework, where the pipeline of Narayan and Gardent is composed of lexical simplification, sentence splitting, and phrase deletion, the pipeline of Kumar et al. includes deletion, reordering, and lexical simplification. Surya et al. (2019) proposed an unsupervised neural text simplification based on a shared encoder and two decoders, which only learn the neural network parameters from simple sentences set and complex sentences set. In other languages, there are unsupervised statistical machine translations for Japanese (Katsuta and Yamamoto, 2019) and back-translation in Spanish and Italian (Palmero Aprosio et al., 2019). The performance of the above unsupervised SS methods is however often below their supervised counterparts. + +Some work (Kajiwara and Komachi, 2018; Martin et al., 2020b) constructed SS corpora by searching the most similar sentences using sentence embedding modeling, and train SS methods using the constructed SS corpora. Kajiwara and Komachi (2018) calculated the similarity between the sentences from English Wikipedia by Word Mover's distance (Kusner et al., 2015). Martin et al. (2020b) adopted multilingual sentence embedding modeling LASER (Artetxe et al., 2018) to calculate the similarity between the sentences from 1 billion sentences from CCNET (Wenzek et al., 2019). Since the aim of the two works is to find the most similar sentences from a large corpus, they cannot guarantee that the aligned sentences preserve the same meanings. + +# 2.3 Paraphrase Mining + +Some work has focused on generating paraphrase corpus for neural machine translation (NMT) systems using back-translation, where back-translation (Sennrich et al., 2015) is a technique widely used in NMT to enhance the target monolingual data during the training process. Specifically, the back-translation technique is used by translating the non-English side of bitexts back to English(Wieting et al., 2017) and pairing translations with the references. Two large paraphrase corpora (PARANMT-50M (Wieting and Gimpel, 2017) and PARABANK (Hu et al., 2019)) are built + +based on this idea, and has been proven to have great potential in different translation-core tasks. Round-trip translation is also used in mining paraphrases (Mallinson et al., 2017) by translating sentences into another language then translating the result back into the original language. Similar to machine translation, back-translation is used to improve the performance of neural SS methods (Katsuta and Yamamoto, 2019; Palmero Aprosio et al., 2019; Qiang and Wu, 2021). Mehta et al. (2020) trained a paraphrasing model by generating a paraphrase corpus using back-translation, which is used to preprocess source sentences of the low-resource language pairs before feeding into the NMT system. + +The above work for building a large paraphrase corpus is to serve for NMT and other tasks, which is not fit for SS task. The difference of sentence complexity between the original sentence and the translated sentence for each sentence pair has not been taken into consideration, which is vitally important for SS task. Therefore, we focus on how to build a sentence simplification corpus, instead of a paraphrase corpus. + +# 3 Method + +In this paper, we present our unsupervised method to build SS corpora in multiple languages, which is motivated by high-frequency tokens generated by NMT modeling and the difference of text complexity levels between bilingual translation corpora. The overall architecture of the proposed method for building the English SS corpus is illustrated in Figure 2. Our method consists of two steps (Paraphrase Generation and Selectors) to build SS corpora, to achieve the following two requirements: + +(1) The two sentences of each sentence pair should convey the same meaning. Given high-resource parallel machine translation corpus, we can obtain paraphrase corpus by translating the sentences of the bridge language into the target language using a Translator. +(2) The two sentences of each sentence pair should have difference in text complexity levels. After obtaining the paraphrase corpus, we calculate the text complexity of the two sentences using text readability formulas and keep these pairs with a higher complexity difference. + +Pseudo SS Generation In contrast to previous work(Wieting and Gimpel, 2017; Hu et al., 2019) mining paraphrases for focusing on lexical and sen + +![](images/338e0dea81130a39cdde0fc2b4aa344303ec8782665cb2f0cfa3f673a6f72a91.jpg) +Figure 2: The overview of our approach for Building English SS corpus. Our approach is composed of a high-resource bilingual translation corpus and a translator. A pseudo paraphrase corpus is synthesized by pairing the source sentences (English) and the translated sentences of the bridge language. Then, we select these complex-simple sentence pairs with a higher complexity difference, as the sentence simplification corpus. + +tence structure diversity, we mine paraphrases as pseudo SS corpus for mainly considering the fluency and syntax correctness. + +Specifically, if we plan to construct a SS corpus for a specific language $A$ , we need to obtain a high-resource bilingual translation corpus of language $A$ and language $B$ , and a Translator which can translate the sentences in language $B$ into the language $A$ , where $B$ is the bridge language. It should be noted that the chosen bridge language determines the availability of parallel machine translation corpus, and also further determines the performance of the Translator. Therefore, the bridge language $B$ and the specific language $A$ should have a high-resource parallel corpus. For example, as shown in Figure 2, we choose German as a bridge language for building the English SS corpus. + +**Pickers** In this step, we design a simple pipeline consisting of only two selectors (BLEU and Flesch Reading Ease) for selecting some sentence pairs with a higher complexity difference. + +Firstly, we select these pairs with the BLEU scores² above a threshold $h_{BLEU}$ , for ensuring the quality of paraphrases. It is worthy to note that, this selector is mainly used to filter the unaligned sentence pairs in paraphrase corpus because translation mistakes are relatively rare owing to recent improvements on NMT models. Meanwhile, we filter out the translations which are the same as references. + +Secondly, we measure the difference of text complexity using Flesch reading ease score (FRES) (Kincaid et al., 1975), which is designed to indicate how difficult a sentence is to understand, and + +is widely used to evaluate the performance of SS. FRES grades the text from 0 to 100. The higher scores indicate the sentences are easier to read. As usual, the difference of one school grade level in FRES is 10, e.g., 5th grade (100.00-90.00) and 6th grade (90.0-80.0). The formula of FRES is, + +$$ +k _ {1} - k _ {2} \left(\frac {\# \text {w o r d s}}{\# \text {s e n t e n c e s}}\right) - k _ {3} \left(\frac {\# \text {s y l l a b l e s}}{\# \text {w o r d s}}\right) \tag {1} +$$ + +Here $k_{1}, k_{2}, k_{3}$ are coefficients that vary in different languages, which are set by linguists. The parameters of FRES in English are set to $k_{1} = 206.835, k_{2} = 1.015, k_{3} = 84.6$ . + +To ensure simplicity, we only keep the sentence pairs with a FRES difference higher than a threshold $h_{FRES}$ . In our experiments, we set $h_{BLEU} = 15.0$ and $h_{FRES} = 10.0$ , where $h_{FKE} = 10.0$ means that for each sentence pair, the simplified version should be at least one school level simpler than its its unsimplified counterpart. + +# 4 Sentence Simplification Corpora + +Our unsupervised method can be used to languages with large-scale bilingual translation corpora. According to this principle, we choose the three languages (English, French, and Spanish) to build SS corpora, to train SS systems. + +English In the step of paraphrase generation, we choose German as bridge language and obtains the bilingual translation corpus provided by huggingface3 with 4,000,000 sentence pairs as De-En. We use Facebook FAIR's state-of-the-art De → En + +
Bridge Language +Complex +SimpleEr sagt er gekommen Platzangst und fuehle sich, als ob er in einem Sarg begraben werden. +He says he gets claustrophobic, that he feels trapped as if he was buried in a coffin. +He says he gets scared and feels like he's being buried in a coffin.
Bridge Language +Complex +SimpleDas Hotel Gates am Kudamm, mit seiner einmaligen Gastfreundschaft, müssen Sie unbedingt einmal selbst erleben. +You simply must experience the Hotel Gates Am Kudamm with its unique concept of hospitality. +The Hotel Gates Am Kudamm, with its unique hospitality, is a must-see.
Bridge Language +Complex +SimpleDas Geld muss in Unternehmen investiert werden, die garantieren, dass Hochschulabgänge einen Arbeitsplatz finden. +The money must be invested in enterprises which guarantee that graduates will find employment. +The money must be invested in companies that guarantee that graduates will find a job.
+ +Table 1: Examples of English SS corpus generated by our method. The differences between the complex sentence and the simple sentence are emphasized in bold . + +
WikiLargeEnglishFrenchSpanish
Vocab(complex)169,349196,301112,335119,876
Vocab(simple)135,607165,130102,672104,361
Avg(complex)21.9318.9526.1728.00
Avg(simple)16.1419.3627.7425.79
Total pairs296,402816,058621,937487,862
+ +Table 2: Statistics of our building corpora in English, French, and Spanish compared with Wikilarge. Avg(complex) and Avg(simple) are the average numbers of words in the complex sentences and the simpler sentences, respectively. + +model $^4$ (Ng et al., 2019) as the translator, which is based on big Transformer (Vaswani et al., 2017) architecture training on WMT19 dataset. + +French and Spanish For both French and Spanish, English is chosen as the bridge language. The bilingual translation corpora for the two languages are from the full Europarl-v7 dataset5, where the sentence pairs of English-French and English-Spanish are 1,965,734 and 2,007,723, respectively. + +For French, the translator from English to French is also a Transformer-based model $^{6}$ (Ott et al., 2018). For Spanish, the translator from English to Spanish is fine-tuned by pre-trained language model mBART(Liu et al., 2020) $^{7}$ . + +The parameters of FRES in French is set to $k_{1} = 207$ , $k_{2} = 1.015$ , $k_{3} = 73.6$ , and the parameters in German are $k_{1} = 180$ , $k_{2} = 58.5$ , $k_{3} = 1.0$ . + +Statistics and Examples We show some examples of the sentence pairs generated by our method in Table 1. We report the statistics of our building corpora in Table 2. The numbers of sentence pairs in English, French, and Spanish are 816,058, + +621,937, and 48,7862, respectively. Because the SS task is a paraphrase generation task using easier words, the length of the complex sentence and the simple sentence are roughly the same, and the size of the vocabulary in the simple sentence set should be smaller than the complex sentence set. From Table 2, we can see that our three corpora satisfy the expectations of the SS task. In contrast to our corpora, the length of the complex sentence in WikiLarge is longer than the simple sentence, because it focuses on the deletion of content. + +# 5 Experiments + +We design experiments to answer the following two questions: + +Q1. Effectiveness: Is the English SS corpus built by our method a better dataset compared with the benchmark WikiLarge and the dataset built by (Martin et al., 2020b)? +Q2. Universality: Can our unsupervised method be used to build SS corpora for other languages with large-scale bilingual translation corpora? + +# 5.1 Evaluation Datasets + +We choose four datasets to evaluate the performance of SS modelings on our corpora: two datasets for English (TURKCORPUS and ASSET), ALECTOR for French, and SIMPLEXT for Spanish. The statistics are reported in Table 4. + +For evaluating English simplification task, we use two widely used evaluation benchmarks TURK-CORPUS (Xu et al., 2016) and ASSET (Alva-Manchego et al., 2020) of WikiLarge dataset. Both TURKCORPUS and its improved version ASSET consist of 2,000 valid sentences and 359 test sentences. Each original sentence in TURKCORPUS has 8 simplification references collected through Amazon Mechanical Turk. ASSET with 10 simplification references per original sentence focuses on multiple simplification operations including lexical + +
DataTURKCORPUSASSET
SARI ↑FKGL ↓BLEU ↑SARI ↑FKGL ↓BLEU ↑
Source26.2910.0299.3620.7310.0292.81
Reference40.218.7373.0045.146.4870.12
PBMT-R(Wubben et al., 2012b)WikiSmall38.048.8582.4934.638.8579.39
Dress-LS(Zhang and Lapata, 2017)WikiLarge36.977.6681.0836.597.6686.39
DMASS-DCSS(Zhao et al., 2018)WikiLarge39.927.7373.2938.677.7371.44
ACCESS(Martin et al., 2020a)WikiLarge41.387.2976.3640.137.2975.99
UNTS(Surya et al., 2019)Unsupervised36.297.6076.4435.197.6076.14
BTTS10(Kumar et al., 2020)Unsupervised36.917.8382.0035.727.8383.01
LSTMWikiLarge35.697.779.4535.816.0672.3
Ours38.218.4176.8537.657.9771.71
ConvS2SWikiLarge36.837.5880.4036.487.1882.29
Ours38.988.6673.7937.927.8969.67
TransformerWikilarge37.058.4286.7134.168.4284.47
MUSS(Martin et al., 2020b)38.069.4363.7038.039.4161.76
Ours39.997.9772.7539.587.8370.81
BARTWikiLarge38.968.1584.5836.818.1585.66
MUSS(Martin et al., 2020b)39.739.2665.00
Ours41.978.2173.7242.697.9471.83
+ +Table 3: Results of English sentence simplification. $\uparrow$ The higher, the better. $\downarrow$ The lower,the better. - indicates the results that are not found in the original paper. + +
Lang.#Valid#TestC.R.
TURKCORPUSEnglish20003590.95
ASSETEnglish20003590.83
ALECTORFrench8008010.97
SIMPLEXTSpanish7087080.48
+ +Table 4: The statistics of SS evaluation datasets. C.R.(Compression Ratio) is the amount of compression of the complex sentence relative to the simple sentence. + +paraphrasing, compression, and sentence splitting. + +For French, we use ALECTOR (Gala et al., 2020) for evaluation, which contains 1601 sentence pairs. It contains 79 original literary and scientific texts along with their simplified equivalents, which are chosen from materials for French Primary school students. We split it into a valid set (first 800 pairs) and a test set (next 801 pairs). + +For Spanish, we use SIMPLEXT (Saggion et al., 2015; Saggion, 2017) for evaluation, which contains 1416 sentence pairs. It is from 200 news articles that were manually simplified by experienced experts for people with learning disabilities. We split it into a valid set (708 pairs) and a test set (708 pairs). + +# 5.2 Training Details + +To compare the quality of our building corpora with other training datasets, we test the following four models: LSTM-based, ConvS2S-based, + +Transformer-based, and BART-based models. We implement the four models via fairseq(Ott et al., 2019). The parameters of all these models are tuned with SARI on validation sets. The parameters of the four models are shown below. + +We adopt the Adam optimizer with $\beta_{1} = 0.9$ , $\beta_{2} = 0.999$ , $\epsilon = 10^{-8}$ for LSTM-based, Transformer-based and BART-based models, the NAG optimizer for ConvS2S-based model. Dropout is set 0.1 for LSTM-based, ConvS2S-based and BART-based models and 0.2 for Transformer-based model. The initial learning rate are set to $5 \times 10^{-4}$ , $3 \times 10^{-4}$ , $lr = 3 \times 10^{-5}$ for LSTM-based, Transformer-based and BART(large)-based models, respectively. We use a fixed learning rate of $lr = 0.5$ for ConvS2S-based model. Byte Pair Encoding(BPE) is used in all the models for word segmentation. + +For BART-based model used for English SS, we initialize the model with the pretrained weights8. For BART-based model used for French and Spanish languages, we adopt a multilingual pretrained BART (mBART) with the weights7 pretrained on 25 languages. + +# 5.3 Evaluation Metrics + +SARI(Xu et al., 2016) is the main metric to evaluate text simplification models, which calculates the + +arithmetic mean of the $n$ -gram F1 scores of three operations (keeping, adding, and deleting) through comparing the generated sentences to multiple simplification references and the original sentences. + +Flesch-Kincaid Grade Level (FKGL)(Kincaid et al., 1975) based on FRES (Formula 1) is widely used to evaluate the SS task, which measures the readability of the system output. + +Earlier work also used BLEU (Papineni et al., 2002) as a metric, but recent work has found that it does not correlate with simplicity (Sulem et al., 2018). Systems with high BLEU scores are thus biased towards copying the original sentences as a whole (e.g., 99.36 on TURKCORPUS or 92.81 on ASSET). For completeness, we also report BLEU scores. For the above metrics, we use standard simplification evaluation tool EASSE to compute their scores. + +# 5.4 English Simplification + +We choose four supervised SS methods (PBMTR(Wubben et al., 2012b), Dress-LS(Zhang and Lapata, 2017), DMASS-DCSS(Zhao et al., 2018), and ACCESS(Martin et al., 2020a)), two unsupervised SS methods (UNTS(Surya et al., 2019) and BTTS10(Kumar et al., 2020)) to compare. We also choose the SS corpus built by (Martin et al., 2020b) as a comparison. + +Table 3 summarizes the evaluation results of SS methods on our building English corpus. We first compare the results between our building English SS corpus and English SS corpus WikiLarge. In terms of SARI metric, we can see that the four models (LSTM-based, ConvS2S, Transformer-based, and BART-based) on our data significantly outperform the results on WikiLarge dataset, demonstrating the promise of building SS corpora using our method. BART-based method achieves the best results compared with the other three models (LSTM-based, ConvS2S, and Transformer-based). On TURKCORPUS and ASSET, BART-based method on our data significantly outperforms the results on WikiLarge by a large margin (+3.01, +5.88 SARI). In terms of readability, BART on our data obtains lower (=better) FKGL compared to the results on WikiLarge. We believe this improvement shows that our method for building English SS corpus is a good choice for SS task. + +We then compare the results between our building corpus and MUSS build by (Martin et al., + +2020b). Compare with MUSS, SS methods on our dataset outperform the results on MUSS in terms of all the measurements. Transformer-based method on our dataset achieves a large improvement of $(+1.93, + 1.55$ SARI) on TURKCORPUS and ASSET, and BART-based method achieves a large margin of $+2.96$ SARI on ASSET. In terms of readability, Transformer-based and BART-based methods obtain lower FKGL compared with MUSS, which indicated the output of the SS methods is easier to understand. These indicate that the effectiveness of our method on building SS English corpus. + +5.5 French and Spanish Simplification + +
DataALECTORSIMPLEXT
SARI ↑FRES ↑SARI ↑FRES ↑
Source26.3666.575.6549.40
Pivot38.5265.5525.9856.30
mBART+MUSS38.3568.3619.8155.07
TransformerOurs36.9375.5630.3744.51
mBARTOurs39.0073.1527.8347.30
+ +Table 5: Results of unsupervised sentence simplification in French and Spanish. We choose FRES metric instead of its revision FKGL in French and Spanish because the coefficients of FKGL in these two languages are not available. + +Our approach can be applied to any language owing to large-scale translation corpora. Different from English SS task, large-scale SS training corpus in other languages is hard to obtain. For a better comparison, we add one new baseline (Pivot) via machine translation. Specifically, for Pivot, give one non-English sentence, we translate the sentence to English and translate the translated sentence back into the source language. Here, we use Google Translator $^{10}$ for French and Spanish translation. We also choose the best results of mBART+ (mBART+ACCESS) on MUSS dataset (Martin et al., 2020b), where ACCESS (Martin et al., 2020a) is a control mechanism to the parameters of SS model by controlling attributes such as length, lexical complexity, and syntactic complexity. + +The results are shown in Table 5. We can see that the same SS methods on our dataset outperform the results on MUSS, which verifies that our method is more fit for SS task. Compared with the results of Pivot, SS methods on our building SS corpora can + +generate more simplified sentences. We conclude that our method for building SS corpora can be used to languages with large-scale bilingual translation corpora. + +# 5.6 Ablation Study of our method + +To further analyze the factors affecting our unsupervised method for building SS corpus, we do more experiments in this subsection. + +
MethodTURKCORPUSASSET
SARI ↑FKGL ↓SARI ↑FKGL ↓
Pseduo SSTransformer34.189.4929.469.49
BART33.949.7229.929.72
w/o BLEUTransformer38.536.3739.056.08
BART38.617.0140.626.54
w/o FRESTransformer34.869.8830.499.63
BART35.979.6931.549.69
fullTransformer39.997.9739.587.83
BART41.978.2142.697.64
+ +Table 6: Ablation study results of SS methods on our English corpus without BLEU selector and FRES selector. "w/o" denotes "without". + +(1) Influence of each selector in our method. To evaluate the effect of each selector in our methods, we build four different SS corpus: pseudo SS corpus, the corpus building by our method without BLEU selector, the corpus building by our method without FRES selector, and the corpus building by our full method. We choose two SS methods (Transformer-based and BART-based) to do the experiments, and the results show in Table 6. It is very obvious that the results on pseudo SS corpus are the worst and our method combing two selectors achieves the best results. FRES selector in our method is more important than BLEU selector, because FRES selector is used to select the sentence pairs with a higher complexity difference and BLEU selector is only used to filter the unaligned sentence pairs. + +(2) Influence of the size of the corpus built by our method. Because the size of our SS corpus is 816,058 and the size of WikiLarge is 296,402, we vary the size from 10K to 800K to analyze the results of Transformer-based on the two corpora. Due to the size of WikiLarge, we only show the results of WikiLarge in the first 30K samples. We can see that the SARI values increase at first and keep stable finally when increasing the size of training samples. We see that the size of the SS corpus is of vital importance for SS methods. In the paper, we only choose a bilingual translation corpus of size + +![](images/06e80b6677e29d74958012f9e70072ca6520bfb114bdc208576802f6ca9f65ac.jpg) +Figure 3: The performance of Transformer-based and BART-based method on TURKCORPUS when varying the size of the corpus. + +![](images/f22156ab51fb38ba4fde5e7c09deaf1ae8a2e3334936c1c79962e73a2d9497e3.jpg) + +4,000,000. In the future, we will try to build SS corpora using a more large-scale bilingual translation corpus. + +# 5.7 Qualitative Study + +Table 7 shows some simplified sentences from the test set of TURKCORPUS by our method BART-based method trained with our building English corpus. Our model reduces more linguistic complexity of the source sentence, while still retaining its original information and meaning. We can found that our method more focuses on lexical simplification, e.g., "stomach" as a simpler for "inoperable abdominal", "very" as a simpler for "extremely", etc. We draw the same conclusions from these examples that our building method can be used to train SS methods. + +# 6 Conclusions + +We propose an unsupervised method to build large parallel corpora for training sentence simplification (SS) models. Our method consists of a high-resource bilingual translation corpus and a translator. Unsupervised SS models can be trained by pairing the source sentences in the bilingual translation corpus and the translated sentences of the bridge language generated by the translator. We conduct experiments and show that SS models trained on synthetic data generated by our approach significantly outperform the results on English benchmark WikiLarge. In the future, we plan to investigate the influence of different text readability methods. + +# Acknowledgements + +This research is partially supported by the National Natural Science Foundation of China under grants + +
SourceHe was diagnosed with inoperable abdominal cancer in April 1999.
ReferenceHe was diagnosed with abdominal cancer in April 1999.
OursHe was diagnosed with stomach cancer in April 1999.
SourceHeavy rain fell across portions of Britain on October 5, causing localized accumulation of flood waters.
ReferenceHeavy rain fell across Britain on October 5, causing accumulation of flood waters.
OursHeavy rain fell on parts of the UK on October 5, causing localized flooding.
SourceAdmission to Tsinghua is extremely competitive.
ReferenceAdmission to Tisinghua is competitive.
OursAdmission to Tsinghua is very competitive.
SourceThey are culturally akin to the coastal peoples of Papua New Guinea.
ReferenceThey are similar to the coastal peoples of Papua New Guinea.
OursThey are similar in culture to the coastal peoples of Papua New Guinea.
+ +Table 7: Examples of simplifications generated by BART-based method on our building English corpus. The bold words highlight the differences. + +62076217 and 61906060. + +# References + +Sandra M Aluísio, Lucia Specia, Thiago AS Pardo, Erick G Maziero, and Renata PM Fortes. 2008. Towards Brazilian Portuguese automatic text simplification systems. In Proceedings of the eighth ACM symposium on Document engineering, pages 240-248. + +Fernando Alva-Manchego, Louis Martin, Antoine Bordes, Carolina Scarton, Benoit Sagot, and Lucia Specia. 2020. ASSET: A dataset for tuning and evaluation of sentence simplification models with multiple rewriting transformations. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4668-4679, Online. Association for Computational Linguistics. + +Mikel Artetxe, Gorka Labaka, and Eneko Agirre. 2018. Unsupervised statistical machine translation. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 3632-3642, Brussels, Belgium. Association for Computational Linguistics. + +Christian Bentz, Tatjana Soldatova, Alexander Koplenig, and Tanja Samardžić. 2016. A comparison between morphological complexity measures: typological data vs. language corpora. + +Dominique Brunato, Felice Dell'Orletta, Giulia Venturi, and Simonetta Montemagni. 2015. Design and annotation of the first Italian corpus for text simplification. In Proceedings of The 9th Linguistic Annotation Workshop, pages 31-41. + +John Carroll, Guido Minnen, Yvonne Canning, Siobhan Devlin, and John Tait. 1998. Practical simplification of english newspaper text to assist aphasic readers. In Proceedings of the AAAI-98 Workshop on Integrating Artificial Intelligence and Assistive Technology, pages 7-10. + +Raman Chandrasekar, Christine Doran, and Srinivas Bangalore. 1996. Motivations and methods for text simplification. In *COLING* 1996 Volume 2: The 16th International Conference on Computational Linguistics, pages 1041-1044. + +William Coster and David Kauchak. 2011. Learning to simplify sentences using wikipedia. In Proceedings of the workshop on monolingual text-to-text generation, pages 1-9. + +Yue Dong, Zichao Li, Mehdi Rezagholizadeh, and Jackie Chi Kit Cheung. 2019. EditNTS: An neural programmer-Interpreter model for sentence simplification through explicit editing. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3393-3402, Florence, Italy. Association for Computational Linguistics. + +Richard Evans, Constantin Orasan, and Iustin Dornescu. 2014. An evaluation of syntactic simplification rules for people with autism. Association for Computational Linguistics. + +Núria Gala, Anaïs Tack, Ludivine Javourey-Drevet, Thomas François, and Johannes C Ziegler. 2020. Alector: A parallel corpus of simplified french texts with alignments of misreadings by poor and dyslexic readers. In Language Resources and Evaluation for Language Technologies (LREC). + +Isao Goto, Hideki Tanaka, and Tadashi Kumano. 2015. Japanese news simplification: Task design, data set construction, and analysis of simplified text. Proceedings of MT Summit XV, 1:17-31. + +Shuhao Gu, Jinchao Zhang, Fandong Meng, Yang Feng, Wanying Xie, Jie Zhou, and Dong Yu. 2020. Token-level adaptive training for neural machine translation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1035-1046, Online. Association for Computational Linguistics. + +J Edward Hu, Rachel Rudinger, Matt Post, and Benjamin Van Durme. 2019. Parabank: Monolingual + +bitext generation and sentential paraphrasing via lexically-constrained neural machine translation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 6521-6528. +Shaojie Jiang, Pengjie Ren, Christof Monz, and Maarten de Rijke. 2019. Improving neural response diversity with frequency-aware cross-entropy loss. In The World Wide Web Conference, pages 2879-2885. +Tomoyuki Kajiwara and M Komachi. 2018. Text simplification without simplified corpora. The Journal of Natural Language Processing, 25:223-249. +Akihiro Katsuta and Kazuhide Yamamoto. 2019. Improving text simplification by corpus expansion with unsupervised learning. In 2019 International Conference on Asian Language Processing (IALP), pages 216-221. IEEE. +J Peter Kincaid, Robert P Fishburne Jr, Richard L Rogers, and Brad S Chissom. 1975. Derivation of new readability formulas (automated readability index, fog count and flesch reading ease formula) for navy enlisted personnel. Technical report, Naval Technical Training Command Millington TN Research Branch. +Dhruv Kumar, Lili Mou, Lukasz Golab, and Olga Vechtomova. 2020. Iterative edit-based unsupervised sentence simplification. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7918-7928, Online. Association for Computational Linguistics. +Matt Kusner, Yu Sun, Nicholas Kolkin, and Kilian Weinberger. 2015. From word embeddings to document distances. In International conference on machine learning, pages 957-966. PMLR. +Yinhan Liu, Jiatao Gu, Naman Goyal, Xian Li, Sergey Edunov, Marjan Ghazvininejad, Mike Lewis, and Luke Zettlemoyer. 2020. Multilingual denoising pre-training for neural machine translation. Transactions of the Association for Computational Linguistics, 8:726-742. +Jonathan Mallinson, Rico Sennrich, and Mirella Lapata. 2017. Paraphrasing revisited with neural machine translation. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 1, Long Papers, pages 881-893. +Louis Martin, Éric de la Clergerie, Benoit Sagot, and Antoine Bordes. 2020a. Controllable sentence simplification. In Proceedings of the 12th Language Resources and Evaluation Conference, pages 4689-4698, Marseille, France. European Language Resources Association. +Louis Martin, Angela Fan, Éric de la Clergerie, Antoine Bordes, and Benoit Sagot. 2020b. Multilingual unsupervised sentence simplification. arXiv preprint arXiv:2005.00352. + +Sneha Mehta, Bahareh Azarnoush, Boris Chen, Avneesh Saluja, Vinith Misra, Ballav Bihani, and Ritwik Kumar. 2020. Simplify-then-translate: Automatic preprocessing for black-box machine translation. +S. Narayan and C. Gardent. 2015. Unsupervised sentence simplification using deep semantics. pages 111-120. +Nathan Ng, Kyra Yee, Alexei Baevski, Myle Ott, Michael Auli, and Sergey Edunov. 2019. *Facebook fair's wmt19 news translation task submission*. arXiv preprint arXiv:1907.06616. +Sergiu Nisioi, Sanja Štajner, Simone Paolo Ponzetto, and Liviu P Dinu. 2017. Exploring neural text simplification models. In Proceedings of the 55th annual meeting of the association for computational linguistics (volume 2: Short papers), pages 85-91. +Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. 2019. *fairseq: A fast, extensible toolkit for sequence modeling.* In *Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics (Demonstrations)*, pages 48-53, Minneapolis, Minnesota. Association for Computational Linguistics. +Myle Ott, Sergey Edunov, David Grangier, and Michael Auli. 2018. Scaling neural machine translation. In Proceedings of the Third Conference on Machine Translation: Research Papers, pages 1-9, Brussels, Belgium. Association for Computational Linguistics. +Alessio Palmero Aprosio, Sara Tonelli, Marco Turchi, Matteo Negri, and A Di Gangi Mattia. 2019. Neural text simplification in low-resource conditions using weak supervision. In Workshop on Methods for Optimizing and Evaluating Neural Language Generation (NeuralGen), pages 37-44. Association for Computational Linguistics (ACL). +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 of the Association for Computational Linguistics, pages 311-318. +Matt Post. 2018. A call for clarity in reporting bleu scores. In Proceedings of the Third Conference on Machine Translation: Research Papers, pages 186-191. +Jipeng Qiang, Yun Li, Yi Zhu, Yunhao Yuan, and Xindong Wu. 2020a. Lexical simplification with pretrained encoders. Thirty-Fourth AAAI Conference on Artificial Intelligence, page 8649-8656. +Jipeng Qiang and Xindong Wu. 2021. Unsupervised statistical text simplification. IEEE Transactions on Knowledge and Data Engineering, 33(4):1802-1806. + +Jipeng Qiang, Qian Zhenyu, Yun Li, Yunhao Yuan, and Xindong Wu. 2020b. Short text topic modeling techniques, applications, and performance: A survey. IEEE Transactions on Knowledge and Data Engineering, page DOI:10.1109/TKDE.2020.2992485. +Luz Rello, Ricardo Baeza-Yates, Stefan Bott, and Horacio Saggion. 2013. Simplify or help? text simplification strategies for people with dyslexia. In Proceedings of the 10th International Cross-Disciplinary Conference on Web Accessibility, pages 1-10. +Horacio Saggion. 2017. Automatic text simplification. Synthesis Lectures on Human Language Technologies, 10(1):1-137. +Horacio Saggion, Sanja Štajner, Stefan Bott, Simon Mille, Luz Rello, and Biljana Drndarevic. 2015. Making it simplex: Implementation and evaluation of a text simplification system for spanish. ACM Transactions on Accessible Computing (TACCESS), 6(4):1-36. +Carolina Scarton and Lucia Specia. 2018. Learning simplifications for specific target audiences. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 712-718. +Rico Sennrich, Barry Haddow, and Alexandra Birch. 2015. Improving neural machine translation models with monolingual data. arXiv preprint arXiv:1511.06709. +Elior Sulem, Omri Abend, and Ari Rappoport. 2018. BLEU is not suitable for the evaluation of text simplification. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 738-744, Brussels, Belgium. Association for Computational Linguistics. +Sai Surya, Abhijit Mishra, Anirban Laha, Parag Jain, and Karthik Sankaranarayanan. 2019. Unsupervised neural text simplification. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 2058-2068, Florence, Italy. Association for Computational Linguistics. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. arXiv preprint arXiv:1706.03762. +Guillaume Wenzek, Marie-Anne Lachaux, Alexis Conneau, Vishrav Chaudhary, Francisco Guzmán, Armand Joulin, and Edouard Grave. 2019. Ccnet: Extracting high quality monolingual datasets from web crawl data. CoRR, abs/1911.00359. +John Wieting and Kevin Gimpel. 2017. *Paranmt-50m: Pushing the limits of paraphrastic sentence embeddings with millions of machine translations.* arXiv preprint arXiv:1711.05732. + +John Wieting, Jonathan Mallinson, and Kevin Gimpel. 2017. Learning paraphrastic sentence embeddings from back-translated bitext. arXiv preprint arXiv:1706.01847. +Kristian Woodsend and Mirella Lapata. 2011. Learning to simplify sentences with quasi-synchronous grammar and integer programming. In Proceedings of the 2011 Conference on Empirical Methods in Natural Language Processing, pages 409-420. +Sander Wubben, EJ Krahmer, and APJ van den Bosch. 2012a. Sentence simplification by monolingual machine translation. +Sander Wubben, Antal van den Bosch, and Emiel Krahmer. 2012b. Sentence simplification by monolingual machine translation. In Proceedings of the 50th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1015-1024, Jeju Island, Korea. Association for Computational Linguistics. +Wei Xu, Chris Callison-Burch, and Courtney Naples. 2015. Problems in current text simplification research: New data can help. Transactions of the Association for Computational Linguistics, 3:283-297. +Wei Xu, Courtney Napoles, Ellie Pavlick, Quanze Chen, and Chris Callison-Burch. 2016. Optimizing statistical machine translation for text simplification. Transactions of the Association for Computational Linguistics, 4:401-415. +Xingxing Zhang and Mirella Lapata. 2017. Sentence simplification with deep reinforcement learning. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 584-594, Copenhagen, Denmark. Association for Computational Linguistics. +Sanqiang Zhao, Rui Meng, Daqing He, Andi Saptono, and Bambang Parmanto. 2018. Integrating transformer and paraphrase rules for sentence simplification. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 3164-3173, Brussels, Belgium. Association for Computational Linguistics. +Zhemin Zhu, Delphine Bernhard, and Iryna Gurevych. 2010. A monolingual tree-based translation model for sentence simplification. In Proceedings of the 23rd International Conference on Computational Linguistics (Coling 2010), pages 1353-1361. \ No newline at end of file diff --git a/anunsupervisedmethodforbuildingsentencesimplificationcorporainmultiplelanguages/images.zip b/anunsupervisedmethodforbuildingsentencesimplificationcorporainmultiplelanguages/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..2d841cbb6bfd120809754ef5714636f939f49502 --- /dev/null +++ b/anunsupervisedmethodforbuildingsentencesimplificationcorporainmultiplelanguages/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b2d345d548f45ef801bda619f036cd10ebf8db0c21957e8286a0ed63ed3b69b +size 474031 diff --git a/anunsupervisedmethodforbuildingsentencesimplificationcorporainmultiplelanguages/layout.json b/anunsupervisedmethodforbuildingsentencesimplificationcorporainmultiplelanguages/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..99d32e9a66ebb6b4a325c8285b482536555f5567 --- /dev/null +++ b/anunsupervisedmethodforbuildingsentencesimplificationcorporainmultiplelanguages/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ce891474062f0d3692b8aace3e669ca27d59d0ce5ede715b5f65460277a5fdb +size 340214 diff --git a/apgnadversarialandparametergenerationnetworksformultisourcecrossdomaindependencyparsing/e0b55ce6-e52c-4a9e-a76f-e9ee75c189f1_content_list.json b/apgnadversarialandparametergenerationnetworksformultisourcecrossdomaindependencyparsing/e0b55ce6-e52c-4a9e-a76f-e9ee75c189f1_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..c9028ccb36bb2bc8a372c2c436799b268cc846e5 --- /dev/null +++ b/apgnadversarialandparametergenerationnetworksformultisourcecrossdomaindependencyparsing/e0b55ce6-e52c-4a9e-a76f-e9ee75c189f1_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc225a360547df3d3b322dd4b5a7e33faa2c4470292468eb706dcd54a08e29d7 +size 73163 diff --git a/apgnadversarialandparametergenerationnetworksformultisourcecrossdomaindependencyparsing/e0b55ce6-e52c-4a9e-a76f-e9ee75c189f1_model.json b/apgnadversarialandparametergenerationnetworksformultisourcecrossdomaindependencyparsing/e0b55ce6-e52c-4a9e-a76f-e9ee75c189f1_model.json new file mode 100644 index 0000000000000000000000000000000000000000..8cdc9b9cca08848cfa1b97d3faf8623375709ac9 --- /dev/null +++ b/apgnadversarialandparametergenerationnetworksformultisourcecrossdomaindependencyparsing/e0b55ce6-e52c-4a9e-a76f-e9ee75c189f1_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:065a0c6d65611a4ec7f0281137b4ac62336e934a826e98498caeb8513103e32f +size 88983 diff --git a/apgnadversarialandparametergenerationnetworksformultisourcecrossdomaindependencyparsing/e0b55ce6-e52c-4a9e-a76f-e9ee75c189f1_origin.pdf b/apgnadversarialandparametergenerationnetworksformultisourcecrossdomaindependencyparsing/e0b55ce6-e52c-4a9e-a76f-e9ee75c189f1_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4066611ae74891ebba987c205da6520ead27727e --- /dev/null +++ b/apgnadversarialandparametergenerationnetworksformultisourcecrossdomaindependencyparsing/e0b55ce6-e52c-4a9e-a76f-e9ee75c189f1_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f3d7004482d334fa42ae2688ace87cc9714719d22c6e02a483d2b33a8fd2c7d +size 528728 diff --git a/apgnadversarialandparametergenerationnetworksformultisourcecrossdomaindependencyparsing/full.md b/apgnadversarialandparametergenerationnetworksformultisourcecrossdomaindependencyparsing/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0f7d3d5c8f2776a5171d13ba386bf8b7f42f2412 --- /dev/null +++ b/apgnadversarialandparametergenerationnetworksformultisourcecrossdomaindependencyparsing/full.md @@ -0,0 +1,330 @@ +# APGN: Adversarial and Parameter Generation Networks for Multi-Source Cross-Domain Dependency Parsing + +Ying Li $^{1}$ , Meishan Zhang $^{2}$ , Zhenghua Li $^{1*}$ , Min Zhang $^{1}$ , Zhefeng Wang $^{3}$ , Baoxing Huai $^{3}$ , Nicholas Jing Yuan $^{3}$ + +1 School of Computer Science and Technology, Soochow University +$^{2}$ School of New Media and Communication, Tianjin University; $^{3}$ Huawei Cloud, China + +yingli_htt@foxmail.com; mason.zms@gmail.com + +{zhli13,minzhang}@suda.edu.cn + +{wangzhefeng, huaibaoxing, nicholas.yuan}@huawei.com + +# Abstract + +Thanks to the strong representation learning capability of deep learning, especially pretraining techniques with language model loss, dependency parsing has achieved great performance boost in the in-domain scenario with abundant labeled training data for target domains. However, the parsing community has to face the more realistic setting where the parsing performance drops drastically when labeled data only exists for several fixed outdomains. In this work, we propose a novel model for multi-source cross-domain dependency parsing. The model consists of two components, i.e., a parameter generation network for distinguishing domain-specific features, and an adversarial network for learning domain-invariant representations. Experiments on a recently released dataset for multidomain dependency parsing show that our model can consistently improve cross-domain parsing performance by about 2 points in averaged labeled attachment accuracy (LAS) over strong BERT-enhanced baselines. Detailed analysis is conducted to gain more insights on contributions of the two components. + +# 1 Introduction + +Dependency parsing aims to derive syntactic and semantic tree structures over input words (McDonald et al., 2013). Given an input sentence $\mathbf{s} = w_{1}w_{2}\dots w_{n}$ , a dependency tree, as depicted in Figure 1, is defined as $\mathbf{d} = \{(h,m,l),0\leq h\leq n,1\leq m\leq n,l\in \mathcal{L}\}$ , where $(h,m,l)$ is a dependency from the head word $w_{h}$ to the child word $w_{m}$ with the relation label $l\in \mathcal{L}$ . + +Recently, supervised neural dependency parsing models have achieved great success, leading to impressive performance (Chen and Manning, 2014; Kiperwasser and Goldberg, 2016; Dozat and Manning, 2017; Li et al., 2019a). Remarkably, the BiAffine parsing model can obtain a UAS of 96.67 + +![](images/642a2ff2306146c9a51d4adc617dcf8bab3073974d37484df0eac02ed574e267.jpg) +Figure 1: An example of dependency tree from product comments. + +and a LAS of 95.03 on standard Penn Treebank benchmark for the English language. + +In order to obtain competitive performance, supervised dependency parsing models rely on a sufficient amount of training data, which is inevitably dominated to several fixed domains. When the test data is sourced from similar domains, good performance could be achieved. However, the performance could be decreased significantly when the test data is from a different domain which has a large gap between the training domains. Thus domain adaptation for dependency parsing has been concerned by a number of studies (Koo et al., 2008; Yu et al., 2013; Sato et al., 2017; Clark et al., 2018; Li et al., 2020b). These works mostly focus on single-source cross-domain dependency parsing, assuming the training data is from a single source domain (Yu et al., 2013; Sato et al., 2017). In fact, multi-source cross-domain dependency parsing is a more practical setting, considering that several dependency parsing corpora from different domains have been developed (Peng et al., 2019). Intuitively, an effective exploration of all these corpora can give better performance for the target domain compared with the single-source domain adaptation. + +Separating domain-invariant and domainspecific features is one popular way for domain adaptation to distinguish the similarity and discrepancy of different domains (Daume III, 2007; Kim et al., 2016; Sato et al., 2017). Domain-invariant features indicate the shared feature space across domains, which have been widely-adopted as + +knowledge transferring. Domain-specific features imply the differences between domains, which could be helpful if the domain gaps could be accurately measured and effectively modeled. The learning of domain invariant and specific features are actually complementary because of mutual exclusivity, especially for single-source domain adaptation. Although single-source and multi-source settings are easily separated domain-invariant and domain-specific features via independent BiLSTMs, the in-depth relevance of domain-specific representations becomes more complicated with the increasing of source domains. Hence, how to construct the relationship between different domain-specific features after a simple feature separation becomes more challenge for multi-source dependency parsing. + +In this work, we for the first time apply adversarial and parameter generation networks (APGN) to multi-source cross-domain dependency parsing for extracting domain-invariant and domain-specific features. Experiments on a benchmark dataset show that our proposed model can boost the parsing performance significantly, leading to averaged LAS improvements by 2 points over strong BERT-enhanced baselines. First, explorations on different unlabeled data sizes reveal that unlabeled data is an useful resource and proper utilization of unlabeled data further improves our model performance by a large margin. Then, we conduct in-depth analysis to gain crucial insights on the effect of adversarial and parameter generation networks, finding the two components are complementary and both have the capability of modeling short- or long-range dependencies. Finally, detailed comparative experiments on alternative domain representation strategies show that our designed distributed domain representation can accurately measure domain gaps and extract more reliable domain knowledge that benefits the dependency parsing task. We will release our code at https://github.com/suda-yingli/EMNLP2021-apgn for facilitating future researches. + +# 2 Baseline Model + +In this work, we adopt the state-of-the-art deep BiAffine parser (Dozat and Manning, 2017) as our baseline model. Figure 2 shows the framework of the parser, which mainly contains four components, i.e., Input layer, Encoder layer, MLP layer, and BiAffine layer. + +![](images/b0be55c3f82d530e87c43f54f113074de5f4a1286c69d1da4548e521e5dc0fe1.jpg) +Figure 2: Framework of the BiAffine parser. + +Input layer. The input layer maps each word $w_{i}$ into a dense vector representation $\mathbf{x}_i$ . First, we apply a BiLSTM to encode the constituent characters of each word $w_{i}$ into its character representation $\mathbf{rep}_i^{\mathrm{char}}$ . Then, we concatenate $\mathbf{rep}_i^{\mathrm{char}}$ with $\mathbf{emb}_i^{\mathrm{word}}$ as the input vector $\mathbf{x}_i$ . + +$$ +\mathbf {x} _ {i} = \mathbf {e m b} _ {i} ^ {\text {w o r d}} \oplus \mathbf {r e p} _ {i} ^ {\text {c h a r}} \tag {1} +$$ + +where $\mathbf{emb}_i^{\mathrm{word}}$ is the pre-trained word embedding, and $\oplus$ indicates vectorial concatenation. In addition, we also use BERT representation to enhance our model, denoted as $\mathbf{rep}_i^{\mathrm{BERT}}$ , where $\mathbf{emb}_i^{\mathrm{word}}$ is substituted by $\mathbf{rep}_i^{\mathrm{BERT}}$ simply. + +Encoder layer. Following Dozat and Manning (2017), we employ a three-layer BiLSTM to sequentially encode the inputs $\mathbf{x}_0\ldots \mathbf{x}_n$ and generate context-aware word representations $\mathbf{h}_0\ldots \mathbf{h}_n$ . We omit the detailed computation of the BiLSTM due to space limitation. + +MLP layer. The MLP layer uses two independent MLPs to get lower-dimensional vectors of each position $0 \leq i \leq n$ . + +$$ +\mathbf {r} _ {i} ^ {\mathrm {H}} = \operatorname {M L P} ^ {\mathrm {H}} \left(\mathbf {h} _ {i}\right) +$$ + +$$ +\mathbf {r} _ {i} ^ {\mathrm {D}} = \operatorname {M L P} ^ {\mathrm {D}} \left(\mathbf {h} _ {i}\right) \tag {2} +$$ + +where $\mathbf{r}_i^{\mathrm{H}}$ is the representation vector of $w_{i}$ as a head word, and $\mathbf{r}_i^{\mathrm{D}}$ as a dependent. + +BiAffine layer. The score of a dependency $i \gets j$ is computed by a BiAffine attention as follows, + +$$ +\operatorname {s c o r e} (i \leftarrow j) = \left[ \begin{array}{c} \mathbf {r} _ {i} ^ {\mathrm {D}} \\ 1 \end{array} \right] ^ {\mathrm {T}} \mathbf {W} ^ {b} \mathbf {r} _ {j} ^ {\mathrm {H}} \tag {3} +$$ + +where the weight matrix $\mathbf{W}^b$ determines the strength of a link from $w_{j}$ to $w_{i}$ . + +Parsing loss. The parsing loss for each position $i$ is computed as: + +$$ +\begin{array}{l} \mathcal {L} ^ {\text {p a r}} (i \xleftarrow {l} j) = - \log \frac {e ^ {\text {s c o r e} (i \leftarrow j)}}{\sum_ {0 \leq k \leq n , k \neq i} e ^ {\text {s c o r e} (i \leftarrow k)}} \tag {4} \\ - \log \frac {e ^ {s c o r e (i \leftarrow j)}}{\sum_ {l ^ {\prime} \in \mathcal {L}} e ^ {s c o r e (i \leftarrow j)}} \\ \end{array} +$$ + +where $w_{j}$ is the gold-standard head of $w_{i}$ , and $l$ is the corresponding gold relation label. + +# 3 Proposed APGN Approach + +The goal of multi-source cross-domain dependency parsing is to train a parser that generates well to the target domain with labeled training data from multiple source domains and unlabeled data from the target domain. The most straightforward approach is training a parser with the concatenation of all source-domain training data. This can extract common features across different domains but fail to capture domain-specific knowledge. To address this issue, we propose an APGN approach for modeling the discrepancy and commonality between different domains simultaneously. As shown in Figure 3, our APGN model mainly contains two components, i.e., a PGN for distinguishing domain-specific features, and an adversarial network for learning domain-invariant representations. + +In this section, we first give a detailed illustration of the parameter generation network which takes distributed domain embedding as input to alleviate potential domain conflicts caused by the fixed one. Then, we introduce the adversarial network which encourages the BiLSTM to extract more pure shared information by fooling the domain classifier. Finally, we propose a new strategy for our model training to make full use of all labeled and unlabeled data. + +# 3.1 PGN + +Jia et al. (2019) first propose PGN to generate BiLSTM parameters based on fixed task and domain embeddings for NER domain adaptation, finding that the PGN can effectively extract domain differences. However, the vanilla PGN requires cross-domain language model task as a bridge to help fixed domain embeddings training. Considering the development of pre-training techniques with language model loss and computational complexity, we first remove the language model from the + +PGN component and use pre-trained BERT to enhance model performance in the final experiments. Intuitively, each input word has its unique domain distributions, initializing these words with the same fixed domain embedding may lead to potential domain conflicts. We then improve the PGN via replacing the fixed domain embedding with distributed one to more accurately integrate multidomain information. As shown in the right part of Figure 3, our PGN takes distributed representations as inputs and dynamically generates the domain-related PGN-BiLSTM parameters. + +PGN-BiLSTM encoder. To better capture domain-specific features, we exploit the PGNBiLSTM instead of a standard BiLSTM encoder. For convenience, we directly formalize the vanilla BiLSTM encoder as follows: + +$$ +\mathbf {h} _ {0} \dots \mathbf {h} _ {n} = \operatorname {B i L S T M} \left(\mathbf {x} _ {0} \dots \mathbf {x} _ {n}, \mathbf {V}\right) \tag {5} +$$ + +where $\mathbf{V} \in \mathcal{R}^{\mathrm{U}}$ can be regarded as a flattened vector which contains all the BiLSTM parameters. Different from a vanilla BiLSTM which use statically allocated parameters and update them during training, PGN-BiLSTM dynamically generates BiLSTM parameters in order to reflect domain differences as follows. + +$$ +\begin{array}{l} \mathbf {h} _ {0} ^ {\text {s p e}} \dots \mathbf {h} _ {n} ^ {\text {s p e}} = \operatorname {P G N - B i L S T M} \left(\mathbf {x} _ {0} \dots \mathbf {x} _ {n}, \mathbf {E}\right) \\ = \operatorname {B i L S T M} \left(\mathbf {x} _ {0} \dots \mathbf {x} _ {n}, \mathbf {V} = \mathbf {W} \otimes \mathbf {E}\right) \tag {6} \\ \end{array} +$$ + +where $\otimes$ denotes matrix multiplication; $\mathbf{W} \in \mathcal{R}^{\mathrm{U} \times \mathrm{D}}$ is a parameter matrix to be trained; $\mathbf{E} \in \mathcal{R}^{\mathrm{D}}$ is distributed domain-aware sentence representation vector and will be explained later. + +Distributed domain-aware sentence representation. The distributed domain-aware sentence representation vector can be regarded as a sum of weighted domain embeddings, where higher weights are expected to be assigned to domains that are more similar to the input sentence. + +First, we compute domain distribution probabilities of each word via simple domain classification. + +$$ +\mathbf {z} _ {i} = \operatorname {s o f t m a x} \left(\operatorname {M L P} \left(\mathbf {h} _ {i} ^ {\text {d o m}}\right)\right) \tag {7} +$$ + +where $\mathbf{h}_i^{\mathrm{dom}}$ is the representation vector of the $i$ -th word generated by a separated standard BiLSTM. + +Then, we compute a distributed domain-aware word representation vector for each word via aggregating domain embeddings according to the do + +![](images/d14c941d854dc9a4628d9772d83243b07de386474b21ab2863f50118b5ecd8ab.jpg) +Figure 3: Framework of our proposed APGN model. + +main distribution of the word. + +$$ +\mathbf {r e p} _ {i} ^ {\mathrm {d o m}} = \sum_ {j = 1} ^ {m + 1} \mathbf {z} _ {i, j} \mathbf {e m b} _ {j} ^ {\mathrm {d o m}} \tag {8} +$$ + +where $\mathbf{emb}_j^{\mathrm{dom}}$ is the embedding vector of the $j$ -th domain; $\mathbf{z}_{i,j}$ is the probability of the $i$ -th word belonging to the $j$ -th domain. + +Finally, we utilize an average pooling to yield distributed domain-aware sentence representation vector, i.e., $\mathbf{E}$ , which is used to generate BiLSTM parameters. + +$$ +\mathbf {E} = \frac {1}{n} \sum_ {i = 1} ^ {n} \mathbf {r e p} _ {i} ^ {\mathrm {d o m}} \tag {9} +$$ + +Domain classification loss. The domain classification module, as shown in the right part of Figure 3, is trained via minimizing a standard cross-entropy loss. + +$$ +\mathcal {L} ^ {\mathrm {d o m}} = - \frac {1}{n} \sum_ {i = 1} ^ {n} \sum_ {j = 1} ^ {m + 1} \left(\hat {\mathbf {z}} _ {i, j}\right) \log \left(\left(\mathbf {z} _ {i, j}\right)\right) \tag {10} +$$ + +where $m$ is the number of source domains (plus a target domain); $n$ is the word number of the input sentence; $\hat{\mathbf{z}}_i$ is the gold-standard domain distribution vector, where only one element is 1 corresponding to the domain index where the sentence comes from. + +# 3.2 The Adversarial Network + +The goal of adversarial learning is to encourage the shared BiLSTM to extract domain-invariant features that are not specific to a particular domain as much as possible (Ganin et al., 2017). During training, we expect the BiLSTM to make it difficult + +for the domain classifier to correctly distinguish domain categories. The architecture of adversarial network is shown in the left part of Figure 3. First, input words from different domains are encoded by the same standard BiLSTM. Before feeding the BiLSTM output $\mathbf{h}_i^{\mathrm{inv}}$ to the domain classifier, $\mathbf{h}_i^{\mathrm{inv}}$ goes through the gradient reversal layer (GRL). Following Ganin and Lempitsky (2015), the forward and backward propagations for the GRL are defined as follows: + +$$ +G _ {\lambda} (\mathbf {h} _ {i} ^ {\mathrm {i n v}}) = \mathbf {h} _ {i} ^ {\mathrm {i n v}} +$$ + +$$ +\frac {\mathrm {d} G _ {\lambda} \left(\mathbf {h} _ {i} ^ {\text {i n v}}\right)}{\mathrm {d} \left(\mathbf {h} _ {i} ^ {\text {i n v}}\right)} = - \lambda I \tag {11} +$$ + +where $\lambda$ is a hyper-parameter. Over the GRL, the domain classifier is applied to identify the domain of input word. Finally, the adversarial network is trained via minimizing the cross-entropy loss $\mathcal{L}^{\mathrm{adv}}$ . + +# 3.3 Joint Training + +In this work, we design a joint training strategy to make full use of all available training datasets, shown as Algorithm 1. In the first $k$ iterations, mini-batches of source-domain and target-domain take turns to train. If the mini-batch comes from the source-domain labeled data, we jointly train the model with the parsing, adversarial, and domain classification losses. Otherwise, the model is trained with the adversarial and domain classification losses. In the first stage, all data is used to select domain-invariant and domain-specific features via the adversarial and parameter generation networks. In the second stage, only source domain labeled data is available and the model is updated with the parsing loss until convergence after $k$ iterations, which is helpful to deal with the overfitting problem of domain classifications. + +Algorithm 1 Joint Training Procedure +Input: source-domain labeled data $S = \{S_i\}_{i=1}^m$ , target-domain unlabeled data T. +Hyper-parameters: loss weights $\alpha$ and $\beta$ , joint training iteration $k$ . +Output: Target model. +1: Repeat +2: if iter < k do +3: Take turns to sample a mini-batch $x$ from S and T +4: if $x \in S$ do +5: Accumulate loss $\mathcal{L} = \mathcal{L}^{\mathrm{par}} + \alpha \mathcal{L}^{\mathrm{adv}} + \beta \mathcal{L}^{\mathrm{dom}}$ +6: else +7: Accumulate loss $\mathcal{L} = \alpha \mathcal{L}^{\mathrm{adv}} + \beta \mathcal{L}^{\mathrm{dom}}$ +8: else +9: Sample a mini-batch $x \in S$ +10: Accumulate loss $\mathcal{L} = \mathcal{L}^{\mathrm{par}}$ +11: Updating parameters via minimizing $\mathcal{L}$ . +12: iter+ = 1 +13: until convergence + +
BCPCPBZX
train16,3396,8855,1291,645
dev9971,3001,300500
test1,9922,6002,6001,100
unlabeled-349,922291,48133,792
+ +Table 1: Data statistics in sentence number + +# 4 Experiments + +# 4.1 Settings + +Data. We use the Chinese multi-domain dependency parsing datasets released at the NLPCC-2019 shared task1, containing four domains: one source domain which is a balanced corpus (BC) from news-wire, three target domains which are the product comments (PC) data from Taobao, the product blog (PB) data from Taobao headline, and a web fiction data named "ZhuXian" (ZX). Table 1 shows the detailed illustration of the data statistics. In this work, we pick one target dataset as the target domain, and the rest are the source domains. For example, if the target domain is PC, source domains are BC, PB, and ZX. + +Evaluation. We use unlabeled attachment score (UAS) and labeled attachment score (LAS) to evaluate the dependency parsing accuracy (Hajic et al., 2009). Each model is trained for at most 1,000 iterations, and the performance is evaluated on the dev data after each iteration for model selection. We stop the training if the peak performance does not increase in 100 consecutive iterations. + +Baseline models. To verify the effectiveness and advantage of our proposed model, we select the following approaches as our strong baselines. + +- Concatenation (CON). We directly train BiAffine parser (Dozat and Manning, 2017) with all source-domain labeled data. The main drawback is that the parser shares all parameters across different domains and ignores domain differences, thus making it difficult to build the relationship between different domains. +- **Domain embedding (DE).** The vanilla DE method has been proven more effective than CON on semi-supervised dependency parsing (Li et al., 2019b). The key idea is to train BiAffine parser with an extra fixed domain embedding to indicate which domain the input sentence comes from. However, when the DE is directly applied to our task, fixed embeddings are trained inadequately due to the lack of target-domain labeled data. +- Adversarial domain embedding (ADE). Li et al. (2020b) propose to apply adversarial network on DE method, which separates domain-specific and domain-invariant features via domain-aware embeddings and adversarial learning. The ADE model can be regarded as the APGN removing the PGN component. +- Parameter generation network (PGN). Motivated by Jia et al. (2019), we exploit the PGN based on distributed domain representations to generate domain-related BiLSTM parameters as our strong baseline. The PGN can be regarded as our APGN model removing the adversarial network. + +# 4.2 Hyper-parameter Choices + +We mostly follow the hyper-parameter settings of Dozat and Manning (2017), such as learning rate, dropout ratios, and so on. The loss weights both $\alpha$ and $\beta$ are set as 0.01. The domain embedding size is set as 8. The Chinese character embeddings are randomly initialized, and the dimension is 100. For pre-trained word embeddings, we train word2vec (Mikolov et al., 2013) embeddings on Chinese Gigaword Third Edition, consisting of about 1.2 million sentences. For BERT, we use the released Chinese BERT-Based model to obtain BERT representations for each word. Following Li et al. (2019a), we utilize the averaged sum of the top-4 layer outputs as the final BERT representation $\mathbf{rep}_i^{\mathrm{BERT}}$ . + +
Iter kPCPBZXAvg.
UASLASUASLASUASLASUASLAS
1049.6237.8973.9668.2674.1966.9065.9257.68
2052.2240.5874.6068.9075.1968.2667.3459.25
3050.5738.4673.9968.2474.5167.5066.3658.07
4049.7737.6174.2568.0974.6767.2166.2357.64
5050.1038.0974.0167.9774.3967.2066.1757.75
+ +Table 2: Results on the dev data regarding the joint training iteration $k$ . + +
PCPBZXAvg.
UASLASUASLASUASLASUASLAS
Comparison with Baseline Models
CON47.3035.6372.8167.2471.0062.9163.7055.26
DE47.4935.5672.6167.0870.9862.6863.6955.11
ADE48.6136.9072.8067.2571.4663.5964.2955.91
PGN49.5336.8772.7166.9370.6563.1664.3055.66
APGN51.4839.1273.8668.1072.4364.8065.9257.34
Comparison with BERT-Enhanced Baseline Models
CON60.6249.5281.5977.0780.6074.5374.2767.04
DE60.4549.4982.0877.1579.8573.6574.1366.76
ADE60.7650.2282.5478.0481.4375.7074.9167.99
PGN62.8750.9482.5077.9381.5976.2475.6568.37
APGN63.1752.1182.9278.2182.7177.0376.2769.12
+ +Table 3: Final results on test data. + +Preliminary experiments show that our model is insensitive to most of the above parameters, while the setting of joint training iteration has a larger impact on the performance as shown in the following results. + +Joint training iteration $k$ . Table 2 shows the results with different joint training iteration $k$ on the dev data. Increasing the iterations from 10 to 20 consistently improves the performance on all domains. The performance drops significantly when using iteration $k$ above 20. These results indicate that more joint training iterations not only increase the complexity of the model, but also make the model prone to overfit the training data. + +# 4.3 Final Results + +Table 3 shows the final results and makes a comparison with multiple baselines on test data. First, we can see that our proposed APGN model achieves the best results on all domains, demonstrating that the APGN is extremely useful for multi-source cross-domain dependency parsing. Second, compared the results of ADE and PGN, we find that both adversarial and parameter generation networks have the capability of capturing useful information to improve the parsing accuracy. Finally, although the performance of different models is obviously improved by utilizing BERT representations, our model still achieves consistently higher accuracy than other baselines, further demonstrating the effectiveness of our proposed method. + +![](images/c622f8dc21d6460f03bace61b66b59bf45f006b27755d39a66b7a319161be5c3.jpg) +Figure 4: Influence of utilizing different amount of unlabeled data on APGN model. The x-axis is the ratio of target-domain unlabeled data size to source-domain labeled data. + +# 4.4 Utilization of Unlabeled Data + +Considering the lack of target-domain labeled data, we directly use unlabeled data for the model training. For unlabeled sentences, the model discards the parsing loss and updates the parameters with only adversarial and domain classifier losses. Figure 4 illustrates the influence of target-domain unlabeled data sizes on dev data. In each curve, we fix the size of labeled data and incrementally add a random subset of unlabeled data. Considering a large-scale unlabeled data may lead to the sample unbalance problem, we randomly sample unlabeled data with the ratios less than 1. On the one hand, we can see that using unlabeled data leads to consistently higher performance for all three domains, indicating that the unlabeled data is an important resource that contributes the target-domain dependency parsing. On the other hand, we find that the improvement of parsing accuracy is obviously steady when the ratio is set as 0.75, showing that the APGN model can achieve best performances with a suitable amount of unlabeled data. + +# 4.5 Analysis + +Ablation study. The results of ablation study on dev data are shown in Table 4. We can see that removing any component from the APGN causes obvious performance degradation. First, compared with the accuracy of "w/o two", "w/o PGN" can further improve parsing performance, showing the usefulness and importance of domain-invariant features generated by adversarial network. Second, it is clear that "w/o Adv" achieves better performance than "w/o PGN", indicating that the parameter generation network is crucial. The reason may be that + +
PCPBZXAvg.
UASLASUASLASUASLASUASLAS
APGN52.2240.5874.6068.9075.1968.2667.3459.25
w/o Adv51.1638.7273.9667.8874.0067.1766.3757.92
w/o PGN49.3437.5073.2367.5473.8766.7365.4857.26
w/o Two48.9737.3273.3667.6173.3065.5365.2156.82
+ +Table 4: Ablation study on reducing the component of the APGN model on dev data. "w/o Adv" and "w/o PGN" mean removing adversarial network or parameter generation network. + +the parameter generation network enable correctly construct domain relations and extract practical domain-specific features, which is significant for dependency parsing. Finally and most importantly, we find that our proposed APGN model achieves consistently higher accuracy than "w/o PGN" and "w/o Adv", demonstrating that the two components are complementary. + +Error analysis. Since ablation study only gives an overall performance trend, we conduct in-depth error analysis in order to gain more insights on the contributions of adversarial and parameter generation networks. We divide the gold-standard dependencies into seven subsets according to the absolute distance between the head word and the modifier word, and calculate the accuracy for each subset. The group whose dependency distance is 0 means the words which take the pseudo node "root" as their head words. Figure 5 compares the accuracy curves of ADE ("w/o PGN"), PGN ("w/o Adv"), and APGN models with regard to the dependency distance on the test data. First, we can see that the parsing accuracy becomes better on all models when the dependency distance is smaller. The reason may be that the contextualized information decays when the distance between two words is too far. Second, there seems slight difference between ADE and PGN performances on the same dependency distance, indicating that adversarial and parameter generation networks, as two typical feature extraction methods, both have the competitive capability of capturing short- and long-range dependencies. Finally, we find that the APGN model achieves better performances than ADE and PGN models, demonstrating that adversarial and parameter generation networks are complementary and can certainly benefit from each other. + +# 4.6 Comparisons on Alternative Domain Representation Strategies + +Most previous works use a fixed domain embedding to indicate the domain of each input word (Jia + +![](images/aba416822bf6f72b210ebd0a02313c102c29301d3cf856dca7e19c396fcec97a.jpg) +Figure 5: Accuracy curves regarding dependency distances. + +![](images/160042dbb935b6e5610240887d5e895ee9dbb04d67a9782e64ccad2fa9527131.jpg) +Figure 6: Domain distributional probabilities of different words. + +et al., 2019; Li et al., 2019b). However, the fixed representation may lead to potential domain conflicts when a word belongs to multiple domains. As shown in Figure 6, we can see that each word has its unique domain distribution and it is difficult to define all word with an explicit fixed representation. Hence, it is necessary to design a more accurate representation, named as distributed domain embedding, which can be regarded as weighted sum of the fixed domain embeddings and its distributional probabilities. + +Detailed comparative experiments are conducted to verify the effectiveness of two domain representation strategies on various models, and results are shown in Table 5. First, we find that the APGN with fixed domain representations like Jia et al. (2019) achieves lower performance than other models. The main reason may be that without cross-domain language model as a bridge, it is difficult for the + +
PCPBZXAvg.
UASLASUASLASUASLASUASLAS
Models with the fixed domain representations
DE48.2336.4073.2567.3973.2766.4964.9256.76
ADE49.1636.6873.4967.8973.9167.0165.5257.19
APGN44.2030.8971.2865.3571.5063.8562.3353.36
Models with the distributed domain representations
DE50.3738.1373.9667.8873.7166.6166.0157.54
ADE50.6338.5073.9068.0873.7267.7966.0858.12
APGN52.2240.5874.6068.9075.1968.2667.3459.25
+ +Table 5: Results of different models with fixed or distributed domain representations. + +PGN to model the relationships of different domains. Second, the APGN with distributed domain representations achieves best performance among all models, revealing that the PGN with distributed domain embeddings can accurately measure the domain similarity and significantly improve our model performance. Finally, we can see that all models with distributed domain representation outperform them with the fixed one by a large margin, demonstrating that distributed domain representation is helpful to reduce potential domain conflicts and extracts more reliable domain knowledge that benefits the parsing task. + +# 5 Related Work + +Domain adaptation has been extensively studied in many research areas, including machine learning (Wang et al., 2017; Kim et al., 2017), computer vision (Ganin and Lempitsky, 2015; Rozantsev et al., 2019) and natural language processing (Kim et al., 2016; Sun et al., 2020). Here, we first simply review single-source domain adaptation researches, and then give more detailed illustration about the studies of multi-source domain adaptation. + +Single-source domain adaptation. Single-source domain adaptation assumes training data comes from a source domain. Due to lacking target-domain labeled data, previous researches mainly investigate unsupervised domain adaptation, which attempt to create pseudo training samples by self-training (Charniak, 1997; Steedman et al., 2003; Reichart and Rappoport, 2007; Yu et al., 2015), co-training (Sarkar, 2001), or tri-training (Li et al., 2019c). However, selecting high confidence samples is a challenge. + +Thanks to large-scale labeled web data released by parsing communities, recent existing works pay more attention to semi-supervised scenario. Yu et al. (2013) give detailed error analysis on cross-domain dependency parsing and solve the ambiguous features problem. Sato et al. (2017) propose to + +separate domain-specific and domain-invariant features via applying adversarial learning on shared-private model, but find that there is little gains and even damage the performance, specially when the scale of target-domain training data is small. Most recently, Li et al. (2019b) propose to leverage an extra domain embedding to indicate domain source and achieve better performance on semi-supervised domain adaptation. In this work, we adjust the domain embedding method as our strong baseline. + +Multi-source domain adaptation. Multi-source domain adaptation assumes the training data comes from multiple source domains. Many approaches of multi-source domain adaptation focus on leveraging domain knowledge to extract domain-related features, thus boosting the performance of target domain (Daumé III, 2007; Guo et al., 2018; Li et al., 2020a; Wright and Augenstein, 2020). Zeng et al. (2018) design a domain classifier and an adversarial network to capture domain-specific and domain-invariant features, achieving good performances on machine translation. Guo et al. (2018) apply meta-training and adversarial learning to compute the point-to-set distance as the weights of multi-task learning network, leading to improvement on classification tasks. + +As another interesting direction, Platanios et al. (2018) propose a parameter generation network to generate the parameters of the encoder and decoder by accepting the source and target language embeddings as input. Recently, a number of works attempt to use the parameter generation network to improve the cross-domain or cross-language performance (Cai et al., 2019; Stoica et al., 2020; Jin et al., 2020; Nekvinda and Dusek, 2020). Particularly, Jia et al. (2019) propose to generate BiLSTM parameters based on task and domain representation vectors, leading to very promising performances on cross-domain NER task. + +Due to the limitation of annotation corpus and the essential difficulty of multi-source domain adaptation, there still lacks such studies on dependency parsing. Inspired by these prior works, we propose a novel approach to separate domain-invariant and domain-specific features by the utilization of adversarial and parameter generation networks. + +# 6 Conclusion + +This work for the first time apply the APGN approach to multi-source cross-domain dependency parsing, obtaining better performance than multiple + +bases, even when all models are enhanced with BERT representations. The ablation study reveals that both adversarial and parameter generation networks are equally important and complementary in capturing domain-related features, which motivates us to make a deep analysis to gain crucial insights on the effectiveness of the two components. Based on the in-depth error analysis, we find that in spite of local divergences, domain-invariant and domain-specific features generated by adversarial and parameter generation networks actually both have the power of modeling short- or long-range dependencies and can certainly benefit from each other. Furthermore, detailed comparative experiments demonstrate that the distributed domain representation is extremely useful to reduce domain conflicts and accurately measure the domain similarity, thus extracting more reliable domain-specific features to boost the parsing performance. + +# 6.1 Acknowledgments + +We thank our anonymous reviewers for their helpful comments. This work was supported by National Natural Science Foundation of China (Grant No. 61876116 and 62176173), and a Project Funded by the Priority Academic Program Development (PAPD) of Jiangsu Higher Education Institutions. + +# References + +Hengyi Cai, Hongshen Chen, Cheng Zhang, Yonghao Song, Xiaofang Zhao, and Dawei Yin. 2019. Adaptive parameterization for neural dialogue generation. In Proceedings of EMNLP-IJCNLP, pages 1793-1802. +Eugene Charniak. 1997. Statistical parsing with a context-free grammar and word statistics. In Proceedings of AAAI, pages 598-603. +Danqi Chen and Christopher D. Manning. 2014. A fast and accurate dependency parser using neural networks. In Proceedings of EMNLP, pages 740-750. +Kevin Clark, Minh-Thang Luong, Christopher D. Manning, and Quoc V. Le. 2018. Semi-supervised sequence modeling with cross-view training. In Proceedings of EMNLP, pages 1914-1925. +Hal Daumé III. 2007. Frustratingly easy domain adaptation. In Proceedings of ACL, pages 256-263. +Timothy Dozat and Christopher Manning. 2017. Deep bioaffine attention for neural dependency parsing. abs/1611.01734. + +Yaroslav Ganin and Victor S. Lempitsky. 2015. Unsupervised domain adaptation by backpropagation. In Proceedings of ICML, pages 1180-1189. +Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, and Victor S. Lempitsky. 2017. Domain-adversarial training of neural networks. In *Domain Adaptation in Computer Vision Applications*, Advances in Computer Vision and Pattern Recognition, pages 189-209. +Jiang Guo, Darsh J. Shah, and Regina Barzilay. 2018. Multi-source domain adaptation with mixture of experts. In Proceedings of EMNLP, pages 4694-4703. +Jan Hajic, Massimiliano Ciaramita, Richard Johansson, Daisuke Kawahara, Maria Antônia Martí, Lluis Márquez, Adam Meyers, Joakim Nivre, Sebastian Padó, Jan Stepanek, Pavel Stranák, Mihai Surdeanu, Nianwen Xue, and Yi Zhang. 2009. The conll-2009 shared task: Syntactic and semantic dependencies in multiple languages. In Proceedings of the Thirteenth Conference on Computational Natural Language Learning: Shared Task, CoNLL 2009, pages 1-18. +Chen Jia, Xiaobo Liang, and Yue Zhang. 2019. Cross-domain NER using cross-domain language modeling. In Proceedings of ACL, pages 2464-2474. +Tian Jin, Zhun Liu, Shengjia Yan, Alexandre E. Eichenberger, and Louis-Philippe Morency. 2020. Language to network: Conditional parameter adaptation with natural language descriptions. In Proceedings of ACL, pages 6994-7007. +Young-Bum Kim, Karl Stratos, and Dongchan Kim. 2017. Domain attention with an ensemble of experts. In Proceedings of ACL, pages 643-653. +Young-Bum Kim, Karl Stratos, and Ruhi Sarikaya. 2016. Frustratingly easy neural domain adaptation. In Proceedings of COLING, pages 387-396. +Eliyahu Kiperwasser and Yoav Goldberg. 2016. Simple and accurate dependency parsing using bidirectional LSTM feature representations. TACL, 4:313-327. +Terry Koo, Xavier Carreras, and Michael Collins. 2008. Simple semi-supervised dependency parsing. In Proceedings of ACL, pages 595-603. +Rumeng Li, Xun Wang, and Hong Yu. 2020a. Metamt, a meta learning method leveraging multiple domain data for low resource machine translation. In Proceedings of AAAI, pages 8245-8252. +Ying Li, Zhenghua Li, and Min Zhang. 2020b. Semi-supervised domain adaptation for dependency parsing via improved contextualized word representations. In Proceedings of COLING, pages 3806-3817. + +Ying Li, Zhenghua Li, Min Zhang, Rui Wang, Sheng Li, and Luo Si. 2019a. Self-attentive biaffine dependency parsing. In Proceedings of IJCAI, pages 5067-5073. +Zhenghua Li, Xue Peng, Min Zhang, Rui Wang, and Luo Si. 2019b. Semi-supervised domain adaptation for dependency parsing. In Proceedings of ACL, pages 2386-2395. +Zuchao Li, Junru Zhou, Hai Zhao, and Rui Wang. 2019c. Cross-domain transfer learning for dependency parsing. In Proceedings of NLPCC, pages 835-844. +Ryan T. McDonald, Joakim Nivre, Yvonne Quirmbach-Brundage, Yoav Goldberg, Dipanjan Das, Kuzman Ganchev, Keith B. Hall, Slav Petrov, Hao Zhang, Oscar Täckström, Claudia Bedini, Núria Bertomeu Castelló, and Jungmee Lee. 2013. Universal dependency annotation for multilingual parsing. In Proceedings of ACL, pages 92-97. +Tomas Mikolov, Ilya Sutskever, Kai Chen, Gregory S. Corrado, and Jeffrey Dean. 2013. Distributed representations of words and phrases and their compositionality. In Proceedings of NIPS, pages 3111-3119. +Tomas Nekvinda and Ondrej Dusek. 2020. One model, many languages: Meta-learning for multilingual text-to-speech. In Proceedings of the Annual Conference of the International Speech Communication Association, pages 2972-2976. +Xue Peng, Zhenghua Li, Min Zhang, Rui Wang, Yue Zhang, and Luo Si. 2019. Overview of the NLPCC 2019 shared task: Cross-domain dependency parsing. In Proceedings of NLPCC, pages 760-771. +Emmanouil Antonios Platanios, Mrinmaya Sachan, Graham Neubig, and Tom M. Mitchell. 2018. Contextual parameter generation for universal neural machine translation. In Proceedings of EMNLP, pages 425-435. +Roi Reichart and Ari Rappoport. 2007. Self-training for enhancement and domain adaptation of statistical parsers trained on small datasets. In Proceedings of ACL. +Artem Rozantsev, Mathieu Salzmann, and Pascal Fua. 2019. Beyond sharing weights for deep domain adaptation. IEEE Trans. Pattern Anal. Mach. Intell., 41(4):801-814. +Anoop Sarkar. 2001. Applying co-training methods to statistical parsing. In Proceedings of NAACL. +Motoki Sato, Hitoshi Manabe, Hiroshi Noji, and Yuji Matsumoto. 2017. Adversarial training for cross-domain universal dependency parsing. In Proceedings of the CoNLL 2017 Shared Task, pages 71-79. +Mark Steedman, Anoop Sarkar, Miles Osborne, Rebecca Hwa, Stephen Clark, Julia Hockenmaier, Paul Ruhlen, Steven Baker, and Jeremiah Crim. 2003. + +Bootstrapping statistical parsers from small datasets. In Proceedings of EACL, pages 331-338. +George Stoica, Otilia Stretcu, Emmanouil Antonios Platanios, Tom M. Mitchell, and Barnabás Póczos. 2020. Contextual parameter generation for knowledge graph link prediction. In Proceedings of AAAI, pages 3000-3008. +Tianxiang Sun, Yunfan Shao, Xiaonan Li, Pengfei Liu, Hang Yan, Xipeng Qiu, and Xuanjing Huang. 2020. Learning sparse sharing architectures for multiple tasks. In Proceedings of AAAI, pages 8936-8943. +Rui Wang, Masao Utiyama, Lemao Liu, Kehai Chen, and Eiichiro Sumita. 2017. Instance weighting for neural machine translation domain adaptation. In Proceedings of EMNLP, pages 1482-1488. +Dustin Wright and Isabelle Augenstein. 2020. Transformer based multi-source domain adaptation. In Proceedings of EMNLP, pages 7963-7974. +Juntao Yu, Mohab Elkaref, and Bernd Bohnet. 2015. Domain adaptation for dependency parsing via self-training. In Proceedings of IWPT, pages 1-10. +Mo Yu, Tiejun Zhao, and Yalong Bai. 2013. Learning domain differences automatically for dependency parsing adaptation. In Proceedings of IJCAI, pages 1876-1882. +Jiali Zeng, Jinsong Su, Huating Wen, Yang Liu, Jun Xie, Yongjing Yin, and Jianqiang Zhao. 2018. Multidomain neural machine translation with word-level domain context discrimination. In Proceedings of EMNLP, pages 447-457. \ No newline at end of file diff --git a/apgnadversarialandparametergenerationnetworksformultisourcecrossdomaindependencyparsing/images.zip b/apgnadversarialandparametergenerationnetworksformultisourcecrossdomaindependencyparsing/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..29bc7e6769e6ccaa2feed62ed31101af8ea4b81e --- /dev/null +++ b/apgnadversarialandparametergenerationnetworksformultisourcecrossdomaindependencyparsing/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a971f2de09bb9b85344877405b1b07c1427e20d1205c2408609d1316024fa37 +size 401326 diff --git a/apgnadversarialandparametergenerationnetworksformultisourcecrossdomaindependencyparsing/layout.json b/apgnadversarialandparametergenerationnetworksformultisourcecrossdomaindependencyparsing/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..5cfe5cfbb66af61f5822846b6806e96169ea16af --- /dev/null +++ b/apgnadversarialandparametergenerationnetworksformultisourcecrossdomaindependencyparsing/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b59d798294508851f8a0542c597dee124fe3de5cdc15c42ed123ca472a55250c +size 351747 diff --git a/aplugandplaymethodforcontrolledtextgeneration/1424622f-6094-4709-9c71-35c24e14e46e_content_list.json b/aplugandplaymethodforcontrolledtextgeneration/1424622f-6094-4709-9c71-35c24e14e46e_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..0ad6ff3388c783f7cefacbbdae79a34d9c6dcc72 --- /dev/null +++ b/aplugandplaymethodforcontrolledtextgeneration/1424622f-6094-4709-9c71-35c24e14e46e_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c03b2f2e2a1de23a3d5757cc9b72d5ef5b0fd622deab2af6034c247fcdba072 +size 138160 diff --git a/aplugandplaymethodforcontrolledtextgeneration/1424622f-6094-4709-9c71-35c24e14e46e_model.json b/aplugandplaymethodforcontrolledtextgeneration/1424622f-6094-4709-9c71-35c24e14e46e_model.json new file mode 100644 index 0000000000000000000000000000000000000000..bd16aebe4436faa0d7e14b93c9ca05069880e7e7 --- /dev/null +++ b/aplugandplaymethodforcontrolledtextgeneration/1424622f-6094-4709-9c71-35c24e14e46e_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1d7bd15ccc5471a149680f1a396069c2198a3b0604acfee4ad27709b2100ef01 +size 162006 diff --git a/aplugandplaymethodforcontrolledtextgeneration/1424622f-6094-4709-9c71-35c24e14e46e_origin.pdf b/aplugandplaymethodforcontrolledtextgeneration/1424622f-6094-4709-9c71-35c24e14e46e_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..184f9edb4dbaaf8a440ab546dffa9b6d549a1639 --- /dev/null +++ b/aplugandplaymethodforcontrolledtextgeneration/1424622f-6094-4709-9c71-35c24e14e46e_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:621adca3eb9ebcd62380803971891424958aced693c931fbf8f6d477badf3855 +size 582534 diff --git a/aplugandplaymethodforcontrolledtextgeneration/full.md b/aplugandplaymethodforcontrolledtextgeneration/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2f7521a7498a4ffb50122b3c65baa55388d49e8c --- /dev/null +++ b/aplugandplaymethodforcontrolledtextgeneration/full.md @@ -0,0 +1,548 @@ +# A Plug-and-Play Method for Controlled Text Generation + +Damián Pascual1 Béni Egressy1 Clara Meister1, Ryan Cotterell1,2 Roger Wattenhofer1 + +$^{1}$ ETH Zürich $^{2}$ University of Cambridge + +damianp@ethz.ch begrassy@ethz.ch clara.meister@inf.ethz.ch + +ryan.cotterell@inf.ethz.ch wattenhofer@ethz.ch + +# Abstract + +Large pre-trained language models have repeatedly shown their ability to produce fluent text. Yet even when starting from a prompt, generation can continue in many plausible directions. Current decoding methods with the goal of controlling generation, e.g., to ensure specific words are included, either require additional models or fine-tuning, or work poorly when the task at hand is semantically unconstrained, e.g., story generation. In this work, we present a plug-and-play decoding method for controlled language generation that is so simple and intuitive, it can be described in a single sentence: given a topic or keyword, we add a shift to the probability distribution over our vocabulary towards semantically similar words. We show how annealing this distribution can be used to impose hard constraints on language generation, something no other plug-and-play method is currently able to do with SOTA language generators. Despite the simplicity of this approach, we see it works incredibly well in practice: decoding from GPT-2 leads to diverse and fluent sentences while guaranteeing the appearance of given guide words. We perform two user studies, revealing that (1) our method outperforms competing methods in human evaluations; and (2) forcing the guide words to appear in the generated text has no impact on the fluency of the generated text. $^{1}$ + +# 1 Introduction + +Having systems capable of automatically generating human-like text has been an objective pursued since the early days of artificial intelligence (Meehan, 1977; Lebowitz, 1987). The recent development of large pre-trained language models based on the transformer architecture has brought us closer to this goal. Indeed, current state-of-the-art models can produce impressively realistic text (Radford et al., 2019; Raffel et al., 2020; + +Brown et al., 2020), facilitating their use across a wide range of language generation applications. + +Yet, these models are probabilistic in nature, and in certain language generation tasks, i.e., those that place few semantic constraints on the output, it can be difficult to control the general theme or ensure the presence of specific words in generated text. We use story generation (Fan et al., 2018) as a running example; even in the presence of a prompt, there are many continuations that may result in a good story. Indeed, for this task, a generator that does not reflect this diversity is likely undesirable, since the number of stories it could produce would be limited. But what if you would like your story to fulfill certain criteria? Under existing methods, one would have to train (or at least fine-tune) a new model for a limited set of use-cases or hope that the model places sufficient probability mass on text meeting this criteria such that it shows up during search $^{2}$ (Hokamp and Liu, 2017; Post and Vilar, 2018; Ziegler et al., 2019; Keskar et al., 2019). + +In this work, we introduce a better strategy for controlled decoding—where generated text must contain certain words—for semantically unconstrained generation tasks. In short, we shift the output distribution of a language generation model towards the semantic space of a given guide word. While this proposal sounds abstract at first, its realization is simple and intuitive: at each generation step, we modify the log-probability of the words in our vocabulary according to their semantic similarity to our guide word, quantified as the cosine similarity between their vector representations, i.e., word embeddings. This method not only encourages the explicit appearance of a guide word, but also encourages the model to generate appropriate context for the guide word to appear, i.e., words in the same semantic neighborhood (Hashimoto + +et al., 2016). By annealing the strength of the probability shift, we can guarantee that all guide words appear in our text. Moreover, this method allows for guidance towards both ordered and unordered sets of words. Our decoding strategy is plug-and-play, i.e., it can be combined with any autoregressive language model and decoding algorithm with no additional training, differentiating it from other self-claimed plug-and-play methods that both (1) require additional discriminators and (2) lack the ability to ensure the appearance of specific words (Dathathri et al., 2020; Krause et al., 2020). In particular, this means it is out-of-the-box compatible with large pre-trained transformer models (Brown et al., 2020; Raffel et al., 2020). + +We run extensive experiments with GPT-2 as our language model and find that our method produces text containing all specified guide words without an impact on the fluency and diversity of generated text. That is, we can control generation without harming text quality. Furthermore, we find that our strategy outperforms competing methods in human evaluations, and that generated text is close in fluency and overall quality to human text. + +# 2 Preliminaries + +# 2.1 Semantic Spaces + +We model a semantic space as a vector space $\mathbb{R}^d$ over concepts where distances indicate semantic similarities (Hashimoto et al., 2016). In practice, this amounts to assigning a vector representation to each concept that reflects its semantic properties; arguably, the most basic unit that we can use to represent concepts are words (Padó and Lapata, 2003). While the notion of a semantic space is abstract in nature, prior research suggests that word embedding algorithms may in fact provide rough representations of these spaces (Hashimoto et al., 2016). + +Word embeddings, i.e., continuous word representations produced by algorithms like word2vec (Mikolov et al., 2013) or GloVe (Pennington et al., 2014), have been studied in depth. Notably, it has been shown that cosine similarity between word embeddings learned by algorithms like GloVe provides a metric of semantic similarity (Erk, 2009; Pennington et al., 2014). Motivated by these results, we adopt word embedding vectors $\gamma(w)$ as points representing concepts in our semantic space—where $\gamma: \mathcal{V} \to \mathbb{R}^d$ is the mapping learned by an embedding algorithm from a word in our vocabulary $w \in \mathcal{V}$ to the vector space $\mathbb{R}^d$ ; we + +adopt cosine similarity $\cos (\gamma (w),\gamma (w^{\prime}))$ for words $w,w^{\prime}$ as our notion of semantic similarity. + +# 2.2 Text Generation + +We consider probabilistic models $p$ that assign a probability to all sequences $\mathbf{y}$ in the space of strings $\mathcal{V}(\mathcal{V}, n_{\max})$ , where $\mathcal{V}$ is the model's vocabulary and $n_{\max}$ is the maximum sequence length considered; all sequences are padded with distinguished beginning-of- and end-of-sequence symbols BOS and EOS. In this work, we focus on the case of autoregressive locally normalized probabilistic models, for which the probability of a sequence $\mathbf{y}$ can be decomposed using the chain rule of probability: + +$$ +p (\mathbf {y}) = \prod_ {t = 1} ^ {| \mathbf {y} |} p \left(y _ {t} \mid \mathbf {y} < t\right) \tag {1} +$$ + +In today's language generation tasks, $p$ is typically parameterized by a neural network, e.g., a transformer or a recurrent neural network; these models have led to impressive results, producing language that is both fluent and coherent (Radford et al., 2019; Raffel et al., 2020; Brown et al., 2020). + +Note that $p$ may additionally be conditioned on some input $\mathbf{x}$ , e.g., an image or a sentence in a source language. Informally, we can view this conditioning as a shift of the mass of $p$ towards the semantic space a model learns to map to from input $\mathbf{x}$ ; this shift may be strong, as in the case of machine translation, where the outcome should satisfy strict semantic constraints, or weak, as in topic-oriented story generation, where text should simply follow a general theme. + +The task of text generation is to decode sequences of natural language, i.e., text, from $p$ . There are myriad strategies for decoding, with no single de facto method used for all language generation tasks. Yet with few exceptions, all can be described using a framework consisting of two components: a score function and a decoding algorithm. Following the structure of Eq. 1, we define decoding algorithms as the general class of algorithms—which may be stochastic or deterministic in nature—that decode text autoregressively according to a score function. Common examples include nucleus sampling (Holtzman et al., 2020) and beam search (Reddy, 1977; Meister + +et al., 2020). Formally, we define a score function, $\mathrm{score}(\cdot \mid \mathbf{y}_{< t})\colon \mathcal{V}^t\to \mathbb{R}$ , as a map from strings generated under a model's vocabulary to a real number. As is clear from notation, we assume a dependency of this score on previously generated text $\mathbf{y}_{< t} = \langle y_1,\dots ,y_{t - 1}\rangle$ . For probabilistic text generators, the default score function is $\mathrm{score}(\cdot \mid \mathbf{y}_{< t}) = \log p(\cdot \mid \mathbf{y}_{< t})$ . Other examples include mutual information (only applicable in the presence of an input $\mathbf{x}$ ): $\mathrm{score}(\cdot \mid \mathbf{y}_{< t}) = \log (p(\cdot \mid \mathbf{y}_{< t},\mathbf{x}) / p(\mathbf{y}_{< t}))$ (Li et al., 2016). We note that for sampling-based decoding algorithms, the distribution over $\mathcal{V}$ output by $\mathrm{score}(\cdot \mid \mathbf{y}_{< t})$ is projected onto the $\Delta^{|\mathcal{V}| - 1}$ probability simplex—typically via the softmax transformation—such that it can be sampled from. + +# 2.3 Controlling Generation + +Two different types of control can be applied over language generation models: soft control and hard control. Soft control aims at directing the mood or the general topic of the generated text, whilst hard control aims at ensuring that some explicit constraints are met, e.g., specific words are contained in the text. Note that soft control can also be reached via hard control, i.e., text that contains a set of words related to a certain topic should arguably revolve around that topic. + +Some recent work has approached the problem of soft control on unconstrained language generation by training or fine-tuning language models (Ziegler et al., 2019; Yu et al., 2017; Keskar et al., 2019). However, given the existing trend towards using out-of-the-box pre-trained language models, it is desirable to develop control methods that are plug-and-play, i.e., that can be applied on an existing model without additional training. Yet currently, even methods that are termed plug-and-play require the training of an external discriminator (Dathathri et al., 2020; Krause et al., 2020). + +While hard control of constrained generation, e.g., machine translation, can be attained with grid beam search methods (Hokamp and Liu, 2017; Post and Vilar, 2018; Hu et al., 2019), it is impractical to use the same approach for hard control of unconstrained generation. Methods such as grid beam search rely on the assumption that there + +exists a core set of plausible candidates fulfilling the desired criteria. While typically true for machine translation—where a well-calibrated model places most of its probability mass on a (relatively) small subset of natural language sequences—this is not often the case for open-ended generation tasks. Recent work on stochastic search (Miao et al., 2019; Sha, 2020) has approached this problem by performing bidirectional search during generation and editing the text until the constraints are fulfilled. Although stochastic search is suitable for bidirectional RNN models, it is not yet clear if it can be applied to forward generation models, e.g., transformer-based models. + +# 3 Keyword2Text + +In this work, we propose Keyword2Text (K2T), a new and simple plug-and-play method for exerting hard control during text generation. By modifying the score function, we can incorporate a semantic shift at decoding time, without additional models or fine-tuning. This method is model agnostic—it works with any autoregressive language model, including pre-trained transformers, and can be combined with other decoding methods and objectives. Further, we show that K2T (1) does not require a pre-defined ordering of constraints, and (2) can be used for guaranteeing hard constraints. + +# 3.1 A Controlled Generation Objective + +We consider a probabilistic language generator $p$ and a word $w$ , which is either a specific word we would like to appear in the generated text or a topic we would like to steer generation towards. We refer to $\gamma(w) \in \mathbb{R}^d$ as our topic vector, i.e., the point in our semantic space associated with the word $w$ . We propose a simple modification to the score function $\text{score}(\cdot | \mathbf{y}_{ EOS", where EOS is the end-of-sequence token. We fine-tune GPT2 on a Titan RTX GPU (24GB) for five epochs on causal language modeling, which takes around 26 hours. At evaluation time we give as initial context a prompt with the same format as during training and we use nucleus sampling with \( p = 0.9 \). + +The objective of the ROC story dataset is to generate stories given a title. $^{10}$ To conform the dataset to our task, i.e., keyword to text, we build a test set of 20 titles randomly selected from the dataset and use the plan component of Plan-and-write (Yao et al., 2019) to generate five keywords from these titles. Using these keywords we generate one story with each of the competing methods, resulting in 20 examples per method. We perform a human evaluation comparing $GPT-2 + K2T$ , CGMH and Plan-and-write in which 30 evaluators are presented each of the three texts and asked to evaluate them relative to each other in terms of 4 criteria: fluency, logical consistency, creativity and best overall (see App. A and B for details). + +# 4.3 Comparison to Human Text + +To assess the quality of text generated using K2T with respect to human text, we generate news articles from keywords. We employ the 500N-KPCrowd dataset from Marujo et al. (2011), which consists of pieces of news written by professional journalists with keywords assigned by human annotators. For our evaluation, we randomly select ten keyword-article pairs from the test set. At generation time, the language model receives the first + +
MethodSR (%)PPLRep. (%)
No control0.6 ± 0.534.6 ± 3.22.4 ± 0.7
W. λ = 54.4 ± 0.934.5 ± 2.83.7 ± 0.8
W. λ = 1052.0 ± 3.446.7 ± 3.37.2 ± 1.3
W. λ = 2084.35 ± 1.2225.9 ± 132.633.0 ± 1.5
C. λ = 512.2 ± 2.129.8 ± 1.33.3 ± 1.4
C. λ = 1072.6 ± 2.844.75 ± 3.78.7 ± 1.3
C. λ = 2095.1 ± 2.399.3 ± 20.113.4 ± 2.1
+ +30 words of the original article as initial context. In our baseline, the model receives no guidance, i.e., $\lambda = 0$ . We compare this to text generated from the same model albeit controlled by K2T. + +We design our human evaluation based on best practices for evaluation of generated text (van der Lee et al., 2019). Specifically, we prepare three sets of ten articles, each consisting of a combination of original articles (written by humans), articles generated by our method and articles generated by GPT-2 without control. We create three separate surveys so that evaluators will only be exposed to one version of each story (they do not know the origin). Participants are asked to evaluate how coherent, fluent and natural (human-like) each article is, as well as its overall quality, on a 7-point Likert scale (van der Lee et al., 2019), i.e., from 1 to 7 where higher is better (cf. App. C). Each survey is shown to 30 evaluators. In App. C.2 we show all the articles used in this study. + +# 5 Results + +# 5.1 Hyperparameter Analysis + +We perform the keyword to phrase task specified in §4.1. We run each experiment ten times with different seeds and report the mean and standard deviation across the runs. + +Controlled Generation. First, we assess the baseline effectiveness of our generation objective in Eq. 2 for generating text that contains a set of guide words $W$ . We compare three approaches. + +- No control: language generation without guidance, i.e., $\lambda = 0$ ; +- Guide words only:11 shifting the scores only for + +Table 1: Comparison of the No control, Guide words only (W) and Guide Context (C) strategies. + +
λ0PPLRep. (%)
558.4 ± 4.53.5 ± 1.1
1070.5 ± 7.16.4 ± 2.2
15109.5 ± 24.210.5 ± 3.2
20235.8 ± 352.210.6 ± 1.7
25135.8 ± 44.99.9 ± 2.4
30310.3 ± 366.89.5 ± 2.1
+ +Table 2: Evaluation of the shift strength $\lambda$ . + +the tokens corresponding exactly to the guide words $W$ and not for similar words; + +- Guide context: shifting the score for the guide words $W$ in addition to semantically similar words. + +In this evaluation we do not anneal $\lambda$ ; thus, guide words are not guaranteed to appear. It follows that we can only evaluate the performance of our method under soft constraints. Unless otherwise stated, here and in the following, we apply unordered control with the Guide Closest strategy, we use score $(\cdot \mid \mathbf{y}_{< t}) = \log p(\cdot \mid \mathbf{y}_{< t})$ as our original score function and we use nucleus sampling with $p = 0.9$ as the decoding algorithm. We present the results of this comparison in Table 1. + +When the score function is not shifted (No control), the average success rate is only $0.6\%$ , which serves as a random baseline. We see that guiding towards the context is more effective than guiding only towards the exact guide words, i.e., for the three values of $\lambda$ considered here, both success rate and perplexity are significantly better. Furthermore, the repetition score of Guide Context is clearly better for $\lambda = 20$ , the only value where both approaches reach a high success rate. Note that encouraging the appearance of specific keywords also helps keep the generated text on-topic; this may explain the lower perplexity of the best performing configuration versus No control. These results validate Guide Context as the best strategy. + +Initial Shift Strength $\lambda_0$ . Next, we investigate the effect of varying the initial shift strength $\lambda_0$ ; here and in the remaining experiments we guarantee the appearance of all keywords. In Table 2 we report perplexity and repetition for different values of $\lambda_0$ (success rate is $100\%$ in all cases). We see that increasing $\lambda_0$ results in a worsening of perplexity and repetition scores, with strong variability across different runs, i.e., high standard deviation. + +
StrategyPPLRep. (%)
Guide Closest58.4 ± 4.53.5 ± 1.1
Guide All39.7 ± 2.730.0 ± 2.3
Guide Random66.9 ± 3.71.5 ± 0.5
Fixed Order61.7 ± 4.23.4 ± 1.2
+ +For $\lambda_0 = 5$ the average perplexity (58.4) and repetition score $(3.5\%)$ are the best among the considered values; we use this value of $\lambda_0$ in the remaining experiments. + +Unordered Control. Given a set of words, it is not trivial to devise a strategy to guide text generation towards those words without a pre-specified order. We explore two additional strategies on top of Guide Closest, described in §3.2: + +- Guide All: We shift the scores towards all guide words at once, by adding the sum of the cosine similarities. +- Guide Random: At each generation step we choose the next guide word uniformly at random from the remaining guide words and shift the scores towards this word. + +In Table 3 we present the evaluation of these strategies. For reference, we also report results for guiding the guide words in order. We see that guiding towards all the words at the same time performs poorly in terms of repetition score $(30.0\%)$ . On the other hand, Guide Random and Guide Closest produce similar results, with smaller perplexity for the Guide Closest strategy and thus, in the following we adopt the Guide Closest strategy. + +Decoding Algorithm. Finally, we evaluate our method in conjunction with different decoding algorithms: + +- Nucleus sampling (NS; Holtzman et al., 2020) with $p = 0.9$ . +- Beam search (BS) with 4 beams and length normalized re-ranking, i.e. taking the top- $K$ candidates according to score $(\mathbf{y}) = \log p(\mathbf{y}) / |\mathbf{y}|$ . +- BS with word count (BS+WC): we increment the above re-ranking function if the generated token $y_{t}$ corresponds to one of the remaining + +Table 3: Comparison of different approaches for control towards unordered constraints with $\lambda_0 = 5$ . + +
StrategyPPLRep. (%)
NS58.4 ± 4.53.5 ± 1.1
BS9.8 ± 046.5 ± 0
BS+WC11.9 ± 038.7 ± 0
BS+WC+NS21.2 ± 1.713.4 ± 2.2
+ +Table 4: Comparison of different decoding algorithms. + +Words: Guide, Jump, Eight, Row, Settle + +Text: One of the most common questions I get from new rowers is how to warm up before a race. Eight months ago, I wrote a guide to warm up and how to jump in the water, but I never got around to updating it. So I decided to settle the question once and for all, and try to write the best possible course through it. + +Words: Search, Major, String, Cost, Village + +Text: + +Table 5: Examples of text generated by K2T. + +guide words: + +$$ +\begin{array}{l} \operatorname {s c o r e} ^ {\prime} \left(\mathbf {y} _ {< t}\right) = \operatorname {s c o r e} \left(\mathbf {y} _ {< t}\right) \tag {5} \\ + \left(| W | - | W _ {t + 1} |\right) \\ \end{array} +$$ + +where $|W| - |W_t| \geq 0$ equals the number of guide words that have appeared by step $t$ . + +- BS+WC with NS (BS+WC+NS): we consider a hybrid of beam search and nucleus sampling where the words are sampled using nucleus (instead of deterministically picking the top words). + +Table 4 shows that while NS produces diverse text, its perplexity is the highest by a margin. Conversely, BS with and without word count reward, generates text with low perplexity but high repetition. The combination of both reaches the best trade-off. + +In Table 5 we show two examples generated with the best-performing configuration: $\lambda_0 = 5$ , Guide + +
MethodSR (%)PPLRep. (%)
Plan-and-Write96.033.925.7
CGMH97.0127.81.6
GPT-2 fine-tuned72.089.41.8
GPT-2 + K2T100.048.81.5
+ +Closest, $BS + WC + NS$ decoding, which we use for the experiments in §5.2 and §5.3. + +# 5.2 Comparison to Alternative Methods + +In Table 6, we report metrics for each of the three methods (K2T, Plan-and-write and CGMH) on the keyword-to-text task based on the ROC dataset. Neither Plan-and-write (P&W), CGMH nor finetuned GPT-2 reach a $100\%$ success rate and, while P&W presents the lowest perplexity, its repetition score is by far the highest (25.7). Conversely, although the repetition score of CGMH and GPT-2 fine-tuned are comparable to our method, they generate text with very high perplexity, 127.8 and 89.4 respectively. In light of these results, K2T seems to provide the best trade-off between perplexity and repetition, on top of reaching $100\%$ success rate. + +In Figure 1 we see the results of the user study comparing CGMH, P&W and GPT-2+K2T. For each method, we report the proportion of times that it is chosen as the best of the three across four different axes: fluency, consistency, creativity and overall quality. K2T outperforms the other two in all aspects, in particular in creativity and overall quality. These results suggest that our method is superior to the baseline hard control methods on both objective and subjective metrics. + +# 5.3 Comparison to Human Text + +In Table 7 we report perplexity, repetition score and success rate on the news article task. We compare the original news articles with those generated by uncontrolled GPT-2 and with GPT-2 controlled by K2T. We see that without controlling GPT-2, the keywords do not appear in the generated texts, despite the 30 words of initial context. This suggests that methods such as grid beam search (Hokamp and Liu, 2017; Post and Vilar, 2018) would perform poorly. We also see that when GPT-2 is controlled by K2T, the text it generates is close to the original text in terms of perplexity and repetition score. To explore the perceived impact of the differences, we + +Table 6: Comparison to competing methods. + +
TextSR (%)PPLRep. (%)
Original100.015.21.3
GPT-20.08.811.5
Ours100.012.51.0
+ +Table 7: Comparison of the original articles and text generated by GPT-2 without and with control (ours). + +look at the results of the human evaluations. + +Figure 2 shows the results of the human evaluations on the news article task. As expected, news articles written by professional journalists are assessed superior to those written by GPT-2 when controlled by K2T. Although the difference is statistically significant $(p < 0.05; t$ -test), it is small: less than 0.6 points for each of the evaluated properties on a scale from 1 to 7. Furthermore, the text generated when controlling GPT-2 is comparable in terms of naturalness and fluency, and significantly better $(p < 0.05; t$ -test) in terms of consistency and overall quality, than the text from uncontrolled GPT-2. These results demonstrate that K2T does not compromise the quality of the generated text. Further, the resulting text is close in perceived quality to human text. + +# 6 Related Work + +Various other approaches exist for controlled language generation; here we review those that are not discussed in $\S 2$ . + +Hard Control. Hard control of autoregressive language models in unconstrained settings has remained elusive thus far. Xu et al. (2020) propose a framework to exert hard control over language generation which, nevertheless, requires training three large transformer models. + +Soft Control. Related to our approach of using semantic spaces to control generation, Chang et al. (2021) use the space of GloVe embeddings to define control topics. However, this method is not plug-and-play since it requires fine-tuning a GPT-2 encoder to generate text aligned with the control topics. A number of plug-and-play methods for soft control exist that use external discriminators to steer language generation. Holtzman et al. (2018) train discriminators on different linguistic properties to improve the quality of generated text. Dathathri et al. (2020) use the gradients of an external discriminator to direct the generation of a + +![](images/aa178f6e1123d236205896f47a14cd43d966f61efabbda2e8809e89d1b5d92ad.jpg) +Figure 1: User study comparing the three methods; bars indicate how often each method was picked as the best. + +pre-trained language model towards the target topic. Similarly, Krause et al. (2020) use a contrastive strategy to soft-control language generation. Yang and Klein (2021) directly modify the output probabilities of a (pre-trained) language model using the output of a discriminator that determines whether future text will contain the desired attribute, e.g., formality. Unfortunately, the use of external discriminators limits the applicability of these methods since they require training data for each of the target topics or attributes. Our method elegantly dispenses with the need for a discriminator by using the geometric properties of semantic spaces. + +# 7 Conclusion + +In this work, we present K2T, a simple and intuitive plug-and-play decoding method that can be used to impose controls on any autoregressive model for language generation, including large pre-trained transformers, like GPT-2. Our method guarantees the appearance of guide words and requires neither re-training nor the use of external discriminators. Our two user studies reveal that K2T is superior to competing hard control methods and that there is no statistical difference in perceived fluency, consistency and overall quality between news articles generated by our method and by GPT-2 without control. In future work, we plan to investigate in more detail the application of this decoding method to soft control tasks and to text detoxification. + +# Ethics Statement + +We recognize that controllable language generation can potentially be used to produce misinformation or offensive text. However, we believe that further research on controllable generation is necessary to ensure that we have at our disposal the tools needed to prevent automatic language generation + +![](images/16219fdb481cc033d206623219d6fa632e62f09a0196272860f295622afa0e59.jpg) +Figure 2: User study comparing our control method to original and GPT-2 articles. + +techniques from being used for malicious purposes. Methods for controlling large pre-trained language models are also a promising tool to mitigate the generation of biased text, e.g., steering generation towards the semantic space of both "woman" and "doctor" may mitigate the bias typically seen surrounding stereotypically male-oriented professions. We believe this is an important future direction for our work. Further, we consider the environmental impacts of our method. As our method is completely plug-and-play, i.e., it is able to make use of pre-trained language models and word embeddings, we hope that it can be utilized in place of techniques that require extensive model training. This would in turn reduce the energy consumption required to setup a controllable language generation system, which for large language generation models, can be quite significant. + +# References + +Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D. Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. 2020. Language models are few-shot learners. In Advances in Neural Information Processing Systems, volume 33, pages 1877-1901. + +Haw-Shiuan Chang, Jiaming Yuan, Mohit Iyyer, and Andrew McCallum. 2021. Changing the mind of transformers for topically-controllable language generation. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 2601-2611, Online. Association for Computational Linguistics. + +Sumanth Dathathri, Andrea Madotto, Janice Lan, Jane Hung, Eric Frank, Piero Molino, Jason Yosinski, and Rosanne Liu. 2020. Plug and play language models: A simple approach to controlled text generation. In 8th International Conference on Learning, Addis Ababa, Ethiopia. +Katrin Erk. 2009. Representing words as regions in vector space. In Proceedings of the Thirteenth Conference on Computational Natural Language Learning (CoNLL-2009), pages 57–65, Boulder, Colorado. Association for Computational Linguistics. +Angela Fan, Mike Lewis, and Yann Dauphin. 2018. Hierarchical neural story generation. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 889-898, Melbourne, Australia. Association for Computational Linguistics. +Tatsunori B. Hashimoto, David Alvarez-Melis, and Tommi S. Jaakkola. 2016. Word embeddings as metric recovery in semantic spaces. Transactions of the Association for Computational Linguistics, 4:273-286. +Chris Hokamp and Qun Liu. 2017. Lexically constrained decoding for sequence generation using grid beam search. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1535-1546, Vancouver, Canada. Association for Computational Linguistics. +Ari Holtzman, Jan Buys, Li Du, Maxwell Forbes, and Yejin Choi. 2020. The curious case of neural text degeneration. In 8th International Conference on Learning Representations, Addis Ababa, Ethiopia. +Ari Holtzman, Jan Buys, Maxwell Forbes, Antoine Bosselut, David Golub, and Yejin Choi. 2018. Learning to write with cooperative discriminators. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1638-1649, Melbourne, Australia. Association for Computational Linguistics. +J. Edward Hu, Huda Khayrallah, Ryan Culkin, Patrick Xia, Tongfei Chen, Matt Post, and Benjamin Van Durme. 2019. Improved lexically constrained decoding for translation and monolingual rewriting. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 839-850, Minneapolis, Minnesota. Association for Computational Linguistics. +Nitish Shirish Keskar, Bryan McCann, Lav R. Varshney, Caiming Xiong, and Richard Socher. 2019. Ctrl: A conditional transformer language model for controllable generation. CoRR, abs/1909.05858. +Ben Krause, Akhilesh Deepak Gotmare, Bryan McCann, Nitish Shirish Keskar, Shafiq Joty, Richard + +Socher, and Nazneen Fatema Rajani. 2020. GeDi: Generative discriminator guided sequence generation. CoRR, abs/2009.06367. +Michael Lebowitz. 1987. Planning stories. In Proceedings of the 9th Annual Conference of the Cognitive Science Society, pages 234-242. +Jiwei Li, Michel Galley, Chris Brockett, Jianfeng Gao, and Bill Dolan. 2016. A diversity-promoting objective function for neural conversation models. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 110-119, San Diego, California. Association for Computational Linguistics. +Bill Yuchen Lin, Wangchunshu Zhou, Ming Shen, Pei Zhou, Chandra Bhagavatula, Yejin Choi, and Xiang Ren. 2020. CommonGen: A constrained text generation challenge for generative commonsense reasoning. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 1823-1840, Online. Association for Computational Linguistics. +Chia-Wei Liu, Ryan Lowe, Iulian Serban, Mike Noseworthy, Laurent Charlin, and Joelle Pineau. 2016. How NOT to evaluate your dialogue system: An empirical study of unsupervised evaluation metrics for dialogue response generation. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 2122-2132, Austin, Texas. Association for Computational Linguistics. +Pedro Henrique Martins, Zita Marinho, and Andre F. T. Martins. 2020. Sparse text generation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4252-4273, Online. Association for Computational Linguistics. +Luís Marujo, Mácio Viveiros, and João Paulo Neto. 2011. Keyphrase cloud generation of broadcast news. In Proceedings of the 12th Annual Conference of the International Speech Communication Association, pages 2393-2396. ISCA. +James R. Meehan. 1977. TALE-SPIN, an interactive program that writes stories. In Proceedings of the 5th International Joint Conference on Artificial Intelligence, pages 91-98. +Clara Meister, Tim Vieira, and Ryan Cotterell. 2020. If beam search is the answer, what was the question? In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, Online. Association for Computational Linguistics. +Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. 2017. Pointer sentinel mixture models. In 5th International Conference on Learning Representations, Toulon, France. +Ning Miao, Hao Zhou, Lili Mou, Rui Yan, and Lei Li. 2019. CGMH: constrained sentence generation by metropolis-hastings sampling. In The Thirty-Third + +AAAI Conference on Artificial Intelligence, pages 6834-6842. AAAI Press. +Tomás Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. 2013. Efficient estimation of word representations in vector space. In 1st International Conference on Learning Representations (Workshop Track), Scottsdale, Arizona, USA. +Nasrin Mostafazadeh, Nathanael Chambers, Xiaodong He, Devi Parikh, Dhruv Batra, Lucy Vanderwende, Pushmeet Kohli, and James Allen. 2016. A corpus and cloze evaluation for deeper understanding of commonsense stories. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 839-849, San Diego, California. Association for Computational Linguistics. +Lili Mou, Rui Yan, Ge Li, Lu Zhang, and Zhi Jin. 2015. Backward and forward language modeling for constrained sentence generation. CoRR, abs/1512.06612. +Kenton Murray and David Chiang. 2018. Correcting length bias in neural machine translation. In Proceedings of the Third Conference on Machine Translation: Research Papers, pages 212-223, Brussels, Belgium. Association for Computational Linguistics. +Sebastian Padó and Mirella Lapata. 2003. Constructing semantic space models from parsed corpora. In Proceedings of the 41st Annual Meeting of the Association for Computational Linguistics, pages 128-135, Sapporo, Japan. Association for Computational Linguistics. +Jeffrey Pennington, Richard Socher, and Christopher Manning. 2014. GloVe: Global vectors for word representation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1532-1543, Doha, Qatar. Association for Computational Linguistics. +Matt Post and David Vilar. 2018. Fast lexically constrained decoding with dynamic beam allocation for neural machine translation. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 1314-1324, New Orleans, Louisiana. Association for Computational Linguistics. +Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language models are unsupervised multitask learners. OpenAI Blog, 1(8):9. +Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21(140):1-67. + +Raj Reddy. 1977. Speech understanding systems: A summary of results of the five-year research effort at carnegie mellon university. +Lei Sha. 2020. Gradient-guided unsupervised lexically constrained text generation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 8692-8703, Online. Association for Computational Linguistics. +Chris van der Lee, Albert Gatt, Emiel van Miltenburg, Sander Wubben, and Emiel Krahmer. 2019. Best practices for the human evaluation of automatically generated text. In Proceedings of the 12th International Conference on Natural Language Generation, pages 355-368, Tokyo, Japan. Association for Computational Linguistics. +Sean Welleck, Ilia Kulikov, Stephen Roller, Emily Dinan, Kyunghyun Cho, and Jason Weston. 2020. Neural text generation with unlikelihood training. In 8th International Conference on Learning Representations, Addis Ababa, Ethiopia. +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumont, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Remi Louf, Morgan Funtowicz, Joe Davison, Sam Shleifer, Patrick von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lhoest, and Alexander Rush. 2020. Transformers: State-of-the-art natural language processing. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 38-45, Online. Association for Computational Linguistics. +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 machine translation system: Bridging the gap between human and machine translation. CoRR, abs/1609.08144. +Peng Xu, Mostofa Patwary, Mohammad Shoeybi, Raul Puri, Pascale Fung, Anima Anandkumar, and Bryan Catanzaro. 2020. MEGATRON-CNTRL: Controllable story generation with external knowledge using large-scale language models. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2831-2845, Online. Association for Computational Linguistics. +Kevin Yang and Dan Klein. 2021. FUDGE: Controlled text generation with future discriminators. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 3511-3535, Online. Association for Computational Linguistics. +Lili Yao, Nanyun Peng, Ralph M. Weischedel, Kevin Knight, Dongyan Zhao, and Rui Yan. 2019. Plan-and-write: Towards better automatic storytelling. In + +The Thirty-Third AAAI Conference on Artificial Intelligence, pages 7378-7385. AAAI Press. +Lantao Yu, Weinan Zhang, Jun Wang, and Yong Yu. 2017. Seqgan: Sequence generative adversarial nets with policy gradient. In Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, February 4-9, 2017, San Francisco, California, USA, pages 2852-2858. AAAI Press. +Daniel M. Ziegler, Nisan Stiennon, Jeffrey Wu, Tom B. Brown, Alec Radford, Dario Amodei, Paul Christiano, and Geoffrey Irving. 2019. Fine-tuning language models from human preferences. CoRR, abs/1909.08593. + +# A Evaluation Details + +In this appendix we provide additional details on different aspects of our evaluation to ease reproducibility. + +# A.1 Keywords for Hyperparameter Analysis + +To generate the keyword sets we use in our hyperparameter analysis we use a list of 1000 common English words12. From this list, we discard the first 500 words, which we found to be too common and from the remaining 500 words, we additionally discard stop words. Then, from the resulting list we sample 50 sets of 5 words each, which constitutes our keyword sets. + +# A.2 Details of Alternative Methods + +For CGMH (Miao et al., 2019), we use the same model as in the original work: a two-layer LSTM (63M parameters); and train it using a Titan Xp 12GB GPU following the instructions from the original repository13. For generating the samples, we run the model for 1000 updates with a minimum sequence length of 30 words. Similarly, Plan-and-write (Yao et al., 2019) uses an LSTM based sequence-to-sequence model with 62M parameters. We train the model for 357 epochs on a Titan Xp 12GB GPU with the ROC story dataset (Mostafazadeh et al., 2016). + +# A.3 Human Evaluation + +We perform both user studies using Amazon MTurks. In each of them, we include simple comprehension questions as a control to ensure that the evaluators read the texts carefully. We discard and replace those evaluators who do not spend the minimum expected time on the study or who do not answer enough control questions correctly. + +# A.4 Comparison to Human Text + +To generate the news articles using the 500N-KPCrowd dataset from Marujo et al. (2011), we randomly select ten keyword-article pairs from the test set with a length ranging from 81 to 217 words (so that the articles are neither too short nor too long for human assessment). Then, from the given keywords, we first remove proper nouns, e.g., names and cities. As the number of keywords provided in some articles is quite large, we further pare this list down by randomly removing selected keywords until the proportion is one keyword per ten words of text, such that all article-keyword pairs have present the same ratio of keywords per length. + +# Read the 3 pieces of text below and answer the questions. + +# Text 1 + +kate was looking for a new car. she needed a new one. she decided to buy a new one. she bought it. she went home and put it in the car. + +# Text 2 + +kate_home # bought this for my husband and decided to give it a try after he needed a stick and a bit of extra action. We also purchased the OLD RELIGION keychain. + +# Text 3 + +Mr. UNK needed not only to get the idea that it had not been decided, nor because she had bought a home + +# Select the text that is the... + +most like a product review. * + +![](images/359d8e9654a04eccde7a95e9a9b51e8d30b3cec5cee7e06a6b00e1273c3b629a.jpg) +Figure 3: Screenshot of the ROC story user study. + +Text 1 + +![](images/10af767a47a49b6fbba5c09b07cec23a5a76fe9eefb053c4eac4d26abd49eb12.jpg) + +Text 2 + +![](images/239017cca7be42881f24e4121345c930dddbfb7751d19463e2d564f8a6e2fb9a.jpg) + +Text 3 + +most fluent. * + +# B ROC Story Survey + +Here we provide a screenshot to show how our survey for method comparison looks. + +# C News Articles + +# C.1 Survey + +As above, here we provide a screenshot that shows how our survey for comparison to human text looks. + +# News Article Text Quality Survey + +*Required + +# Read the text below and answer the questions + +On Wednesday, Egypt's Supreme Military Council issued a declaration which will temporarily replace the country's former constitution, dating back to 1971. The declaration is based on amendments to the old constitution which were backed by the majority of people at a referendum on March 19. The amendments mostly concern procedures for presidential and parliamentary elections, and the terms of presidency. The old constitution was abrogated by the country's military on February 13, soon after President Mubarak's resignation. Parliamentary elections in Egypt are planned for this September. + +# Definitions (reminder) + +Fluency: the text can be understood easily, well, and quickly Logical Consistency: there are no contradictions in the text Naturalness: the text seems to have been written by a human + +There was a referendum about the constitution in February. + +![](images/152e521009c4010c7a2eaf0811675630aa6a59bdfa16770aaf5cdf8536734150.jpg) + +![](images/ea970fdd1798af73eaf953cffd8773b8a47c6b211b887c3c8fec306ad5d3f6cf.jpg) + +This text is (logically) consistent. + +![](images/6cd3f7a8c7fea37dccc34bccb87390fd24bff92d3d07d3e92de3efcc431d802a.jpg) +Figure 4: Screenshot of the news article user study. + +# C.2 Texts + +Below we show the original news articles and the news articles generated by our method that were used in the human evaluation study. Detailed results of the study are included in Appendix C.3. + +# Text 1 + +Context: Johnny Depp will be asked to make a fifth Pirates Of The Caribbean film if the fourth instalment is a success. Producer Jerry Bruckheimer said he already has a screenplay + +Keywords: fifth, audience, embraces, character, original, trilogy, continue, story, digital, cameras, pirates, fresh, new, carry + +OURS + GPT2-774M: Johnny Depp will be asked to make a fifth Pirates Of The Caribbean film if the fourth instalment is a success. Producer Jerry Bruckheimer said he already has a screenplay with Pirates new trilogy character Johnny Depp and digital animation studio Story Studio. The fifth film will continue the original story from the first three films and will be set in the Caribbean. "We are very excited to carry on the story of the audience's favourite Pirates of the Caribbean characters," said Bruckheimer. "We are fresh off the success of Pirates of the Caribbean: On Stranger Tides and we are looking forward to embracing the new generation of fans with a new film that will be even more exciting than the first three films." The Pirates of the Caribbean: On Stranger Tides cameras have been filming in Barranquilla since April 11. Filming will continue for two months to reach completion by May 23. + +HUMAN: Johnny Depp will be asked to make a fifth Pirates Of The Caribbean film if the fourth instalment is a success. Producer Jerry Bruckheimer said he already has a screenplay in the works for a fifth Pirates tale, which would follow the forthcoming Pirates Of The Caribbean: On Stranger Tides. "As long as the audience embraces this one, we'll certainly try to make another one. It's really up to Johnny. He loves the character," he said. The original three Pirates blockbusters ended up as a trilogy continuing the same key characters and story line. But Jerry said On Stranger Tides - the first Pirates flick shot with digital 3D cameras - and future Pirates films will be stand-alone stories continuing the adventures of Johnny's woozy buccaneer Captain Jack Sparrow. "The audience told us (at test screenings of On Stranger Tides) what they loved about it is that it was fresh, it was new, it was a whole new story, "Jerry said. "So that will carry over into the next one, too, to give it something fresh and different." + +# Text 2 + +Context: On Wednesday, Egypt's Supreme Military Council issued a declaration which will temporarily replace the country's former constitution, dating back to 1971. The declaration is based on amendments to the old + +Keywords: constitution, majority, elections, military, resignation + +Ours + GPT2-774M: On Wednesday, Egypt's Supreme Military Council issued a declaration which will temporarily replace the country's former constitution, dating back to 1971. The declaration is based on amendments to the old constitution which were approved by the majority of military members in elections earlier this year. The new constitution will replace the previous one, which was approved by a referendum in June. The resignation of President Mohammed Morsi in July 2011 was a prerequisite for the current constitutional amendment. Civil society activists point to the judiciary, a particularly divisive institution. They accuse the military council and authorities of targeting the judiciary to weaken the role of the Egyptian people. + +HUMAN: On Wednesday, Egypt's Supreme Military Council issued a declaration which will temporarily replace the country's former constitution, dating back to 1971. The declaration is based on amendments to the old constitution which were backed by the majority of people at a referendum on March 19. The amendments mostly concern procedures for presidential and parliamentary elections, and the terms of presidency. The old constitution was abrogated by the country's military on February 13, soon after President Mubarak's resignation. Parliamentary elections in Egypt are planned for this September. + +# Text 3 + +Context: A group of moderate House Democrats have initiated conversations with Republican lawmakers in a bid to try to reach a deal to tackle burgeoning federal spending. The group is being + +Keywords: leaders, coalition, conservative, lawmakers, goals + +OURS + GPT2-774M: A group of moderate House Democrats have initiated conversations with Republican lawmakers in a bid to try to reach a deal to tackle burgeoning federal spending. The group is being led by conservative lawmakers and leaders of the coalition, including Reps. Chris Van Hollen (Md.), Jim McGovern (Mass.), and Jim McDermott (Wash.). The goals are to present a united front and try to provide some bipartisan credibility to the nascent spending talks. That effort will likely fail, however, as the Democratic leaders have been unable to reach agreement on a spending plan that is both ambitious and bipartisan. + +HUMAN: A group of moderate House Democrats have initiated conversations with Republican lawmakers in a bid to try to reach a deal to tackle burgeoning federal spending. The group is being led by Reps. Jim Cooper (D., Tenn.) and Kurt Schrader (D., Ore.), both of whom are leaders of the Blue Dogs, a coalition of fiscal conservative Democrats. Tuesday, the lawmakers released a series of fiscal discipline goals, many of which are similar to the targets set in place by the deficit commission established... + +# Text 4 + +Context: Oscar nominated actress Hailee Steinfeld is set to play Sleeping Beauty in a re-visioning of the classic fairytale. The 14-year-old star has signed on to play the unfortunate princess in + +Keywords: movie, version, story, star, sleep, dream, role, novel, upcoming, youngest, actress, nominated, television, adaptation, classic + +OURS + GPT2-774M: Oscar nominated actress Hailee Steinfeld is set to play Sleeping Beauty in a re-visioning of the classic fairy tale. The 14-year-old star has signed on to play the unfortunate princess in the adaptation of classic novel Sleeping Beauty starring Emma Watson. The movie will be directed by Story television and produced by DreamWorks Animation. The role of Sleeping Beauty was originally played by Australian actress Sophie Okonedo in the original version of the story. The upcoming remake will be directed by Oscar nominated director Rob Marshall. Steinfeld, who is the youngest of four siblings and a native of Melbourne, Australia, has already landed a pair of teen movies with her younger sister Zoe in Zoe and Me and Ice Age. "It's exciting to be working with DreamWorks again, and on a film like Sleeping Beauty," Steinfeld said. + +HUMAN: Oscar nominated actress Hailee Steinfeld is set to play Sleeping Beauty in a re-visioning of the classic fairy tale. The 14-year-old star has signed on to play the unfortunate princess in the new movie. It will be a spin of a version of the story which is being written by screen writer Lindsay Devlin. According to Deadline.com the new version will give the star more to do than just sleep as it will follow her as she enters a dream world and has to find her way out. Hailee is also currently being considered to play the lead role in the novel-based film Forgotten, from the upcoming book of the same name by Cat Patrick. After being one of the youngest ever actresses to be nominated for an Academy Award at this years Oscars she is set to have a busy year with several other offers on the table. The young California native had only starred in several television bit parts before landing the lead role in the Cohen Brothers adaptation of the classic John Wayne western True Grit alongside Jeff Bridges. + +# Text 5 + +Context: Pinch-hitter David Murphy delivered a tiebreaking, two-run double in the eighth inning and the Texas Rangers rallied for a 9-5 victory over the Boston Red Sox on Friday after raising + +Keywords: championship, kicked, land, newcomers, home, score, played, season, victory, hits, runs, debut, strikeouts + +OURS + GPT2-774M: Pinch-hitter David Murphy delivered a tiebreaking, two-run double in the eighth inning and the Texas Rangers rallied for a 9-5 victory over the Boston Red Sox on Friday after raising their season home run total to 27. The victory was the Rangers' first since hitting 27 home runs in a season-opening win over the New York Yankees on April 1. The Rangers scored four runs in the eighth inning to take a 6-5 lead. Murphy played the role of a pinch hitter in the eighth inning and kicked a single to right field to score Mark Trumbo and make it 7-5. The Rangers scored four more runs in the ninth inning to land the win. Matt Bush hit a two-run homer to right field and Prince Fielder hit a two-run double to left field to make it 9-5. The strikeouts were the most the Rangers have allowed in a game since debuting with 26 in a win over the New York Yankees on April 1. The championship of the American League West will be decided on Sunday when the Rangers host the newcomers the Los Angeles Angels. + +HUMAN: Pinch-hitter David Murphy delivered a tiebreaking, two-run double in the eighth inning and the Texas Rangers rallied for a 9-5 victory over the Boston Red Sox on Friday after raising their American League championship flag. Murphy's slicing liner off Daniel Bard (0-1) kicked up chalk when it landed on the left-field line. That sent Rangers newcomers Mike Napoli and Yorvit Torrealba home to break a 5-all tie. Murphy scored on a double by Elvis Andrus before another double by AL MVP Josh Hamilton. Napoli, Ian Kinsler and Nelson Cruz all homered off Jon Lester for Texas, which played its season opener exactly five months after a Game 5 loss to San Francisco at home ended its first World Series. Darren Oliver (1-0) got the victory after allowing a tying homer to David Ortiz in the eighth. Adrian Gonzalez had two hits and drove in three runs in his Boston debut. Carl Crawford went 0 for 4 with three strikeouts while leaving a runner in scoring position each at-bat. + +# Text 6 + +Context: An Alaska lawmakers introduced an amendment Friday that would give oil companies a tax break provided they pledged to increase production. Alaska Gov. Sean Parnell, a Republican, unveiled plans for + +Keywords: barrels, production, pipeline, companies, investments, oil, tax, message, legislators, strategy, future, amendment, restrictions, companies, tax, increase, percentage, benefit + +OURS + GPT2-774M: An Alaska lawmaker introduced an amendment Friday that would give oil companies a tax break provided they pledged to increase production. Alaska Gov. Sean Parnell, a Republican, unveiled plans for a tax credit for oil companies that increase production. Pipeline companies would benefit from tax breaks as well. The amendment would restrict oil companies from receiving a tax credit if they increase production by more than 10 percent a year for five years and invest more than $1 billion in future projects. The legislation is expected to be introduced in the House and Senate this week. Parnell said the percentage increase would be based on the amount of barrels of oil produced by the company. "This is a great opportunity for us to help the oil industry grow and create jobs," Parnell said. The strategy is expected to be controversial in Alaska, where the oil industry has been a major employer and a major contributor to the state's economy. The state has the nation's third-largest oil reserves and is home to the world's largest crude oil messageboard. + +HUMAN: An Alaska lawmaker introduced an amendment Friday that would give oil companies a tax break provided they pledged to increase production. Alaska Gov. Sean Parnell, a Republican, unveiled plans for 1 million barrels of oil production per day through the Trans-Alaska pipeline system within the next decade. Parnell said he was proposing a tax break for oil companies to encourage investments and to erase declines in state oil production. "The time to reduce oil taxes is now and I am asking all Alaskans to send a clear message to legislators in Juneau that a "do-nothing" strategy is unacceptable because Alaska's future is at stake," he said in a statement. But state Rep. Bob Miller, D-Fairbanks, introduced an amendment that would put certain restrictions on oil companies. Under Miller's plan, companies would get a tax break until January 2017. After that, they would need to have increased production by 10 percent of current levels to continue getting a break and increase production by another 2 percent each year beyond 2017. "We want to be sure that they are earning the breaks that we are giving," Miller said in a statement. "This amendment says here's the benefit. If you do not make certain metrics for the benefit of Alaska, we withdraw those benefits." + +# Text 7 + +Context: At a government laboratory in Alabama, workers in blue coats unload envelopes packed with small filters that trapped air particles in Hawaii, Alaska and elsewhere. The discs are placed in + +Keywords: devices, traces, radioactive, materials, ocean, dangerous, workers, disaster, radiation, environmental, administration, federal, consumers, crisis, water + +OURS + GPT2-774M: At a government laboratory in Alabama, workers in blue coats unload envelopes packed with small filters that trapped air particles in Hawaii, Alaska and elsewhere. The discs are placed in a water-filled device called a "federal environmental control and radiation protection system," or $E$ consumers, which traces radioactive material to the ocean floor. The workers put the discs in a machine that separates the dangerous particles from the rest of the water. The process is called "crisis management" and is used to deal with disasters such as the Fukushima nuclear disaster in Japan in 2011. The $E$ consumers are also used to deal with the fallout from the Chernobyl nuclear disaster in 1986 in the Ukraine. The federal government has spent $5 billion on the system since the administration of President George W. Bush signed the U.S. Environmental Protection Agency Reactor Resilience Initiative, a 35-year program that aims to turn the Fukushima Daiichi nuclear plant's reactors into low-carbon and efficient power plants. It has provided $1 billion each year since it was established in the aftermath of the tragedy. If each $E$ consumer is turned on once a year for 40 years, a certain percentage of radioactivity on the Pacific Ocean floor will be removed. This includes particulates in the ocean bottom, as well as radioactive materials such as uranium. It also includes contaminated groundwater. + +HUMAN: At a government laboratory in Alabama, workers in blue coats unload envelopes packed with small filters that trapped air particles in Hawaii, Alaska and elsewhere. The discs are placed in lead-lined, barrellike devices for testing to make sure no traces of radioactive materials have wafted across the Pacific Ocean from Japan. So far, the sea breeze in places such as Honolulu is no more dangerous than the pollen-laden air of the Deep South, according to officials. Still, the 60 or so workers in the 72,000-square-foot building will be the first to know if the Japanese disaster spreads harmful amounts of radiation to the U.S. On Wednesday, the Environmental Protection Agency and the Food and Drug Administration said very low levels of radiation had turned up in a sample of milk from Washington state, but federal officials assured consumers not to worry. The FDA said such findings were to be expected in the coming days because of the nuclear crisis in Japan and that the levels were expected to drop relatively quickly. The EPA said it was increasing the level of nationwide monitoring of milk, precipitation and drinking water. + +# Text 8 + +Context: A 25-year-old German man has been arrested for allegedly burying a cache of bombs near a German soccer stadium in a blackmail plot, authorities say. The unnamed German national was + +Keywords: german, arrested, explosives, garage, stadium, federal, criminal, investigation, bombs, home, embassy, information, blackmail, criminal, terrorist, organizations, safe + +OURS + GPT2-774M: A 25-year-old German man has been arrested for allegedly burying a cache of bombs near a German soccer stadium in a blackmail plot, authorities say. The unnamed German national was arrested in the German city of Leipzig on Monday, federal prosecutors said. Investigators believe the explosives were hidden in a home garage and bombs were hidden in a safe in the garage, according to the Criminal Criminal Information Service. The suspect is suspected of blackmailing a German soccer stadium security guard and threatening to detonate a terrorist attack if he didn't comply with his demands, the prosecutors said. The suspect is also suspected of trying to obtain information about organizations and individuals involved in the soccer stadium security. The suspect is suspected of blackmailing a German soccer stadium security guard and threatening to detonate a terrorist attack if he didn't comply with his demands, the prosecutors said. The suspect is also suspected of trying to obtain information about organizations and individuals involved in the soccer stadium security. Embassy Security Blog discusses the "Security Update". + +HUMAN: A 25-year-old German man has been arrested for allegedly burying a cache of bombs near a German soccer stadium in a blackmail plot, authorities say. The unnamed German national was arrested in Cologne on Tuesday after allegedly placing the explosives in a parking garage near the Westfalenstadion in Dortmund, home of the Borussia Dortmund team, the Federal Office of Criminal Investigation told The Local news agency. The bombs were safely defused, and three more were found at the man's home in Krefeld, officials said. Investigators said they began tracking the man after he emailed the German Embassy in Pakistan, offering information about two planned attacks in Germany by a group. The warning appeared to be a blackmail bid and was worded like an unsolved attempted blackmail case last year. "The suspect apparently acted alone with a general criminal motive," a federal spokesman said. "There are absolutely no ties to terrorist or Islamist organizations." Authorities say he admitted placing the bombs. Dortmund police spokesman Michael Stein told the BBC: "We expect no security threat at all for the upcoming Bundesliga match on Saturday. Visitors are invited to come to Dortmund. They will be safe here." + +# Text 9 + +Context: I'd enjoy reading the citation of constitutional authority for this: "The bill then says if the Senate does not act, then H.R. 1 [the House-passed bill that cuts $61 billion] + +Keywords: senate, shutdown, pay, unconstitutional, prevention, legislation, president, sign, law, senate, compromise, problem, effort, attention, deal, option + +Ours + GPT2-774M: I'd enjoy reading the citation of constitutional authority for this: "The bill then says if the Senate does not act, then H.R. 1 [the House-passed bill that cuts $61 billion] will become law without Senate action. This legislation is unconstitutional because Senate President Pro Tempore (and the signers of the Constitution) have the option of not passing it. This problem does not exist in the House bill. This is the same effort that has been going on for years to get the Senate to act on the shutdown deal, and it has not worked. The compromise that was reached last week was not enough to get the attention of the Senate to act on the bill. So now they are paying the price for not acting prevention of a government shutdown happening, which all sides recognize will happen, eventually. + +HUMAN: I'd enjoy reading the citation of constitutional authority for this: "The bill then says if the Senate does not act, then H.R. 1 [the House-passed bill that cuts $61 billion] will be the law of the land. In addition to that, it says that if all else fails, and the Senate brings about a shutdown, then members should not get their pay." That's House Majority Leader Eric Cantor describing his "Government Shutdown Prevention Act." The problem is, this would be blatantly unconstitutional: The Senate needs to pass the same piece of legislation the House does, and the president needs to either sign it or have his veto overturned. That's how deemed-and-pass worked with the health-care law, for instance: Both the Senate and the House passed the same pieces of legislation, and then the president signed them. But it seems Cantor merely misspoke. I've clarified with both his office and Boehner's office that they believe the Senate and the president would still play their traditional roles. That means deemed-and-pass isn't, as Cantor suggests, an alternative to actually striking a compromise. It's just an effort to message the shutdown that'll happen if a law isn't passed. The problem for Cantor is that by misdescribing how the gambit would work, he's drawing attention to the fact that it can't. At the end of the day, we need an actual deal here. There's no other option. + +# Text 10 + +Context: We tend to think of Seattle in stereotypical ways: earthy, mellow, panoramic, rainy. But it's not all Patagonia and lattes out there, as the news yesterday about the Justice Department's + +Keywords: investigation, police, force, discriminating, yesterday, robbery, suspect, detective, african, native, knife, chief, investigation, justice + +Ours + GPT2-774M: We tend to think of Seattle in stereotypical ways: earthy, mellow, panoramic, rainy. But it's not all Patagonia and lattes out there, as the news yesterday about the Justice Department's investigation of police force in Seattle shows. The Justice Department investigation, which was announced yesterday, is focused on the Chief of Police, who is African American, and the Seattle Police Department, which is Native American. The Seattle Police Department has been under federal investigation for a long time. The Justice Department has suspected that the Seattle Police Department has discriminated against African Americans and other minorities. The detective in charge of the investigation, who is white, is a member of the department's Professional Standards Bureau. The investigation has been going on for a long time. The robbery of a black man in Seattle in the early 1990s was one of the first cases that the Professional Standards Bureau investigated. The detective in charge of the investigation, who is white, was a knife-wielding undercover officer. There have been other violent incidents involving white Seattle police officers and Asian men. + +HUMAN: We tend to think of Seattle in stereotypical ways: earthy, mellow, panoramic, rainy. But it's not all Patagonia and lattes out there, as the news yesterday about the Justice Department's investigation of Seattle police would indicate. The DOJ is looking into a possible pattern of the SPD using excessive force and discriminating against minorities, Justice announced here yesterday. At issue in the federal investigation are several high-profile incidents involving police violence. Last April, a detective was videotaped kicking a Latino robbery suspect and stating that he would beat the "Mexican piss" out of the suspect; In June, an officer was videotaped punching a 17-year-old African American girl who protested the arrest of a friend for jaywalking; and, In August, police shot a Native American woodcarver after he faied to drop his carving knife. Seattle Police Chief John Diaz told the Seattle Times that he welcomes the DOJ investigation and considers it like a "free audit." "We have nothing to hide," he said. "We've been open and transparent with the Department of Justice, which makes for a good working relationship." + +![](images/42952557a963bb78e68ff2f44f85ebd478f20be483decb1823daeedcffd65b2c.jpg) + +![](images/8e1fefe8165f6d9e1d7dad51c3b7a615198bdd767e1d0eb8c14c7395d7a387a4.jpg) + +![](images/bbd6230269c95dc77a70d833c402d386eceedc33170d718c36b2827d9a27ad28.jpg) + +![](images/fc816ea2cf25ea7df1e87a411a6ea93ada1760f8809406bf87fd46945a556308.jpg) + +![](images/05b16ed946d285880f202982a9c7197d6766335c8882c2997982a0b5feaaf1e4.jpg) + +![](images/992feef3c4755c69730171c24cb7c3f88f96f8c24abf0dd70839f231e93978d2.jpg) +Figure 5: Results of the user study with mean scores and standard deviation error bars per text. + +![](images/2e86f2071b73cfb33149156dd76c762e85cf894236c7e569fe6043ba1f196ba3.jpg) + +![](images/9dc91f23259f927c47229567622e27162e3f376d294bbac008211dd21689ab11.jpg) + +![](images/aedd3db9d0d311a9bbc3a1b4010ccc29ba0c462899ef70ef9aa1834c97c5ef89.jpg) + +![](images/ab22d0a0163c8b34e4d3d95e1ee51a88f1a4fd641e063aa610ff5c982d9362ac.jpg) + +# C.3 Detailed Results by News Article + +In Figure 5 we show the results of the user study split by news article. As with the aggregated results, we see that per article the average scores for our method are very similar to the scores for uncontrolled GPT-2. However, there are some noteworthy differences. In particular, in the cases of texts 4 and 5, our method scores much higher than uncontrolled GPT-2 on all four scales. On the other hand uncontrolled GPT-2 performs exceptionally well on text 2, but without meeting the keyword requirements of course. + +Although on average our method lags behind human-written text in all four categories, it performs almost on par for many of the articles, and even produces text of higher perceived quality than the original for the first article. On the other hand our method struggles to match the scores in all categories for text 10 and texts 7 and 8 to a lesser extent. + +There is not much variation across the four categories even in the detailed results. \ No newline at end of file diff --git a/aplugandplaymethodforcontrolledtextgeneration/images.zip b/aplugandplaymethodforcontrolledtextgeneration/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f39e671b5a260e689613182523992e86b86cbd82 --- /dev/null +++ b/aplugandplaymethodforcontrolledtextgeneration/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3ac833fb69728e73e28ca886dd80d2764789d114b19978a841e1d97f6444ef0 +size 340694 diff --git a/aplugandplaymethodforcontrolledtextgeneration/layout.json b/aplugandplaymethodforcontrolledtextgeneration/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..67655c4b2ff2285f9f626b0e21a501e37ac3702a --- /dev/null +++ b/aplugandplaymethodforcontrolledtextgeneration/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc74916eb48cfd5c3e51f0811af0698245963b8373606b3c907ebddeaf0156c7 +size 609502 diff --git a/apretrainingnumericalreasoningmodelforordinalconstrainedquestionansweringonknowledgebase/f5fed6e6-5d8a-40ab-ac02-345f517dc4cd_content_list.json b/apretrainingnumericalreasoningmodelforordinalconstrainedquestionansweringonknowledgebase/f5fed6e6-5d8a-40ab-ac02-345f517dc4cd_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..e0f28f27ea297db4c3ecd05b4d5440b5d7d097d4 --- /dev/null +++ b/apretrainingnumericalreasoningmodelforordinalconstrainedquestionansweringonknowledgebase/f5fed6e6-5d8a-40ab-ac02-345f517dc4cd_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1d8e8867adb6bd336dece81fca56f8ace9273e114bf589de11e01a1c140487a6 +size 75865 diff --git a/apretrainingnumericalreasoningmodelforordinalconstrainedquestionansweringonknowledgebase/f5fed6e6-5d8a-40ab-ac02-345f517dc4cd_model.json b/apretrainingnumericalreasoningmodelforordinalconstrainedquestionansweringonknowledgebase/f5fed6e6-5d8a-40ab-ac02-345f517dc4cd_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b97178b307c436a68cdbe0ec8a25c245233dd593 --- /dev/null +++ b/apretrainingnumericalreasoningmodelforordinalconstrainedquestionansweringonknowledgebase/f5fed6e6-5d8a-40ab-ac02-345f517dc4cd_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ec24cd9b4da55870c7e95468dfd0ed37b58bff5af76e64e75654346cf2c91dc +size 94865 diff --git a/apretrainingnumericalreasoningmodelforordinalconstrainedquestionansweringonknowledgebase/f5fed6e6-5d8a-40ab-ac02-345f517dc4cd_origin.pdf b/apretrainingnumericalreasoningmodelforordinalconstrainedquestionansweringonknowledgebase/f5fed6e6-5d8a-40ab-ac02-345f517dc4cd_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..024cf69c520b53da7b7d9db7fee5884e705a524c --- /dev/null +++ b/apretrainingnumericalreasoningmodelforordinalconstrainedquestionansweringonknowledgebase/f5fed6e6-5d8a-40ab-ac02-345f517dc4cd_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:758a25749d28432770fdba51fd1cc87c94774f6989a48cec40866e71a26be0b9 +size 1149433 diff --git a/apretrainingnumericalreasoningmodelforordinalconstrainedquestionansweringonknowledgebase/full.md b/apretrainingnumericalreasoningmodelforordinalconstrainedquestionansweringonknowledgebase/full.md new file mode 100644 index 0000000000000000000000000000000000000000..bc16a0098774922e58e5c6ada86d6cc1269dc82c --- /dev/null +++ b/apretrainingnumericalreasoningmodelforordinalconstrainedquestionansweringonknowledgebase/full.md @@ -0,0 +1,349 @@ +# A Pretraining Numerical Reasoning Model for Ordinal Constrained Question Answering on Knowledge Base + +Yu Feng $^{1,2}$ , Jing Zhang $^{1,2*}$ , Gaole He $^{2}$ , Wayne Xin Zhao $^{3}$ , Lemao Liu $^{4}$ , Quan Liu $^{2}$ , Cuiping Li $^{1,2}$ , Hong Chen $^{1,2}$ + +1Key Laboratory of Data Engineering and Knowledge Engineering of Ministry of Education + +$^{2}$ School of Information, Renmin University of China + +$^{3}$ Gaoling School of Artificial Intelligence, Renmin University of China $^{4}$ Tencent AI Lab {anniefeng, zhang-jing, hegaole, LICUping, chong}@ruc.edu.cn + +{batmanfly, lemaoliu}@gmail.com + +# Abstract + +Knowledge Base Question Answering (KBQA) is to answer natural language questions posed over knowledge bases (KBs). This paper targets at empowering the IR-based KBQA models with the ability of numerical reasoning for answering ordinal constrained questions. A major challenge is the lack of explicit annotations about numerical properties. To address this challenge, we propose a pretraining numerical reasoning model consisting of NumGNN and NumTransformer, guided by explicit self-supervision signals. The two modules are pretrained to encode the magnitude and ordinal properties of numbers respectively and can serve as model-agnostic plugins for any IR-based KBQA model to enhance its numerical reasoning ability. Extensive experiments on two KBQA benchmarks verify the effectiveness of our method to enhance the numerical reasoning ability for IR-based KBQA models. Our code and datasets are available online1. + +# 1 Introduction + +Knowledge Base Question Answering (KBQA) aims at finding answers from the existing knowledge bases (KBs) such as freebase (Bollacker et al., 2008) and DBPedia (Lehmann et al., 2015) for the given questions expressed in natural language. KBQA has emerged as an important research topic in the last few years (Sun et al., 2018, 2019; Lan and Jiang, 2020; He et al., 2021), as the logically organized entities and relations in KBs can explicitly facilitate the QA process. + +Two mainstream methods including the semantic parsing based (SP-based) models (Berant et al., 2013; Bao et al., 2016; Liang et al., 2017; Lan and Jiang, 2020) and the information retrieval based (IR-based) models (Sun et al., 2018, 2019; Saxena et al., 2020; He et al., 2021) are commonly studied + +to solve KBQA task. The SP-based models heavily rely on the intermediate logic query parsed from the natural language question, which turns out to be the bottleneck of performance improvement (Lan et al., 2021). On the contrary, the IR-based models directly represent and rank the entities in a question-aware subgraph based on their relevance to the question. Such an end-to-end paradigm is easier to train and more fault-tolerant. However, most of the IR-based models focus on the single- or multi-hop relation tasks. To answer the example question "Which is the largest city in China?" in Figure 1, the answer "Beijing" is supposed to encode not only the magnitude of its area but also the ordinal relationship with "largest"—the ordinal determiner in the question. Existing IR-based models are not explicitly aware of the magnitude and ordinal properties of entities, making the entity representations fall short in the ability to support such numerical reasoning. + +In view of the issue, this paper targets at empowering the IR-based KBQA models with the ability of numerical reasoning to address the ordinal constrained questions. Ordinal constraint is summarized as one of the most important constraints via web query analysis (Bao et al., 2016) and ordinal is also defined as the second fundamental measurement to capture data in the forms of surveys2. + +Some efforts have been made on numerical reasoning for machine reading comprehension (MRC) (Yu et al., 2018; Ran et al., 2019; Chen et al., 2020). For example, given a question and a passage from which the answer can be inferred, NumNet (Ran et al., 2019) is an end-to-end model to learn the number embeddings and the non-numerical word embeddings together, which are encoded by graph neural network (GNN) (Kipf and Welling, 2017) and BERT (Devlin et al., 2019) respectively. QDGAT (Chen et al., 2020) further + +wires the numbers and the words in a same graph and encode them together by GNN. However, most of them implicitly infer number embeddings based on the QA pairs without the explicit annotation of the magnitude and ordinal relationships of numbers. Such weak supervision signals bring difficulties to infer accurate number embeddings, which becomes more prominent when the ordinal supervision signals are rarely available in existing KBQA datasets. In fact, the three well-known KBQA benchmarks, MetaQA (Zhang et al., 2018), WebQuestionSP (WebQSP) (Yih et al., 2016) and ComplexWebQueustions (CWQ) (Talmor and Berant, 2018) only contain 0, 101 and 1821 ordinal constrained questions respectively. + +To tackle the above challenge, we propose a pretraining method with additional self-supervision signals to capture two critical ingredients for ordinal constrained KBQA: + +- Relative Magnitude: The relative magnitude between numbers, such as “ $1 \prec 2 \prec 3$ , is to be preserved by number embeddings3. +- Ordinal Relationship: Based on the above relative magnitude, the ordinal relationship between each number and the ordinal determiner (such as "largest" in the question) is to be captured, e.g., 3 in $1 \prec 2 \prec 3$ is identified as the largest number. + +Number embeddings which satisfy the above two ingredients are capable of numerical reasoning for ordinal constrained questions. To obtain such number embeddings, we propose two pretraining modules NumGNN and NumTransformer. The former one pretrains a GNN upon the constructed number graphs by a number-aware triplet loss function to preserve the relative magnitude, and the latter one pretrains a transformer upon the constructed question-aware number graphs by a number prediction loss function to capture ordinal relationships. Compared with the weak supervision signals from QA pairs, such self-supervision signals explicitly denote the numerical properties. + +After pretraining, NumGNN and NumTransformer can be attached as model-agnostic plugins into any IR-based KBQA model to infer number embeddings. By fusing the number embeddings + +into the entity embeddings learned by the basic model, the numerical reasoning ability of the basic model is enhanced. + +Finally, we evaluate our method on two benchmarks of KBQA: WebQSP and CWQ. Experimental results demonstrate that NumGNN plus NumTransformer, serving as plugins of alternative IR-based KBQA models, can achieve substantial and consistent improvement (+2.4 - 14.8% in terms of accuracy) on the ordinal constrained questions. + +# 2 Related Work + +Knowledge Base Question Answering. Methods for the KBQA task can be categorized into two groups: SP-based methods and IR-based methods. A detailed survey of the task can be referred to (Lan et al., 2021; Zhang et al., 2021). SP-based methods (Berant et al., 2013; Berant and Liang, 2014; Yih et al., 2015; Bao et al., 2016; Liang et al., 2017; Lan and Jiang, 2020) learn a semantic parser to convert natural language questions into logic queries, which are able to deal with ordinal constrained questions. However, they heavily rely on intermediate logic queries, which becomes the bottleneck of performance improvement. + +IR-based methods (Bordes et al., 2015; Dong et al., 2015; Miller et al., 2016; Sun et al., 2018, 2019; Saxena et al., 2020; He et al., 2021) directly retrieve answer candidates from the KBs and represent them to encode the semantic relationships with the questions. These methods are more fault-tolerant, but are unable to deal with ordinal constrained questions. This paper aims to enhance the IR-based models for numerical reasoning. + +Numerical Reasoning. Numerical Reasoning has been studied for various tasks such as word embedding (Naik et al., 2019; Wallace et al., 2019), arithmetic word problems (AWP) (Wang et al., 2018; Zhang et al., 2020), and MRC (Yu et al., 2018; Ran et al., 2019; Chen et al., 2020). Word embedding and AWP are a little far from our task. Similar to KBQA, MRC also aims to answer questions, but infers the answers from passages instead of KBs. To enable numerical reasoning, NumNet (Ran et al., 2019) adopts a numerically-aware GNN to encode numbers and QDGAT (Chen et al., 2020) further extends the number graph with additional words. However, they are all end-to-end models weakly supervised by the final answers. This paper studies the explicit supervision signals about numerical + +![](images/909b4fd57adbce453005022e507ff009555117261b51973a4b472decd78c845a.jpg) +Figure 1: The whole reasoning process includes basic reasoning on the relation subgraph $\mathcal{G}_r^q$ and numerical reasoning on the attribute subgraph $\mathcal{G}_a^q$ . For numerical reasoning, we first perform the pretrained NumGNN and NumTransformer to infer value embeddings and then attach them into the entity embeddings learned by the basic reasoning. The final prediction is based on the entity embeddings. + +properties. + +# 3 Method + +In this section, we first introduce the ordinal constrained KBQA. Then the framework of our model is provided, followed by detailed descriptions of its components. + +# 3.1 Problem Definition + +A Knowledge Base $\mathcal{G}$ is the union of a relation graph $\mathcal{G}_r$ and an attribute graph $\mathcal{G}_a$ , where $\mathcal{G}_r = \{(e, r, e')\}$ and $\mathcal{G}_a = \{(e, a, v)\}$ with $e(e')$ , $r$ , $a$ , and $v$ denoting an entity, relation, attribute, and value respectively. Their initial embeddings $\mathbf{e}^{(0)}$ , $\mathbf{r}^{(0)}$ , $\mathbf{v}^{(0)}$ , and $\mathbf{a}^{(0)}$ are encoded by RoBERTa (Liu et al., 2019) based on their names. Attributes are divided into the numeric attributes and non-numeric attributes, where values of the former and the later ones are presented as numbers and texts respectively. + +Ordinal Constrained Question (Bao et al., 2016) denotes that the answers of such question should be selected from a ranked set based on ordinal determiners in the question as ranking criteria. This paper manually defines a list of ordinal determiners: first, last, latest, earliest, largest, biggest, most, least, warmest, tallest, highest, lowest, longest, shortest, according to (Lan and Jiang, 2020). + +Ordinal Constrained KBQA: Given an ordinal constrained question $q$ , and the topic entity $e_q$ present in $q$ , we aim to retrieve the question-aware relation graph $\mathcal{G}_r^q$ and attribute graph $\mathcal{G}_a^q$ from $\mathcal{G}$ + +perform basic reasoning on $\mathcal{G}_r^q$ and numerical reasoning on $\mathcal{G}_a^q$ , and then extract the answer $e_t$ from the two graphs based on the fused entity embeddings in them. + +# 3.2 Overall Framework + +The framework of the proposed model is depicted in Figure 1. The reasoning process consists of basic reasoning on $\mathcal{G}_r^q$ and numerical reasoning on $\mathcal{G}_a^q$ . The former process infers entity embeddings that can encode the semantic relationships between entities and the question, regardless of the numerical properties. Meanwhile, the latter process infers the value embeddings by the pretrained NumGNN and NumTransformer modules, and attaches them into the entity embeddings derived by the basic reasoning module to complement the relative magnitude and ordinal properties of entities. + +# 3.3 Number Pretraining (NumGNN) + +We randomly build a large amount of number graphs from the given KB, upon which we perform GNN reasoning and optimize a number-aware triplet ranking loss to preserve the relative magnitude of numbers. Henceforth, we name a graph full of number nodes as a number graph and denote it as $\mathcal{G}_n$ . + +Number Graph Construction. In a number graph $\mathcal{G}_n$ , the nodes are composed of the values belonging to the same numerical attribute extracted from the given KB, and the edges are directed with each one pointing from a larger number to a smaller number. + +In other words, $v_{i}$ points at $v_{j}$ if $n(v_{i}) > n(v_{j})$ , where $n(v)$ denotes the number corresponding to the node/value $v$ . Unlike the single "greater" edge, NumNet for MRC (Ran et al., 2019) builds both the "greater" and the "lower/equal" edges between nodes. As a result, NumNet needs to additionally incorporate weights to distinguish the effect of different relations during message passing in GNN. Given this, we only keep a single "greater" relation, as it can already distinguish the magnitude of numbers and make the latter GNN model simple. We also prove this by the empirical results shown in Figure 2(c). + +We randomly sample a set of numerical attributes from the whole knowledge base $\mathcal{G}$ and extract the values of the same attributes to construct the number graphs. + +Number Representation. Given a number graph $\mathcal{G}_n$ , we use a GNN model to learn the number embeddings of the nodes by the following steps: + +(1) Node Initialization: Nodes in a number graph $\mathcal{G}_n$ are initialized by the corresponding value embeddings $\{\mathbf{v}^{(0)}\}$ . +(2) Message Passing: As we intend to preserve the relative magnitude between numbers, the role a number plays in reasoning should be affected by the surrounding numbers. Specifically, We propagate messages from each number to its neighbors by the following propagation function: + +$$ +\widetilde {\mathbf {v}} _ {i} ^ {(l - 1)} = \frac {1}{| \mathcal {N} _ {n} (i) |} \left(\sum_ {v _ {j} \in \mathcal {N} _ {n} (i)} \alpha_ {j} \mathrm {M L P} \left(\mathbf {v} _ {j} ^ {(l - 1)}\right)\right), \tag {1} +$$ + +where $\mathbf{v}_j$ is the number embedding of $v_{j}$ and $\mathcal{N}_n(i)$ is the neighbors of $v_{i}$ in $\mathcal{G}_n$ . MLP mentioned in this paper is the abbreviation of multi-layer perceptron. The weight $\alpha_{j}$ is formulated as: + +$$ +\alpha_ {j} = \sigma (\operatorname {M L P} \left(\mathbf {v} _ {j} ^ {(l - 1)}\right)), \tag {2} +$$ + +where $\sigma$ is the sigmoid function. + +(3) Node Representation Update: The information carried by the neighbors is added with the node itself to update its representation: + +$$ +\mathbf {v} _ {i} ^ {(l)} = \operatorname {R e L U} \left(\operatorname {M L P} \left(\mathbf {v} _ {i} ^ {(l - 1)}\right) + \widetilde {\mathbf {v}} _ {i} ^ {(l - 1)}\right). \tag {3} +$$ + +The above steps (2) and (3) are repeated $L$ times, resulting in the number embeddings $\{\mathbf{v}^{(L)}\}$ which preserve the relative magnitude between numbers. To be conveniently referred in the following sections, the entire NumGNN reasoning process (Eq. (1)-(3)) is denoted as a single function: + +$$ +\left\{\mathbf {v} ^ {(L)} \right\} = \operatorname {N u m G N N} \left(\mathcal {G} _ {n}, \left\{\mathbf {v} ^ {(0)} \right\}\right). \tag {4} +$$ + +Loss Function. We perform a number-aware triplet ranking loss for NumGNN optimization. Specifically, from each number graph $\mathcal{G}_n$ , we randomly sample a set of triplets with each consists of three numbers and assume that the small number $v_{s}$ should be closer to the medium one $v_{m}$ than the big one $v_{b}$ . In other words, " $v_{s} \prec v_{m} \prec v_{b}$ " should be satisfied to reflect the relative distance between numbers rather than the absolute magnitude. We minimize the following triplet ranking loss to learn the parameters of NumGNN, i.e., + +$$ +\ell = \sum_ {\left(v _ {s}, v _ {m}, v _ {b}\right) \in \mathcal {T}} \max \left(0, \epsilon + g \left(\mathbf {v} _ {s}, \mathbf {v} _ {m}\right) - g \left(\mathbf {v} _ {s}, \mathbf {v} _ {b}\right)\right), \tag {5} +$$ + +where $g$ is cosine similarity between two numbers, $\mathcal{T}$ is the set of the sampled triplets, and $\epsilon$ is a margin separating $(v_{s}, v_{m})$ and $(v_{s}, v_{b})$ . + +# 3.4 Number Pretraining (NumTransformer) + +Based on the number embeddings output by NumGNN, we need further connect the numbers to the ordinal determiners to learn the ordinal properties of numbers. For example, we aim to make the embedding of 1 in “ $1 \prec 2 \prec 3$ ” closer to the ordinal determiner “smallest” than 2 and 3. To efficiently achieve the goal, we build a set of question-aware number graphs from the ordinal constrained QA pairs, upon which we pretrain NumTransformer and optimize a number prediction loss. Other datasets that can indicate the relationship between ordinal determiners and numbers could also be chosen for pretraining. + +Question-aware Number Graph Construction. For each ordinal constrained question $q$ , we find the most relevant numerical attribute $a_{t}$ of the answer entity $e_{t}$ to $q$ via measuring the cosine similarity between the attribute embeddings $\mathbf{a}^{(0)}$ and the question embedding $\mathbf{q}^{(0)}$ encoded by RoBERTa. Then we retrieve $v_{t}$ in $(e_{t}, a_{t}, v_{t})$ as the ground truth value and sample other values of the same attribute $a_{t}$ as the negative instances. We restrict the negative instances within three-hops of the topic entity $e_{q}$ to avoid destroying the question-specific ordinal relationship. + +We construct a number graph $\mathcal{G}_n$ by the ground truth and the negative values in the same way as Section 3.3. $\mathcal{G}_n$ together with the question $q$ compose a question-aware number graph pair $(q,\mathcal{G}_n)$ + +Number Representation. Given a question-aware number graph pair $(q, \mathcal{G}_n)$ , we apply NumGNN on $\mathcal{G}_n$ by Eq. (4) to output the number embeddings $\{\mathbf{v}^{(L)}\}$ . Then we concatenate them with the word embeddings $\mathbf{h}_q^{(0)}$ in the question $q$ encoded by RoBERTa as the input of a transformer to update the number embeddings, i.e., + +$$ +\{\mathbf {v} ^ {(L ^ {\prime})} \} = \operatorname {T r a n s f o r m e r} (\left[ \mathbf {h} _ {q} ^ {(0)}; \{\mathbf {v} ^ {(L)} \} \right]), \quad (6) +$$ + +where $L^{\prime}$ is the size of the fully-connection layers in Transformer. Thanks to the multi-layer selfattention, the updated number embeddings $\mathbf{v}^{(L^{\prime})}$ has fully interacted with the query words such that they can encode the ordinal semantics, e.g., a "largest" or "smallest" number. + +Loss Function. Since the output number embeddings of NumTransformer are conjectured to encode the ordinal properties, we can predict the ground truth number based on its output embedding, and adopt cross-entropy loss to train NumTransformer. The predictive probability of the ground truth number $v_{t}$ in $\mathcal{G}_n$ is formulated as: + +$$ +p (v _ {t} | q, \mathcal {G} _ {n}) = \frac {\exp \sigma (\mathrm {M L P} (\mathbf {v} _ {t} ^ {(L ^ {\prime}))}}{\sum_ {j} \exp \sigma (\mathrm {M L P} (\mathbf {v} _ {j} ^ {(L ^ {\prime}))}).} \tag {7} +$$ + +# 3.5 Basic Reasoning + +We adopt the subgraph retrieval and reasoning scheme for basic reasoning. + +Relation Subgraph Retrieval. We follow GRAFT-Net (Sun et al., 2018) to extract the neighborhood relation triplets within two hops of the topic entity $e_{q}$ . To reduce the size of the triplets, we also perform the personalized PageRank (Haveli-wala, 2002) to keep the most relevant entities to $q$ . The resultant relation triplets compose the query-relevant relation subgraph $\mathcal{G}_r^q$ . + +Relation Subgraph Reasoning. We perform any subgraph reasoning model such as GRAFT-Net (Sun et al., 2018), EmbedKGQA (Saxena et al., 2020) and NSM (He et al., 2021) on $\mathcal{G}_r^q$ to learn the embeddings for entities in the subgraph. This model is named as BasicReason, i.e., + +$$ +\{\mathbf {e} \} = \operatorname {B a s i c R e a s o n} \left(\mathcal {G} _ {r} ^ {q}, \left\{\mathbf {e} ^ {(0)} \right\}\right), \tag {8} +$$ + +where $\{\mathbf{e}^{(0)}\}$ are the initial entity embeddings. + +Loss Function. The predictive probability of the answer $e_t$ is formulated as: + +$$ +p \left(e _ {t} \mid q, \mathcal {G} _ {r} ^ {q}\right) = \sigma (\operatorname {M L P} \left(\mathbf {e} _ {t}\right)). \tag {9} +$$ + +The cross-entropy loss is optimized on both ordinal and non-ordinal constrained questions. + +# 3.6 Numerical Reasoning + +We first retrieve an attribute subgraph $\mathcal{G}_a^q$ for $q$ , then apply the pretrained NumGNN and NumTransformer (the parameters are frozen) to infer the value embeddings in $\mathcal{G}_a^q$ , which are then attached to entity embeddings in $\mathcal{G}_r^q$ for numerical reasoning. This process can be visualized as Figure 1. + +Attribute Subgraph Retrieval. We extract the numerical attribute triplets for entities in $\mathcal{G}_r^q$ to compose the attribute subgraph $\mathcal{G}_a^q$ . More specifically, from all the numerical attributes of the entities in $\mathcal{G}_r^q$ , we extract the top- $K$ attributes relevant to the question $q$ by measuring the cosine similarity between the attribute embeddings and the question embedding, and add the attribute triplets $\{(h,a,v), h \in \mathcal{G}_r^q\}$ associated with these attributes into $\mathcal{G}_a^q$ . + +Number Embedding Inference. The values in $\mathcal{G}_a^q$ compose multiple number graphs $\{\mathcal{G}_n\}$ . Each $\mathcal{G}_n$ is composed of the values of the same attributes and is built in the same way as Section 3.3. Their value embeddings are updated by the pretrained NumGNN in Eq. (4). Then they are concatenated with the question word embeddings as the input of the pretrained NumTransformer in Eq. (6) to be further updated. + +Number Embedding Plugin. The updated numerical value embeddings $\{\mathbf{v}^{(L^{\prime})}\}$ from $\mathcal{G}_a^q$ can be incorporated into the entity embeddings $\{\mathbf{e}\}$ , which is learned by the basic reasoning module on the relation graph $\mathcal{G}_r^q$ . Specifically, we aggregate the value embeddings by attentions associated with the neighborhood attributes of the $i$ -th entity: + +$$ +\widetilde {\mathbf {e}} _ {i} = \sum_ {j \in \mathcal {N} _ {a} (i)} \alpha_ {j} \operatorname {M L P} \left(\mathbf {a} _ {j}, \mathbf {v} _ {j}\right), \tag {10} +$$ + +$$ +\alpha_ {j} = \operatorname {s o f t m a x} \left(\mathbf {a} _ {j} ^ {T} \mathbf {q}\right), \tag {11} +$$ + +where $\mathcal{N}_a(i)$ is the $i$ -th entity's attribute neighbors. $\mathbf{a}_j$ and $\mathbf{v}_j$ are the attribute embedding and the value embedding of the $j$ -th neighbor respectively. The weight $\alpha_j$ emphasizes the question-relevant values. + +Finally, we concatenate the updated entity embedding $\widetilde{\mathbf{e}}_i$ propagated from $\mathcal{G}_a^q$ with the corresponding entity embedding $\mathbf{e}_i$ in $\mathcal{G}_r^q$ to compose the ordinal-aware entity embedding: + +# Algorithm 1: Training Process + +Input: The KB and QA pairs $\{(q, e_t)\}$ . + +Output: Learned parameters $\theta_{\mathrm{NG}}$ (NumGNN), $\theta_{\mathrm{NT}}$ (NumTransformer), $\theta_{\mathrm{BR}}$ (BasicReason), $\theta_{\mathrm{NR}}$ (NumericalReason), and relation/attribute embeddings $\{\mathbf{r},\mathbf{a}\}$ . + +1 Initialize $\{\mathbf{e},\mathbf{v},\mathbf{r},\mathbf{a},\mathbf{q}\}$ by RoBERTa; /\* Pretrain NumGNN +2 Build the number graphs $\{\mathcal{G}_n\}$ +3 Train $\theta_{\mathrm{NG}}$ by Eq. (5); /* Pretrain NumTransformer +4 Build the query-aware number graph pairs $\{(q, \mathcal{G}_n)\}$ ; +5 Train $\{\theta_{\mathrm{NT}}\}$ by CrossEntropy on Eq. (7); / $\star$ Train Basic Reasoning Module +6 Retrieve a relation graph $\mathcal{G}_r^q$ for each $q$ ; +7 Train $\theta_{\mathrm{BR}}$ and $\mathbf{r}$ by CrossEntropy on Eq. (9) and update $\{\mathbf{e}\}$ ; /* Train Numerical Reasoning Module +8 Retrieve an attribute graph $\mathcal{G}_a^q$ for each $q$ ; +9 Build $\{(q,\mathcal{G}_n)\}$ from $\mathcal{G}_a^q$ +10 Apply NumGNN and NumTransformer to update $\{\mathbf{v}\}$ ; +11 Attach $\mathbf{v}$ into corresponding e; +12 Train $\theta_{\mathrm{BR}}$ , $\theta_{\mathrm{NR}}$ , $\{\mathbf{r}\}$ , and $\{\mathbf{a}\}$ by CrossEntropy on Eq. (9) and Eq. (13) jointly. + +$$ +\mathbf {e} _ {i} ^ {f} = \operatorname {M L P} \left(\left[ \mathbf {e} _ {i}; \widetilde {\mathbf {e}} _ {i} \right]\right). \tag {12} +$$ + +Note $\widetilde{\mathbf{e}}_i$ is set to 0 if the $i$ -th entity does not have numerical attributes. + +Loss Function. The predictive probability of the answer $e_t$ is formulated as: + +$$ +p \left(e _ {t} \mid q, \mathcal {G} _ {r} ^ {q}, \mathcal {G} _ {a} ^ {q}\right) = \sigma \left(\operatorname {M L P} \left(\mathbf {e} _ {t} ^ {f}\right)\right). \tag {13} +$$ + +The cross-entropy loss is optimized on the ordinal constrained questions. + +# 3.7 Training & Prediction + +The training process is presented in Algorithm 1. $\theta_{\mathrm{NG}}$ of NumGNN, $\theta_{\mathrm{NT}}$ of NumTransformer, $\theta_{\mathrm{BR}}$ of the basic reasoning module, $\theta_{\mathrm{NR}}$ of the numerical reasoning module, as well as the relation embeddings $\{\mathbf{r}\}$ and the attribute embeddings $\{\mathbf{a}\}$ are parameters to be optimized. Note the parameters in Eq. (8) for embedding entities are shared between $\theta_{\mathrm{BR}}$ and $\theta_{\mathrm{NR}}$ . The parameters in Eq. (9) for basic predicting and those from Eq. (10)-(13) for numerical predicting are separated. + +For each question $q$ , we retrieve the relation subgraph $\mathcal{G}_r^q$ and the attribute subgraph $\mathcal{G}_a^q$ , predict the probability of each entity candidate in $\mathcal{G}_r^q$ by Eq. (13) if the question is ordinal constrained or by Eq. (9) otherwise. + +# 4 Experiments + +# 4.1 Experimental Setting + +Dataset. We evaluate the proposed method on two KBQA benchmarks: WebQuestionSP (WebQSP) (Yih et al., 2016) and Complex WebQuestion 1.1 (CWQ) (Talmor and Berant, 2018). Table 1 shows the statistics of the original datasets and the retrieved subgraphs. + +Evaluation Metrics. We follow GRAFT-Net to rank candidate entities4 for each question by their predictive probabilities and then evaluate Hits@1 to reflect the accuracy of the top-1 prediction. + +Baselines. We compare with three IR-based KBQA models: GRAFT-Net (Sun et al., 2018), EmbedKGQA (Saxena et al., 2020) and NSM (He et al., 2021). Compared with the Vanilla GNN, GRAFT-Net and NSM incorporate questions into graph convolution. EmbedKGQA directly optimizes the triplet of (topic entity, question, answer) based on their direct embeddings. PullNet (Sun et al., 2019)—the advanced GRAFT-Net—is not evaluated due to the unreleased code. + +Implementation Details. We construct a train-valid/test set of 10000/3000/4000 number graphs for NumGNN pretraining and a train-valid/test set of 500/60/80 question-aware number graphs for NumTransformer pretraining. Dataset of this scale is capable of capturing the ordinal relationships since the initial question word embeddings and the number embeddings have already been pretrained. The scale of a number graph in both NumGNN and NumTransformer is controlled within 2 to 150 nodes to balance the efficiency and the effectiveness. We unify the units of the same attribute and only compare the numbers belonging the same attribute. We extract top- $K$ ( $K = 3$ ) attributes relevant to $q$ to build the attribute subgraph. + +We run experiments on single Tesla V100 GPU with 32GB memory. Both number pretraining processes can be finished in 20 minutes. Take NSM as example, with our plugins, it takes around 850/76 seconds an epoch to train model on CWQ/WebQSP dataset. All the models are trained on the training set, selected on the validation set, and evaluated on the test set. Due to the scarce ordinal labels on the validation set of WebQSP (only 4 ordinal con + +Table 1: Data statistics. #All/Ordinal QA pairs for training, validating and testing are presented. $|\mathcal{G}_r^q|$ and $|\mathcal{G}_a^q|$ are the average number of nodes in the retrieved relation subgraph $\mathcal{G}_r^q$ and attribute subgraph $\mathcal{G}_a^q$ respectively. Coverage and coverage(O) are the coverage rate of the answers by the subgraphs over all/ordinal QA pairs respectively. + +
DatasetTrainValidationTest|Gqr||Gqa|CoverageCoverage(O)
WebQSP2848/58250/41639/394323691.6%97.4%
CWQ27639/14353519/1893531/1976105272.3%84.3%
+ +Table 2: Overall performance of different methods on (all) the test instances and the (ordinal) constrained test instances (Hits@1 by %). +Num denotes the basic model is attached with the numerical reasoning module. + +
ModelWebQSPCWQ
AllOrdinalAllOrdinal
GRAFT-Net66.428.436.819.3
GRAFT-Net+Num67.443.237.325.9
EmbedKGQA46.035.432.020.0
EmbedKGQA+Num47.645.432.022.4
NSM68.533.346.324.4
NSM+Num68.638.547.428.4
+ +strained questions), model selection is performed on WebQSP's training set instead. For GRAFT-Net, the embedding dimension is set as 200 on CWQ and 100 on WebQSP. On both datasets, the embedding dimension is set as 200 for EmbedKGQA and 50 for NSM. The default layer size $L$ of NumGNN and $L'$ of NumTransformer are both set as 2. The head size of attentions in NumTransformer is set as 8 if the embedding dimension is 200 and 5 if the embedding dimension is 50 or 100. The margin $\epsilon$ for the triplet ranking loss in NumGNN is set as 0.5. The learning rate is $1 * 10^{-4}$ . The NumGNN is pretrained 5 epochs with batch size as 512. The NumTransformer is pretrained 15-20 epochs with batch size as 10. All the basic reasoning models adopt the same settings as the original papers. The numerical reasoning model is trained 50 epochs with the same batch size as the corresponding basic reasoning model. + +# 4.2 Overall Performance + +Table 2 presents Hits@1 of all the compared methods. The results show that any basic IR-based model, attached with the proposed numerical reasoning module, can obtain improved performance on both the whole test set and the specific ordinal constrained test set. This indicates that the proposed model can indeed capture the ordinal relationships of entities. The basic reasoning mod + +Table 3: Ablation study of the pre-trained NumGNN and NumTransformer (Hits@1 by %). +NumGNN: only NumGNN is attached; +Num: both NumGNN and NumTransformer are attached; (Pre-trained): the attachment is pre-trained. + +
WebQSPCWQ
AllOrdinalAllOrdinal
GRAFT-Net66.428.436.819.3
+ NumGNN66.432.736.921.6
+ NumGNN (Pre-trained)66.537.836.922.3
+ Num66.433.736.820.8
+ Num (Pre-trained)67.443.237.325.9
+ +els ignore the numerical attributes and values of entities, which apparently underperform the corresponding number-enhanced models. + +The performance improvement on WebQSP is more significant than that on CWQ, as the questions on CWQ are more complex, which results in many mistaken reasoned entities, based on which the ordinal constraints are hard to be satisfied. + +# 4.3 Ablation Study + +We perform the below model variants on GRAFT-Net to investigate the effect of different components: + ++NumGNN: with non-pretrained NumGNN, meaning that NumGNN from scratch is trained end-to-end with numerical reasoning. ++NumGNN (Pretrained): NumGNN is first pretrained and then frozen with numerical reasoning. ++Num: with non-pretrained NumGNN plus the non-pretrained NumTransformer. ++Num (Pretrained): with pretrained NumGNN and pretrained NumTransformer. + +The results in Table 3 reflect 1) the effectiveness of both NumGNN and NumTransformer; 2) the positive guidance of the pretraining loss function for NumGNN and NumTransformer; 3) the inadequacy of the end-to-end QA supervision signals for NumGNN and NumTransformer. + +![](images/f07008f1ad67d98341e7ffeb72ffbc94d176ac95edd83414eed83a8e415d69cd.jpg) +(a) Layer $L$ of NumGNN + +![](images/a1f19882c9de130304c794b9e49b9a274232722f2bfd9263edfb2fb62bb83e7e.jpg) +Figure 2: Direct and final evaluations of (a) NumGNN or (b) NumTransformer with different layers; (c) Direct and final evaluations of NumGNN with different relation types. + +![](images/dc8fd36004abad234df3a553b3b50dff562ab9f5c4cfd7866d0772de506d1e95.jpg) +(b) Layer $L^{\prime}$ of NumTransformer +(c) Relation Type of NumGNN + +# 4.4 Parameter and Embedding Analysis + +NumGNN Layer Size $L$ . Figure 2(a) presents the direct performance of the pre-trained NumGNN and the final ordinal constrained QA performance with various NumGNN layers. To evaluate the direct performance, we build a set of number graphs from the given KB in the same way as Section 3.3, and evaluate whether NumGNN can explicitly preserve the relative magnitude between the largest and the smallest numbers in each graph. Specifically, we reduce the number embeddings into 1-dimensional scores, calculate the sign of score difference of the two numbers and compare it with the original sign, and finally evaluate the accuracy. Considering both the direct accuracy and the final QA performance, the 2-layer NumGNN performs the best. Because 1-layer is too shallow to distinguish the number magnitude, while 3-layer over-smooths the number embeddings. + +NumTransformer Layer Size $L^{\prime}$ . Figure 2(b) presents the direct performance of NumTransformer and the final ordinal constrained QA performance with various NumTransformer layers. We evaluate the ability of predicting the right number corresponding to the ordinal determiner of the questions in the same way as Section 3.4. Considering both the direct and final evaluations, 2-layer NumTransformer performs the best, which is consistent with the layer selection of NumGNN. Due to the small amount of training data for NumTransformer, the model is sensitive to $L^{\prime}$ . If the number of $L^{\prime}$ is large, there will be too many parameters in the model and will lead to overfitting. While if the number of $L^{\prime}$ is small, the parameters are not enough to capture the features of the training data and will cause underfitting. + +NumGNN Graph Relation Type. We study whether the single "greater" relation in number graphs is enough to learn the numerical properties, compared with the multi-typed relations (including "greater", "equal" and "lower" types) defined by NumNet. We perform both the direct and final QA evaluations for the single-typed and multi-typed relations. The results in Figure 2(c) show that the direct performances are almost the same but the single-typed setting outperforms the multi-typed setting in terms of Hits@1 of the final ordinal QA. Moreover, considering that the multi-typed setting demands additional weights during graph convolution to distinguish the types' effect, the single-typed relation is a better choice in our model. + +Number Embeddings. We visualize the reduced 1-dimensional scores of number embeddings in an example number graph in Figure 3. We can see that the relative magnitude between almost all the numbers can be maintained. Since the scores can only reflect the relative distance rather than the absolute magnitude, the absolute sort may be kept or reversed. In fact, more than $95\%$ number graphs in our datasets can keep the relative magnitude between the largest and the smallest numbers, more than $35\%$ can keep all the numbers' relative magnitude, which indicates NumGNN's capacity of encoding the relative magnitude. + +# 5 Conclusion + +The paper proposes a pretraining numerical reasoning model for ordinal constrained KBQA. Via pretraining by explicit supervision signals, NumGNN and NumTransformer are capable of capturing the magnitude and ordinal properties of numbers. By attaching them as plugins into any IR-based KBQA model, the numerical reasoning ability of the model + +# Original numbers + +
20011030 < 20031202 < 20050000 < 20050610 < 20061017 < 20130711 < 20131023
0.1432 < 0.1265 < 0.1137 < 0.0979 < -0.0458 < -0.2542 < -0.2150
+ +Reduced 1-dimensional scores of the number embeddings + +Figure 3: A case study of the number embeddings output by NumGNN. The upper and the lower bar present relative magnitude between the original numbers and between the reduced 1-dimensional scores respectively. + +can be enhanced. The experimental results on two benchmarks verify the effectiveness of our model. Other types of constraints, such as multiple topic entities, type and aggregation constraints, are to be explored in the future. + +# Acknowledgments + +This work is supported by National Natural Science Foundation of China (62076245, 62072460, 62172424); National Key Research & Develop Plan(2018YFB1004401); Beijing Natural Science Foundation (4212022); CCF-Tencent Open Fund. + +# References + +Junwei Bao, Nan Duan, Zhao Yan, Ming Zhou, and Tiejun Zhao. 2016. Constraint-based question answering with knowledge graph. In Proceedings of COLING 2016, the 26th International Conference on Computational Linguistics: Technical Papers, pages 2503-2514. +Jonathan Berant, Andrew Chou, Roy Frostig, and Percy Liang. 2013. Semantic parsing on Freebase from question-answer pairs. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 1533-1544. +Jonathan Berant and Percy Liang. 2014. Semantic parsing via paraphrasing. In Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics, pages 1415-1425. +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 international conference on Management of data, pages 1247-1250. +Antoine Bordes, Nicolas Usunier, Sumit Chopra, and Jason Weston. 2015. Large-scale simple question answering with memory networks. +Kunlong Chen, Weidi Xu, Xingyi Cheng, Zou Xiaochuan, Yuyu Zhang, Le Song, Taifeng Wang, Yuan Qi, and Wei Chu. 2020. Question directed graph attention network for numerical reasoning + +over text. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, pages 6759-6768. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 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, pages 4171-4186. +Li Dong, Furu Wei, Ming Zhou, and Ke Xu. 2015. Question answering over Freebase with multicolumn convolutional neural networks. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing, pages 260-269. +Taher H. Haveliwala. 2002. Topic-sensitive pagerank. In Proceedings of the 11th International Conference on World Wide Web, page 517-526. +Gaole He, Yunshi Lan, Jing Jiang, Wayne Xin Zhao, and Ji-Rong Wen. 2021. Improving multi-hop knowledge base question answering by learning intermediate supervision signals. Proceedings of the 14th ACM International Conference on Web Search and Data Mining. +Thomas N. Kipf and Max Welling. 2017. Semi-supervised classification with graph convolutional networks. In 5th International Conference on Learning Representations. +Yunshi Lan, Gaole He, Jing Jiang, Jinhao Jiang, Wayne Xin Zhao, and Ji-Rong Wen. 2021. A survey on complex knowledge base question answering: Methods, challenges and solutions. In Proceedings of the 30th International Joint Conference on Artificial Intelligence. +Yunshi Lan and Jing Jiang. 2020. Query graph generation for answering multi-hop complex questions from knowledge bases. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 969-974. +Jens Lehmann, Robert Isele, Max Jakob, Anja Jentzsch, Dimitris Kontokostas, Pablo N Mendes, Sebastian Hellmann, Mohamed Morsey, Patrick Van Kleef, Soren Auer, et al. 2015. Dbumedia-a large-scale, multilingual knowledge base extracted from wikipedia. Semantic web, 6(2):167-195. +Chen Liang, Jonathan Berant, Quoc Le, Kenneth D. Forbus, and Ni Lao. 2017. Neural symbolic machines: Learning semantic parsers on Freebase with weak supervision. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics, pages 23-33. +Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019. + +Roberta: A robustly optimized BERT pretraining approach. +Alexander Miller, Adam Fisch, Jesse Dodge, Amir-Hossein Karimi, Antoine Bordes, and Jason Weston. 2016. Key-value memory networks for directly reading documents. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 1400-1409. +Aakanksha Naik, Abhilasha Ravichander, Carolyn Rose, and Eduard Hovy. 2019. Exploring numeracy in word embeddings. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3374-3380. +Qiu Ran, Yankai Lin, Peng Li, Jie Zhou, and Zhiyuan Liu. 2019. NumNet: Machine reading comprehension with numerical reasoning. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 2474-2484, Hong Kong, China. Association for Computational Linguistics. +Apoory Saxena, Aditay Tripathi, and Partha Talukdar. 2020. Improving multi-hop question answering over knowledge graphs using knowledge base embeddings. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4498-4507. +Haitian Sun, Bhuwan Dhingra, Manzil Zaheer, Kathryn Mazaitis, Ruslan Salakhutdinov, and William Cohen. 2018. Open domain question answering using early fusion of knowledge bases and text. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 4231-4242. +Haitian Sun, Tania Bedrax Weiss, and William W. Cohen. 2019. Pullnet: Open domain question answering with iterative retrieval on knowledge bases and text. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing, pages 2380-2390. +Alon Talmor and Jonathan Berant. 2018. The web as a knowledge-base for answering complex questions. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 641-651. +Eric Wallace, Yizhong Wang, Sujian Li, Sameer Singh, and Matt Gardner. 2019. Do NLP models know numbers? probing numeracy in embeddings. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing, pages 5306-5314. +Lei Wang, Yan Wang, Deng Cai, Dongxiang Zhang, and Xiaojiang Liu. 2018. Translating a math word problem to a expression tree. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1064-1069. + +Wen-tau Yih, Ming-Wei Chang, Xiaodong He, and Jianfeng Gao. 2015. Semantic parsing via staged query graph generation: Question answering with knowledge base. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing, pages 1321-1331. +Wen-tau Yih, Matthew Richardson, Chris Meek, Ming-Wei Chang, and Jina Suh. 2016. The value of semantic parse labeling for knowledge base question answering. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, pages 201-206. +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 6th International Conference on Learning Representations. +Jing Zhang, Bo Chen, Lingxi Zhang, Xirui Ke, and Haipeng Ding. 2021. Neural, symbolic and neural-symbolic reasoning on knowledge graphs. AI Open, 2:14-35. +Jipeng Zhang, Lei Wang, Roy Ka-Wei Lee, Yi Bin, Yan Wang, Jie Shao, and Ee-Peng Lim. 2020. Graph-to-tree learning for solving math word problems. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 3928-3937. +Yuyu Zhang, Hanjun Dai, Zornitsa Kozareva, Alexander J. Smola, and Le Song. 2018. Variational reasoning for question answering with knowledge graph. In Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence, pages 6069-6076. \ No newline at end of file diff --git a/apretrainingnumericalreasoningmodelforordinalconstrainedquestionansweringonknowledgebase/images.zip b/apretrainingnumericalreasoningmodelforordinalconstrainedquestionansweringonknowledgebase/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f4172d23c558aebf493b28c69c9523f9204f13c7 --- /dev/null +++ b/apretrainingnumericalreasoningmodelforordinalconstrainedquestionansweringonknowledgebase/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e601a9cc163f50266845f1fe99c2bd532ee12d52270294f20ed627beef4fd18 +size 314942 diff --git a/apretrainingnumericalreasoningmodelforordinalconstrainedquestionansweringonknowledgebase/layout.json b/apretrainingnumericalreasoningmodelforordinalconstrainedquestionansweringonknowledgebase/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..f7d76f6f7dd15a3edb50e0e10503f3297adc554a --- /dev/null +++ b/apretrainingnumericalreasoningmodelforordinalconstrainedquestionansweringonknowledgebase/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85a0af065ee2879fa0ec58c9c4c6259ac32581aa83180e347f63d294425106e0 +size 476058 diff --git a/arabictransformerefficientlargearabiclanguagemodelwithfunneltransformerandelectraobjective/58347792-2fa2-44be-94a4-ec64712afa2e_content_list.json b/arabictransformerefficientlargearabiclanguagemodelwithfunneltransformerandelectraobjective/58347792-2fa2-44be-94a4-ec64712afa2e_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..aba272be8c6fea46ba3d79bbb9987f973ba0d0a1 --- /dev/null +++ b/arabictransformerefficientlargearabiclanguagemodelwithfunneltransformerandelectraobjective/58347792-2fa2-44be-94a4-ec64712afa2e_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8ef64df2bda87f08c560ceaaff70054384e4f2445b97d6c98c1a43e76c4fc382 +size 46327 diff --git a/arabictransformerefficientlargearabiclanguagemodelwithfunneltransformerandelectraobjective/58347792-2fa2-44be-94a4-ec64712afa2e_model.json b/arabictransformerefficientlargearabiclanguagemodelwithfunneltransformerandelectraobjective/58347792-2fa2-44be-94a4-ec64712afa2e_model.json new file mode 100644 index 0000000000000000000000000000000000000000..2a5a06721f2f704a86c686f8931a772d9665e73f --- /dev/null +++ b/arabictransformerefficientlargearabiclanguagemodelwithfunneltransformerandelectraobjective/58347792-2fa2-44be-94a4-ec64712afa2e_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca1625e87472253e12f571f80f6131eb2534c7c2f217e5784ae2f0c2c488868d +size 57671 diff --git a/arabictransformerefficientlargearabiclanguagemodelwithfunneltransformerandelectraobjective/58347792-2fa2-44be-94a4-ec64712afa2e_origin.pdf b/arabictransformerefficientlargearabiclanguagemodelwithfunneltransformerandelectraobjective/58347792-2fa2-44be-94a4-ec64712afa2e_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f9822f17f598a4b8e20e7af89196b59cb0127476 --- /dev/null +++ b/arabictransformerefficientlargearabiclanguagemodelwithfunneltransformerandelectraobjective/58347792-2fa2-44be-94a4-ec64712afa2e_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cfd5148a91d24b8c7764e749b288487f91427f51515b5ab4c1d5fd3c4c6870d9 +size 179830 diff --git a/arabictransformerefficientlargearabiclanguagemodelwithfunneltransformerandelectraobjective/full.md b/arabictransformerefficientlargearabiclanguagemodelwithfunneltransformerandelectraobjective/full.md new file mode 100644 index 0000000000000000000000000000000000000000..eb420df02116a19d890accd748215eab947dd07e --- /dev/null +++ b/arabictransformerefficientlargearabiclanguagemodelwithfunneltransformerandelectraobjective/full.md @@ -0,0 +1,194 @@ +# ArabicTransformer: Efficient Large Arabic Language Model with Funnel Transformer and ELECTRA Objective + +Sultan Alrowili + +University of Delaware + +Newark, Delaware, USA + +alrowili@udel.edu + +K. Vijay-Shanker + +University of Delaware + +Newark, Delaware, USA + +vijay@udel.edu + +# Abstract + +Pre-training Transformer-based models such as BERT and ELECTRA on a collection of Arabic corpora, demonstrated by both AraBERT and AraELECTRA, shows an impressive result on downstream tasks. However, pre-training Transformer-based language models is computationally expensive, especially for large-scale models. Recently, Funnel Transformer has addressed the sequential redundancy inside Transformer architecture by compressing the sequence of hidden states, leading to a significant reduction in the pretraining cost. This paper empirically studies the performance and efficiency of building an Arabic language model with Funnel Transformer and ELECTRA objective. We find that our model achieves state-of-the-art results on several Arabic downstream tasks despite using less computational resources compared to other BERT-based models. + +# 1 Introduction + +The introduction of Transformer and attention mechanism (Vaswani et al., 2017) have achieved significant success by exploiting transfer learning. Bidirectional Encoder Representations from Transformers BERT (Devlin et al., 2019), builds upon the idea of pre-training a Transformer with self-attention on large amounts of unlabeled text. Then, leverage the idea of transfer learning to fine-tune the pre-trained language model on downstream tasks. BERT has achieved impressive performance gains against its predecessor Bi-LSTM (Huang et al., 2015) on many downstream tasks. In the Arabic domain, both AraBERT (Antoun et al., 2020) and AraELECTRA (Antoun et al., 2021) have adapted BERT and ELECTRA (Clark et al., 2020b) models to the Arabic language and show impressive results on downstream tasks. + +However, pre-training Transformer-based models, especially at a large scale, requires enormous computational resources. This issue motivates us + +to investigate a solution to reduce the cost of pretraining Transformer-based models. Reducing the cost to train Arabic language models will help accelerate research advancement in Arabic language processing. Additionally, this will help researchers with limited resources to fine-tune large models. + +Several techniques in the literature have suggested solutions to reduce the cost of pre-training and fine-tuning, including cross-layer parameter sharing with ALBERT (Lan et al., 2020) and distillation (Sanh et al., 2020). Distillation and similar techniques have a detrimental effect on performance since they aim to reduce the parameter size. On the other hand, the fine-tuning and inference time for the ALBERT model, especially for $\mathrm{ALBERT}_{\mathrm{xlarge}}$ and $\mathrm{ALBERT}_{\mathrm{xxlarge}}$ scale is significantly higher than $\mathrm{BERT}_{\mathrm{Large}}$ and $\mathrm{ELECTRA}_{\mathrm{Large}}$ as a result of having more hidden layer size. Thus, we seek alternative architectures that could increase the scale of the model without adding additional cost to the pre-training. + +Funnel Transformer (Dai et al., 2020) introduces a novel solution to address the cost of pre-training by reconstructing the Transformer architecture using pooling and up-sampling techniques. Additionally, ELECTRA speeds up the pre-training by introducing a new objective function, employing a small generator model trained with maximum likelihood. This study investigates the effect of pretraining Funnel Transformer with ELECTRA objective on the performance of Arabic downstream tasks. Our results show that we achieve state-of-the-art results with less computational resources than existing Arabic language models described in the literature. Thus, our contributions in this paper include : + +- We pretrain ArabicTransformer on a large collection of unlabeled Arabic corpora with Funnel Transformer and ELECTRA objective that requires significantly less time and resources than state-of-the-art models. + +![](images/136c29b1bd110194639e368c043588dc6c9aebb07cf737c243c54fa4b4292e6e.jpg) +Figure 1: Overview of Funnel Transformer Architecture. Figure adapted from (Dai et al., 2020). + +- We fine-tune and evaluate our model on a suite of Arabic downstream tasks, including question answering and sentiment analysis tasks showing that we achieve state-of-the-art performance on several downstream tasks. +- We released our models to the research community along with our GitHub repository ${}^{1}$ . + +# 2 Related Work + +# 2.1 ELECTRA + +The loss function inside the BERT model consists of semi-supervised learning objectives that aim to capture the contextual representation of an unstructured unlabeled dataset. This loss function in BERT has two objectives: Masked Language Model MLM and Next Sentence Prediction NSP. Several studies have investigated the effect of those two objectives on language model perplexity (Liu et al., 2019), (Lan et al., 2020). ELECTRA (Clark et al., 2020b), reconstructed the BERT model's loss function based on game theory concepts, particularly the GAN (Goodfellow et al., 2014) and MaskGAN (Fedus et al., 2018) models. In ELECTRA, the loss function is formed as a zero-sum game where the goal of the discriminator and generator is to reach the Nash equilibrium point. This point represents the convergence of the language model to the optimal solution. As a result of having a binary loss function, the ELECTRA model's learning curve is higher than the MLM objective. + +# 2.2 Funnel Transformer + +The ELECTRA paper only introduces novelty to the loss function without significant changes to the Transformer architecture. The major problem with Transformer architecture is the sequential redundancy within its structure. This re Dun + +dancy adds additional pre-training cost to the language model. Funnel Transformer reconstructed the Transformer's architecture to address the redundancy issue. + +The key idea is to use a pooling technique to compress the full sequence of hidden states in the encoder part through a series of blocks. Then recover the full sequence representation in the decoder part using an up-sampling technique. A common configuration for the block layout, as shown by (Dai et al., 2020) consists of 3 blocks and a hidden layer size of 768 for base-scale models. For example, an architecture with B6-6-6 design has three blocks where each has 6 layers of a hidden size of 768. A model with a B4-4-4 design consists of three blocks where each has 4 layers of hidden size of 768. Figure 1 shows a high-level illustration of Funnel Transformer architecture. + +Funnel Transformer with this novel design managed to save more FLOPs. The saved FLOPs can be used either to increase the model parameters or to speed up the pre-training process (Dai et al., 2020). Results of Funnel Transformer on English domain show significant performance leap, especially at base scale. These results motivate us to investigate the cost and efficiency of pre-training Funnel Transformer in the Arabic domain. + +# 3 Pre-Training the Language Model + +# 3.1 Dataset + +We pretrain our models using a collection of large Arabic corpora (45GB) including : + +Arabic Wikipedia dump 1.3GB . +Abu El-Khair corpus 14GB (El-khair, 2016). +- Unshuffled Arabic Oscar dataset 30GB (Ortiz Suárez et al., 2020). + +
SettingsAraELECTRAArabicTransformerAraBERTL
Model-ScaleBaseB4-4-4B6-6-6Large
Hidden Layer Size7687687681024
Vocabulary Size64K50K50K64K
Corpora Size77GB45GB45GB77GB
Pre-SegmentationNoNoNoYes (v2) - No (v02)
Learning Rate2e-41e-44e-4-
Max Sequence Length512512512128-512
Batch Size256256102413440-2056
Steps2M1M250k550K
Computational Ratio1.0x0.5x0.5x7.8x
Pre-Training HardwareTPUv3-8TPUv3-8TPUv3-32TPUv3-128
+ +# 3.2 Environmental Setup + +We pretrain our models using the google cloud compute engine and TensorFlow units (TPUs). We use TensorFlow 1.15 (Abadi et al., 2015) and the open-source code of Funnel Transformer. + +# 3.3 Pre-Training Hyperparameters + +Table 1 provides our choice of pre-training hyperparameters for our models against both AraELECTRA (Antoun et al., 2021) and AraBERT (Antoun et al., 2020). We build our base model with a structure that consists of a 6-6-6 block layout and 768 hidden layer size. This block layout increases the model parameters up to $1.39\mathrm{x}$ compared to $\mathrm{BERT}_{\mathrm{Base}}$ and $\mathrm{ELECTRA_{Base}}$ (Dai et al., 2020). Additionally, we pretrain a smaller model with a 4-4-4 block layout. This model has a similar parameter size to $\mathrm{ELECTRA_{base}}$ . + +Instead of using a batch size of 256 as proposed in the original paper of ELECTRA and AraELECTRA, we increase the batch size to 1024 and the learning rate to 4e-4 for our B6-6-6 model. Several studies in the literature support the idea of using large batch size since it improves the language model's perplexity (Liu et al., 2019), (You et al., 2020). On the other hand, we use similar pre-training hyperparameters to (Dai et al., 2020) for our B4-4-4 model. We build our vocabulary file with a size of 50K without using Farasa segmenter (Abdelali et al., 2016). Farasa segmenter is a tool that breaks words into stems, suffixes, and prefixes (Antoun et al., 2020). + +# 4 Fine-tuning on Downstream Tasks + +# 4.1 Question Answering + +To compare our model with existing models in the literature, we use ARCD (Mozannar et al., 2019) and the Arabic portion of TyDi QA (Clark et al., 2020a). Both ARCD and TyDi QA are in format of SQuADv1.1 dataset (Rajpurkar et al., 2016). Similar to the AraELECTRA and AraBERT approach, we fine-tune our model on both ArabicSQuAD and ARCD training datasets. Then, we evaluate our model on the test portion of the ARCD dataset. Moreover, as is a common practice, we use a preprocessing script developed by the AUB MIND lab, which fixes the position of text spans and handles special characters in the ARCD dataset. + +Our baseline models for QA tasks including AraBERTv02large, AraBERTv2large (Antoun et al., 2020), Arabic-ALBERTxlarge (Safaya, 2020) and AraELECTRA. We follow the same split of training and development dataset used by AraELECTRA, summarized in Table 2. We only include models that have reported results in the literature for ARCD and TyDi QA in our baseline models. + +Table 1: The structure and hyperparameters of ArabicTransformer models compared to AraELECTRA and AraBERTL. Computational Ratio (C ratio) represents the training steps multiplied by the batch size where the AraELECTRA model is the baseline. AraBERTL follows a similar approach to (Devlin et al., 2019) by pretraining AraBERTL initially for 250K steps with a maximum sequence length of 128 and batch size of 13440. Then, they continue the pre-training for additional 300K steps with a maximum sequence length of 512 and batch size of 2056. Both AraBERTv2L and AraBERTv02L have similar hyperparameters except the use of pre-segmentation. + +
TaskTrainTest
ARCD Mozannar et al. (2019)49,037702
TyDiQA Clark et al. (2020a)14,805921
+ +Table 2: Summary of Question Answering datasets. + +# 4.2 Sentiment Analysis + +Sentiment analysis (SA) task is a text classification task where we classify each sentence (sequence) with a (sentiment) label. Those labels can be either binary or categorical. Our choice for sentiment analysis task including Hotel Arabic-Reviews Dataset (HARD) (Elnagar et al., 2018), Arabic Jordanian General Tweets (AJGT) (Dahou et al., 2019) and ArScarcasmv2 (sentiment shared task) (Abu Farha et al., 2021). Our baseline models for sentiment analysis tasks including XLM-RBase;XLM-RLarge (Conneau et al., 2020), AraBERTv2Large;AraBERTv02Large (Antoun et al., 2020), AraELECTRA (Antoun et al., 2021), ARBERT and MARBERT (Abdul-Mageed et al., 2021). Table 3 summarize the details of the dataset we use for SA tasks. + +
TaskLabelsTrainTest
HARD[neg, pos]84.5k21.1k
ArSarcasm[neg, neut, pos]12.5k3K
AJGT[neg, pos]1.4k360
+ +# 4.3 Fine-tuning Hyperparameters + +We extensively conduct a grid search to find the best hyperparameters for each task using the TPUv3-8 unit and Tensorflow 1.15. Our grid search space range is : learning rate (2e-5, 3e-5, 4e-5, 5e-5, 6e-5), batch size (16, 24, 32, 40, 48, 64), layerwise decay (0.75, 0.8, 1.0), max sequence length (384, 512) and epochs number (2-12). For sentiment analysis tasks, we use 256 as the maximum sequence length. We report our result as the best result out of five different runs for each task, which is a similar approach used by both ELECTRA (Clark et al., 2020b) and BERT (Devlin et al., 2019). We use the following seeds: 123, 1234, 12345, 666, 42 for each run. We define our choices of seeds to improve the reproducibility of results. + +# 5 Results and Discussion + +# 5.1 Pre-Training + +Table 4 shows the pre-training time of our models against AraELECTRA. The reduction in cost for both B6-6-6 and B4-4-4 models is a result of using a $0.5 \times C$ ratio (batch x steps) compared to AraELECTRA. Additionally, Funnel-transformer architecture contributes to additional reduction from + +Table 3: Summary of sentiment analysis (SA) datasets. (neg: negative, pos:positive, neut: neutral) + +
ModelHardwareTimeCost
AraELECTRATPUv3-824d1.00x
B6-6-6 (Ours)TPUv3-322d 10h0.40x
B4-4-4 (Ours)TPUv3-87d 11h0.31x
+ +Table 4: Pretraining cost of our models compared to AraELECTRA. + +0.5x to 0.4x (B6-6-6) and from 0.5x to 0.31x for (B4-4-4) model. We have also evaluated our pretrained models on a random Arabic sample (2.5M words with a size of 25MB) from CCNet dataset (Wenzek et al., 2020). Our evaluation shows that the B4-4-4 model has a loss score of $11.58\%$ against $11.12\%$ for the B6-6-6 model. + +# 5.2 Question Answering + +Table 5 shows the performance of our models on QA tasks compared to state-of-the-art models reported by (Antoun et al., 2021). + +
ModelTyDiQAARCD
EMF1EMF1
AraBERT02L73.7286.0336.8971.32
AraBERT2L64.4982.1534.1968.12
ArabicALBERTx171.1284.5937.7568.03
AraELECTRAP74.9186.6837.0371.22
Ours B4-4-474.7085.8931.4867.70
Ours B6-6-675.3587.2136.8972.70
+ +Table 5: Evaluation results of ArabicTransformer compared to SOTA models on QA tasks. We use F1 and exact match (EM) score for both tasks which is a common practice to evaluate task in format of SQuAD1.1. We use reported number by (Antoun et al., 2021) for our baseline models results. + +Our base-scale model (B6-6-6) outperforms AraELECTRA on both TyDi QA and ARCD tasks. This performance improvement is due to the fact that B6-6-6 has larger parameter size $(1.39\mathrm{x})$ than ELECTRABase architecture. Furthermore, our small model (B4-4-4) has a competitive performance against AraELECTRA and AraBERTL on the TyDi QA task, especially on the exact match (EM) metric. The discrepancy in performance between ARCD and TyDi QA tasks is due to the poor quality of the training dataset that we use for the ARCD task. This training dataset uses the Arabic Translation of SQuAD1.1 dataset (Antoun et al., 2021). + +# 5.3 Sentiment Analysis + +Table 6 summarizes the performance of Arabic-Transformer against SOTA models on sentiment analysis tasks. In both HARD and ArScarcasm + +
TaskHARDAJGTScarcasm
MetricAcc.Acc.Acc.F1PN
XLM-RB95.789.464.366.1
XLM-RL96.091.967.869.9
AraBERT02L96.494.569.571.8
AraBERT2L96.596.470.072.4
ARBERTB96.194.467.369.5
MARBERTB96.296.169.372.4
AraELECTB96.495.069.672.3
Ours B4-4-496.595.070.472.8
Ours B6-6-696.695.070.874.0
+ +Table 6: Evaluation results of our models compared to SOTA models. $\mathrm{F1}_{\mathrm{PN}}$ score takes only positive and negative classes in calculation excluding neutral class. For HARD and AJGT tasks, we use reported numbers of XLM-R, ARBERT and MARBERT (Abdul-Mageed et al., 2021). For ArScarcasm task we use the reported numbers by Farha and Magdy, 2021). We reproduced AraELECTRA results on all tasks and $\mathrm{AraBERT_L}$ models on HARD and AJGT tasks. + +tasks, our models perform better than other state-of-the-art models, including larger models such as XLM- $\mathbf{R}_{\mathrm{L}}$ and AraBERTv2. However, our models perform worse on the AJGT task. We attribute this performance to the fact that the AJGT task has a relatively smaller dataset than HARD and ArScarcasm. Therefore, it is more sensitive to hyperparameter tuning, leading to a significant performance fluctuation. + +# 5.4 Pre-Segmentation + +AraBERTv2L, in contrast to other models in Table 5 and Table 6, uses Farasa segmenter. Although AraBERTv2L outperforms AraELECTRA on the ArScarcasm task, AraBERTv2L performs worse on QA tasks despite having a 7.5x computational ratio compared to AraELECTRA. The performance of AraELECTRA, AraBERTv02L and our models against AraBERTv2L on the QA task suggests that pre-segmentation do not always lead to better performance on span-based QA tasks. In contrast, pre-segmentation contributes to the performance improvement of AraBERTv2 on sentiment analysis tasks against AraBERTv02, especially on the ArScarcasm task. + +# 5.5 Efficiency of Fine-Tuning + +Table 7 shows the fine-tuning time of our models compared to AraELECTRAbase. In addition to improvement in fine-tuning speed, we also observe that B4-4-4 uses less memory consumption than AraELECTRA. + +
ModelTime / Ratio#Params
AraELECTRAb25:31 (1.00x)1.00x
Ours (B4-4-4)18:27 (0.72x)1.00x
Ours (B6-6-6)27:24 (1.07x)1.39x
+ +Table 7: Fine-Tuning time of our models compared to SOTA models. We finetune all models on HARD dataset for 3 epochs and with a batch size of 32 using V100 16GB Tesla GPU with PyTorch (FP16 - O2). Parameters ratio does not include embedding matrix. + +# 6 Conclusion + +We introduce Arabic Transformer, a pretrained Arabic language representation model based on Funnel Transformer and ELECTRA objective. We show that we achieve state-of-the-art results on several Arabic downstream tasks, including question answering and sentiment analysis tasks. Additionally, we show that our models are computationally efficient and pretrained using significantly less resources than state-of-the-art models. For future work, we plan to investigate different designs of the Funnel Transformer, including larger models such as (B8-8-8). + +# 7 Acknowledgement + +We would like to acknowledge the support we have from Tensorflow Research Cloud (TFRC) team to grant us access to TPUv3 units. The authors also would like to thank anonymous reviewers from EMNLP21 for their constructive feedback on our initial manuscript. + +# References + +Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, 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, Dandelion Mane, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, + +Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. 2015. TensorFlow: Large-scale machine learning on heterogeneous systems. Software available from tensorflow.org. +Ahmed Abdelali, Kareem Darwish, Nadir Durrani, and Hamdy Mubarak. 2016. Farasa: A fast and furious segmenter for Arabic. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Demonstrations, pages 11-16, San Diego, California. Association for Computational Linguistics. +Muhammad Abdul-Mageed, AbdelRahim Elmadany, and El Moatez Billah Nagoudi. 2021. ARBERT & MARBERT: Deep bidirectional transformers for Arabic. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 7088-7105, Online. Association for Computational Linguistics. +Ibrahim Abu Farha, Wajdi Zaghouani, and Walid Magdy. 2021. Overview of the wanlp 2021 shared task on sarcasm and sentiment detection in arabic. In Proceedings of the Sixth Arabic Natural Language Processing Workshop. +Wissam Antoun, Fady Baly, and Hazem Hajj. 2020. AraBERT: Transformer-based model for Arabic language understanding. In Proceedings of the 4th Workshop on Open-Source Arabic Corpora and Processing Tools, with a Shared Task on Offensive Language Detection, pages 9–15, Marseille, France. European Language Resource Association. +Wissam Antoun, Fady Baly, and Hazem Hajj. 2021. AraELECTRA: Pre-training text discriminators for Arabic language understanding. In Proceedings of the Sixth Arabic Natural Language Processing Workshop, pages 191-195, Kyiv, Ukraine (Virtual). Association for Computational Linguistics. +Jonathan H. Clark, Eunsol Choi, Michael Collins, Dan Garrette, Tom Kwiatkowski, Vitaly Nikolaev, and Jennimaria Palomaki. 2020a. TyDi QA: A benchmark for information-seeking question answering in typologically diverse languages. Transactions of the Association for Computational Linguistics, 8:454-470. +Kevin Clark, Minh-Thang Luong, Quoc V. Le, and Christopher D. Manning. 2020b. ELECTRA: Pretraining text encoders as discriminators rather than generators. In ICLR. +Alexis Conneau, Kartikay Khandelwal, Naman Goyal, Vishrav Chaudhary, Guillaume Wenzek, Francisco Guzmán, Edouard Grave, Myle Ott, Luke Zettlemoyer, and Veselin Stoyanov. 2020. Unsupervised cross-lingual representation learning at scale. In + +Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 8440-8451, Online. Association for Computational Linguistics. +Abdelghani Dahou, Mohamed Abd Elaziz, Junwei Zhou, Shengwu Xiong, and Rodolfo Zunino. 2019. Arabic sentiment classification using convolutional neural network and differential evolution algorithm. Intell. Neuroscience, 2019. +Zihang Dai, Guokun Lai, Yiming Yang, and Quoc Le. 2020. Funnel-transformer: Filtering out sequential redundancy for efficient language processing. In Advances in Neural Information Processing Systems, volume 33, pages 4271-4282. Curran Associates, Inc. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 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, Volume 1 (Long and Short Papers), pages 4171-4186, Minneapolis, Minnesota. Association for Computational Linguistics. +Ibrahim Abu El-khair. 2016. 1.5 billion words arabic corpus. +Ashraf Elnagar, Yasmin S. Khalifa, and Anas Einea. 2018. Hotel Arabic-Reviews Dataset Construction for Sentiment Analysis Applications, pages 35-52. Springer International Publishing, Cham. +Abu Farha and Walid Magdy. 2021. Benchmarking transformer-based language models for arabic sentiment and sarcasm detection. In Proceedings of the Sixth Arabic Natural Language Processing Workshop. +William Fedus, Ian Goodfellow, and Andrew M. Dai. 2018. MaskGAN: Better text generation via filling in the . In International Conference on Learning Representations. +Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. 2014. Generative adversarial nets. In Advances in Neural Information Processing Systems, volume 27, pages 2672-2680. Curran Associates, Inc. +Zhiheng Huang, Wei Xu, and Kai Yu. 2015. Bidirectional LSTM-crf models for sequence tagging. +Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, and Radu Soricut. 2020. Albert: A lite bert for self-supervised learning of language representations. In International Conference on Learning Representations. +Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, + +Luke Zettlemoyer, and Veselin Stoyanov. 2019. Roberta: A robustly optimized bert pretraining approach. +Hussein Mozannar, Elie Maamary, Karl El Hajal, and Hazem Hajj. 2019. Neural Arabic question answering. In Proceedings of the Fourth Arabic Natural Language Processing Workshop, pages 108-118, Florence, Italy. Association for Computational Linguistics. +Pedro Javier Ortiz Suárez, Laurent Romary, and Benoit Sagot. 2020. A monolingual approach to contextualized word embeddings for mid-resource languages. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 1703-1714, Online. Association for Computational Linguistics. +Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. SQuAD: 100,000+ questions for machine comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 2383-2392, Austin, Texas. Association for Computational Linguistics. +Ali Safaya. 2020. Arabic-albert. +Victor Sanh, Lysandre Debut, Julien Chaumont, and Thomas Wolf. 2020. Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advances in Neural Information Processing Systems, volume 30, pages 5998-6008. Curran Associates, Inc. +Guillaume Wenzek, Marie-Anne Lachaux, Alexis Conneau, Vishrav Chaudhary, Francisco Guzmán, Armand Joulin, and Edouard Grave. 2020. CCNet: Extracting high quality monolingual datasets from web crawl data. In Proceedings of the 12th Language Resources and Evaluation Conference, pages 4003-4012, Marseille, France. European Language Resources Association. +Yang You, Jing Li, Sashank Reddi, Jonathan Hseu, Sanjiv Kumar, Srinadh Bhojanapalli, Xiaodan Song, James Demmel, Kurt Keutzer, and Cho-Jui Hsieh. 2020. Large batch optimization for deep learning: Training bert in 76 minutes. In International Conference on Learning Representations. \ No newline at end of file diff --git a/arabictransformerefficientlargearabiclanguagemodelwithfunneltransformerandelectraobjective/images.zip b/arabictransformerefficientlargearabiclanguagemodelwithfunneltransformerandelectraobjective/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..96001b7d55fb0739450a2c698450a6dcd2e36a87 --- /dev/null +++ b/arabictransformerefficientlargearabiclanguagemodelwithfunneltransformerandelectraobjective/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe594f8cf49b5b76d2f5984a3799c8dd1b6b75a49a8be1c62224697a929efa9c +size 245918 diff --git a/arabictransformerefficientlargearabiclanguagemodelwithfunneltransformerandelectraobjective/layout.json b/arabictransformerefficientlargearabiclanguagemodelwithfunneltransformerandelectraobjective/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2d02484a2f21a89ab3d7dc05a5ff4024bf41b9e0 --- /dev/null +++ b/arabictransformerefficientlargearabiclanguagemodelwithfunneltransformerandelectraobjective/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6871651062a4a50bec88071478adcd6d08814602ec82b36445fb7fa5c97c95b7 +size 201908 diff --git a/archefficientadversarialregularizedtrainingwithcaching/99dc1bfd-15ea-49a4-ba63-b5c22b0cb8bd_content_list.json b/archefficientadversarialregularizedtrainingwithcaching/99dc1bfd-15ea-49a4-ba63-b5c22b0cb8bd_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..5ba6fe14b2d67667848f5f457e793d6425f6da2d --- /dev/null +++ b/archefficientadversarialregularizedtrainingwithcaching/99dc1bfd-15ea-49a4-ba63-b5c22b0cb8bd_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c895875cec0760d2544e086aa1d83dea611fdb336ca16a0e36bee1d97ad55b02 +size 97362 diff --git a/archefficientadversarialregularizedtrainingwithcaching/99dc1bfd-15ea-49a4-ba63-b5c22b0cb8bd_model.json b/archefficientadversarialregularizedtrainingwithcaching/99dc1bfd-15ea-49a4-ba63-b5c22b0cb8bd_model.json new file mode 100644 index 0000000000000000000000000000000000000000..19b3501e92835ad11a9468309522554bd64a72ca --- /dev/null +++ b/archefficientadversarialregularizedtrainingwithcaching/99dc1bfd-15ea-49a4-ba63-b5c22b0cb8bd_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:414d5e4f982bd7746fdd0232e1c12209a7d169c8ea8363e143b56343164aded6 +size 118795 diff --git a/archefficientadversarialregularizedtrainingwithcaching/99dc1bfd-15ea-49a4-ba63-b5c22b0cb8bd_origin.pdf b/archefficientadversarialregularizedtrainingwithcaching/99dc1bfd-15ea-49a4-ba63-b5c22b0cb8bd_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..dd782c99fa2d61268ffa521339a4479665c2a6f4 --- /dev/null +++ b/archefficientadversarialregularizedtrainingwithcaching/99dc1bfd-15ea-49a4-ba63-b5c22b0cb8bd_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:880d24b8529610761c55181984e13288f982354916eb14b2e4ab8f990a7f4af1 +size 1983180 diff --git a/archefficientadversarialregularizedtrainingwithcaching/full.md b/archefficientadversarialregularizedtrainingwithcaching/full.md new file mode 100644 index 0000000000000000000000000000000000000000..c7ab951a9df5cfd355ad6ddb7f45a674b0e8ba47 --- /dev/null +++ b/archefficientadversarialregularizedtrainingwithcaching/full.md @@ -0,0 +1,425 @@ +# ARCH: Efficient Adversarial Regularized Training with Caching + +Simiao Zuo $^{\dagger}$ , Chen Liang $^{\dagger}$ , Haoming Jiang $^{\square}$ , Pengcheng He $^{\diamond}$ , Xiaodong Liu $^{\diamond}$ , Jianfeng Gao $^{\diamond}$ , Weizhu Chen $^{\diamond}$ and Tuo Zhao $^{\dagger}$ + +$^{\dagger}$ Georgia Institute of Technology $\square$ Amazon $\diamond$ Microsoft + +{simiaozuo,ciang73}@gatech.edu,jhaoming@amazon.com + +{Pengcheng.H, xiaodl, jfgao, wzchen}@microsoft.com, + +tourzhao@gatech.edu + +# Abstract + +Adversarial regularization can improve model generalization in many natural language processing tasks. However, conventional approaches are computationally expensive since they need to generate a perturbation for each sample in each epoch. We propose a new adversarial regularization method ARCH (adversarial regularization with caching), where perturbations are generated and cached once every several epochs. As caching all the perturbations imposes memory usage concerns, we adopt a K-nearest neighbors-based strategy to tackle this issue. The strategy only requires caching a small amount of perturbations, without introducing additional training time. We evaluate our proposed method on a set of neural machine translation and natural language understanding tasks. We observe that ARCH significantly eases the computational burden (saves up to $70\%$ of computational time in comparison with conventional approaches). More surprisingly, by reducing the variance of stochastic gradients, ARCH produces a notably better (in most of the tasks) or comparable model generalization. Our code is publicly available. + +# 1 Introduction + +Adversarial regularization (Miyato et al., 2017) can improve model generalization in many natural language processing tasks, such as neural machine translation (Cheng et al., 2019), natural language understanding (Jiang et al., 2020), language modeling (Wang et al., 2019b), and reading comprehension (Jia and Liang, 2017). Even though the method has demonstrated its power in many scenarios, its computational efficiency remains unsatisfactory. + +Conventional adversarial regularization (Miyato et al., 2017) methods involve a min-max optimization problem. Specifically, a perturbation is + +generated for each sample by solving a maximization problem, and the model parameters are subsequently updated through a minimization problem, subject to the generated perturbations. A popular algorithm (Madry et al., 2018) for such optimization is to alternate between several projected gradient descent steps (PGD, for the maximization) and a gradient descent step (for the minimization). + +There are two drawbacks with the alternating gradient descent/ascent method. First, the procedure requires significant computational efforts. Suppose we run PGD for $S$ steps, then we introduce extra $S$ forward passes and extra $S$ backward passes in each iteration. As such, training with adversarial regularization is significantly slower than standard training. Second, optimizing the min-max problem is hard. This is because the perturbations are model and data dependent, and thus, variance of them is large. That is, the model needs to adapt to drastically different "noisy data" (i.e., clean data with perturbations), such that the stochastic gradients vary significantly during training. Such large variance imposes optimization challenges. + +We propose ARCH (Adversarial Regularization with CachHing) that alleviates the aforementioned issues by reusing perturbations. Recall that in conventional adversarial regularization methods, a different perturbation is generated for each sample in each epoch. In contrast to this, we propose to generate perturbations less frequently. For example, for a given sample, we can generate a new perturbation every 20 epochs, and the sample's perturbation remains unchanged in other epochs. We call this method "caching". The method has two advantages. First, it alleviates the computational burden. By reusing the perturbations, we avoid the extra forward and backward passes caused by PGD for most of the iterations. Second, caching stabilizes the stochastic gradients. Notice that in our method, the model is optimized with respect to the same noisy data for multiple times, instead + +of only one. In this way, variance of the stochastic gradients is reduced. + +One caveat of the caching method is its memory overhead. This is because a sample's perturbation is significantly larger than itself (the perturbation has an extra embedding dimension). We propose a K-nearest neighbors-based approach to tackle this problem. Specifically, instead of caching perturbations for all the samples, we only cache a small proportion of them. Each uncached perturbation can then be constructed using the cached ones in its neighborhood. Such a construction procedure can be executed in parallel with model training. Therefore, training time will not be prolonged because of this memory saving strategy. + +We use a moving average approach to boost model generalization. Specifically, when generating a new perturbation, we integrate information from both the current model and the current perturbation. This is different from conventional approaches, where the new perturbation only depends on the current model. The moving average approach has a smoothing effect that boosts model generalization, as demonstrated both theoretically and empirically by previous works (Izmailov et al., 2018; Athiwaratkun et al., 2019; Jiang et al., 2020). + +Arguably, the perturbations introduced by our method may not constitute strong adversarial attacks, because of the "staleness" caused by infrequent updates. However, we highlight that the focus of this work is model generalization over clean data, instead of adversarial robustness (ability to defend attacks). As we will demonstrate in the experiments, the "weak" perturbations show notable improvement of model generalization. And somewhat surprisingly, ARCH also exhibits on par or even better robustness comparing with conventional approaches. + +We conduct extensive experiments on neural machine translation (NMT) and natural language understanding (NLU) tasks. In comparison with conventional adversarial regularization approaches, ARCH can save up to $70\%$ computational time. Moreover, in NMT tasks, our method improves about 0.5 BLUE over baseline methods on seven datasets. ARCH also achieves 0.7 average score improvement on the GLUE (Wang et al., 2019a) development set over existing methods. + +We summarize our contributions as follows: (1) We propose a caching method that needs drastically less computational efforts. The method can also + +improve model generalization by reducing variance of stochastic gradient. (2) We propose a memory saving strategy to efficiently implement the caching method. (3) Extensive experiments on neural machine translation and natural language understanding demonstrate the efficiency and effectiveness of the proposed method. + +# 2 Background + +$\diamond$ Neural machine translation has achieved superior empirical performance (Bahdanau et al., 2015; Gehring et al., 2017; Vaswani et al., 2017). Recently, the Transformer (Vaswani et al., 2017) architecture dominates the field. This sequence-to-sequence model employs an encoder-decoder structure, and also integrates the attention mechanism. During the encoding phase, a Transformer model first computes an embedding for each sentence, after which the embeddings are fed into several layers of encoding blocks. Each of these blocks contain a self-attention mechanism and a feed-forward neural network (FFN). Subsequently, after encoding, the hidden representations are fed into the decoding blocks, each constituted of a self-attention, a encoder-decoder attention, and a FFN. + +$\diamond$ Fine-tuning pre-trained language models (Peters et al., 2018; Devlin et al., 2019; Radford et al., 2019; Liu et al., 2019b; He et al., 2020) is a state-of-the-art method for natural language understanding tasks such as the GLUE (Wang et al., 2019a) benchmark. Adversarial regularization is also incorporated into the fine-tuning approach. For example, Liu et al. (2020a) combines adversarial pretraining and fine-tuning, Zhu et al. (2020); Jiang et al. (2020) adopt trust region-based methods, and Aghajanyan et al. (2020) aims for a more efficient computation. + +Adversarial training was originally proposed for computer vision tasks (Szegedy et al., 2014; Goodfellow et al., 2015; Madry et al., 2018), where the goal is to train robust classifiers. Such methods synthesize adversarial samples, such that the classifier is trained to be robust against them. This strategy is also effective for tasks beyond computer vision, such as in reinforcement learning (Shen et al., 2020). Various algorithms are proposed to craft the adversarial samples, e.g., learning-to-learn (Jiang et al., 2021) and Stackelberg adversarial training (Zuo et al., 2021). Moreover, adversarial training is also well-studied theoretically (Li et al., 2019). In natural language processing, the goal is no longer adversarial robustness, but instead we use adver + +sarial regularization to boost model generalization. Note that adversarial training and adversarial regularization are different concepts. The former focuses on defending against adversarial attacks, and the latter focuses on encouraging smooth model predictions (Miyato et al., 2017). These two goals are usually treated as mutually exclusive (Raghunathan et al., 2020; Min et al., 2020). + +# 3 Method + +Generating perturbations for natural language inputs faces the difficulty of discreteness, i.e., words are defined in a discrete space. A common approach to tackle this is to work on the continuous embedding space (Miyato et al., 2017; Sato et al., 2019). Denote $f(x,\theta)$ a neural network parameterized by $\theta$ , where $x$ is the input embedding. Further denote $y$ the ground-truth corresponding to $x$ . For example, in classification tasks, $x$ is the sentence embedding, and $y$ is its label. In sequence-to-sequence learning, $x$ is the source sentence embedding, and $y$ is the target sentence. In both of these cases, the model is trained by minimizing the empirical risk over the training data, i.e., + +$$ +\min _ {\theta} \mathcal {L} (\theta) = \frac {1}{n} \sum_ {i = 1} ^ {n} \ell (f (x _ {i}, \theta), y _ {i}). +$$ + +Here $\{(x_i,y_i)\}_{i = 1}^n$ is the dataset, and $\ell$ is a task-specific loss, e.g., cross-entropy loss for classification and mean-squared error for regression. + +# 3.1 Adversarial Regularization + +Adversarial regularization (Miyato et al., 2017) is a technique that encourages smoothness of the model outputs around each input data point. Concretely, we define an adversarial regularizer for non-regression tasks as + +$$ +\ell_ {v} (x, \delta , \theta) = \operatorname {K L} \big (f (x, \theta) | | f (x + \delta , \theta) \big), +$$ + +where $\mathrm{KL}(P\mid Q) = \sum_{k}p_{k}\log \frac{p_{k}}{q_{k}}.$ + +Here $f(\cdot, \theta)$ is the prediction confidence, i.e., $\sum_{i} [f(\cdot, \theta)]_{i} = 1$ , $\delta$ is the perturbation of sample $x$ , and $\mathrm{KL}(\cdot ||\cdot)$ is the Kullback-Leibler (KL) divergence. In regression tasks, the model output $f(\cdot, \theta)$ is a scalar, and the adversarial regularizer is + +$$ +\ell_ {v} (x, \delta , \theta) = (f (x, \theta) - f (x + \delta , \theta)) ^ {2}. +$$ + +We consider the worst-case perturbation to encourage the model to make smooth predictions. + +Specifically, at epoch $t$ , we solve + +$$ +\min _ {\theta^ {t}} \mathcal {L} \left(\theta^ {t}\right) + \frac {\lambda}{n} \sum_ {i = 1} ^ {n} \max _ {\| \delta_ {i} ^ {t} \| \leq \epsilon} \ell_ {v} \left(x _ {i}, \delta_ {i} ^ {t}, \theta^ {t}\right). \tag {1} +$$ + +Here $\lambda$ is the weight of the regularizer, $\epsilon$ is a predefined perturbation strength, and $\|\cdot\|$ is either the $\ell_2$ norm or the $\ell_{\infty}$ norm. Notice that the perturbation $\delta_i^t$ of sample $x_i$ is different in each epoch. + +The min-max optimization problem in Eq. 1 is notoriously difficult to solve. Previous works (Miyato et al., 2017; Sato et al., 2019; Jiang et al., 2020; Zhu et al., 2020) employ variations of alternating gradient descent/ascent. That is, we first solve the maximization problem using several iterations of projected gradient ascent, and then we run a gradient descent step on the loss function of the minimization problem, subject to the generated perturbations. The above procedures are run iteratively. + +On major drawback of the alternating gradient descent/ascent approach is that the stochastic gradients are unstable. Specifically, norms of the gradients vary significantly during training (Fig. 3). This is because perturbations are generated based on the current model parameters, i.e., by maximizing $\ell_v(x_i,\delta_i^t,\theta^t)$ , where $\theta^t$ changes in each epoch. Therefore, the perturbations exhibit large variance. This causes instability of the stochastic gradients, because the model needs to adapt to drastically different adversarial directions (i.e., $\delta_i^t$ ). + +# 3.2 Adversarial Regularization with Caching + +To alleviate the gradient instability problem, we propose to reuse the perturbations. Specifically, instead of optimizing with respect to different perturbations $\{\delta_i^t\}_{i=1}^n$ in each epoch, we optimize with respect to the same ones for several epochs. + +Concretely, the training objective is now + +$$ +\min _ {\theta^ {t}} \mathcal {L} \left(\theta^ {t}\right) + \frac {\lambda}{n} \sum_ {i = 1} ^ {n} \ell_ {v} \left(x _ {i}, \delta_ {i} ^ {t}, \theta^ {t}\right), \tag {2} +$$ + +$$ +\delta_ {i} ^ {t} = \left\{ \begin{array}{l l} \delta_ {i} ^ {t - 1}, & t \% T _ {c} \neq 0, \\ \alpha \delta_ {i} ^ {t - 1} + (1 - \alpha) \Delta_ {i} ^ {t}, & t \% T _ {c} = 0. \end{array} \right. +$$ + +where $\Delta_i^t = \max_{\| \delta_i^t\| \leq \epsilon}\ell_v(x_i,\delta_i^t,\theta^t)$ + +Here, $\%$ is the mod operator, and $T_{c}$ is a pre-defined gap between re-computing the perturbations. Notice that we use an exponential moving average (EMA) approach with parameter $\alpha$ when updating the perturbations. The EMA strategy integrates + +past information into the current epoch, and induces a smoothing effect that boosts model generalization. This strategy has demonstrated its effectiveness in many previous works (Izmailov et al., 2018; Athiwaratkun et al., 2019; Jiang et al., 2020). + +In comparison with Eq. 1, the formulation in Eq. 2 indicates that the perturbations are generated $\lfloor T / T_{c}\rfloor$ times instead of $T$ times when we train for $T$ epochs. As such, the model is optimized with respect to $\{\delta_i\}_{i = 1}^n$ for $T_{c}$ times, instead of only one time. In this way, the model can better adapt to the perturbed data, and thus, variance of the gradient norms is reduced. Intuitively, this is because optimization is more stable when the model is trained on the same data for multiple epochs, in comparison with trained on different noisy data in each epoch. The algorithm to implement the caching strategy is summarized in Algorithm 1. + +In conventional adversarial regularization (e.g., SMART), we find the perturbations by optimization algorithms such as projected gradient descent at every iteration. Recently, R3F (Aghajanyan et al., 2020) propose to use random perturbations instead, i.e., they directly draw $\delta$ from a normal distribution, and generalization of R3F can match SMART in some cases. However, because the random noise (as opposed to optimized perturbations) is not data-dependent, generalization of R3F is subpar in some scenarios, e.g., machine translation (see our experiments). Our approach enjoys the advantages of both of these two methods. Specifically, ARCH is efficient since it removes the maximization problem most of the time. Moreover, perturbations generated by our method are informative, unlike R3F. Empirically, our proposed method is just as efficient as R3F, and somewhat surprisingly, we find that generalization of ARCH can not only match, but even surpass conventional approaches in most of the tasks (see our experiments). + +# 3.3 Memory Saving with KNN + +One caveat of Algorithm 1 is the increased memory usage. For example, there are about 4.5 million sentence pairs in the WMT'16 En-De dataset, so that simply caching the adversarial samples takes about 100GB of memory. We propose a memory saving strategy based on K-nearest neighbors (KNN) to address this issue. + +The idea is to only cache perturbations of some samples, and perturbations of the other samples are constructed using the cached ones on the fly. + +Algorithm 1: Adversarial Regularization with Caching. + +Input: $T$ : number of training epochs; $T_{c}$ : number of epochs between caching; $\alpha$ : moving average parameter. + +Initialize: Cache $\mathcal{C} =$ dict{}; + +for $t = 0,\dots T - 1$ do + +for each batch $\mathcal{B}$ do + +// Find perturbations + +if $t\% T_{c} = = 0$ then + +Find $\delta_i^t$ for each $x_{i}\in \mathcal{B}$ using projected gradient ascent; + +$\mathcal{C}[x_i]\gets \alpha \mathcal{C}[x_i] + (1 - \alpha)\delta_i^t$ for each $x_{i}\in \mathcal{B}$ + +else + +$\delta_i^t = \mathcal{C}[x_i]$ for each $x_{i}\in \mathcal{B}$ + +end + +// Update model + +One-step gradient descent on Eq. 2; + +end + +end + +Output: Trained model. + +Algorithm 2: Memory Saving. +Input: $W$ : word embedding matrix; $n$ .. total number of training samples; $p$ .. proportion of cached samples; $K$ .. size of each neighbor. +// Before training +Compute $\{v_i\}_{i = 1}^n$ using $W$ and Eq.4; +Sample a cache set $\mathcal{X}\subset \{1\dots n\}$ such that $|\mathcal{X}| = \lfloor np\rfloor$ . +for $i\in \{1\dots n\} \setminus \mathcal{X}$ do Find $\kappa_{i}\subset \mathcal{X}$ for $x_{i}$ based on cosine similarity among $\{v_i\}_{i = 1}^n$ . +end +// In epoch t where $t\% T_c\neq 0$ +for $i = 1,\dots n$ do if $i\in \mathcal{X}$ then Retrieve $\delta_i^t$ from cache; else Compute $\delta_i^t$ using $\kappa_{i}$ and Eq.3; end +end + +Specifically, whenever $t\% T_{c} = 0$ , i.e., we need to re-compute and re-cache the perturbations, we only cache $\delta_i^t$ such that $i \in \mathcal{X}$ . Here, $\mathcal{X} \subset \{1 \cdots n\}$ is a pre-defined cache set and $|\mathcal{X}| \ll n$ . This + +strategy significantly reduces memory overhead. Consequently, in each epoch $t$ where $t\% T_{c} \neq 0$ , perturbations $\delta_{i}^{t}$ such that $i \in \mathcal{X}$ are directly retrieved from the cache. And perturbations $\delta_{i}^{t}$ such that $i \in \{1 \cdots n\} \setminus \mathcal{X}$ are defined as the following: + +$$ +\delta_ {i, \ell} ^ {t} = \frac {1}{| \mathcal {K} _ {i} |} \sum_ {j \in \mathcal {K} _ {i}} \frac {1}{\ell_ {j}} \sum_ {\ell^ {\prime} = 1} ^ {\ell_ {j}} \delta_ {j, \ell^ {\prime}} ^ {t - 1}, \ell = 1, \dots , \ell_ {i}. \tag {3} +$$ + +Here, $\ell_{i}$ be the length of sentence $x_{i}$ , $\delta_{i,\ell}^{t} \in \mathbb{R}^{d}$ is the perturbation for the $\ell$ -th word in sentence $x_{i}$ , and $\kappa_{i}$ is the nearest neighbor set for $x_{i}$ (which we present later). We remark that constructing the perturbations does not impose extra training time, because we can perform such computation in parallel with training. + +We remark that each word has an identical perturbation in Eq. 3, i.e., $\delta_i^t\in \mathbb{R}^{|\ell_i|\times d}$ has identical rows. We choose this design because a perturbation in the neighbor of $\delta_i^t$ may have a different dimension, i.e., $\delta_j^t\in \mathbb{R}^{|\ell_j|\times d}$ is in the neighbor of $\delta_i^t$ and it is possible that $|\ell_i|\neq |\ell_j|$ . To resolve this issue, we compute the word-level mean of all the perturbations in the neighbor of $\delta_i^t$ and assign it to each row of $\delta_i^t$ . + +The remaining is to find $K$ nearest neighbors in $\mathcal{X}$ for each sentence $x_{i}$ such that $i\in \{1\dots n\} \setminus \mathcal{X}$ . Suppose we have a word embedding matrix $W\in \mathbb{R}^{d\times |\mathcal{V}|}$ , where $|\mathcal{V}|$ is the vocabulary size and $d$ is the embedding dimension. Note that $W$ can be obtained from pre-trained models such BERT (Devlin et al., 2019). For each sentence $x_{i}$ , we compute its sentence representation $v_{i}\in \mathbb{R}^{d}$ as + +$$ +v _ {i} = \frac {1}{\ell_ {i}} \sum_ {\ell = 1} ^ {\ell_ {i}} W x _ {i, \ell}. \tag {4} +$$ + +Here, $x_{i,\ell} \in \mathbb{R}^{|\mathcal{V}|}$ is the one-hot vector of the $\ell$ -th word in sentence $x_{i}$ . Then, we can find $K$ nearest neighbors $\mathcal{K}_i$ for sample $x_{i}$ using the KNN algorithm, where the distance between two samples is defined as their cosine similarity. Notice that finding $\{\mathcal{K}_i\}_{i=1}^n$ is a pre-processing step, i.e., we can find the neighbors before training the model. + +The memory saving algorithm is summarized in Algorithm 2, and an extended version that combines caching and memory saving is presented in Algorithm 3 in the appendix. + +# 3.4 Computational Efficiency + +Computational costs of various methods are summarized in Table 1. In conventional adversarial + +
ForwardBackward
Standard11
FreeLB1 + S1 + S
SMART1 + S1 + S
R3F21
ARCH2 + (S - 1)/Tc1 + S/Tc
+ +Table 1: Computational cost of various methods. Here $S$ is the number of gradient ascent (PGD) steps, and ${T}_{c}$ is the number of epochs between caching. Forward is the number of forward passes, and Backward is the number of backward passes. + +![](images/e6003568813fa97df495268b5f8def30c3e4360e031682c8672173533fa1ada4.jpg) +Figure 1: Wall time of different methods. Left: training a Transformer-base model for 150 epochs on IWSLT'14 De-En; Right: fine-tuning BERTBASE for 10 epochs on SST-2. + +![](images/b41ff0332fb6a8dd416098774934cb530e66d46015f84ece885b4555d1d7299c.jpg) + +regularization algorithms, such as FreeLB (Zhu et al., 2020) and SMART (Jiang et al., 2020), suppose we solve the inner maximization problem for $S$ steps, then we impose extra $S$ forward passes and $S$ backward passes in each iteration. In contrast, R3F (Aghajanyan et al., 2020) removes the maximization problem, and directly samples perturbations from a normal distribution. Thus, R3F only introduce one extra forward pass to compute the regularization term. Using Algorithm 1, our method shares similar efficiency as R3F. Specifically, suppose we cache the perturbations every $T_{c}$ epochs, then the average number of forward passes and backward passes per iteration is $2 + (S - 1) / T_{c}$ and $1 + S / T_{c}$ , respectively. In practice, $S / T_{c}$ is usually small, such that the computational cost between ARCH and R3F is close. + +Wall time comparison is illustrated in Fig. 1. Notice that in the left subfigure, both our method and R3F save about $70\%$ computation time in comparison with FreeLB and SMART. In the right subfigure, the time saving is about $50\%$ . The absolute time saving is more significant on large models and large datasets. For example, when training a Transformer-big model on the WMT'16 En-De dataset, our method costs about 176 GPU hours, while SMART uses 576 GPU hours. + +
ModelsEn-ViVi-EnEn-DeDe-EnEn-FrFr-En
Transformer (Vaswani et al., 2017)30.328.728.334.739.338.2
R3F (Aghajanyan et al., 2020)31.630.029.035.439.538.7
FreeLB (Zhu et al., 2020)31.629.628.635.339.438.7
SMART (Jiang et al., 2020)31.530.129.235.539.838.9
ARCH32.030.429.436.140.339.3
+ +Table 2: BLEU score on three low-resource datasets. All the baseline results are from our re-implementation. We report the mean over three runs using different random seeds. ARCH saves about $70\%$ computational time comparing with SMART. + +
ModelsBLEUsacreBLEU
Transformer29.128.4
R3F29.429.0
FreeLB29.329.0
SMART29.829.1
ARCH29.829.4
+ +Table 3: BLEU and sacreBLEU score on the WMT'16 En-De dataset. All the baseline results are from our re-implementation. + +
DataSourceTrainValidTest
En-ViIWSLT'15133k7681268
En-DeIWSLT'14161k7.2k6.7k
En-FrIWSLT'16224k10801133
En-DeWMT'164.5m3.0k3.0k
+ +Table 4: Dataset source and statistics. Here "k" stands for thousand, and "m" stands for million. + +# 4 Experiments + +In all the experiments, we use PyTorch1 (Paszke et al., 2019) as the backend. All the experiments are conducted on NVIDIA V100 GPUs. + +# 4.1 Baselines + +We adopt several baselines in the experiments. + +$\diamond$ Transformer (Vaswani et al., 2017) achieves superior performance in neural machine translation. +$\diamond$ BERT (Devlin et al., 2019) exhibits outstanding performance when fine-tuned on natural language understanding tasks. +$\diamond$ FreeAT (Shafahi et al., 2019) enables "free" adversarial training by recycling the gradient information generated when updating the model. + +$\diamond$ FreeLB (Zhu et al., 2020) treats the intermediate perturbations during the projected gradient ascent steps as virtual batches. As such, the method achieves "free" large batch adversarial training. +SMART (Jiang et al., 2020) achieves state-of-the-art performance in natural language understanding. The method utilizes smoothness-inducing regularization and Bregman proximal point optimization. +$\diamond$ $R3F$ (Aghajanyan et al., 2020) replaces the maximization problem in conventional adversarial regularization with random noise. + +# 4.2 Machine Translation + +Datasets. We use three low-resource datasets: English-German from IWSLT'14, English-Vietnamese from IWSLT'15, and English-French from IWSLT'16. We also use a rich-resource dataset: English-German from WMT'16. Dataset statistics are summarized in Table 4. + +Implementation. In NMT tasks, we have the source-side and the target-side inputs. We add perturbations to both of their embeddings (Sato et al., 2019). This has demonstrated to be more effective than adding perturbations to a single side. We use $\text{Fairseq}^3$ (Ott et al., 2019) to implement our algorithms. For En-Vi and En-Fr experiments, we use the Transformer-base architecture (Vaswani et al., 2017). For En-De (IWSLT'14) experiments, we modify the Transformer-base architecture by decreasing the hidden dimension size from 2048 to 1024, and decreasing the number of heads from 8 to 4 (while dimension of each head doubles). For En-De (WMT'16) experiments, we use the Transformer-big (Vaswani et al., 2017) architecture. The training details are presented in Appendix B.1. + +
RTE AccMRPC Acc/F1CoLA MccSST-2 AccSTS-B P/S CorrQNLI AccQQP Acc/F1MNLI-m/mm AccAverage Score
BERTBASE63.584.1/89.054.792.989.2/88.891.190.9/88.384.5/84.481.5
FreeAT68.085.0/89.257.593.289.5/89.091.391.2/88.584.9/85.082.6
FreeLB70.086.0/90.058.993.489.7/89.291.591.4/88.485.4/85.583.3
R3F70.487.0/91.059.193.490.1/89.892.091.7/88.885.2/85.483.7
SMART71.287.7/91.359.193.090.0/89.491.791.5/88.585.6/86.083.8
ARCH72.288.0/91.661.193.690.6/90.292.291.9/89.185.6/86.084.5
+ +Table 5: Evaluation results on the GLUE development set. We use the $BERT_{BASE}$ architecture for all the methods. The best results on each dataset are shown in **bold**. Results of $BERT_{BASE}$ (Devlin et al., 2019), FreeAT (Shafahi et al., 2019), FreeLB (Zhu et al., 2020), and $R3F$ (Aghajanyan et al., 2020) are based on our re-implementation. SMART results are from Jiang et al. (2020). + +Results. Experimental results on the low-resource datasets are summarized in Table 2. We can see that ARCH outperforms all the baselines in all the experiments. We remark that our method saves about $70\%$ computational time in comparison with SMART and FreeLB, and has the save level of efficiency comparing with R3F (Fig. 1). Even though R3F is efficient by eliminating the maximization problem, we can see that it does not generalize as well as SMART, i.e., R3F has worse BLEU score than SMART in 5/6 of the experiments. + +Experimental results on the WMT'16 En-De dataset are summarized in Table 3. We report both the BLEU score and the sacreBLEU (Post, 2018) score. The former is standard for machine translation tasks, and the latter is a detokenzied version of BLEU. The absolute computational time saving is more significant for larger datasets (e.g., WMT) and larger models (e.g., Transformer-big). In the experiments, ARCH uses about 176 GPU hours to train, while it costs SMART about 576 hours. Performance of ARCH is better or on par with all the baselines. Notice that like in Table 2, performance of R3F is worse than SMART. + +# 4.3 Natural Language Understanding + +Datasets. We conduct experiments on the General Language Understanding Evaluation (GLUE) benchmark (Wang et al., 2019a), which is a collection of nine natural language inference tasks. The benchmark includes question answering (Rajpurkar et al., 2016), linguistic acceptability (CoLA, Warstadt et al. 2019), sentiment analysis (SST, Socher et al. 2013), text similarity (STS-B, Cer et al. 2017), paraphrase detection (MRPC, Dolan and Brockett 2005), and natural language inference (RTE & MNLI, Dagan et al. 2006; Bar-Haim et al. + +2006; Giampiccolo et al. 2007; Bentivogli et al. 2009; Williams et al. 2018) tasks. Statistics of the datasets are summarized in Table 8 (Appendix B.2). + +Implementation. We implement our algorithm using the $MT-DNN^5$ (Liu et al., 2019a, 2020b) and the Transformers (Wolf et al., 2020) code-base. The training details are presented in Appendix B.2. + +Results. Table 5 summarizes experimental results on the GLUE development set. We can see that ARCH is on par or outperforms all the baselines in all the tasks. Notice that generalization of R3F is comparable with SMART. Our proposed method shares the advantages of both efficiency (i.e., R3F) and informative perturbations (i.e., SMART), and thus, ARCH behaves better than both of these methods. We highlight that our method is $50\% -70\%$ faster than SMART and FreeLB. + +# 4.4 Parameter Study + +$\diamond$ Moving average helps. As indicated in Fig. 2a, without the exponential moving average, model performance drops about 0.3 BLEU. Also, the model is robust to the moving average parameter, as increasing it from 0.01 to 0.1 does not change model performance. + +$\diamond$ Number of epochs between caching is important. If we cache the perturbations too frequently (i.e., 5 in Fig. 2b), the model cannot adapt to the perturbations well; and if we cache the perturbations too infrequently (i.e., inf in Fig. 2b), staleness of the perturbations hinders model generalization. +$\diamond$ Robustness to the number of neighbors. In Fig. 2c, notice that ARCH is robust to the number of neighbors. We also examine a variant of the KNN memory-saving strategy (R-1-NN): namely + +![](images/dbe4b69ae29311425a97a65d298da2bd596e32431881c348ddc12293a2134406.jpg) +(a) Moving average. + +![](images/60c1ca6dde32b4ae0cb7727d5bc4ba1376350b2680f1ac415036cb0d48ea8e8d.jpg) + +![](images/d622b6d999347d8eff360d49f61d8f9ec57a19f867ffbcb45c42a85ada310940.jpg) +(b) Epochs between caching. +(c) Number of neighbors. +Figure 2: Parameter study on the IWSLT'14 De-En dataset. Each error bar is based on three runs using different random seeds. Each dashed line signifies the SMART baseline. In (b), inf means we only cache once during training. In (c), $R - 1$ -NN means we use 1-NN, but the neighbor is randomly selected. + +![](images/01fede1d304035609c2188fc14f886e989897e60583e99b1a13c92604d114a10.jpg) +(d) Proportion of caching. + +in Algorithm 1, the nearest neighbors set $\kappa_{i}$ for sample $x_{i}$ is randomly constructed instead of based on word embeddings. We can see that model performance drops, and the method also exhibits drastically larger variance. + +$\diamond$ Robustness to the number of cached samples. From Fig. 2d, notice that the model generalizes well even caching only $1\%$ of the perturbations (i.e., only 1400 samples for the IWSLT'14 De-En dataset). Moreover, the KNN memory-saving strategy does not hinder model performance, i.e., the BLEU score is consistent when caching all the samples and caching only $10\%$ of the samples. + +We highlight that in practice ARCH does not need much tuning, because the method is robust to the introduced hyper-parameters. + +# 4.5 Analysis + +$\diamond$ Caching reduces gradient norm variance. As demonstrated in Fig. 3, variance of the gradient norms reduces significantly comparing with SMART and R3F. This meets our expectation that by reusing perturbations, the model can adapt to the noisy data (i.e., clean data with perturbations) better. Notice that R3F has even larger gradient norm variance than SMART, which is because R3F uses random noise instead of data-dependent ones. + +Adversarial robustness. We remark that the focus of ARCH is model generalization. Never + +![](images/842cafced501530136a3bcef82f9861ceb72cda2558c411a73ecd7dfeba90da5.jpg) + +![](images/0d4c76694937d0e91f34f6f7ff85892afbac18d23b3dea69ff283dde12f13ae8.jpg) +Figure 3: Norm of stochastic gradients during training. Top: IWSLT'14 De-En; Bottom: IWSLT'15 En-Vi. + +theless, we investigate model robustness on the Adversarial-NLI (ANLI, Nie et al. 2020) dataset. The dataset contains 163k data, which are collected via a human-and-model-in-the-loop approach. Surprisingly, from Table 6, we can see that R3F and ARCH achieve on par robustness with SMART. This indicates that reusing perturbations, or even constructing random perturbations can increase robustness (than BERT) to the same level as computing optimized perturbations (i.e., SMART). + +
Dev
R1R2R3All
BERTBASE53.343.044.746.8
R3F53.943.446.347.8
SMART54.144.445.347.8
ARCH54.046.146.048.5
Test
R1R2R3All
BERTBASE54.144.946.648.4
R3F54.346.246.548.8
SMART54.346.446.548.9
ARCH53.846.647.449.2
+ +Table 6: Experimental results on the ANLI dataset. Model references: $BERT_{BASE}$ (Devlin et al., 2019), R3F (Aghajanyan et al., 2020), SMART (Jiang et al., 2020). + +$\diamond$ Probing experiments. We first fine-tune a BERTBASE model on the SST-2 dataset using different methods, and then we freeze the representations and only tune a prediction head on other datasets. The probing method directly measures the quality of representations generated by different models. As illustrated in Fig. 4, ARCH consistently outperforms the baseline methods. + +![](images/5897d35ff4ee35fc2e483084ed31555627f471c4613905f063835fdfe49711c7.jpg) + +![](images/d5204de2223eeb728dd8750badd9b28b222581607cd015f16448ea8196db466b.jpg) + +![](images/2e0bc4e25b90cf3b02651adb3be59962e2258276f89d68f25da5ce9452ba1a8a.jpg) +Figure 4: Probing experiments. Each violin plot is based on 10 runs with different random seeds. + +![](images/454b55327728f0c56f1af65c51ce7a3388272067220d83170703ee14f9c0cebf.jpg) + +# 5 Conclusion + +We propose a new caching method to speedup the training of neural models with adversarial regularization. By reusing the generated perturbations, our proposed method significantly amortizes the computational cost of the backward passes at each iteration. Our thorough experiments show that the proposed method not only improves the computational efficiency, but also reduces the variance of the stochastic gradients, which leads to better model generalization. + +# Broader Impact + +This paper proposes a caching method to speedup adversarial regularized training for NLP tasks. Our proposed method provides a fundamental way to address the efficiency issue that commonly exists in conventional adversarial regularization methods. We use publicly available data, to conduct neural machine translation and natural language understanding experiments. Our framework is built using public code bases. We do not find any ethical concerns. + +# References + +Armen Aghajanyan, Akshit Shrivastava, Anchit Gupta, Naman Goyal, Luke Zettlemoyer, and Sonal Gupta. 2020. Better fine-tuning by reducing representational collapse. arXiv preprint arXiv:2008.03156. +Ben Athiwaratkun, Marc Finzi, Pavel Izmailov, and Andrew Gordon Wilson. 2019. There are many consistent explanations of unlabeled data: Why you should average. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net. +Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. 2015. Neural machine translation by jointly learning to align and translate. In 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings. +Roy Bar-Haim, Ido Dagan, Bill Dolan, Lisa Ferro, and Danilo Giampiccolo. 2006. The second PASCAL recognising textual entailment challenge. In Proceedings of the Second PASCAL Challenges Workshop on Recognising Textual Entailment. +Luisa Bentivogli, Ido Dagan, Hoa Trang Dang, Danilo Giampiccolo, and Bernardo Magnini. 2009. The fifth pascal recognizing textual entailment challenge. In In Proc Text Analysis Conference (TAC'09). +Daniel Cer, Mona Diab, Eneko Agirre, Inigo Lopez-Gazpio, and Lucia Specia. 2017. SemEval-2017 task 1: Semantic textual similarity multilingual and crosslingual focused evaluation. In Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval-2017), pages 1-14, Vancouver, Canada. Association for Computational Linguistics. +Yong Cheng, Lu Jiang, and Wolfgang Macherey. 2019. Robust neural machine translation with doubly adversarial inputs. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4324-4333, Florence, Italy. Association for Computational Linguistics. +Ido Dagan, Oren Glickman, and Bernardo Magnini. 2006. The pascal recognising textual entailment challenge. In Proceedings of the First International Conference on Machine Learning Challenges: Evaluating Predictive Uncertainty Visual Object Classification, and Recognizing Textual Entailment, MLCW'05, pages 177-190, Berlin, Heidelberg. Springer-Verlag. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 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, Volume 1 (Long and Short Papers), pages 4171-4186, Minneapolis, Minnesota. Association for Computational Linguistics. + +William B. Dolan and Chris Brockett. 2005. Automatically constructing a corpus of sentential paraphrases. In Proceedings of the Third International Workshop on Paraphrasing (IWP2005). +Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N. Dauphin. 2017. Convolutional sequence to sequence learning. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, volume 70 of Proceedings of Machine Learning Research, pages 1243-1252. PMLR. +Danilo Giampiccolo, Bernardo Magnini, Ido Dagan, and Bill Dolan. 2007. The third PASCAL recognizing textual entailment challenge. In Proceedings of the ACL-PASCAL Workshop on Textual Entailment and Paraphrasing, pages 1-9, Prague. Association for Computational Linguistics. +Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. 2015. Explaining and harnessing adversarial examples. In 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings. +Pengcheng He, Xiaodong Liu, Jianfeng Gao, and Weizhu Chen. 2020. Deberta: Decoding-enhanced bert with disentangled attention. arXiv preprint arXiv:2006.03654. +Pavel Izmailov, Dmitrii Podoprikhin, Timur Garipov, Dmitry P. Vetrov, and Andrew Gordon Wilson. 2018. Averaging weights leads to wider optima and better generalization. In Proceedings of the Thirty-Fourth Conference on Uncertainty in Artificial Intelligence, UAI 2018, Monterey, California, USA, August 6-10, 2018, pages 876-885. AUAI Press. +Robin Jia and Percy Liang. 2017. Adversarial examples for evaluating reading comprehension systems. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 2021-2031, Copenhagen, Denmark. Association for Computational Linguistics. +Haoming Jiang, Zhehui Chen, Yuyang Shi, Bo Dai, and Tuo Zhao. 2021. Learning to defend by learning to attack. In The 24th International Conference on Artificial Intelligence and Statistics, AISTATS 2021, April 13-15, 2021, Virtual Event, volume 130 of Proceedings of Machine Learning Research, pages 577-585. PMLR. +Haoming Jiang, Pengcheng He, Weizhu Chen, Xiaodong Liu, Jianfeng Gao, and Tuo Zhao. 2020. SMART: Robust and efficient fine-tuning for pretrained natural language models through principled regularized optimization. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 2177-2190, Online. Association for Computational Linguistics. + +Diederik P. Kingma and Jimmy Ba. 2015. 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. +Yan Li, Ethan X Fang, Huan Xu, and Tuo Zhao. 2019. Inductive bias of gradient descent based adversarial training on separable data. arXiv preprint arXiv:1906.02931. +Xiaodong Liu, Hao Cheng, Pengcheng He, Weizhu Chen, Yu Wang, Hoifung Poon, and Jianfeng Gao. 2020a. Adversarial training for large neural language models. arXiv preprint arXiv:2004.08994. +Xiaodong Liu, Pengcheng He, Weizhu Chen, and Jianfeng Gao. 2019a. Multi-task deep neural networks for natural language understanding. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4487-4496, Florence, Italy. Association for Computational Linguistics. +Xiaodong Liu, Yu Wang, Jianshu Ji, Hao Cheng, Xueyun Zhu, Emmanuel Awa, Pengcheng He, Weizhu Chen, Hoifung Poon, Guihong Cao, and Jianfeng Gao. 2020b. The Microsoft toolkit of multitask deep neural networks for natural language understanding. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pages 118-126, Online. Association for Computational Linguistics. +Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019b. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692. +Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. 2018. Towards deep learning models resistant to adversarial attacks. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net. +Yifei Min, Lin Chen, and Amin Karbasi. 2020. The curious case of adversarially robust models: More data can help, double descend, or hurt generalization. arXiv preprint arXiv:2002.11080. +Takeru Miyato, Andrew M. Dai, and Ian J. Goodfellow. 2017. Adversarial training methods for semi-supervised text classification. In 5th International Conference on Learning Representations, ICLR 2017, Toulouse, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net. +Yixin Nie, Adina Williams, Emily Dinan, Mohit Bansal, Jason Weston, and Douwe Kiela. 2020. Adversarial NLI: A new benchmark for natural language understanding. In Proceedings of the 58th Annual Meeting of the Association for Computational + +Linguistics, pages 4885-4901, Online. Association for Computational Linguistics. +Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. 2019. *fairseq: A fast, extensible toolkit for sequence modeling.* In *Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics (Demonstrations)*, pages 48-53, Minneapolis, Minnesota. Association for Computational Linguistics. +Myle Ott, Sergey Edunov, David Grangier, and Michael Auli. 2018. Scaling neural machine translation. In Proceedings of the Third Conference on Machine Translation: Research Papers, pages 1-9, Brussels, Belgium. Association for Computational Linguistics. +Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Köpf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. 2019. Pytorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pages 8024-8035. +Matthew Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. 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, Volume 1 (Long Papers), pages 2227-2237, New Orleans, Louisiana. Association for Computational Linguistics. +Matt Post. 2018. A call for clarity in reporting BLEU scores. In Proceedings of the Third Conference on Machine Translation: Research Papers, pages 186-191, Brussels, Belgium. Association for Computational Linguistics. +Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9. +Aditi Raghunathan, Sang Michael Xie, Fanny Yang, John C. Duchi, and Percy Liang. 2020. Understanding and mitigating the tradeoff between robustness and accuracy. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pages 7909-7919. PMLR. +Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. SQuAD: 100,000+ questions for + +machine comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 2383-2392, Austin, Texas. Association for Computational Linguistics. +Motoki Sato, Jun Suzuki, and Shun Kiyono. 2019. *Effective adversarial regularization for neural machine translation*. In *Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics*, pages 204–210, Florence, Italy. Association for Computational Linguistics. +Ali Shafahi, Mahyar Najibi, Amin Ghiasi, Zheng Xu, John P. Dickerson, Christoph Studer, Larry S. Davis, Gavin Taylor, and Tom Goldstein. 2019. Adversarial training for free! In Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pages 3353-3364. +Qianli Shen, Yan Li, Haoming Jiang, Zhaoran Wang, and Tuo Zhao. 2020. Deep reinforcement learning with robust and smooth policy. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pages 8707-8718. PMLR. +Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D. Manning, Andrew Ng, and Christopher Potts. 2013. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 1631-1642, Seattle, Washington, USA. Association for Computational Linguistics. +Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian J. Goodfellow, and Rob Fergus. 2014. Intriguing properties of neural networks. In 2nd International Conference on Learning Representations, ICLR 2014, Banff, AB, Canada, April 14-16, 2014, Conference Track Proceedings. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pages 5998-6008. +Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. 2019a. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net. +Dilin Wang, ChengYue Gong, and Qiang Liu. 2019b. Improving neural language modeling via adversarial training. In Proceedings of the 36th International + +Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, volume 97 of Proceedings of Machine Learning Research, pages 6555-6565. PMLR. +Alex Warstadt, Amanpreet Singh, and Samuel R. Bowman. 2019. Neural network acceptability judgments. Transactions of the Association for Computational Linguistics, 7:625-641. +Adina Williams, Nikita Nangia, and Samuel Bowman. 2018. A broad-coverage challenge corpus for sentence understanding through inference. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 1112-1122, New Orleans, Louisiana. Association for Computational Linguistics. +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumont, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Remi Louf, Morgan Funtowicz, Joe Davison, Sam Shleifer, Patrick von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lhoest, and Alexander Rush. 2020. Transformers: State-of-the-art natural language processing. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 38-45, Online. Association for Computational Linguistics. +Chen Zhu, Yu Cheng, Zhe Gan, Siqi Sun, Tom Goldstein, and Jingjing Liu. 2020. Freelb: Enhanced adversarial training for natural language understanding. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net. +Simiao Zuo, Chen Liang, Haoming Jiang, Xiaodong Liu, Pengcheng He, Jianfeng Gao, Weizhu Chen, and Tuo Zhao. 2021. Adversarial training as stackelberg game: An unrolled optimization approach. arXiv preprint arXiv:2104.04886. + +# A Detailed Algorithm + +Algorithm 3: Adversarial Regularization with Caching and Memory Saving. +Input: $W$ : word embedding matrix from a pre-trained model; $T$ : number of training epochs; $T_{c}$ : number of epochs between caching; $\alpha$ : moving average parameter. // Before training Compute $\{v_i\}_{i = 1}^n$ using Eq.4; Sample a cache set $\mathcal{X}\subset \{1,\dots ,n\}$ . for $i\notin \mathcal{X}$ do Find $\kappa_{i}\subset \mathcal{X}$ for $x_{i}$ based on cosine similarity among $\{v_i\}_{i = 1}^n$ end // During training Initialize: Cache $\mathcal{C} =$ dict{}; for $t = 0,\dots T - 1$ do + +for each $x_{i}\in \mathcal{B}$ in a batch B do if $t\% T_c = = 0$ then Find $\delta_i^t$ for each $x_{i}$ using projected gradient ascent; if $i\in \mathcal{X}$ then $\mathcal{C}[x_i]\gets \alpha \mathcal{C}[x_i] + (1 - \alpha)\delta_i^t;$ end else if $i\in \mathcal{X}$ then $\delta_i^t = \mathcal{C}[x_i];$ else Compute $\delta_i^t$ using $\kappa_{i},\mathcal{C}$ ,and Eq.3; end end One-step gradient descent on Eq.2 to update model parameters; +end +end +Output: Trained model. + +# B Training Details + +# B.1 Machine Translation Experiments + +For the low-resource experiments, we use a batch size of 64k tokens. For example, when running the experiments on 4 GPUs, we set the tokens-per-GPU to be 8k, and we accumulate gradients for 2 steps. We use Adam (Kingma and Ba, 2015) as the optimizer, and we set $\beta = (0.9, 0.98)$ . The learning rate is set to be $1 \times 10^{-3}$ in all the experiments. + +We choose the model with the best validation performance to test on the test set. Other training details are the same as Ott et al. (2019) $^6$ . + +For the rich resource experiments, we use a batch size of $450\mathrm{k}$ tokens. That is, we set tokens-per-GPU to be 7k with 8 GPUs, and we further accumulate gradients for 8 steps. We set the learning rate to be $1\times 10^{-3}\}$ . For other training setups, please refer to Ott et al. (2018) $^{7}$ . + +To implement our proposed method, we sample the initial perturbation from a uniform distribution. We use sentence-level $\ell_2$ constraints on the perturbations, and we set the perturbation strength $\epsilon = 0.1$ . We run a modified version of projected gradient ascent for 3 steps to compute the perturbations, and the learning rate is set to be 0.1. Concretely, in each iteration to compute the perturbations, we apply the following update rule + +$$ +\delta \leftarrow \Pi \left(\delta + \eta \frac {\nabla_ {\delta} \ell_ {v} (x , \delta , \theta)}{\| \nabla_ {\delta} \ell_ {v} \| _ {2}}\right), +$$ + +where $\eta$ is the learning rate and $\Pi$ denotes the projection into the $\ell_2$ ball. We set the number of epochs between caching to be 15, and the exponential moving average parameter $\alpha = 0.01$ . We cache $10\%$ of perturbations, and we use the nearest neighbor (i.e., 1-NN) to construct uncached perturbations. + +Inference settings are presented in Table 7. + +
BeamLen-Pen
En-Vi (IWSLT'15)101.0
Vi-En (IWSLT'15)150.3
En-De (IWSLT'14)101.5
De-En (IWSLT'14)91.5
En-Fr (IWSLT'16)100.2
Fr-En (IWSLT'16)102.0
En-De (WMT'16)40.6
+ +Table 7: Hyper-parameters for machine translation. Here, Beam is the size of beam search, and Len-Pen is the length penalty parameter during beam search. + +
CorpusTask#Train#Dev#Test#LabelMetrics
Single-Sentence Classification (GLUE)
CoLAAcceptability8.5k1k1k2Matthews corr
SSTSentiment67k8721.8k2Accuracy
Pairwise Text Classification (GLUE)
MNLINLI393k20k20k3Accuracy
RTENLI2.5k2763k2Accuracy
QQPParaphrase364k40k391k2Accuracy/F1
MRPCParaphrase3.7k4081.7k2Accuracy/F1
QNLIQA/NLI108k5.7k5.7k2Accuracy
Text Similarity (GLUE)
STS-BSimilarity7k1.5k1.4k1Pearson/Spearman corr
+ +Table 8: Summary of the GLUE benchmark. + +# B.2 Natural Language Understanding Experiments + +Statistics and descriptions of the GLUE benchmark is summarized in Table 8. + +We fine-tune a pre-trained $\mathrm{BERT}_{\mathrm{BASE}}$ model. For each task, we choose the batch size from $\{8,16,32,64,128\}$ , and the learning rate from $\{5\times 10^{-5},8\times 10^{-5},1\times 10^{-4},2\times 10^{-4}\}$ . We use a linear learning rate warm-up schedule for $10\%$ of the training iterations. We set the dropout rate of the task specific layer (i.e., the classification head) to be 0.1, and the dropout rate of BERT is chosen from $\{0.0,0.1\}$ . We train the model for 10 epochs. We report the best performance on each dataset individually. + +To implement the adversarial regularization method, we sample the initial perturbation from a normal distribution with mean 0 and standard deviation $10^{-5}$ . We use word-level $\ell_{\infty}$ constraints, and the perturbation strength is set to be 1.0. We run standard projected gradient ascent to compute the perturbations, where the number of steps is chosen from $\{1,2\}$ , and the learning rate is chosen from $\{10^{-4},10^{-5}\}$ . Because of the limited number of training samples, we only cache the perturbations once for fine-tuning tasks. We refer to the MT-DNN code-base for other details. \ No newline at end of file diff --git a/archefficientadversarialregularizedtrainingwithcaching/images.zip b/archefficientadversarialregularizedtrainingwithcaching/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..c24f67294d11784e39ff02a334d57a13790f18d3 --- /dev/null +++ b/archefficientadversarialregularizedtrainingwithcaching/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:030428aa5965fb016b13667836ccc030b9777a9ca2744bd5d92183b210655d03 +size 519834 diff --git a/archefficientadversarialregularizedtrainingwithcaching/layout.json b/archefficientadversarialregularizedtrainingwithcaching/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a9cd8878309bb7ba8935e2d132de52e3fb874c09 --- /dev/null +++ b/archefficientadversarialregularizedtrainingwithcaching/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6873ab9c96d13a1bb03367722970418db9999e84193d583d7e432cabe0f40c07 +size 569654 diff --git a/arefactualitycheckersreliableadversarialmetaevaluationoffactualityinsummarization/66d996a1-5ee7-46c4-a47a-74a674f1e91b_content_list.json b/arefactualitycheckersreliableadversarialmetaevaluationoffactualityinsummarization/66d996a1-5ee7-46c4-a47a-74a674f1e91b_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..6d51830e49d45f1b4aa1049df18728e47920b238 --- /dev/null +++ b/arefactualitycheckersreliableadversarialmetaevaluationoffactualityinsummarization/66d996a1-5ee7-46c4-a47a-74a674f1e91b_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b89750be195210ddb411e73a707a7b4f81f4c238e9c2dc746260ba12c464a372 +size 97616 diff --git a/arefactualitycheckersreliableadversarialmetaevaluationoffactualityinsummarization/66d996a1-5ee7-46c4-a47a-74a674f1e91b_model.json b/arefactualitycheckersreliableadversarialmetaevaluationoffactualityinsummarization/66d996a1-5ee7-46c4-a47a-74a674f1e91b_model.json new file mode 100644 index 0000000000000000000000000000000000000000..7b8d3af88b78124be24849816d2755f93a83da74 --- /dev/null +++ b/arefactualitycheckersreliableadversarialmetaevaluationoffactualityinsummarization/66d996a1-5ee7-46c4-a47a-74a674f1e91b_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a39cd2dd95265cb71b978394592238fc3884d34cf261727956430a07099c312a +size 118456 diff --git a/arefactualitycheckersreliableadversarialmetaevaluationoffactualityinsummarization/66d996a1-5ee7-46c4-a47a-74a674f1e91b_origin.pdf b/arefactualitycheckersreliableadversarialmetaevaluationoffactualityinsummarization/66d996a1-5ee7-46c4-a47a-74a674f1e91b_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e1d40ac65a613f6e9cdb85b60d535c715111cadc --- /dev/null +++ b/arefactualitycheckersreliableadversarialmetaevaluationoffactualityinsummarization/66d996a1-5ee7-46c4-a47a-74a674f1e91b_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb17fdf7a7290878b3f7cd8acc6ff7c0f236eba11968ebdc9132e26db9a4465f +size 394697 diff --git a/arefactualitycheckersreliableadversarialmetaevaluationoffactualityinsummarization/full.md b/arefactualitycheckersreliableadversarialmetaevaluationoffactualityinsummarization/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2a04ce7d309250e813aa1c8033cb9457863136fe --- /dev/null +++ b/arefactualitycheckersreliableadversarialmetaevaluationoffactualityinsummarization/full.md @@ -0,0 +1,320 @@ +# Are Factuality Checkers Reliable? Adversarial Meta-evaluation of Factuality in Summarization + +Yiran Chen*, Pengfei Liu*, Xipeng Qiu† +Shanghai Key Laboratory of Intelligent Information Processing, Fudan University School of Computer Science, Fudan University +2005 Songhu Road, Shanghai, China +#Carnegie Mellon University +{yrchen19, xpqiu}@fudan.edu.cn +{pliu3}@cs.cmu.edu + +# Abstract + +With the continuous upgrading of the summarization systems driven by deep neural networks, researchers have higher requirements on the quality of the generated summaries, which should be not only fluent and informative but also factually correct. As a result, the field of factual evaluation has developed rapidly recently. Despite its initial progress in evaluating generated summaries, the meta-evaluation methodologies of factuality metrics are limited in their opacity, leading to the insufficient understanding of factuality metrics' relative advantages and their applicability. In this paper, we present an adversarial meta-evaluation methodology that allows us to (i) diagnose the fine-grained strengths and weaknesses of 6 existing top-performing metrics over 24 diagnostic test datasets, (ii) search for directions for further improvement by data augmentation. Our observations from this work motivate us to propose several calls for future research. We make all codes, diagnostic test datasets, trained factuality models available: https://github.com/zide05/AdvFact. + +# 1 Introduction + +With the rapid development of neural networks in text summarization (Liu and Lapata, 2019; Liu, 2019; Zhong et al., 2019; Zhang et al., 2019; Lewis et al., 2019; Zhong et al., 2020; Liu and Liu, 2021), especially the use of contextualized pre-trained models (Devlin et al., 2019; Lewis et al., 2019), the state-of-the-art performance, measured by automated metrics such as ROUGE (Lin, 2004) and BERTScore (Zhang et al., 2020) has been constantly updated. However, although these systems can generate informative, and fluent summaries, they suffer from the problem of making factual errors—generating incorrect facts that can not be + +supported by the source document (Cao et al., 2018a). + +Among this background, a large body of recent works (Wang et al., 2020a; Kryscinski et al., 2020; Durmus et al., 2020; Cao et al., 2020) are trying to search for new automated metrics that can assess the factuality of generated summaries due to the fact that existing metrics (e.g., ROUGE) are not correlated well with factual consistency (Maynez et al., 2020; Goyal and Durrett, 2020). + +Generally, the process of designing these evaluation metrics w.r.t factuality is commonly formulated into different forms of NLP tasks, ranging from text entailment (Falke et al., 2019; Kryscinski et al., 2020) at sentence level or more fine-grained level (Goyal and Durrett, 2020) to question answering (Wang et al., 2020a; Durmus et al., 2020). Improving the understanding of these factuality metrics with diverse paradigms is critical for further metric improvement. However, the evaluation methodologies of factuality metrics are limited in their opacity—they are opaque to their results, which are usually holistic scores (e.g., accuracy) and not interpretable. Specifically, different from traditional non-learnable metrics like ROUGE, whose scores are relatively straightforward to interpret, e.g., lower ROUGE-2 Recall implies fewer bigrams from reference summaries are covered by generated summaries, there are diverse factors that could lead to lower score of factuality metrics (e.g., entity replacement, number inference). However, most of existing meta-evaluation strategies fail to tell (i) which types of factual errors the metric evaluated at hand are better at identifying, (ii) on which categories the error recognition ability of factuality metrics can not be well generalized. As a result, (1) the relative advantages between a better- and worse-performing systems w.r.t factuality are unclear. (2) the lack of understanding of factuality metrics' applicability reduces their reliability, and users may take the risk of over-estimating their + +generalization ability so as to apply them to inappropriate evaluation samples. (3) it's unclear how to improve the metric further. + +Thus instead of further pursuing a new method, we take a step back to understand the shortcomings of existing metrics. We present an adversarial meta-evaluation framework which can perform fine-grained evaluation of factuality metrics. Methodologically, we (i) first conduct error analysis of existing state-of-the-art factuality metrics, (ii) define effective adversarial transformations based on the results of error analysis. We (iii) construct diagnostic examples by applying adversarial transformations to test datasets with different distributions and then diagnose existing top-scoring factuality metrics. (iv) We finally show that, the technique of data augmentation, driven by adversarial transformations, can increase the diversity of training samples, making factuality metrics more robust and reliable. + +Our contributions can be summarized as follows: (1) We figure out several representative errors made by the existing top-performing factuality metrics (§4.2), inspiring the direction for further improvement. (2) We propose effective adversarial transformations that can either be applied to test set for model diagnosis (§5) or applied to training set for data augmentation (§6.2), by which we further improve the performance of current checkers. (3) We propose a fine-grained meta-evaluation methodology for factuality metrics and re-evaluate existing top-performing metrics to assess their relative strengths and weaknesses. (4) We call for a more fine-grained and interpretable meta-evaluation of factuality metrics for future research. As a first step, we released our constructed diagnostic test sets with various characteristics, as well as augmented training data and more robust factuality metrics. + +# 2 Related Work + +Factuality in Text Summarization Recent studies on factuality of text generation revolve around metric design and system optimization. Regarding the metric perspective, researchers formulate the design of automated metrics w.r.t factuality as different problems: text entailment over sequential (Kryscinski et al., 2020; Goyal and Durrett, 2021a) or tree (Goyal and Durrett, 2020, 2021a) structures; question answering (Wang et al., 2020a; Durmus et al., 2020) and sequence labeling (Zhao et al., + +2020a). Concurrent to our work, Pagnoni et al. (2021a) constructs human annotated test sets for factuality metrics while using a different typology. Additionally, their method is difficult to be used as automatic data augmentation. Other works aim to learn factuality-aware summarization systems, which can be achieved by leveraging open information extraction and dependency parsing (Cao et al., 2018b; Zhu et al., 2020). Chen et al. (2020) explore how factuality metrics are influenced by domain shift and conclude that out-of-domain systems can even surpass in-domain systems in terms of factuality and factuality checkers like FactCC is limited in predictive power of positive samples. + +Adversarial Evaluation of NLP Systems Adversarial evaluation has been extensively explored in many NLP tasks recently. The adversarial challenge sets have been introduced into tasks of natural language inference (Naik et al., 2018) question answering (Jia and Liang, 2017), machine translation (Burlot and Yvon, 2017) and language model (Marvin and Linzen, 2018) to examine system drawbacks. More recently, Gardner et al. (2020) introduces the concept of "contrast set" and proposes to use it to measure the generalization of different NLP systems. Instead of adversarially evaluate an NLP system, we perform an adversarial metaevaluation of evaluation metrics. + +Meta-evaluation for Automated Metrics Meta-evaluation aims to evaluate the reliability of automated metrics based on their correlation with human judgments (Graham, 2015; Peyrard, 2019; Bhandari et al., 2020). Most existing works perform meta-evaluation on metrics that measure semantic equivalence, such as ROUGE (Lin, 2004) and BERTScore (Zhang et al., 2020). Yuan et al. (2021) more recently propose BARTScore and meta evaluate it on multiple evaluation perspectives. By contrast, in this paper, we focus on the evaluation of factuality metrics using our constructed diagnostic test sets. Concurrent with our work, Goyal and Durrett (2021b); Pagnoni et al. (2021b) also look into the error patterns of existing factuality checkers. $^{1}$ + +# 3 Preliminaries + +# 3.1 Definition of Factuality + +Although researchers have slightly different definitions of factuality (Maynez et al., 2020; Kryscinski et al., 2020). In this paper, we consider factuality as how well generated summaries are supported by source documents without using any external knowledge. A factual error happens when generated summaries contain salient facts (Kryscinski et al., 2020) that can not be inferred from source documents. The summary sentences that need to be verified are also called claims below to keep consistent with the field of fact verification (Zhou et al., 2019; Schuster et al., 2019; Liu et al., 2020). + +
ModelsTypeTrain data
MNLIBERTNLI-SMNLI
MNLIROBERTANLI-SMNLI
MNLIELECTRANLI-SMNLI
DAENLI-APARANMT-G
FACTCCNLI-SCNNDM-G
FEQAQAQA2D, SQuA
+ +# 3.2 Factuality Metrics + +There are two major task formulations of factuality metrics: natural language inference (NLI) and question answering (QA). Model types and training data are summarized in Tab. 1. + +# 3.2.1 NLI-based Metrics + +NLI-based metrics consider factual consistency as a natural language inference problem, the core idea of which is to infer if facts from generated summaries can be entailed by its source documents. Specifically, different metrics have diverse definitions of facts. + +FactCC Kryscinski et al. (2020) defines facts as salient spans in source documents and proposes to use a weakly-supervised method to learn a model-based factuality metric. + +Dependency-level Entailment (DAE) Goyal and Durrett (2020) define facts as dependency arcs and propose DAE formulation to identify factual errors in a more fine-grained manner. + +NLI transferred models Following Falke et al. (2019), we train different factuality checkers (MNLIBERT, MNLIROBERTA and MNLIELECTRA) based on BERT (Devlin et al., 2019), RoBERTa (Liu et al., 2019) and ELECTRA (Clark et al., 2019) on MNLI dataset (Williams et al., 2018). The neutral class samples are deleted in the dataset for fair comparison following Goyal and Durrett (2020). + +# 3.2.2 QA-based Metrics + +The basic idea behind QA-based metrics is whether similar answers can be replied when we ask the same question to a generated summary $S$ and its source document $D$ (Durmus et al., 2020; Wang et al., 2020b). In practice, we use the recently proposed FEQA (Durmus et al., 2020). + +FEQA It first generates questions based on summary, and answers the questions based on source document and summary separately. Mismatching answers indicate an inconsistency between document and summary, on the other hand, matching answers reveal consistency. + +Table 1: The model types and training data of factuality metrics. NLI-A and NLI-S represent NLI-based metrics defining facts as dependency arcs and span respectively. PARANMT-G and CNNDM-G mean the automatically generated training data from PARANMT (Wieting and Gimpel, 2018) and CNN/DailyMail (Nallapati et al., 2016) (referred to as CNNDM in the rest of the paper). + +
Eval. setDataset type#Sys.#Sam.Nov.(%)
FaccTeCNNDM1050354.0
QagsCCNNDM150428.6
RankTeCNNDM3107252.5
FaithFactXSum5233299.2
+ +Table 2: Statistics of different human annotation datasets for meta-evaluating factuality metrics. Dataset type means the dataset that source document and summary belong to. Here, #Sys. and #Sam. represent the number of summarization systems that the output summaries come from and the test set size respectively. Nov. (abbreviation of novelty) means the proportion of trigrams in claims that don't exist in source documents. + +# 3.3 Existing datasets for Meta-evaluation + +To get a holistic overview of factuality metrics performances, we collect four different human judgment datasets that can be used to meta-evaluate the correctness of factuality metrics. They are FaccTe (Kryscinski et al., 2020), QagsC (Wang et al., 2020a), RankTe (Falke et al., 2019) and FaithFact (Maynez et al., 2020). Each sample of the evaluation sets is composed of one document, one summary sentence (claim), and a human annotated label that represents the factuality consistency between the document and summary. The detailed statistics of evaluation sets are showed in Tab. 2. As it shows, the claims of FaccTe, QagsC + +and RankTe are the outputs from summarizers on CNNDM dataset. However, FaithFact includes faithfulness annotations $^2$ of five summarization systems outputs on XSum. It is included to measure the generalization ability of factuality metrics in domain different from CNNDM. + +![](images/6457432af8770197ead58623841b30eedf2b25e5eb5c89785e1e2c63d48683ac.jpg) +Figure 1: The overall accuracy performance of six representative factuality checkers. + +# 4 Meta-Evaluation + +# 4.1 Holistic Meta-evaluation + +Fig. 1 illustrates meta-evaluation results of six factuality checkers on four human judgment sets. We can observe3 that: + +(1) FACTCC has achieved the best performance in most of the test sets except in FaithFact. The reason for this is that the claims in this set are highly paraphrased (its novelty is $99.2\%$ in Tab. 2) thus will mislead FACTCC which is trained on less abstractive claims (CNNDM-G as shown in Tab. 1). (2) FEQA underperforms FACTCC most of the time. (3) With the same pre-trained model (ELECTRA), DAE outperforms MNLIELECTRA in FaccTe and QagsC. However, DAE with dependency information doesn't show constant superiority over MNLIELECTRA in all evaluation sets. + +# 4.2 Fine-grained error analysis + +Setup and Error Typology To get a more fine-grained understanding of factuality checkers and define the upper bound of the difficulty for the task, we choose FACTCC as the representative factuality checker (for its superior performance as described in §4.1) and perform error analysis on it. We examine 140 samples4 that the checker fails to predict correctly in FaccTe and QagsC, and divide the reasons into diverse categories. Examples are pre + +sented in Tab. 3. Notably, there could be multiple error reasons for one mispredicted sample. + +- R1: VANs replacement: the checker is hard to detect Verb, Adjective and Noun replacements (e.g., antonym, synonym) thus producing the wrong prediction. Here noun represents noun or noun phrase excluding entity. +- R2: Numerical inference the checker obtains worse performance when verifying samples that require numerical inference (e.g., date). Similar results are also observed in (Zhao et al., 2020b). +- R3: Entity coreference: a slight change of person name or replacing the pronoun with its reference name will mislead factuality checker which suggests the lack of entity coreference resolution ability. +- R4: Missing details: when the claim lacks some detailed information (e.g., location), the checker tends to predict it as inconsistent though it is not. While this is frequently occurring in the scenario of summarization when the summarizer only extracts the most important information. +- R5: Paraphrase The more complex paraphrase patterns (e.g., complex reorder, passive-active transformation, sentence fusion and so on) other than simple token replacement or omission that cause the model to make wrong predictions. +- R6: Background knowledge The checker is fragile when extra knowledge is required. +- R7: Truncate The checker truncates long documents and will ignore the information of evidence sentences in later part of documents, therefore making wrong judgment. +R8: Wrong label Incorrect annotated label. +R9: Others Other reasons. + +Analysis of Error Reasons As presented in Tab. 3, VANs replacement and Missing details account for a large proportion in all error reasons. It is because verb, adjective and noun (besides entity) replacement and detail omission are not included in the training data for FACTCC. Moreover, misclassifications that caused by paraphrase are account for $11.8\%$ , which lies in the lack of paraphrase for training data of FACTCC as the only paraphrase pattern is introduced by backtranslation (Edunov et al., 2018). While entity and number swap are included in negative sample construction in (Kryscinski et al., 2020), FACTCC still makes wrong prediction facing samples requiring entity coreference resolution and numerical inference. + +
TypologySource documentClaimRatio
R1: VANs replacement (inco → co)...Japanese court issued a landmark injunction halting plans to restart two nuclear reactors in a western prefecture...japanese court orders to restart two nuclear reactors in a western prefecture.12.4%
R2: Numerical inference (co → inco)...On October 31, 2014, the Italian government announced the end of "Mare Nostrum" ...the italican government announced the end of "mare nostrum" in 2014.1.3%
R3: Entity coreference (co → inco)...Ahmed Farouq didn't have the prestige......Before that, Farouq was the deputy emir of al Qaeda....ahmed farouq was the deputy emir of al Qaeda in the indian subcontinent.17.0%
R4: Missing details (co → inco)...Phil Rudd, the drummer for legendary hard rock band AC/DC, has pleaded guilty to charges of...rudd has pleaded guilty to threatening to kill and possession of drugs in a court.31.4%
R5: Paraphrase (inco → co)...A police motorcycle stopped the rest of the pack, before organ- isers of the 151-mile race slowed the leaders to allow the pack to catch up...Leaders of the tour de france were stopped by police as they crossed a railway line to avoid a train.11.8%
R6: Background knowledge (co → inco)Scientists from harvard medical school have discovered a way of turning stem cells into killing machines ...Scientists in the us have developed a stem cell therapy for brain tumours.0.7%
R7: Truncate (co → inco)[>512]...Ben was slated for a clinical trial with an experimental drug...ben was slated for a clinical trial with an experimental drug.3.3%
R8: Wrong label (inco → co)...The man who spent six years as spokesman for the Glazer family has written an enlightening account of his time with the Manchester United chiefs...Manchester united's unpopular owners has written an enlightening account of his time with the manchester united chiefs.9.8%
R9: Others (inco → co)These days we are increasingly using outdoor space for the occasional barbecue or to relax in a hot tub rather than for tending flowers.these days we are increasingly using outdoor space for tending flowers.12.4%
+ +Table 3: Error reasons with their corresponding examples and the ratio of them. The bold span is corresponding to the error reason. co $\rightarrow$ inco represents the gold label is factually correct while checker misclassifies it as factually incorrect (inco $\rightarrow$ co means the opposite). [>512] means there are more than 512 subwords before this position. + +# 5 Construction of Diagnostic Set + +It is not realistic to produce large scale human annotated test sets with multiple error reasons observed above. As a consequence, former work (Hidey et al., 2020) and (Naik et al., 2018) construct diagnostic test sets automatically. In this section, we first introduce automatic rule-based transformation methods based on error analysis (§5.1). Then we construct 24 diagnostic test sets based on three types of baseline test sets. + +# 5.1 Adversarial Transformations + +We introduce four types of automatic transformation methods corresponding to the R1-4 error reasons in error analysis (§4.2). Paraphrasing (R5) is not included here for it is hard to produce simply with rule, thus we introduce it in another way—using gold references as claims in §5.2. The rest four error reasons are either too hard for models (R6, R9) or correspond to systematic error (R7) or lie in annotation error (R8), and also will not be included here. The adversarial transformation examples are shown in Tab. 4. + +R1: Antonym Substitution We first use Stanza (Qi et al., 2020) to do Part-of-Speech tagging and then use WordNet wrapped in NLTK (Bird et al., 2009) package to find antonyms for verb and adjective. Negative samples are produced by replacing + +the original word with its antonyms. The reason we do not include synonyms replacement is that simply replacing word with its synonyms can introduce factual error and cause the gold label ambiguous. + +R2: Numerical Editing FACTCC exhibits worse performance when it needs numerical reasoning to derive the result as §4.2 shows, which motivates us to design a numerical adversarial transformation. Specifically: (1) to produce negative samples, we replace numerical entity $^5$ with a randomly chosen entity of the same type in source document and guarantee the transformed claim differs from the origin. On the other hand, we also add preposition (e.g., "after") before date and timing type entities while adding "more than" and "less than" before other types of numerical entities; (2) For positive samples, we change the number or date $^6$ and add "before", "after", "more than" and "less than" properly (e.g., "in 2019" to "two years before 2021"). We include more complex negative and positive transformations for numerical inference compared with Kryscinski et al. (2020). + +R3: Entity Replacement At the phase of error analysis, we discover FACTCC fails to understand the equivalence between named entities referring to + +
Adv Trans.TypeTransformed Claim
R1: AntoSubverbpoolside: guests enjoyed the sunny weather as they waited for the show to ecommence → end .
adj.on monday, children will flock from every state to decorate eggs on the south lawn of the white → black house .
R2: NumEditpossilk flowers and a sign saying ‘ pray for justice ’ adorn the highway 34 bridge on the edge of alsea bay in waldport, oregon, in a picture taken in october 2002 → before May, 2003 .
negsilk flowers and a sign saying ‘ pray for justice ’ adorn the highway 34 bridge on the edge of alsea bay in waldport, oregon, in a picture taken in october 2002 → in 2011 .
R3: EntRepposactor isaiah washington → isaiah tweeted: ‘ okay , watching the #walterscott video was horrible , but i think the brave person who captured the murder is a hero and a godsend #truthdom . ’
negactor isaiah washington → michelle williams tweeted: ‘ okay , watching the #walterscott video was horrible , but i think the brave person who captured the murder is a hero and a godsend #truthdom . ’
R4: SynPrunprepo.the queen and the duke of edinburgh appeared in good spirits as they arrived to a red carpet at the event .
clausethe mystery hero who raced to the edge of a cliff and pulled a driver from his preariously balanced ear has been identified as a 29-year - old man who fled the scene to go to work .
+ +Table 4: Adversarial transformations corresponding to error reasons R1-4 in §4.2. "Type" here means subtype of adversarial transformations. Specifically, we display verb and adjective antonym substitution for AntoSub. Also, factual consistent and inconsistent samples (pos and neg) are displayed for NumEdit and EntRep. Lastly, prepo. and clause mean the omission of preposition phrases and sub-clauses. + +the same person. Thus, we produce positive examples by replacing PERSON named entity with its substring (e.g., replace Isaiah washington with Isaiah). Negative samples are produced by replacing the entity with a randomly chosen entity of the same type from the source document. Here we prevent the new entity from being substring of the origin entity and vise versa. Another type of negative transformation is replacing part of PERSON entity with different one. The transformation in (Kryscinski et al., 2020) doesn't include positive samples as well as PERSON entity editing as negative samples. + +R4: Syntactic Pruning Syntactic pruning is used to produce positive examples with detail omitted. Despite using dependency parsing, we choose constituency parsing to disentangle the summary sentence for it is more suitable to capture clauses and phrases. To produce positive examples, clauses with label "S" and "SBAR" and prepositional phrases with label "PP" are deleted based on the assumption that the lack of sub-clause will not affect the factual consistency. + +# 5.2 Diagnostic Datasets + +We construct 24 diagnostic datasets based on three types of base test sets as follows: Besides only using sentences in source document (DocAsClaim) as input to transformation as previous work (Kryscinski et al., 2020) does, we propose to use another two base test sets: gold sum + +mary (RefAsClaim) and generated summary (FacTe, QagsC,RankTe and FaithFact) to serve as input to the adversarial transformation. Reasons are: (i) the diagnostic set constructed based on reference summaries corresponds to the error reason R5 in §4.2, which is a more challenging test set for factuality checkers due to its more complex paraphrase patterns. (ii) the distribution of generated summaries will be more closed to summaries verified by factuality checkers in real scenarios (e.g., generated summaries from BART). Finally we obtain 6 base test sets and 24 diagnostic test sets (4 adversarial transformations on every base test set). + +# 5.3 Quality Examination + +In order to explore the reliability of the automatically generated diagnostic test sets, we conduct human examination on whether the generated claim is grammatically correct and maintains correct label. This is carried out on 50 randomly chosen samples for each type of adversarial transformation. Results show that all the diagnostic sets are grammatically correct (ratio around $85\%$ ) and possess correct factuality labels (ratio higher than $90\%$ ). + +# 6 Experiment + +# 6.1 Re-evaluation on Diagnostic Datasets + +Antonym Substitution The performances of checkers drop when tested in AntoSub as Tab. 5 + +
Evaluation SetDocAsClaimRefAsClaimFaccTe
Transf.OriginAntoSubNumEditEntRepSynPrunOriginAntoSubNumEditEntRepSynPrunOriginAntoSubNumEditEntRepSynPrun
MNLIBERT76.48-48.01-46.77-38.22+3.4177.10-37.34-43.57-37.08-3.0879.92-45.74-56.81-43.78+8.24
MNLIROBERTA92.85-80.49-69.49-61.15+0.7452.08+0.17-3.25-1.06-0.9983.30-66.14-52.30-48.53+8.54
MNLIELECTRA79.67-53.42-47.61-40.59+0.5474.23-41.04-39.33-36.18-0.2868.79-22.67-29.96-26.97+0.60
DAE67.02-32.18-28.13-24.58+2.4077.69-52.27-45.44-44.10+0.8371.77-47.59-36.82-36.77-2.79
FEQA81.04-53.26-42.35-34.85-8.9336.93+35.75+26.10+31.31-1.9477.93-48.53-35.60-27.70-8.26
FACTCC72.54-37.62-10.52+10.75-4.3640.62+22.58+31.98+40.99-3.9286.08-73.09-30.93+0.51-10.98
Evaluation SetQagsCRankTeFaithFact
Transf.OriginAntoSubNumEditEntRepSynPrunOriginAntoSubNumEditEntRepSynPrunOriginAntoSubNumEditEntRepSynPrun
MNLIBERT82.54-65.52-67.58-56.57+15.4785.54-57.41-59.97-48.25+0.5761.92-22.53-25.19-26.83+1.64
MNLIROBERTA63.29-24.61-25.73-23.03+4.5254.76-7.13-10.02-5.48+5.0541.12-23.21-9.49-11.30+43.63
MNLIELECTRA71.03-47.26-40.46-33.92+9.3185.82-65.71-59.71-54.27+1.2261.75-23.18-0.05-18.77+0.11
DAE77.73-69.43-57.73-47.12+14.8483.86-70.98-57.60-53.35+1.1440.31-13.86-7.33-18.38+26.64
FEQA80.52-59.56-44.10-44.34-2.5276.00-42.89-29.44-22.28-10.0791.59+2.90-1.16-6.50-87.35
FACTCC83.33-61.81-27.56-0.96-7.5587.97-68.59-26.98-3.22-10.3877.32-12.03+14.17+3.38-38.34
+ +Table 5: Adversarial Evaluation Results. The first column of every subtable represents the factuality checker performance in the original test set (gray). The rest four columns represent four types of diagnostic test sets, the value of which is the difference between model accuracy in diagnostic and original test set. Here we don't use balanced accuracy because AntoSub and SynPrun only possess negative samples and positive samples respectively. The positive value implies the performance increases when evaluated in the diagnostic test set while the negative value does the opposite (red). Here DocAsClaim and RefAsClaim represent two evaluation set with document sentences and summary reference sentences as claims respectively. + +shows (nearly all entry values of AntoSub columns are negative). + +However, FEQA and FACTCC obtain obvious performance improvement in the AntoSub diagnostic set of RefAsClaim. It is because claims in RefAsClaim original set are highly paraphrased which will mislead the checkers to produce negative labels and cause lower accuracy. While Antonym Substitution introduces factual inconsistent samples, thus instead, model performance improves. Models transferred from MNLI and DAE are more robust to samples with highly paraphrased claims. + +Numerical Editing Nearly all factuality checkers get worse performance with NumEdit transformation (almost all results of NumEdit columns are negative in Tab. 5). Even FACTCC is not the exception though it may possess numerical inference ability to some extent. It emphasizes the importance to improve numerical inference ability for factuality checkers. However, FEQA and FACTCC get better performances when tested in NumEdit diagnostic set of RefAsClaim because the numerical editing transformation introduces more negative samples (reason is similar as described above). + +Entity Replacement Similar to numerical Editing, the entity replacement transformation also tends to mislead six factuality checkers as nearly all values of EntRep columns in Tab. 5 are negative. Although FACTCC is trained with data that also includes entity replacement transformation, it still + +obtains worse performance in EntRep diagnostic test sets of QagsC and RankTe. This implies the incompleteness of entity replacement in (Kryscinski et al., 2020). It shows the same pattern as Antosub when models are tested in EntRep diagnostic sets of RefAsClaim and the reason is similar as described above. + +Syntactic Pruning The diagnostic test sets of SynPrun can lead to more performance drop when the base test sets are RefAsClaim and FaccTe because the last columns of these subtables get more negative values. Transformation of this type will be more confusing when the claims are highly paraphrased. + +As observed in Tab. 5, models transferred from MNLI dataset and DAE are more robust when syntactic pruning are introduced, while FACTCC and FEQA are constantly misled by SynPrun diagnostic test sets. This can be attributed to the lack of highly paraphrased claims in FACTCC training set. DAE tends to extract dependency triples of summary and make prediction based on them, thus is more robust when evaluated in SynPrun diagnostic sets. As for models transferred from MNLI, it may because the training set of MNLI already possesses pattern of detail omission and the trained models have the capability to recognize it. + +Takeaways (1) Most factuality checkers obtain poor performance in AntoSub and NumEdit diagnostic sets, which suggests that current factuality metrics are not faithful when dealing with antonym substitution and numerical editing samples. (2) + +
Evaluation SetDocAsClaimRefAsClaimFacTe
Transf.OriginAntoSubNumEditEntRepSynPrunOriginAntoSubNumEditEntRepSynPrunOriginAntoSubNumEditEntRepSynPrun
FactCC72.5434.9262.0283.2968.1840.6263.2072.6081.6136.7086.0812.9955.1586.5975.10
FactCCsub78.24†27.4460.3480.2874.9954.1748.0566.1578.9153.8588.278.9652.2382.0586.12
FactCCadvsub77.0686.00†90.16†87.69†80.00†58.08†80.99†86.19†83.39†61.40†88.0780.45†86.99†87.27†96.73†
FactCCrefsub82.92†22.4459.2077.8578.5978.09†27.3760.3071.1178.1188.674.9351.0782.0590.20
FactCCref-advsub81.8771.58†83.69†84.17†80.88†75.1282.73†85.31†86.15†78.3288.8769.70†88.35†92.73†96.73†
Evaluation SetQagsCRankTeFaithFact
Transf.OriginAntoSubNumEditEntRepSynPrunOriginAntoSubNumEditEntRepSynPrunOriginAntoSubNumEditEntRepSynPrun
FactCC83.3321.5255.7782.3775.7887.9719.3860.9984.7577.5977.3265.4446.8379.7980.70
FactCCsub82.7416.0354.6379.0483.4890.1113.1859.8582.5383.15
FactCCadvsub85.32†80.03†88.78†84.23†97.72†91.42†79.77†84.58†87.09†96.67†69.85†80.99†90.43†90.35†45.76
FactCCrefsub84.9210.6953.5078.2986.3291.327.5957.1081.6290.0049.0133.8876.6075.4464.41†
FactCCref-advsub86.7173.42†90.89†87.94†94.02†92.72†74.79†89.01†89.05†93.33†62.95†87.33†88.30†88.60†55.93
+ +Table 6: The adversarial training accuracy results. Cells in bold means the highest score among FACTCC, FactCCadv and FactCCref. While cells in red means highest score among FactCCref and FactCCref-adv. † and † indicate the difference between FactCCadv sub, FactCCref-adv and FactCCref-adv, FactCCref is significant. + +FACTCC can handle entity replacement diagnostic sets to some extent, but can not maintain the performance constantly over all EntRep sets. (3) MNLIBERT, MNLIROBERTA, MNLIELECTRA and DAE are more reliable to deal with highly paraphrased claims and are more robust to syntactic pruning transformation. + +# 6.2 Data Augmentation + +Besides utilizing adversarial transformation to construct test sets, it can also be used to create more training data, i.e., data augmentation, to improve the model performance. Here we choose FACTCC to conduct adversarial training $^9$ due to the excellent performance of FACTCC in § 4.1. + +As the original training data of FACTCC has more than 100 million samples, we first subsample 50 million data to train $\mathrm{FACTCC}_{sub}$ . Moreover, we add 34,912 adversarial training data to the subsampled set and train another checker called $\mathrm{FACTCC}_{sub}^{adv}$ . Also, we investigate whether introducing references as claims to the training set will enhance model performance. We include references as claims and make negative transformations in (Kryscinski et al., 2020) on them to train $\mathrm{FACTCC}_{sub}^{ref}$ . Lastly, adversarial transformation based on reference is also included and the trained model calls $\mathrm{FACTCC}_{sub}^{ref - adv}$ . The analysis results of them in different baseline and diagnostic test sets are showed in Tab. 6, from which we can draw several conclusions: + +Subsampling doesn't mean performance decrease. Compared with the original FACTCC that trained from more than 100 million data, the subsampling version $\mathrm{FACTCC}_{sub}$ with 50 million training data performs better when tested in the + +original test set of DocAsClaim, RefAsClaim, FaccTe and RankTe in Tab. 6. + +Adversarial data augmentation improves model performance on both original and diagnostic test sets most of time. As shown in Tab. 6, FACTCC $_{sub}$ outperforms FACTCC and FACTCC $_{sub}$ in original test sets of RefAsClaim, QagsC and RankTe. Moreover, FACTCC $_{sub}$ shows significantly $^{10}$ superior performance on the diagnostic test sets because nearly all cells in the line of FACTCC $_{sub}$ are bold on diagnostic test sets. + +Adding reference as augmented training data can improve model performance to some extent. FACTCCref performs better than FACTCCsub in all origin evaluation set except in FaithFact. When introducing adversarial training set, the performances are significantly improved in Tab. 6, especially when tested in diagnostic test sets (nearly all cells of row FACTCCref-adv are red). + +# 7 Implications and Future Directions + +In this paper, we present an adversarial meta-evaluation methodology driven by our fine-grained analysis, which not only allows us to re-evaluate existing top-performing factuality metrics, diagnosing their limitations, but also instructs us to further improve current metrics by data augmentation. Based on what we have explored and observed in this work, we suggest following potentially promising future directions: + +(1) Knowledge-guided factuality metric: One error reason in §4.2 is the lacking of extra knowledge reference ability for factuality metrics. It would + +be promising to explore the effectiveness of external knowledge like knowledge base (Bordes et al., 2013), citation graph (Lo et al., 2020) (for scientific summarization). + +(2) Long document Modeling: Lengths of most of summarization documents are over 512, which brings great challenge for pretrain based factuality metrics (R7 in §4.2). Various methodologies (e.g., first retrieval then verification (Zhou et al., 2019)) should be put forwards to deal with the problem. +(3) Fine-grained meta-evaluation and more diverse human judgments: To reliably evaluate factuality metrics, human judgments over diverse distribution are needed. Moreover, fine-grained meta-evaluation for metrics is beneficial to further identify their drawbacks and suggest future directions. + +# Acknowledgments + +We thanks Ming Zhong and all reviewers for their valuable comments and helpful suggestions. This work was supported by the National Key Research and Development Program of China (No. 2020AAA0106702) and National Natural Science Foundation of China (No. 62022027). + +# References + +Manik Bhandari, Pranav Narayan Gour, Atabak Ashfaq, Pengfei Liu, and Graham Neubig. 2020. Reevaluating evaluation in text summarization. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 9347-9359, Online. Association for Computational Linguistics. +Steven Bird, Ewan Klein, and Edward Loper. 2009. Natural language processing with Python: analyzing 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 Neural Information Processing Systems (NIPS), pages 1-9. +Franck Burlot and François Yvon. 2017. Evaluating the morphological competence of machine translation systems. In Proceedings of the Second Conference on Machine Translation, pages 43-55, Copenhagen, Denmark. Association for Computational Linguistics. +Meng Cao, Yue Dong, Jiapeng Wu, and Jackie Chi Kit Cheung. 2020. Factual error correction for abstractive summarization models. In Proceedings of the 2020 Conference on Empirical Methods in Natural + +Language Processing (EMNLP), pages 6251-6258, Online. Association for Computational Linguistics. +Ziqiang Cao, Furu Wei, Wenjie Li, and Sujian Li. 2018a. Faithful to the original: Fact aware neural abstractive summarization. In Thirty-Second AAAI Conference on Artificial Intelligence. +Ziqiang Cao, Furu Wei, Wenjie Li, and Sujian Li. 2018b. Faithful to the original: Fact aware neural abstractive summarization. In Proceedings of the Thirty-Second AAAI Conference on Artificial 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 4784-4791. AAAI Press. +Angel X Chang and Christopher D Manning. Suture: A library for recognizing and normalizing time expressions. +Yiran Chen, Pengfei Liu, Ming Zhong, Zi-Yi Dou, Dan- qing Wang, Xipeng Qiu, and Xuanjing Huang. 2020. CDEvalSumm: An empirical study of cross-dataset evaluation for neural summarization systems. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 3679-3691, Online. Association for Computational Linguistics. +Kevin Clark, Minh-Thang Luong, Quoc V Le, and Christopher D Manning. 2019. Electra: Pre-training text encoders as discriminators rather than generators. In International Conference on Learning Representations. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 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, Volume 1 (Long and Short Papers), pages 4171-4186, Minneapolis, Minnesota. Association for Computational Linguistics. +Esin Durmus, He He, and Mona Diab. 2020. Feqa: A question answering evaluation framework for faithfulness assessment in abstractive summarization. arXiv, pages arXiv-2005. +Sergey Edunov, Myle Ott, Michael Auli, and David Grangier. 2018. Understanding back-translation at scale. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 489-500. +Tobias Falke, Leonardo FR Ribeiro, Prasetya Ajie Utama, Ido Dagan, and Iryna Gurevych. 2019. Ranking generated summaries by correctness: An interesting but challenging application for natural language inference. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 2214-2220. + +Matt Gardner, Yoav Artzi, Victoria Basmov, Jonathan Berant, Ben Bogin, Sihao Chen, Pradeep Dasigi, Dheeru Dua, Yanai Elazar, Ananth Gottumukkala, et al. 2020. Evaluating models' local decision boundaries via contrast sets. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: Findings, pages 1307-1323. +Tanya Goyal and Greg Durrett. 2020. Evaluating factuality in generation with dependency-level entailment. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 3592-3603, Online. Association for Computational Linguistics. +Tanya Goyal and Greg Durrett. 2021a. Annotating and modeling fine-grained factuality in summarization. arXiv preprint arXiv:2104.04302. +Tanya Goyal and Greg Durrett. 2021b. Annotating and modeling fine-grained factuality in summarization. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1449-1462, Online. Association for Computational Linguistics. +Yvette Graham. 2015. Re-evaluating automatic summarization with BLEU and 192 shades of ROUGE. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 128-137, Lisbon, Portugal. Association for Computational Linguistics. +Christopher Hidey, Tuhin Chakrabarty, Tariq Alhindi, Siddharth Varia, Kriste Krstovski, Mona Diab, and Smaranda Muresan. 2020. DeSePtion: Dual sequence prediction and adversarial examples for improved fact-checking. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 8593-8606, Online. Association for Computational Linguistics. +Robin Jia and Percy Liang. 2017. Adversarial examples for evaluating reading comprehension systems. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 2021-2031, Copenhagen, Denmark. Association for Computational Linguistics. +Wojciech Kryscinski, Bryan McCann, Caiming Xiong, and Richard Socher. 2020. Evaluating the factual consistency of abstractive text summarization. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 9332-9346, Online. Association for Computational Linguistics. +Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Ves Stoyanov, and Luke Zettlemoyer. 2019. Bart: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. arXiv preprint arXiv:1910.13461. + +Chin-Yew Lin. 2004. Rouge: A package for automatic evaluation of summaries. Text Summarization Branches Out. +Yang Liu. 2019. Fine-tune BERT for Extractive Summarization. +Yang Liu and Mirella Lapata. 2019. Text summarization with pretrained encoders. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 3721-3731. +Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692. +Yixin Liu and Pengfei Liu. 2021. SimCLS: A simple framework for contrastive learning of abstractive summarization. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 2: Short Papers), pages 1065-1072, Online. Association for Computational Linguistics. +Zhenghao Liu, Chenyan Xiong, Maosong Sun, and Zhiyuan Liu. 2020. Fine-grained fact verification with kernel graph attention network. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7342-7351. +Kyle Lo, Lucy Lu Wang, Mark Neumann, Rodney Kinney, and Daniel Weld. 2020. S2ORC: The semantic scholar open research corpus. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4969-4983, Online. Association for Computational Linguistics. +Rebecca Marvin and Tal Linzen. 2018. Targeted syntactic evaluation of language models. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1192-1202, Brussels, Belgium. Association for Computational Linguistics. +Joshua Maynez, Shashi Narayan, Bernd Bohnet, and Ryan McDonald. 2020. On faithfulness and factuality in abstractive summarization. arXiv preprint arXiv:2005.00661. +Aakanksha Naik, Abhilasha Ravichander, Norman Sadeh, Carolyn Rose, and Graham Neubig. 2018. Stress test evaluation for natural language inference. In Proceedings of the 27th International Conference on Computational Linguistics, pages 2340-2353, Santa Fe, New Mexico, USA. Association for Computational Linguistics. +Ramesh Nallapati, Bowen Zhou, Cicero dos Santos, Ca glar Gulçehre, and Bing Xiang. 2016. Abstractive text summarization using sequence-to-sequence rnns and beyond. CoNLL 2016, page 280. + +Artidoro Pagnoni, Vidhisha Balachandran, and Yulia Tsvetkov. 2021a. Understanding factuality in abstractive summarization with frank: A benchmark for factuality metrics. arXiv preprint arXiv:2104.13346. +Artidoro Pagnoni, Vidhisha Balachandran, and Yulia Tsvetkov. 2021b. Understanding factuality in abstractive summarization with FRANK: A benchmark for factuality metrics. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 4812-4829, Online. Association for Computational Linguistics. +Maxime Peyrard. 2019. Studying summarization evaluation metrics in the appropriate scoring range. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 5093-5100, Florence, Italy. Association for Computational Linguistics. +Peng Qi, Yuhao Zhang, Yuhui Zhang, Jason Bolton, and Christopher D. Manning. 2020. Stanza: A Python natural language processing toolkit for many human languages. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations. +Tal Schuster, Darsh Shah, Yun Jie Serene Yeo, Daniel Roberto Filizzola Ortiz, Enrico Santus, and Regina Barzilay. 2019. Towards debiasing fact verification models. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 3410-3416. +Alex Wang, Kyunghyun Cho, and Mike Lewis. 2020a. Asking and answering questions to evaluate the factual consistency of summaries. arXiv preprint arXiv:2004.04228. +Alex Wang, Kyunghyun Cho, and Mike Lewis. 2020b. Asking and answering questions to evaluate the factual consistency of summaries. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5008-5020, Online. Association for Computational Linguistics. +John Wieting and Kevin Gimpel. 2018. ParaNMT-50M: Pushing the limits of paraphrastic sentence embeddings with millions of machine translations. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 451–462, Melbourne, Australia. Association for Computational Linguistics. +Adina Williams, Nikita Nangia, and Samuel Bowman. 2018. A broad-coverage challenge corpus for sentence understanding through inference. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 1112-1122, New Orleans, + +Louisiana. Association for Computational Linguistics. +Weizhe Yuan, Graham Neubig, and Pengfei Liu. 2021. Bartscore: Evaluating generated text as text generation. arXiv preprint arXiv:2106.11520. +Jingqing Zhang, Yao Zhao, Mohammad Saleh, and Peter J Liu. 2019. Pegasus: Pre-training with extracted gap-sentences for abstractive summarization. arXiv preprint arXiv:1912.08777. +Tianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q. Weinberger, and Yoav Artzi. 2020. *Bertscore: Evaluating text generation with BERT.* In *8th International Conference on Learning Representations*, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net. +Zheng Zhao, Shay B. Cohen, and Bonnie Webber. 2020a. Reducing quantity hallucinations in abstractive summarization. In *Findings of the Association for Computational Linguistics: EMNLP* 2020, pages 2237-2249, Online. Association for Computational Linguistics. +Zheng Zhao, Shay B Cohen, and Bonnie Webber. 2020b. Reducing quantity hallucinations in abstractive summarization. arXiv preprint arXiv:2009.13312. +Ming Zhong, Pengfei Liu, Yiran Chen, Danqing Wang, Xipeng Qiu, and Xuanjing Huang. 2020. Extractive summarization as text matching. +Ming Zhong, Pengfei Liu, Danqing Wang, Xipeng Qiu, and Xuan-Jing Huang. 2019. Searching for effective neural extractive summarization: What works and what's next. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1049-1058. +Jie Zhou, Xu Han, Cheng Yang, Zhiyuan Liu, Lifeng Wang, Changcheng Li, and Maosong Sun. 2019. Gear: Graph-based evidence aggregating and reasoning for fact verification. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 892-901. +Chenguang Zhu, William Hinthorn, Ruochen Xu, Qingkai Zeng, Michael Zeng, Xuedong Huang, and Meng Jiang. 2020. Boosting factual correctness of abstractive summarization with knowledge graph. arXiv preprint arXiv:2003.08612. + +# A Appendix + +# A.1 Experimental Setup + +The training sets and trained models can be found in our github: https://github.com/zide05/AdvFact. Here we introduce the training process and model details below: + +FactCC We use the trained FACTCC model in Kryscinski et al. (2020) as the origin FACTCC. Also we train other four versions namely FACTCCsub, FACTCCadv, FACTCCref and FACTCCref-adv. All four checkers are trained with the code by Kryscinski et al. (2020) on 4 TI-TAN Xp for 15 epochs. The training batch size for eachgpu is 8 and the optimizer is AdamW with initial learning rate 2e-5. The code url can be found in https://github.com/salesforce/factCC. + +DAE We use DAE in Goyal and Durrett (2020) and the ELECTRA based DAE which trained on training set consists of paraphrase data, synonym data and hallucination data are included. The trained model and code can be found in https://github.com/tagoyal/dae-factuality. + +NLI transferred models We train three NLI transferred models (MNLIBERT, MNLIROBERTA and MNLIELECTRA) on MNLI dataset (Williams et al., 2018) and the samples with neutral label are deleted for fair comparison. Every model is trained on 4 TITAN Xp for 15 epochs. We choose the AdamW as optimizer and set the learning rate to 2e-5. The training batch size for eachgpu is 8. The code and the trained checkpoints can be found in our github https://github.com/zide05/AdvFact. + +FEQA The trained FEQA in (Durmus et al., 2020) are used in this paper and the checkpoints and codes can be found in https://github.com/esdurmus/feqa. + +# A.2 Experimental Results + +Detailed information for baseline and diagnostic datasets. We introduce the basic information for the baseline datasets in Tab. 7. The more detailed statistics for baseline and diagnostic datasets are displayed in Tab. 11. + +![](images/bded3d24c9033cfc75ae773a1c489980e042c7d91391f27df6f4e643db15e02e.jpg) +Figure 2: The overall accuracy performance of six representative factuality checkers. + +Detailed holistic meta-evaluation Following conclusions can be drawn from the holistic meta-evaluation results in Fig. 2: + +(1) FACTCC has achieved the best performance in most of the test sets except in FaithFact. The reason for this is that the claims in this set are highly paraphrased (novelty of it is $99.2\%$ in Tab. 7) thus will mislead FACTCC which is trained on less abstractive claims (CNNDM-G as shown in Tab. 10). +(2) FEQA underperforms FACTCC most of the time. In FaithFact, however, FEQA gets higher accuracy. Because the claims in FaithFact are highly paraphrased, thus FEQA tends to label samples as factually inconsistent. On the other hand, the negative samples account for $92\%$ in FaithFact. Thus the tendency of producing negative labels helps to improve the accuracy of FEQA. (3) With the same pre-trained model ELECTRA, DAE outperforms MNLIELECTRA in FaccTe and QagsC. However DAE with dependency information doesn't show constant superiority over NLI based model MNLIELECTRA in all evaluation sets. It shows especially worse performance in FaithFact. Opposite to FEQA, DAE averages the factuality scores of all dependency arc triples as the claim-level factuality score, which is biased towards the label of factually correct. Therefore it will obtain lower accuracy in the test set with more negative samples. + +
Base Test SetsDataset typeNov.#Sys.
DocAsClaimCNNDM0.00
RefAsClaimCNNDM77.70
FaccTeCNNDM5410
QagsCCNNDM28.61
RankTeCNNDM52.53
FaithFactXSum99.25
+ +Table 7: The basic statistics of baseline test sets. Dataset type means the dataset that source document and summary belong to. Here, CNNDM means CNN/DailyMail dataset. Nov.(%) means the proportion of trigrams in claims that don't exist in source documents. #Sys. represents the number of summarization systems that the output summaries come from. + +Adversarial trained FACTCC model details. The detailed training set composition of adversarial trained FACTCC models are presented in Tab. 8. + +Quality examination of diagnostic evaluation sets. Tab. 9 shows the ratio of generated claims + +
ModelsBase\( Adv_{base} \)Ref\( Adv_{ref} \)
FactCCorigin (100 m)×××
FactCC\( _{sub} \)sub (50 m)×××
FactCC\( _{sub}^{adv} \)sub (50 m)××
FactCC\( _{sub}^{ref} \)sub (50 m)×
FactCC\( _{sub}^{refadv} \)sub (50 m)
+ +that are grammatically correct and maintains correct label. + +Table 8: Data augmented models and their corresponding training data set composition. Base and Ref represent the base training set and augmented data using references as claims. $\mathrm{Adv}_{\mathrm{base}}$ and $\mathrm{Adv}_{\mathrm{ref}}$ mean the adversarial augmented data based on the base training data and reference augmented data respectively. + +
Trans.CoLabel (%)CoGrammar (%)
AntoSub9084
NumEdit9890
EntRep9692
SynPrun9082
+ +Table 9: Quality examination of four diagnostic evaluation sets. "CoLabel" and "CoGrammar" represent the correctness rate of automatically generated labels and grammar. + +
ModelsTypeTrain data
MNLIBERTNLI-SMNLI
MNLIROBERTANLI-SMNLI
MNLIELECTRANLI-SMNLI
DAENLI-APARANMT-G
FACTCCNLI-SCNNDM-G
FEQAQAQA2D, SQuA
+ +Table 10: The model types and training data of factuality metrics. NLI-A and NLI-S represent NLI-based metrics defining facts as dependency arcs and span respectively. PARANMT-G and CNNDM-G mean the automatically generated training data from PARANMT (Wieting and Gimpel, 2018) and CNN/DailyMail (Nallapati et al., 2016) + +
Evaluation SetDocAsClaimRefAsClaimFacTe
Transf.OriginAntoSubNumEditEntRepSynPrunOriginAntoSubNumEditEntRepSynPrunOriginAntoSubNumEditEntRepSynPrun
# PosSam.1149002706193695331000002091553745724410102118245
# NegSam.02648712477488000141319530232210626704133220
# Sam.11490264871518368169533100001413111621287584572503670515440245
AvgText778.78787.67766.58785.08764.70817.28836.23821.39816.35821.65760.28767.48714.59796.92737.69
AvgClaim23.3228.3129.0828.5823.5514.4516.1716.9215.8112.7016.7520.1219.9818.4716.45
Evaluation SetQagsCRankTeFaithFact
Transf.OriginAntoSubNumEditEntRepSynPrunOriginAntoSubNumEditEntRepSynPrunOriginAntoSubNumEditEntRepSynPrun
# PosSam.4010100134351100102122015401830816118
# NegSam.103711515405071164610985660214936386980
# Sam.504711615539351107216461310767540233236394114118
AvgText356.40360.21360.15353.54360.59816.19795.37805.08805.87842.13440.45768.372385.571152.77425.81
AvgClaim17.9922.6221.2120.3017.7417.2920.4621.6820.0418.0121.0822.4224.9323.3716.33
+ +Table 11: The detailed statistics of baseline (gray) and diagnostic test sets. # PosSam., # NegSam. and # Sam. represent the numbers of positive samples, negative samples and all samples respectively. AvgText and AvgClaim mean the average token length of texts and claims. \ No newline at end of file diff --git a/arefactualitycheckersreliableadversarialmetaevaluationoffactualityinsummarization/images.zip b/arefactualitycheckersreliableadversarialmetaevaluationoffactualityinsummarization/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..be34a9943c0ea9403d1e7b48428a5af47db720db --- /dev/null +++ b/arefactualitycheckersreliableadversarialmetaevaluationoffactualityinsummarization/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb5b59da0e9599ac339f9c9d978f1e2f661ed1c01978b9d787cb1706940f7aee +size 664425 diff --git a/arefactualitycheckersreliableadversarialmetaevaluationoffactualityinsummarization/layout.json b/arefactualitycheckersreliableadversarialmetaevaluationoffactualityinsummarization/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..281fc619359800dbeadaf418c0b18fa574390de0 --- /dev/null +++ b/arefactualitycheckersreliableadversarialmetaevaluationoffactualityinsummarization/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:635ad233fda4e1180c404890929062dbc0e326cba42224fea286d0689f002a40 +size 370014 diff --git a/argumentationdrivenevidenceassociationincriminalcases/cb3ae3b0-3e8a-473e-9efa-f298774425ef_content_list.json b/argumentationdrivenevidenceassociationincriminalcases/cb3ae3b0-3e8a-473e-9efa-f298774425ef_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..3a0f647f25654af8a8273fb37bb2d0c8a0efec84 --- /dev/null +++ b/argumentationdrivenevidenceassociationincriminalcases/cb3ae3b0-3e8a-473e-9efa-f298774425ef_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:391e14acd1c8788ace55d21d9bccff760a249762864e6f6fae377a351f25d14f +size 36782 diff --git a/argumentationdrivenevidenceassociationincriminalcases/cb3ae3b0-3e8a-473e-9efa-f298774425ef_model.json b/argumentationdrivenevidenceassociationincriminalcases/cb3ae3b0-3e8a-473e-9efa-f298774425ef_model.json new file mode 100644 index 0000000000000000000000000000000000000000..65980e295ed5fae874a721bbf0c0bf5256feffc7 --- /dev/null +++ b/argumentationdrivenevidenceassociationincriminalcases/cb3ae3b0-3e8a-473e-9efa-f298774425ef_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6de40c9f40d5b2f8e60ab699fa4670db4b17c93401f4814a468c6f255ec0defb +size 45857 diff --git a/argumentationdrivenevidenceassociationincriminalcases/cb3ae3b0-3e8a-473e-9efa-f298774425ef_origin.pdf b/argumentationdrivenevidenceassociationincriminalcases/cb3ae3b0-3e8a-473e-9efa-f298774425ef_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c96e7b8f331d4567b9f310e0b00bc64041600b74 --- /dev/null +++ b/argumentationdrivenevidenceassociationincriminalcases/cb3ae3b0-3e8a-473e-9efa-f298774425ef_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d150f658d58bbb91fd2b7091446edf490b59b210c433910d623542a3ab6c3714 +size 858655 diff --git a/argumentationdrivenevidenceassociationincriminalcases/full.md b/argumentationdrivenevidenceassociationincriminalcases/full.md new file mode 100644 index 0000000000000000000000000000000000000000..499d3507dd80cebac8df3ce2dbba14098dfd5e7c --- /dev/null +++ b/argumentationdrivenevidenceassociationincriminalcases/full.md @@ -0,0 +1,158 @@ +# Argumentation-Driven Evidence Association in Criminal Cases + +Yefei Teng and Wenhan Chao + +School of Computer Science and Engineering, Beihang University, Beijing, China + +flyxdoimp@gmail.com + +chaowenhan@buaa.edu.cn + +# Abstract + +Evidence association in criminal cases is dividing a set of judicial evidence into several non-overlapping subsets, improving the interpretability and legality of conviction. Observably, evidence divided into the same subset usually supports the same claim. Therefore, we propose an argumentation-driven supervised learning method to calculate the distance between evidence pairs for the following evidence association step in this paper. Experimental results on a real-world dataset demonstrate the effectiveness of our method. + +# 1 Introduction + +Previous work has put forward multiple legal assistant systems with various functions, such as searching relevant cases given the query (Chen et al., 2013), predicting the legal judgement (Ye et al., 2018), etc. Despite promising results in this area, the research of judicial evidence in criminal cases has been omitted in recent years. The role of judicial evidence is to support several sub-claims in favour of conviction and the evidence description is an essential part of criminal judgement documents. However, the organization of evidence varies in different legal documents. The form of evidence association mainly includes collection form and argumentation-driven form as shown in Figure 1. In most current criminal judgement documents, the evidence is only listed in the form of a collection without giving explicit claims, which is regarded as collection form. However, evidence collection is divided into several subsets according to related claim only in around $5\%$ criminal judgement documents, which is regarded as argumentation-driven form. + +As shown in Figure 1, evidence divided into the same subset could support the same claim and such kind of legal documents have better readability. Inspired by this observation, we propose to study the problem of evidence association in this paper. + +Evidence association is dividing a set of judicial evidence into several non-overlapping subsets according to their corresponding claims, improving the interpretability and legality of conviction. To our knowledge, there has been very limited research about evidence association in the legal field. + +Evidence association could be treated as a clustering problem. Existing short text clustering methods broadly fall into two categories: representation-based methods and semantic textual similarity methods(Xu et al., 2017; Reimers et al., 2019). The representation-based methods concentrate on extracting rich semantic representation and then calculate cosine distance between text representations. The semantic textual similarity methods predict the distance between texts directly through supervised learning. However, the former methods perform poorly on the very short text and the latter methods require manually labelled data in the same field for supervised learning. We learn distance metric based on the probability supporting the same claim between evidence pairs directly on account of the short length of judicial evidence, which is regarded as an argumentation-driven method. Another challenge is that the number of clusters in each case is various. In this paper, we use agglomerative hierarchical clustering to learn the stopping threshold to avoid specifying the number of clusters. Our contributions of this paper are presented as follows: + +1. We propose a task of evidence association in criminal cases which is significant but has not been well studied before and release a real-world dataset for this task. +2. We learn the distance metric by supervised argumentation-driven method for subsequent clustering without extra manual annotation. +3. Extensive experiments conducted on a real-world dataset show the efficiency of our methods and provide a simple baseline for future research. + +# Collection Form + +证明上述事实的证据有: + +接受刑事案件登记表、立案决定书、归案情况说明、在逃人员登记表、死亡证明、户籍信息、机动车驾驶证、行驶证、交通事故认定书、民事调解书、谅解书,车辆检验报告、尸体检验报告,现场勘验检查笔录,证人宋某某的证言及被告人李宇的供述和辩解。 + +The above facts can be proved by the following evidence: criminal case registration form, the decision to file a case, fugitive registration form, the victim's death certificate, defendant's household registration information, motor vehicle driving license, the traffic accident responsibility certificate, paper of civil mediation, inspection report of the accident vehicle, postmortem examination report of victim, traffic accident scene investigation note, testimony of witnesses Song and defendant Chen's confession and explanation. + +# Argumentation-Driven Form + +证明上述事实的证据有: + +1.接受刑事案件登记表、受理道路交通事故案件登记表、立案决定书、取保候审决定书证实;本案报案、立案及丁光富被采取强制措施的情况。 +2.常住人口信息资料证实:丁光富达到完全刑事责任年龄及身份信息。 +3.车辆检验鉴定报告书、鉴定意见告知书证实:小型客车制动性能良好; + +The above facts can be proved by the following evidence: + +(1) The registration form for accepting criminal cases, the registration form for accepting cases of road traffic accidents, the decision to file a case and the decision to obtain bail pending trial prove that the situation of the file and the compulsory measures for Ding; +(2) The resident population information prove that Ding has reached the age of full criminal responsibility and identity information; +(3) The vehicle inspection appraisal report and appraisal opinion notice prove that the braking performance of small passenger cars is well; + +Figure 1: A real-word example of evidence descriptions in argumentation-driven form and collection form. The part before "prove that" is the evidence subset and the part after "prove that" is the corresponding claim. + +# 2 Related works + +The evidence association task is motivated by previous research on the legal assistant system, especially by the work of improving the interpretability of charge prediction (Ye et al., 2018). To our knowledge, there has been very limited research about evidence associations in the legal field. One of the most related research work was done by Poudyal et al. (2018). They use clustering techniques to identify argumentative sentences in legal documents, whereas it is a sentence-level task. + +As a part of argument mining, argument clustering aims to identify similar arguments. Boltužić and Šnajder (2015) identifies similar arguments in online debates using semantic textual similarity. Ajjour et al. (2019) groups arguments that emphasize a specific aspect of a controversial topic. Contextualized word embeddings methods are introduced in the classification and clustering of arguments in recent years (Reimers et al., 2019). In this paper, we mainly used the BERT(Devlin et al., 2019) and ESIM(Chen et al., 2017) model to learn the distance metric between evidence pairs. + +# 3 Methodology + +Given a set of evidence $E = \{e_1, e_2, \dots, e_n\}$ involved with a criminal case, we expect to split the $E$ into $k$ non-overlapping subsets $\{E_1, E_2, \dots, E_k\}$ iff. $\bigcup_{t}^{k} E_t = E, E_i \cap E_j = \emptyset, 1 \leq i < j \leq k$ . Each non-overlapping subset of evidence $E_k$ proves the same claim $c_k$ . We firstly study the latent argumentation-driven evidence association in the case of lacking explicit claims. We also explored how to associate evidence more accurately in the case of giving the + +explicit claim set $C = \{c_1, c_2, \dots, c_k\}$ involved in the criminal case. Similarly, we define it as an explicit argumentation-driven evidence association. A suitable clustering method and a meaningful distance between evidence pairs are crucial for evidence association. + +# 3.1 Clustering Method + +It is a prior that the number of clusters in each case is various so that we can not set a specific cluster number like the K-Means method. We try to cluster evidence via agglomerative hierarchical clustering (Day and Edelsbrunner, 1984), which learns a stopping threshold that determines when to stop merging two clusters without giving the specific number of clusters. + +# 3.2 Distance Metric + +# Latent Distance + +Without giving the explicit claims, we can only use the information of the evidence pairs to calculate the distance between them. Nogueira and Cho (2019) define the correlation between relevant query-passage pairs as 0 and irrelevant query-passage pairs as 1 on account of the lack of labeled dataset. Similarly, we assume a smaller distance between two pieces of evidence that support the same claim. For simplification, the distance between evidence pairs that supports the same claim is labeled to 0. And the distance between evidence pairs involved in the same criminal case that prove different claims is labeled to 1. If $p$ is the possibility that the distance between evidence pairs is 0 predicted by the model, then we simply regard the latent distance between evidence pairs as $1 - p$ . + +![](images/0432fa965a2162df15f98269863cc7fc3e251c246dc7eff56fa0be420fb32193.jpg) +Figure 2: An example of pre-processed samples. The superscript of the claim text represents the ID number of the claim. The superscript of the evidence text represents which claim the evidence can support. + +# Explicit Distance + +There is strong relevance between evidence and the corresponding claim. For example, the traffic accident responsibility certificate can support the division of responsibility for traffic accidents. Therefore, we assume a higher relevance score between evidence and the corresponding claim. Similar to the sampling method mentioned above, the relevance score between evidence and the corresponding claim is 1 and the relevance score between evidence and any other claim is 0. + +For a given criminal case, there is a evidence set denoted as $E = \{e_1, e_2, \dots, e_n\}$ and a claim set denoted as $C = \{c_1, c_2, \dots, c_m\}$ . Models predict a relevance score matrix denoted as $A \in \mathbb{R}^{n \times m}$ . Each element $a_{ij}$ in matrix $A$ means the relevance score between the evidence $e_i$ and the claim $c_j$ . We assume that evidence belonging to the same cluster have a similar relevance score distribution. More specifically, suppose the relevance score distribution of evidence $e_1$ is $P \in \mathbb{R}^{1 \times m}$ , where each element $P_j$ is the relevance score between evidence $e_1$ and claim $c_j$ . Similarly, $Q \in \mathbb{R}^{1 \times m}$ is the relevance score distribution of evidence $e_2$ . We view Jensen-Shannon divergence (Endres and Schindelin, 2003) between these two distributions as the explicit distance between $e_1$ and $e_2$ . + +# Ensemble Distance + +The latent distance only uses the semantic information between the evidence texts to calculate the similarity. The explicit distance only uses the inference relationship between evidence and claim to calculate the distance between evidence. We try to use the semantic information between the evidence and the inference information between the evidence and the claim at the same time by fusing these two methods. We define the ensemble distance as the weighted sum of these two distances. + +Table 1: Statistics of our dataset + +
Avg. number of evidence16.2
Avg. number of claim11.9
Avg. length of evidence10.7
Avg. length of claim45.5
+ +# 4 Experiments + +# 4.1 Datasets + +We construct a new dataset from the published legal documents in China Judgements Online1. We selected the legal documents where the evidence description is the argumentation-driven form as shown in Figure 1 for experiments. For those evidence descriptions of argument-driven form, we can extract the evidence and corresponding claims without manual annotation easily. A subset of evidence and the corresponding claim are always on the same line. The part before "prove that" is the evidence subset and the part after "prove that" is the corresponding claim. Evidence in the same subset is usually separated by punctuations. After pre-processing, each judicial evidence description sample can be composed of an evidence set and a claim set as the illustration of our data in Figure 2. + +We select 500 cases of the Traffic Accident Crime, which is one of the most frequent criminal charges. We counted the average number of judicial evidence and claims per case. The average length of evidence and claims of Chinese characters are calculated. The detailed statistical results of the datasets are shown in Table 1. + +# 4.2 Experimental Setup + +We calculate the cosine distance between the average word GloVe embeddings of evidence pairs as a baseline. We mainly adopt ESIM and BERT to predict the distance via supervised learning. + +ESIM. We tokenize the Chinese texts with the open-source tool of HanLP² and use the Glove + +![](images/84ea181fdb471232f9ea9f3aa158aa3cb7724514713f49ab8166e3404d377498.jpg) +Figure 3: An example of clustering results via different distance metrics. The superscript of the evidence text represents which claim the evidence can support and evidence with the same superscript should be grouped together. + +(Pennington et al., 2014) word embedding trained on the corpus crawled from China Judgements Online with the embedding size of 300. We trained the model for 20 epochs, with a learning rate of 1e-4, a hidden size of 300, and a batch-size of 32. + +BERT. We concatenate evidence pairs (evidence-claim pairs while calculating explicit distance, both separated by a special [SEP] token) and add a sigmoid layer to the special [CLS] token. We only fine-tune the last two layers of the BERT model for 10 epochs with a learning rate of 5e-5 and a batch-size of 32. + +We choose the weights between latent and explicit distance after testing the results of different proportions. + +The agglomerative hierarchical clustering method has a stopping threshold parameter. We choose the best parameter on the validation dataset in the range of 0 to 0.2 with a step size of 0.001. To ensure the stability of the experimental results, we evaluate methods via 5-fold cross-validation. + +# 4.3 Result and Analysis + +As the constructed datasets include ground truth cluster labels, we adopt the Adjusted Rand Index(ARI)(Hubert and Arabie, 1985) and the Adjusted Mutual Information(AMI)(Vinh et al., 2009) to evaluate the clustering performance. + +Table 2 presents the experiment results. Encouragingly, compared with unsupervised methods, the performance of any one of the supervised methods is much higher. Meanwhile, the BERT model outperforms the ESIM model. Firstly, the deeper neural network produces better performance. Another possible reason may be that the evidence pairs supporting the same claim have a co-occurrence tendency, which could be learned by the next sen + +Table 2: The clustering results + +
MetricsARIAMI
Unsupervised Methods(Average Embeddings)
GloVecosine0.1690.204
Supervised Methods
ESIMdistlatent0.5820.599
distexplicit0.5190.540
distensemble0.6330.646
BERTdistlatent0.6030.611
distexplicit0.5340.555
distensemble0.6430.656
+ +tence prediction task of the BERT model. The performance of latent distance is better than the explicit distance because it utilizes the semantic information between evidence pairs. The clustering result via the ensemble distance has a great improvement than any single distance owing to integrating the relationship between evidence pairs and evidence-claim pairs. + +As shown in Figure 3, claims 1 and 2 represent the victim's date of birth and death, respectively. Both the victim's household registration certificate and the victim's death certificate can partly support the victim's identification information, and they were clustered together by mistake while using latent distance because no explicit claims were given so that only the semantic relationship between evidence pairs are used. Claims 4 and 5 are similar and they are both descriptions of the scene of a traffic accident. The defendant Wang's confession and the testimony of witness Dong are clustered together by mistake because almost no semantic relationship between evidence pairs is considered while using explicit distance. The clustering result + +via the ensemble distance is correct via combining the semantic relationship between evidence pairs and the information introduced by explicit claims. + +# 5 Conclusion + +In this paper, we propose a novel task of evidence association. The experiment results show that supervised methods significantly improve the clustering results even with a few training data. The clustering results have been greatly improved by introducing the information from explicit claims. Since explicit claims are not given in most cases, we are now studying how to model the claims through the fact description of the case in order to take advantage of the improvement of explicit claims. + +# Ethics Statement + +The dataset constructed in this paper is from China Judgements Online3, which is an official legal documents website. The names of all participants in the dataset are anonymized before being published online. And there are already lots of datasets constructed from this website used in Chinese law-related research. We do not perform analysis at the user level rather than the evidence level, which is less intrusive for specific people. Finally, This technology mainly plays an auxiliary role to provide a reference for judges rather than play a decisive role. + +# References + +Yamen Ajjour, Milad Alshomary, Henning Wachsmuth, and Benno Stein. 2019. Modeling frames in argumentation. In EMNLP/IJCNLP. +Filip Boltužić and Jan Šnajder. 2015. Identifying prominent arguments in online debates using semantic textual similarity. In Proceedings of the 2nd Workshop on Argumentation Mining, pages 110-115. +Qian Chen, Xiaodan Zhu, Zhen-Hua Ling, Si Wei, Hui Jiang, and Diana Inkpen. 2017. Enhanced lstm for natural language inference. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1657-1668. +Yen-Liang Chen, Yi-Hung Liu, and Wu-Liang Ho. 2013. A text mining approach to assist the general public in the retrieval of legal documents. Journal of the American Society for Information Science and Technology, 64(2):280-290. + +William HE Day and Herbert Edelsbrunner. 1984. Efficient algorithms for agglomerative hierarchical clustering methods. Journal of classification, 1(1):7-24. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 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, Volume 1 (Long and Short Papers), pages 4171-4186. +Dominik Maria Endres and Johannes E Schindelin. 2003. A new metric for probability distributions. IEEE Transactions on Information theory, 49(7):1858-1860. +Lawrence Hubert and Phipps Arabie. 1985. Comparing partitions. Journal of classification, 2(1):193-218. +Rodrigo Nogueira and Kyunghyun Cho. 2019. Passage re-ranking with bert. arXiv preprint arXiv:1901.04085. +Jeffrey Pennington, Richard Socher, and Christopher Manning. 2014. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pages 1532-1543. +Prakash Poudyal, Teresa Gonçalves, and Paulo Quaresma. 2018. Using clustering techniques to identify arguments in legal documents. +Nils Reimers, Benjamin Schiller, Tilman Beck, Johannes Daxenberger, Christian Stab, and Iryna Gurevych. 2019. Classification and clustering of arguments with contextualized word embeddings. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 567-578. +Nguyen Xuan Vinh, Julien Epps, and James Bailey. 2009. Information theoretic measures for clusterings comparison: is a correction for chance necessary? In Proceedings of the 26th annual international conference on machine learning, pages 1073-1080. +Jiaming Xu, Bo Xu, Peng Wang, Suncong Zheng, Guanhua Tian, and Jun Zhao. 2017. Self-taught convolutional neural networks for short text clustering. Neural Networks, 88:22-31. +Hai Ye, Xin Jiang, Zhunchen Luo, and Wenhan Chao. 2018. Interpretable charge predictions for criminal cases: Learning to generate court views from fact descriptions. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 1854-1864. \ No newline at end of file diff --git a/argumentationdrivenevidenceassociationincriminalcases/images.zip b/argumentationdrivenevidenceassociationincriminalcases/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d4eba0fcfc5dc282a70e46192d6d6af4bd203c2c --- /dev/null +++ b/argumentationdrivenevidenceassociationincriminalcases/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:486867615c6a4afbf7f30566acdb9700dbb67cf45a3fe8d8eb6df02784eaa823 +size 155294 diff --git a/argumentationdrivenevidenceassociationincriminalcases/layout.json b/argumentationdrivenevidenceassociationincriminalcases/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..53e06112c9f38faae0b74ec745d65a40f066c71d --- /dev/null +++ b/argumentationdrivenevidenceassociationincriminalcases/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d9b57055c84dea3f4211e2afe6687f3048c8f03f940762099345beaa25dd89a +size 171872 diff --git a/aspectbasedsentimentanalysisinquestionansweringforums/4c4ce4b9-3188-42ab-a677-702b5fd8d23d_content_list.json b/aspectbasedsentimentanalysisinquestionansweringforums/4c4ce4b9-3188-42ab-a677-702b5fd8d23d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..3a50cc67bf5ae26252e7b322d262d3f1705a642d --- /dev/null +++ b/aspectbasedsentimentanalysisinquestionansweringforums/4c4ce4b9-3188-42ab-a677-702b5fd8d23d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f3aa017d4440894241c17f548a917afa53f7ff5f6641c9e6feb76df131a91d52 +size 74396 diff --git a/aspectbasedsentimentanalysisinquestionansweringforums/4c4ce4b9-3188-42ab-a677-702b5fd8d23d_model.json b/aspectbasedsentimentanalysisinquestionansweringforums/4c4ce4b9-3188-42ab-a677-702b5fd8d23d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d8b8aebbd64c8b9c9be607d2ed64d9f60decb571 --- /dev/null +++ b/aspectbasedsentimentanalysisinquestionansweringforums/4c4ce4b9-3188-42ab-a677-702b5fd8d23d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2aeb839e09acc238d10f5b3896cdc80cb2a6846f9491fc827cbb5bd69143a4b3 +size 89612 diff --git a/aspectbasedsentimentanalysisinquestionansweringforums/4c4ce4b9-3188-42ab-a677-702b5fd8d23d_origin.pdf b/aspectbasedsentimentanalysisinquestionansweringforums/4c4ce4b9-3188-42ab-a677-702b5fd8d23d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..28eddd328427dee4ef72b7ff37cc3086fc832c69 --- /dev/null +++ b/aspectbasedsentimentanalysisinquestionansweringforums/4c4ce4b9-3188-42ab-a677-702b5fd8d23d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dcce22fe4534ed11b8d188ba37cb22fa956fb1bf488502635bf74870e79b4ba1 +size 1890707 diff --git a/aspectbasedsentimentanalysisinquestionansweringforums/full.md b/aspectbasedsentimentanalysisinquestionansweringforums/full.md new file mode 100644 index 0000000000000000000000000000000000000000..b9b9f5e71d8b4712be2879f9639387209c82eed2 --- /dev/null +++ b/aspectbasedsentimentanalysisinquestionansweringforums/full.md @@ -0,0 +1,330 @@ +# Aspect-based Sentiment Analysis in Question Answering Forums * + +Wenxuan Zhang $^{1}$ , Yang Deng $^{1}$ , Xin Li $^{2}$ , Lidong Bing $^{2}$ and Wai Lam $^{1}$ + +1The Chinese University of Hong Kong + +$^{2}$ DAMO Academy, Alibaba Group + +{wxzhang, ydeng, wlam}@se.cuhk.edu.hk + +{xinting.lx,l.bing}@alibaba-inc.com + +# Abstract + +Aspect-based sentiment analysis (ABSA) typically focuses on extracting aspects and predicting their sentiments on individual sentences such as customer reviews. Recently, another kind of opinion sharing platform, namely question answering (QA) forum, has received increasing popularity, which accumulates a large number of user opinions towards various aspects. This motivates us to investigate the task of ABSA on QA forums (ABSA-QA), aiming to jointly detect the discussed aspects and their sentiment polarities for a given QA pair. Unlike review sentences, a QA pair is composed of two parallel sentences, which requires interaction modeling to align the aspect mentioned in the question and the associated opinion clues in the answer. To this end, we propose a model with a specific design of cross-sentence aspect-opinion interaction modeling to address this task. The proposed method is evaluated on three real-world datasets and the results show that our model outperforms several strong baselines adopted from related state-of-the-art models. + +# 1 Introduction + +Aspect-based sentiment analysis (ABSA) usually involves two sub-tasks including aspect term extraction (ATE) and aspect sentiment classification (ASC) (Liu, 2012; Pontiki et al., 2014). For an example sentence "The feel of the restaurant was crowded but the food is great.", ATE is to detect the mentioned aspects "feel" and "food", whereas supposing aspects are given, ASC predicts their sentiment polarities as negative and positive respectively. Given the broad application scenarios, the two sub-tasks (He et al., 2017; Sun et al., 2019; Tulkens and van Cranenburg, 2020) and their joint + +Q: How about the screen? Is this phone's battery life durable? Thanks in advance! +A: Not as large as I thought. But the battery is quite good, I like it. + +
TASKINPUTOUTPUT
ATE-QAQA pair[screen]; [battery life]
ASC-QAQA pair + [screen]NEG
QA pair + [battery life]POS
ABSA-QAQA pair[screen]NEG[battery life]POS
+ +Figure 1: Demonstrations of ABSA-QA task and its two sub-tasks including ATE-QA and ASC-QA. + +prediction (Li et al., 2019a; Chen and Qian, 2020a; Mao et al., 2021; Zhang et al., 2021) have received increasing attention in recent years. + +Most existing ABSA studies focus on a single opinionated sentence such as the customer review (Pontiki et al., 2014, 2015). Besides product reviews, another kind of opinion sharing platform, namely question answering (QA) forum, has been provided on many E-commerce websites, due to the rising demand for users and sellers to communicate with the former buyers to obtain their opinions towards various aspects of the concerned product (Zhang et al., 2020b). Thus, investigating the ABSA task on such QA forums (denoted as ABSA-QA) can be a meaningful problem for revealing the rich opinion information from those QA pairs. + +Several attempts have been made on analyzing the sentiment information in QA forums. However, they either predict an overall sentiment polarity towards the entire QA pair (Shen et al., 2018; Hu et al., 2020) or only consider partial ABSA-QA problems. For example, Wang et al. (2019) tackle the ASC-QA task under the assumption that the targeted aspects are given. As illustrated in Figure 1, they perform aspect-level sentiment classification according to both of the QA pair and the input aspect. However, obtaining the discussed aspects is not a trivial task, which is especially difficult + +for those QA pairs involving multiple aspects. Inspired by previous success on jointly solving the two sub-tasks in review-oriented ABSA (He et al., 2019; Luo et al., 2019; Chen and Qian, 2020a), we aim to handle the ABSA-QA task in a similar unified setting in this work1. As shown in Figure 1, given a question-answer pair, our goal is to jointly detect the discussed aspect(s) and predict their corresponding sentiment polarities. + +To tackle the ABSA-QA task, an intuitive idea would be concatenating the question and answer sentence, then employing the existing ABSA models to solve it. However, the question and answer sentence are two parallel sequences, therefore, simply concatenating them cannot produce a semantic-fluent expression. In such a concatenation, the aspect terms and their corresponding opinion words do not appear next or near to each other, making the position clue utilized by many ABSA models, i.e., the aspect modifier is closer to the corresponding aspect term in the sentence, invalid (Hu et al., 2019; He et al., 2019). To make matters worse, it will result in wrong proximity relation, for instance, compared with "quite good", "not as large as" is nearer to "battery life" in the example. Meanwhile, because the opinions are expressed in an interactive manner, i.e., the question asks about one or multiple aspects and the answer expresses the opinions towards them, the aspect terms are likely to be omitted or rephrased in the answer sentence. Returning to the example in Figure 1, the aspect "battery life" is shortened to "battery" while the explicit mention of the aspect "screen" is directly omitted in the answer. This requires the model to capture the aspect-opinion interactions between the QA pair to align the concerned aspect in the question with the opinions expressed in the answer instead of simply treating them as a consecutive sequence. + +In this paper, we formulate the ABSA-QA task as a sequence labeling problem on the question text with the unified tagging scheme denoting both the aspect boundary and sentiment polarity for each word. Because of the interactive nature of QA pairs, when predicting the unified tags for the question text, it is essential to utilize the answer information to locate the aspect terms as well as predict their sentiments. To this end, we propose a novel model with cross-sentence aspect-opinion interac + +tion modeling to tackle the ABSA-QA task. Specifically, our model is built on top of the pre-trained BERT network, which has shown its effectiveness in the general ABSA problem (Hu et al., 2019; Li et al., 2019b; Chen and Qian, 2020a). Firstly, to capture the interactions between the question and answer, an inter-QA attention mechanism is employed, which aligns the aspect in the question with the corresponding opinions in the answer. A gated fusion layer is then designed for combining the information from the answer and the question itself to obtain an enriched aspect-aware question representation. Next, we employ attentive encoding to summarize the main opinion information from the answer text into the question representation and use two types of CNN layers to refine the final representation and control the sentiment consistency. Finally, the refined feature representation for each question token is fed to a linear layer to predict the unified tag. In addition to the base model described above, we exploit two auxiliary tasks to further enhance it: (i) An auxiliary aspect term extraction task is introduced to better guide the learning of the aspect-aware question representation. (ii) To improve the interaction modeling across the sentence pair, we propose to pre-train the related components with QA pair matching task for obtaining the prior knowledge on aligning two sentences. + +In summary, our main contributions are as follows: (1) We study the ABSA-QA task, aiming to jointly detect the discussed aspects and their sentiment polarities for a given QA pair. (2) We propose a model that carefully captures the cross-sentence aspect-opinion interactions and utilize two auxiliary tasks for better feature representation learning to tackle the concerned task. (3) We conduct extensive experiments on real-world datasets across three domains and the results show that our proposed model outperforms several strong baselines adopted from related state-of-the-art models. + +# 2 Methodology + +We formulate the ABSA-QA task as a sequence labeling problem on the question text and employ a unified tagging scheme: $\mathcal{Y}^u = \{\mathtt{B},\mathtt{I},\mathtt{E},\mathtt{S}\} -$ {POS, NEU, NEG} $\cup \{0\}$ to jointly denote the aspect term and its sentiment polarity for each token following (Li et al., 2019a). The former part of the tag defines the boundary of the aspect whereas the latter refers to its sentiment polarity. Given a QA pair including a question $Q = \{q_{1},q_{2},\ldots ,q_{m}\}$ and its + +![](images/2c9dd21bdbaf51e0806adb790f030ed4f51382e5a2e910ec10502036e3801bb2.jpg) +Figure 2: Architecture of our proposed model + +answer $A = \{a_{1},a_{2},\ldots ,a_{n}\}$ , we aim to detect the discussed aspects and their sentiment polarities by predicting a tag sequence $Y = \{y_{1},y_{2},\dots ,y_{m}\}$ for the question text where $y_{i}\in \mathcal{V}^{u}$ + +# 2.1 Model Overview + +The overall architecture of our proposed model is depicted in Figure 2, which mainly consists of three components, including cross-sentence aspect information fusion, answer-guided sentiment prediction, and QA matching pre-training. Given a QA pair, we first utilize inter-sentence attention to capture the interactions between the question and answer sentences for aligning the aspects with their corresponding opinion information. A gated fusion layer and a self-attention layer are then employed to fuse and refine the feature representation. To summarize the expressed opinion, we then conduct a self-attentive encoding on the answer for highlighting the sentiment. A local context encoder is then applied to maintain the sentiment consistency. Finally, the refined question representation is utilized to predict the tag sequence with the unified tagging scheme. To learn a better aspect-aware question representation, our model is jointly trained with an auxiliary aspect term extraction (ATE) task, which makes use of the attended information from the answer to help extract the discussed aspect. + +In addition, an auxiliary QA matching task aiming at measuring the relevance between a QA pair is conducted. As shown in the shaded modules in Figure 2, it utilizes the interacted representations of two sentences to make the prediction, thus its inter-QA attention module can be equipped with the knowledge of capturing the alignment of related elements between the QA pair. We adopt the pre-training strategy where the trained parameters from the QA matching task are used to initialize the certain network modules of the main model. + +# 2.2 Model Description + +We use BERT (Devlin et al., 2019) as our backbone network to obtain contextualized word representations. Given a question $Q$ and an answer $A$ , we employ BERT to transform each token $w_{i}$ to its word vector $h_i \in \mathbb{R}^{d_h}$ where $d_h$ is the hidden dimension. We denote the transformed sequences as $H^q = \{h_1^q, h_2^q, \ldots, h_m^q\}$ and $H^a = \{h_1^a, h_2^a, \ldots, h_n^a\}$ respectively, where $m$ and $n$ are their sequence lengths. Following this notation convention, we shall use capital letter such as $H^q$ to denote the matrix of the whole sequence and the corresponding lowercase letter such as $h_i^q$ to refer to the representation of the $i$ -th token hereafter. + +# 2.2.1 Cross-sentence Aspect Information Fusion + +To align the mentioned aspects with their opinion information and capture the complete semantic information of the QA pair, it requires to model the interactions across the question and answer sentences. To this end, we employ an inter-sentence attention mechanism to conduct the matching between them. Specifically, we define an attention operation $\mathrm{ATTN}(X,Y)$ between the sequence $X$ and $Y$ as follows: + +$$ +\operatorname {A T T N} (X, Y) = \operatorname {L N} (X + \mathrm {M H} - \operatorname {A T T} (X, Y, Y)) \tag {1} +$$ + +where $\mathrm{MH - ATT}(Q,K,V)$ is the multi-head attention operation described in (Vaswani et al., 2017), and LN denotes the layer normalization (Ba et al., 2016). Then we can compute an answer-attended question representation as $\bar{H}^q = \mathrm{ATTN}(H^q,H^a)$ . From the perspective of the multi-head attention mechanism, such representations can be regarded as the results of using the question as the "query" to align with the "key" in the answer so as to obtain the related opinion information, which is the "value" part. Similarly, we can also obtain + +the question-attended answer representation as $\bar{H}^a = \mathrm{ATTN}(H^a, H^q)$ . + +The matched information from the answer can well indicate the mentioned aspects. For example, it may rephrase or simply repeat the aspect term asked in the question and then present their sentiment. To combine the attended representations $\bar{H}^q$ and the original representations $H^q$ , a multi-layer perceptron is typically involved in solving the text matching task (Chen et al., 2017; Yang et al., 2019). However, since we are tackling a token-level prediction problem, such a fusion method would obscure the fine-grained feature representations. We propose a gated fusion approach to absorb the aspect information from the answer while also maintain the most salient information in each question token. Concretely, for the $i$ -th word, we have: + +$$ +g = \sigma \left(W ^ {r} h _ {i} ^ {q} + W ^ {a} \bar {h} _ {i} ^ {q} + b _ {g}\right) \tag {2} +$$ + +$$ +\tilde {h} _ {i} ^ {q} = g \odot h _ {i} ^ {q} + (1 - g) \odot \bar {h} _ {i} ^ {q} \tag {3} +$$ + +where $W^r$ and $W^a$ are trainable parameters, $\sigma$ and $\odot$ denote the sigmoid function and the element-wise multiplication respectively. The resulting $\tilde{h}_t^q$ represents the fused representation for the $i$ -th question token. The attention operation is then applied on top of it to further refine the representation after the fusion as $S = \mathrm{ATTN}(\tilde{H},\tilde{H})$ , which is in essence the self-attention module in the transformer network (Vaswani et al., 2017). + +# 2.2.2 Answer-guided Sentiment Prediction + +To more explicitly highlight the sentiment polarity expressed in the answer sentence, we next conduct self-attentive encoding on the answer text to emphasize the most important part in it: + +$$ +\alpha_ {i} = \frac {\exp (w _ {s} ^ {T} \tanh (W ^ {s} \bar {h} _ {i} ^ {a}))}{\sum_ {k = 1} ^ {n} \exp (w _ {s} ^ {T} \tanh (W ^ {s} \bar {h} _ {k} ^ {a}))} \tag {4} +$$ + +where $w_{s}\in \mathbb{R}^{d_{a}}$ and $W^{s}\in \mathbb{R}^{d_{a}\times d_{h}}$ are trainable parameters, $\alpha_{i}$ denotes the weight for the $i$ -th answer token. We then compute a fixed-size answer representation $\bar{p}$ as follows: + +$$ +\bar {p} = \sum_ {i = 1} ^ {n} \alpha_ {i} \bar {h} _ {i} ^ {a} \tag {5} +$$ + +which summarizes the main opinion information in the answer. A linear transformation is further applied to obtain a more condensed representation $p \in \mathbb{R}^{d_e}$ . We concatenate it to each question token to enlarge the sentiment information and denote + +the new question representation as $\bar{S}$ where $\bar{s}_i = [s_i;p]$ , and $[;]$ is the concatenation operation. + +Given the concatenated representations, we first adopt a point-wise CNN network to refine the feature for each question token, where the kernel size is set to one for only considering each token itself. Then another CNN layer with larger kernel size is stacked on top of it to exploit the neighboring information for each token, which helps control the sentiment consistency to avoid different sentiments are predicted for the same aspect: + +$$ +O = \operatorname {R e L U} \left(W ^ {l} * \operatorname {R e L U} \left(W ^ {t} * \bar {S} + b _ {t}\right) + b _ {l}\right) \tag {6} +$$ + +where $W^l$ and $W^t$ denote the trainable parameters of two convolutional kernels, $*$ refers to the convolution operation. $O\in \mathbb{R}^{m\times d_u}$ is the final feature representation for the entire question sequence. + +# 2.2.3 Model Training + +After obtaining the final representation $o_i$ for each question token, the probability score $\hat{y}_i$ over the unified tagging set $\mathcal{Y}^u$ can be computed through a linear layer. The cross-entropy loss $\mathcal{L}^{\mathcal{U}}$ for the main ABSA-QA task is then calculated as follows: + +$$ +\hat {y} _ {i} = \operatorname {S o f t m a x} \left(W ^ {u} o _ {i} + b _ {u}\right) \tag {7} +$$ + +$$ +\mathcal {L} ^ {\mathcal {U}} = - \sum_ {i = 1} ^ {m} y _ {i} \log (\hat {y} _ {i}) \tag {8} +$$ + +In the model described above, the ABSA-QA task is tackled with two main steps where we first focus on the aspect-level information, then predict the sentiment polarity, both with interacted answer information. To enforce better aspect-aware question representation, we incorporate the ATE task at the connection of these two phases. Concretely, the question representation $S$ is used to predict a tag sequence denoting the boundary of the aspect: + +$$ +\hat {z} _ {i} = \operatorname {S o f t m a x} \left(W ^ {z} s _ {i} + b _ {z}\right) \tag {9} +$$ + +$$ +\mathcal {L} ^ {\mathcal {T}} = - \sum_ {i = 1} ^ {m} z _ {i} \log (\hat {z} _ {i}) \tag {10} +$$ + +where $W^{z}$ is a weight matrix, $\hat{z}_i$ is the predicted score of the $i$ -th question token over the boundary tag set $\mathcal{Y}^z = \{\mathtt{B},\mathtt{I},0,\mathtt{E},\mathtt{S}\}$ , $z_{i}$ is the ground-truth label, $\mathcal{L}^T$ is the cross-entropy loss for the ATE task. Note that although the target of the ATE task is already contained in the main ABSA-QA task, augmenting the ATE task here can more explicitly guide the learning of aspect-aware question representation, helping the following components for solving the entire task. + +To train the overall framework, the loss of the main ABSA-QA task and the auxiliary ATE task are combined in a multi-task learning paradigm to form the final loss $\mathcal{L}$ : + +$$ +\mathcal {L} = \mathcal {L} ^ {\mathcal {U}} + \lambda \mathcal {L} ^ {\mathcal {T}} \tag {11} +$$ + +where $\lambda$ is a hyper-parameter to control the influence of the ATE task. + +# 2.3 Pre-training with QA Matching Task + +To better capture the cross-sentence interaction, we propose to pre-train the corresponding network modules with an auxiliary QA matching task for transferring some prior knowledge of aligning related elements between QA pairs. Specifically, after obtaining the attended representations $\bar{H}^q$ and $\bar{H}^a$ , we conduct a max-pooling on them to obtain the vector representations $v_q$ and $v_a$ : + +$$ +v _ {q} = \operatorname {M a x - P o o l} \left(\bar {H} ^ {q}\right); v _ {a} = \operatorname {M a x - P o o l} \left(\bar {H} ^ {a}\right) \tag {12} +$$ + +which are then transformed with a linear layer to obtain fixed-size vector representations containing the main semantic information, denoted as $\bar{v}_q$ and $\bar{v}_a$ respectively. The prediction layer then takes the two encoded representations to predict the matching between the QA pair following (Chen et al., 2017; Yang et al., 2019): + +$$ +\hat {x} = \mathrm {G} \left(\left[ \bar {v} _ {q}; \bar {v} _ {a}; \bar {v} _ {q} - \bar {v} _ {a}; \bar {v} _ {q} \odot \bar {v} _ {a} \right]\right) \tag {13} +$$ + +where $\mathrm{G}(\cdot)$ is a multi-layer perceptron, $\hat{x}$ is the predicted score, which can be used to calculate a cross-entropy loss with the ground-truth label to train this matching task end-to-end. Note that our main target of conducting such matching task is to equip the interaction layer with better alignment capabilities, so we keep the design of the network architecture here in a simple manner. + +Since the original QA data are already paired, i.e., the matching labels between them are always true. For each question, we randomly sample an answer of other questions in the training data to construct a "negative" QA pair. The augmented training data is then used to pre-train the interaction layer, and the trained weights are utilized as the initialization of the corresponding network parameters of the main ABSA-QA model. + +
DatasetTrainTestTotal
ELEC# QA pair36399094548
# aspect407110185089
BEAUTY# QA pair35778944471
# aspect38879644851
BAGS# QA pair36209044524
# aspect422810355263
+ +Table 1: Statistics of the datasets of three domains. + +# 3 Experiments + +# 3.1 Datasets + +We conduct experiments with QA pairs originally collected by Wang et al. (2019) from Taobao², the biggest E-commerce platform in China. It includes datasets from three product categories, namely Electronics (ELEC), Beauty (BEAUTY) and Bags (BAGS). Each QA pair is annotated with one or multiple tuples: (aspect term, polarity) where the aspect term is a span of the question text. We remove the duplicated QA pairs in the original corpus and filter out the mis-annotated data³. For each product category, we randomly split the data into training and testing set with the ratio of 8:2. During the training phase, we randomly sample $20\%$ of the training data as the development data to tune the hyper-parameters and use the rest for training. The detailed statistics of each dataset including the number of QA pairs and aspect terms are summarized in Table 1. + +The model achieving the best performance on the development set is used for evaluation on the test set. We adopt the F1 score as the main evaluation metric and also report the corresponding precision (Pre) and recall (Rec) scores. The measurement are based on exact match where a prediction is correct only when the extracted span and the predicted sentiment are both correct. Average scores over 5 runs with different random initialization are reported. + +# 3.2 Comparison Methods + +We compare with the following methods: + +BiLSTM-CRF: a baseline model with Bidirectional LSTM network as the encoding module and a CRF layer as the label decoding module. The unified tagging scheme is adopted. + +E2E-TBSA (Li et al., 2019a): an end-to-end model for tackling ATE task and ASC task simultaneously + +
ModelELECBEAUTYBAGS
PreRecF1PreRecF1PreRecF1
BiLSTM-CRF77.5470.4073.7374.2465.8769.7881.4673.8677.47
E2E-TBSA84.3677.3080.6775.5871.9273.7184.8580.9682.86
BERT-Linear81.2985.7983.4775.1180.4477.6782.1488.4885.18
BERT-GRU81.7186.4884.0278.3181.7878.4183.4288.0885.68
BERT-SAN82.7986.7684.7275.5481.1978.2583.8188.4486.06
Span-Joint85.9385.8785.8981.2179.7880.4887.1486.0486.57
Span-Pipeline84.6589.5187.0179.8981.9280.8985.3189.7187.41
BERT-QA84.4188.1986.2579.4182.7781.0585.8889.1887.49
Base Model85.9987.8786.9280.7083.3181.9987.8390.3589.07
Base+ATE86.7788.0587.3982.1983.0882.6387.6590.6989.13
Base+QA87.1188.6687.8781.9283.3182.6087.9190.9189.38
Full Model88.3988.4888.4482.8882.8682.8787.7190.8689.26
+ +Table 2: Main results of the ABSA-QA task. The best performance are in bold and the second best performance are underlined. + +with the unified tagging scheme. We use the officially released code4 to obtain the results. + +Bert-Linear (Devlin et al., 2019): the original BERT model with a single linear layer stacked on top of the last transformer block to conduct the question tagging task. + +BERT-{GRU, SAN} (Li et al., 2019b): two BERT-based models with specific ABSA layers achieving the best performance on its investigated two datasets respectively. Bert-GRU uses Gated Recurrent Unit (GRU) with additional layer normalization as the ABSA layer, while Bert-SAN model uses a single layer self-attention network. + +Span-Joint (Hu et al., 2019): a span-based model for jointly performing ATE and ASC tasks with BERT as the backbone. The "Span-Joint" variant has two output layers on top of the same encoder, one for each task. We run the released code5 to produce the results. + +Span-Pipeline (Hu et al., 2019): a state-of-the-art method for the unified ABSA task. It includes a multi-target extractor and a polarity classifier, both with BERT as the base network. Two models are separately trained and piped together to make predictions during inference. + +BERT-QA (Sun et al., 2019): It transforms the ABSA task to a sentence pair classification task6. We adopt "BERT-pair-QA-M" variant and change its output layer to conduct token-level classification. + +It serves as a strong baseline for our concerned ABSA-QA task. + +For those models using the same unified tagging scheme as ours, we concatenate the question and answer sequences as their inputs for them to utilize the answer information. + +For our proposed model, we report the results for the following variants: Base Model, which only uses $\mathcal{L}^{\mathcal{U}}$ to train the model; Base+ATE, where the base model is augmented with the ATE task using $\mathcal{L}$ as the loss function; Base+QA, where the base model is augmented with the pre-training of QA pair matching; Full Model, our full model involving both auxiliary tasks. + +# 3.3 Experimental Settings + +For baseline models using pre-trained word vectors, we use cc.zh.300. $\mathsf{vec}^8$ trained with fastText (Bojanowski et al., 2017) for fair comparison. For BERT-based models including ours, we use the same pre-trained BERT-Base, Chinese in all experiments, which includes 12 transformer layers and the hidden dimension $d_h$ is 768. For our proposed model, the parameters of BERT is further fine-tuned during the training process. + +Regarding the network architectures, the hidden dimension of the answer encoding module $d_{a}$ is 300, the dimension of the encoded answer vector $d_{e}$ is 64. For the local context capturing layer, the + +![](images/faa06fea1e2bc1a3c3fa7a71e890a6cbc30b5306cad4b01b387d9fb4aa0204f2.jpg) +Figure 3: Performance on the BEAUTY dataset of QA pairs involving single and multiple aspects respectively. + +kernel sizes are 1 and 3 respectively and the dimension of the encoded question representation is 256. $\lambda$ is set to 0.5 in Eq. 11. We also conduct dropout after the BERT encoding layer and before the output layer (in Eq. 7) with dropout rate both being 0.1. Our model is trained using Adam optimizer with the learning rate being 3e-5. The batch size is set to 25 for all datasets. The experiments are conducted on a single GeForce GTX 1080 Ti GPU. + +# 3.4 Results and Analysis + +# 3.4.1 Main Results + +Table 2 reports the performance of our proposed model and baseline methods on the concerned ABSA-QA task. We can see that our model consistently outperforms those strong baselines adopted from state-of-the-art models and gives the best F1 score across all datasets. + +Among the baseline methods, it can be observed that the BERT-QA model provides a strong baseline performance. Compared with Span-Pipeline which is a state-of-the-art ABSA model for single-sentence, BERT-QA still obtains better performance in 2 out of 3 datasets, showing the importance of explicitly considering the input data format (i.e., QA pair) rather than simply treating it as a consecutive sequence for the ABSA-QA task. Our proposed model, even the base variant, outperforms the strongest baseline in all domains, suggesting a carefully-designed cross-sentence interaction modeling is beneficial on the concerned task. Another finding is that BERT-based methods, even the simplest BERT-Linear outperforms E2E-TBSA, which is a state-of-the-art non-BERT model, demonstrating the superior power of BERT for capturing the contextual information of the input sentence. + +# 3.4.2 Impact of Two Auxiliary Tasks + +Comparing the different variants of our proposed method, assisting the base model with the ATE task achieves better performance in all domains. This + +
ELECBEAUTYBAGS
Base Model+ATE87.3982.6389.13
- w/o Q self attention87.1582.4488.85
- w/o answer encoding86.8181.8188.58
- w/o local context layer87.1082.3888.43
+ +Table 3: Ablation Study on Base Model+ATE + +result indicates that ABSA-QA can benefit from jointly learning with aspect term extraction task, which enables the model to explicitly learn a better aspect-aware question representation. Utilizing the QA pair matching task to pre-train the interaction layer also brings in some performance gain, which shows that such pre-training strategy effectively enhance the inter-sentence attention layer with better capabilities to align the aspect-opinion information across two parallel sentences. To further investigate such improvements, we report the F1 scores on the BEAUTY dataset for QA pairs containing single and multiple aspects respectively in Figure 3. We can see that there is a significant performance boosting on those difficult data instances with multiple aspects when incorporating the ATE task or QA pre-training. However, as shown in Table 2, utilizing both tasks does not necessarily lead to the best performance, e.g., the results on the BAGS dataset. This is likely due to the reason that the base model itself can already achieve good results (around $1.6\%$ absolute gain compared with BERT-QA), while the auxiliary tasks make relatively slight contribution to the final performance. + +# 3.4.3 Ablation Study + +To investigate the effectiveness of some important components of our proposed model, we conduct ablation studies on the "Base Model+ATE" variant and report F1 scores across three datasets in Table 3. As observed from the results, the model without the question self-attention ("w/o Q self attention") and without the final local context capturing layer ("w/o local context layer") both suffer from a performance decrease, showing the effectiveness of refining the feature representations after the question-answer interactions. Removing the answer sentiment encoding component ("w/o answer encoding"), i.e., using $S$ instead of $\bar{S}$ in the Eq. 6 leads to a large performance fall. This result indicates that it is effective and necessary to integrate the opinion information in the answer into the question representation for a precise sentiment classification. + +
ExamplesSpan-PipelineOurs-BaseOurs-Full
Q1: [遮痘]NEG怎么样? How about [cover acne]NEG? +A1: 痘印能遮, 痘痘遮不了。 It can cover the acne scar, cannot cover the acne.[遮痘]POS × +[cover acne]POS[遮痘]NEG √ +[cover acne]NEG[遮痘]NEG √ +[cover acne]NEG
Q2: 迹瑕哪样, [持久]NEG不?? +How about mask blemishes? Can the effect [last long]NEG? +A2: 不持久 Didn't last long.[遮瑕]POS × +[mask blemishes]POS +[持久]NEG [last long]NEG √[持久]NEG √ +[last long]NEG[持久]NEG √ +[last long]NEG
Q3: 书包的[容量]POS和[质量]POS怎么样 +How's the [capacity]POS and the [quality]POS of this backpack? +A3: 都还可以吧, 容量我是放假回家背的微电脑和5, 6件衣服的样子 +Both are okay. For the capacity, I bring a laptop and 5 or 6 clothes with me when I go home on holiday.None × +[质量]POS √ +[quality]POS[容量]POS √ +[capacity]POS +[质量]POS √ +[quality]POS[容量]POS √ +[capacity]POS +[质量]POS √ +[quality]POS
Q4: 你们的手机[质量]NEG怎么样? 我手机弯曲了。 +How's the [quality]NEG of your phones, mine is already bent. +A4: 触屏经常没反应, 数据流量很慢, 先说明我不是在偏僻的地方。Touching screen often does not react. The network flow is very slow, just be clear that I'm not in a remote area.[质量]POS × +[quality]POS[质量]POS × +[quality]POS[质量]NEG √ +[quality]NEG
+ +Table 4: Case analysis. The "Examples" column contains sample QA pairs with gold labels where words in brackets are annotated aspect terms, the subscripts denotes their sentiment polarities. "None" in predictions denotes that no aspect terms are extracted. The correct/incorrect predictions are marked with $\sqrt{}$ respectively. + +# 3.4.4 Case Analysis + +We present some sample cases including input QA pairs and predictions given by the baseline Span-Pipeline model, our proposed base model and the full model in Table 4. We can see that Span-Pipeline fails when the alignment is needed between the question and answer sentences. For example, the second answer $\mathbf{A}_2$ only comments on the "last long" aspect, thus Span-Pipeline just randomly assigns a sentiment polarity for the "mask blemishes". Regarding the third question $\mathbf{Q}_3$ , its answer expresses "okay" to both aspects mentioned in the question, but only "quality" is detected by Span-Pipeline. Our proposed model, both the base and full model successfully handle these two cases, showing the necessity to model the interactions between the given QA pairs. For the last example $\mathbf{Q}_4$ , the answer does not provide any direct comment on the asked aspects, for instance, it does not mention aspect "quality" or any related opinion term such as "bad" at all, making it difficult to predict the sentiment polarity. Our proposed full model equipped with the QA matching pre-training gives correct predictions on them, which attributes to the pre-training that brings in some prior knowledge for identifying that the answer is talking about the "quality" of the product. + +# 4 Related Work + +Aspect-based sentiment analysis (ABSA) has been extensively studied in recent years (Liu, 2012; Zhang et al., 2018). It is often decomposed into two sub-tasks. The first aspect term extraction (ATE) + +task aims to detect the mentioned aspect (He et al., 2017; Xu et al., 2019; Tulkens and van Cranenburgh, 2020; Li et al., 2020; Wei et al., 2020). The second aspect sentiment classification (ASC) task then predicts the sentiment polarity, assuming an aspect is given (Sun et al., 2019; Tang et al., 2020; Chen et al., 2020b; Zheng et al., 2020). + +Since separately handling these two tasks ignores the relations between them and leads to unsatisfactory performance, recent works attempt to solve it in a unified framework. These studies either adopt a unified tagging scheme (Li et al., 2019b,a; Hu et al., 2019) or solving them in a multi-task learning paradigm with shared feature representations (He et al., 2019; Luo et al., 2019). Recently, there are also some attempts of combining another related task, namely opinion term extraction (OTE), with the ATE and/or ASC tasks to provide a more complete understanding of the aspect-level user sentiment (Chen et al., 2020a; Zhao et al., 2020; Chen and Qian, 2020b; Liang et al., 2020; Zhang et al., 2021). + +However, most existing studies target at customer reviews (Pontiki et al., 2014, 2015) or twitter posts (Mitchell et al., 2013). Thus the proposed methods are often tailored for observations made in single-sentence situation. For example, many models consider the position clues between the aspect term and the opinion terms since they often appear next or near to each other in the reviews (Hu et al., 2019; He et al., 2019). Given the rising popularity of question answering (QA) forums (Zhang et al., 2020b,a; Deng et al., 2020), some studies aim at extracting sentiment information on them. Shen + +et al. (2018) treat the QA pair as a whole and predict its sentiment polarity. Hu et al. (2020) further consider the syntax information in QA to improve the prediction. However, these work ignore the aspect-level information and only predict "conflict" if there are multiple aspects involved. Wang et al. (2019) focus on the ASC task in the QA forums (ASC-QA) which assumes the aspect is already given for the classification. Unlike these existing work, we investigate the unified ABSA-QA task in this paper, aiming to jointly tackle the ATE-QA and ASC-QA problem. + +# 5 Conclusions + +In this paper, we investigate the aspect-based sentiment analysis in question answering forums (ABSA-QA), aiming to jointly detect the discussed aspects and their sentiment polarities for a given QA pair. We demonstrate the challenges of conducting ABSA in QA settings and propose a model with carefully designed cross-sentence aspect-opinion interaction to tackle the task. Moreover, we utilize two auxiliary tasks including aspect term extraction task for learning better aspect-aware representation and QA pair matching task to pre-train the inter-QA attention components to for better aligning the question and answer sentence. Extensive experiments are conducted on three real-world datasets, showing the superiority of our proposed model against various baselines. + +# References + +Lei Jimmy Ba, Jamie Ryan Kiros, and Geoffrey E. Hinton. 2016. Layer normalization. CoRR, abs/1607.06450. +Piotr Bojanowski, Edouard Grave, Armand Joulin, and Tomas Mikolov. 2017. Enriching word vectors with subword information. Transactions of the Association for Computational Linguistics, 5:135-146. +Qian Chen, Xiaodan Zhu, Zhen-Hua Ling, Si Wei, Hui Jiang, and Diana Inkpen. 2017. Enhanced LSTM for natural language inference. In ACL, pages 1657-1668. +Shaowei Chen, Jie Liu, Yu Wang, Wenzheng Zhang, and Ziming Chi. 2020a. Synchronous double-channel recurrent network for aspect-opinion pair extraction. In ACL, pages 6515-6524. +Xiao Chen, Changlong Sun, Jingjing Wang, Shoushan Li, Luo Si, Min Zhang, and Guodong Zhou. 2020b. Aspect sentiment classification with document-level sentiment preference modeling. In ACL, pages 3667-3677. + +Zhuang Chen and Tieyun Qian. 2020a. Relation-aware collaborative learning for unified aspect-based sentiment analysis. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, pages 3685-3694. +Zhuang Chen and Tieyun Qian. 2020b. Relation-aware collaborative learning for unified aspect-based sentiment analysis. In ACL. +Yang Deng, Wenxuan Zhang, and Wai Lam. 2020. Opinion-aware answer generation for review-driven question answering in e-commerce. In CIKM '20, pages 255-264. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: pre-training of deep bidirectional transformers for language understanding. In *NAACL-HLT*, pages 4171–4186. +Ruidan He, Wee Sun Lee, Hwee Tou Ng, and Daniel Dahlmeier. 2017. An unsupervised neural attention model for aspect extraction. In ACL, pages 388-397. +Ruidan He, Wee Sun Lee, Hwee Tou Ng, and Daniel Dahlmeier. 2019. An interactive multi-task learning network for end-to-end aspect-based sentiment analysis. In ACL19, pages 504-515. +Guangyi Hu, Chongyang Shi, Shufeng Hao, and Yu Bai. 2020. Residual-duet network with tree dependency representation for chinese question-answering sentiment analysis. In SIGIR, page 1725-1728. +Minghao Hu, Yuxing Peng, Zhen Huang, Dongsheng Li, and Yiwei Lv. 2019. Open-domain targeted sentiment analysis via span-based extraction and classification. In ACL, pages 537-546. +Kun Li, Chengbo Chen, Xiaojun Quan, Qing Ling, and Yan Song. 2020. Conditional augmentation for aspect term extraction via masked sequence-to-sequence generation. In ACL, pages 7056-7066. +Xin Li, Lidong Bing, Piji Li, and Wai Lam. 2019a. A unified model for opinion target extraction and target sentiment prediction. In AAAI, pages 6714-6721. +Xin Li, Lidong Bing, Wenxuan Zhang, and Wai Lam. 2019b. Exploiting BERT for end-to-end aspect-based sentiment analysis. In W-NUT@EMNLP, pages 34-41. +Yunlong Liang, Fandong Meng, Jinchao Zhang, Jinan Xu, Yufeng Chen, and Jie Zhou. 2020. An iterative knowledge transfer network with routing for aspect-based sentiment analysis. CoRR, abs/2004.01935. +Bing Liu. 2012. Sentiment Analysis and Opinion Mining. Synthesis Lectures on Human Language Technologies. + +Huaishao Luo, Tianrui Li, Bing Liu, and Junbo Zhang. 2019. DOER: dual cross-shared RNN for aspect term-polarity co-extraction. In ACL, pages 591-601. +Yue Mao, Yi Shen, Chao Yu, and Longjun Cai. 2021. A joint training dual-mrc framework for aspect based sentiment analysis. CoRR, abs/2101.00816. +Margaret Mitchell, Jacqui Aguilar, Theresa Wilson, and Benjamin Van Durme. 2013. Open domain targeted sentiment. In EMNLP, pages 1643-1654. +Maria Pontiki, Dimitris Galanis, Haris Papageorgiou, Suresh Manandhar, and Ion Androutsopoulos. 2015. Semeval-2015 task 12: Aspect based sentiment analysis. In SemEval@NAACL-HLT, pages 486-495. +Maria Pontiki, Dimitris Galanis, John Pavlopoulos, Harris Papageorgiou, Ion Androutsopoulos, and Suresh Manandhar. 2014. Semeval-2014 task 4: Aspect based sentiment analysis. In SemEval@COLING 2014, pages 27-35. +Chenlin Shen, Changlong Sun, Jingjing Wang, Yangyang Kang, Shoushan Li, Xiaozhong Liu, Luo Si, Min Zhang, and Guodong Zhou. 2018. Sentiment classification towards question-answering with hierarchical matching network. In EMNLP, pages 3654-3663. +Chi Sun, Luyao Huang, and Xipeng Qiu. 2019. Utilizing BERT for aspect-based sentiment analysis via constructing auxiliary sentence. In NAACL-HLT, pages 380-385. +Hao Tang, Donghong Ji, Chenliang Li, and Qiji Zhou. 2020. Dependency graph enhanced dual-transformer structure for aspect-based sentiment classification. In ACL, pages 6578-6588. +Stéphan Tulkens and Andreas van Cranenburgh. 2020. Embarrassingly simple unsupervised aspect extraction. In ACL, pages 3182-3187. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In NIPS, pages 5998-6008. +Jingjing Wang, Changlong Sun, Shoushan Li, Xiaozhong Liu, Luo Si, Min Zhang, and Guodong Zhou. 2019. Aspect sentiment classification towards question-answering with reinforced bidirectional attention network. In ACL, pages 3548-3557. +Zhenkai Wei, Yu Hong, Bowei Zou, Meng Cheng, and Jianmin Yao. 2020. Don't eclipse your arts due to small discrepancies: Boundary repositioning with a pointer network for aspect extraction. In ACL, pages 3678-3684. +Hu Xu, Bing Liu, Lei Shu, and Philip S. Yu. 2019. BERT post-training for review reading comprehension and aspect-based sentiment analysis. In NAACL-HLT, pages 2324-2335. + +Runqi Yang, Jianhai Zhang, Xing Gao, Feng Ji, and Haiqing Chen. 2019. Simple and effective text matching with richer alignment features. In ACL, pages 4699-4709. +Lei Zhang, Shuai Wang, and Bing Liu. 2018. Deep learning for sentiment analysis: A survey. Wiley Interdiscip. Rev. Data Min. Knowl. Discov., 8(4). +Wenxuan Zhang, Yang Deng, and Wai Lam. 2020a. Answer ranking for product-related questions via multiple semantic relations modeling. In ACM SIGIR, pages 569-578. +Wenxuan Zhang, Wai Lam, Yang Deng, and Jing Ma. 2020b. Review-guided helpful answer identification in e-commerce. In WWW '20, pages 2620-2626. +Wenxuan Zhang, Xin Li, Yang Deng, Lidong Bing, and Wai Lam. 2021. Towards generative aspect-based sentiment analysis. In ACL/IJCNLP 2021, pages 504-510. +He Zhao, Longtao Huang, Rong Zhang, Quan Lu, and Hui Xue. 2020. Spanplt: A span-based multi-task learning framework for pair-wise aspect and opinion terms extraction. In ACL, pages 3239-3248. +Yaowei Zheng, Richong Zhang, Samuel Mensah, and Yongyi Mao. 2020. Replicate, walk, and stop on syntax: An effective neural network model for aspect-level sentiment classification. In AAAI, pages 9685-9692. \ No newline at end of file diff --git a/aspectbasedsentimentanalysisinquestionansweringforums/images.zip b/aspectbasedsentimentanalysisinquestionansweringforums/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..41bb9beba929c5694032fe7e7544ddd8e9ec000d --- /dev/null +++ b/aspectbasedsentimentanalysisinquestionansweringforums/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3df011b2d70f35c60bb79b284fe70adca37fedb6becf8f43351714a064c36f4 +size 424151 diff --git a/aspectbasedsentimentanalysisinquestionansweringforums/layout.json b/aspectbasedsentimentanalysisinquestionansweringforums/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ee1f5f53e827b0180b90d4e44987113e113667a8 --- /dev/null +++ b/aspectbasedsentimentanalysisinquestionansweringforums/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45470bc25a24aee8b7125dd6d7c6d99a3b0d2bb54ac3443ed2a5808b056b2d9b +size 350375 diff --git a/astitchinlanguagemodelsdatasetandmethodsfortheexplorationofidiomaticityinpretrainedlanguagemodels/a2eb518a-dc42-4b13-86db-6915f9a56c79_content_list.json b/astitchinlanguagemodelsdatasetandmethodsfortheexplorationofidiomaticityinpretrainedlanguagemodels/a2eb518a-dc42-4b13-86db-6915f9a56c79_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..48f39a8ae6c53ee94a669819f33b03744367a6e0 --- /dev/null +++ b/astitchinlanguagemodelsdatasetandmethodsfortheexplorationofidiomaticityinpretrainedlanguagemodels/a2eb518a-dc42-4b13-86db-6915f9a56c79_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6054b9bca42ebe50ce2e1e88167d022304f72b36885560f889e47fe1fcc1c211 +size 97250 diff --git a/astitchinlanguagemodelsdatasetandmethodsfortheexplorationofidiomaticityinpretrainedlanguagemodels/a2eb518a-dc42-4b13-86db-6915f9a56c79_model.json b/astitchinlanguagemodelsdatasetandmethodsfortheexplorationofidiomaticityinpretrainedlanguagemodels/a2eb518a-dc42-4b13-86db-6915f9a56c79_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e9fb5aae4c5af79c665c0f36820cc5d157ebd7c3 --- /dev/null +++ b/astitchinlanguagemodelsdatasetandmethodsfortheexplorationofidiomaticityinpretrainedlanguagemodels/a2eb518a-dc42-4b13-86db-6915f9a56c79_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f7cf1c93f491e4a99d72e330d3fd70d575e2931f6622450a3de8fede3bf63a92 +size 113657 diff --git a/astitchinlanguagemodelsdatasetandmethodsfortheexplorationofidiomaticityinpretrainedlanguagemodels/a2eb518a-dc42-4b13-86db-6915f9a56c79_origin.pdf b/astitchinlanguagemodelsdatasetandmethodsfortheexplorationofidiomaticityinpretrainedlanguagemodels/a2eb518a-dc42-4b13-86db-6915f9a56c79_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2c101df6f439ce4e481f62aaf83f40607e4b76a2 --- /dev/null +++ b/astitchinlanguagemodelsdatasetandmethodsfortheexplorationofidiomaticityinpretrainedlanguagemodels/a2eb518a-dc42-4b13-86db-6915f9a56c79_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ada7f97d754679f73284291b1b87882c37e895089748dfd9913b8ff4dae1c3d5 +size 297183 diff --git a/astitchinlanguagemodelsdatasetandmethodsfortheexplorationofidiomaticityinpretrainedlanguagemodels/full.md b/astitchinlanguagemodelsdatasetandmethodsfortheexplorationofidiomaticityinpretrainedlanguagemodels/full.md new file mode 100644 index 0000000000000000000000000000000000000000..827c080496e2b2a35b2a286a866a9e248ecf0fd6 --- /dev/null +++ b/astitchinlanguagemodelsdatasetandmethodsfortheexplorationofidiomaticityinpretrainedlanguagemodels/full.md @@ -0,0 +1,328 @@ +# AStitchInLanguageModels: Dataset and Methods for the Exploration of Idiomaticity in Pre-Trained Language Models + +Harish Tayyar Madabushi, Edward Gow-Smith, Carolina Scarton and Aline Villavicencio + +Department of Computer Science, University of Sheffield United Kingdom + +{h.tayarmadabushi, egow-smithl, c.scarton, a.villavicencio} @sheffield.ac.uk + +# Abstract + +Despite their success in a variety of NLP tasks, pre-trained language models, due to their heavy reliance on compositionality, fail in effectively capturing the meanings of multiword expressions (MWEs), especially idioms. Therefore, datasets and methods to improve the representation of MWEs are urgently needed. Existing datasets are limited to providing the degree of idomaticity of expressions along with the literal and, where applicable, (a single) non-literal interpretation of MWEs. This work presents a novel dataset of naturally occurring sentences containing MWEs manually classified into a fine-grained set of meanings, spanning both English and Portuguese. We use this dataset in two tasks designed to test i) a language model's ability to detect idiom usage, and ii) the effectiveness of a language model in generating representations of sentences containing idioms. Our experiments demonstrate that, on the task of detecting idiomatic usage, these models perform reasonably well in the one-shot and few-shot scenarios, but that there is significant scope for improvement in the zero-shot scenario. On the task of representing idomaticity, we find that pre-training is not always effective, while finetuning could provide a sample efficient method of learning representations of sentences containing MWEs. + +# 1 Introduction and Motivation + +Pre-trained language models such as BERT (Devlin et al., 2019) and XLNet (Yang et al., 2019) have been widely used in a variety of Natural Language Processing tasks. Despite their success in multiple downstream applications, such as sentence classification (Zhang et al., 2019) and reading comprehension (Raffel et al., 2019), they are unable to effectively represent idiomatic multiword expressions (MWEs) (Yu and Ettinger, 2020; Garcia et al., 2021). Capturing idiomaticity is particularly challenging as the representations of words and + +phrases are explicitly designed to be compositional both in non-contextual (Mitchell and Lapata, 2010; Mikolov et al., 2013b) and contextual embedding models. Pre-trained language models in particular exploit compositionality at both the word and sub-word levels (Devlin et al., 2019) to reduce the size of their vocabulary, which makes representing idiomatic phrases particularly challenging. The effective representation of idiomatic MWEs is critical for them to be correctly interpreted in downstream tasks. Such an improvement will benefit both classification-based problems (e.g. sentiment analysis) and sequence-to-sequence tasks (e.g. machine translation). + +To this end, we present a dataset consisting of naturally occurring sentences containing potentially idiomatic MWEs and two tasks aimed at evaluating language models' ability to effectively detect and represent idiomaticity. The primary contributions of this work are: + +1. A novel dataset consisting of: + +(a) naturally occurring sentences (and two surrounding sentences) containing potentially idiomatic MWEs annotated with a fine-grained set of meanings: compositional meaning, idiomatic meaning(s), proper noun and "meta usage"; +(b) paraphrases for each meaning of each MWE; + +2. Two tasks aiming at evaluating i) a model's ability to detect idiomatic usage, and ii) the effectiveness of sentence embeddings in representing idiomaticity. Table 1 provides details of these tasks and associated subtasks, each designed to test different aspects of models. + +(a) These tasks are presented in multilingual, zero-shot, one-shot and few-shot settings. +(b) We provide strong baselines using state-of-the-art models, including experiments with one-shot and few-shot setups for idiomatic- + +ity detection and the use of the idiom principle for detecting and representing MWEs in contextual embeddings. Our results highlight the significant scope for improvement. + +
Task 1Subtask ACoarse-grained classification of examples containing idioms.
Subtask BFine-grained classification of examples into meanings.
Task 2Subtask AEffective representation of sentences containing idiomatic phrases using only pre-training.
Subtask BEffective representation of sentences using both pre-training and fine-tuning.
+ +Table 1: AStitchInLanguageModels Tasks: The two tasks and associated subtasks. + +This dataset and associated tasks have the potential to catalyse research into representing more complex elements of language beginning with idiomaticity, thus ensuring a timely stitch in language models. We call this dataset and associated tasks AStitchInLanguageModels, and make the dataset, the associated splits for each task, pre-training data, pre-trained and fine-tuned models, program code and associated processing scripts, including hyperparameters, publicly available in the interest of reproducibility and for subsequent reuse1. + +This paper is organised as follows: Section 2 presents a discussion of related work. We then present AStitchInLanguageModels consisting of the novel MWE dataset and the two associated tasks in Section 3. We discuss our experiments and results for these two tasks in Section 4, before presenting a discussion of the more interesting elements of our findings in Section 5. We present our conclusions and possible avenues of future work in Section 6. + +# 2 Related work + +The problems posed by MWEs to NLP models have been known for some time (Sag et al., 2002; Constant et al., 2017; Shwartz and Dagan, 2019). For instance, Sag et al. (2002) refer to the idiomaticity problem and place the need for effective processing of MWEs on par with that for word sense disambiguation to be able to effectively process text. While their analysis focused on symbolic methods, this problem still persists: Shwartz and Dagan (2019) showed, using six tasks, that con + +textual pre-trained language models, capable of handling polysemy, continued to be unable to effectively handle idiomatic MWEs, although they tend to do better than their non-contextual predecessors. Further experiments with probing pre-trained language models across multiple languages have also confirmed this result (Yu and Ettinger, 2020; Garcia et al., 2021). + +# 2.1 Existing Datasets + +Datasets of MWE annotated corpora include that associated with the PARSEME shared task (Savary et al., 2017) which focuses on verbal MWEs and the STREUSLE dataset (Schneider et al., 2014; Schneider and Smith, 2015; Schneider et al., 2016) which includes noun, verb, prepositional and possessive expressions including "semantic supersenses". However, most existing datasets associated with compositionality of MWEs consist of isolated phrases, labelled with overall compositionality scores (Venkatapathy and Joshi, 2005; Biemann and Giesbrecht, 2011; Farahmand et al., 2015), scores of how individual words contribute to the meaning of the MWE (Venkatapathy and Joshi, 2005), or both (Reddy et al., 2011; Cordeiro et al., 2019; Schulte im Walde et al., 2016). While most of these target only English, some include scores for other languages such as German (Schulte im Walde et al., 2016), and French and Portuguese (Cordeiro et al., 2019). + +Existing datasets of compositionality that include context often add context automatically by first selecting MWEs that are either only compositional or only idiomatic. For instance, the VNC-Token Dataset (Cook et al., 2008) consists of 53 English MWEs each with a maximum of 100 sentences extracted from the BNC, while Tu and Roth (2012) collected 1,348 sentences associated with 23 verb phrases annotated as compositional and idiomatic. Shwartz and Dagan (2019) focused on a subset of noun compounds that are only compositional or idiomatic from the dataset provided by Reddy et al. (2011) and automatically added sentences from Wikipedia. Finally, the NCS Dataset (Garcia et al., 2021) consists of 280 English and 180 Portuguese MWEs, annotated with degrees of compositionality and three sentences containing each of the MWEs. + +Despite the importance of the context surrounding an MWE, where available, context, in the form of sentences containing MWEs, is available only + +for those MWEs that are either idiomatic or compositional. This significant shortcoming makes it impossible to train models to learn to differentiate between the compositional and idiomatic usage of the same MWE. + +Finally, while existing datasets also provide paraphrases for the compositional and idiomatic meanings of MWEs (Hendrickx et al., 2013; Garcia et al., 2021), they are limited to having exactly one compositional and one idiomatic meaning, which is not always the case as is exemplified by the phrase "head hunter" which, while not having a literal usage, has multiple idiomatic meanings (i.e recruiter, baseball pitcher who aims for the head, and hunter). + +AStitchInLanguageModels is designed to alleviate these shortcomings, specifically: a) the lack of context sentences, b) the need for fine grained classification of MWEs, and a more complete set of paraphrases for all possible meanings of MWEs (Section 3). + +# 2.2 Methods + +The task of identifying idiomaticity in sentences was initially addressed by use of symbolic methods (Baldwin and Villavicencio, 2002; Sag et al., 2002), statistical properties of text such as mutual information (Lin, 1999), and latent semantic analysis (Baldwin et al., 2003). + +The subsequent adoption of distributional semantics led to the use of constituent word embeddings to determine the compositionality of phrases, such as in the work by Katz and Giesbrecht (2006) who made use of the semantic similarity between the distributional vectors associated with an MWE as a whole and those associated with its parts to determine compositionality. This is achieved by use of a single token to represent an MWE. This trend continued with the introduction of neural distributional semantic models such as word2vec (Mikolov et al., 2013a) wherein MWEs were taken as single units in learning embeddings (Mikolov et al., 2013b). This method was improved upon by use of an explicit disambiguation step prior to composition (Kartsaklis et al., 2014), and by the joint learning of compositional and idiomatic embeddings using a "compositionality scoring" function (Hashimoto and Tsuruoka, 2016). This "single token" method has the advantage of being rooted in the linguistic idiom principle (Sinclair et al., 1991), which postulates that humans process idioms by treating them as a "single independent token". + +Despite being the only method of handling MWEs and having had relative success, it is not without its shortcomings. The first is that the frequency of MWEs tends to be low (a problem that worsens with the increase in length of MWEs) and since the quality of distributional representations tends be proportional to the number of instances of a token, representations of MWEs are often lacking. The second is that non-contextual type level representations are inherently limited as MWEs often have multiple meanings, as detailed in Section 2.1. + +While contextual embeddings can handle polysemy, they fail to fully capture the meaning of MWEs as discussed earlier. How contextual embeddings fair in comparison to their non-contextual predecessors is not entirely clear as Nandakumar et al. (2019) found that they do worse on some tasks while Shwartz and Dagan (2019) found that they do better. Hashempour and Villavicencio (2020) adopted the idiom principle (MWE as a single token) with contextual language models (specifically BERT), and found that this method does not benefit transformer-based pre-trained models. However, they did not introduce a new token to represent each MWE as is required during the training of non-contextual models built on the idiom principle, but instead replaced MWEs with a single token in the input and rely on BERT's word-piece tokenizer. To the best of our knowledge this work is the first to introduce new tokens for MWEs into a contextual pre-trained language model (see Section 4.2). + +# 3 AStitchInLanguageModels: Dataset and Tasks + +To create a dataset and tasks aimed at improving language models' ability to identify and capture idomaticity, we first collected examples of MWE usage in naturally occurring sentences along with the two surrounding sentences. We then annotated these examples with a fine-grained set of meanings associated with each usage. We restrict our attention to noun compounds, a subset of idiomatic MWEs, sourced from the Noun Compound Senses (NCS) dataset (Cordeiro et al., 2019), which extends the dataset by Reddy et al. (2011). + +# 3.1 Data Collection and Annotation + +A total of 12 judges were asked to collect examples containing a list of MWEs occurring naturally in context, in both English and Portuguese. For each MWE, judges were instructed to obtain + +7 to 10 examples of each meaning ("Idiomatic", "Non-Idiomatic", "Proper Noun" and "Meta Usage") where possible, with between 20 and 30 total examples for each MWE. We define "Meta Usage" to be the literal use of an MWE in a metaphor (e.g. life vest in "Let the Word of God be our life vest to keep us afloat, so as not to drown"). Judges were additionally instructed to add to the list of possible meanings associated with each MWE based on the usage they observed when collecting examples, or to flag examples with novel usage for review by language experts. Emphasis was put on extracting high-quality examples with three contiguous sentences and correct formatting, containing no unusual characters. The data consists of excerpts of text from the web, each a maximum of three sentences, thus adhering to fair use. + +The meanings of each MWE were then paraphrased by language experts. The idiomatic paraphrases aim to concisely convey the meaning of the idiom. For example, cutting edge is paraphrased to most advanced and night owl is paraphrased to nocturnal person in the idiomatic case. The aim of the literal paraphrase is to apply a minimal lexical alteration that shifts the MWE away from its idiomatic meaning(s). For example, cutting edge is paraphrased to slicing edge and night owl is paraphrased to night hooter in the literal case. This adversarial paraphrasing is designed to test a model's ability to discern a compositional meaning from an idiomatic one, and aims to ensure that models must have a nuanced understanding of idiomaticity for them to be successful. Examples of the annotated data are shown in Table 2. + +Finally, each example was annotated with a label and corresponding paraphrase by two judges. The Cohen's kappa coefficient of inter-rater reliability was 0.887 for English and 0.807 for Portuguese. We note that a significant proportion of disagreements arose from a difference in interpretation of the "Proper Noun" and "Meta Usage" labels, and from what constituted "low quality" for discarding examples. For resolution of disagreements a final label was decided based on a discussion between the judges. + +# 3.2 The Final Dataset + +The final dataset consists of 4,558 English examples containing 223 MWEs, and 1,872 Portuguese examples containing 113 MWEs. + +We divide this data into training, development + +and test splits as follows: the test and development splits consist of sentences containing 30 and 20 idioms each in English and Portuguese respectively. To enable the testing of models under different scenarios of data availability, we create three different setups of the test split for each language. The first, the zero-shot setup, consists of sentences containing 163 idioms in English and 60 idioms in Portuguese, which do not occur in the development and test sets. The second, the one-shot setup, consists of exactly one non-idiomatic and (where available) one idiomatic example associated with each MWE in the development and test sets. The third and final, the few-shot setup, consists of between 1 and 4 examples associated with each meaning of each MWE in the development and test sets. The exact number of examples available is proportional to the original number of examples associated with that specific meaning of that idiom. We make it clear that there are no overlapping target sentences between the three splits - the only overlap is in terms of the idioms contained in examples. Detailed statistics for the English and Portuguese datasets are provided in Appendix A. + +# 3.3 Tasks + +In addition to the dataset of labelled contextualised MWEs, we present two tasks. + +# 3.3.1 Task 1: Idiomaticity Detection + +The first task we propose is designed to evaluate the extent to which models can identify idiomaticity in text and consists of two Subtasks: a coarse-grained classification task (Subtask A) and a fine-grained classification task (Subtask B). For the coarse-grained subtask, the problem is simplified to classifying the examples as either "Idiomatic" or "Non-Idiomatic". For the purposes of this subtask, anything labelled as "Literal" or "Proper Noun" was classed as "Non-Idiomatic" and given a label of 1, whilst all "Idiomatic" labels as well as "Meta Usage" were given a label of 0. (See also Table 2). + +For the fine-grained task, the possible meanings are equivalent to the paraphrases in the dataset, described previously. Since this problem does not have a fixed number of labels (given that each MWE has a different set of meanings), we convert this to a binary classification problem: the first input is the example containing the MWE and the second the paraphrase of each possible meaning of the MWE (or one of the phrases "Proper Noun" or "Meta Usage"). An input pair is labelled 1 if + +
MWETarget SentencePrevious SentenceNext SentenceLabelIdiomatic?Paraphrase
gold mineThis means that search data is a gold mine for marketing strategy. (marketingweek.com)The data that those searches generate builds...It reveals which types of product...Idiomatic 1Yessource of fortune
gold mineThe hashtag “Qixia gold mine in- cident” has been viewed many million of times on the social me- dia site Weibo. (wsws.org)The rescue opera- tion took place...A week after the ex- plosion...LiteralNomine
gold mineThe Gold Mine’s plain frontage & sparse, white-walled dining room suggest that it's a quick-fix refuelling stop rather than a place to linger. (squaremeal.co.uk)SquareMeal Re- view of Gold MineThe menu tout s a bewildering array of dishes...Proper NounNoProper Noun
+ +Table 2: A sample of the dataset for one MWE (gold mine). Context sentences are truncated for brevity. The "Idiomatic?" column is used for the coarse-grained classification task (Subtask 1 A) and the "Paraphrase" column is used for the fine-grained classification task (Subtask 1 B) and the representation task (Task 2). + +the paraphrase represents the correct meaning of the MWE in the example and 0 otherwise. In addition, we report scores for both subtasks in the zero-shot, one-shot and few-shot setups to better evaluate a model's ability to generalise and learn in a sample efficient fashion. We note that this was impossible prior to the introduction of AStitchIn-LanguageModels as all previous datasets which included context considered only one meaning per MWE (see Section 2.1). Due to the imbalanced nature of these subtasks, we use Macro F1-score as the measure of evaluation. + +We note that due to the different ways in which the two settings in this Task are setup the results for the two settings in this task are not directly comparable. + +# 3.3.2 Task 2: Idiomaticity Representation + +While the identification of idomaticity is important, downstream tasks require embeddings that effectively capture idomaticity, which is the purpose of the second task. For this task, we design a metric to measure how consistent a model is in capturing similarity between sentences containing idomatic elements and sentences that are purely compositional. + +As each possible meaning of an MWE contained in each example is associated with a paraphrase, this task requires a model to generate similarity scores for each example $E$ such that: + +$$ +\begin{array}{l} \forall_ {i \in I} (s i m (E, E _ {\rightarrow c}) = 1; \tag {1} \\ \left. s i m (E, E _ {\rightarrow \mathrm {i}}) = s i m (E _ {\rightarrow \mathrm {c}}, E _ {\rightarrow \mathrm {i}})\right) \\ \end{array} +$$ + +where $E\to \mathrm{c}$ represents the example with the MWE in $E$ replaced by the paraphrase of the correct meaning associated with the MWE, and $E\rightarrow \mathrm{i}$ the + +example with the MWE replaced by a paraphrase of one of the incorrect meanings of the MWE in $E$ (see Table 3 for examples). + +Without additional checks, models can trivially succeed in this task by simply assigning a similarity score of 1 to every sentence pair. To prevent this, we splice in development and test data from the Semantic Text Similarity (STS) benchmark dataset (Cer et al., 2017) in English and from the ASSIN2 STS dataset (Real et al., 2020) for Portuguese. + +We note that the expected similarity scores are approximates as the paraphrases need not have exactly the same meanings as that of the MWE they are paraphrasing. However, we consider this difference to be acceptable given the typical nature of annotation of semantic similarity data wherein annotators use labels between 1 and 5. + +Finally, we divide this task into two subtasks: Subtask A which requires the solving of this task using only pre-training and Subtask B which allows the fine-tuning of models. For clarity, we define pre-training to be the training of a model on any task other than idiomatic STS (and can include "fine-tuning" on a different task), and fine-tuning to include the inclusion of training on any STS dataset which includes potentially idiomatic MWEs. We use Spearman correlation coefficient as the measure of evaluation for both subtasks in Task 2 as it has been shown that Pearson correlation is poorly suited for comparing performance on the STS task (Reimers et al., 2016). + +# 4 Experiments and Results + +Our aim was to investigate the performance of state-of-the-art transformer-based pre-trained language models on these tasks, and how their performance varied with different input features (i.e. inclusion + +
Sentence (E)Correct Replacement (EMWE→c)Wrong Replacement (EMWE→i)Expected
When removing a big fish from a net, it should be held in a manner that supports the girth. (newsdakota.com)When removing a fish from a net, it should be held in a manner that supports the girth.When removing a important person from a net, it should be held in a manner that supports the girth.sim(E,E→c)=1 sim(E,E→i)=sim(E→c,E→i)
To pay attention only to new housing and houses I think skews the big picture. (streets.mn)To pay attention only to new housing and houses I think skews the whole situation.To pay attention only to new housing and houses I think skews the large image.sim(E,E→c)=1 sim(E,E→i)=sim(E→c,E→i)
+ +Table 3: Task 2 - Models are required to be consistent in assigning semantic similarity scores as measured by use of the paraphrases of different meanings. + +of MWE, context sentences), problem setups (i.e. zero-shot, one-shot and few-shot), and training regimes (i.e. pre-training, fine-tuning) so as to provide a baseline for the AStitchInLanguageModels dataset. Here we provide an overview of the experiments ran and our results. More detailed description of the experimental procedure, including runtimes are given in Appendix B. + +# 4.1 Task 1: Idiomaticity Detection + +For Subtask A, which requires the coarse-grained classification of examples, we start by exploring the impact of three variables in the zero-shot setup: the pre-trained language model, the inclusion of context (the two surrounding sentences), and adding the relevant MWE as a feature. The context is included by simply concatenating the three contiguous sentences, and the MWE is included by separating it from the rest of the input by use of the "[SEP]" token. For the purposes of brevity, we report a subset of variations highlighting the most interesting results, with more details of the experimental procedure in Appendix B. Among the results for Task 1, Subtask A (Table 4), the best-performing experimental settings from the zero-shot setting (by development F1 score) were transferred over to the one-shot and few-shot problem setups. While the inclusion of context (surrounding sentences) did not change the performance of the models significantly, and will not be used in the other experiments, the inclusion of the relevant MWE was found to be beneficial to performance. + +For Subtask B, fine-grained classification, the best-performing experimental settings found for the first subtask were used for the multiclass data, although the MWE was not included as a feature, since our previous method for inclusion is incompatible with the passing of the paraphrase; the input consists of the target sentence without the previous or next sentences followed by a single possible meaning of the MWE separated by the "[SEP]" token. The task is thus reduced to a binary classifi + +cation task wherein the model is required to predict 1 when the target sentence is followed by the correct paraphrase and 0 otherwise. The results are in Table 5. + +# 4.2 Task 2: Idiomaticity Representation + +Task 2 requires models to output the semantic similarity between sentences in a consistent manner. Given that sentence embeddings generated by pretrained language models cannot directly be used to calculate semantic similarity (Devlin et al., 2019), we used Sentence BERT (Reimers and Gurevych, 2019) which consists of a siamese network structure with a regression objective function consisting of the mean-squared error loss calculated over the cosine similarity of two input sentences during training. This results in sentences whose semantic similarity can be compared using cosine similarity (Schroff et al., 2015). We note that while this is not strictly required for our purpose, we use this method as the siamese network structure is likely to be beneficial in fine-tuning on the idiomatic STS data where the similarity scores are all relatively close to each other. + +To test the effectiveness of the idiom principle to represent MWEs (Section 2.2) for Task 2, we analyse three different settings, involving the expansion of the vocabulary of pre-trained models by the addition of a single token to represent each MWE: In the first setting ("all replace") all instances of an MWE are replaced with the corresponding token before input to the model; in the second ("select replace") each input sentence is first classified using the one-shot model for course grained classification (Section 4.1) and a given instance of an MWE is replaced only when the one-shot model predicts that the MWE in a given sentence has an idiomatic meaning; and in the third ("no replace") there is no change to either the model (no special token added) or their input. + +For Subtask A, which requires the use of only pre-training, we collect sentences (including, + +
Problem SetupModelContext?MWE?Dev F1Test F1
Englishzero-shotBERT base (cased)NoNo0.7240.688
BERT base (cased)YesNo0.7170.797
BERT base (cased)YesYes0.7790.774
BERT base (cased)NoYes0.7850.821
XLNet base (cased)NoYes0.8230.832
one-shotXLNet base (cased)NoYes0.8970.874
one-shotXLNet base (cased)YesNo0.6890.701
one-shotXLNet base (cased)NoNo0.7550.754
few-shotXLNet base (cased)NoYes0.9590.971
few-shotXLNet base (cased)YesNo0.7820.806
few-shotXLNet base (cased)NoNo0.7920.853
Portuguesezero-shotXLM-RoBERTa base (cased)NoNo0.5930.528
XLM-RoBERTa base (cased)YesNo0.5420.562
XLM-RoBERTa base (cased)YesYes0.6960.604
XLM-RoBERTa base (cased)NoYes0.7030.579
BERT base multilingual (cased)NoYes0.6860.560
one-shotXLM-RoBERTa base (cased)NoYes0.8770.778
one-shotXLM-RoBERTa base (cased)YesNo0.6050.563
one-shotXLM-RoBERTa base (cased)NoNo0.6380.534
few-shotXLM-RoBERTa base (cased)NoYes0.9260.944
few-shotXLM-RoBERTa base (cased)YesNo0.6550.684
few-shotXLM-RoBERTa base (cased)NoNo0.7960.696
+ +Table 4: Evaluation results for Task 1 Subtask A (with best results for each setting in bold). + +
Problem SetupModelDev F1Test F1
Enzero-shotXLNet base (cased)0.8520.875
one-shotXLNet base (cased)0.9230.927
few-shotXLNet base (cased)0.9330.948
Ptzero-shotXLM-RoBERTa base (cased)0.8430.778
one-shotXLM-RoBERTa base (cased)0.8520.858
few-shotXLM-RoBERTa base (cased)0.9090.878
+ +where available, the paragraph they occur in) from the Common CWE1 News Dataset2 spanning the first 6 months of 2020 (over half a terabyte of text). This results in about 220,000 sentences in English and about 16,000 in Portuguese containing relevant MWEs. We use this data to continue pre-training BERT base in both the "all replace" and "select replace" variations described above. Unlike our other experiments, we do not pre-train multiple times due to time and resource constraints. We also limit pre-training to 5 epochs for English and 10 epochs for Portuguese based on results from our exploratory experiments. + +In addition to these two models, we also test BERT base with no modifications, and a version of BERT base with the addition of tokens associated with each MWE but no pre-training (the embeddings associated with these tokens are randomly initialised). The "all replace" and "select replace" models have their pre-training and input sentences tokenized according to the same strategy. Each of these models are subsequently trained using the Sentence BERT architecture so as to ensure that the resultant embeddings can be compared using + +cosine similarity. We train using the training data from the STS benchmark dataset (Cer et al., 2017) for English and the ASSIN2 STS dataset (Real et al., 2020) for Portuguese. This training does not violate the "pre-train only" requirement of this task as we do not train on idiomatic STS data. The results are presented in Table 6. + +Table 5: Evaluation results for Task 1 Subtask B. + +
TokenizationDev ρTest ρ
EnglishDefault0.7670.744
All Tokenized (No Pre-Training)0.8260.801
All Tokenized0.8350.811
Select Tokenized0.8480.805
PortugueseDefault0.7260.785
All Tokenized (No Pre-Training)0.7490.798
All Tokenized0.7420.805
Select Tokenized0.7500.814
+ +Table 6: Results for Task 2 Subtask A. + +For Subtask B, we fine-tune the "no replace", "all replace" and "select replace" versions of BERT base on both the standard STS data as in Subtask A and training data constructed from the zero-shot and few-shot version of the training data using Equation 1. Therefore, during fine-tuning, the gold similarity score for $\text{sim}(E, E_{\rightarrow c})$ is 1 and that + +for $sim(E, E_{\rightarrow \mathrm{i}})$ is $sim(E_{\rightarrow c}, E_{\rightarrow \mathrm{i}})$ . Both the "replace" versions of the model are fine-tuned from scratch (i.e. the tokens associated with MWE are random and not pre-trained as in Subtask A). Although it is possible to start with the pre-trained version of the "replace" models, we make the conscious decision not to, so we might test if this sample efficient method of learning is feasible. The results for these models are presented in Table 7. + +
TokenizationDev ρTest ρ
EnDefault0.8180.823
All Tokenized0.8210.817
Select Tokenized0.8510.825
PDefault0.7520.811
All Tokenized0.8030.835
Select Tokenized0.8060.818
+ +# 5 Discussion + +This section discusses some highlights of our results. + +# 5.1 Detection of Idiomaticity + +In the task of detecting idiomaticity (Task 1), we find that in the zero-shot setting, the models perform poorly in both the coarse-grained and fine-grained subtasks. This shows there is still significant room for improvement in this task. The most interesting result was that models perform surprisingly well in the one-shot and few-shot setups. This is a novel observation, made possible by the unique nature of this dataset and is likely to be very helpful in developing methods of identifying idiomatic language. + +We found that including context sentences did not always lead to significantly improved model performance. Intuitively, one would expect an increase in performance due to the availability of more relevant data. A possible reason we did not observe this in our experiments is that we included context by simply concatenating the three sentences, which means the model has no awareness of which sentence is relevant and could be deceived by surrounding sentences containing idiomatic expressions, for example. However, in the zero shot setting, including the context while excluding the target MWE led to a significant increase in generalisability as measured by the increased performance on the test set. This combination led to an increase of almost 8 points over the development set in English and 2 points in Portuguese where all + +other combinations led to a drop in performance on the test set as compared to the development set. + +The inclusion of the relevant MWE, was generally found to be greatly beneficial to model performance. The intuition behind this is that models are able to "focus" on the relevant MWE when determining idiomaticity. In the one and few shot settings in particular, this inclusion significantly boosted performance. When models had previously not encountered examples associated with a particular MWE in the training data (as in the zero shot setting), including the MWE did less to boost performance, although it still did improve results. The only advantage of excluding the MWE was in helping with generalisation as detailed above. In the case of both MWE and context inclusion, we expect more sophisticated methods of incorporating this information to further boost performance. + +We note that results in English outperform those in Portuguese. We believe that this difference could be a result of three factors: a) the fact that there is less training data available in Portuguese, b) because models are pre-trained on significantly less Portuguese data, and c) due to the higher degree of inflection in Portuguese. + +# 5.2 Representation of Idiomaticity + +Recall that the evaluation data for Task 2 included data from standard STS datasets to ensure that the task is not trivially solvable (Section 3.3.2). We report results on only the MWE subset of the evaluation data in Tables 8 and 9 for Subtasks A and B respectively. + +Table 7: Results for Task 2 Subtask B. + +
TokenizationEN Non-STS ρPT Non-STS ρ
Default0.2190.203
All Tokenized (No Pre-Training)0.3950.274
All Tokenized0.4590.369
Select Tokenized0.4370.332
+ +Table 8: Results on only the MWE subset of the Test split for Task 2 Subtask A. + +
TokenizationEN Non-STS ρPT Non-STS ρ
Default0.6270.312
All Tokenized0.6110.379
Select Tokenized0.6180.416
+ +Table 9: Results on only the MWE subset of the Test split for Task 2 Subtask B. + +These results show the significant scope for improvement in representing idomaticity (given + +model performance on the standard STS benchmark datasets is close $0.9\rho$ . Additionally, we note that in Subtask A, which requires the use of only pre-training, it is better to tokenize all pre-training data, thus maximising the amount of training data, rather than selectively tokenizing training data. In Subtask B (fine-tuning), however, selective tokenization seems to have a slight advantage although the default tokenization seems to be more suitable in English. + +Thus, our experiments exploring the use of the idiomatic principle to capture idomaticity in contextual pre-trained models (Task 2 Subtask A), show that while replacing potential MWEs with a single token does improve performance, further pretraining with text tokenized either using "all replace" or "select replace" improves performance only on the MWE subset of the evaluation split. On the full test set, which includes standard STS data (Table 6), however, additional pre-training with MWE data does not always improve over a random representation of MWE tokens and when it does, it does so only slightly. This is an interesting result, and could be because gains made by the use of the idiom principle are offset by the continuing to pre-train on a relatively small set of sentences that include a randomly initialised token added to the vocabulary, or because the gains made on the MWE subset are diluted across the entire test split. + +Experiments using fine-tuning (Task 2 Subtask B, see Section 4.2, Table 6) show, unsurprisingly, that pre-trained language models are extremely effective in transfer learning. What is particularly interesting, though, is that starting with random embeddings for tokens representing MWEs can lead to comparative (and in some cases slightly better) scores. This suggests that these tokens have at least a reasonable representation level, thus providing a sample efficient method of learning embeddings for them. However, further experiments on different tasks are required to test the extent to which these tokens have been trained. + +# 6 Conclusions and Future Work + +In this work we presented a novel dataset of naturally occurring idiomatic MWE usage in English and Portuguese, with associated tasks aimed at testing the ability of language models to deal with idiomaticity. In addition, we ran a number of experiments on these tasks. + +In terms of idiomaticity detection, the results of + +our experiments show these models achieve reasonable performance in the one-shot and few-shot settings, but particularly struggle with the zero-shot setting, where the models encounter unseen MWEs at inference time. + +When it comes to the representation of idiomaticity, our experiments show that while the use of the idiom principle does help in representing MWEs, these gains do not transfer to a significant overall increase in performance on the entire test split. The large number of MWEs makes including all of them in the vocabulary impractical, likewise selectively training models with MWEs of interest is impractical due to the cost of pre-training. This underscores the need for a more nuanced approach to incorporating the idiom principle with pre-trained language models. Additionally, in creating representations for MWEs that are partially compositional, methods that make use of the representations of constituent words such as attentive mimicking (Schick and Schütze, 2019) might be beneficial and we intend to experiment with these methods in future. We also find that pre-training is potentially an effective way of learning these representations, although more experiments are required to test these representations. + +There are many avenues for future work using the data presented here, including running crosslingual experiments across different scenarios of data availability. Although our experiments have been limited to the use of transformer based pretrained language models, the dataset and tasks we present can be used with any language model. While this work provides a useful dataset for the investigation of idiomaticity, we intend to expand this dataset in order to cover a broader set of languages, and include a wider range of idiomatic MWE types, including more syntactically flexible expressions. One limitation of the dataset is that the paraphrases generated are syntactically rigid, and for Task 2 the replacement sentences may not always be grammatically correct (see Table 3). Although this is sufficient for current purposes, future datasets could generate paraphrases per sentence rather than per MWE. + +# Acknowledgements + +This work was partially supported by the UK EPSRC grant EP/T02450X/1 and the CDT in Speech and Language Technologies and their Applications funded by UKRI (grant number EP/S023062/1). + +# References + +Timothy Baldwin, Colin Bannard, Takaaki Tanaka, and Dominic Widdows. 2003. An empirical model of multiword expression decomposability. In Proceedings of the ACL 2003 Workshop on Multiword Expressions: Analysis, Acquisition and Treatment, pages 89-96, Sapporo, Japan. Association for Computational Linguistics. +Timothy Baldwin and Aline Villavicencio. 2002. Extracting the unextractable: A case study on verb particles. In *COLING-02: The 6th Conference on Natural Language Learning* 2002 (CoNLL-2002). +Chris Biemann and Eugenie Giesbrecht. 2011. Distributional semantics and compositionality 2011: Shared task description and results. In Proceedings of the Workshop on Distributional Semantics and Compositionality, pages 21-28, Portland, Oregon, USA. Association for Computational Linguistics. +Daniel Cer, Mona Diab, Eneko Agirre, Inigo Lopez-Gazpio, and Lucia Specia. 2017. SemEval-2017 task 1: Semantic textual similarity multilingual and crosslingual focused evaluation. In Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval-2017), pages 1-14, Vancouver, Canada. Association for Computational Linguistics. +Mathieu Constant, Gülşen Eryigit, Johanna Monti, Lonneke van der Plas, Carlos Ramisch, Michael Rosner, and Amalia Todirascu. 2017. Survey: Multiword expression processing: A Survey. Computational Linguistics, 43(4):837-892. +Paul Cook, Afsaneh Fazly, and Suzanne Stevenson. 2008. The VNCTokens Dataset. In In proceedings of the MWE workshop. ACL. +Silvio Cordeiro, Aline Villavicencio, Marco Idiart, and Carlos Ramisch. 2019. Unsupervised compositionality prediction of nominal compounds. Computational Linguistics, 45(1):1-57. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 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, Volume 1 (Long and Short Papers), pages 4171-4186, Minneapolis, Minnesota. Association for Computational Linguistics. +Meghdad Farahmand, Aaron Smith, and Joakim Nivre. 2015. A multiword expression data set: Annotating non-compositionality and conventionalization for English noun compounds. In Proceedings of the 11th Workshop on Multiword Expressions, pages 29-33, Denver, Colorado. Association for Computational Linguistics. +Marcos Garcia, Tiago Kramer Vieira, Carolina Scarton, Marco Idiart, and Aline Villavicencio. 2021. Probing for idiomaticity in vector space models. In Proceedings of the 16th Conference of the European + +Chapter of the Association for Computational Linguistics: Main Volume, pages 3551-3564, Online. Association for Computational Linguistics. +Reyhaneh Hashempour and Aline Villavicencio. 2020. Leveraging contextual embeddings and idiom principle for detecting idiomaticity in potentially idiomatic expressions. In Proceedings of the Workshop on the Cognitive Aspects of the Lexicon, pages 72-80, Online. Association for Computational Linguistics. +Kazuma Hashimoto and Yoshimasa Tsuruoka. 2016. Adaptive joint learning of compositional and non-compositional phrase embeddings. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 205-215, Berlin, Germany. Association for Computational Linguistics. +Iris Hendrickx, Zornitsa Kozareva, Preslav Nakov, Diarmuid O Seaghdha, Stan Szpakowicz, and Tony Veale. 2013. SemEval-2013 task 4: Free paraphrases of noun compounds. In Second Joint Conference on Lexical and Computational Semantics (*SEM), Volume 2: Proceedings of the Seventh International Workshop on Semantic Evaluation (SemEval 2013), pages 138-143, Atlanta, Georgia, USA. Association for Computational Linguistics. +Dimitri Kartsaklis, Nal Kalchbrenner, and Mehrnoosh Sadrzadeh. 2014. Resolving lexical ambiguity in tensor regression models of meaning. In Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 212-217, Baltimore, Maryland. Association for Computational Linguistics. +Graham Katz and Eugenie Giesbrecht. 2006. Automatic identification of non-compositional multiword expressions using latent semantic analysis. In Proceedings of the Workshop on Multiword Expressions: Identifying and Exploiting Underlying Properties, pages 12-19, Sydney, Australia. Association for Computational Linguistics. +Dekang Lin. 1999. Automatic identification of noncompositional phrases. In Proceedings of the 37th Annual Meeting of the Association for Computational Linguistics, pages 317-324, College Park, Maryland, USA. Association for Computational Linguistics. +Tomas Mikolov, Kai Chen, Greg S. Corrado, and Jeffrey Dean. 2013a. Efficient estimation of word representations in vector space. +Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg Corrado, and Jeffrey Dean. 2013b. Distributed representations of words and phrases and their compositionality. In Proceedings of the 26th International Conference on Neural Information Processing Systems - Volume 2, NIPS'13, page 3111-3119, Red Hook, NY, USA. Curran Associates Inc. + +Jeff Mitchell and Mirella Lapata. 2010. Composition in distributional models of semantics. Cognitive science, 34(8):1388-1429. +Navnita Nandakumar, Timothy Baldwin, and Bahar Salehi. 2019. How well do embedding models capture non-compositionality? a view from multiword expressions. In Proceedings of the 3rd Workshop on Evaluating Vector Space Representations for NLP, pages 27-34, Minneapolis, USA. Association for Computational Linguistics. +Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. 2019. Exploring the limits of transfer learning with a unified text-to-text transformer. CoRR, abs/1910.10683. +Livy Real, Erick Fonseca, and Hugo Goncalo Oliveira. 2020. The assin 2 shared task: a quick overview. In International Conference on Computational Processing of the Portuguese Language, pages 406-412. Springer. +Siva Reddy, Diana McCarthy, and Suresh Manandhar. 2011. An empirical study on compositionality in compound nouns. In Proceedings of 5th International Joint Conference on Natural Language Processing, pages 210-218, Chiang Mai, Thailand. Asian Federation of Natural Language Processing. +Nils Reimers, Philip Beyer, and Iryna Gurevych. 2016. Task-oriented intrinsic evaluation of semantic textual similarity. In Proceedings of COLING 2016, the 26th International Conference on Computational Linguistics: Technical Papers, pages 87-96, Osaka, Japan. The COLING 2016 Organizing Committee. +Nils Reimers and Iryna Gurevych. 2019. Sentence-bert: Sentence embeddings using siamese bert-networks. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing. Association for Computational Linguistics. +Ivan A. Sag, Timothy Baldwin, Francis Bond, Ann A. Copestake, and Dan Flickinger. 2002. Multiword expressions: A pain in the neck for nlp. In Proceedings of the Third International Conference on Computational Linguistics and Intelligent Text Processing, CICling '02, page 1-15, Berlin, Heidelberg. Springer-Verlag. +Agata Savary, Carlos Ramisch, Silvio Cordeiro, Federico Sangati, Veronika Vincze, Behrang QasemiZadeh, Marie Candito, Fabienne Cap, Voula Giouli, Ivelina Stoyanova, and Antoine Doucet. 2017. The PARSEME shared task on automatic identification of verbal multiword expressions. In Proceedings of the 13th Workshop on Multiword Expressions (MWE 2017), pages 31-47, Valencia, Spain. Association for Computational Linguistics. +Timo Schick and Hinrich Schütze. 2019. Attentive mimicking: Better word embeddings by attending to informative contexts. In Proceedings of the 2019 + +Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 489-494, Minneapolis, Minnesota. Association for Computational Linguistics. +Nathan Schneider, Jena D. Hwang, Vivek Srikumar, Meredith Green, Abhijit Suresh, Kathryn Conger, Tim O'Gorman, and Martha Palmer. 2016. A corpus of preposition supersenses. In Proceedings of the 10th Linguistic Annotation Workshop held in conjunction with ACL 2016 (LAW-X 2016), pages 99-109, Berlin, Germany. Association for Computational Linguistics. +Nathan Schneider, Spencer Onuffer, Nora Kazour, Emily Danchik, Michael T. Mordowanec, Henrietta Conrad, and Noah A. Smith. 2014. Comprehensive annotation of multiword expressions in a social web corpus. In Proceedings of the Ninth International Conference on Language Resources and Evaluation (LREC'14), pages 455-461, Reykjavik, Iceland. European Language Resources Association (ELRA). +Nathan Schneider and Noah A. Smith. 2015. A corpus and model integrating multiword expressions and supersenses. In Proceedings of the 2015 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1537-1547, Denver, Colorado. Association for Computational Linguistics. +Florian Schroff, Dmitry Kalenichenko, and James Philbin. 2015. Facenet: A unified embedding for face recognition and clustering. In 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 815-823. +Sabine Schulte im Walde, Anna Hatty, Stefan Bott, and Nana Khvtisavrishvili. 2016. GhoSt-NN: A representative gold standard of German noun-noun compounds. In Proceedings of the Tenth International Conference on Language Resources and Evaluation (LREC'16), pages 2285-2292, Portoorz, Slovenia. European Language Resources Association (ELRA). +Vered Shwartz and Ido Dagan. 2019. Still a pain in the neck: Evaluating text representations on lexical composition. Transactions of the Association for Computational Linguistics, 7:403-419. +J. Sinclair, L. Sinclair, and R. Carter. 1991. Corpus, Concordance, Collocation. Describing English language. Oxford University Press. +Yuancheng Tu and Dan Roth. 2012. *Sorting out the most confusing English phrasal verbs.* In *SEM* 2012: The First Joint Conference on Lexical and Computational Semantics – Volume 1: Proceedings of the main conference and the shared task, and Volume 2: Proceedings of the Sixth International Workshop on Semantic Evaluation (SemEval 2012), pages 65–69, Montréal, Canada. Association for Computational Linguistics. + +Sriram Venkatapathy and Aravind Joshi. 2005. Measuring the relative compositionality of verb-noun (V-n) collocations by integrating features. In Proceedings of Human Language Technology Conference and Conference on Empirical Methods in Natural Language Processing, pages 899-906, Vancouver, British Columbia, Canada. Association for Computational Linguistics. +Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Russ R Salakhutdinov, and Quoc V Le. 2019. Xlnet: Generalized autoregressive pretraining for language understanding. In Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc. +Lang Yu and Allyson Ettinger. 2020. Assessing phrasal representation and composition in transformers. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4896-4907, Online. Association for Computational Linguistics. +Zhengyan Zhang, Xu Han, Zhiyuan Liu, Xin Jiang, Maosong Sun, and Qun Liu. 2019. ERNIE: Enhanced language representation with informative entities. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1441-1451, Florence, Italy. Association for Computational Linguistics. + +# A Dataset Statistics + +Detailed statistics for the English and Portuguese datasets are shown in Table 10 and Table 11, respectively. The train, dev and set breakdowns are shown in the leftmost column, with the further breakdown of the train set into zero-shot, one-shot and few-shot setups. Note here that the one-shot data is contained within the few-shot data. The MWEs column is the number of MWEs that the examples span - the one-shot and few-shot setups contain all the MWEs from the dev and test sets, but the examples are different. The next columns show the fine-grained and coarse-grained breakdown of the dataset, used in Task 1 Subtask B and Task 1 Subtask A, respectively. + +# B Experimental Procedure + +# B.1 Task 1 Subtask A + +The Task 1 experiments were run on NVIDIA Tesla K80s. For the first subtask, we ran a range of experiments, varying the model used, whether context was used, and whether the MWE was used. We ran each experiment for 9 epochs with five seeds (0 - 5). For all experiments, we used a max sequence length of 128 and a learning rate of 2e-5. The standard tokenizers for each model were used for tokenizing the input. The results for the best performing seed and epoch (by F1 score) for each experiment are shown in Table 12, with approximate training run times (for one seed for nine epochs). We started with the zero-shot experiments, then took the best performing models, and continued training them from the best epoch for another 9 epochs in the one-shot and few-shot setups. + +# B.2 Task 1 Subtask B + +For the second subtask, we took the best-performing experimental settings from Subtask A: XLNET base (cased) for English and BERT base multilingual (cased) for Portuguese, excluding context but not including the MWE since we instead pass the relevant paraphrase of the MWE (either correct or incorrect). These models were then trained on the multiclass data, again for 9 epochs and with five seeds (0-5). Again, the best-performing models in the zero-shot setup were continued training from the best epoch for another 9 epochs in the few-shot and one-shot setups. These experiments are shown in Table 13. Training times are increased due to the larger dataset from generation of negative samples. + +# B.3 Task 2 + +Pre-training models was done using NVIDIA Tesla V100s and took approximately 15 hours for each of the two models in English (BERT base on "all replaced" and "select replaced") and 5 hours for each model in Portuguese (BERT base multilingual). Due to time and resource limitations, we pre-train models only once. All models were pretrained for 5 epochs based on the evaluation on a development set and our initial experiments which showed that further pre-training did not improve results. + +For Subtask A, fine-tuning these models using the Sentence BERT architecture (so as to be able to compare the resultant embeddings using cosine similarity) was done using NVIDIA K80 GPUs for English and took approximately 6 minutes per seed. Since we tested four variations (original BERT, BERT tokenized but not pre-trained, BERT all tokenized and select tokenized) each with five seeds, these experiments took a total of about two hours. The multilingual models required the use of NVIDIA Tesla V100s due to their larger size and took about 3 minutes to train each model (per seed) and consequently took a total of about an hour to train. The best model was picked based on the performance on the STS dataset they were trained on (i.e. the STS benchmark dataset for English and ASSIN2 for Portuguese). + +Subtask B similarly required the use of NVIDIA K80 GPUs for English and NVIDIA Tesla V100s for Portuguese. We select the best models finetuned using the Sentence BERT architecture (with no pre-training) from Subtask A and continue pretraining with MWE specific data. This process took approximately 6 minutes per model in English and 3 minutes in Portuguese leading to a total of about 30 minutes and 15 minutes respectively. + +All fine-tuning was done for as many epochs as was required to see a drop in performance on the corresponding development set. + +# B.4 Larger Models + +Exploratory experiments on Task 1 showed that the larger language models performed worse than the base ones, and thus these were the ones we used in our experiments. + +For task 2, we use the smaller base models due to the limited amount of pre-train data, which we believe would make the use of larger models impractical. + +
SetMWEsNon-Idiomatic (1)Idiomatic (0)Tot
LitPNTot123MetaTot
trainzero-shot1631110455156516149284817623327
(one-shot)60292655255023287
few-shot601355018581110597282
total22312455051750169510385318593609
dev3017411028415714011182466
test30271633341182407149483
total22316906782368197014187121904558
+ +Table 10: Breakdown of the English dataset. + +
SetMWEsNon-Idiomatic (1)Idiomatic (0)Tot
LitPNTot123MetaTot
trainzero-shot73284107391697552197731164
(one-shot)4017825262002853
few-shot405514698060187156
total113339121460777612208601320
dev2096231191371601154273
test209420114151905165279
total11352916469310658622611791872
+ +Table 11: Breakdown of the Portuguese dataset. + +
Problem SetupModelContext?MWE?Train TimeDev AccuracyDev F1
Englishzero-shotBERT base (cased)NoNo~1 hour0.7320.724
BERT base (cased)YesNo~1 hour0.7320.717
BERT base (cased)YesYes~1 hour0.7850.779
BERT base (cased)NoYes~1 hour0.7960.785
BERT base (uncased)NoYes~1 hour0.7770.77
XLNet base (cased)NoYes~1 hour0.8280.823
DistilBERT base (cased)NoYes~1 hour0.7680.757
RoBERTa base (cased)NoYes~1 hour0.8070.801
one-shotXLNet base (cased)NoYes+~5 mins0.9030.897
one-shotXLNet base (cased)YesNo+~5 mins0.7190.689
one-shotXLNet base (cased)NoNo+~5 mins0.7750.755
few-shotXLNet base (cased)NoYes+~1min0.9610.959
few-shotXLNet base (cased)YesNo+~1min0.8070.782
few-shotXLNet base (cased)NoNo+~1min0.8130.792
Portuguesezero-shotXLM-RoBERTa base (cased)NoNo~1 hour0.6040.593
XLM-RoBERTa base (cased)YesNo~1 hour0.560.542
XLM-RoBERTa base (cased)YesYes~1 hour0.7140.696
XLM-RoBERTa base (cased)NoYes~1 hour0.7290.703
BERT base multilingual (cased)NoYes~1 hour0.7070.686
one-shotXLM-RoBERTa base (cased)NoYes+~5 mins0.8790.877
one-shotXLM-RoBERTa base (cased)YesNo+~5 mins0.6150.605
one-shotXLM-RoBERTa base (cased)NoNo+~5 mins0.6410.638
few-shotXLM-RoBERTa base (cased)NoYes+~1min0.9270.926
few-shotXLM-RoBERTa base (cased)YesNo+~1min0.6560.655
few-shotXLM-RoBERTa base (cased)NoNo+~1min0.7990.796
+ +Table 12: Dev set results for Task 1 Subtask A + +
Problem SetupModelTrain TimeDev AccuracyDev F1
Enzero-shotXLNet base (cased)~2.5 hours0.8830.852
one-shotXLNet base (cased)+~20 mins0.9380.923
few-shotXLNet base (cased)+~1 hour0.9470.933
Ptzero-shotXLM-RoBERTa base (cased)~1 hour0.8860.843
one-shotXLM-RoBERTa base (cased)+~5 mins0.8880.852
few-shotXLM-RoBERTa base (cased)+~20 mins0.9310.909
+ +Table 13: Dev set results for Task 1 Subtask B \ No newline at end of file diff --git a/astitchinlanguagemodelsdatasetandmethodsfortheexplorationofidiomaticityinpretrainedlanguagemodels/images.zip b/astitchinlanguagemodelsdatasetandmethodsfortheexplorationofidiomaticityinpretrainedlanguagemodels/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d6275a87b17ddf47823adc009ebb83e994fa8fc8 --- /dev/null +++ b/astitchinlanguagemodelsdatasetandmethodsfortheexplorationofidiomaticityinpretrainedlanguagemodels/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b82bed100ddee6b21c5b05a5be6a11c0a249d83e45e88ee7f05ce2c5feb3cac9 +size 742426 diff --git a/astitchinlanguagemodelsdatasetandmethodsfortheexplorationofidiomaticityinpretrainedlanguagemodels/layout.json b/astitchinlanguagemodelsdatasetandmethodsfortheexplorationofidiomaticityinpretrainedlanguagemodels/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..916b549c085a2f32ad19fca2c2ec95a75931e6e7 --- /dev/null +++ b/astitchinlanguagemodelsdatasetandmethodsfortheexplorationofidiomaticityinpretrainedlanguagemodels/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:13667b72d7ff7351fcd7661f2102e9d5e2304adb2c7df1d9c8487aa9a0704f3d +size 329828 diff --git a/attendmemorizeandgeneratetowardsfaithfultabletotextgenerationinfewshots/ac5f85e3-7f9d-4bf3-b065-342fb70dfd8d_content_list.json b/attendmemorizeandgeneratetowardsfaithfultabletotextgenerationinfewshots/ac5f85e3-7f9d-4bf3-b065-342fb70dfd8d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..fd4a2a0387ccf297199c134d1f07f99c301d32b2 --- /dev/null +++ b/attendmemorizeandgeneratetowardsfaithfultabletotextgenerationinfewshots/ac5f85e3-7f9d-4bf3-b065-342fb70dfd8d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:80124d9cb2f22fa34692a0fb512a46a333f794e8f6176e481e6c3689a5262c0d +size 79983 diff --git a/attendmemorizeandgeneratetowardsfaithfultabletotextgenerationinfewshots/ac5f85e3-7f9d-4bf3-b065-342fb70dfd8d_model.json b/attendmemorizeandgeneratetowardsfaithfultabletotextgenerationinfewshots/ac5f85e3-7f9d-4bf3-b065-342fb70dfd8d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f5058c48648746cd43b72b5d648e4c043a399a90 --- /dev/null +++ b/attendmemorizeandgeneratetowardsfaithfultabletotextgenerationinfewshots/ac5f85e3-7f9d-4bf3-b065-342fb70dfd8d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b0c4d21f246028032ce8c01160655c092a15c557134a5bcd4166b53d7d4d8ab +size 96769 diff --git a/attendmemorizeandgeneratetowardsfaithfultabletotextgenerationinfewshots/ac5f85e3-7f9d-4bf3-b065-342fb70dfd8d_origin.pdf b/attendmemorizeandgeneratetowardsfaithfultabletotextgenerationinfewshots/ac5f85e3-7f9d-4bf3-b065-342fb70dfd8d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5e40c96fcecf96405702b895cb4cef8046d5f417 --- /dev/null +++ b/attendmemorizeandgeneratetowardsfaithfultabletotextgenerationinfewshots/ac5f85e3-7f9d-4bf3-b065-342fb70dfd8d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac925194df9a94e66163c515fe929cd0958eca0700fbfa7f21f109e853d2ad6d +size 596941 diff --git a/attendmemorizeandgeneratetowardsfaithfultabletotextgenerationinfewshots/full.md b/attendmemorizeandgeneratetowardsfaithfultabletotextgenerationinfewshots/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d1c1b15fb2ad93cc20995da9771d83242a741f4b --- /dev/null +++ b/attendmemorizeandgeneratetowardsfaithfultabletotextgenerationinfewshots/full.md @@ -0,0 +1,295 @@ +# Attend, Memorize and Generate: Towards Faithful Table-to-Text Generation in Few Shots + +Wenting Zhao1 Ye Liu1 Yao Wan2 Philip S. Yu1 + +$^{1}$ Department of Computer Science, University of Illinois at Chicago, IL, USA + $^{2}$ School of Computer Sci. & Tech., Huazhong University of Science and Technology, China {wzhao41, yliu279, psyu}@uic.edu, wanyao@hust.edu.cn + +# Abstract + +Few-shot table-to-text generation is a task of composing fluent and faithful sentences to convey table content using limited data. Despite many efforts having been made towards generating impressive fluent sentences by fine-tuning powerful pre-trained language models, the faithfulness of generated content still needs to be improved. To this end, this paper proposes a novel approach _Attend_, _Memorize and _Generate_ (called AMG), inspired by the text generation process of humans. In particular, AMG (1) attends over the multi-granularity of context using a novel strategy based on table slot level and traditional token-by-token level attention to exploit both the table structure and natural linguistic information; (2) dynamically memorizes the table slot allocation states; and (3) generates faithful sentences according to both the context and memory allocation states. Comprehensive experiments with human evaluation on three domains (i.e., humans, songs, and books) of the Wiki dataset show that our model can generate higher qualified texts when compared with several state-of-the-art baselines, in both fluency and faithfulness. + +# 1 Introduction + +Table-to-text generation, which aims to translate a semi-structured table into natural language descriptions while preserving the conveyed table information, are drawing increasing interest over the past few years. It has been widely applied in many real-world scenarios, such as automatically generating weather forecasting reports (Liang et al., 2009), biographies (Lebret et al., 2016; Wang et al., 2018), restaurant descriptions (Novikova et al., 2017), task-oriented conversations (Budzianowski et al., 2018; Williams et al., 2013) as well as healthcare descriptions (DiMarco et al., 2007; Hasan and + +![](images/684b60683e82550908cacbed0a6c1c3c52b0b16f6407fffad96908418b0a2b8b.jpg) +Figure 1: A motivating example. + +Farri, 2019). Despite such significant gains, current approaches are driven by large-scale well-labeled training data, hindering the generalization to other scenarios with limited labeled data. In addition, the faithfulness of generated contents is still not well explored. + +Few-shot natural language generation (Brown et al., 2020; Schick and Schütze, 2021; Xia et al., 2020a) has been in increasing demand since sufficient labeled data are always unavailable in many scenarios. To improve the table-to-text generation in few-shot scenarios, many existing works (Chen et al., 2020c; Gong et al., 2020; Peng et al., 2020) resort to the pre-training techniques which have been widely adopted in NLP, that is, pre-training a model first on large-scale unlabeled data, and then transfer the learned knowledge in pre-trained model to the few-shot scenario of table-to-text generation. Although these pre-trained models have achieved promising performance on generating fluent descriptions, from our investigation, they are still suffering from three major limitations: (1) The structure of table has not been well preserved. On table representation, existing methods (Chen et al., 2020c; Gong et al., 2020; Chen et al., 2020a) used to flatten the table into sequential sentences, ignoring the structured features (e.g., correlation between words within each table slot) among tables, + +which is also critical for table-to-text generation. (2) Generation bias. Current approaches that directly fine-tune the model on target data make the model in favor of the knowledge learned from pretraining rather than specific target task knowledge, hurting the faithfulness because extra information irrelevant to the input table is introduced. + +For example, as shown in Figure 1, given a table in the top box, the aim is to generate a coherent and faithful sentence with high coverage of table slots, as well as less out-of-table information. From this table, we can observe that current state-of-the-art models tend to generate sentences with hallucinated contents. For example, GPT-2 introduces wrong middle name "kelly" and the nationality "american". In addition, the table coverage of contents generated by current approaches is low. For example, BART does not mention the event "marathon". These observation motivate us to design a model that can generate faithful texts from tables while keeping the fluency. + +To tackle the aforementioned limitations, this paper proposes a novel approach $\underline{\text{Attend}}$ , $\underline{\text{Memorize}}$ and $\underline{\text{Generate}}$ (called AMG) for faithful table-to-text generation in few-shots. Inspired by the human generation process which copies a consecutive slot span to compose a sentence using the context, we propose a table slot attention mechanism to empower the model generalization ability in inference by strengthening the dependency between the generated sentence with the input table. In addition, to avoid generating hallucinated contents, we design a memory unit to monitor the visits of each table slot. Particularly, the memory unit is initialized as all the meta-data of table slots, and then updated by checking the generated words as well as the current memory state. + +Looking back to Figure 1, we can also observe several advantages of AMG. First of all, we can see AMG allows the to-be-predicted word "1998" from "birth_date" table slot to attend on the table as well as the previously generated sentence "robert ... born", while the attention on within table slot words are prohibited. Thus, the model is enforced to capture the table span structure and rely on the table span value to generate. To this end, the model learns to capture the slot level table representation. + +Furthermore, as shown in Figure 1, “ $M^{0}$ ” is the memory initial state where all the slot are available to be chosen (marked by green). After predicting the last word of table slot “name”, “ $M^{1}$ ” will be + +updated since it detects that the table slot "name" is present in the generated sentence, thus making the state of "name" unavailable (marked by red). In addition, the generation of word "1998" takes the context and table slot allocation into account, therefore "1998" is selected by locating the value of table span "birth_date" as well as the activated signal of table slot "birth_date" (marked by blue) from memory allocation status. + +To summarize, the primary contributions of this paper are as follows: (1) To better preserve the structure of table, we design a multi-grain attention that can attend over the table word as well as table slots level. (2) It is the first time that we introduce a memory mechanism to improve the faithfulness of generated texts by tracking the allocation of table slots. (3) We have conducted comprehensive experiments on three domains (i.e., Humans, Books and Songs) of the Wiki dataset to validate the effectiveness of our proposed approach. + +# 2 Preliminaries + +# 2.1 Problem Definition + +Given a table $T$ of $m$ attribute-value pairs $\{(a_i, v_i)\}_{i=1}^m$ , where $a_i$ and $v_i$ refer to the attribute name and value of $i$ -th table slot, respectively, the table-to-text generation task aims at producing a coherent text $Y = (y_1, \dots, y_L)$ that can describe the table information with fluency and faithfulness, where $L$ denotes the length of generated text. + +# 2.2 UniLM + +To alleviate the under-fitting issue caused by insufficient training examples in few shot learning, AMG adopts the state-of-art pre-trained language model UniLM (Dong et al., 2019) structure to integrate the external knowledge. UniLM is a multi-layer Transformer network which can be applied into both tasks of natural language understanding (NLU) and natural language generation (NLG). In this paper, we configure UniLM using Seq2Seq self-attention mask to aggregate the context of the masked $i$ -th to-be-predicted word $y_{i}^{[MASK]}$ that are source sequence words from table $T$ , and the previously generated target words $y_{< i}$ . The proposed model computes the conditional probability for the to-be-predicted word using the masked language model objective function, as follows: + +$$ +P (Y | T; \theta) = \prod_ {i = 1} ^ {L} P \left(y _ {i} ^ {[ M A S K ]} \mid y _ {< i}, T; \theta\right). \tag {1} +$$ + +![](images/7396ac2aea55ba85ce49c1b48c2f9c3461a0eda60a673cfe7e5b03e0abfb819a.jpg) + +![](images/a16dfc7ac4400ae5ee93adeda0d6f5b5cf98f4ad687e0b592646951aa288e19a.jpg) + +![](images/53d9a3ff306bf65ba34251ac5ec45fc9943931a117511882353e11fa125030fa.jpg) + +![](images/3430938600698651b17c85b5f00b0e3a7bf3f2c7f12343ac416883148f4b55fe.jpg) +Figure 2: An overview of AMG. The input to AMG is the concatenation of linearized table (marked in grey) and the descriptive sentence(marked in orange). The bottom box shows the memory update process. The top three boxes show the building blocks of AMG, designed to attend, memorize and generate descriptions from tables. + +# 3 AMG Approach + +# 3.1 Overview + +Figure 2 illustrates the overall architecture of our model, which is composed of three components, i.e., attend, memorize, and generate. (1) Attend. We propose a multi-granularity attention mechanism which attends over both token level and the table slot level to capture the linguistic knowledge as well as table structure information. We think that these knowledge can improve the faithfulness of generated texts. (2) Memory. We develop a memory to store and keep track of the table slot allocation status. (3) Generate. We take both the context representation and the table slot allocation states into account while making predictions. The above three building blocks interweave and lead the model to generate descriptions from tables faithfully. + +# 3.2 Table Representation + +Table Linearization Table-to-text generation receives semi-structured table as input. However, our proposed model AMG is built upon the UniLM architecture which requires natural sentence as input. Therefore, the first step we need to do is to translate the table into a natural sentence by linearization (Chen et al., 2020c). For the table example shown in Figure 1, the attribute value pair "name: robert kiprono cheruiyot" can be linearized + +as "name is [E_CLS] robert kiprono cheruiyot [E_SEP];", where [E_CLS] and [E_SEP] are two special tokens to indicate the beginning and the end of table slot value. + +Representing the History of Table Slot Allocation AMG makes prediction on the to-be-predicted token by taking the memory allocation status into account. The memory at different time step is updated by the previously generated table slots. Thus, we need to prepare the previously generated table slot representation $\text{his}^t$ at time step $t$ by using the static UniLM model. For example, in Figure 2, when making prediction for "[MASK]", the representation of table slot allocation history is computed by feeding "robert kiprono cheruiyot" to the static UniLM model and obtain the average of hidden states. + +# 3.3 Multi-Granularity Attention + +AMG introduces the multi-granularity attention (MA) which is the combination of two granularity of attention, i.e., token level and table slot level attention. The token level attention is the original UniLM token level attention while the table slot level attention is the extra attention over table slot memory. The advantage is that the table slot attention can provide an extra signal to the UniLM, encouraging AMG to copy tokens from the table slot value that have not appeared in the target. As + +shown in Figure 2, the memory augmented attention $A$ is the average of token level attention $A_{ta}$ and table slot level attention $A_{sa}$ , as following: + +$$ +A = \left(A _ {t a} + A _ {s a}\right) / 2, \tag {2} +$$ + +where the token level self-attention mechanism learns a unique series of query matrix $W_{Q_{ta}}^{l}$ , key matrix $W_{K_{ta}}^{l}$ , and value matrix $W_{V_{ta}}^{l}$ at the $l$ -th Transformer layer for each attention head. Then, AMG maps the $(l - 1)$ -th Transformer layer output $T^{l - 1}$ to three matrices: query $Q_{ta}$ , key $K_{ta}$ , and value $V_{ta}$ . The output of a self-attention head $A_{ta}$ is computed as Eq.(3), where $\text{Mask}^{ta} \in \mathbb{R}^{N \times N}$ is the seq2seq attention mask, allowing the to-be-predicted token to attend to table tokens as well as the previously generated tokens. $N$ refers to the total token length of table, previously generated tokens and the current to-be-predicted token. + +$$ +A _ {t a} ^ {l} = \mathrm {s o f t m a x} (\frac {Q _ {t a} K _ {t a} ^ {T}}{\sqrt {d ^ {k}}} + M a s k ^ {t a}) \cdot V _ {t a}, (3) +$$ + +Table Slot Attention Table slot attention works in a similar way with the self attention, while the major difference is to learn new key and value mapping matrices $W_{K_{sa}}^{l}$ and $W_{V_{sa}}^{l}$ and project memory $M^{l-1}$ using $W_{K_{sa}}^{l}$ and $W_{V_{sa}}^{l}$ to obtain $K_{sa}$ and $V_{sa}$ . The query $Q_{sa}$ is computed by the projection of UniLM hidden state $h^{l-1}$ using mapping matrix $W_{Q_{sa}}^{l}$ . Memory $M$ in AMG is defined as a $\mathbb{R}^{d_h \times slot_n}$ matrix where slot $n$ is the maximum number of table slots. The $j$ -th column of memory at time step $t$ is denoted as $M_j^t$ , and the initial state of memory $M_j^0$ is the average embedding of the $j$ -th table slot value computed using static UniLM model. The output of slot level attention head $A_{sa}^{l}$ is as follows: + +$$ +\begin{array}{l} Q _ {s a} = h ^ {l - 1} W _ {Q _ {s a}} ^ {l} \\ K _ {s a} = M ^ {l - 1} W _ {K _ {s a}} ^ {l} \\ V _ {s a} = M ^ {l - 1} W _ {V _ {s a}} ^ {l} \\ A _ {s a} ^ {l} = \operatorname {s o f t m a x} \left(\frac {Q _ {s a} K _ {s a} ^ {T}}{\sqrt {d k}} + M a s k ^ {\text {s l o t}}\right) \cdot V _ {s a}. \tag {4} \\ \end{array} +$$ + +Instead of applying the original seq2seq attention from UniLM to the input, a table slot attention mask $Mask^{slot} \in \mathbb{R}^{N \times N}$ is introduced to decide which word should be attended. In our case, we prohibit the to-be-predicted token to attend the previously generated words within the same table slots, while + +allow to attend the rest of generated words and the table. As shown in Figure 2, "1998" from the descriptive sentence can attend to both the table "name is ..., birth_date is ..." and previously generated words "robert kiprono cheruiyot ( born", while is not allowed to attend to words within the same table slot "august 10". + +Table Slot Memory Update AMG updates the memory matrix multiple times dynamically depending on how many times the generated sentence finishes generating one entire table slot value. To give a clear signal for the model to detect the beginning and the end of the table slot value, we introduce two additional special tokens [E_CLS] and [E_SEP] into the reference. Memory is updated using the gated mechanism, following (Henaff et al., 2016): + +$$ +\hat {M} _ {j} ^ {t} = \tanh (W _ {a} M _ {j} ^ {t - 1} + W _ {b} h i s ^ {t - 1}) +$$ + +$$ +z _ {j} ^ {t} = \delta \left(W _ {c} M _ {j} ^ {t - 1} + W _ {d} h i s ^ {t - 1}\right) \tag {5} +$$ + +$$ +M _ {j} ^ {t} = (1 - z _ {j} ^ {t}) M _ {j} ^ {t - 1} + z _ {j} ^ {t} \hat {M} _ {j} ^ {t}. +$$ + +In Eq.(5), $W_{a}$ , $W_{b}$ , $W_{c}$ and $W_{d}$ are trainable parameters. First, $\hat{M}_j^t$ is the new candidate memory to be combined with the existing memory $M_j^{t-1}$ . Then, the gate function $z_j^t$ employs a sigmoid function $\delta$ to determine how much memory $M_j^t$ will be influenced. At last, we retain $M_j^t$ by using gate function to control how much each cell in memory is updated by considering the history of table slot appearance in the target sentence, as well as the last memory. + +Text Generation When predicting the next token at each time step, AMG considers both the context representation and the table slot allocation status from memory shown in Eq.(6) where $tb$ refers to the table representation, $tk^t$ denotes the token predicted at time $t$ by AMG, and $tk^{0\dots t - 1}$ denote the tokens previously generated from time 0 to $t - 1$ . + +$$ +\begin{array}{l} (h i s ^ {t}, M ^ {t}, t k ^ {t}) = \\ \operatorname {A M G} \left(t b, h i s ^ {t - 1}, M ^ {t - 1}, t k ^ {0 \dots t - 1}\right). \tag {6} \\ \end{array} +$$ + +# 3.4 Task-Adaptive Pre-Training + +AMG is built upon the pre-trained UniLM and introduces additional weight. The memory updater depends on $W_{a}$ , $W_{b}$ , $W_{c}$ and $W_{d}$ to project memory and history values, as shown in Eq.(5). Besides, the newly added special token [E_CLS] and [E_SEP] is supposed to learn appropriate embedding weight from scratch. It is challenging to + +
BLEU-4METEORROUGE-LPARENT(P/R/F)PARENT-T(P/R/F)
Humans
1GPT2+copy (Chen et al., 2020c)41.7----
2GPT2+copy (our replication)42.0533.3663.9068.47/37.28/45.5947.90/40.18/41.58
3TableGPT2 (Gong et al., 2020)45.6----
4GPT2 (Radford et al., 2019)24.2625.2053.9059.45/18.51/25.8941.60/27.93/31.57
5BART (Lewis et al., 2020)48.3137.2468.2474.04/41.46/50.7951.50/41.98/44.20
6UniLM (Dong et al., 2019)45.3137.1068.3672.90/40.24/49.6150.06/41.67/43.46
7AMG49.0237.9769.3774.14/42.74/51.8651.20/43.03/44.70
Books
1GPT2+copy (Chen et al., 2020c)40.30----
2GPT2+copy (our replication)40.3934.4867.5969.68/35.10/44.8751.34/35.34/40.45
3TableGPT2 (Gong et al., 2020)41.6----
4GPT2 (Radford et al., 2019)19.1224.9954.8355.22/17.72/24.9440.41/28.21/32.14
5BART (Lewis et al., 2020)43.5336.4568.9372.86/37.84/48.1154.35/37.51/42.97
6UniLM (Dong et al., 2019)40.5635.7168.8571.90/35.60/45.8753.07/35.58/41.15
7AMG43.8836.9870.5773.26/38.18/48.5953.89/37.29/42.69
Songs
1GPT2+copy (Chen et al., 2020c)42.20----
2GPT2+copy (our replication)42.4133.4365.1866.34/35.72/44.7542.05/33.99/36.27
3TableGPT2 (Gong et al., 2020)42.30----
4GPT2 (Radford et al., 2019)22.4824.0955.9255.05/17.90/25.6530.96/21.53/24.42
5BART (Lewis et al., 2020)43.8834.6967.2269.22/36.31/46.0043.48/34.55/37.26
6UniLM (Dong et al., 2019)42.6334.7967.9268.19/34.74/44.5541.32/32.64/35.24
7AMG45.0935.5567.3867.60/37.63/46.9042.78/35.21/37.36
+ +Table 1: Test results on three domains Humans/Books/Songs of Wiki dataset using 500 training data. “P/R/F” denotes the precision/recall/F score. + +expect the newly introduced weight can be learned properly if we directly fine-tune AMG under the few shot scenario. + +Inspired by the pre-trained language models and the task adaptive pre-training (Gururan et al., 2020), we collect the unlabelled table side data to do a second phase task adaptive pre-training. + +We first linearize the input table and add special token [E_CLS] and [E_SEP] to indicate the beginning and the end of the table slot value respectively. Then, around $20\%$ tokens are masked and the cross entropy loss is employed as the objective function. One corrupted example for further pre-training stage is "[CLS]" name is [E_CLS] [MASK] kiprono [MASK] [E_SEP]; birth_date is [E_CLS] 10 august [MASK] [E_SEP]; ... [SEP]. + +During pre-training, AMG modifies the UniLM model architecture by designing a novel slot attention mask as well as slot memory mechanism which introduces additional weights. There are two goals for pre-training: 1) tune UniLM weights to incorporate slot attention mask, and 2) learn proper weights for slot memory block. We divide the pretraining stage into two phases: slot attention based pre-training and slot memory based pre-training. + +We incrementally incorporate the slot attention and slot memory elements to the UniLM model along the two pre-training phases. First, the model structure of slot attention based pre-training is to add the slot attention mask to the last 6 layers of UniLM. We also learn the embedding of two special tokens [E_CLS] and [E_SEP] by adding them into the UniLM vocabulary. We load the UniLM checkpoint model weight as the initial weight for slot attention based pre-training. The second slot memory based pre-training phase adopts the full AMG model, and is loaded with the checkpoint obtained after the slot attention mask based pre-training. + +# 3.5 Fine-Tuning and Inference + +In fine-tuning stage, AMG first loads the model weight after the further pre-training stage which exploits valuable information from plenty of unlabelled task relevant data. The input for our proposed model is the concatenation of the linearized table and the reference sentence. The model is trained end to end in masked language model fashion. Around $70\%$ words in the reference are masked, and the cross entropy loss is used to minimize the discrepancy between the masked token + +and the groundtruth. + +For inference, table side data is present while the reference sentence is missing. Our approach generates sentence auto-regressively. When making prediction on the $t$ -th word, we need to inform the model previously generated table slots through table slot history representation $his^t$ . + +# 4 Experiment + +In this section, we explore the following experimental questions: (1) Can the proposed model generate fluent sentences?; and (2) Is the generated sentence faithful to the fact given by input table? We also perform ablation analysis to investigate the two main components of AMG, namely the slot attention and slot memory mechanism. + +# 4.1 Dataset + +Task Adaptive Dataset for Pre-training To pretrain AMG, we collect additional unlabelled data from WikiBio (Lebret et al., 2016) and Wiki dataset. First, Wiki-Humans is a subset of WikiBio dataset which contains massive training examples collected from Wikipedia, a cleaned-up version of original WikiBio dataset by setting a vocabulary bound and removing those include out-of-vocabulary words that are not in the given table. Since pre-training only requires the table side data and focuses on reconstructing the corrupted text, we collect the rest of table side data (around 500K from WikiBio by removing all the train-valid/test data used in Wiki-Humans heuristically. Second, for songs and books domain, we collect around 26K and 17K filtered out table data from (Chen et al., 2020c) respectively as the pre-training data. + +Dataset for Fine-Tuning Inspired by the experimental settings of few-shot natural language generation in (Chen et al., 2020c), we conduct experiments on three domains, i.e., humans, songs and books of Wiki dataset denoted as Wiki-Humans, Wiki-Songs and Wiki-Books. For each domain, we fine tune AMG to inspect the model performance on various few shot settings by sampling different amount of training examples (e.g. 500, 200, 100, 50). The validation set for each domain includes 1000 instances, and test sets of humans, songs and books domain have 13587, 11879 and 5252 examples. We set the maximum length of the linearized table and the generated sentence as 300 and 64 respectively. + +# 4.2 Implementation Details + +The base model for AMG is UniLM-base model with 12 Transformer layers, 768 hidden state dimensions, and 110M parameters in total. The implementation of AMG is divided into two stages in total: 1) two-phase task adpative pre-training, and 2) fine-tuning on the target wiki dataset. We run the program on a single 1080Ti GPU with 12GB memory. Due to the memory constraint, the batch size on all stages is set as 4 and gradient is accumulated every 11 steps which results in a comparable 44 batch size. The learning rate is $5e - 5$ . The Adam (Kingma and Ba, 2015) optimizer is used and the weight decay is set as 0.01. + +For fine-tuning, we fine-tune the AMG on target dataset by setting the maximum number of epoch as 50. For inference, we decode on the test set using the best checkpoints according to the validation set result. During inference, we use beam search with beam size 3 and length penalty 1. + +# 4.3 Baselines + +We compare the proposed model with strong pretrained language models. UniLM (Dong et al., 2019) is a pre-trained language model for both natural language understanding and generation using three types of language modeling tasks. BART (Lewis et al., 2020) introduces a denoising autoencoder for pre-training sequence-to-sequence models. GPT-2 (Radford et al., 2019) is a powerful unidirectional model pre-trained on millions of webpages in auto-regressive fashion. GPT2+copy (Chen et al., 2020c) designed for few-shot table-to-text generation learns how to alternate between copying from table and generating functional words using GPT-2. TableGPT (Gong et al., 2020) is a followup work of (Chen et al., 2020c) while considers to minimize the contradicting part of the generated sentence give the table information. + +# 4.4 Automatic Evaluation + +Following other generation tasks, we choose three automatic evaluation metrics BLEU-4 (Papineni et al., 2002), ROUGE-L (Lin, 2004) and METEOR (Banerjee and Lavie, 2005) to evaluate the overlapping between the generated sentence and the reference sentence. Besides, to evaluate the faithfulness of generated sentence with the source table, we adopt PARENT (Dhingra et al., 2019) as our main metric. PARENT not only considers the + +
Domain +# of training examplesHumansBooksSongs
501002005005010020050050100200500
GPT2+copy (our replication)30.5934.5940.5445.5942.6742.7943.4444.8740.1841.7243.9744.75
GPT2 (Radford et al., 2019)0.1712.9019.0225.890.7120.8224.1824.940.8517.0824.7225.65
BART (Lewis et al., 2020)37.7341.3747.4145.4541.6843.4343.6548.1141.7442.4444.1246.00
UniLM (Dong et al., 2019)35.8041.8346.0849.6138.2841.3944.0645.8740.1741.9542.4544.55
AMG43.5547.7250.1351.8643.4246.0347.4548.5942.0343.3045.9346.90
+ +matching between the generated sentence with the reference, but also takes how much table slot information is reflected in the generated sentence into account. In addition, to further evaluate the faithfulness of the generated text, PARENT-T (Wang et al., 2020) which only measures the matching between the generated text and the corresponding table is also included. + +Results We first compare AMG with state-of-the-art models mentioned in section 4.3. Table 1 shows the performance of AMG and baseline models on three domains of Wiki dataset using 500 training examples. For (Chen et al., 2020c), we copy the code that the author released on GitHub and replicate the result denoted as GPT2+copy (our replication). Regarding the conventional overlapping based metrics BLEU-4, METEOR, ROUGE-L, We can see that AMG provides the best overall performance under various domains and evaluation metrics. AMG outperforms the base model UniLM $3.71\% / 3.32\% / 2.46\%$ on BLEU-4 under Humans/Books/Songs domains, and AMG gains $0.73\% / 0.53\% / 0.16\%$ more than the second best model BART on METEOR. AMG outperforms the second best model BART $1.07\% / 0.48\% / 0.90\%$ on the F score of PARENT which is a strong indication that AMG can achieve the strongest balance between the fluency and faithfulness. Regarding the overlapping between the generated sentence with table content, F scores of PARTENT-T metric shows that AMG provides the most informative results on Humans and Songs domains while still very competitive with the best model BART on Books domain. + +Besides, to verify the stability of AMG when the amount of training data varies to 50, 100, 200 and 500, we show PARENT score for the proposed and other baseline models in Table 2. As shown in the table, over various domain and number of training example settings, AMG outperforms other baseline models. Specifically, under the 200 training examples, AMG outperforms the + +Table 2: PARENT F score on three domains using 50/100/200/500 training examples. + +
Domain#sup#conoverall
Reference3.871.713.55
GPT2+copy (our replication)3.991.753.39
GPT2 (Radford et al., 2019)3.731.693.61
BART (Lewis et al., 2020)4.0171.533.24
UniLM (Dong et al., 2019)3.921.653.52
AMG4.0231.753.22
+ +second strongest model BART by $2.72\%$ on Humans, UniLM by $3.39\%$ on Books, and BART by $1.81\%$ on Songs. The results demonstrate that leveraging the table slot attention as well as the memory mechanism provide a stable and competitive performance of faithful generation. On the other hand, on the Humans/Books/Songs domain with 50 training examples, AMG gains $5.82\% / 1.74\% / 0.29\%$ improvements than the second best model BART respectively which shows that our model has powerful generative ability even only 50 examples are present. And human domains achieve the most gain since we collect most pre-training data for the task adaptive pre-training, thus it would be beneficial for the further work to collect more task adaptive pre-training data for Books and Songs domains to further boost the model performance. + +# 4.5 Analysis + +We further analysis the faithfulness and the overall quality of the generated descriptions by conducting human evaluation. Then, we design ablation studies to investigate the importance of two building blocks of AMG: span attention and memory mechanism. In addition, we sample a specific input table and compare sentence generated by AMG with the state-of-the-art models shown in Figure 3. + +Table 3: Results of human evaluation. + +
BARTAMG
50 shots rating3.874.11p=0.002
500 shots rating4.464.55p=0.24
+ +Table 4: Statistical significance on human evaluation. + +Human Evaluation Following (Wang et al., 2020; Chen et al., 2020c), we recruit three human annotators who pass the College English Test (CET-6) English test $^{2}$ to judge the quality of the generated sentence. We sample 100 test tables and collect corresponding outputs from AMG, and baseline models. The sentences are randomly shuffled to reduce human variance. We provide instructions for human annotators to evaluate the sentence quality from two aspects: faithfulness and overall quality. First, for faithfulness, they are supposed to identify the number of entities mentioned in the sentence. Then, they need to compare the entities with ones from source table. Finally, they are supposed to report the number of fact supported and contradicted from the table respectively. Subsequently, we compute the average number of supported and unsupported entities denoted by #sup and #con in Table 3. The second study evaluates the overall quality of the generated sentence from their fluency, grammatical correctness, and the information consistency with the table. To compare the overall quality of various models, annotators rank the sentences generated using different models from 1 (best) to 6 (worst) by comparing the sentence. The "overall" column refers to the average ranking of the model. Table 3 shows that AMG generates better quality sentences compared with other models. Specifically, the outputs generated by AMG contains the most information supported by the table and the overall quality is ranked the first place. Although it shows the number unsupported by the table is higher than other models, the overall quality still outperforms other models. + +The overall ranking in Table 3 between BART and AMG is quite close, thus we ask 3 human evaluators to rate the generated sentences from 3 criteria, and then calculate the statistical significance of the overall rating between BART and AMG. We randomly sample 50 sentences for 50 and 100 training examples in few-shot cases respectively. Three annotators are instructed to re-evaluate the overall sentence quality by rating them from 1 (worst) to 5 (best) by considering the following 3 criteria: (1) #sup, (2) #con (see Table 3), (3) naturalness and grammar correctness. The results are listed as follows. + +As shown in Table 4, comparing BART with AMG, the p-value $p$ 0.002 of Wilcoxon signed-rank tests shows at $95\%$ confidence level, AMG is + +![](images/8b0042b8bcdfa13aaf00f8e6058cbb02afe62b72b53a5a89c092841aaca5a296.jpg) +Figure 3: A case study of a specific table input for qualitative analysis of table-to-text generation. + +statistically significant with BART when training examples are as scarce as 50. While at $75\%$ confidence level, AMG is statistically significant with BART when training examples increase to 500. + +
ModelBLEUMETEORPARENTPARENT-T
AMG49.0237.9751.8644.70
AMG w/o span47.2837.1050.2443.36
AMG w/o mem48.9238.1451.3843.76
AMG w/o extra46.7836.9949.8344.00
+ +Table 5: Ablation study of the proposed model. + +Ablation Study We also conduct ablation studies to understand each component of the proposed model, including slot attention and slot memory mechanism. Table 5 provides the ablation results under different evaluation metrics. It shows that AMG can still outperform all these two variants overall, certifying the effectiveness of each designed component in our model and we demonstrate that incorporating table slot attention and memory mechanism with the pre-trained model UniLM can boost the model performance. + +Case Study Figure 3 provides a sample input table from test set along with various model outputs. The top box contains an input table while the bottom box includes model generations. In the bottom box, we leave the content supported by table as black, unsupported as light brown, and blue for the remaining words. We find that the output of pre + +trained baseline models suffer from the following problems: (1) repetition, e.g., BART fails to generate person name "wayne" correctly while repeats the last two letters as "wayne", (2) hallucination, e.g., GPT-2 generates a middle name "wayne" which is out of table, and GPT2+copy attempts to copy the "office" slot but fail to copy the entire information by introducing unsupported information "the oak house" and "2003 ... brotherwayne". By contrast, AMG provides the highest table coverage while keeping the sentence fluent which demonstrates the table slot span attention and memory mechanism enables the model to copy from the table slot level correctly and enhance the generation faithfulness. + +# 5 Related Work + +Table-to-Text Generation Recent years have witnessed much success on representing the semistructured tabular data and generating text to describe the table. From our investigation, most existing methods for table-to-text generation are based on the RNN-based encoder-decoder framework (Lebret et al., 2016; Liu et al., 2018; Wiseman et al., 2018; Ma et al., 2019; Liu et al., 2019a). Ma et al. (2019) extend the table-to-text generation to low-resource scenario and put forward a Transformer-based model. Of late, as the pretraining language model (e.g., BERT and GPT) has achieved significant successes in NLP, many works also propose to pre-train a model for table understanding. Yin et al. (2020) pre-train a model for jointly understanding of tabular data around textual descriptions on large-scale paired data. Herzig et al. (2020) extend the architecture of BERT to encode tables as input, and propose a weakly supervised pre-training model for question answering over tables. Kale (2020) investigate the performance of pre-trained T5 (Raffel et al., 2019) on multiple table-to-text tasks and provide a benchmark for the future research. To keep the faithfulness of table on generation, one related work to ours is (Wang et al., 2020), which introduces a new table-text optimal-transport matching loss and a table-text embedding similarity loss based on the Transformer model to enforce the faithfulness during text generation. + +Pre-Trained Language Model Our work is also related to model pre-training for NLP, which has brought dramatic improvements on natural language understanding (Devlin et al., 2019; Liu et al., 2019c; Clark et al., 2020; Sun et al., 2019) and + +generation (Song et al., 2019; Dong et al., 2019; Liu et al., 2020b, 2019b). The widely used pretrained models (PTMs) for table-to-text generation can be categorized into two classes: text-to-text PTMs (Radford et al., 2018; Devlin et al., 2019; Dong et al., 2019; Lewis et al., 2020; Joshi et al., 2020) and structured data-to-text PTMs (Chen et al., 2020b; Herzig et al., 2020; Xing and Wan, 2021). Recently, many pre-training models (Liu et al., 2021, 2020a; Yao et al., 2019) start to incorporate the structured information from knowledge bases (KBs) or other structured semantic annotations into pre-training, which is also related to our work. + +Few-shot text generation Few-shot text generation learns with minimal data while maintaining decent generation capacity. Few-shot text generation can be used to augment the scarce training data to better assist the down-stream task, e.g., (Xia et al., 2020a,b) for spoken language intent detection, (Bražinskas et al., 2020) for opinion summary generation. In addition, to better utilize the available resources, Chang et al. (2021) investigates the training instance selection on unlabelled data, and (Schick and Schütze, 2020) adapts pattern-exploiting training strategy to fine-tune a PTM. + +# 6 Conclusion + +In this paper, we have proposed a novel approach AMG for faithful table-to-text generation in few shots. We first attend over the multi-granularity of context using a novel span level and traditional token-by-token level attention strategy to exploit both the table structural and natural linguistic information. Then, we design a memory unit to memorize the table slot allocation states dynamically. Extensive experiments on three domains of Wiki dataset verify the effectiveness of our proposed model on generating fluent and faithful descriptions from tables. + +# Acknowledgements + +We would like to thank all the anonymous reviewers for their helpful comments. This work is supported by NSF under grants III-1763325, III-1909323, III-2106758, and SaTC-1930941. Yao Wan is partially supported by the Fundamental Research Funds for the Central Universities. + +# References + +Satanjeev Banerjee and Alon Lavie. 2005. Meteor: An automatic metric for mt evaluation with improved correlation with human judgments. In Proceedings of the acl workshop on intrinsic and extrinsic evaluation measures for machine translation and/or summarization, pages 65-72. +Arthur Bražinskas, Mirella Lapata, and Ivan Titov. 2020. Few-shot learning for opinion summarization. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4119-4135, Online. Association for Computational Linguistics. +Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. arXiv preprint arXiv:2005.14165. +Paweł Budzianowski, Tsung-Hsien Wen, Bo-Hsiang Tseng, Iñigo Casanueva, Ultes Stefan, Ramadan Osman, and Milica Gašić. 2018. Multiwoz - a large-scale multi-domain wizard-of-oz dataset for task-oriented dialogue modelling. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing (EMNLP). +Ernie Chang, Xiaoyu Shen, Hui-Syuan Yeh, and Vera Demberg. 2021. On training instance selection for few-shot neural text generation. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 2: Short Papers), pages 8-13, Online. Association for Computational Linguistics. +Wenhu Chen, Jianshu Chen, Yu Su, Zhiyu Chen, and William Yang Wang. 2020a. Logical natural language generation from open-domain tables. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7929-7942, Online. Association for Computational Linguistics. +Wenhu Chen, Yu Su, Xifeng Yan, and William Yang Wang. 2020b. KGPT: Knowledge-grounded pretraining for data-to-text generation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 8635-8648, Online. Association for Computational Linguistics. +Zhiyu Chen, Harini Eavani, Wenhu Chen, Yinyin Liu, and William Yang Wang. 2020c. Few-shot NLG with pre-trained language model. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 183-190, Online. Association for Computational Linguistics. +Kevin Clark, Minh-Thang Luong, Quoc V. Le, and Christopher D. Manning. 2020. Electra: Pretraining text encoders as discriminators rather than + +generators. In International Conference on Learning Representations. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. Bert: Pre-training of deep bidirectional transformers for language understanding. +Bhuwan Dhingra, Manaal Faruqui, Ankur Parikh, Ming-Wei Chang, Dipanjan Das, and William Cohen. 2019. Handling divergent reference texts when evaluating table-to-text generation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4884-4895, Florence, Italy. Association for Computational Linguistics. +Chrysanne DiMarco, H Dominic Covvey, Peter Bray, Donald Cowan, Vic DiCiccio, Eduard Hovy, Joan Lipa, and Doug Mulholland. 2007. The development of a natural language generation system for personalized e-health information. Medinfo, 2007:12th. +Li Dong, Nan Yang, Wenhui Wang, Furu Wei, Xiaodong Liu, Yu Wang, Jianfeng Gao, Ming Zhou, and Hsiao-Wuen Hon. 2019. Unified language model pre-training for natural language understanding and generation. In Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc. +Heng Gong, Yawei Sun, Xiaocheng Feng, Bing Qin, Wei Bi, Xiaojiang Liu, and Ting Liu. 2020. TableGPT: Few-shot table-to-text generation with table structure reconstruction and content matching. In Proceedings of the 28th International Conference on Computational Linguistics, pages 1978-1988, Barcelona, Spain (Online). International Committee on Computational Linguistics. +Suchin Gururangan, Ana Marasovic, Swabha Swayamdipta, Kyle Lo, Iz Beltagy, Doug Downey, and Noah A. Smith. 2020. Don't stop pretraining: Adapt language models to domains and tasks. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 8342-8360, Online. Association for Computational Linguistics. +Sadid A Hasan and Oladimeji Farri. 2019. Clinical natural language processing with deep learning. In Data Science for Healthcare, pages 147-171. Springer. +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. +Jonathan Herzig, Pawel Krzysztof Nowak, Thomas Müller, Francesco Piccinno, and Julian Eisenschlos. 2020. TaPas: Weakly supervised table parsing via pre-training. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4320-4333, Online. Association for Computational Linguistics. + +Mandar Joshi, Danqi Chen, Yinhan Liu, Daniel S. Weld, Luke Zettlemoyer, and Omer Levy. 2020. SpanBERT: Improving pre-training by representing and predicting spans. Transactions of the Association for Computational Linguistics, 8:64-77. +Mihir Kale. 2020. Text-to-text pre-training for data-to-text tasks. arXiv preprint arXiv:2005.10433. +Diederik P Kingma and Jimmy Ba. 2015. Adam: A method for stochastic optimization. In Proceedings of the 3rd International Conference on Learning Representations, San Diego, CA. +Rémi Lebret, David Grangier, and Michael Auli. 2016. Neural text generation from structured data with application to the biography domain. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 1203-1213, Austin, Texas. Association for Computational Linguistics. +Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. 2020. BART: Denoising sequence-to-sequence pretraining for natural language generation, translation, and comprehension. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7871-7880, Online. Association for Computational Linguistics. +Percy Liang, Michael Jordan, and Dan Klein. 2009. Learning semantic correspondences with less supervision. In Proceedings of the Joint Conference of the 47th Annual Meeting of the ACL and the 4th International Joint Conference on Natural Language Processing of the AFNLP, pages 91-99, Suntec, Singapore. Association for Computational Linguistics. +Chin-Yew Lin. 2004. Rouge: A package for automatic evaluation of summaries. In Text summarization branches out, pages 74-81. +Tianyu Liu, Fuli Luo, Qiaolin Xia, Shuming Ma, Baobao Chang, and Zhifang Sui. 2019a. Hierarchical encoder with auxiliary supervision for neural table-to-text generation: Learning better representation for tables. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 6786-6793. +Tianyu Liu, Kexiang Wang, Lei Sha, Baobao Chang, and Zhifang Sui. 2018. Table-to-text generation by structure-aware seq2seq learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32. +Weijie Liu, Peng Zhou, Zhe Zhao, Zhiruo Wang, Qi Ju, Haotang Deng, and Ping Wang. 2020a. K-bert: Enabling language representation with knowledge graph. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 2901-2908. + +Ye Liu, Yao Wan, Lifang He, Hao Peng, and Philip S Yu. 2021. Kg-bart: Knowledge graph-augmented bart for generative commonsense reasoning. In Proceedings of the AAAI Conference on Artificial Intelligence. +Ye Liu, Tao Yang, Zeyu You, Wei Fan, and Philip S Yu. 2020b. Commonsense evidence generation and injection in reading comprehension. In Proceedings of SIGDIAL. +Ye Liu, Chenwei Zhang, Xiaohui Yan, Yi Chang, and Philip S Yu. 2019b. Generative question refinement with deep reinforcement learning in retrieval-based qa system. In Proceedings of the 28th ACM International Conference on Information and Knowledge Management, pages 1643-1652. +Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019c. Roberta: A robustly optimized bert pretraining approach. +Shuming Ma, Pengcheng Yang, Tianyu Liu, Peng Li, Jie Zhou, and Xu Sun. 2019. Key fact as pivot: A two-stage model for low resource table-to-text generation. arXiv preprint arXiv:1908.03067. +Jekaterina Novikova, Ondrej Dušek, and Verena Rieser. 2017. The E2E dataset: New challenges for end-to-end generation. In Proceedings of the 18th Annual SIGdial Meeting on Discourse and Dialogue, pages 201-206, Saarbrücken, Germany. Association 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 of the Association for Computational Linguistics, pages 311-318. +Baolin Peng, Chenguang Zhu, Chunyuan Li, Xiujun Li, Jinchao Li, Michael Zeng, and Jianfeng Gao. 2020. Few-shot natural language generation for task-oriented dialog. In *Findings of the Association for Computational Linguistics: EMNLP* 2020, pages 172-182, Online. Association for Computational Linguistics. +Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. 2018. Improving language understanding with unsupervised learning. +Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9. +Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. 2019. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv e-prints. + +Timo Schick and Hinrich Schütze. 2021. It's not just size that matters: Small language models are also few-shot learners. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 2339-2352, Online. Association for Computational Linguistics. +Timo Schick and Hinrich Schütze. 2020. Few-shot text generation with pattern-exploiting training. +Kaitao Song, Xu Tan, Tao Qin, Jianfeng Lu, and TieYan Liu. 2019. MASS: Masked sequence to sequence pre-training for language generation. In Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 5926-5936. PMLR. +Yu Sun, Shuohuan Wang, Yukun Li, Shikun Feng, Xuyi Chen, Han Zhang, Xin Tian, Danxiang Zhu, Hao Tian, and Hua Wu. 2019. Ernie: Enhanced representation through knowledge integration. arXiv preprint arXiv:1904.09223. +Qingyun Wang, Xiaoman Pan, Lifu Huang, Boliang Zhang, Zhiying Jiang, Heng Ji, and Kevin Knight. 2018. Describing a knowledge base. In Proceedings of the 11th International Conference on Natural Language Generation, pages 10-21, Tilburg University, The Netherlands. Association for Computational Linguistics. +Zhenyi Wang, Xiaoyang Wang, Bang An, Dong Yu, and Changyou Chen. 2020. Towards faithful neural table-to-text generation with content-matching constraints. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 1072-1086, Online. Association for Computational Linguistics. + +Jason Williams, Antoine Raux, Deepak Ramachandran, and Alan Black. 2013. The dialog state tracking challenge. In Proceedings of the SIGDIAL 2013 Conference, pages 404-413, Metz, France. Association for Computational Linguistics. +Sam Wiseman, Stuart Shieber, and Alexander Rush. 2018. Learning neural templates for text generation. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 3174-3187, Brussels, Belgium. Association for Computational Linguistics. +Congying Xia, Caiming Xiong, Philip Yu, and Richard Socher. 2020a. Composed variational natural language generation for few-shot intents. In *Findings of the Association for Computational Linguistics: EMNLP* 2020, pages 3379-3388, Online. Association for Computational Linguistics. +Congying Xia, Chenwei Zhang, Hoang Nguyen, Jiawei Zhang, and Philip Yu. 2020b. Cg-bert: Conditional text generation with bert for generalized few-shot intent detection. arXiv preprint arXiv:2004.01881. +Xinyu Xing and Xiaojun Wan. 2021. Structure-aware pre-training for table-to-text generation. In *Findings of the Association for Computational Linguistics: ACL-IJCNLP* 2021, pages 2273-2278, Online. Association for Computational Linguistics. +Liang Yao, Chengsheng Mao, and Yuan Luo. 2019. Kgbert: Bert for knowledge graph completion. arXiv preprint arXiv:1909.03193. +Pengcheng Yin, Graham Neubig, Wen tau Yih, and Sebastian Riedel. 2020. TaBERT: Pretraining for joint understanding of textual and tabular data. In Annual Conference of the Association for Computational Linguistics (ACL). \ No newline at end of file diff --git a/attendmemorizeandgeneratetowardsfaithfultabletotextgenerationinfewshots/images.zip b/attendmemorizeandgeneratetowardsfaithfultabletotextgenerationinfewshots/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..9cc2a7328b1a5518bc27a7be2056718f658c1632 --- /dev/null +++ b/attendmemorizeandgeneratetowardsfaithfultabletotextgenerationinfewshots/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:97656a8bd4d29bd52ad03696a4387eb06f8c5bc1a52b8f32deb47e030a54fdda +size 538605 diff --git a/attendmemorizeandgeneratetowardsfaithfultabletotextgenerationinfewshots/layout.json b/attendmemorizeandgeneratetowardsfaithfultabletotextgenerationinfewshots/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..e7d83bf4411d28afa036528e9280bca345d980fc --- /dev/null +++ b/attendmemorizeandgeneratetowardsfaithfultabletotextgenerationinfewshots/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d6553909d1fc7d8c1fbf54f3e73bbe8026df9e7ddda1673a884f68f3559da759 +size 364602 diff --git a/attentionbasedcontrastivelearningforwinogradschemas/7adde1d6-a5ad-4749-9463-d512edd25f0d_content_list.json b/attentionbasedcontrastivelearningforwinogradschemas/7adde1d6-a5ad-4749-9463-d512edd25f0d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..ce1df08539bd0844380912801967cc1131db9959 --- /dev/null +++ b/attentionbasedcontrastivelearningforwinogradschemas/7adde1d6-a5ad-4749-9463-d512edd25f0d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18a8ded16d27af66a6ff22863ceb4a3940693a7125f2e725cf774ddf91978e8b +size 45641 diff --git a/attentionbasedcontrastivelearningforwinogradschemas/7adde1d6-a5ad-4749-9463-d512edd25f0d_model.json b/attentionbasedcontrastivelearningforwinogradschemas/7adde1d6-a5ad-4749-9463-d512edd25f0d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..795fb4b51a8594f9ed947f51a5e316622418026e --- /dev/null +++ b/attentionbasedcontrastivelearningforwinogradschemas/7adde1d6-a5ad-4749-9463-d512edd25f0d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:42ede118c273114114cac255bbfc5488eeec5fcba46585867cc18127bc6a5473 +size 56445 diff --git a/attentionbasedcontrastivelearningforwinogradschemas/7adde1d6-a5ad-4749-9463-d512edd25f0d_origin.pdf b/attentionbasedcontrastivelearningforwinogradschemas/7adde1d6-a5ad-4749-9463-d512edd25f0d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..cf74d0dc264d74745ed683cd1ca0e797327aca4d --- /dev/null +++ b/attentionbasedcontrastivelearningforwinogradschemas/7adde1d6-a5ad-4749-9463-d512edd25f0d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:920c54ce10314b25aa169868fb37c8fb9f491b74bc2579904d12232d69f4b9c8 +size 310207 diff --git a/attentionbasedcontrastivelearningforwinogradschemas/full.md b/attentionbasedcontrastivelearningforwinogradschemas/full.md new file mode 100644 index 0000000000000000000000000000000000000000..fdc6fb529942d9162ade68af5f84efe5fc1592cb --- /dev/null +++ b/attentionbasedcontrastivelearningforwinogradschemas/full.md @@ -0,0 +1,178 @@ +# Attention-based Contrastive Learning for Winograd Schemas + +Tassilo Klein + +SAP AI Research + +tassilo.klein@sap.com + +Moin Nabi + +SAP AI Research + +m.nabi@sap.com + +# Abstract + +Self-supervised learning has recently attracted considerable attention in the NLP community for its ability to learn discriminative features using a contrastive objective (Qu et al., 2020; Klein and Nabi, 2020). This paper investigates whether contrastive learning can be extended to Transfomer attention to tackling the Winograd Schema Challenge. To this end, we propose a novel self-supervised framework, leveraging a contrastive loss directly at the level of self-attention. Experimental analysis of our attention-based models on multiple datasets demonstrates superior commonsense reasoning capabilities. The proposed approach outperforms all comparable unsupervised approaches while occasionally surpassing supervised ones. + +# 1 Introduction + +Pre-trained language models have propelled the domain of NLP to a new era. Specifically, Transformer-based models are the driving force behind recent breakthroughs. However, despite all the recent success in text understanding, the task of commonsense reasoning is still far from being solved (Marcus, 2020; Kocijan et al., 2020). In order to assess the commonsense reasoning capabilities of automatic systems, several tasks have been devised. Among them is the popular Winograd Schema Challenge (WSC) (Levesque et al., 2012). WSC frames commonsense reasoning as a pronoun co-reference resolution problem (Lee et al., 2017), which consists of twin-pair sentences. Experts curated the twin pairs manually to be "Google-proof", e.g., simple statistical biases from large data should be insufficient to resolve the pronouns. Hence, solving WSC was expected to require diverse reasoning capabilities (e.g., + +relational, causal). Sentences in the twin pairs differ only in the "trigger word". Furthermore, trigger words are responsible for switching the correct answer choice between the questions. Below is a popular example from WSC. In the example, the trigger word is underlined. The challenge entails resolving the pronoun "it" with a noun from the candidate set ("suitcase", "trophy"): + +Sentence-1: The trophy doesn't fit in the suitcase because it is too small. + +Answers: A) the trophy B) the suitcase + +Sentence-2: The trophy doesn't fit in the suitcase because it is too big. + +Answers: A) the trophy B) the suitcase + +The research community has recently experienced an abundance of methods proposing to utilize the latest language model (LM) for commonsense reasoning (Kocijan et al., 2019b; He et al., 2019; Ye et al., 2019; Ruan et al., 2019; Trinh and Le, 2018; Klein and Nabi, 2019; Tamborrino et al., 2020). Models learned on large text corpora were hoped to internalize commonsense knowledge implicitly encountered during training. Most of such methods approach commonsense reasoning in a two-stage learning pipeline. Starting from an initial self-supervised learned model, commonsense enhanced LMs are obtained in a subsequent fine-tuning (ft) phase. Fine-tuning enforces the LM to solve the downstream WSC task only as a plain co-reference resolution task. Despite some initial success in this direction, we hypothesize that the current self-supervised tasks used in the pre-training phase are too "shallow" to enforce the model to capture a "deeper" notion of commonsense (Kejriwal and Shen, 2020; Elazar et al., 2021). Shortcomings of models obtained in such a fashion can partially be attributed to the training corpora itself. Standard training sets such + +as Wikipedia barely contain commonsense knowledge, so supervised fine-tuning only promotes the discovery of "artificial" cues and language biases to tackle commonsense reasoning (Trichelair et al., 2018; Saba, 2018; Trichelair et al., 2019; Emami et al., 2019; Kavumba et al., 2019). This is the main reason why supervised methods pre-trained on large datasets (e.g., WinoGrande) can transfer effectively to smaller target datasets (e.g., WSC) yet do not show the same performance level on the source dataset. + +In an attempt to avoid the utilization of shallow commonsense reasoning cues, very recently (Klein and Nabi, 2020) introduced a Contrastive Self-Supervised (CSS) learning method, leveraging the mutual-exclusivity of WSC pairs. Despite almost reaching state-of-the-art performance, the approach does not require external knowledge for training. However, the authors observed that leveraging the contrastive loss directly on the Transformer-backbone at the LM-level can destabilize the self-supervised optimization. + +We propose a novel self-supervised loss to address this, introducing an abstraction layer between the backbone and the downstream task. Our approach smoothly manipulates the attentions to achieve this goal in a Transformer-like fashion while avoiding destabilization of the intrinsics. To do so, we make use of the non-identifiability property of attention, which implies that the attention values are not uniquely determined from the head's output, and vice versa. Consequently, various attention patterns across the Transformer can result in identical outcomes and permit regularization - see for details (Brunner et al., 2020). Intuitively, the proposed contrastive attention mechanism does not overwrite the low-level semantics captured in the pre-trained model. Instead, it induces modest adjustments via attention patterns. In the context of Winograd schemas, the proposed approach shifts the attention from the wrong answer candidate to the right candidate. Simultaneously, the attention contrast forces the LM to be more rigorous across attention heads while consistent over the samples. In summary, our contributions are the following: First, we propose a contrastive loss enforced on the Transformer attention, which helps for the emergence of commonsense patterns. Second, we present empirical evidence showcasing the viability of the approach, outperforming comparable state-of-the-art. + +# 2 Attention-based Contrastive Learning + +Preliminaries: The proposed approach extends the contrastive self-supervised method (Klein and Nabi, 2020) to facilitate commonsense reasoning for Winograd schemas at the attention level. In the context of data, we assume that $\mathcal{D}$ with $N = |\mathcal{D}_c|$ is a dataset constructed from contrastive twin-pairs samples, $(s_i,s_{i + 1})\in \mathcal{D}_c$ , with $c_{j}$ and $c_{j + 1}$ denoting answer candidates. The difference between the sentence pairs is the so-called "trigger words" responsible for flipping the answer in pronoun disambiguation. Thus, this trigger-word structure induces a mutual-exclusive candidate answer relationship at the pair level. In the context of the model, we employ a Transformer-based LM for Masked Token Prediction (Devlin et al., 2018). Given a sentence with a [MASK] token, the LM provides the likelihood of sentence $s_i$ with the token replaced by candidate tokens $c_{j}\in \{[\mathrm{CANDIDATE - 1}], [\mathrm{CANDIDATE - 2}]\}$ denoted as $p(c_j|s_i) = p_{i,j}$ , assuming that the dataset consists of $i\in \frac{N}{2}$ distinct twin-pairs. Besides sentence likelihoods, the Transformer architecture also provides an attention tensor $\mathcal{A}(x)\in \mathbb{R}^{H\times L\times C\times C}$ , for a given an input $x$ with $|x| = C$ , where $L$ denotes the number of layers, and $H$ the number of heads. Then the tensor decomposes into elements $a_{i,j}^{h,l}(x)$ , gauging the influence of token $i$ w.r.t. token $j$ in layer $l$ of attention head $h$ . + +# 2.1 Method + +Inspired by (Klein and Nabi, 2020), we make use of the structural prior of Winograd schemas and their within-pair mutual-exclusivity. We formulate this as in context of Transformer-based LM as a multi-task optimization problem defined as: + +$$ +\mathcal {L} (f _ {\theta}) = \mathcal {L} (f _ {\theta}) _ {C M} + \mathcal {L} (f _ {\theta}) _ {C M} +$$ + +Here $f$ denotes the underlying LM parameterized by $\theta$ . The first term, $\mathcal{L}_{CM}$ leverages the contrast arising from twin pairs enforcing mutual-exclusivity on attentions. The second term, $\mathcal{L}_{CM}$ , seeks to further reduce ambiguity at the LM level by maximization between the differences of the likelihoods for the answer candidates. It should be noted that although the proposed approach leverages the structural prior of twin pairs and it does not make use of any class label information explicitly, similar to (Klein and Nabi, 2020). See Fig. 1 for a schematic illustration of the proposed method. + +![](images/a209aa779b712cc6b83ee595dc206ee3469df680719e2b7d1c3e0053cc64613d.jpg) +Figure 1: Schematic illustration of contrastive learning for a particular sentence, where colors show attention maps for different words of a mock setup with 3 heads and 3 layers. Squares with blue/red frames correspond to specific sliced attention $3 \times 3$ matrix for candidates, 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. The Attention-based Contrast shows a more consistent disambiguation attention for the correct candidate compare to the LM-based Contrast (Klein and Nabi, 2020). + +# 2.1.1 Contrastive Attention + +The contrastive mechanism targets regularizing self-attention patterns emerging by invoking the LM on an input sequence, thus providing the model with commonsense reasoning capabilities. Specifically, the proposed approach seeks to induce consistently higher attention values across all attention heads and layers for the right candidate as opposed to the wrong one. This contrasts with the LM-level MEx (Klein and Nabi, 2020), where only the overall value of attention is enforced to be higher for the right candidate - see Fig. 1 for an illustration. Hence, the proposed approach promotes the emergence of diverse attention patterns between the attention heads, avoiding issues such as the collapse to a single dominant head. To this end, our proposed approach invokes twin-pair contrast on attention level for samples in $\mathcal{D}_c$ . This pushes for the superior establishment of distant dependencies more indirectly than enforcing it directly on the LM. Given the observation of (Brunner et al., 2020) that distant relationships are formed towards the end of the transformer stack, we restrict instantiation of the contrastive attention loss on the last layers. This, in combination with the non-uniqueness of Transformer attentions w.r.t. output, operating on attention level suggests comparably smoother behavior. In order to resolve ambiguity in the attention mechanism w.r.t. candidates, we + +tie mutual exclusivity together with a binarization scheme. Here binarization refers to a simple form of mutual exclusivity loss applied in binary classification cases (such as WSC), defined as: + +$$ +\mathcal{L}_{CA} = -\lambda \sum_{\substack{i = 1,j = 1\\ i + = 2}}^{N,2}\left(\mathbf{a}_{i,j} - \frac{\mathbf{e}}{2}\right)^{2} + \left(\mathbf{a}_{i + 1,j} - \frac{\mathbf{e}}{2}\right)^{2} +$$ + +$$ ++ 1 - \left(\mathbf {a} _ {i, j} - \mathbf {a} _ {i + 1, j}\right) ^ {2} + 1 - \left[ \left(1 - \mathbf {a} _ {i, j}\right) - \left(1 - \mathbf {a} _ {i + 1, j}\right) \right] ^ {2} +$$ + +Here $\mathbf{a} \in \mathbb{R}^H$ denotes a vector containing the attentions of all heads. Assuming attentions to be normalized w.r.t. candidates, i.e., $\sum_{j} a_{i,j} = 1$ , effectively turns them into pseudo-likelihoods. Furthermore, $\mathbf{e} \in \mathbb{R}^H$ is vector with all elements $1$ , and $\lambda \in \mathbb{R}$ a hyperparameter. + +# 2.1.2 Contrastive Margin + +To stabilize optimization, we leverage consistency between sentences of each contrastive pair. On the one hand, it leads to faster convergence. On the other hand, it enforces smoothness on the loss surface and decreases the overall gradient fluctuation. The CM term seeks to maximize the margin between the LM likelihoods for each candidate in a pair: + +$$ +\mathcal {L} _ {C M} = - \alpha \sum_ {i, j} ^ {N, 2} \max \left(0, \left| p _ {i, j} - p _ {i, j + 1} \right| + \beta\right), +$$ + +
MethodWSCDPRW.G.K.RefW.Gen.
Bi-LSTM (Opitz and Frank, 2018)56.063.0---
BERT (DPR-ft)69.8-50.261.059.2
BERT (MaskedWiki-DPR-ft) (Kocijan et al., 2019b)67.083.350.2-79.2
BERT (WikiCREM-DPR-ft) (Kocijan et al., 2019a)71.884.8---
RoBERTa (DPR-ft)83.1-59.484.2-
RoBERTa (WG-ft) (Sakaguchi et al., 2019)90.192.5-85.6-
(Rahman and Ng, 2012)58.073.0---
(Peng et al., 2015)-76.4---
Knowledge Hunter (Emami et al., 2018)57.1----
E2E (Emami et al., 2019)---58.0-
MAS (Klein and Nabi, 2019)60.3----
Ensemble LM (Trinh and Le, 2018)63.8----
BERT (zero-shot) (Vaswani et al., 2017)62.658.551.762.362.5
RoBERTa (zero-shot) (Liu et al., 2019)67.770.353.760.461.6
Self-supervised Ref. (BERT) (Klein and Nabi, 2021)61.561.352.362.462.0
Self-supervised Ref. (RoBERTa) (Klein and Nabi, 2021)71.776.955.063.969.1
CSS (BERT) (Klein and Nabi, 2020)69.680.150.965.569.5
CSS (RoBERTa) (Klein and Nabi, 2020)79.890.657.768.076.2
Our Proposed Method84.190.060.869.993.3
+ +Table 1: Results on different tasks: WSC, DPR, WinoGrande(W.G.), KnowRef (K Ref) and WinoGender (W.Gen). Task performances in accuracy $(\%)$ are subdivided into two parts. Top: supervised (ft), bottom: unsupervised. + +with $\alpha, \beta \in \mathbb{R}$ being hyperparameters. + +When training the language model, the algorithm will look for a pattern of consistency in the attention heads and layers rather than force-fit supervisory signals from labels. Assuming the answer of the first sentence is [CANDIDATE-1], it follows the answer for the second one is [CANDIDATE-2]. This restricts the answer space. As the model is forced to leverage the pairwise relationship to resolve the ambiguity, it needs to generalize w.r.t. commonsense relationships. Intuitively speaking, as no labels are provided to the model during training, the model seeks to make the answer probabilities less ambiguous. It should be noted that the proposed approach leverages the structural prior of twin pairs, not making use of any label. + +# 3 Experiments and Results + +# 3.1 Setup + +We leverage RoBERTa (Liu et al., 2019) as Language Model for Masked Token Prediction, and DPR (Rahman and Ng, 2012) as dataset for training. Specifically, we use the Hugging Face (Wolf et al., 2019) implementation of RoBERTa. The model is trained for 22 epochs using a batch size of 18 (pairs). Hyperparameters are $\alpha = 0.05$ , $\beta = 0.02$ + +$\lambda = 1.0$ . For optimization Adam was selected with a learning rate of $10^{-5}$ . Commonsense reasoning is approached by first fine-tuning the pretrained RoBERTa (large) masked-LM model on the DPR (Rahman and Ng, 2012). + +# 3.2 Results + +While observing loss fluctuations by learning mutual-exclusivity at LM model directly via log-likelihood (MEx) (Klein and Nabi, 2020), such fluctuations are less pronounced when operating at attention level (proposed approach). + +We evaluate the performance on different tasks - see Tab. 1. As can be seen, the proposed approach outperforms other unsupervised methods by a significant margin, outperforming some supervised methods or at least significantly reducing the gap between supervised and unsupervised approaches. The results are discussed separately for each benchmark below: + +WSC (Levesque et al., 2012): the most well-known pronoun disambiguation benchmark. Our method outperforms the strongest unsupervised baseline CSS(BERT) margin of $(+14.5\%)$ and CSS(RoBERTa) by $(+4.3\%)$ . + +DPR (Rahman and Ng, 2012): this pronoun disambiguation benchmark resembles WSC, yet sig- + +nificantly larger in size. According to (Trichelair et al., 2018), less challenging due to inherent biases. Here the proposed approach outperforms the unsupervised baseline CSS(BERT) by a margin of $(+9.9\%)$ , while observing a slight drop of $(-0.6\%)$ compared to CSS(RoBERTa). + +WinoGrande (W.G.) (Sakaguchi et al., 2019): the largest dataset for Winograd co-reference resolution. Our method outperforms the unsupervised baseline CSS(BERT) by $(+9.9\%)$ and CSS(RoBERTa) by $(+3.1\%)$ , even surpassing supervised RoBERTa(DPR-ft) by $(+1.4\%)$ . + +KnowRef (Emami et al., 2019): a co-reference corpus addressing gender and number bias. The proposed approach outperforms the unsupervised baseline CSS(BERT) by a margin of $(+4.4\%)$ and CSS (RoBERTa) by $(+1.9\%)$ . + +WinoGender (Rudinger et al., 2018): a gender-balanced co-reference corpus. The proposed approach outperforms the unsupervised baseline CSS(BERT) by a margin of $(+23.8\%)$ and CSS(RoBERTa) by $(+17.1\%)$ . + +# 3.2.1 Attention-level Analysis + +Inspired by (Vig and Belinkov, 2019), we assess the impact of the attention mechanism by analyzing the attention tensor which is obtained by querying the attention of the MASK token w.r.t. right/wrong candidate over all layers and heads. The tensor decomposes into elements $a_{i,j}^{h,l}(x)$ , gauging the influence of token $i$ w.r.t. token $j$ in layer $l$ of attention head $h$ . Aggregating the attention of MASK token $i$ for the tokens $c_j$ for the right and wrong candidates by summation, slices the tensor into matrices $A_r$ , $A_w \in \mathbb{R}^{H \times L}$ generating attention maps. Here $A_r$ , $A_w$ corresponds to the attention maps w.r.t. the right answer and the wrong answer, respectively. Following (Brunner et al., 2020), we also investigated the maps of the last $k$ -layers, denoted as $A_r^{[k]}$ and $A_w^{[k]}$ . We then computed the attention difference and entropy $H(. )$ difference on the attention maps of all DPR (Rahman and Ng, 2012) samples, and presented the statistics in Tab. 2. + +We observed a significant concentration of attention for the right candidates for the proposed approach compared to the wrong ones. This pattern is even more pronounced for the last 3 layers. Specifically, we observed the manifestation of an average entropy of 3.41 (right) nats vs. 2.1 nats (wrong) on the last 3 layers, giving rise to the emergence of the desired pattern of more concerted attention + +
RoBaCSSOurs
|H(Ar) - H(Aw)|0.0240.0970.078
|H(Ar[3]) - H(Aw[3])|0.0050.7721.328
|A_r - A_w|0.0090.0100.061
|A_r[3] - A_w[3]|0.0200.0340.306
+ +Table 2: Attention analysis of different models on DPR, and $k = 3$ . Top: entropies, Bottom: mean statistics. + +
MethodWSCW.G.
RoBERTa (Liu et al., 2019)67.7653.75
CSS (RoBERTa)79.8557.77
Our Method (CM)60.8152.88
Our Method (CA)80.9557.14
Our Method (CA+CM)84.1060.80
+ +Table 3: Ablation study, performance in accuracy (%) + +on the right candidate. See supplementary material for more detailed results. + +# 3.2.2 Ablation Study + +To assess the contribution of each component, we evaluated the performance of each module separately, gradually adding components to the loss. See Tab. 3 for the ablation study on WSC and Wino-Grande. Pre-trained RoBERTa (large) constitutes the baseline. MEx denotes the mutual-exclusive loss on the sentence log-likelihoods (Klein and Nabi, 2020), CA denotes the contrastive attention defined in Sec. 2.1.1, CM denotes the contrastive-margin defined in Sec. 2.1.2. While the CA term alone already suggests strong performance, this does not apply to the CM term. Given the regulatory nature of the CM term, optimizing it in isolation yields a model with inferior accuracy. + +# 4 Conclusion + +In this paper, we introduce an attention-level self-supervised learning method for commonsense reasoning. Specifically, we propose a method that enforces a contrastive loss on the attentions produced by transformer LM while pushing the likelihood of the candidates towards the extremities. The experimental analysis demonstrates that our proposed system outperforms the previous unsupervised state-of-the-art in multiple datasets. + +# References + +Gino Brunner, Yang Liu, Damian Pascual, Oliver Richter, Massimiliano Ciaramita, and Roger Wattenhofer. 2020. On identifiability in transformers. In International Conference on Learning Representations. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805. +Yanai Elazar, Hongming Zhang, Yoav Goldberg, and Dan Roth. 2021. Back to square one: Bias detection, training and commonsense disentanglement in the winograd schema. +Ali Emami, Noelia De La Cruz, Adam Trischler, Kaheer 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 Processing, pages 1949-1958, Brussels, Belgium. Association for Computational Linguistics. +Ali Emami, Paul Trichelair, Adam Trischler, Kaeher Suleman, Hannes Schulz, and Jackie Chi Kit Cheung. 2019. The knowref coreference corpus: Removing gender and number cues for difficult pronominal anaphora resolution. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3952-3961. +Pengcheng He, Xiaodong Liu, Weizhu Chen, and Jianfeng Gao. 2019. A hybrid neural network model for commonsense reasoning. In Proceedings of the First Workshop on Commonsense Inference in Natural Language Processing, pages 13-21, Hong Kong, China. Association for Computational Linguistics. +Pride Kavumba, Naoya Inoue, Benjamin Heinzerling, Keshav Singh, Paul Reisert, and Kentaro Inui. 2019. In Proceedings of the First Workshop on Common-sense Inference in Natural Language Processing, pages 33-42, Hong Kong, China. Association for Computational Linguistics. [link]. +Mayank Kejriwal and Ke Shen. 2020. Do fine-tuned commonsense language models really generalize? +Tassilo Klein and Moin Nabi. 2019. Attention is (not) all you need for commonsense reasoning. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4831-4836, Florence, Italy. Association for Computational Linguistics. +Tassilo Klein and Moin Nabi. 2020. Contrastive self-supervised learning for commonsense reasoning. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7517-7523, Online. Association for Computational Linguistics. + +Tassilo Klein and Moin Nabi. 2021. Towards zero-shot commonsense reasoning with self-supervised refinement of language models. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing (EMNLP). +Vid Kocijan, Ana-Maria Cretu, Oana-Maria Camburu, Yordan Yordanov, Phil Blunsom, and Thomas Lukasiewicz. 2019a. Wikicrem: A large unsupervised corpus for coreference resolution. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing (EMNLP), Hong Kong. +Vid Kocijan, Ana-Maria Cretu, Oana-Maria Camburu, Yordan Yordanov, and Thomas Lukasiewicz. 2019b. A surprisingly robust trick for winograd schema challenge. In The 57th Annual Meeting of the Association for Computational Linguistics (ACL), Florence, Italy. +Vid Kocijan, Thomas Lukasiewicz, Ernest Davis, Gary Marcus, and Leora Morgenstern. 2020. A review of winograd schema challenge datasets and approaches. arXiv preprint arXiv:2004.13831. +Kenton Lee, Luheng He, Mike Lewis, and Luke Zettle-moyer. 2017. End-to-end neural coreference resolution. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 188-197, Copenhagen, Denmark. Association for Computational Linguistics. +Hector Levesque, Ernest Davis, and Leora Morgenstern. 2012. The winograd schema challenge. In Thirteenth International Conference on the Principles of Knowledge Representation and Reasoning. +Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019. Roberta: A robustly optimized bert pretraining approach. +Gary Marcus. 2020. The next decade in ai: four steps towards robust artificial intelligence. arXiv preprint arXiv:2002.06177. +Juri Opitz and Anette Frank. 2018. Addressing the winograd schema challenge as a sequence ranking task. In Proceedings of the First International Workshop on Language Cognition and Computational Models, pages 41-52. +Haoruo Peng, Daniel Khashabi, and Dan Roth. 2015. Solving hard coreference problems. In Proceedings of the 2015 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 809-819, Denver, Colorado. Association for Computational Linguistics. +Yanru Qu, Dinghan Shen, Yelong Shen, Sandra Sajeev, Jiawei Han, and Weizhu Chen. 2020. Coda: Contrast-enhanced and diversity-promoting data augmentation for natural language understanding. arXiv preprint arXiv:2010.08670. + +Altaf Rahman and Vincent Ng. 2012. Resolving complex cases of definite pronouns: The Winograd schema challenge. In Proceedings of the 2012 Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning, pages 777-789, Jeju Island, Korea. Association for Computational Linguistics. +Yu-Ping Ruan, Xiaodan Zhu, Zhen-Hua Ling, Zhan Shi, Quan Liu, and Si Wei. 2019. Exploring unsupervised pretraining and sentence structure modelling for winograd schema challenge. arXiv preprint arXiv:1904.09705. +Rachel Rudinger, Jason Naradowsky, Brian Leonard, and Benjamin Van Durme. 2018. Gender bias in coreference resolution. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), pages 8-14, New Orleans, Louisiana. Association for Computational Linguistics. +Walid S. Saba. 2018. A simple machine learning method for commonsense reasoning? A short commentary on trinh & le (2018). CoRR, abs/1810.00521. +Keisuke Sakaguchi, Ronan Le Bras, Chandra Bhagavatula, and Yejin Choi. 2019. WINOGRANDE: an adversarial winograd schema challenge at scale. CoRR, abs/1907.10641. +Alexandre Tamborrino, Nicola Pellicano, Baptiste Pannier, Pascal Voitot, and Louise Naudin. 2020. Pretraining is (almost) all you need: An application to commonsense reasoning. arXiv preprint arXiv:2004.14074. +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. CoRR, abs/1811.01778. +Paul Trichelair, Ali Emami, Adam Trischler, Kaheer Suleman, and Jackie Chi Kit Cheung. 2019. How reasonable are common-sense reasoning tasks: A case-study on the Winograd schema challenge and SWAG. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 3380-3385, Hong Kong, China. Association for Computational Linguistics. +Trieu H. Trinh and Quoc V. Le. 2018. A simple method for commonsense reasoning. CoRR, abs/1806.02847. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advances in Neural Information Processing Systems, pages 5998-6008. + +Jesse Vig and Yonatan Belinkov. 2019. Analyzing the structure of attention in a transformer language model. In Proceedings of the 2019 ACL Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pages 63-76, Florence, Italy. Association for Computational Linguistics. +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumont, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, R'emi Louf, Morgan Funtowicz, and Jamie Brew. 2019. Huggingface's transformers: State-of-the-art natural language processing. ArXiv, abs/1910.03771. +Zhi-Xiu Ye, Qian Chen, Wen Wang, and Zhen-Hua Ling. 2019. Align, mask and select: A simple method for incorporating commonsense knowledge into language representation models. arXiv preprint arXiv:1908.06725. \ No newline at end of file diff --git a/attentionbasedcontrastivelearningforwinogradschemas/images.zip b/attentionbasedcontrastivelearningforwinogradschemas/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d22dbb493704a5a401875d9db1ab3264fa73d713 --- /dev/null +++ b/attentionbasedcontrastivelearningforwinogradschemas/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b1202ec949773737384a1ba0712fcbbe9becf9faf26cc03938a1276997bebd7 +size 285700 diff --git a/attentionbasedcontrastivelearningforwinogradschemas/layout.json b/attentionbasedcontrastivelearningforwinogradschemas/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..710a9dcdbb2e6b98e54b0e14579ef55fc01695a9 --- /dev/null +++ b/attentionbasedcontrastivelearningforwinogradschemas/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:630ac3f600f0b5b70f0707d9d0137c4928f138ba131f6bae5c83175734262a33 +size 225997 diff --git a/attentionweightsintransformernmtfailaligningwordsbetweensequencesbutlargelyexplainmodelpredictions/50d77ae8-84e3-41c8-a704-6212947c7ac8_content_list.json b/attentionweightsintransformernmtfailaligningwordsbetweensequencesbutlargelyexplainmodelpredictions/50d77ae8-84e3-41c8-a704-6212947c7ac8_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..03e2f001bdd18d6bb26e5a0f97de6f5917166334 --- /dev/null +++ b/attentionweightsintransformernmtfailaligningwordsbetweensequencesbutlargelyexplainmodelpredictions/50d77ae8-84e3-41c8-a704-6212947c7ac8_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:300c30b03390069abc7c68217abac97dfc450e149e741fe19030b9bb51935e9e +size 68703 diff --git a/attentionweightsintransformernmtfailaligningwordsbetweensequencesbutlargelyexplainmodelpredictions/50d77ae8-84e3-41c8-a704-6212947c7ac8_model.json b/attentionweightsintransformernmtfailaligningwordsbetweensequencesbutlargelyexplainmodelpredictions/50d77ae8-84e3-41c8-a704-6212947c7ac8_model.json new file mode 100644 index 0000000000000000000000000000000000000000..72e07211ed0f22be3d69f2514e60e7d072b87662 --- /dev/null +++ b/attentionweightsintransformernmtfailaligningwordsbetweensequencesbutlargelyexplainmodelpredictions/50d77ae8-84e3-41c8-a704-6212947c7ac8_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bcb885a101858f0464daa8e74d807bdfffeaa538a6419178e30477b69489b4bb +size 83762 diff --git a/attentionweightsintransformernmtfailaligningwordsbetweensequencesbutlargelyexplainmodelpredictions/50d77ae8-84e3-41c8-a704-6212947c7ac8_origin.pdf b/attentionweightsintransformernmtfailaligningwordsbetweensequencesbutlargelyexplainmodelpredictions/50d77ae8-84e3-41c8-a704-6212947c7ac8_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d3f5f3fe9636183e0329d15d14b55a7723e946d1 --- /dev/null +++ b/attentionweightsintransformernmtfailaligningwordsbetweensequencesbutlargelyexplainmodelpredictions/50d77ae8-84e3-41c8-a704-6212947c7ac8_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f3a1978c29c9c6078754f92eb8717b885bdaae2cc1c79817511b69bc3c8eb925 +size 1223740 diff --git a/attentionweightsintransformernmtfailaligningwordsbetweensequencesbutlargelyexplainmodelpredictions/full.md b/attentionweightsintransformernmtfailaligningwordsbetweensequencesbutlargelyexplainmodelpredictions/full.md new file mode 100644 index 0000000000000000000000000000000000000000..c51e9b116e187d1e095287746cf90ff5fca6b3c2 --- /dev/null +++ b/attentionweightsintransformernmtfailaligningwordsbetweensequencesbutlargelyexplainmodelpredictions/full.md @@ -0,0 +1,328 @@ +# Attention Weights in Transformer NMT Fail Aligning Words Between Sequences but Largely Explain Model Predictions + +Javier Ferrando and Marta R. Costa-jussa +TALP Research Center, Universitat Politècnica de Catalunya, Barcelona +{javier.ferrando.monsonis, marta.ruiz}@upc.edu + +# Abstract + +This work proposes an extensive analysis of the Transformer architecture in the Neural Machine Translation (NMT) setting. Focusing on the encoder-decoder attention mechanism, we prove that attention weights systematically make alignment errors by relying mainly on uninformative tokens from the source sequence. However, we observe that NMT models assign attention to these tokens to regulate the contribution in the prediction of the two contexts, the source and the prefix of the target sequence. We provide evidence about the influence of wrong alignments on the model behavior, demonstrating that the encoder-decoder attention mechanism is well suited as an interpretability method for NMT. Finally, based on our analysis, we propose methods that largely reduce the word alignment error rate compared to standard induced alignments from attention weights. + +# 1 Introduction + +Recently, Transformer-based models (Vaswani et al., 2017) have allowed huge improvements in performance across multiple NLP tasks. The inclusion of this architecture has led the field of NLP to investigate the inner workings of this architecture in several tasks. One of its core components, the attention mechanism, which provides a distribution of scores over the input tokens, has been often presented as showing the relative importance of the inputs. Some works have criticized the use of attention weights as model explanations (Jain and Wallace, 2019; Serrano and Smith, 2019; Pruthi et al., 2020), demonstrating that attention weights distributions can be modified without affecting the final prediction. However, these studies have mainly analyzed encoder-only or decoder-only architectures like BERT (Devlin et al., 2019) or GPT-2 (Radford et al., 2019), which are based on self-attention mechanisms. + +Nonetheless, NMT models use the encoder-decoder Transformer architecture, which adds the encoder-decoder attention mechanism, in charge of distributing the information flow from the encoder representations of the source input tokens into the decoder. (Voita et al., 2019) analyze the effect of pruning different attention heads in a Transformer NMT model and conclude that the encoder-decoder attention mechanism is the most critical one. (Raganato et al., 2020) show that encoder self-attention weights can be interchanged by predefined non-learnable patterns without hindering the translation performance. These results provide evidence about the relevance of the encoder-decoder attention mechanism on NMT, which we believe needs further investigation. In this work we analyze the encoder-decoder attention weights and shed light on their impact on the decoder representations and final predictions, showing how alignment errors can also give information about the model's decision-making process. + +Research in NMT interpretability has mainly focused on understanding source words importance when predicting a target word. The word alignment task (Och and Ney, 2003) has served to compare explanation methods against human-annotated source-target word alignments. Encoder-decoder attention weights have been used to provide source-target word alignments (Zenkel et al., 2019; Garg et al., 2019), but its low performance has made researchers sceptical about its use as an interpretable method (Li et al., 2019). An important issue when relying on word alignment task is that it ignores the words that are predicted based on the target prefix, i.e what the model has previously translated. An extreme example of the impact of the target prefix on the prediction occurs during 'hallucinations' (Lee et al., 2019; Berard et al., 2019; Voita et al., 2020; Raunak et al., 2021). Although some studies have analyzed the relative contribution of the target prefix context in a model's prediction (Li et al., + +2019; Voita et al., 2020), the way NMT models decide in which proportion to use both sequences remains unexplored. + +In Section 3, we propose a simple method to measure the relative contribution of the source and the target prefix by perturbing input embeddings, we also extend the gradient-based method towards the target prefix token embeddings to obtain saliency scores from the prefix words. Both methods serve us in Section 5 to understand the attention weights generated in the encoder-decoder modules and their relationship with the model predictions. Lastly, in Section 6, we propose two methods to improve the alignment error extracted from the model in accordance with our results analysis. + +# 2 Background + +In this section, we briefly introduce the existing methodologies that we use in our work: the Transformer and the methods used to induce alignment. + +# 2.1 Transformers in NMT + +Given a source sequence $\mathbf{x} = \{x_{1},\dots ,x_{|\mathbf{x}|}\}^{1}$ and a target sequence $\mathbf{y} = \{y_1,\dots ,y_{|\mathbf{y}|}\}$ an NMT system models the probability: + +$$ +P (\mathbf {y} | \mathbf {x}) = \prod_ {t = 1} ^ {| \mathbf {y} |} P (y _ {t} | \mathbf {y} _ {< t}, \mathbf {x}) +$$ + +where $\mathbf{y}_{<\mathbf{t}} = \{y_0, \dots, y_{|t-1|}\}$ represent the prefix of $y_t$ , and $x_{|\mathbf{x}|} = y_0 = y_{|\mathbf{y}|} = \langle /s \rangle$ , which represents a special token used to denote the beginning and end of sentence. The Transformer architecture is composed by a stack of encoder layers and decoder layers. The encoder generates a contextualized sequence of representations $\mathbf{e} = \{e_1, \dots, e_{|\mathbf{x}|}\}$ of the source sentence while the decoder, at each time step $t$ , uses both the encoder output and the token representation $s_t^{l-1}$ of the previous layer $l$ to compute the final probability distribution over the target vocabulary. + +In terms of the model's input and output, we consider $\pmb{x}_j$ and $\pmb{y}_i$ representing the embeddings of each token from the source and target prefix respectively. So, we can write the conditional probability modeled by the network at each time step as: + +$$ +P \left(y _ {t} \mid \left\{\boldsymbol {y} _ {0}, \dots , \boldsymbol {y} _ {t - 1} \right\}, \left\{\boldsymbol {x} _ {1}, \dots , \boldsymbol {x} _ {| \mathbf {x} |} \right\}\right) +$$ + +The encoder and decoder representations are merged in the multi-head encoder-decoder attention mechanism (Figure 1). For each head, the encoder embeddings are projected to keys and values. Formally, $\mathbf{V}^h\in \mathbb{R}^{|\mathbf{x}|\times d_v}$ is the value matrix and $\mathbf{K}^h\in \mathbb{R}^{|\mathbf{x}|\times d_k}$ is the key matrix, where $d_{v}$ and $d_{k}$ refers to the dimension of the values and keys vectors. The decoder representation of the output token $\pmb{s}_t^{l - 1}$ is projected to a query vector of dimension $d_q$ $\pmb {q}_t^h\in \mathbb{R}^{d_q}$ . The output of each attention head is obtained by: + +$$ +\boldsymbol {z} _ {t} ^ {h} = \sum_ {j = 1} ^ {| \mathbf {x} |} \boldsymbol {\alpha} _ {t, j} ^ {h} \boldsymbol {v} _ {j} ^ {h} \tag {1} +$$ + +Where: + +$$ +\boldsymbol {\alpha} _ {t} ^ {h} = \operatorname {s o f t m a x} \left(\frac {\boldsymbol {q} _ {t} ^ {h} \mathbf {K} ^ {\top}}{\sqrt {d _ {k}}}\right) +$$ + +$\alpha_{t}^{h}$ refers to the vector of attention scores at decoding step $t$ , which is often presented as a matrix (attention matrix) made of a stack of $\alpha_{t}^{h}$ , for every time step. This process is repeated simultaneously in multiple heads. Each head computes a $z_{t}^{h}$ representation, and are concatenated before projecting by $\mathbf{W}_{\mathbf{h}}^{\mathbf{O}}$ to obtain $attn_{t}$ + +![](images/cc4854d6768fc76236f2b5ff40d320105e2be69020abeb7f798e224292b77cae.jpg) +Figure 1: Decoder Layer with the Encoder-Decoder Attention module expanded. + +# 2.2 Attention Weights to Induce Word Alignment + +Attention weights $\alpha_{t,j}^{h}$ from the encoder-decoder attention modules represent the similarity between $h_j$ and $s_t^{l - 1}$ and have been commonly presented as a baseline to extract word alignments from words $x_{j}$ and $y_{t}$ . Attention vectors $\alpha_{t}^{h}$ represent a probability distributions over all source tokens $\mathbf{x}$ . A + +classical approach to obtain final alignments has been to compute the average over all heads (Garg et al., 2019) in each layer and selecting the source word that yields the maximum score: + +$$ +\mathbf {A} _ {t, j} = \left\{ \begin{array}{l l} 1 & j = \arg \max _ {j ^ {\prime}} \frac {1}{H} \sum_ {h = 1} ^ {H} \alpha_ {t, j ^ {\prime}} ^ {h} \\ 0 & \text {e l s e} \end{array} \right. +$$ + +(Zenkel et al., 2019; Li et al., 2019; Garg et al., 2019) showed alignments induced from attention weights are noisy, although they realize that some layers seem to generate better $(x_{j},y_{t})$ alignments, especially the last layers of the Transformer. + +An issue regarding the use of this method to interpret the model predictions is that the ground truth target word $y_{t}$ may differ from the actual model prediction $y_{t}^{\prime}$ . In these cases, $(x_{j},y_{t}^{\prime})$ alignments can not be compared with $(x_{j},y_{t})$ gold alignments, showing limitations about its use as an interpretability method. + +Alignments from the decoder input. A technique that solves the aforementioned issue consists of inducing alignments by comparing $\mathbf{x}$ with the input of the decoder $y_{i}$ (Kobayashi et al., 2020; Chen et al., 2020) (in force decoding setting $y_{i} = y_{t - 1}$ ). So, since the ground truth target sequence is used as input in the decoder, alignments $\mathbf{A}_{i,j}$ in this setting represent the same information as gold alignments. Attention modules from the initial layers tend to extract better alignments from the input of the decoder, while alignments from the decoder output are better extracted from the final layers. Although results show that decoder input provides lower alignment error rates, it shows how similar to $e_j$ the model is able to generate representations of the decoder input, losing explanation power about the influence of source tokens into the model output. Therefore, we use $\mathbf{A}_{t,j}$ in our analysis in Section 5. An extension of the use of attention weights to induce alignments is presented in (Kobayashi et al., 2020), where it is also considered the norm of the vectors projected by the linear layers inside the attention modules. + +# 2.3 Other Methods + +Model-agnostic methods. Several methods for inducing alignments have been proposed that work regardless of the chosen architecture. Gradient-based methods such as gradient $\times$ input (Ding et al., 2019) or Integrated Gradients (He et al., 2019) have been used to obtain saliency values from the source words as a measure of source word importance. + +Erasure methods have also been applied to NMT (Li et al., 2019), which consist of techniques to measure the relevance of each input token by evaluating the changes in the output probability of the model after removing it from the input of the network (Zintgraf et al., 2017) or eliminating the connection via dropout (Srivastava et al., 2014). + +Methods to improve alignments. Other works propose methods to improve word alignment extracted from the Transformer. (Li et al., 2019) use an explicit alignment model (Liu et al., 2005; Taskar et al., 2005) consisting of optimizing a parameter matrix to reduce the alignment distance with respect to a reference. (Zenkel et al., 2019) adds an alignment module attending encoder representations. (Garg et al., 2019) propose to supervise an attention head with GIZA++ (Brown et al., 1993) alignments. Although they improve alignment performance, these methods introduce external trainable parameters or alignments references, which makes these techniques lose interest regarding interpretability of the model. + +# 3 Proposed Methods for Analysis + +In this section, we introduce two simple methods for measuring the contributions of each source sequence to a model prediction and extend the gradient-based analysis to understand dependency relationships between target prefix words. + +![](images/b59b7f455ff699227bf6456064d3551863c235d981ec08bf9d968d96d175551b.jpg) +Figure 2: Contribution from the source input sequence to the final prediction by perturbing source token embeddings. + +# 3.1 Contributions by Input Perturbation + +We propose separately perturbing source and prefix embeddings (Smilkov et al., 2017) to get the marginal contributions of each sequence to the final prediction. For each embedding we compute + +$N$ random samples around their neighborhood: + +$$ +\hat {\pmb {x}} _ {j} = \pmb {x} _ {j} + \mathcal {N} (0, \sigma_ {\pmb {x} _ {j}} ^ {2}) +$$ + +Since input embeddings differ in their length, we adapt the noise level to each token embedding as a proportion $(\lambda)$ of its euclidean norm²: + +$$ +\sigma_ {\boldsymbol {x} _ {j}} = \left\| \boldsymbol {x} _ {j} \right\| \cdot \lambda +$$ + +By adding noise to each embedding in the sequence we get the perturbed sequence of embeddings $\hat{\mathbf{x}}$ . So, for each prediction $y_{t}$ we can compute the source contribution $C_S(y_t)$ by measuring how large is the variation of the output probability when feeding the network with $N$ noisy sequence samples. To get the marginal effect of one sequence, we keep the other with the original embeddings. + +![](images/4071196c4c361c5b5dd3c78eb06999573418ed68925705099bf03bad9fc7905b.jpg) +Figure 3: Source $C_S(y_t)$ and target prefix $C_T(y_t)$ contributions for reference model output. + +$$ +\begin{array}{l} C _ {S} (y _ {t}) = \triangle P (y _ {t} | \mathbf {y}, \hat {\mathbf {x}} ^ {1: N}) \\ = \frac {1}{N} \sum_ {n = 1} ^ {N} (P (y _ {t} | {\bf y} _ {< t}, \hat {{\bf x}} ^ {n}) - \bar {P} (y _ {t} | {\bf y} _ {< t}, \hat {{\bf x}} ^ {1: N})) ^ {2} \\ \end{array} +$$ + +where $\bar{P}$ refers to the mean of the observed output probabilities and $\hat{\mathbf{x}}^n$ to $n$ -th source sequence with added noise. Similarly, we get the target prefix contribution $C_T(y_t)$ perturbing prefix embeddings: + +$$ +\hat {\boldsymbol {y}} _ {i} = \boldsymbol {y} _ {i} + \mathcal {N} (0, \sigma_ {\boldsymbol {y} _ {i}} ^ {2}) +$$ + +and then, computing the variance of the output probability across $N$ sequences of noisy prefix embeddings, keeping untouched the original source token embeddings: + +$$ +\begin{array}{l} C _ {T} (y _ {t}) = \triangle P (y _ {t} | \hat {\mathbf {y}} _ {< t} ^ {1: N}, \mathbf {x}) \\ = \frac {1}{N} \sum_ {n = 1} ^ {N} \left(P \left(y _ {t} \mid \hat {\mathbf {y}} _ {< t} ^ {n}, \mathbf {x}\right) - \bar {P} \left(y _ {t} \mid \hat {\mathbf {y}} _ {< t} ^ {1: N}, \mathbf {x}\right)\right) ^ {2} \\ \end{array} +$$ + +# 3.2 Saliency of Target Sequences Words + +Any model $f(\pmb{x})$ can be linearly approximated locally by its first-order Taylor expansion at a point $\hat{\pmb{x}}$ : + +$$ +f (\hat {\boldsymbol {x}}) \approx f (\boldsymbol {x}) + \nabla_ {\boldsymbol {x}} f (\boldsymbol {x}) \cdot (\hat {\boldsymbol {x}} - \boldsymbol {x}) +$$ + +Rearranging terms we get: + +$$ +f (\boldsymbol {x}) \approx f (\hat {\boldsymbol {x}}) + \nabla_ {\boldsymbol {x}} f (\boldsymbol {x}) \cdot (\boldsymbol {x} - \hat {\boldsymbol {x}}) +$$ + +Making $\hat{\pmb{x}}$ a zero vector, we arrive to: + +$$ +f (\boldsymbol {x}) \approx \nabla_ {\boldsymbol {x}} f (\boldsymbol {x}) \cdot \boldsymbol {x} +$$ + +With this approximation, $\nabla_{\pmb{x}}f(\pmb{x})$ can be interpreted as coefficients that measure the impact of $\pmb{x}$ in the output. In NLP (Li et al., 2016) propose the use of word embeddings as input features from which to calculate saliency scores. In the NMT setting, current methods (Ding et al., 2019) extract saliency scores of the input source tokens by computing the gradient with respect to source embeddings $\pmb{x}_i$ . + +Nevertheless, the Transformer model deals with two different sequences of inputs (x and $\mathbf{y}_{<\mathbf{t}}$ ), $f(\mathbf{x}) = P(y_t|\mathbf{y}_{<\mathbf{t}},\mathbf{x})$ . So, analyzing only the saliency of the source sequence embeddings might lead to an incomplete analysis. To have a full understanding of the influences of each input word on the model prediction we propose to extend the SmoothGrad method (Smilkov et al., 2017) to also consider the gradients w.r.t the target prefix embeddings. We compute the target prefix saliencies by averaging the gradients over $N$ noisy examples, as detailed in Section 3.1: + +$$ +\psi (y _ {i}, y _ {t}) = \frac {1}{N} \sum_ {n = 1} ^ {N} \| \nabla_ {\pmb {y} _ {i}} P (y _ {t} | \hat {\mathbf {y}} _ {< t} ^ {n}, \mathbf {x}) \| +$$ + +# 4 Experimental Setup + +As follows, we detail the model and datasets used in our experiments. We decide to choose this experimental framework to compare and further explain previous works (Ding et al., 2019; Zenkel et al., 2019; Kobayashi et al., 2020). We follow the same procedure as these past works, we train the Transformer model for the German-English translation task. Specifically, we use Europarl v7 corpus3 which consists on 1.9M sentence pairs. We use the + +![](images/bff53816c4f5dcc32327825d3d1473922daa2daabb7bdd00fc05bab1263252c2.jpg) +Figure 4: From left to right: gold alignments, hard alignments $\mathbf{A}_{t,j}$ and soft alignments given by the average attention weights over all heads in Layer 5. + +gold alignment dataset $^{4}$ (Vilar et al., 2006) which contains 508 sentence pairs. The Transformer used in this work $^{5}$ is implemented in fairseq (Ott et al., 2019) and contains 6 layers with 4 attention heads each. We apply Byte Pair Encoding (BPE) (Sennrich et al., 2016) with 10k merging operations. As (Ding et al., 2019) and (Kobayashi et al., 2020) we use the last 1000 samples of the training data as the development data. + +# 5 Analysis + +In this section, and for the sake of clarity, we convey our analysis on a single example while quantifying how our findings generalize to the entire test set. We use the following source example: + +(1) Herr Kommissar, liebe kolleginnen und kol- legen!Zunachst herzlichen Dank,Herr Bur-tone,fur ihren Bericht. + +for which the model prediction is: + +(2) Mr, ladies and gentlemen, first would like to start by thanking Mr Burtone for his report. + +and with its reference: + +(3) Commissioner, ladies and gentlemen, I should like to begin by thanking Mr Burtone for his report. + +# 5.1 Categorization of Word Alignment Errors + +Figure 4 (Middle) shows $(x_{j},y_{t})$ alignments $\mathbf{A}_{t,j}$ extracted from the best layer (§2.2) for the example. Figure 4 (Right) depicts the average attention weight matrix across all heads in the best layer (soft alignments), from which some information can be recovered. When comparing hard with gold alignments (Figure 4 (Left)), some errors are clearly observed, with a large number of target tokens aligning to finalizing tokens. Hereinafter, finalizing tokens correspond to the special token used to indicate end of sentence $(\langle /s\rangle)$ and the final punctuation mark $(\_ )$ , while the rest of tokens will be referred to as standard tokens. + +We categorize alignment errors occurring in weight attention matrices as: + +1. Functional/content words aligning to finalizing tokens. +2. Words with non-direct translation aligning to finalizing tokens. +3. Last tokens of a split word (divided into multiple subwords) aligning to finalizing tokens. +4. Functional words aligning to the next content word token. +5. Words aligning to other standard tokens. + +Our analysis focuses on finding explanations to the errors inside categories 1-3, which account for $60.6\%$ and $38.7\%$ of the total errors in the best layer in the $(x_{j},y_{t})$ and $(x_{j},y_{i})$ alignment settings respectively. + +# 5.2 Encoder-Decoder Attention Module decides Source-Target Contributions + +From source-target contributions of the reference model output (Figure 3), we observe that the target prefix largely contributes when predicting gentlemen, and it also receives large saliency scores (Figure 5) from ladies. This matches the human intuition about how these words are naturally generated from the context. + +![](images/b9b8fd2c440db22a248b82deeff1f64e37249427f2e416f9d97b833cb7bf5995.jpg) +Figure 5: Saliency scores $\psi (\mathbf{y}_{< t},y_{t})$ for the reference model output (from top to bottom): _gentlemen, by, t and for. + +Similarly, a non-common word such as Burtone, which gets tokenized into _bur, t and one gets source-target contributions that also match human intuition. The first token _bur is predicted by relying almost only on the source sequence. However, following tokens, although they heavily rely on the source, get information about the previous tokens. In this case, _bur gives a high saliency value when predicting t. We can also observe that the word by is mainly predicted using target prefix, and gets the highest saliency score from begin. Another observation is that thanking highly influences the prediction of for. These examples have in common both large dependency on the target prefix and large attention values towards finalizing tokens. + +Model behaviour. From the decoder layer depicted in Figure 1 we can observe that the output of the encoder-decoder attention module is added to the target prefix representation by means of the residual connection $\mathbf{att} \mathbf{n}_t + \mathbf{s}_t^{l-1}$ . Therefore, the + +![](images/4135eb9f0c7d27b7eb9d58fd894d7b6b96d6582c972419a55dc5735304ca66e5.jpg) +Figure 6: $\left\| v_j^h\right\|$ computed in every attention head. $\langle /s\rangle$ has almost zero norm for every head. + +amount of information arriving from the input sequence is determined by the weighted sum of the values. If we analyze the norms of the values vectors (Figure 6) we can see that the source finalizing tokens, especially $\langle /s\rangle$ , get almost zero norms. This can be interpreted as when assigning high attention weights to these tokens, the Residual + Normalization layer gets almost no information from the source. From the results obtained over 5 random seeds (Figure 7) we can state that the network picks a common token, i.e. $\langle /s\rangle$ or _. and projects it to a zero vector through $\mathbf{W_h^V}$ . These results support the (Clark et al., 2019) hypothesis about the selection of a token as a "no-op" in the attention mechanism ([SEP] token in BERT model). + +![](images/d74198bca09a9546c95d08a5e3fe3d13b4e390974a0c392cef652939ecd1b2a4.jpg) + +![](images/1e0b73123732327aa4c7921a62a139eeec7a022e4cd802863ff242cb920793d2.jpg) +Figure 7: $\left\| v_{j}^{h}\right\|$ for $-$ . (Top) and $\langle \langle s\rangle$ (Bottom) for the best alignment head over 5 random seeds. + +In this way, by putting attention to it, decides how much amount of information flows from the source and target sequences. Note that over the five trained models, the selection of the token that ends up squished varies, for model number 5, the network selects the final punctuation mark as the token used to cancel source contribution. $\mathbf{att}n_{t}$ vector norms (Figure 8) correlate with our source + +target contribution method results depicted in Figure 3. Representations $\mathbf{att} \mathbf{n}_t$ for tokens such as and, gentlemen and _, have low norms due to the effect of large attention weights towards finalizing tokens. + +![](images/6f6c80e8bd075aa386fea968c71eeb87c7bcd9c4a5f05cb09d79d6dfee297ffd.jpg) +Figure 8: Output representation of the encoder-decoder attention module norms $\| \pmb{a}\pmb{t}\pmb{n}_t\|$ + +Interestingly, the finalizing tokens representations from the last encoder layer show clear differences with respect to the other tokens' representations. Measuring the cosine similarity between every encoder output representation (Figures 9 and 10) we observe how the finalizing tokens similarity with every other encoder representation is consistently negative. + +![](images/63ff654339d28b6b94a87830918c00991fd8c7a07a8e61cc95fe930d3838a587.jpg) +Figure 9: Cosine similarity between encoder representations. Positive similarity (blue), negative (red). + +We conjecture that these tokens encode minimum information about the source sentence, and the decoder finds them useful in the encoder-decoder attention module to skip source attention. We leave as future work a deeper investigation of this phenomenon. + +# 5.3 Word Alignment Errors associated to Part-of-Speech + +If we analyze the percentage of tokens across the whole dataset that are aligned towards finalizing + +![](images/7bc7ec1cc19e55379bdc0996ec0a69536cccb6b56152fe93026482a21ad15516.jpg) +Figure 10: Cosine similarity between encoder representations by type of token across the test set. + +tokens, i.e receiving attention scores greater than 0.5, we observe (Table 1) that words with a high degree of dependency on the context such as adpositions (ADP), particles (PART) and conjunctions (SCONJ, CCONJ) are likely to get aligned to finalizing tokens. On the other hand, numerical values (NUM), determiners (DET) and verbs (VERB, AUX), which are more independent of the context tend to align to source tokens. We see that functional words are more prone to get aligned to finalizing tokens. + +
POS-tag%
ADP49.1
PART33.9
SCONJ30.7
NOUN24
CCONJ23.8
ADV17.3
PROPN16
PRON14
ADJ13.1
VERB12.4
DET9.4
NUM6.8
AUX4.5
+ +Table 1: Words (in %) aligning to finalizing tokens. + +These results agree with our previous observations. Words with a high contribution from the target prefix get attention weights assigned to source finalizing tokens. These results demonstrate a correlation between the attention towards finalizing tokens and the lack of contribution from the source to the model prediction. + +# 6 Methods to Improve Alignment + +As shown in the previous analysis, alignments from attention weight matrices reveal errors mainly due to the existence of the skip source attention operation. In this section we propose two methods to get more clear alignments. + +# 6.1 Heads Importance + +Each layer attention weight matrix is computed by averaging over every head (§2.2). However, + +we know specific heads learn better alignments (Kobayashi et al., 2020). Based on the Hidden Token Attribution method (Brunner et al., 2020) we measure the contribution of each head to the output of the model and detect that specialized heads tend to obtain higher contributions. We propose to optimize the extraction of per layer attention weights substituting the naive average approach by a weighted average based on each head contribution. For each head $h$ we compute the summation of the gradients w.r.t the input vectors $v_{j}^{h}$ : + +$$ +c _ {h} (y _ {t}) = \sum_ {j = 1} ^ {| \mathbf {x} |} \left\| \nabla_ {\mathbf {v} _ {j} ^ {h}} P (y _ {t} | \mathbf {y} _ {< t}, \mathbf {x}) \right\| +$$ + +Then, to extract its relative contribution, we normalize between the scores of every head: + +$$ +C _ {h} (y _ {t}) = \frac {c _ {h} (y _ {t})}{\sum_ {h = 1} ^ {H} c _ {h} (y _ {t})} +$$ + +Finally, we extract hard alignment as a weighted average of the head's relative contribution: + +$$ +\mathbf {A} _ {t, j} = \left\{ \begin{array}{l l} 1 & j = \arg \max _ {j ^ {\prime}} \sum_ {h = 1} ^ {H} C _ {h} (y _ {t}) \alpha_ {t, j ^ {\prime}} ^ {h} \\ 0 & \mathrm {e l s e} \end{array} \right. +$$ + +# 6.2 Masking Finalizing Tokens + +Attention shifting towards source finalizing tokens make the models underperform in the Word Alignment Task. From our previous analysis we also demonstrate they are used to manage the amount of information from the prefix that flow to upper layers. We propose to mask the attention weights to the finalizing tokens with zeros to measure the degree of success of secondary attention weights induced alignments. + +# 6.3 Modified Alignments Results + +Results in Table 2 reflect the reduction in alignment error rate (AER) by applying the proposed methods. Regarding the heads importance method, it improves AER percentage in 2.7 points in the decoder input $(\mathbf{A}_{i,j})$ alignment setting, although maintaining same accuracy in the decoder output $(\mathbf{A}_{t,j})$ alignments. The difference in improvements in $\mathbf{A}_{i,j}$ are explained by the fact that initial layers have attention heads more specialized, while in the last layers they perform more uniformly. Masking methods reduces 6.3 and 8.4 AER points in $\mathbf{A}_{i,j}$ and $\mathbf{A}_{t,j}$ respectively, which indicates that, despite deciding that the prefix contributes the most, the model still pays attention to relevant source tokens. + +
MethodAER ± SDAER ± SD
Ai,jAt,j
Attention weights (Kobayashi et al., 2020)29.83.747.71.7
Ours (HI)27.12.047.61.6
Ours (Mask)23.51.139.31.5
Ours (HI + Mask)22.11.238.51.7
(Chen et al., 2020)20.9---
Vector-Norms (Kobayashi et al., 2020)25.01.541.41.4
Word Aligner (Fast-Align)28.4-28.4-
GIZA++21.0-21.0-
+ +Table 2: AER results comparison. Our methods are applied on (Kobayashi et al., 2020) implementation, which we use as the reference. HI refers to the Heads Importance method (§6.1). GIZA++ and Fast-Align results from (Zenkel et al., 2019). + +# 7 Conclusion + +In this paper, we have studied the use of attention weights as an explanatory method for the Transformer in NMT. We have proposed analysis methods that measure the relative contribution of the source and the target prefix sequences. Then, we have demonstrated that the alignment bias towards finalizing tokens, which is the most common alignment error, is used by the model to avoid source information flowing through the decoder. In these cases, the predicted output relies on prefix dependencies, which are identifiable by extending the gradient-based analysis to extract saliency scores. Furthermore, we have proposed two methods to improve the extraction of alignments from attention weights. As future work, we plan to extend our study to more languages pairs, as well as to the multilingual NMT setting. + +# Acknowledgements + +We would like to thank Ioannis Tsiamas for the help in the busy days, as well as Carlos Escolano and Christine Basta for the useful comments. This work is supported by the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme (grant agreement No. 947657). + +# References + +Alexandre Berard, Ioan Calapodescu, and Claude Roux. 2019. Naver labs Europe's systems for the WMT19 machine translation robustness task. In Proceedings of the Fourth Conference on Machine + +Translation (Volume 2: Shared Task Papers, Day 1), pages 526-532, Florence, Italy. Association for Computational Linguistics. +Peter F. Brown, Stephen A. Della Pietra, Vincent J. Della Pietra, and Robert L. Mercer. 1993. The mathematics of statistical machine translation: Parameter estimation. Computational Linguistics, 19(2):263-311. +Gino Brunner, Yang Liu, Damian Pascual, Oliver Richter, Massimiliano Ciaramita, and Roger Wattenhofer. 2020. On identifiability in transformers. In International Conference on Learning Representations. +Yun Chen, Yang Liu, Guanhua Chen, Xin Jiang, and Qun Liu. 2020. Accurate word alignment induction from neural machine translation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 566-576, Online. Association for Computational Linguistics. +Kevin Clark, Urvashi Khandelwal, Omer Levy, and Christopher D. Manning. 2019. What does BERT look at? an analysis of BERT's attention. In Proceedings of the 2019 ACL Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pages 276-286, Florence, Italy. Association for Computational Linguistics. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 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, Volume 1 (Long and Short Papers), pages 4171-4186, Minneapolis, Minnesota. Association for Computational Linguistics. +Shuoyang Ding, Hainan Xu, and Philipp Koehn. 2019. Saliency-driven word alignment interpretation for neural machine translation. In Proceedings of the Fourth Conference on Machine Translation (Volume 1: Research Papers), pages 1-12, Florence, Italy. Association for Computational Linguistics. +Sarthak Garg, Stephan Peitz, Udhyakumar Nallasamy, and Matthias Paulik. 2019. Jointly Learning to Align and Translate with Transformer Models. arXiv:1909.02074 [cs]. ArXiv:1909.02074. +Shilin He, Zhaopeng Tu, Xing Wang, Longyue Wang, Michael Lyu, and Shuming Shi. 2019. Towards understanding neural machine translation with word importance. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 953-962, Hong Kong, China. Association for Computational Linguistics. +Sarthak Jain and Byron C. Wallace. 2019. Attention is not Explanation. In Proceedings of the 2019 Con + +ference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 3543-3556, Minneapolis, Minnesota. Association for Computational Linguistics. +Goro Kobayashi, Tatsuki Kuribayashi, Sho Yokoi, and Kentaro Inui. 2020. Attention is not only a weight: Analyzing transformers with vector norms. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 7057-7075, Online. Association for Computational Linguistics. +Katherine Lee, Orhan First, Ashish Agarwal, Clara Fannjiang, and David Sussillo. 2019. Hallucinations in neural machine translation. +Jiwei Li, Xinlei Chen, Eduard Hovy, and Dan Jurafsky. 2016. Visualizing and understanding neural models in NLP. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 681-691, San Diego, California. Association for Computational Linguistics. +Xintong Li, Guanlin Li, Lemao Liu, Max Meng, and Shuming Shi. 2019. On the word alignment from neural machine translation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1293-1303, Florence, Italy. Association for Computational Linguistics. +Yang Liu, Qun Liu, and Shouxun Lin. 2005. Log-linear models for word alignment. In Proceedings of the 43rd Annual Meeting of the Association for Computational Linguistics (ACL'05), pages 459-466, Ann Arbor, Michigan. Association for Computational Linguistics. +Franz Josef Och and Hermann Ney. 2003. A systematic comparison of various statistical alignment models. Computational Linguistics, 29(1):19-51. +Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. 2019. *fairseq: A fast, extensible toolkit for sequence modeling.* In *Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics (Demonstrations)*, pages 48-53, Minneapolis, Minnesota. Association for Computational Linguistics. +Danish Pruthi, Mansi Gupta, Bhuwan Dhingra, Graham Neubig, and Zachary C. Lipton. 2020. Learning to deceive with attention-based explanations. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4782-4793, Online. Association for Computational Linguistics. +A. Radford, Jeffrey Wu, R. Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language models are unsupervised multitask learners. In OpenAI Blog. + +Alessandro Raganato, Yves Scherrer, and Jörg Tiedemann. 2020. Fixed encoder self-attention patterns in transformer-based machine translation. In *Findings of the Association for Computational Linguistics: EMNLP* 2020, pages 556–568, Online. Association for Computational Linguistics. +Vikas Raunak, Arul Menezes, and Marcin Junczys-Dowmunt. 2021. The curious case of hallucinations in neural machine translation. +Rico Sennrich, Barry Haddow, and Alexandra Birch. 2016. Neural machine translation of rare words with subword units. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1715-1725, Berlin, Germany. Association for Computational Linguistics. +Sofia Serrano and Noah A. Smith. 2019. Is attention interpretable? In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 2931-2951, Florence, Italy. Association for Computational Linguistics. +Daniel Smilkov, Nikhil Thorat, Been Kim, Fernanda B. Viégas, and Martin Wattenberg. 2017. Smooth-grad: removing noise by adding noise. CoRR, abs/1706.03825. +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(56):1929-1958. +Ben Taskar, Simon Lacoste-Julien, and Dan Klein. 2005. A discriminative matching approach to word alignment. In Proceedings of Human Language Technology Conference and Conference on Empirical Methods in Natural Language Processing, pages 73-80, Vancouver, British Columbia, Canada. Association for Computational Linguistics. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc. +David Vilar, Maja Popovic, and H. Ney. 2006. Aer: do we need to "improve" our alignments? In IWSLT. +Elena Voita, Rico Sennrich, and Ivan Titov. 2020. Analyzing the Source and Target Contributions to Predictions in Neural Machine Translation. arXiv:2010.10907 [cs]. ArXiv:2010.10907. +Elena Voita, David Talbot, Fedor Moiseev, Rico Sennrich, and Ivan Titov. 2019. Analyzing multi-head self-attention: Specialized heads do the heavy lifting, the rest can be pruned. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 5797-5808, Florence, Italy. Association for Computational Linguistics. + +Thomas Zenkel, Joern Wuebker, and John DeNero. 2019. Adding interpretable attention to neural translation models improves word alignment. CoRR, abs/1901.11359. +Luisa M. Zintgraf, Taco S. Cohen, Tameem Adel, and Max Welling. 2017. Visualizing deep neural network decisions: Prediction difference analysis. In 5th International Conference on Learning Representations, ICLR 2017, Toulouse, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net. \ No newline at end of file diff --git a/attentionweightsintransformernmtfailaligningwordsbetweensequencesbutlargelyexplainmodelpredictions/images.zip b/attentionweightsintransformernmtfailaligningwordsbetweensequencesbutlargelyexplainmodelpredictions/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..9d3e709b3f63716a7faed934dbd5d766640a710e --- /dev/null +++ b/attentionweightsintransformernmtfailaligningwordsbetweensequencesbutlargelyexplainmodelpredictions/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:565c3a68a8dffe9fd122531134706ceea7dbff8edd687ce25adf3c098757c1c9 +size 358021 diff --git a/attentionweightsintransformernmtfailaligningwordsbetweensequencesbutlargelyexplainmodelpredictions/layout.json b/attentionweightsintransformernmtfailaligningwordsbetweensequencesbutlargelyexplainmodelpredictions/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2288d38665abfe96e81a29a055974c3856ded086 --- /dev/null +++ b/attentionweightsintransformernmtfailaligningwordsbetweensequencesbutlargelyexplainmodelpredictions/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1f5f7ebd8afb61f2c1988296c44dd58b1aa7461c5f0a031b8004c6a862617f3 +size 366307 diff --git a/attributealignmentcontrollingtextgenerationfrompretrainedlanguagemodels/df1ec479-ae1d-4b68-8ec4-ec473bbf6b00_content_list.json b/attributealignmentcontrollingtextgenerationfrompretrainedlanguagemodels/df1ec479-ae1d-4b68-8ec4-ec473bbf6b00_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a41a99820edad58b3277a77b18f2534743c12397 --- /dev/null +++ b/attributealignmentcontrollingtextgenerationfrompretrainedlanguagemodels/df1ec479-ae1d-4b68-8ec4-ec473bbf6b00_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9dd667fa4bccedf3c2eef5e0399e64b84bc05cf1871f5049bceea6bf1cbe9d9 +size 109166 diff --git a/attributealignmentcontrollingtextgenerationfrompretrainedlanguagemodels/df1ec479-ae1d-4b68-8ec4-ec473bbf6b00_model.json b/attributealignmentcontrollingtextgenerationfrompretrainedlanguagemodels/df1ec479-ae1d-4b68-8ec4-ec473bbf6b00_model.json new file mode 100644 index 0000000000000000000000000000000000000000..376110d3bbf320e4b784b35b89c4dc7e232bf952 --- /dev/null +++ b/attributealignmentcontrollingtextgenerationfrompretrainedlanguagemodels/df1ec479-ae1d-4b68-8ec4-ec473bbf6b00_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:955c13d14ac8ed8a3e84c7677e4aec750e3f4ee10ea6ea917b0e2462b20bb136 +size 125357 diff --git a/attributealignmentcontrollingtextgenerationfrompretrainedlanguagemodels/df1ec479-ae1d-4b68-8ec4-ec473bbf6b00_origin.pdf b/attributealignmentcontrollingtextgenerationfrompretrainedlanguagemodels/df1ec479-ae1d-4b68-8ec4-ec473bbf6b00_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..41b8d582333bdd26a1ff95c159a5430ce61fae8f --- /dev/null +++ b/attributealignmentcontrollingtextgenerationfrompretrainedlanguagemodels/df1ec479-ae1d-4b68-8ec4-ec473bbf6b00_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:134d456d39118d5c60528610b36e298c029700f7cb9559778c79190070a40484 +size 432667 diff --git a/attributealignmentcontrollingtextgenerationfrompretrainedlanguagemodels/full.md b/attributealignmentcontrollingtextgenerationfrompretrainedlanguagemodels/full.md new file mode 100644 index 0000000000000000000000000000000000000000..6e35921ae4b6eb206a29843de2a59af2f539b402 --- /dev/null +++ b/attributealignmentcontrollingtextgenerationfrompretrainedlanguagemodels/full.md @@ -0,0 +1,359 @@ +# Attribute Alignment: Controlling Text Generation from Pre-trained Language Models + +Dian Yu $^{1}$ , Zhou Yu $^{2}$ , Kenji Sagae $^{1}$ + +1 University of California, Davis + +2 Columbia University + +{dianyu, sagae}@ucdavis.edu + +zhouyu@cs.columbia.edu + +# Abstract + +Large language models benefit from training with a large amount of unlabeled text, which gives them increasingly fluent and diverse generation capabilities. However, using these models for text generation that takes into account target attributes, such as sentiment polarity or specific topics, remains a challenge. We propose a simple and flexible method for controlling text generation by aligning disentangled attribute representations. In contrast to recent efforts on training a discriminator to perturb the token level distribution for an attribute, we use the same data to learn an alignment function to guide the pre-trained, non-controlled language model to generate texts with the target attribute without changing the original language model parameters. We evaluate our method on sentiment- and topic-controlled generation, and show large performance gains over previous methods while retaining fluency and diversity. + +# 1 Introduction + +While large pre-trained language models (LM) have advanced text generation with coherent language by training on a large amount of unlabeled data (Radford et al., 2018; Yang et al., 2019; Raffel et al., 2020), they are not controllable. For instance, given the prompt "The issue focused on", GPT-2 (Radford et al., 2019) can generate a high-quality sentence, but it cannot take extra input such as "positive" or "business" to guide the sentence towards a positive sentiment or business-related topic, due to the lack of attribute labels during training. + +To solve the discrepancy between training and inference, one direction is to train an LM from scratch with some supervision such as control codes in CTRL (Keskar et al., 2019). Nevertheless, this method requires training an LM with a large number of parameters, and is limited by the attributes used during pre-training. Another direction is to fine-tune the pre-trained LM on some + +annotated datasets. This usually requires updating all the parameters in the model, which incurs large computational costs with current large LMs that have millions or billions of parameters, and may result in an LM highly relevant only to the specific training data. For example, one can fine-tune a large pre-trained LM on product reviews labeled with sentiment to generate positive and negative sentences, but the fine-tuned model will tend to generate sentences like those from product reviews which greatly limits its utility with out-of-domain prompts. Both these methods require training all the parameters of the model. Alternatively, recent research leverages a discriminator to re-weight output distributions (Holtzman et al., 2018) or to perturb latent representations in the token level such as in PPLM (Dathathri et al., 2020) without changing the pre-trained LM. However, raising target-relevant token probabilities may lead to less fluent sentences. In addition, updating gradients at the token level makes decoding expensive and slow. + +In this paper, we propose Attribute Alignment to infuse attribute representations into a pre-trained unconditional LM without changing the LM parameters. We are inspired by language codes which guide multilingual translation models to translate to the target language (Johnson et al., 2016). However, because attributes signals are not trained with the LM during large-scale pretraining (Johnson et al., 2016; Keskar et al., 2019), we introduce an alignment function to bridge attribute representations to the LM so that it can interpret the weights in the attribute representations. + +Specifically, we encode an attribute (e.g. positive, negative, business, military, etc.) with a pre-trained LM and learn an alignment function to transform the attribute representation. To train the alignment function, we use the same annotated data used to train discriminators in token-level perturbation methods (Dathathri et al., 2020) so that the self-attention to the aligned attribute represen + +
AttributeGenerated Text
NoneThe issue focused on a 2008 decision by the United States Court of Appeals for the Ninth Circuit, in San Francisco, that denied local restaurants advance notice of changes to their menus, even when that change had not been submitted to ...
positiveThe issue focused on returning to the simple premise that dialogue is more effective than banal reactions. They demonstrate very good personal style with establishing dialogue and bringing about a good point of view. Most fantastic of all ...
negativeThe issue focused on a false belief that treatment can never be "good enough" and that long-term treatment only "cures" a person. This does not account for why this is the case: Patients with the ...
businessThe issue focused on the regulations preventing banks and other entities in the financial sector from moving money across foreign borders without the consent of its investors.
athleteThe issue focused on Robinson, who went to camp with his hometown team after being released by the Seattle Seahawks, though it was ruled an emergency by the National Football League.
militaryThe issue focused on whether servicemen and women should be allowed to opt out of serving overseas. It was also about whether making it easier for American troops to return home would help their families.
world + scienceThe issue focused on an allegation that White House chief science adviser, Michael Mann, misstated data about global warming in his
+ +Table 1: Examples generated using the proposed alignment function with Bayes disentanglement (ACB). Tokens underscored are the prompts. We use a classifier to select sentences (see Section 4.3.1) with the highest target attribute predication probability and present the examples here (i.e., the results are not cherry-picked). "None" indicates non-controlled generation (original GPT-2 model). "business" is from AG News, "athlete" is from DBpedia corpus, and "military" is not in the training data (zero-shot). "world + science" controls multiple attributes. + +tation will guide the LM with a language modeling objective on the attribute-related dataset. In contrast to fine-tuning, this does not involve training LM parameters, thus we can do controlled text generation without sacrificing the linguistic quality of the original LM. In addition, we disentangle undesirable features from the training data using a principled approach based on Bayes' Rule. Because of the way the attributes are encoded, the end result is that the generation process can be controlled using arbitrary attributes expressed as words or phrases. Table 1 shows text generated using the prompt The issue focused on with various control attributes. We evaluate our proposed method on sentiment and topic control and show better performance than previous state-of-the-art methods in controlling effectiveness and language quality1. + +# 2 Related Work + +Controlled text generation To interpolate a controlling factor, concatenating the attribute to the input sequence is the most straightforward approach and has been commonly used in grounded generation (Dinan et al., 2019; Prabhumoye et al., 2020). Keskar et al. (2019) proposes to pre-train a large conditional language model with available labels such as URLs for large LM control. This method can be effective in conditional modeling, but requires a substantial amount of resources for pretraining and is limited by the labels used during + +pre-training (e.g. 55 control codes in CTRL). Another approach is to concatenate the attribute representation to the hidden states using linear transformation (Hoang et al., 2016; Fu et al., 2018) or latent variables (Bowman et al., 2016; Wang et al., 2019). These approaches require training from scratch or fine-tuning the entire pre-trained model to incorporate the external target attributes and model conditional probability (Ficler and Goldberg, 2017; Ziegler et al., 2019a; Smith et al., 2020). In addition, they always require carefully designed Kullback-Leibler (KL)-Divergence and adversarial training to generate out-of training domain text with the desirable attribute only (Romanov et al., 2019). In comparison, our proposed method does not require fine-tuning the original LM so that we can make use of the high quality pre-trained LM while controlling the target attributes. + +Instead of fine-tuning the whole model, Houlsby et al. (2019) proposes to add residual adapters, which are task-specific parameters to transformer layers for each language understanding task. Different from adding adapters for each individual attribute (Bapna and First, 2019; Ziegler et al., 2019b), our method only requires learning one attribute alignment function for all attributes to do controlled generation, and is more flexible at inference time without degrading quality such as diversity (Madotto et al., 2020). Recently, Chan et al. (2021) proposes to use self-supervised learning with hand-crafted phrases (e.g. "is perfect" to represent positive sentiment), but suffers from high variance, low coherence and diversity in order to + +![](images/72f4050ff04ca1d01d6622c932c6ec5705891af10f1ef5ebb75533cbb7f42a92.jpg) +Figure 1: Attribute Alignment model architecture with corpus representation disentanglement. We train the alignment function (an MLP in our experiment shown as blue arrows) to transform attribute (e.g. positive sentiment) representation (encoder hidden states in the left grey box) to aligned attribute representation (blue shade box in the middle). The training objective is to generate attribute-related sentences in the training dataset by attending to aligned attribute representation (green lines) in addition to regular self-attention (grey lines). + +incorporate the target phrase. An alternative is to take a pre-trained unconditional LM and perturb the hidden states towards a target attribute in a plug and play manner (Nguyen et al., 2017). PPLM proposes to train a classifier or bag-of-words to increase the likelihood of the target attribute in the hidden state for each token (Dathathri et al., 2020). Similar to ours, their method does not require changing the pre-trained LM and they are able to control sentiment and various topics. However, ascending conditional probability in the token level to shift the distribution towards target-related tokens can lead to degeneration (Holtzman et al., 2020) and is slow at inference time. The most similar work to ours is probably GeDi (Krause et al., 2020) which proposes to apply weighted decoding using class-conditional LMs with Bayes' Rule on each token to solve the slow inference problem. Concurrently, Li and Liang (2021) introduces learning prefix rather than task instructions (Brown et al., 2020) and achieves better performances than adapter-based lightweight baselines. In contrast, our method learns an alignment function on hidden representations of the attribute so that tokens can do self-attention with the attribute without breaking the pre-trained self-attention in the LM. During generation, we can simply send the attribute as a signal for conditional generation. Our method is uniform for different attributes such as sentiment and topics, and is more efficient and flexible. + +Attribute representation learning Liu and Lapata (2018) splits hidden representations to encourage different dimensions to learn different attributes for document representation. In compari + +son, Romanov et al. (2019) uses adversarial learning methods to disentangle different attributes such as style. Similarly, Radford et al. (2017) trains a LM on a sentiment classification dataset and finds that one neuron is responsible for the sentiment value in generation. Our proposed disentangle-ment methods, on the other hand, encourages the alignment function to encode different attributes to different representations and we leverage Bayes' Rule to further separate attributes. + +In machine translation, a language representation is learned by appending a language code to the source sentence (Johnson et al., 2016) or summing with word embeddings (Conneau and Lample, 2019) to guide the translation towards the target language. Inspired by these methods (Yu et al., 2021), Attribute Alignment appends the attribute to the beginning of a sentence and learns an attribute alignment function to transform attribute representations while freezing the LM parameters, without fine-tuning the whole model in previous methods. + +# 3 Methodology + +Unconditional language models are trained to optimize the probability of $p(x_{i}|x_{0:i - 1})$ where $x_{i}$ is the next token and $x_{0:i - 1}$ are already generated tokens. For controlled generation, we need to model the conditional distribution $p(x_{i}|x_{0:i - 1},\mathbf{a})$ where a is the attribute for the model to condition on. To make use of large LMs trained on unlabeled data, we need to infuse the attribute a into the pre-trained unconditional distribution $p(x_{i}|x_{0:i - 1})$ . We introduce Attribute Alignment to this + +end. Different from fine-tuning the whole LM, our alignment function is the only trainable component while the pre-trained LM parameters are frozen. + +# 3.1 Attribute representation with alignment function (A) + +The high-level idea is to append the attribute token to the beginning of a prompt as a signal so that each token in the sentence can attend to the attribute token. However, this may break the originally learned sequential dependencies because now the sentence starts with an attribute token followed by a regular sentence, different from the data used for large LM pre-training. + +Instead, Attribute Alignment first gets the hidden states of the attribute by running the pretrained LM on a. Then we align the hidden states using our alignment function $(\mathcal{F})$ ,implemented as a multi-layer perceptron (MLP) with non-linear connections in this paper, to get aligned attribute representation. Specifically, in the Transformer architecture (Vaswani et al., 2017) where hidden states are represented as key-value pairs, the key $(K)$ and value $(V)$ pair after attribute representation alignment is represented by + +$$ +K _ {: t} ^ {\prime}, V _ {: t} ^ {\prime} = \left[ \mathcal {F} \left(K _ {\mathbf {a}}\right); K _ {: t} \right], \left[ \mathcal {F} \left(V _ {\mathbf {a}}\right); V _ {: t} \right] \quad (1) +$$ + +$K_{\mathbf{a}}, V_{\mathbf{a}}$ are from $LM(x_{\mathbf{a}})$ and $K_{:t}, V_{:t}$ are from $LM(x_{:t})$ where $x_{\mathbf{a}}$ is the attribute phrase, and $x_{:t}$ are the tokens in the generated sentence up to timestep $t$ . Then we can calculate attention and output in the original Transformer model. + +During training, we freeze the pre-trained LM and compute the language modeling loss on datasets with the attribute $\mathbf{a}$ to train the alignment function $\mathcal{F}$ . The loss function is thus + +$$ +\mathcal {L} _ {A} = - \sum_ {t = 0} ^ {l} \log p (x _ {t} | \mathbf {a}, x _ {: t}) \tag {2} +$$ + +and we only update the parameters of the alignment function using the gradients. Fig.1 illustrates the model architecture. At inference time, all tokens starting from the prompt attend to the target attribute representation transformed by the trained alignment function in addition to the standard self-attention to generate the next token. Intuitively, this can be considered as a conditional LM because all tokens now can attend to the aligned attribute representation. + +# 3.2 Disentangle irrelevant attributes + +The learned alignment function bridges the attribute representation to pre-trained LMs. However, we do not disentangle different features in the training data. For instance, if we train the alignment function on a movie review dataset for sentiment control, then $\mathcal{F}$ encodes both sentiment and movie review style after aligning the sentiment attribute representation. Thus, the target attribute representation may be diluted. To solve this problem, we propose three disentanglement methods. + +# 3.2.1 Attribute representation with corpus representation disentanglement (AC) + +We propose to add a corpus domain representation $\mathbf{d}$ along with the attribute representation $\mathbf{a}$ during training. For a training corpus (such as movie reviews) with multiple attributes (such as positive and negative sentiment), $\mathbf{d}$ is used in all the training data while $\mathbf{a}$ is only used in a subset of the training data labeled with the target attribute. Similar to Liu and Lapata (2018), this can encourage the model to encode target attribute and other features separately into different representations. Specifically, the key-value pairs can be represented as + +$$ +K _ {: t} ^ {\prime \prime}, V _ {: t} ^ {\prime \prime} = \left[ \mathcal {F} \left(K _ {\mathrm {a}}\right); \mathcal {F} _ {\mathrm {d}} \left(K _ {\mathrm {d}}\right); K _ {: t} \right], \left[ \mathcal {F} \left(V _ {\mathrm {a}}\right); \mathcal {F} _ {\mathrm {d}} \left(V _ {\mathrm {d}}\right); V _ {: t} \right] \tag {3} +$$ + +where $\mathcal{F}_{\mathbf{d}}$ is a separate alignment function for corpus domain representation, and $K_{\mathrm{d}}, V_{\mathrm{d}}$ are from the LM encoding of corpus domain names. Compared to attributes, corpus domain names might be more abstract so we use special tokens for d (such as ) and the original texts for attributes (such as athlete). At inference time, we want to generate coherent sentences given any (including out-of-domain) prompts. Therefore, we ignore the corpus representation while having tokens attend to the attribute representation in addition to normal self-attention as in Equation 12. + +# 3.2.2 KL disentanglement (ACK) + +We also experiment with adding KL-Divergence on top of AC to ensure that the LM does not diverge too much from the original distribution when an attribute signal is added following (Dathathri et al., 2020). The disadvantage of this method, however, is that KL-Divergence may also prevent the + +alignment function from learning useful updates to attribute representation. + +# 3.2.3 Bayes disentanglement (ACB) + +To further disentangle different features, we use Bayes' Rule to split domain-relevant distribution from attribute-relevant distribution. Derived from Bayes' Theorem (See Appendix A.1), we have + +$$ +p (x | \mathbf {a}) \sim \frac {p (x | \mathbf {a} , \mathbf {d})}{p (x | \mathbf {d})} \cdot \frac {p (x , \mathbf {a})}{p (\mathbf {a} | x , \mathbf {d})} \tag {4} +$$ + +$p(x|\mathbf{a},\mathbf{d})$ is the probability distribution of the generated sentence conditioning on both the attribute and the corpus domain, while $p(x|\mathbf{d})$ is the probability distribution of the generated sentence conditioning on the corpus domain only. During training, we assume that different attributes in a corpus (e.g. different sentiments in movie reviews) are close to a uniform distribution. Hence, we consider $p(a|x,d)$ as a constant for a given sentence $x$ from the corpus $d$ . Likewise, we consider $p(x,a)$ as a probability distribution from the frozen pre-trained LM with roughly comparable attribute distribution on any sentence to approximate $p(a|x)$ , similar to Li et al. (2016). Therefore, we approximate this equation by eliminating the rest where the elimination does not directly impact a specific training sentence for the target conditional distribution. We can approximate the desired conditional probability in the log space as + +$$ +\log p (x | \mathbf {a}) \sim \log p (x | \mathbf {a}, \mathbf {d}) - \log p (x | \mathbf {d}) \tag {5} +$$ + +During training, we train the attribute and domain alignment functions $(\mathcal{F},\mathcal{F}_{\mathbf{d}})$ by running the LM conditioned on both attribute and domain $(p(x|\mathbf{a},\mathbf{d}))$ , and on domain only $(p(x|\mathbf{a}))$ . In specific, the loss function is + +$$ +\mathcal {L} _ {A C B} = - \sum_ {t = 0} ^ {l} \log p (x _ {t} | \mathbf {a}, \mathbf {d}, x _ {: t}) + \sum_ {t = 0} ^ {l} \log p (x _ {t} | \mathbf {d}, x _ {: t}) \tag {6} +$$ + +Similar to other proposed methods, the loss is used to update $\mathcal{F}$ and $\mathcal{F}_{\mathrm{d}}$ . At inference time, suggested by Li et al. (2016), we use a hyper-parameter $\lambda$ to balance the two distributions. Therefore, the distribution we sample tokens from is + +$$ +\log p (x | \mathbf {a}) \sim \log p (x | \mathbf {a}, \mathbf {d}) - \lambda \log p (x | \mathbf {d}) \quad (7) +$$ + +# 3.3 Multi-attribute Control and Zero-shot Inference + +We can simply concatenate aligned attribute representations to control multiple attributes at the same + +time. In addition, as we learn the alignment function on the attribute hidden representation from word embeddings instead of learning the attribute representation directly (Ziegler et al., 2019b), we can switch in any attribute token at inference time. Therefore, we can choose attributes not seen in the training corpus and generate text conditioned on a new topic as a zero-shot setting. + +# 4 Experiments + +We evaluate our proposed methods A: using attribute representation only; AC: Model A with corpus representation for disentanglement; ACK: AC with KL disentanglement; and lastly ACB: AC with Bayes disentanglement. We evaluate these models on sentiment control for thorough comparisons. We use nucleus sampling (Holtzman et al., 2020) for all the methods at inference time. Refer to Appendix A.4 for implementation details. + +# 4.1 Sentiment control + +Data. We use the Stanford Sentiment Treebank (SST, Socher et al., 2013) as our training data. We choose the sentences with positive and negative sentiment to train our alignment function. We select the same 15 prompts such as "Once upon a time" that were used in prior work, which were originally randomly selected, and are listed in Appendix A.2 (Dathathri et al., 2020). + +Baselines. We compare with five baselines. GPT2 generates unconditioned sentences given the prompts from pre-trained GPT2-medium. The generated sentences are coherent and consistent, but may not capture the target attribute. Its fluency, diversity, and how much the results look like a particular training corpus serve as an upper bound. GPT2-concat appends the sentiment token (i.e., positive, negative) before the prompt. It shares the same motivation as our model (see Section 3.1). GPT2-finetune is GPT2 fine-tuned with all the model parameters on the same SST dataset by appending an attribute token to the beginning of a sentence. Its sentiment control score is an upper bound. PPLM perturbs pre-trained LMs to incorporate attributes without fine-tuning the LM parameters. Similar to ours, the recent state-of-the-art GeDi incorporates target attributes by weighted decoding on the token-level and uses Bayes' Rule on all control codes (rather than domain) to remove unwanted attributes. It serves as a strong baseline. + +# 4.2 Topic control + +Data. For topic control, we use AG News dataset (Zhang et al., 2015) with four topic attributes ("World", "Sports", "Business", "Sci/Tech") and DBpedia (Zhang et al., 2015) with 14 topic attributes such as "natural place" (see Appendix A.3 for the full list) as our training data. We use the same 20 prompts from Dathathri et al. (2020) (see Appendix A.2). AG News dataset collects news articles whereas DBpedia dataset collects entity definitions from Wikipedia. + +Baselines. PPLM uses different methods for topic control (pre-defined bag of words). For fair comparison, we only compare with GPT2, GPT2-finetune, and GeDi training on the same data. We choose the best preforming models from sentiment control for topic control experiments (AC, ACB), while having ablation study among proposed models on sentiment control. + +# 4.3 Evaluation + +We evaluate our proposed methods and baselines on sentiment and topic control. Following Dathathri et al. (2020), we sample ten sentences in a batch and select the most attribute-relevant one over three runs for human evaluation for each prompt in each target attribute. For automatic evaluation, we compare the average performance on all the $30(3 \times 10)$ conditionally generated results to test the average performance and stability against variances. + +# 4.3.1 Automatic evaluation + +We evaluate the conditional generation results on fluency, diversity, attribute relevance, and training data corpus resemblance. + +Fluency is measured by GPT2-large, a pre-trained external LM, different from the LM we conduct our experiments with (GPT2-medium). We get the average perplexity of the generated sentences (including the prepended prompt). The perplexity score also indicates how much the generated examples diverge from the pre-trained LM. + +Diversity is measured by distinct uni-, bi-, and tri-gram ratios as Dist-1, Dist-2, and Dist-3 (Li et al., 2016) averaged over all generated sentences. + +Attribute relevance measures how well the generated examples condition on the target attributes. We train classifiers to predict the probability that a given sentence has the target attribute. For sentiment control, we train an external sentiment classifier using IMDB movie review dataset (Maas et al., 2011) with a BERT (Devlin et al., 2019) classifier. + +The classifier achieves an accuracy of $88.51\%$ on the IMDB test set. We also experiment with an internal sentiment classifier trained with SST development set, and we observe that the prediction on the generated texts is similar to that with the external classifier. + +For topic control, we train multi-class classifiers with BERT using $80\%$ of the development sets of AG News and DBpedia datasets. The classifiers achieve an accuracy of $89.71\%$ and $99.25\%$ on the rest of the two development sets, respectively. Because other datasets do not share the same topics, we cannot train external classifiers. + +Training data corpus resemblance is used to evaluate if the proposed methods generate sentences that contain undesirable features such as style from the training corpus. For instance, because our proposed method trains with a movie review dataset, the generated examples may tend to be semantically similar to movie reviews. Similar to attribute relevance, we train a BERT classifier by randomly selecting 2,000 training examples and 500 development examples from each of SST, DBpedia, and AG News, and the trained classifier achieves an accuracy of $99.3\%$ . We report the probability that a generated sentence is from its controlling attribute training corpus as the corpus resemblance score. + +# 4.3.2 Human evaluation + +We evaluate the generated sentences on attribute relevance, language quality, and training data corpus resemblance. All the metrics are on 1-5 Likert scale. Attribute relevance and Corpus resemblance are similar to the automatic metrics, measuring the degree to which the generated sentences are relevant to the target attributes, and how much the generated sentences read like from their corresponding training corpus, respectively. Since one can easily increase attribute relevance score by sampling target-related tokens more frequently regardless of coherence and the context, Language quality measures if the generated sentences are coherent, in addition to fluency. Since GeDi outperforms previous strong baselines including PPLM from both automatic and human evaluation (Krause et al., 2020), we only do human evaluation comparing our best performing model (ACB) with GeDi. + +# 5 Results and Analysis + +We show controlled examples in Table 1 and analyze sentiment and topic control results as follows. + +
ModelAttributeQualityData
Sentiment (classifier) % ↑Sentiment (human) % ↑PPL ↓Dist-1 ↑Dist-2 ↑Dist-3 ↑Quality (human) ↑Corpus resemblance (classifier) % ↓Corpus resemblance (human) % ↓
Baselines
GPT249.24-37.780.490.850.91-18.31-
GPT2-concat52.24-57.500.490.840.89-18.87-
PPLM57.03-54.030.440.790.88-26.12-
GeDi40.032.1863.490.360.770.862.9126.311.44
Attribute Alignment
A52.61-40.190.450.820.90-59.13-
AC68.92-48.780.470.840.91-62.13-
ACK64.89-52.660.480.840.91-62.80-
ACB64.493.4936.620.480.850.913.2524.051.91
Language model fine-tuning
GPT2-finetune78.78-55.600.370.660.75-92.24-
+ +Table 2: Results on sentiment control. Sentiment relevance, language quality, and corpus resemblance scores evaluated by humans are in scale of 1-5. Our proposed model with Bayes disentanglement (ACB) achieves good performance on sentiment controlling while maintaining high quality language generation. Note that even though GPT2-finetune achieves the best sentiment controlling score by training the whole LM, it suffers in generation quality and the generated sentences read like movie reviews. + +# 5.1 Sentiment control + +Comparison with baselines. Table 2 shows results on sentiment control. Compared to the pre-trained LM (GPT2, $49.24\%$ ), all our proposed methods achieve better sentiment controlling scores with a large margin and get similar distinct scores. This shows that our proposed method is effective in sentiment control. + +Even though GPT2-finetune achieves the highest sentiment score $(78.78\%)$ , it gets higher perplexity, lower distinct scores, and very high corpus resemblance $(92.24\%)$ . This implies that we can fine-tune a pre-trained LM to condition on the target attribute but suffer from the cost of being restricted to generating sentences resembling the training data as motivated by Section 1. + +All our methods outperform PPLM and GeDi with better sentiment control and diversity while having higher language quality. For qualitative comparisons between our proposed method and PPLM, we use the IMDB classifier to rank the most negative sentence generated from 30 examples for each prompt and show the generated results in Appendix A.8. Compared to our models, PPLM suffers from repetition and degeneration problems suggested by both distinct scores and qualitative analysis from the generated examples. Similarly, even though GeDi can successfully generate sentiment relevant sentences with prompts similar to the training data (such as "The book" for book reviews, Krause et al., 2020), it does not generate coherent examples with target sentiment (2.18 from human + +annotation) on a more diverse set of prompts. In contrast, using the aligned attribute representation as a control signal to guide the text generation leads to higher sentiment controlling probabilities while keeping the original quality. + +Comparison among proposed methods. The worse performance of having attribute representation only (52.61%) indicates that the entangled attributes dilute the conditional distribution and result in texts using similar vocabularies suggested by low diversity scores. In comparison, adding a corpus representation to disentangle target attributes leads to the best performance on sentiment probability prediction. Further disentanglement by adding KL-Divergence and separating corpus distribution with Bayes' theorem helps to reach lower perplexity and higher distinct scores as expected, but it hurts the attribute controlling performances. This may be caused by that the attribute and corpus representations in fact still mingle with each other so that when we remove the corpus distribution, we also remove some of the target attribute distribution. We also note that without Bayes disentanglement, all the other proposed methods reach much higher training corpus resemblance score (e.g. 62.13% with AC) but still much lower than that from finetuning (92.24%). This may be partially explained by that sentences with a strong sentiment are more similar to movie reviews than others from the training corpus resemblance classifier. Combining all the metrics, it shows that there is trade-off between sentiment control and generation quality. However, + +
Topic sourceModelAttributeQualityData
Relevance (classifier) % ↑Relevance (human) % ↑Perplexity ↓Dist-1 ↑Dist-2 ↑Dist-3 ↑Quality (human) ↑Corpus resemblance (human) % ↓
AG NewsGPT225.43-38.000.490.840.90--
GeDi91.614.7541.420.280.730.863.682.61
AC63.38-32.370.470.830.90--
ACB64.804.5431.220.460.830.903.622.47
DBpediaGPT26.63-37.400.490.840.90--
AC32.98-60.220.500.840.90--
ACB32.18-49.850.490.830.90--
+ +Table 3: Topic control results with topics from AG News and DBpedia. Attribute relevance score from human annotation and language quality are in scale of 1-5. Our proposed methods outperform the GPT2 baselines by a large margin and achieve similar performance with the state-of-the-art GeDi while having higher diversity scores. + +we can still control the sentiment better without the cost of perplexity, diversity, and style convergence than the strong baselines. + +Adversarial prompts results. Following Dathathri et al. (2020), we also experiment with generating a sentence to an opposing sentiment from a highly polarized prompt. For example, the goal is to generate a positive sentence with the negative prompt "The food is awful". Using the external classifier to select the generated examples with the most likely target sentiment, we can obtain sentences such as "The food is awful but the service is amazing!" which is coherent compared to methods like PPLM and GeDi perturbing on the token level. Despite the prompts being very polarized, our method can still lead the text generation to the target sentiment without compromising fluency and diversity. More importantly, although we train our alignment function in the movie review domain, our generated sentences are not biased towards the domain. We show comparisons to PPLM and GeDi in Table 7 in the appendix. + +Attribute data influence results. To evaluate how much attribute relevance in training data influences controlling effect, we experiment with training on strong polarized examples labeled as "very positive" and "very negative" from SST. We denote the corresponding models as AC-S: AC with strong polarized training data; and ACB-S: AC-S with Bayes disentanglement. Table 4 shows that training with strong polarized data achieves similar controlling ability but suffers from lower diversity. This suggests that our proposed method is not sensitive to the attribute quality in the training data, showing the potential to use less strictly annotated data for controlling more diverse attributes. + +# 5.2 Topic control + +Comparison among different methods. We present our results on topic control in Table 3. Similar to sentiment control, we observe that our proposed methods significantly outperform the baseline in target topic controlling while holding similar perplexity and distinct scores. Even though the topic relevance score is lower than GeDi from automatic evaluation, ACB performs similarly measured by human annotation in terms of both relevance and language quality, while being much more diverse. In addition, using Bayes' disentanglement results in lower perplexity. However, compared to sentiment control, further disentanglement derives controlling effect on par with the simple disentanglement $(+1.42\%)$ and $-0.80\%$ relative change for AG News and DBpedia) and generates comparable distinct scores. This indicates that topic attribute representations may be less entangled with other features such as style from the training corpus compared to that for sentiment representation. We show analysis of GPT-finetune in Appendix A.6. + +Comparison between training dataset. To compare the results between topics from AP News and DBpedia, the perplexity is higher than the baseline and the relative corpus resemblance score is also high for DBpedia. We conjecture that this is caused by that topics such as "educational institution" may be difficult to associate with prompts such as "Emphasised are" in the pre-trained LM. When we control the model to generate sentences with the corresponding attributes, the generation diverges from the pre-trained LM more. However, distinct n-grams are not sacrificed. + +
ModelAttributeQualityData
Sentiment% ↑Positive% ↑Negative% ↑PPL↓Dist-1 ↑Dist-2 ↑Dist-3 ↑Corpus resemblance % ↓
AC-S67.0481.6254.4538.460.450.800.8863.21
ACB-S58.8580.8836.8233.330.460.830.8928.12
+ +Table 4: Results on sentiment control comparing strong polarized training data. + +# 5.3 Comparison to GeDi + +From both sentiment control and topic control, we can see that our propose method is on par or better than GeDi in terms of attribute relevance and language quality, while being much more diverse (more than $10\%$ averaged absolute points on distinct scores). Qualitatively, because GeDi applies weighted decoding on the token level similar to PPLM, we observe that it indeed boosts attribute-relevant token distribution which may lead to incoherent sentences (such as repeating the same phrase). For instance, regardless of the prompt, country and names (e.g. "Palestinian") are frequently sampled for the attribute "world". This can be further justified by their lower diversity score compared to the baselines. In addition, since GeDi utilized Bayes' Rule on all attribute codes (in comparison to ours on domains), it can also explain the lower performance on sentiment control where attributes are less decoupled. + +# 5.4 Multi-attribute control and zero-shot analysis + +In Table 1, we show examples with controlling multiple attribute (e.g. "world + science technology"). In addition, topics such as "military" are not in the topic control training corpus so that they are considered as zero-shot attributes. Our trained alignment function can map unseen attribute representation to the target representation to generate fluent and on-topic sentences. However, this zero-shot ability largely depends on the unseen attribute and the provided prompt. Following previous research (Keskar et al., 2019) where there may not be good evaluation metrics for the much harder multi-attribute and zero-shot inference task, we only show generated examples here with limited human annotation results showing better controlling and language quality compared to previous work (Krause et al., 2020). We conjecture that our better performance is due to our more flexible alignment structure. In comparison, it is more complicated to compute the contrastive generation decoding method using Bayes rule suggested by + +Krause et al. (2020) with more control codes without compromising the marginal distribution. + +# 6 Conclusion + +In this paper, we propose a simple but effective attribute alignment model for conditional language generation on top of non-controlled pre-trained LM without fine-tuning LM parameters. We also introduce disentanglement methods to separate different features from the training corpus to further preserve the original pre-trained LM distribution. Evaluated on sentiment and topic control, we show that our proposed method outperforms the previous methods on attribute control while maintaining language generation quality. For future work, we plan to apply the proposed methods on other attributes such as dialog act and explore few-shot learning settings of the training corpus. + +# Acknowledgments + +We thank our anonymous reviewers for constructive suggestions. This work was supported by the National Science Foundation under Grant No. 1840191. Any opinions, findings, and conclusions or recommendations expressed are those of the authors and do not necessarily reflect the views of the NSF. + +# Ethical Considerations + +The proposed method is intended to explore approaches to perturb pre-trained large language models. We hope that our method can inspire future research on conditional generation while maintaining the original LM generation quality. Meanwhile, we note that our method can be used to generate negative sentences which may harm some use cases. However, similar to previous research, we can apply our method to control the generation to less toxic directions and reduce the risks of misuse. In addition, our experiments are done on English data, but our method can be applied to any language. We did experiments with the same setting and same data with previous research when we claim better performance. + +# References + +Ankur Bapna and Orhan First. 2019. Simple, scalable adaptation for neural machine translation. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 1538-1548, Hong Kong, China. Association for Computational Linguistics. +Samuel R. Bowman, Luke Vilnis, Oriol Vinyals, Andrew Dai, Rafal Jozefowicz, and Samy Bengio. 2016. Generating sentences from a continuous space. In Proceedings of The 20th SIGNLL Conference on Computational Natural Language Learning, pages 10-21, Berlin, Germany. Association for Computational Linguistics. +Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. 2020. Language models are few-shot learners. In Advances in Neural Information Processing Systems, volume 33, pages 1877-1901. Curran Associates, Inc. +Alvin Chan, Yew-Soon Ong, Bill Pung, Aston Zhang, and Jie Fu. 2021. Cocon: A self-supervised approach for controlled text generation. In International Conference on Learning Representations. +Alexis Conneau and Guillaume Lample. 2019. Cross-lingual language model pretraining. In Advances in Neural Information Processing Systems, volume 32, pages 7059-7069. Curran Associates, Inc. +Sumanth Dathathri, Andrea Madotto, Janice Lan, Jane Hung, Eric Frank, Piero Molino, Jason Yosinski, and Rosanne Liu. 2020. Plug and play language models: A simple approach to controlled text generation. In International Conference on Learning Representations. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 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, Volume 1 (Long and Short Papers), pages 4171-4186, Minneapolis, Minnesota. Association for Computational Linguistics. +Emily Dinan, Stephen Roller, Kurt Shuster, Angela Fan, Michael Auli, and Jason Weston. 2019. Wizard of wikipedia: Knowledge-powered conversational agents. In International Conference on Learning Representations. + +Jessica Ficler and Yoav Goldberg. 2017. Controlling linguistic style aspects in neural language generation. In Proceedings of the Workshop on Stylistic Variation, pages 94-104, Copenhagen, Denmark. Association for Computational Linguistics. +Zhenxin Fu, Xiaoye Tan, Nanyun Peng, Dongyan Zhao, and Rui Yan. 2018. Style transfer in text: Exploration and evaluation. In AAAI Conference on Artificial Intelligence. +Cong Duy Vu Hoang, Trevor Cohn, and Gholamreza Haffari. 2016. Incorporating side information into recurrent neural network language models. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1250-1255, San Diego, California. Association for Computational Linguistics. +Ari Holtzman, Jan Buys, Li Du, Maxwell Forbes, and Yejin Choi. 2020. The curious case of neural text degeneration. In International Conference on Learning Representations. +Ari Holtzman, Jan Buys, Maxwell Forbes, Antoine Bosselut, David Golub, and Yejin Choi. 2018. Learning to write with cooperative discriminators. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1638-1649, Melbourne, Australia. Association for Computational Linguistics. +Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin De Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. 2019. Parameter-efficient transfer learning for NLP. In Proceedings of Machine Learning Research, volume 97 of Proceedings of Machine Learning Research, pages 2790-2799, Long Beach, California, USA. PMLR. +Melvin Johnson, Mike Schuster, Quoc V. Le, Maxim Krikun, Yonghui Wu, Zhifeng Chen, Nikhil Thorat, Fernanda B. Viégas, 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. +Nitish Shirish Keskar, Bryan McCann, Lav R. Varshney, Caiming Xiong, and Richard Socher. 2019. CTRL: A conditional transformer language model for controllable generation. CoRR, abs/1909.05858. +Ben Krause, Akhilesh Deepak Gotmare, Bryan McCann, Nitish Shirish Keskar, Shafiq R. Joty, Richard Socher, and Nazneen Fatema Rajani. 2020. Gedi: Generative discriminator guided sequence generation. CoRR, abs/2009.06367. +Jiwei Li, Michel Galley, Chris Brockett, Jianfeng Gao, and Bill Dolan. 2016. A diversity-promoting objective function for neural conversation models. In Proceedings of the 2016 Conference of the North + +American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 110-119, San Diego, California. Association for Computational Linguistics. +Xiang Lisa Li and Percy Liang. 2021. Prefix-tuning: Optimizing continuous prompts for generation. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 4582-4597, Online. Association for Computational Linguistics. +Yang Liu and Mirella Lapata. 2018. Learning structured text representations. Transactions of the Association for Computational Linguistics, 6:63-75. +Andrew L. Maas, Raymond E. Daly, Peter T. Pham, Dan Huang, Andrew Y. Ng, and Christopher Potts. 2011. Learning word vectors for sentiment analysis. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, pages 142-150, Portland, Oregon, USA. Association for Computational Linguistics. +Andrea Madotto, Etsuko Ishii, Zhaojiang Lin, Sumanth Dathathri, and Pascale Fung. 2020. Plug-and-play conversational models. In *Findings of the Association for Computational Linguistics: EMNLP* 2020, pages 2422-2433, Online. Association for Computational Linguistics. +Anh Nguyen, Jeff Clune, Yoshua Bengio, Alexey Dosovitskiy, and Jason Yosinski. 2017. Plug & play generative networks: Conditional iterative generation of images in latent space. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR). +Shrimai Prabhumoye, Alan W Black, and Ruslan Salakhutdinov. 2020. Exploring controllable text generation techniques. In Proceedings of the 28th International Conference on Computational Linguistics, pages 1-14, Barcelona, Spain (Online). International Committee on Computational Linguistics. +Alec Radford, Rafal Jozefowicz, and Ilya Sutskever. 2017. Learning to generate reviews and discovering sentiment. CoRR, abs/1704.01444. +Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. 2018. Improving language understanding by generative pre-training. +Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language models are unsupervised multitask learners. +Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21(140):1-67. + +Alexey Romanov, Anna Rumshisky, Anna Rogers, and David Donahue. 2019. Adversarial decomposition of text representation. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 815-825, Minneapolis, Minnesota. Association for Computational Linguistics. +Eric Michael Smith, Diana Gonzalez-Rico, Emily Dinan, and Y-Lan Boureau. 2020. Controlling style in generated dialogue. CoRR, abs/2009.10855. +Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D. Manning, Andrew Ng, and Christopher Potts. 2013. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 1631-1642, Seattle, Washington, USA. Association for Computational Linguistics. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advances in Neural Information Processing Systems, volume 30, pages 5998-6008. Curran Associates, Inc. +Wenlin Wang, Zhe Gan, Hongteng Xu, Ruiyi Zhang, Guoyin Wang, Dinghan Shen, Changyou Chen, and Lawrence Carin. 2019. Topic-guided variational auto-encoder for text generation. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 166-177, Minneapolis, Minnesota. Association for Computational Linguistics. +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumont, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Remi Louf, Morgan Funtowicz, Joe Davison, Sam Shleifer, Patrick von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lhoest, and Alexander Rush. 2020. Transformers: State-of-the-art natural language processing. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 38-45, Online. Association for Computational Linguistics. +Zhilin Yang, Zihang Dai, Yiming Yang, Jaime G. Carbonell, Ruslan Salakhutdinov, and Quoc V. Le. 2019. Xlnet: Generalized autoregressive pretraining for language understanding. CoRR, abs/1906.08237. +Dian Yu, Taiqi He, and Kenji Sagae. 2021. Language embeddings for typology and cross-lingual transfer learning. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 7210–7225, Online. Association for Computational Linguistics. + +Xiang Zhang, Junbo Zhao, and Yann LeCun. 2015. Character-level convolutional networks for text classification. In Proceedings of the 28th International Conference on Neural Information Processing Systems - Volume 1, NIPS'15, page 649-657, Cambridge, MA, USA. MIT Press. +Daniel M. Ziegler, Nisan Stiennon, Jeffrey Wu, Tom B. Brown, Alec Radford, Dario Amodei, Paul F. Christiano, and Geoffrey Irving. 2019a. Fine-tuning language models from human preferences. CoRR, abs/1909.08593. +Zachary M. Ziegler, Luke Melas-Kyriazi, Sebastian Gehrmann, and Alexander M. Rush. 2019b. Encoder-agnostic adaptation for conditional language generation. CoRR, abs/1908.06938. + +# A Appendices + +# A.1 Bayes Theorem Proof + +By Bayes' Theorem, + +$$ +\begin{array}{l} p (x \mid a, d) = \frac {p (x , a , d)}{p (a , d)} (8) \\ = \frac {p (d | x , a) \cdot p (x , a)}{p (a , d)} (9) \\ = \frac {p (d | x , a) \cdot p (x | a) \cdot p (a)}{p (a , d)} (10) \\ = \frac {p (d | x , a) \cdot p (x | a) \cdot p (a)}{p (d | a) \cdot p (a)} (11) \\ = \frac {p (d | x , a) \cdot p (x | a)}{p (d | a)} (12) \\ \end{array} +$$ + +so that we can get + +$$ +p (x \mid a) = \frac {p (x \mid a , d) \cdot p (d \mid a)}{p (d \mid x , a)} \tag {14} +$$ + +Transforming the denominator by + +$$ +\begin{array}{l} p (d \mid x, a) = \frac {p (x \mid d) \cdot p (d) \cdot p (a \mid x , d)}{p (x , a)} (15) \\ \propto \frac {p (x | d) \cdot p (a | x , d)}{p (x , a)} (16) \\ \end{array} +$$ + +we can get + +$$ +\begin{array}{l} p (x \mid a) \sim \frac {p (x \mid a , d)}{p (x \mid d)} \cdot \frac {p (x , a)}{p (a \mid x , d)} \cdot \frac {p (d \mid a)}{p (d \mid x , a)} \tag {18} \\ \sim \frac {p (x \mid a , d)}{p (x \mid d)} \cdot \frac {p (x , a)}{p (a \mid x , d)} \\ \end{array} +$$ + +It is worth noting that our training and loss are novel and different from the pointwise mutual information proposed in Li et al. (2016), although the ACB inference equation looks similar. From our training data, we can only model $p(x|a,d)$ but not $p(x|a)$ directly. Here $a$ is the target attribute and $d$ represents domain-relevant(noisy) attributes. Therefore, we propose a detailed method adopting Bayes rules to approximate conditional probabilities $p(x|a)$ by removing $d$ from $p(x|a,d)$ . In comparison, Li et al. (2016)'s optimization only models $P(T|S)$ and $P(T)$ without any additional attributes or approximation, where $T$ and $S$ are target and source text in conversations. Therefore, the derivation is different. + +# A.2 Prompts for Experiment + +We use the same 15 prompts used for sentiment control experiment and 20 prompts used for topic controlling experiment from PPLM (Dathathri et al., 2020). + +Sentiment control: "Once upon a time", "The book", "The chicken", "The city", "The country", "The horse", "The lake", "The last time", "The movie", "The painting", "The pizza", "The potato", "The president of the country", "The road", and "The year is 1910." + +Topic control: "In summary", "This essay discusses", "Views on", "The connection", "Foundational to this is", "To review", "In brief", "An illustration of", "Furthermore", "The central theme", "To conclude", "The key aspect", "Prior to this", "Emphasised are", "To summarise", "The relationship", "More importantly", "It has been shown", "The issue focused on", "In this essay". + +# A.3 DBpedia topics + +The 14 topics from the DBpedia dataset are: "company", "educational institution", "artist", "athlete", "officeholder", "means of transportation", "building", "natural place", "village", "animal", "plant", "album", "film", "written work". (Zhang et al., 2015) + +# A.4 Implementation Details + +We use GPT2-medium (Radford et al., 2019) with 355M parameters as our pre-trained language model, and GPT2-large with 774M parameters as an external language model to evaluate perplexity. Our implementation is based on an efficient transformer architecture (Wolf et al., 2020) where hidden states are stored as key-value pairs. We implement the alignment function with a multi-layer perceptron (MLP) of two linear layers and a nonlinear activation function (ReLU). Both at training and inference time, all tokens in the sentence can attend to the attribute representations as if they are appended to the beginning of the sentence, but we fix the position ids of the sentence to start with 0. We apply nucleus sampling (Holtzman et al., 2020) with $p$ set to 0.9 and generate texts with a maximum length of 40 for all the experiments. + +We did not do exhaustive hyperparameter search. For $\lambda$ used in ACB, we tried 0.1, 0.5, 1. We choose the best hyperparameters on a held-out set of prompts using the evaluate metrics. We set $\lambda = 0.1$ and report the results in the paper. Sim + +imilarly, we experimented with 0.01, 0.1, 1 for the KL scale and show results in the paper with KL scale set to 0.01. However, we use the suggested hyperparemters from the paper and code for the baselines we compare with (Dathathri et al., 2020; Krause et al., 2020). On SST training set for sentiment control, each epoch takes about 250 seconds, 720 seconds, 720 seconds, and 720 seconds for A, AC, ACK, and ACB respectively on a RTX 2080 Ti GPU machine. We train for 50 iterations for each model. It takes about 3.5 seconds to generate 30 examples for each prompt with evaluation on proposed evaluation metrics. + +In addition, we note that PPLM uses top-k sampling and the sampling method may result in different performance. To eliminate the influence from sampling methods, we also compare our methods with PPLM by top-k sampling and our methods show higher sentiment probability and lower perplexity with the same trend (see Table 5 in Appendix A.5). + +Computational cost Our method requires fewer training epochs, less data, and minimal storage. Specifically, it takes fine-tune model 10 epochs (1846.6s), our methods AC 7 epochs (1237.6s), and ACB 7 epochs (1622.6s) during training. It takes 3.4s, 3.4s, 3.5s respectively at inference time to generate 30 examples. Overall, our method is computationally more efficient. Moreover, recent research suggests that similar alignment methods as ours require less training data than fine-tuning (Li and Liang, 2021). With less data, our method would require even less iterations to converge. Additionally, we only need to store the trained alignment function for all attributes, compared to all parameters for fine-tuning, and one adapter per attribute in residual adapters (Bapna and Firat, 2019). + +A.5 Comparison using top-k sampling + +
ModelSent. prob.%↑Perplexity↓
GPT249.9810.94
PPLM58.5717.52
AC67.3916.53
ACB60.5413.35
+ +Table 5: Comparison on different methods using top-k sampling $(k = 10)$ . + +# A.6 Performance of GPT-finetuning on topic control. + +Table 6 shows results for topic control by finetuning GPT-2. Similar to sentiment control, even though we can achieve better topic relevance score, the generated sentences suffer from low language quality and much less diversity, while converging to the training data. This greatly limits its utility (for example, we may want to generate a coherent sentence about nature in scenarios such as conversations, but we do not want to generate anything that reads like Wikipedia or repeating about forests.) + +
Topic sourceModelAttributeQualityData
On topic prob. % ↑Perplexity↓Dist-1 ↑Dist-2 ↑Dist-3 ↑Corpus resemblance % ↓
AG NewsGPT2-finetung77.0630.420.460.820.8998.37
DBpediaGPT2-fineune59.2169.120.470.790.8758.9
+ +# A.7 Comparison to PPLM and GeDi on adversarial prompts + +Table 6: Topic control results with topics by fine-tuning GPT-2 from AG News and DBpedia. + +
ModelTargetGenerated Text
ACBpositiveThe food is awful but the service is amazing! The takeout is amazing! However, for me, a small,cozy restaurant that is a small institution in a small town I'm so glad that they are planning on ...
negativeThe food is amazing!! We didn't want to bring it home as the night before, but we can't affordthe honey pot cost so we ended up throwing in our own trail mix as well as having ...
PPLMpositiveThe food is awful but there is also the music, the story and the magic! \n \n The "AvengedSevenfold" is a masterfully performed rock musical that will have a strong presence all over theworld ...
negativeThe food is amazing\n \n It's also not. \n \n It is not the kind of stuff that you would just want tospend your money on for \n \n I don't know why, but when I got my second box, it felt like a badrip off ...
GeDipositiveThe food is awful now but awesome! Love this place!!! (10 minutes away from anywhere I canfind good food). Great tapas selection and the chef is very friendly! Excellent staff and great ...
negativeThe food is amazing but terrible...\n \n Why would I buy to test restaurants when I could orderonline online or drive home in a car instead? ...
+ +Table 7: Adversarial sentiment control examples compared to PPLM and GeDi generated from the proposed alignment function with Bayes disentanglement (ACB) where the prompt has a strong opposite sentiment. Similar to Table 1, the results here are selected by a sentiment classifier (not cherry-picked). PPLM results are taken from Dathathri et al. (2020) + +# A.8 Comparison between Attribute Alignment (ACB) and PPLM Examples + +
Modelpred%PPLGenerated Text
PPLM*98.3122.19Once upon a time \n\nI made this game for my wife, and she loved it! I have made a wonderful discovery of how to make this very amazing and beautiful looking and beautiful, beautiful, amazing book! I
PPLM98.39119.54Once upon a time, in a distant galaxy, a supernova blast destroyed a super-nova explosion the losing side ripping apart sScRush UV-3a. A burnt out and rusty mess of garbage spools the
ACB99.5242.17Once upon a time, eBay lists its canceled items. I don't think there is a list of canceled items that I can see here. In the meantime, a bunch of crap, from iPhones (minus their selling center
PPLM*96.5313.52The city of Detroit, the country's third-richest and most-populous, is the most violent, most dysfunctional and most pathetic city in American history; that is, if the United States, which
PPLM99.88158.57The city might as well have been written by \n\n"We got into this mess, how could you What. and by" (by the night was "O-but of the/-how we"
ACB98.0731.98The city is a city of commerce, traffic and construction. In the midst of all this noise and bustle, West Queen West has produced the most monotonous of urban mini-revolutions: no
PPLM*99.4611.67The book was not the best. I found some of the writing to be slightly clunky and awkward. I liked some, but not enough to buy a copy. \n\nThe plot seemed to be about a
PPLM*99.8429.16The book comes out of the ashes of my writing and writing. It was a complete disaster from beginning to end. I had seasoned 250,000 words-at least an hour's per day to write on it
ACB99.6927.30The book was poorly written, written off as 'opinion' and poor grammar and punctuation were used extensively. No wonder the author is currently living in a halfway house with his estate. Nevermind the fact
PPLM*83.4221.89The president of the country's largest hospital says they are now on a "mis-sion to save lives" and that "the people of the US" should not pay for this. I'm a man. I am the reason the
PPLM86.4632.13The president of the country's largest college was fired from her job for giggling at a Golden Gate crowd as a crowd in San Francisco rallied to help a storm victim. \nHowever, the New York Times shames the
ACB97.9313.32The president of the country isn't in office. The president isn't in office. You can't make an argument based on that kind of stuff. So what's the point of it?
PPLM*69.7321.67The painting will be on the back \n\n-A \n\n. \n\n- n\n< |endoftext| > "I can't be the only one who has the right to be a 'f*ck you
PPLM99.44119.54The painting is thought fluff, a very poor, and a shambolic, modern, and bannister-ly, why did you just do that to me, you and your wretched brand of dreadful
ACB99.7520.76The painting is one of the worst I've seen in my lifetime... it's so corny and flat. It's such a cheap, offbeat example. It's more shocking than shocking, because you wouldn
PPLM*96.9273.73The horse has no need for any of this. \n\;;;;;;;;;;! # !? :? *? :? no (: the (( @ the (
PPLM97.7294.93The horse is a wyvern. A wyder is a " rifle". A good shot. Create Chris C, a pretty, brunette, a skinny, bald drone. Just a fat.
ACB97.3947.43The horse he's teaching to lick it away at the bar: heck, the economy would be better off if they didn't have one. In fairness, he could certainly have cut some of his cast more slack
PPLM*94.6120.66The lake has long been the center for a long, ugly, and and and and. \n\ .\n .\n .\n .\n The problem with the problem is I can't find
PPLM96.2143.00The lake around Yaffo in south-central Russia in the world's only biodiversity-poor desert was the scene of the worst air quality in Europe, with more than half of the population suffering three different types
ACB97.3944.15The lake is not vast enough to accommodate a tight lake liner. \n\nLooking for catnap materials in the lake \n\nFinding a catnap bather or two is like asking a family
PPLM*98.7215.78The country is in a tailspin with the economy barely growing and the budget deficit rising. \n\nThe government's budget is a failure. A failure for which there's nothing the public will not pay the price
PPLM97.2032.84The country's will merely sit silently on its grave. \n\nA federal government miscalculated and the economy is limping back to the roots. \n\nJust how bad are the latest developments and what do
ACB94.5338.63The country has become too interested in its politics to pay attention to anything else. The top domestic TV stations should say nothing about this conflict or this nation and instead should be focusing on discussing the place of gays and
PPLM*97.8384.65The road to the White House is an ugly,,,,,,,.. \n\nThe A house or a bin is a a. It's got an awful, unpleasant name.
PPLM86.5133.87The road to intensive genetic counseling \n\nWhen can an individual apply for a program under "animal welfare" or "conservation"? \n\nWhat does "social welfare," "mangle" and "population
ACB97.5835.38The road trip to Seattle and Pacific Ocean was plagued with weird mishaps. Our airline plane couldn't land at Seattle airport so a Toyota Hilux truck was hired to drive it, and a lot of the freight
PPLM*99.868.94The movie is a total disaster, and it's been a total failure at that. \nI can't say I'm entirely convinced it's been a total failure, but I can assure you I'm not
PPLM*99.7734.70The movie is chock-full of nothing good. It is a horrible 3 minute movie. It would've been terrible if I didn't see it when I was through Foety.
ACB99.6023.77The movie set/store just makes no sense at all. \nI've only had my phone with me for a week, so I didn't watch it while others did. On day two I caught the
PPLM*97.6525.52The Pizzaoiolo or specialised freezer version of an Italian classic is no better or worse than a standard hot dog. The good, you just eat it, while the bad, you cook it way, way
PPLM99.6420.79The pizza oven. The pan. What a boring, boring job. You put everything in it, right? So there's this wonderful smell in there. But this is the worst part of it. It takes
ACB99.1825.45The pizza box is, in a word, a piece of garbage \nThe first-ever-to-make-it-in-a-Bowl \nAn over-sucking, over-dram
PPLM*95.218.33The last time New Orleans faced a top-five opponent, it went 4-13. \n\N The Pelicans have lost six consecutive games. \n\N The Pelicans have the league's fourth-worst offense.
PPLM47.1727.44The last time I wrote about buryable garbage I compared the North American garbage garbage heap to that of "Hell" on Earth, and if you have been following along you have noticed some large differences. "Hell"
ACB97.1015.95The last time we were all excited about Wolf of Wall Street, it was Sam Jackson. It took for us a while for us to realize that this was going to be a terrible idea. \n\N Stereotype
PPLM*99.1522.28The year is 1910. A woman, the only child in a small, isolated village, is attacked and is killed.< |endoftext| >I have no time for the idiotic and disgusting bullshit that is the NFL, and that is just
PPLM96.2439.15The year is 1910. Colonists on a long-sought-after research mission return to a barren world of dirt and rubble. The expedition discovers a barren, randy device who possesses a hundred-year-old device
ACB99.9317.29The year is 1910. He's going back home to Paris, where he's an English salesman. He's trying to raise a family and he's having some trouble when his wife returns from an extended vacation.
PPLM*99.3014.63The potato is the world's most widely eaten meat, and its high price is why we eat so much. But is the potato actually the worst meat you'll get? And does a potato really have the worst
PPLM99.00166.03The potato, a slender, poorly vascular plant that is a poor choice for many traditional timesaving reasons. Full of nasty things like the inability to remember details where the it is raised, is the sention the
ACB99.5266.44The potato seems to be a slow, vomiting, and hungry thing. I have seen it eat its excess of juice and poop and drink in thin streams. Yet, despite this hideous abnormality, it hardly feels
PPLM*98.4718.20The chicken wing virus was a terrible thing. I mean, really bad. \n\N The virus, known as "Chicken Wing," was a disease that was devastating to the entire chicken world, killing thousands of chickens
PPLM95.9626.20The chicken coop is a great idea for people, but if you are getting pregnant, the plan is not going to work. Hermies, baby and toddlers are at risk. \n\N Most people would
ACB99.2439.75The chicken commercial is packed full of even more bullshit. For the nearly 900th time, Wendy's CEO Joe Noller has made it clear that there is an organization in this country that hates its products, specifically
+ +Table 8: Examples from PPLM(Dathathri et al., 2020) and our proposed method (ACB: attribute and corpus representation with Bayes disentanglement) for each prompt we experiment with. Note that the perplexity is not comparable among different sampling methods. We use top-p sampling for ACB and and PPLM, and top-k sampling for PPLM* because Dathathri et al. (2020) suggests top-k in their paper for the best results. We use an external classifier to select the example with the highest negative probability from 30 generated sentences and present the results. \ No newline at end of file diff --git a/attributealignmentcontrollingtextgenerationfrompretrainedlanguagemodels/images.zip b/attributealignmentcontrollingtextgenerationfrompretrainedlanguagemodels/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..38a52fd2dacdbeff399e8cdaa18054bb8370faee --- /dev/null +++ b/attributealignmentcontrollingtextgenerationfrompretrainedlanguagemodels/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dddbc13b9559195bff550d8c77f4eee2c07022bea49401bf17282be434070929 +size 1727712 diff --git a/attributealignmentcontrollingtextgenerationfrompretrainedlanguagemodels/layout.json b/attributealignmentcontrollingtextgenerationfrompretrainedlanguagemodels/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..4f2d30a469097f2c4dde5ee8fca5e7e7bc3441c8 --- /dev/null +++ b/attributealignmentcontrollingtextgenerationfrompretrainedlanguagemodels/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6781c748562fba9ab4a9ac2f7626a362b9e0a3c4cbe17a42b008afa19561ef1c +size 396786 diff --git a/autoeqaautoencodingquestionsforextractivequestionanswering/abdb696b-e46a-4195-a33e-595c8603dbbf_content_list.json b/autoeqaautoencodingquestionsforextractivequestionanswering/abdb696b-e46a-4195-a33e-595c8603dbbf_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..1daba6fe917cb5a7b679993b0f560238a5bec538 --- /dev/null +++ b/autoeqaautoencodingquestionsforextractivequestionanswering/abdb696b-e46a-4195-a33e-595c8603dbbf_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:24917910f8f03f04dfc18b7232308e7f0bac8213028bb8f51e415b940d70b7d3 +size 46288 diff --git a/autoeqaautoencodingquestionsforextractivequestionanswering/abdb696b-e46a-4195-a33e-595c8603dbbf_model.json b/autoeqaautoencodingquestionsforextractivequestionanswering/abdb696b-e46a-4195-a33e-595c8603dbbf_model.json new file mode 100644 index 0000000000000000000000000000000000000000..581ef338ec23cbdd3e91c7999b7080db015e50d7 --- /dev/null +++ b/autoeqaautoencodingquestionsforextractivequestionanswering/abdb696b-e46a-4195-a33e-595c8603dbbf_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3b676064e2aa66008934f0efb39a5cccf3982b178152b852b9465d0633b60cf +size 56553 diff --git a/autoeqaautoencodingquestionsforextractivequestionanswering/abdb696b-e46a-4195-a33e-595c8603dbbf_origin.pdf b/autoeqaautoencodingquestionsforextractivequestionanswering/abdb696b-e46a-4195-a33e-595c8603dbbf_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2f3d0143605da8fb1d3cf2de6ce43679a84ff4fd --- /dev/null +++ b/autoeqaautoencodingquestionsforextractivequestionanswering/abdb696b-e46a-4195-a33e-595c8603dbbf_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53e5d7c7042505e63df6278ef6b5526dc18472120050a7839503f541bc1ef412 +size 507616 diff --git a/autoeqaautoencodingquestionsforextractivequestionanswering/full.md b/autoeqaautoencodingquestionsforextractivequestionanswering/full.md new file mode 100644 index 0000000000000000000000000000000000000000..ff58c73a5dd7162d9c6ea1ad5b3eaddd55231a9e --- /dev/null +++ b/autoeqaautoencodingquestionsforextractivequestionanswering/full.md @@ -0,0 +1,184 @@ +# AutoEQA: Auto-Encoding Questions for Extractive Question Answering + +# Stalin Varanasi Saadullah Amin Günter Neumann + +Saarland Informatics Campus, D3.2, Saarland University, Germany +German Research Center for Artificial Intelligence (DFKI), Saarbrücken, Germany + +{stalin.varanasi,saadullah.amin,guenter.neumann}@dfki.de + +# Abstract + +There has been a significant progress in the field of extractive question answering (EQA) in the recent years. However, most of them rely on annotations of answer-spans in the corresponding passages. In this work, we address the problem of EQA when no annotations are present for the answer span, i.e., when the dataset contains only questions and corresponding passages. Our method is based on auto-encoding of the question that performs a question answering (QA) task during encoding and a question generation (QG) task during decoding. Our method performs well in a zero-shot setting and can provide an additional loss to boost performance for EQA. + +# 1 Introduction + +Extractive question answering (EQA) is the task of finding an answer span to a question from a context paragraph. Most of the deep learning models for this task perform well when annotated data is present. Scaling such models to new domains often requires creation of new datasets (d'Hoffschmidt et al., 2020; Lim et al., 2019; Trischler et al., 2017; Kwiatkowski et al., 2019). However, collecting labels for these corpora is expensive and time consuming which may involve multiple steps such as article curation, question and answer sourcing. Alleviating the annotation efforts for any of these steps is not only of research but also of practical interest. In this work, we address the problem of extracting answer spans to a question from unannotated context paragraph. + +Some works have already been proposed to solve EQA in both semi-supervised and unsupervised setting. Unsupervised methods focus on creating a synthetic corpus and further train a supervised model on the synthetic corpus (Lewis et al., 2019). In semi-supervised methods the focus is on different pre-training tasks that improve the initialization of the EQA models (Dhingra et al., 2018; Glass + +![](images/f6782e7178cfef40b077fe12a9779927ece08fbb1f39af98143c8865e5237b10.jpg) +Figure 1: Schematic diagram of the proposed autoencoding scheme. To the right, is the semi-diagonal mask on the self-attention layers for the decoding step. It enables the uni-directional language model of the question. We assume a latent distribution over possible answer spans, approximated by candidate phrases. See §2 for details. + +et al., 2020; Ram et al., 2021). Our work can be categorized as the latter with one key difference: to further perform question answering without annotations on answer spans. To validate our approach, we use the pre-trained BERT (Devlin et al., 2019) model using SQuAD (Rajpurkar et al., 2016). + +Specifically, our method employs a conditional auto-encoding scheme that reconstructs question given a passage while assuming a latent distribution over the answer phrases. The encoder of our model is a Question Answering (QA) model that jointly encodes the context and the question to estimate the probability distribution over possible answer spans. This is further given as input along with passage to the decoder which is a Question Generation (QG) model. We use a shared architecture for both the encoder and the decoder. Therefore, our model can be viewed as a self-supervised machine comprehension model that learns from itself. We list our contributions as follows: + +- We propose a novel method to perform unsupervised answer span extraction given a corpus of questions and associated paragraphs. + +- We obtain an accuracy of $90\%$ on unsupervised answer sentence selection. +- We obtain strong results (34.3 EM, 53.4 F1 on SQuAD dev set) for EQA when there is no annotation on the answer spans (Rajpurkar et al., 2016). + +# 2 Method + +Our model can be characterized as a discrete conditional variational auto-encoder (CVAE), where we seek to maximize the ground truth distribution of question given context $p_{\theta}(Q|c)$ with the assumption that there exist a latent variable answer span. We can then maximize the log-likelihood of $p_{\theta}(Q|c)$ with this assumption by the Evidence Lower Bound (ELBO) (Kingma and Welling, 2014): + +$$ +\begin{array}{r l} \log p _ {\theta} (Q | c) & \geq \mathbb {E} _ {a \sim q _ {\phi} (a | c, Q)} [ \log p _ {\theta} (Q | a, c) ] - \\ D _ {K L} [ q _ {\phi} (a | Q, c) | | p (a | c) ] \end{array} \tag {1} +$$ + +where $Q$ is the question, $c$ is the context, $q_{\phi}$ is the inference network, which estimates the probability of an answer $a$ given the question and context, and $p_{\theta}$ is the decoder model to estimate the distribution $p_{\theta}(Q|a,c)$ . In our case, since the architecture is shared, $\theta$ and $\phi$ represent the same set of parameters. Our auto-encoding scheme consists of three modules phrase extractor, encoder and decoder as shown in Figure 1. + +# 2.1 Phrase Extractor + +For EQA, given that there is no supervised signal for answer spans, an exhaustive search over all the possible phrases would be sub-optimal as there can be many phrases not suitable for natural language questions (Trischler et al., 2017; Joshi et al., 2017). We limit our potential answer phrases to the named entities and tags from constituency trees $^{1}$ . We also allow overlapping answer phrases in the set of candidate answer phrases. This is necessary as the sub-words of a phrase can be answers to different questions. We further remove the phrases that overlapped with the question, because such phrases can be more significant for generating the question over the possible answer phrases. With our chosen phrases, it is possible to achieve a best $70\%$ EM and $88\%$ F1 on SQuAD. These results serve as upper bound on our model's performance. + +![](images/a2b2599efc651a2ad27748c39051efd032bffe5e79a93feca96cab2c1fa60152.jpg) +Figure 2: Example on how token scores are obtained from probabilities of overlapping phrases 3, the Gold Dome and 3 statues and the Gold Dome + +# 2.2 Encoder + +Our encoder is a pre-trained BERT (Devlin et al., 2019) model, which is referred to as the inference network, that estimates $q(a|Q,c)$ taking a paragraph concatenated with the corresponding question as input. This is similar to Devlin et al. (2019) while encoding two different text segments. Each token of the input is accompanied by a segment feature that takes values 0 or 1 representing different segments of the input (i.e., the question or the paragraph). Without a supervised signal, estimating probabilities on individual phrases might be difficult, so we decompose the probability of a phrase by using the probability of its sentence as follows: + +$$ +q (a _ {s _ {i}} | Q, c) = q (a _ {s _ {i}} | s _ {i}, Q, c) q (s _ {i} | Q, c) \tag {2} +$$ + +where $s_i$ is the $i$ -th sentence, $a_{s_i}$ is one of the candidate phrases in it, $Q$ and $c$ are the question and the context paragraph respectively. To obtain the terms of the above expression, we define a scoring function that takes two text segments as input and outputs an affinity score. A text segment can either be a sentence, a question or a phrase. Each text segment is embedded as a vector from BERT output embeddings as follows: + +$$ +\mathbf {v} _ {t} = \frac {1}{| t |} \sum_ {w _ {i} \in t} \mathrm {B E R T} (w _ {i}) +$$ + +$$ +\operatorname {s c o r e} (s, t) = \mathbf {v} _ {s} ^ {T} \mathbf {W} \mathbf {v} _ {t} \tag {3} +$$ + +where $t$ represents a text segment, $\mathrm{BERT}(w_i)$ is the output embedding of BERT model for token $w_i$ , $\mathbf{v}_t$ is the vector representation of the phrase $t$ obtained as an average of BERT embeddings of the phrase tokens. The affinity score is obtained as a bilinear product of the vector representations of the text segments with learnable matrix $\mathbf{W} \in \mathbb{R}^{d \times d}$ . + +The conditional probability of a sentence given the question and the paragraph, $q(s_i|Q,c)$ , is obtained as a softmax of the scoring function in Eq. 3 over all the sentences. + +$$ +q (s _ {i} | Q, c) = \frac {\exp (\operatorname {s c o r e} (s _ {i} , Q))}{\sum_ {\forall s _ {k} \in c} \exp (\operatorname {s c o r e} (s _ {k} , Q))} +$$ + +Similarly, $q(a_{s_i}^{(j)}|s_i, Q, c)$ is obtained as a softmax of the scores between the question $Q$ and the answer phrase $a_{s_i}^{(j)}$ over all answer phrases within the $i$ -th sentence $s_i$ of $c$ : + +$$ +q (a _ {s _ {i}} ^ {(j)} | s _ {i}, Q, c) = \frac {\exp (\operatorname {s c o r e} (a _ {s _ {i}} ^ {(j)} , Q))}{\sum_ {\forall a _ {s _ {i}} ^ {(k)} \in s _ {i}} \exp (\operatorname {s c o r e} (a _ {s _ {i}} ^ {(k)} , Q))} +$$ + +With these two expressions, one can obtain the probability distribution of the phrases from Eq. 2. Further, we transfer these (overlapping) phrase-level probabilities into token-level scores to obtain a real valued segment feature vector as follows (shown in Figure 2): + +$$ +t _ {i} = \sum_ {\forall a _ {i} \in s _ {j}; t _ {i} \in a _ {i}} q (a _ {i} | s _ {j}, Q, c) +$$ + +The purpose of the binary segment features is to differentiate some part of the text from the rest and to signify connection between them. The pretrained weights of BERT model include segment embeddings for input segment features 0 or 1. However, the output of the encoder model is a vector of real numbers $\in [0,1]$ . To accommodate this input whilst not loosing the well-informed weights of BERT, we obtain the segment embeddings for each token as an interpolation between the binary segment embeddings of BERT: + +$$ +\operatorname {v e c} _ {\operatorname {s e g}} \left(t _ {i}\right) = \operatorname {v e c} _ {\operatorname {s e g}} (0) t _ {i} + \operatorname {v e c} _ {\operatorname {s e g}} (1) \left(1 - t _ {i}\right) +$$ + +where $\operatorname{vec}_{\mathrm{seg}}(t_i)$ is the segment embedding at position $i$ , given a segment feature $t_i \in [0,1]$ , $\operatorname{vec}_{\mathrm{seg}}(0)$ and $\operatorname{vec}_{\mathrm{seg}}(1)$ are segment embeddings for the input segment features 0 and 1 respectively. + +# 2.3 Decoder + +The decoder is a BERT model, which shares weights with the encoder. It performs the task of generating question given paragraph and the answer span. Here we employ a unified transformer architecture model similar to (Dong et al., 2019; Varanasi et al., 2020; Chan and Fan, 2019). + +
ModelTop-1
SUPERVISED
Selector (Min et al., 2018)91.2
BR-MPGE-ASBase (Tian et al., 2020)92.1
UNSUPERVISED
SBERT (Reimers and Gurevych, 2019)63.5
TF-IDF (Min et al., 2018)81.2
AutoEQA-GSBase75.0
UNSUPERVISED ANSWER SPAN
AutoEQA-QGBase87.6
AutoEQA-QGLarge90.3
+ +Table 1: Answer sentence accuracy at top-1 sentence selection on SQuAD dev set (v1.1) (Rajpurkar et al., 2016) at different levels of supervision. Base and Large refers to bert-base and bert-large (Devlin et al., 2019) models respectively. + +To encode answer span, we use segment features of BERT. The first term in Eq. 1 is an expectation over an estimated distribution of the inference network. This requires sampling which can be simulated by adding Gumbel-noise (Maddison et al., 2017; Jang et al., 2017) to the distribution and further taking the softmax with a scaling factor $\tau$ , which decides the peakiness of the distribution. However during training, we allow soft answer selection instead of choosing a single answer. The probabilities on the answer phrases are transferred as scores per token and these scores are provided as soft segment ids for corresponding tokens. Similar to Sun et al. (2018) and Dong et al. (2019), we use a QG model to decode the question given a paragraph and an answer phrase as input. We hypothesize that the tasks of encoder and decoder complement each other as one single transformer model perform both QA and QG simultaneously. We use BERT based copy-mechanism (Gu et al., 2016) while generating the question as proposed by Varanasi et al. (2020). The copy-mechanism interpolates the probability distribution over the vocabulary with the probability distribution over the paragraph which is obtained from self attention scores across different layers of BERT. + +# 3 Experiments + +For EQA experiments, we used the SQuAD v1.1 (Rajpurkar et al., 2016) dataset and conducted both sentence level and phrase level answer span selection. We trained on paragraph-question pairs without using the labels for answers (i.e., 87, 594 paragraph-question pairs). We maximize the objec + +
ModelEMF1
BASELINE
Random (Rajpurkar et al., 2016)1.34.3
Sliding Window (Rajpurkar et al., 2016)13.020.0
Context Only (Kaushik and Lipton, 2018)10.914.8
ANSWER SPAN SELECTION VIA PRE-TRAINING
Cloze Corpus + BIDAF+SAγ (Dhingra et al., 2018)10.015.0
Cloze CorpusγLarge (Dhingra et al., 2018)28.035.8
Span Pre-train*Base (Glass et al., 2020)3.810.4
Span Pre-train*Large (Glass et al., 2020)10.923.2
ANSWER SPAN SELECTION VIA AUTO-ENCODING QUESTION
AutoEQA-QGBase32.5949.4
AutoEQA-QGLarge34.353.4
SUPERVISED
BERTBase (Devlin et al., 2019)80.888.5
BERTLarge (Devlin et al., 2019)84.190.9
+ +Table 2: Comparison of different unsupervised and semi-supervised models on SQuAD dev set. $\gamma$ is implemented and reported by Lewis et al. (2019), $*$ are the models provided by the authors. + +tive for log-likelihood where we trained for 3 epochs on the training set and kept the model that has the best log-likelihood of the question. We observed that a question log-likelihood loss already achieves good performance. As expected for auto-regressive decoders, introducing KL-Divergence term in the Eq. 1 caused posterior collapse. We used simulated annealing to mitigate this issue. As mentioned above, removing phrases that are common with the question helped to avoid local minima. We used bert-base-cased and bert-large-cased (Devlin et al., 2019) models in our experiments, with initial learning rate $3e^{-5}$ using Adam (Kingma and Ba, 2015) optimizer with 0.1 proportion of linear warm-up for learning rate. + +# 3.1 Unsupervised Sentence Level QA + +Answer sentence selection is an important task that benefits EQA further in terms of the accuracy and speed. Min et al. (2018) showed that by reducing the context to a sentence, one can not only reduce the training and inference time but also at times obtain better accuracy. As we factored the probability of a sentence into the probability of a candidate answer phrase that it contains, our model naturally scores a sentence high if it impacts the likelihood of the question. We used a modified version of SQuAD for answer-sentence span selection, similar to Tian et al. (2020).2 Table 1 provides a + +![](images/906a11808da3d4a8d5b0adc7d73aede4f5f37a85bffac79d92c82fc0b23f673f.jpg) +Figure 3: Average F1 scores for different question types + +comparison of our results on SQuAD dev set to some of the unsupervised and supervised methods on answer sentence selection task. We provide our own baseline, AutoEQA-GSBase, by auto-encoding a missing (gap) sentence from a SQuAD paragraph instead of the question. We achieve 75% accuracy on top-1 sentence. This suggests that the architecture of AutoEQA by design captures semantic similarity necessary for question-answering. + +TF-IDF (Min et al., 2018) uses word frequency in the question and the sentence to provide a similarity score. Sentence-BERT (SBERT) (Reimers and Gurevych, 2019) is a state-of-the-art sentence embedding model which is trained for Textual Similarity tasks (STS). It is noteworthy that our model + +AutoEQA-GSBase surpasses SBERT when there is no supervision for both paragraph or answer span. For supervised sentence selection models, Min et al. (2018) uses sentence-aware question embeddings to find similarity between sentences and questions and Tian et al. (2020) uses multi-perspective graph encoding to capture sentence relations to further benefit answer-sentence selection task. While both of these models use supervision with elaborate architecture for answer sentence selection, they only marginally outperform AutoEQA-QG model in span unsupervised setting. This suggests the potential for AutoEQA-QG loss to enhance for sentence level EQA models. + +# 3.2 Unsupervised Extractive Question Answering + +For evaluation on answer phrases, we compare our model with other possible answer span selection techniques. The baseline models use heuristics to train on simple features that do not require annotation for EQA. The first baseline model is the sliding window approach reported by Rajpurkar et al. (2016) that finds answers using word overlap with the question. Secondly, they also propose a supervised logistic regression model which is trained on hand crafted features. Kaushik and Lipton (2018) use supervision to extract the most likely answer span from the context but they completely ignore the question. These models mark the baseline. + +Secondly, we report models that pre-train on answer span selection methods to improve EQA. Dhingra et al. (2018) creates a noisy corpus from Wikipedia articles where questions are sentences with missing phrases called cloze questions. Recently, Glass et al. (2020) created a similar cloze question corpus with documents retrieved per each cloze question using information retrieval methods. Both models train on answer span selection that is required for the task of EQA. From table 2, one can see that AutoEQA out performs them with large margin. The difference between EM and F1 scores for our models suggests that there are more overlaps between the model's predictions and ground truth though it does not predict the exact phrase. This provides a scope of improvement on phrase selection. + +While the selection of candidate answer phrases themselves can limit AutoEQA, some answer phrases might be inherently difficult to learn. For better understanding, we look at the performance + +statistics on different question categories. Figure 3 shows the average F1 scores on different question types. AutoEQA naturally performs better in the question categories when, where, and what attributing to the fact that the answers for these questions tend to be named entities. The model performed poorly in the why questions. This could be because of their lengthy answer phrases. It is interesting to note that (Lewis et al., 2019) too performed poorly in this category. The category other refers to which and who questions combined with no-question word questions. Overall, we seem to see a correlation with answer types being named entities and the model's performance. Nearly $75\%$ of the predicted answers are less than 10 words distant from the ground truth. + +# 4 Related Work + +Recently, data augmentation has become a popular way to do unsupervised EQA (Lewis et al., 2019; Li et al., 2020; Fabbri et al., 2020), where synthetic questions are generated either by heuristics or by unsupervised question generation methods. Brown et al. (2020) show that very large-scale language models can generate answers without supervision. While these works have their own benefits, they are different from the problem we intend to address and hence can not be compared directly. For example, Lewis et al. (2019) achieves similar performance to ours using millions of artificially created data points for EQA corpora, while we achieve our results by using only 87k training samples suggesting the efficiency of our method when supervision for question, paragraph pairs is provided. + +# 5 Conclusion + +In this work, we proposed a novel method for Unsupervised answer span selection. We showed that using auto-encoding of question, one can get considerable gains (34.3% EM and 53.4% F1 score). Methods for unsupervised key phrase extraction can benefit AutoEQA in choosing well-informed and dynamic phrases. + +# Acknowledgments + +The work was partially funded by the German Federal Ministry of Education and Research (BMBF) through the projects CoRA4NLP (01IW20010) and XAINES (01IW20005). The authors thank Anna Vechkaeva for helpful discussions. + +# References + +Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. 2020. Language models are few-shot learners. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual. +Ying-Hong Chan and Yao-Chung Fan. 2019. A recurrent BERT-based model for question generation. In Proceedings of the 2nd Workshop on Machine Reading for Question Answering, pages 154-162, Hong Kong, China. Association for Computational Linguistics. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 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, Volume 1 (Long and Short Papers), pages 4171-4186, Minneapolis, Minnesota. Association for Computational Linguistics. +Bhuwan Dhingra, Danish Danish, and Dheeraj Rajagopal. 2018. Simple and effective semi-supervised question answering. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), pages 582-587, New Orleans, Louisiana. Association for Computational Linguistics. +Martin d'Hoffschmidt, Wacim Belblidia, Quentin Heinrich, Tom Brendlé, and Maxime Vidal. 2020. FQuAD: French question answering dataset. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 1193-1208, Online. Association for Computational Linguistics. +Li Dong, Nan Yang, Wenhui Wang, Furu Wei, Xiaodong Liu, Yu Wang, Jianfeng Gao, Ming Zhou, and Hsiao-Wuen Hon. 2019. Unified language model pre-training for natural language understanding and generation. In Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pages 13042-13054. +Alexander Fabbri, Patrick Ng, Zhiguo Wang, Ramesh Nallapati, and Bing Xiang. 2020. Template-based + +question generation from retrieved sentences for improved unsupervised question answering. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4508-4513, Online. Association for Computational Linguistics. +Michael Glass, Alfio Gliozzo, Rishav Chakravarti, Anthony Ferritto, Lin Pan, G P Shrivatsa Bhargav, Dinesh Garg, and Avi Sil. 2020. Span selection pretraining for question answering. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 2773-2782, Online. Association for Computational Linguistics. +Jiatao Gu, Zhengdong Lu, Hang Li, and Victor O.K. Li. 2016. Incorporating copying mechanism in sequence-to-sequence learning. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1631-1640, Berlin, Germany. Association for Computational Linguistics. +Matthew Honnibal, Ines Montani, Sofie Van Landeghem, and Adriane Boyd. 2020. spaCy: Industrial-strength Natural Language Processing in Python. +Eric Jang, Shixiang Gu, and Ben Poole. 2017. Categorical reparameterization with gumbel-softmax. In 5th International Conference on Learning Representations, ICLR 2017, Toulouse, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net. +Mandar Joshi, Eunsol Choi, Daniel Weld, and Luke Zettlemoyer. 2017. TriviaQA: A large scale distantly supervised challenge dataset for reading comprehension. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1601-1611, Vancouver, Canada. Association for Computational Linguistics. +Divyansh Kaushik and Zachary C. Lipton. 2018. How much reading does reading comprehension require? a critical investigation of popular benchmarks. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 5010-5015, Brussels, Belgium. Association for Computational Linguistics. +Diederik P. Kingma and Jimmy Ba. 2015. 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. +Diederik P. Kingma and Max Welling. 2014. Autoencoding variational bayes. In 2nd International Conference on Learning Representations, ICLR 2014, Banff, AB, Canada, April 14-16, 2014, Conference Track Proceedings. +Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Jacob Devlin, Kenton Lee, Kristina Toutanova, Llion Jones, + +Matthew Kelcey, Ming-Wei Chang, Andrew M. Dai, Jakob Uszkoreit, Quoc Le, and Slav Petrov. 2019. Natural questions: A benchmark for question answering research. Transactions of the Association for Computational Linguistics, 7:452-466. +Patrick Lewis, Ludovic Denoyer, and Sebastian Riedel. 2019. Unsupervised question answering by cloze translation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4896-4910, Florence, Italy. Association for Computational Linguistics. +Zhongli Li, Wenhui Wang, Li Dong, Furu Wei, and Ke Xu. 2020. Harvesting and refining question-answer pairs for unsupervised QA. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6719-6728, Online. Association for Computational Linguistics. +Seungyoung Lim, Myungji Kim, and Jooyoul Lee. 2019. Korquad1. 0: Korean qa dataset for machine reading comprehension. ArXiv preprint, abs/1909.07005. +Chris J. Maddison, Andriy Mnih, and Yee Whye Teh. 2017. The concrete distribution: A continuous relaxation of discrete random variables. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net. +Sewon Min, Victor Zhong, Richard Socher, and Caiming Xiong. 2018. Efficient and robust question answering from minimal context over documents. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1725-1735, Melbourne, Australia. Association for Computational Linguistics. +Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. SQuAD: 100,000+ questions for machine comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 2383-2392, Austin, Texas. Association for Computational Linguistics. +Ori Ram, Yuval Kirstain, Jonathan Berant, Amir Globerson, and Omer Levy. 2021. Few-shot question answering by pretraining span selection. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 3066-3079, Online. Association for Computational Linguistics. +Nils Reimers and Iryna Gurevych. 2019. SentenceBERT: Sentence embeddings using Siamese BERTnetworks. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 3982-3992, Hong Kong, China. Association for Computational Linguistics. + +Xingwu Sun, Jing Liu, Yajuan Lyu, Wei He, Yanjun Ma, and Shi Wang. 2018. Answer-focused and position-aware neural question generation. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 3930-3939, Brussels, Belgium. Association for Computational Linguistics. +Zhixing Tian, Yuanzhe Zhang, Xinwei Feng, Wenbin Jiang, Yajuan Lyu, Kang Liu, and Jun Zhao. 2020. Capturing sentence relations for answer sentence selection with multi-perspective graph encoding. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 9032-9039. +Adam Trischler, Tong Wang, Xingdi Yuan, Justin Harris, Alessandro Sordoni, Philip Bachman, and Kaheer Suleman. 2017. NewsQA: A machine comprehension dataset. In Proceedings of the 2nd Workshop on Representation Learning for NLP, pages 191-200, Vancouver, Canada. Association for Computational Linguistics. +Stalin Varanasi, Saadullah Amin, and Guenter Neumann. 2020. CopyBERT: A unified approach to question generation with self-attention. In Proceedings of the 2nd Workshop on Natural Language Processing for Conversational AI, pages 25–31, Online. Association for Computational Linguistics. \ No newline at end of file diff --git a/autoeqaautoencodingquestionsforextractivequestionanswering/images.zip b/autoeqaautoencodingquestionsforextractivequestionanswering/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d8f34ed680f86fc1a624113988e2298846872386 --- /dev/null +++ b/autoeqaautoencodingquestionsforextractivequestionanswering/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f9c78bfefc292dd483d3b0dc55437c00a325c4a75e085322fca576b60c69679b +size 239168 diff --git a/autoeqaautoencodingquestionsforextractivequestionanswering/layout.json b/autoeqaautoencodingquestionsforextractivequestionanswering/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..373c906c4692357cadcc9ab265ba89bda068b138 --- /dev/null +++ b/autoeqaautoencodingquestionsforextractivequestionanswering/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d44a83d9e71ff529a60af7db626cc04d5a6677d111d3785704684c0e5ceaa7b0 +size 210374 diff --git a/automaticbilingualmarkuptransfer/e1413613-43e3-4a75-bd01-0246fdd01fae_content_list.json b/automaticbilingualmarkuptransfer/e1413613-43e3-4a75-bd01-0246fdd01fae_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..036fdce025bc37f49c70306035c5ac7cc4ecc945 --- /dev/null +++ b/automaticbilingualmarkuptransfer/e1413613-43e3-4a75-bd01-0246fdd01fae_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac1575a7ebb0f7e0afb1b1c8aa52e335b11ea4dc433318ffbd1e82a10d1aadb2 +size 69639 diff --git a/automaticbilingualmarkuptransfer/e1413613-43e3-4a75-bd01-0246fdd01fae_model.json b/automaticbilingualmarkuptransfer/e1413613-43e3-4a75-bd01-0246fdd01fae_model.json new file mode 100644 index 0000000000000000000000000000000000000000..5cf6a1e6078b8f22b2ddc7ab69db92d6d2a4d490 --- /dev/null +++ b/automaticbilingualmarkuptransfer/e1413613-43e3-4a75-bd01-0246fdd01fae_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91510e9244ca10606e3ef693bfc2ac20c10bcc0874ec7af2d40a8f22cdfee79a +size 80350 diff --git a/automaticbilingualmarkuptransfer/e1413613-43e3-4a75-bd01-0246fdd01fae_origin.pdf b/automaticbilingualmarkuptransfer/e1413613-43e3-4a75-bd01-0246fdd01fae_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..73747bd0329c7830899d0e4f25e793feceb0a5ee --- /dev/null +++ b/automaticbilingualmarkuptransfer/e1413613-43e3-4a75-bd01-0246fdd01fae_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:efff2dfc01fc5bfd43c5cca2d33f62bc73613b8a281719e6803fceed58475108 +size 320291 diff --git a/automaticbilingualmarkuptransfer/full.md b/automaticbilingualmarkuptransfer/full.md new file mode 100644 index 0000000000000000000000000000000000000000..37ebf03089dedca08f56d262777951456b7f9fe2 --- /dev/null +++ b/automaticbilingualmarkuptransfer/full.md @@ -0,0 +1,283 @@ +# Automatic Bilingual Markup Transfer + +Thomas Zenkel and Joern Wuebker and John DeNero + +Lilt, Inc. + +first_name@lilt.com + +# Abstract + +We describe the task of bilingual markup transfer, which involves placing markup tags from a source sentence into a fixed target translation. This task arises in practice when a human translator generates the target translation without markup, and then the system infers the placement of markup tags. This task contrasts from previous work in which markup transfer is performed jointly with machine translation. We propose two novel metrics and evaluate several approaches based on unsupervised word alignments as well as a supervised neural sequence-to-sequence model. Our best approach achieves an average accuracy of $94.7\%$ across six language pairs, indicating its potential usefulness for real-world localization tasks. + +# 1 Introduction + +Machine translation (MT) has two primary use cases: fully automatic MT and assistance for human translators. Fully automatic translation is used widely by consumers, while professional human translation with machine assistance remains the preferred method for translations that require a guarantee of publication quality. In both use cases, markup of particular spans of the source text that encodes formatting, hyperlinks, and other extralinguistic information must be transferred to corresponding spans of the target translation. Prior work on neural machine translation has focused on the problem of simultaneous translation and markup for the fully automatic use case (Hashimoto et al., 2019). This work describes approaches to the complementary problem for the assistance use case. + +A common and effective workflow for professional translators is to first produce the text of a translation, then transfer markup into this text. This paper describes approaches to automating the second step in this workflow by automatically transferring source markup into a fixed reference translation. This fixed reference may not be preferred + +by a machine translation model, for example because it was written by a human, and therefore the correspondence between source and target may be challenging to infer. In this way, markup transfer is similar to word alignment, which is typically applied to authentic human translations rather than machine translations. Indeed, Hanneman and Dinu (2020) describe an algorithm for using word alignments to perform markup transfer. + +This work contains three novel contributions: + +- An improved algorithm for markup transfer via word alignments; +- A supervised approach to markup transfer, which benefits from word alignments; +- An evaluation methodology and two metrics for comparing approaches to bilingual markup transfer that can be applied to the structured document translation corpus released by Hashimoto et al. (2019). + +In experiments across six language pairs, we find that neural word alignments increase markup transfer accuracy over FastAlign by $5.2\%$ using prior markup transfer methods, our improved transfer algorithm increases accuracy by an additional $7.3\%$ , and our supervised approach further increases accuracy by $9.9\%$ . Our best approach has an average accuracy of $94.7\%$ , compared to a baseline of $72.3\%$ from applying the markup transfer algorithm of Hanneman and Dinu (2020) to word alignments from FastAlign (Dyer et al., 2013). This improved performance indicates potential usefulness in a professional localization setting. NLP practitioners may also benefit from this reliable method of transferring span annotations to new languages. + +# 2 Related Work + +Recent work in neural word alignment has indicated that markup transfer is a downstream task, + +though evaluations of word aligners have not included an explicit evaluation of markup transfer (Garg et al., 2019; Nagata et al., 2020; Jalili Sabet et al., 2020). Experiments in this paper are the first to quantify the amount by which the improved alignment quality of a neural aligner compared to FastAlign also improves markup transfer accuracy. + +Markup can be represented using XML tags (Hashimoto et al., 2019). Previous work describes two approaches to markup transfer for fully automated machine translation, where the goal is to place each XML tag from the source into the target translation in a way that produces well-formed XML. The first approach is to include markup while training the translation model, such that the translation model takes as input a source sentence with XML markup and directly generates a translation that includes XML tags. A translation training set that includes markup can either be created by human translators (Hashimoto et al., 2019) or synthesized by adding markup to an existing unformatted bitext (Hanneman and Dinu, 2020). A translation model that generates both text and markup may prefer an output sequence for which the XML markup is invalid (e.g. there might be an opening tag that is not closed). This problem can be addressed through XML-constrained beam search (Hashimoto et al., 2019). This approach requires training data that contains XML markup. + +The second approach is to train the translation model without markup, separately train a word aligner, and then transfer format using an inference pipeline. After the translation model has generated a text translation, the alignment model aligns the tokens of the source segment to the generated translation. Finally, a deterministic algorithm (labeled Min-Max in Section 4.2) transfers the markup from the source segment into the translation via the word alignments (Hanneman and Dinu, 2020). This approach does not require training data that contains XML markup. + +Past work has not measured markup transfer accuracy directly, because when a system generates both a translation and its markup, the translation differs from the reference by more than just markup. Instead, automatic metrics such as XML accuracy check that all source tags appear in the target and are properly nested. XML-based BLEU splits the translation at every formatting tag both for the reference and the translation and calculates the BLEU score (Papineni et al., 2002) on the resulting sub + +Tags · are · 1 … 2 … awesome /2 ! /1 + +Tags·sind·1… 2… fantastisch /2!/1 + +Figure 1: Two nested tag pairs that have similar tag positions. Tag pair 1 is the parent of tag pair 2. + +segments (Hashimoto et al., 2019). Past work has also included manual evaluation of the transferred markup information (Müller, 2017; Hanneman and Dinu, 2020), since transfer accuracy could not be assessed directly. In contrast, our goal is to transfer markup directly into the reference translation. Evaluation of markup accuracy is therefore straightforward: a tag is placed correctly if it appears at the correct character position within the reference translation. + +# 3 Bilingual Markup Transfer + +In this section we introduce tag pairs, the data structure with which we represent markup information, and define two evaluation metrics. + +# 3.1 Definition + +We represent all markup information as tag pairs. A tag pair contains an opening and a closing tag and spans all characters of the sentence between the character position associated with its opening tag and closing tag. When two tag pairs span the same characters, one encloses the other, as in Figure 1. To indicate nesting order, we say that the enclosed pair has the enclosing pair as its parent. + +Below is a data structure to represent a tag pair: + +```yaml +class TagPair: opening_tag: Tag closing_tag: Tag parent: Optional[TagPair] +``` + +```txt +class Tag: position:int label:str +``` + +Each position describes the number of text characters that appear before the tag in the sentence, not including any other tags. In contrast to the opening tag, the label of a closing tag contains a forward slash (e.g. $\langle$ b $\rangle$ ). There are no self-closing tags in this representation. A TagPair has a parent if there is another TagPair that encloses it. + +# 3.2 Metrics + +The following two metrics1 score a proposed set of tags that are well-formed XML (properly nested with each opening tag closed) in which every source tag pair appears exactly once in the target. + +Let $L$ be the character length of the reference translation. In the following we denote the character position of a tag as $p \in \{0, \dots, L\}$ . We start by matching the reference and hypothesis tags by their label. Therefore, let $\mathcal{T} = \{(p_r, p_h)\} \in \{0, \dots, L\} \times \{0, \dots, L\}$ be the set of tuples of all reference and hypothesis character-level positions, and let $|\mathcal{T}|$ be the number of tags. + +To evaluate the quality of the automatically transferred markup tags, we compare the reference character-level position $p_r$ of each tag in the target sentence with its position in the hypothesis $p_h$ . The tag accuracy metric is the fraction of correctly placed tags: + +$$ +C _ {h} = \left\{\left(p _ {r}, p _ {h}\right) \in \mathcal {T} | p _ {r} = p _ {h} \right\} +$$ + +tag accuracy $= \frac{|C_h|}{|\mathcal{T}|}$ + +This metric is meant to reflect the human effort saved in the assistance use case, as each incorrectly placed tag must be corrected manually. + +However, in some cases there may be multiple reasonable tag placements. An example for such a case is provided in Figure 2. Therefore, another useful metric for markup transfer accuracy is the average character distance between reference and hypothesis tag positions. + +$$ +\text {a v e r a g e} = \frac {\sum_ {\left(p _ {r} , p _ {h}\right) \in \mathcal {T}} \left| p _ {r} - p _ {h} \right|}{\left| \mathcal {T} \right|} +$$ + +Distinction between metrics: The two metrics are designed to evaluate different aspects of the tag placements. + +Tag accuracy checks whether a tag is at exactly the same position as in the reference. The character distance uses the assumption that, if multiple tag placements are correct, the different correct tag placement will oftentimes be close to each other as in the example of Figure 2. Both metrics will + +Figure 2: In the source sentence the German word "Das" is formatted. In the translation formatting either "But this" or "this" are both reasonable options. + +yield a perfect score for reproducing the reference exactly, but for an incorrect placement the character distance gives additional information about the severity of the errors. + +Figure 3 provides an example of this situation. + +# 4 Unsupervised Markup Transfer + +For unsupervised markup transfer, we apply a two-step process. First we use an unsupervised aligner to infer the alignments between source and target subwords. The second step uses a deterministic algorithm to place tag pairs based on these alignments. Two advantages of this unsupervised approach are that it does not require training data with markup, and it can leverage any word aligner. + +# 4.1 Alignments + +An alignment expresses the token-level correspondence between a source sentence and its target translation. Tokens can be words, individual characters or subwords. Our experiments align subwords to minimize alignment error rate (Zenkel et al., 2020). + +Let $s_i$ and $t_j$ represent the $i$ th token in the source sentence and the $j$ th token in its translation, respectively. The number of tokens of the source sentence and its translation are $I$ and $J$ . Additionally, let $A(s_i) \subseteq \{1, \ldots, J\}$ define the alignments of the $i$ th source token to a set of target tokens. + +In this work, we compare the popular FastAlign toolkit (Dyer et al., 2013), a statistical aligner, to a state-of-the-art neural alignment approach described by Zenkel et al. (2020) based on the Transformer architecture. + +# 4.2 Min-Max Tag Pair Projection + +As a baseline markup transfer algorithm we implement the approach described by Hanneman and Dinu (2020), which we call the Min-Max algorithm. Each tag pair in the source sentence spans multiple contiguous source tokens $s_{i'}$ , ..., $s_{i''}$ . To project the start and end tags of the tag pair into the translation, we use the union of the target alignments + +
Reference<b>But this</b> is not what happens.tag accuracyaverage distance
Hypothesis 1But <b>this</b> is not what happens.50.0%2
Hypothesis 2< b >But this is not what happens</ b >.50.0%10
+ +Figure 3: A reference tag placement and two different hypotheses for the sentence “ $\langle \mathrm{b} \rangle \mathrm{Das} \langle \mathrm{b} \rangle$ stimmt nicht!” While both hypotheses have a tag accuracy of $50\%$ , the average distance of the first hypothesis $(4/2 = 2)$ is lower than the average distance of the second one $(20/2 = 10)$ . + +of its spanned source words $L = \bigcup_{i = i'}^{i''}A(s_i)$ . We project the tag pair to the contiguous target span $t_{min(L)},\ldots ,t_{max(L)}$ that contains all target tokens present in the set of target alignments. This method implicitly maintains nesting order. + +# 4.3 Inside-Outside Tag Pair Projection + +The Min-Max approach has the disadvantage that a single incorrect alignment link can lead to a large error in the projected location of the target span. To address this shortcoming, we introduce the Inside-Outside span projection algorithm which is more resilient to spurious alignment links. It works by individually scoring all possible target spans and selecting the span with the highest score. For nested tag pairs, we ensure that nesting order is maintained by projecting the parent first, and restricting the search space of the child to the span of the projected parent pair. + +The Min-Max algorithm can be viewed as a special case of this generalization, where the score for a target span is defined as the total number of alignment links between tokens in the source and the target spans, with a penalty for unaligned words at the boundaries. + +The Inside-Outside span projection algorithm expands this idea by considering alignment links both inside the spans and outside of the spans. The score for each target span is defined as the total number of alignment links inside the source and target spans, plus the number of links outside of the spans. Formally, given a source span $s_{i'}$ , ..., $s_{i''}$ , the score for the target span $t_{j'}$ , ..., $t_{j''}$ is calculated as $s(j', j'') = |L_{in}| + |L_{out}|$ with + +$$ +\begin{array}{l} L _ {i n} = \bigcup_ {i \in \{i ^ {\prime}, \dots , i ^ {\prime \prime} \}} \left\{j \in A (s _ {i}) | j ^ {\prime} \leq j \leq j ^ {\prime \prime} \right\} \\ L _ {o u t} = \bigcup_ {i \notin \{i ^ {\prime}, \dots , i ^ {\prime \prime} \}} \left\{j \in A (s _ {i}) | j < j ^ {\prime} \vee j > j ^ {\prime \prime} \right\} \\ \end{array} +$$ + +The highest scoring target span for a given tag pair can be computed in quadratic time by a straightforward application of dynamic programming. + +# 4.4 Perfect Match Heuristic + +During development of these algorithms we observed that markup tags often span source phrases that appear identically in the target (e.g. "start"), "Default WorkflowUser", "Identity Connect"). We define a tag pair as a perfect match if it spans a phrase in the source that appears exactly once in the target, and both the source and target phrase either span full words or both have a tag placed within words. The second condition is necessary to prevent perfect matches for cases like "We $<\text{b}> \text{all} \ll \text{/b}>$ " and "Wir $<\text{b}> \text{all} \ll \text{/b}>\text{e}>$ . We project tag pairs that span perfect matches by placing the tag around the same phrase in the target segment. + +# 5 Supervised Markup Transfer + +When a bitext annotated with markup is available, it is possible to train a supervised markup transfer system. We implement a sequence-to-sequence model using the Transformer (Vaswani et al., 2017) architecture that learns to generate the target sequence with tags given input of the source with tags and the target without tags. To perform well in this task, the model must learn to copy the target text, infer the correspondence between source and target tokens, and place the tags present in the source text at corresponding positions in the target. + +To encourage the model to learn the correspondence between source and target subwords, we pretrain it for machine translation, translating a source segment without tags into a target without tags. Afterwards, we train the model to project the markup tags into a given target sentence. The input of the model during this stage of training (and during inference) is the source segment with tags, a separator token, and then the target segment without tags. Figure 4 provides an input-output example. + +After training we can project markup tags into the target sentence by searching for the most likely output sequence under the model, which will be a target sentence containing markup. We first consider greedy search. While a well-formed output results most of the time, the model does not always + +Figure 4: Example input and desired output for a sequence-to-sequence supervised markup transfer system. + +generate the same target sentence that appeared in the input. It also does not always reproduce all tags that appeared in the source segment. + +To circumvent these issues, we can constrain the search towards a consistent output. During output sequence generation, we keep track of the text of the produced hypothesis, and constrain the next target token to be either a prefix of the remaining target text or a markup tag. When producing a markup tag, we make sure that only markup tags that appeared in the source segment can be opened, and we track their counts. To enforce a valid tag structure, we ensure that only the most recent opening tag without a corresponding closing tag can be closed. We additionally ensure that all tags appearing in the source are produced in the target exactly once. These constraints can be implemented efficiently using a bias vector that prevents invalid tokens by setting their bias to a large negative value. During every decoding step this bias vector is added to the logits before retrieving the most likely token. + +During development of this model we noticed that the output of the unconstrained search provides a signal about its quality. If unconstrained greedy search does not copy the target text or does not reproduce all tags in a well-formed structure, typically the constrained search produces output with incorrect markup tag positions. Therefore, we evaluate an additional method which uses the output of unconstrained greedy search from the sequence-to-sequence model, but with a fallback to unsupervised markup transfer if either the text or tags of the output are inconsistent with the input—the two failure modes described above. + +# 6 Experimental Setup + +# 6.1 Dataset + +We base our experiments on the multilingual dataset for structured document translation4 described by Hashimoto et al. (2019). This dataset is extracted from the online help of an international enterprise software-as-a-service platform that is localized from English into multiple languages. The + +data is already aligned into segments consisting of one or multiple sentences. These segments contain markup tags that are always consistent between the source segment and its translation, that is the type and number of markup tags is the same across aligned segments. + +The data set is split into a training set consisting of approximately 100k segments, a validation set of 2k segments and an unreleased test set. One fourth of the segments in both the training and validation set contain at least one markup tag. We hold out 1k segments of the training set for early stopping, use the remaining segments for training and the validation set for testing. + +Only a fixed set of 14 different opening and closing markup tags appear in the dataset, each of these tag pairs spanning one or more characters. + +# 6.2 Tokenization + +We use byte pair encoding (BPE) (Sennrich et al., 2016) computed via the SentencePiece toolkit (Kudo, 2018), and follow the setup described by Hashimoto et al. (2019) for subword tokenization. We add all tags and the separator token used for the input of the sequence-to-sequence model as user-defined symbols. In contrast to Hashimoto et al. (2019), we also add all punctuation marks to this set. These symbols will not be split or merged by the SentencePiece toolkit and are always represented as a single token. We learn a joint subword vocabulary of 10k tokens for each language pair and use this tokenization for both the supervised sequence-to-sequence model and the unsupervised alignment systems. Zenkel et al. (2020) showed that subword-level alignment leads to lower alignment error rates than word-level alignment, both for statistical and neural aligners. For the purpose of markup tag transfer, subwords also provide more fine-grained information, for example if a markup tag is used to format a part of a word. Partial word formatting is common for German compound words, for example “Self-Servicesnutzung”. We learn a single SentencePiece model on the concatenated training data including markup tags for both languages of each + +
MethodEnDeEnFiEnFrEnJaEnNlEnZhAvg
FastAlign (Min-Max)75.9%72.9%81.9%42.6%83.9%81.8%72.3%
7.97.25.35.84.01.75.3
FastAlign (Inside-Outside)83.1%80.0%85.5%47.1%89.2%83.8%78.1%
2.73.81.83.21.21.12.3
FastAlign (Inside-Outside + Perfect Match)86.7%82.8%88.9%49.5%91.2%86.3%80.9%
2.43.31.63.01.01.02.1
NeuralAlign (Min-Max)77.4%73.3%83.8%57.8%84.1%88.6%77.5%
10.28.58.85.210.61.47.5
NeuralAlign (Inside-Outside)84.7%81.2%86.3%64.5%90.9%91.4%83.2%
2.32.53.41.31.40.51.9
NeuralAlign (Inside-Outside + Perfect Match)88.2%84.5%87.5%65.0%92.0%91.7%84.8%
1.92.33.41.21.40.51.8
Seq2Seq (Constrained Search)89.6%89.1%91.0%94.5%89.0%95.5%91.5%
15.813.416.13.015.70.710.8
Seq2Seq + NeuralAlign91.6%95.3%95.2%94.1%95.6%96.4%94.7%
2.01.32.10.81.10.21.3
+ +Table 1: Tag accuracy and average distance results on the multilingual dataset for structured document translation. The methods above the double line are not trained using target markup; the methods below do use supervised data. + +language pair.5 + +# 6.3 Unsupervised Markup Transfer: Alignment Systems + +To compare unsupervised statistical and neural aligners, we strip all markup tags from the training and validation data and apply the SentencePiece model to obtain tokenized versions of the data. + +As our statistical system, we use FastAlign (Dyer et al., 2013; Brown et al., 1993) due to its popularity. We concatenate both training and validation data and train the alignment system using its standard settings. + +As our neural alignment system, we generate first-pass alignments and then train a guided alignment model using the generated alignments (Garg et al., 2019). To generate alignments for guided training, we follow Zenkel et al. (2020) and train an alignment layer on top of a Transformer-based machine translation system in the forward and backward direction. We then extract alignments using bidirectional attention optimization. We follow the hyperparameter settings of Zenkel et al. (2020): 6 encoder and 3 decoder layers with a layer dimension of 256. Finally, we train a guided alignment layer on top of the existing translation model in the forward direction. In contrast to Zenkel et al. (2020), we additionally shift the attention by one + +unit to the right using the "SHIFT-ATT" method described by Chen et al. (2020), which resulted in higher quality alignments. We finally generate attention distributions from the guided alignment layer and extract alignments based on the attention. To extract alignments, for each target token we select the source token with the highest attention value as its alignment link. This method, which is commonly used across neural alignment systems (Garg et al., 2019; Zenkel et al., 2019), does not produce any unaligned target tokens and produces more alignment links than FastAlign. + +# 6.4 Supervised Markup Transfer: Sequence-to-Sequence Model + +The sequence-to-sequence markup transfer model also has a transformer architecture with 6 encoder and 3 decoder layers using a embedding size of 256 and 8 attention heads per layer. We first train a translation model on the data with stripped markup tags. We then use this pretrained translation model and continue training to predict the target with tags using the input described in Section 5. + +# 7 Evaluation + +Table 1 shows accuracy and average distance results for all language pairs, discussed below. + +# 7.1 Unsupervised Markup Transfer + +All results labeled FastAlign or NeuralAlign are unsupervised in that they do not use the source or target markup in the corpus during model training. + +# 7.1.1 Effect of Transfer Algorithms + +Using FastAlign, the choice of markup transfer algorithm does impact tag accuracy. The simple Min-Max algorithm gives a tag accuracy of $72.3\%$ and a character distance of 5.3, averaged across all language pairs. English to Chinese achieves the best average distance with 1.7 characters per tag, which is due in part to its segments containing fewer characters compared to target languages with phonetic alphabets. There is substantial variability in tag accuracy across language pairs, ranging from $42.6\%$ (Japanese) to $83.9\%$ (Dutch). + +Compared to the Min-Max algorithm, the Inside-Outside algorithm improves both metrics in all cases. The tag accuracy improves by $5.8\%$ and the character distance per tag reduces by half from 5.3 to 2.3, with the largest gains in German, Finnish, and Dutch. Figure 5 provides an example of a Min-Max projection error that is corrected by Inside-Outside. This example is typical in that a single incorrect link within the source span to a position in the target that is well outside the correct target span will cause a large error in the Min-Max algorithm, but will not cause a similar error for Inside-Outside. + +# 7.1.2 Effect of Alignment Quality + +When using the higher quality neural alignment system, the tag accuracy improves on average by $5\%$ for both markup transfer algorithms. The character distance of the projected tags also decreases for the Inside-Outside algorithm, but increases when using the Min-Max algorithm. We speculate that the lack of null alignments in the neural alignment system makes it more likely that erroneous alignment links are off by a large distance, and so the Inside-Outside algorithm is particularly important for projecting markup with neural aligners. + +# 7.1.3 Perfect Match Heuristic + +To conclude the analysis of unsupervised markup transfer algorithms we analyse the rule-based transfer of markup tags that span "perfect matches". This simple heuristic increases the average tag accuracy consistently across all language pairs by $1.6\%$ for the Inside-Outside algorithm. We analysed this result further for German, French and Chinese. The perfect match heuristic finds 236, + +
EnDeEnFrEnZh
Consistent88.1%87.8%93.4%
Inconsistent Text8.5%9.2%4.1%
Inconsistent Tags6.7%7.0%3.5%
+ +Table 2: Percentage of consistent segments produced by the sequence-to-sequence markup transfer model using unconstrained search and proportion of inconsistencies due to not being able to copy the text or not producing a consistent tag structure. + +242 and 178 perfect matches for these three language pairs, respectively, and failed to match the reference tag in only eight cases across all three languages. These errors were largely due to the reference translation containing both the English and the translated word, e.g. "Clear (Effacer)", and the translator placing the tag around both words. In this case, the perfectMatch heuristic differed from the reference tag position by only spanning the English word "Clear". + +# 7.2 Supervised Markup Transfer + +The supervised approach, Seq2Seq (constrained search), substantially outperforms the best unsupervised approach, increasing average accuracy by $6.7\%$ . We analyse how often the sequence-to-sequence model correctly copies the provided target text and how often it produces a correctly formatted tag structure when using unconstrained greedy search. We focus on German and French as example phonetic languages and Chinese as an example character-based language. For German and French, greedy search produces a consistent output on $88\%$ of the validation segments, and for Chinese on $93.4\%$ . Failure to copy the target text is a slightly more frequent error mode compared to inconsistent tag structure ( $8.5\%$ versus $6.7\%$ for German). The two error modes are not mutually exclusive. Table 2 states the distribution of these errors for these three languages. + +When using constrained search, we force the model to output the correct text and to copy all tags from the source segment. In comparison to unconstrained greedy search, this only changes the segments with inconsistencies and results in an overall tag accuracy of $89.6\%$ , $89.1\%$ and $95.5\%$ , for German, French and Chinese. These results are consistently better than using the best unsupervised system, but the overall results are considerably lower compared to the subset of segments for which greedy search produced a consistent output. + +
SourceTo see if your formula contains errors, click <u>Check Syntax</u>.
Min-MaxKlichen Sie auf <u>Syntax prüfen, um zu sehen, ob</u> die Formel Fehler enthalt.
Inside-OutsideKlichen Sie auf <u>Syntax prüfen</u>, um zu sehen, ob die Formel Fehler enthalt.
+ +Figure 5: Example output of two markup transfer algorithms after FastAlign produced the wrong alignment link "Check"- "ob". While the Inside-Outside algorithm is able to recover and select the correct target span, the MinMax algorithm erroneously selects an excessively large span. The tag is abbreviated with . + +
1.en +jaTo show the available values, leave the <ucontrol> Search for values...</ucontrol> box empty and click <ucontrol> Search </ucontrol>.選択可能な値を表示するには、<ucontrol>[值を検索...]</ucontrol> 業クスを空のまえにし、<ucontrol>[検索]<ucontrol>をケリックします
2.en +jaSet the territory classification policy to <ucontrol> Highest</ucontrol>.テリトリ一分類ボーリusherを [Highest (最高)]に設定いたします。
3.en +jaMake the page the default object record page for specific <ph>Lightning apps</ph>.ipedーを特定の <ph>Lightning アplikaciones</ph>のデ fasルトの才総工クレコeadipedー您可以
+ +Figure 6: Examples for the three patterns we identified in the English-Japanese test set that make word-alignment based tag transfer challenging. In example 3 the highlighted character sequence フリロー constitutes a single subword in the tag-stripped sentence. + +
EnDeEnFrEnZh
Consistent98.6%99.4%98.0%
0.30.10.1
Inconsistent Text53.5%52.9%78.6%
89.599.33.3
Inconsistent Tags36.3%47.7%53.7%
116.4104.010.0
+ +Table 3: Tag accuracy and average distance using constrained search on subsets of segments based on whether unconstrained search produces consistent output. Note that in the "Consistent" case unconstrained and constrained search outputs are identical. + +Table 3 summarizes the tag accuracy on different subsets defined by consistency behavior in unconstrained search. When greedy search correctly outputs the target with a consistent tag structure, its performance is close to perfect, achieving a tag accuracy above $98\%$ and an average character distance below 0.3. When the text is inconsistent, the accuracy drops between $20\%$ and $50\%$ absolute. If the tags are inconsistent in the output of greedy search, constrained search places less than half of the tags correctly across the language pairs. The average distance increases to over 100.0 characters per tag for German and French. This large average difference is due in large part to tag pairs being placed at the very end of the target sentence. + +# 7.3 Manual Error Analysis + +On the English-Japanese data set there is a substantial gap in accuracy between the unsupervised and supervised approaches. A manual analysis identified three common patterns that make this task challenging for word-alignment based techniques. + +1. Tags often span labels of UI elements like buttons, which in Japanese are additionally bracketed. These brackets do not have a correspondence in the English source. +2. Some label names are left untranslated, but with their Japanese translation in brackets. +3. Grammar particles at the end of Japanese words are usually not included in tags, but are not encoded as separate subwords when encoding the target sentence without tags, which makes correct placement through word alignment impossible. + +Examples for these patterns are given in Figure 6. + +# 7.4 Seq2Seq + NeuralAlign + +Finally, we evaluate a simple approach to combining the output of the best unsupervised system with the output of the supervised system. When the greedy search of the sequence-to-sequence model produced a coherent output, we treat it as a signal that its output is of high quality. For these segments we use the output of the greedy search, otherwise + +we use the output of the best unsupervised system. This approach, called Seq2Seq + NeuralAlign in Table 1, leads to both the best accuracy of $94.7\%$ and average character distance of 1.3 character per tag, averaged across all language pairs. The performance gain over Seq2Seq for average distance is particularly large, indicating a substantial reduction in highly misplaced tags. Since the Seq2Seq system does not use word alignments, this improvement in performance is evidence that unsupervised word alignments are indeed useful for the task of bilingual markup transfer, even when supervised examples are available at training time. + +# 8 Conclusion + +We introduced the task of bilingual markup transfer into a fixed reference translation. Using two novel metrics, tag accuracy and average character distance, we evaluated both unsupervised and supervised approaches to this task. Both may be useful, depending on the availability of training examples with markup. Our supervised approach provides higher tag accuracy, but at the expense of higher average character distance. Combining supervised and unsupervised approaches corrects for this problematic behavior and provides a reliable and accurate method for markup transfer. + +# References + +Peter F. Brown, Stephen A. Della Pietra, Vincent J. Della Pietra, and Robert L. Mercer. 1993. The mathematics of statistical machine translation: Parameter estimation. Computational Linguistics, 19(2):263-311. +Yun Chen, Yang Liu, Guanhua Chen, Xin Jiang, and Qun Liu. 2020. Accurate word alignment induction from neural machine translation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 566-576, Online. Association for Computational Linguistics. +Chris Dyer, Victor Chahuneau, and Noah A. Smith. 2013. A simple, fast, and effective reparameterization of IBM model 2. In Proceedings of the 2013 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 644-648, Atlanta, Georgia. Association for Computational Linguistics. +Sarthak Garg, Stephan Peitz, Udhyakumar Nallasamy, and Matthias Paulik. 2019. Jointly learning to align and translate with transformer models. In Proceedings of the 2019 Conference on Empirical Methods + +in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 4453-4462, Hong Kong, China. Association for Computational Linguistics. +Greg Hanneman and Georgiana Dinu. 2020. How should markup tags be translated? In Proceedings of the Fifth Conference on Machine Translation, pages 1160-1173, Online. Association for Computational Linguistics. +Kazuma Hashimoto, Raffaella Buschiazzo, James Bradbury, Teresa Marshall, Richard Socher, and Caiming Xiong. 2019. A high-quality multilingual dataset for structured documentation translation. In Proceedings of the Fourth Conference on Machine Translation (Volume 1: Research Papers), pages 116-127, Florence, Italy. Association for Computational Linguistics. +Masoud Jalili Sabet, Philipp Duffer, François Yvon, and Hinrich Schütze. 2020. SimAlign: High quality word alignments without parallel training data using static and contextualized embeddings. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 1627-1643, Online. Association for Computational Linguistics. +Taku Kudo. 2018. Subword regularization: Improving neural network translation models with multiple subword candidates. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 66-75, Melbourne, Australia. Association for Computational Linguistics. +Mathias Müller. 2017. Treatment of markup in statistical machine translation. In Proceedings of the Third Workshop on Discourse in Machine Translation, pages 36-46, Copenhagen, Denmark. Association for Computational Linguistics. +Masaaki Nagata, Katsuki Chousa, and Masaaki Nishino. 2020. A supervised word alignment method based on cross-language span prediction using multilingual BERT. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 555-565, Online. Association 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 of the Association for Computational Linguistics, pages 311-318, Philadelphia, Pennsylvania, USA. Association for Computational Linguistics. +Rico Sennrich, Barry Haddow, and Alexandra Birch. 2016. Neural machine translation of rare words with subword units. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1715-1725, Berlin, Germany. Association for Computational Linguistics. + +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advances in Neural Information Processing Systems, volume 30. +Thomas Zenkel, Joern Wuebker, and John DeNero. 2019. Adding interpretable attention to neural translation models improves word alignment. arXiv preprint arXiv:1901.11359. +Thomas Zenkel, Joern Wuebker, and John DeNero. 2020. End-to-end neural word alignment outperforms GIZA++. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 1605-1617, Online. Association for Computational Linguistics. \ No newline at end of file diff --git a/automaticbilingualmarkuptransfer/images.zip b/automaticbilingualmarkuptransfer/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..546bf42d1b3b8f0f0b11275663754f8db9652069 --- /dev/null +++ b/automaticbilingualmarkuptransfer/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:42f5209531ce626350e213e0f25ebb2557b73698874b5b268f1c9c3c20267964 +size 336633 diff --git a/automaticbilingualmarkuptransfer/layout.json b/automaticbilingualmarkuptransfer/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..e73b2cdee12d471264750471b7dc84967e7847a1 --- /dev/null +++ b/automaticbilingualmarkuptransfer/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f7a0e508fe900031d3adf2f6f2b066b79d28b6a17a85efef302ceff225d2f483 +size 290175 diff --git a/automaticdiscriminationbetweeninheritedandborrowedlatinwordsinromancelanguages/77036aed-608e-4cd4-9285-a25b1fbf4b1b_content_list.json b/automaticdiscriminationbetweeninheritedandborrowedlatinwordsinromancelanguages/77036aed-608e-4cd4-9285-a25b1fbf4b1b_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..27ee7a67d356167543a351460d254b6208bc56d0 --- /dev/null +++ b/automaticdiscriminationbetweeninheritedandborrowedlatinwordsinromancelanguages/77036aed-608e-4cd4-9285-a25b1fbf4b1b_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5bd8cbd23fdee965a4f2e7943e4c3b33b9651bfc37fab4f9db72aa640559b420 +size 68872 diff --git a/automaticdiscriminationbetweeninheritedandborrowedlatinwordsinromancelanguages/77036aed-608e-4cd4-9285-a25b1fbf4b1b_model.json b/automaticdiscriminationbetweeninheritedandborrowedlatinwordsinromancelanguages/77036aed-608e-4cd4-9285-a25b1fbf4b1b_model.json new file mode 100644 index 0000000000000000000000000000000000000000..3ac8d8e0027cfe08574a0fb00333a2507049b064 --- /dev/null +++ b/automaticdiscriminationbetweeninheritedandborrowedlatinwordsinromancelanguages/77036aed-608e-4cd4-9285-a25b1fbf4b1b_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d4055d07ba85e27c0a0ccba48e9668e3ab2aefaa8341a21b3f6f479c2977bbc6 +size 82580 diff --git a/automaticdiscriminationbetweeninheritedandborrowedlatinwordsinromancelanguages/77036aed-608e-4cd4-9285-a25b1fbf4b1b_origin.pdf b/automaticdiscriminationbetweeninheritedandborrowedlatinwordsinromancelanguages/77036aed-608e-4cd4-9285-a25b1fbf4b1b_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..dde14565ce5a1d8340ac5044b8cae16d3699988a --- /dev/null +++ b/automaticdiscriminationbetweeninheritedandborrowedlatinwordsinromancelanguages/77036aed-608e-4cd4-9285-a25b1fbf4b1b_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:03a71ee55dcee9e905b4d7f6ec989373e7aa3136fe4721ee0c8f106a252f96ef +size 329185 diff --git a/automaticdiscriminationbetweeninheritedandborrowedlatinwordsinromancelanguages/full.md b/automaticdiscriminationbetweeninheritedandborrowedlatinwordsinromancelanguages/full.md new file mode 100644 index 0000000000000000000000000000000000000000..29709fe0ac58af17fbd984400b6debd397c1121f --- /dev/null +++ b/automaticdiscriminationbetweeninheritedandborrowedlatinwordsinromancelanguages/full.md @@ -0,0 +1,234 @@ +# Automatic Discrimination between Inherited and Borrowed Latin Words in Romance Languages + +Alina Maria Cristea, Liviu P. Dinu, Simona Georgescu, Mihnea-Lucian Mihai, Ana Sabina Uban + +University of Bucharest + +alina.cristea@fmi.unibuc.ro, ldinu@fmi.unibuc.ro, simona.georgescu@lls.unibuc.ro, + +mihnea.mihai@gmx.com, ana.uban+acad@gmail.com + +# Abstract + +In this paper, we address the problem of automatically discriminating between inherited and borrowed Latin words. We introduce a new dataset and investigate the case of Romance languages (Romanian, Italian, French, Spanish, Portuguese and Catalan), where words directly inherited from Latin coexist with words borrowed from Latin, and explore whether automatic discrimination between them is possible. Having entered the language at a later stage, borrowed words are no longer subject to historical sound shift rules, hence they are presumably less eroded, which is why we expect them to have a different intrinsic structure distinguishable by computational means. We employ several machine learning models to automatically discriminate between inherited and borrowed words and compare their performance with various feature sets. We analyze the models' predictive power on two versions of the datasets, orthographic and phonetic. We also investigate whether prior knowledge of the etymon provides better results, employing n-gram character features extracted from the word-etymon pairs and from their alignment. + +# 1 Introduction and Related Work + +"When a foreign word falls by accident into the fountain of a language, it will get driven around in there until it takes on that language's colour." + +— Jakob Grimm; cited by Campbell (1998) + +All the world's languages are subjected to contact-induced linguistic change (Chamoreau and Léglise, 2012; Grant, 2020). A base assumption of historical linguistics (HL) is that the sound changes throughout a language's evolution were systemic in nature and produced relatively predictable results. For a long time, this hypothesis has been mainly investigated with comparative linguistics methods + +(Meillet, 1925; Campbell, 1998), which required a lot of manual work and extensive knowledge, and enabled significant advances in many languages. + +The last decades have brought a series of computational approaches to many topics of HL, such as the problem of automatically identifying cognate pairs (Kondrak, 2001; Mulloni and Pekar, 2006; Ciobanu and Dinu, 2014; List et al., 2017; List, 2019; Heggarty, 2021), reconstructing protowords (Oakes, 2000; Bouchard-Coté et al., 2009; Ciobanu and Dinu, 2018; Meloni et al., 2019), predicting etymology (Wu and Yarowsky, 2020), discriminating between cognates and borrowings (Ciobanu and Dinu, 2015; Tsvetkov et al., 2015) or identifying lexical borrowings in a language (Miller et al., 2020; Koo, 2015). + +Identifying lexical borrowings is considered one of the most difficult and important problems in HL (Carling et al., 2019; Jäger, 2019), for which "the computerised approach" is regarded as the appropriate solution even by classical linguists (Heggarty, 2012). Besides the classical distinction between borrowed words and cognates, another important problem in HL is discriminating between inherited and borrowed words (Campbell, 1998). + +We shall approach the distinction between inherited and borrowed Latin words in the Romance languages (Romanian, Italian, French, Catalan, Spanish and Portuguese), with the aim of investigating whether we can automatically discriminate between the two categories, defined as follows: + +- Inherited words: lexemes that have been preserved from the mother tongue in the vernacular languages by uninterrupted oral usage, taking thus part in the process of language formation; in the case of the Romance languages, we can only speak of inherited words when referring to Latin lexemes that have been part of their vocabulary ever since their “birth” (an outcome of the diversification of + +
CatalanFrenchItalianSpanishPortugueseRomanian
Inheriteddretdroitdrittoderechodireitodrept
Borroweddirectdirectdiretrodirectodiretodirect
+ +Table 1: A Latin word - directus (meaning right/direct) - both inherited and borrowed in all six Romance languages. + +Latin, that had already started in the Roman period – i.e. before the 5th century AD (cf. Lausberg (1969); Adams (2007)); + +- Borrowed words (also known as 'loanwords'): lexical items that have been adopted in language A from language B after the language A had completed its formation period (cf. Reinheimer Ripeanu (2001)); we shall thus speak of Latin borrowings when referring to those words that, still being of Latin origin, have penetrated the Romance languages in a later period, most of them not before the 12th century AD. + +There is a considerable number of cases where the same Latin word has been both inherited and borrowed. For instance, Ro. drept (meaning right), It. dritto, Fr. droit, Ca. dret, Es. derecho, Pt. direito are all inherited from Lat. directus. On the other hand, Ro. direct (meaning direct), It. diretto, Fr. direct, Ca. direct, Es. directo, Pt. directo have been borrowed from the same etymon, Lat. directus, in a period that varies from the 13th century for French, to the 19th century for Romanian (see Table 1). Most of the Latin borrowings are the effect of the so-called "relatinization" of Romance languages (starting as early as the 13th century in Western Europe): in this case, the relation between the Romance languages and Latin - as a non-contemporary source of lexical enrichment - does not count as genetic, but artificial, resulting in learned words (cf. (Reinheimer Ripeanu, 2004)). + +Given the twofold relationship between Latin and the Romance languages, it is not always easy to distinguish between an inherited and a borrowed word by using only the classical methods, and the disputes between linguists increase proportionally with the uncertain cases. The importance of this subject is manifold, having implications in important HL research problems such as protolanguage reconstruction, word dating (Campbell, 1998, pp. 299, 315, 328), or socio-cultural reconstruction (Epps, 2014). + +Firstly, while we try to reconstruct a protolanguage - in this case, Protoromance -, it is essen + +tial to compare only the inherited words that form an etymological series (knows as 'real cognates'), putting aside all the borrowings (or 'virtual cognates') that may interfere and thus lead to a false protoword reconstruction. + +Secondly, the distinction between inherited and borrowed words can facilitate the process of word dating, by automatically placing a lexeme among the ones that were part of a certain Romance language lexicon from the very beginning or among the lexical items that penetrated in a later period. + +From a socio-cultural point of view, a word's status can shed light on the speakers' conceptual universe, by allowing us to reconstruct their everyday talk: a word is inherited only if the concept it verbalizes is needed, and it is not borrowed unless at some point the concept becomes necessary. Thus, by carefully separating between these categories, we find evidence of what topics concerned people at certain points in time. + +Although linguists have successfully applied the comparative method to build classifications – to distinguish between "internal and external change" (Pat-El, 2013) – there is a fine line between the two categories and we consider that a computational method could aid in better predicting the expected classification of a term given its intrinsic structure. Since the unique application of the traditional methods has still left many uncertainties concerning the status of Romance words (easily noticeable in the Romance dictionaries), we investigate whether by applying machine learning algorithms to this problem the distinction between the two categories becomes more easily detectable. + +The research shows that there is an inherent distinction between inherited and borrowed Latin words. Further introspection of the models reveals relevant features which provide useful information to linguists. The tools could be used for parallel investigations in different linguistic families, by automatically showing which category a given word "fits" better. + +# 2 Methodology + +Borrowings from Latin are supposedly easily recognized because they are presented in forms close to the Latin form in all Romance languages. For example, Lat. attestationem (meaning testimony/certification) became attestazione (It.), attestation (Fr.), atestacio (Ca.), atestacion (Es.), atestacao (Pt.); Lat. auctor (meaning author) became autore (It.), auteur (Fr.), autor (Es., Pt.); Lat. cultura (meaning culture) became cultura (It., Es., Pt.), culture (Fr.). + +There are formal differences between inherited and borrowed words from Latin: the inherited lexemes have undergone an evolutionary process that has changed their phonetic appearance (e.g. Lat. noctem (meaning night) > Ro. noapte, Fr. nuit, Sp.:noche), while the borrowed words are generally only adapted to the Romance languages' system (cf. Reinheimer Ripeanu (2001)). Having entered the language at a later stage, borrowings are presumably less eroded and thus consistently exhibit different phonetic features, which is why we expect them to have a different intrinsic structure distinguishable by computational means. As previously discussed, in Table 1 we give an example of a Latin word both inherited and later borrowed in all Romance languages, where it can be noticed that the borrowed terms more closely resemble the original. + +From a morphological point of view, one cannot reveal systematic distinct features that characterize the inherited words versus the borrowed ones. The Romance nouns' form – be they inherited or borrowed – is, in the great majority of cases, based on the accusative-ablative structure of the Latin word: for instance, both Es. razón (inherited, meaning reason) and Es. ración (borrowed, meaning portion) are originated in the Latin accusative-ablative ratione(m) (meaning calculation/proportion). It is true, though, that in a few cases of borrowing the adoption of the nominative form results in the presence of word endings that are not attested in inherited words: e.g. -o in French (écho, lumbago), -i in Italian for feminine singular nouns (e.g. aferesi, crisi), or -u in Spanish (e.g. espíritu, impetu). + +Given that the phonetic form is the interface that we shall mainly consider in our attempt to automatically distinguish between inherited and borrowed words, we need to make a preliminary statement concerning the relation between orthography and pronunciation in the studied languages. Among the Romance idioms, only French has a deep orthog- + +raphy and the most conservative spelling system, while the others use a phonemic orthography. Although all the Romance languages have preserved certain orthographic traits that, far from reflecting the current pronunciation, encode historical features, French is the only language where this characteristic is general and defining. Consequently, for an accurate result we must compare both the actual phonetic transcription and the approximation of phonetic structure by orthography. + +To approach our research question, we apply various machine learning models in two scenarios: in the first one we are looking only at the surface forms of inherited and borrowed words, without any other helpful supplementary information, and in the second one we have access to the etymon of the modern Romance words as well. + +# 2.1 Algorithms + +We experiment with several machine learning algorithms for the binary classification task of discriminating between inherited and borrowed Latin words: Random Forests (RF), Gradient Boosting (GB), Multi-layered Perceptron (MLP), XGBoost, Recursive Neural Networks (RNN) and Support Vector Machines (SVM). For SVM we used the radial basis function kernel (RBF), which maps samples non-linearly into a higher dimensional space, being thus able to handle the case when the relation between class labels and attributes is non-linear. Given two instances $x_{i}$ and $x_{j}$ , where $x_{i,j} \in \mathbb{R}^{n}$ , the RBF kernel function for $x_{i}$ and $x_{j}$ is defined as follows: + +$$ +K (x _ {i}, x _ {j}) = e x p (- \gamma | | x _ {i} - x _ {j} | | ^ {2}), \gamma > 0, +$$ + +where $\gamma$ is a kernel parameter. The RNN model is a character-level BiLSTM with attention with 32 units, where input characters are encoded with embedding layer of 16 units. We use dropout (with 0.1 probability) for regularization, and a learning rate of 0.005. We put our system together using several machine learning frameworks: Weka (Hall et al., 2009), Scikit-learn (Pedregosa et al., 2011), TensorFlow (Abadi et al., 2015) and Keras (Chollet et al., 2015). We split the data in two stratified subsets, for training and testing, with a 3:1 ratio, and we perform grid search and 3-fold cross validation over the training set in order to optimize hyper-parameters. + +# 2.2 Features + +For the first experiment, we use as input only the modern word forms, without knowledge of the Latin etymon. In this case, we use n-gram features (character n-grams with $n \in \{1, 2, 3\}$ ).1 We mark the beginning and the end of the words with a special character $. For the second experiment, we include the Latin etymon in the input data, along with the modern word forms in Romance languages. We experiment with n-gram features extracted around mismatches in the aligned pairs (Ciobanu and Dinu, 2019), using the Needleman and Wunsch (1970) alignment algorithm. In case of multiple alignments with equal scores, we choose the first one. We also use the edit distance (Levenshtein, 1965) between the words and their etymons as an additional feature. In Figure 1 we provide a workflow example for obtaining n-gram features for the Spanish word sacudir (meaning to shake off) inherited from the Latin word succutere. With this approach, the system could capture transformations that occur much more often in inherited words than in borrowed words (such as letter $t$ from Latin becoming $d$ in Spanish) or the reduction of double consonants (such as $cc$ from Latin becoming $c$ in Spanish). + +In addition, we apply a set of diachronic general features that characterize the sound evolution of inherited words in the Romance languages. We focused on the consonant shifts that can be defined as "sound laws" in the transition from Latin to the Romance languages, leaving aside the vowel behavior, which includes a larger number of variables difficult to systematize. + +We synthesize the consonant shifts by treating them as part of a general process of lenition ("weakening"), which overarchs most of the particular "sound laws" identifiable in the different Romance languages. The opposite process, of fortition, is much less frequent in the Romance languages and cannot be circumscribed to certain phonetic contexts. Intervocalic consonants (or consonant $+R$ ) are prone to undergo a process of lenition, materialized as a transition from a stronger articulation to a weaker one; their recurrent trajectory can thus be defined as: voiceless occlusive $(p/t/k) \rightarrow$ voiced occlusive $(b/d/g) \rightarrow$ voiceless affricate $(ts/tS) \rightarrow$ voiced affricate $(dz/dZ) \rightarrow$ voiceless fricative (e.g. $f, s) \rightarrow$ voiced fricative (e.g. $v, z) \rightarrow$ glide $(w, j)$ + +→ disappearance; it goes without saying that it is not necessary for a consonant to go through all the stages involved by the process of lenition, easily skipping steps: e.g. $p \rightarrow b \rightarrow \nu$ , cf. Lat. ripa (meaning bank) > Es. riba // Fr. rive; Lat. capra > Es. cabra // Fr. chèvre. The weakening process can involve the loss of the original place of articulation, leading to palatalization (the change into a palatal sound) and assibilization (the change into a sibilant): e.g. $k \rightarrow t\mathfrak{f}(\rightarrow \mathfrak{f})$ , cf. Lat. caput (meaning head) > Fr. chef [ʃef] // $k \rightarrow ts \rightarrow s$ , cf. Lat. caelum [kelum] (meaning sky) > Fr. ciel [siel]. The lenition process includes as well the simplification of geminate consonants: e.g. $pp \rightarrow p$ , Lat. cuppa (meaning cask) > Ro. cupă, Es. copa. The consonant shifts are represented in Table 2. + +Taking this general recurrent trajectory as a starting point, we extract all possible particular sound shifts and encoded them as binary features with 0/1 values denoting their presence or absence in the input words. + +![](images/5ccf141d2fc34433a30d6376702d74f43b6ae118de53576d74da94a1d1082e5d.jpg) +Figure 1: An example for obtaining n-gram features $(n\in \{1,2,3\})$ for the Spanish word sacudir (meaning to shake off) inherited from the Latin word succutere. Highlighted in red are transformations that occur much more often in inherited words than in borrowed words and might have high discriminative power. + +
FORTIS——»»»»»»LENIS
Voiceless occlusivesVoiced occlusivesVoiceless affricatesVoiced affricatesVoiceless fricativesVoiced fricativesNasalsLiquidsGlides
pbfvβmw
tdtsdzsznlλ
θδ
nr
kgh
n velarj
3
+ +# 2.3 Phonetic Transcriptions + +We obtain automatic phonetic transcriptions for all datasets using the eSpeak NG $^2$ library. This tool employs a mainly rule-based approach with lookup enrichment for exceptions and annotations, and has been successfully used in previous historical linguistics applications. + +Since we make use of phonetic transcriptions for the Romance languages, we consider that a similar processing of the Latin data would be appropriate. Using the comparative method, linguists were able to very reliably define the phonetic representation of Latin. It is proved that the written variety of Latin, used in the majority of etymological works, sometimes obscures the phonetic form of words – that is, the one that is truly inherited –, as well as the true relation between Romance cognates (real vs. virtual). On the contrary, since the Romance languages come from the spoken (oral) Latin language and not from the classical one as registered by dictionaries, it is preferable for our investigation to take as a starting point the phonetic representation of Latin. This method was also adopted by the Romance etymological dictionary, Dictionnaire Étymologique Roman.3 + +# 3 Experiments + +In this section we describe and discuss experiments on automatically discriminating between inherited and borrowed Latin words. + +Table 2: Consonant shifts: "sound laws" in the transition from Latin to the Romance languages. + +
DataLanguageFeatures
WikiCatalanió ci 6$ $i ll ac ic ia ct di
Frenchou io ti at $i st on ch ic ré
Italianzi ne on az io ul $i si cl pl
Portugueseça lh ic ia ul ei ha nh cião
Spanishió ci on n$ ic $i ac ll ct ul
Romanianti en on it $e il ie an $i ân
DEXRomanianân $i on it il en ti în i$ $e
+ +Table 3: Most informative bi-gram features (highest entropy) for each dataset and language. + +# 3.1 Data + +We extract datasets of inherited and borrowed words from Wiktionary, which provides Wikitext templates that systematically specify etymological information, taking into account the original inherited word forms as well (for example, accusative Latin structures instead of the dictionary nominative forms). We capture etymons using regular expressions and, scraping the latest database version, we obtain datasets for all six Romance + +
DataLanguageSizeAvg word lengthAvg word-etymon dist
inherited | borrowed | allinherited | borrowed | allinherited | borrowed | all
WikiCatalan1,5368892,4255.367.426.120.460.280.39
French2,0032,3674,3705.917.876.970.540.310.42
Italian3,0871,5854,6726.748.007.170.380.280.34
Portuguese1,9721,6723,6445.777.486.550.480.310.40
Spanish2,2831,7954,0786.077.716.800.500.290.40
Romanian2,1048592,9635.607.166.050.560.280.48
DEXRomanian1,3974,6316,0285.397.697.160.480.250.30
+ +languages investigated. Additionally, for Romanian we also prepare a comprehensive and accurate dataset extracted from the digitalized version of the language's most reputed dictionary DEX, $^{5}$ taking advantage of structural regularities used in the etymology section. We use two versions of the dataset – one raw and another one with several linguistically-motivated edits. $^{6}$ In Table 3 we report the most informative bigram features for each language (obtained based on entropy) and in Table 4 we provide a characterization of the extracted datasets, which we make available publicly. $^{7}$ + +The datasets do not include information about the time of borrowing. The borrowed words are not likely to show very different characteristics even if borrowed at different times, but this also depends on the language: a word that was borrowed in French in the 13th century has undergone more sound shifts than another word borrowed in the 20th century. On the other hand, a Latin word borrowed in Spanish in the 13th century did not experience severe phonetic changes, because most of the "sound laws" specific to Spanish had already ended their active period by that time. The significant phonetic changes in the the Romance languages had mostly taken place before Latin borrowings started entering their lexicons, the "relatinization" process coinciding with the official attempts to normalize the vernacular languages. Once standardized, the Romance languages slowed down the process of + +change, thus preventing the newly borrowed Latin words to undergo a noteworthy formal evolution. For Spanish, to give an example, one cannot identify any systematic formal features that would allow us to distinguish between earlier and later borrowings from Latin. + +# 3.2 Baselines + +We compare our results with two baselines: a majority class baseline that always predicts the most frequent label (accounting, thus, for the class imbalance) and a more informed baseline – a decision tree classifier with only one node that uses the edit distance between the modern word and its etymon + +Table 4: Dataset characterization: distribution of inherited and borrowed words, average word length and average normalized edit distance between modern words and their etymons. Values are computed only on the training subset and are reported in the following format: inherited | borrowed | all (total). + +
DataLanguageB1B2
WikiItalian (ort)66.065.3
Italian (phon)66.065.3
Portuguese (ort)54.169.0
Portuguese (phon)54.162.6
Catalan (ort)63.369.0
Catalan (phon)63.362.6
Spanish (ort)55.973.4
Spanish (phon)55.957.2
French (ort)54.180.3
French (phon)54.170.2
Romanian (ort)70.981.2
Romanian (phon)70.970.8
DEXRo (raw, ort)76.784.1
Ro (raw, phon)76.776.7
Ro (edit, ort)76.779.7
Ro (edit, phon)76.776.7
+ +Table 5: Baselines accuracy for discriminating between inherited and borrowed words. + +
DataLanguageRFGBSVMRNNSVM (+ etymons)
F1AccF1AccF1AccF1AccF1Acc
WikiItalian (ort)81.382.281.982.684.584.983.884.286.086.0
Italian (phon)81.782.581.882.281.382.180.080.385.986.0*
Portuguese (ort)82.282.384.384.484.684.781.781.785.785.6
Portuguese (phon)84.985.086.086.083.183.282.082.086.286.2*
Catalan (ort)84.485.184.284.886.186.483.483.391.791.7*
Catalan (phon)84.284.885.285.686.086.386.186.389.489.5*
Spanish (ort)83.984.183.683.786.286.280.980.988.588.4*
Spanish (phon)82.882.982.882.886.186.179.079.087.987.9*
French (ort)87.987.087.687.688.387.686.486.591.090.9*
French (phon)83.783.785.985.986.886.784.084.090.890.8*
Romanian (ort)87.388.187.888.289.389.683.084.490.590.6
Romanian (phon)89.089.686.987.590.290.486.687.090.890.9
DEXRomanian (raw, ort)90.791.191.091.391.691.690.990.193.693.6*
Romanian (raw, phon)90.490.791.391.592.192.192.592.694.094.0*
Romanian (edit, ort)90.390.791.091.292.192.092.292.392.992.9
Romanian (edit, phon)90.590.891.691.892.292.295.295.293.593.5
+ +Table 6: Results for automatic discrimination between inherited and borrowed Latin words (orthographic -ort, and phonetic -phon). The last column represents SVM results using features extracted from the word-eymon pairs. We marked with * accuracy results for which the difference to SVM without etymons is statistically significant (99% confidence level, performed on 10,000 iterations of bootstrap resampling (Koehn, 2004)). + +as single feature. The latter baseline is motivated by the observation (reported in Table 4 on the training subset) that borrowings are generally closer to the form of their etymon than inherited words. + +# 3.3 Results + +In Table 5 we report the results of the two baselines. The more informed baseline (B2) outperforms the majority class baseline (B1) in most cases. In Table 6 columns "RF", "GB", "RNN", "SVM" we report the results of our systems in the first scenario - using only the surface forms of the modern Romance words as input. We report results on Wiktionary datasets for six Romance languages and on the additional DEX dataset for Romanian for two versions of each dataset - orthographic and phonetic. We measure the performance of the models with the accuracy and weighted average F1 values (that is, the average is weighted by the number of true instances for each class, taking thus the class imbalance into account). + +Comparing results from Table 5 and Table 6, we + +observe that the proposed systems outperform both baselines significantly, obtaining an increase of up to $\sim 36$ percentage points over the first one, and up to $\sim 20$ percentage points over the second one. + +The best results are obtained by SVM in most cases. The high performance (F1 between 84.5 and 92.1 at orthographic level and between 81.3 and 92.2 at phonetic level) shows that there are discriminating features that can be learned automatically. We attribute the lower results of the RNN compared to some of the other models on the Wiktionary data to the insufficient data size compared to the model's complexity. A similar RNN architecture was previously used by Miller et al. (2020) for identifying lexical borrowings in monolingual wordlists. In their setup, RNN was reported to perform best, while in our setting RNN was, in most cases, outperformed by the SVM system using features extracted from the etymons. + +For the most part, the results at phonetic and orthographic level are comparable. The best results (in F1 terms) on Wiktionary data are obtained for Catalan, followed by French, Romanian, Spanish, Portuguese, and Italian. As a general observation, the inherited words are classified better than the + +![](images/bbee1a0c684ae43d1dcc80921d47fbd69a105041f059460ce36b9708fc88adbb.jpg) +Figure 2: Accuracy for discriminating between inherited and borrowed words on balanced subsets of equal size for all languages, for the best performing system, SVM (+ etymons). + +borrowed words. $^{9}$ We do not consider this to be caused by the unbalanced datasets (more training material available for inherited words), because an additional experiment with equal training/test data sizes across all languages exhibited the same behavior. Moreover, this is not the case for French, where we have more borrowings than inherited words in the dataset, but the accuracy is still better for the inherited words. The accuracy obtained for equal subsets (850 borrowings and 850 inherited words, split for training/test with a 3:1 ratio) is reported in Figure 2. We observe that, for some languages, the results with orthographic forms are better than with phonetic forms. The orthography tends to be conservative, which allows an easier confrontation between the Romance lexemes and their etymons, hence a better automatic interpretation of the sound evolution. At the same time, the orthographic form facilitates the direct observation of the degree of proximity between the etymon and its Romance descendants, thus allowing its inclusion in the right category. The phonetic form can sometimes distort its automatic interpretation, as the pronunciation is always ahead of the orthography, and can, not infrequently, coincide with the result of the sound laws that intervened in the evolution of the inherited form. + +In Table 6 column "SVM (+ etymons)" we report the results of our best-performing system in the second scenario - using the {word, etymon} pairs as input (F1 between 85.7 and 93.6 at orthographic level and between 85.9 and 93.5 at phonetic level). We have experimented with different combinations of features (described in Section 2.2) + +![](images/8bf0dd8a6fdc3c32c344e580faae61a3a4871df86d2c15d1fa1cfcae99f9e623.jpg) +Figure 3: Accuracy for discriminating between inherited and borrowed words: SVM, RNN, SVM (+ etymons). + +and we report here the best performing combination, which includes all features: n-grams extracted from the modern words, n-grams extracted from the alignment of the words and their etymons, the edit distance and the linguistic features regarding consonant shifts. We report results on DEX for Romanian with and without linguistically-motivated edits, and both versions in orthographic and phonetic form. The top 3 performing systems are also represented in Figure 3, for a better visualisation. This setup outperforms our previous results for all datasets except for DEX phonetic form, with linguistic edits. Introducing the etymons in the input data lead to a performance increase of $\sim 2$ percentage points, which was further slightly improved by the linguistic edits. Taking a closer look at the misclassified instances (see Figure 4) we observe that, overall, the edit distance between the misclassified borrowed words and their etymons does not differ significantly from the edit distance be + +tween the misclassified inherited words and their etymons. The difference in edit distance between correctly classified inherited and borrowed words is not significant either. + +![](images/066105b442d9f4ed70fe36f0de8f2040358e985884caf1c24f6e7f349d45149b.jpg) +Figure 4: Normalized edit distance between words and their etymons for misclassified instances. + +# 3.4 Error Analysis + +Upon examining the predictions from the held-out test sets, we are able to identify three underlying error sources. + +Lack of distinguishing information: Some words are simply not characterised by distinguishing features. While specific discriminative features exist for both classes, it is not guaranteed that each and every test sample will exhibit any such feature. For example, the Romanian term suc (meaning juice; misclassified by our model as inherited) is actually borrowed from Latin succus via the French suc. However, had succus descended directly from Latin, the result according to the comparative method would still have been suc, which shows the limitations of a purely phonetic-based model. + +Influence of existing words on borrowings (so-called semi-learned borrowings): A significant number of Latinate borrowings in Romance languages have been artificially influenced by already existing terms inherited from the same Latin root. As such, they phonetically resemble an inherited word despite not being actually inherited. Our model misclassified French discourir (meaning to discourse/talk) as inherited (although it is borrowed from the Latin discurree) because it was heavily adapted according to the inherited courir $<$ currere. Another example of phonetic assimilation is the Romanian word demn (meaning dignified; mis + +classified as inherited although it is borrowed from the Latin dignus), because its phonetic form was heavily altered under the pressure of other inherited roots such as semn $<$ signum (meaning sign) or lemn $<$ lignum (meaning wood). This influence simulates the term having suffered the same diachronic sound shifts although it was not present in the language at that time. + +Disputed etymologies: Our model classified the Spanish term clavo (meaning nail) as borrowed, although it is directly inherited from the Latin clavus. This mistake is actually not a fully detrimental trait of the model, because it proves the model learned expected phonetic behaviour, as linguists themselves struggled to explain why the initial consonant cluster $cl-$ failed to shift into $ll-$ as is usually the case with inherited Spanish words. + +# 4 Conclusions + +In this paper we have analyzed the automatic discrimination between inherited and borrowed Latin words in Romance languages, both in orthographic and phonetic form. We have obtained an average F1 over all languages $\sim 90\%$ at orthographic level. We have built a dataset of inherited and borrowed Latin words from two sources (Wiktionary and DEX) in multiple Romance language (Catalan, French, Italian, Portuguese, Romanian, Spanish). We have augmented the data with features provided by linguists in order to increase the system's performance, based on the idea that the optimal approach to computational historical linguistics is to combine the experience and intuitions of linguists with the intelligent processing and automation capabilities of computational tools. + +# Ethics Statement + +All our data are extracted from publicly available sources. There are no ethical issues in our work. + +# Acknowledgments + +We would like to thank the reviewers for their helpful comments. All authors contributed equally to this work. This research is supported by a grant of the Ministry of Research, Innovation and Digitization, CNCS/CCCDI UEFISCDI, project number 108, COTOHILI, within PNCDI III. + +# References + +Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, 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, Dandelion Mane, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. 2015. TensorFlow: Large-scale machine learning on heterogeneous systems. Software available from tensorflow.org. +James Noel Adams. 2007. The regional diversification of Latin 200 BC - AD 600. Cambridge University Press. +Alexandre Bouchard-Côté, Thomas L. Griffiths, and Dan Klein. 2009. Improved Reconstruction of Protolanguage Word Forms. In Proceedings of NAACL 2007, volume 7, pages 65-73. +Lyle Campbell. 1998. *Historical Linguistics*. An Introduction. MIT Press. +Gerd Carling, Sandra Cronhamn, Robert Farren, Elnur Aliyev, and Johan Frid. 2019. The causality of borrowing: Lexical loans in eurasian languages. PLOS ONE, 14(10):1-33. +Claudine Chamoreau and Isabelle Léglise. 2012. A multi-model approach to contact-induced language change, pages 1-16. De Gruyter Mouton. +François Chollet et al. 2015. Keras. +Alina Maria Ciobanu and Liviu P. Dinu. 2014. Automatic Detection of Cognates Using Orthographic Alignment. In Proceedings of ACL 2014, Volume 2: Short Papers, pages 99-105. +Alina Maria Ciobanu and Liviu P. Dinu. 2015. Automatic Discrimination between Cognates and Borrowings. In Proceedings of ACL 2015, Volume 2: Short Papers, pages 431-437. +Alina Maria Ciobanu and Liviu P. Dinu. 2018. Ab initio: Automatic latin proto-word reconstruction. In Proceedings of the 27th International Conference on Computational Linguistics, COLING 2018, Santa Fe, New Mexico, USA, August 20-26, 2018, pages 1604-1614. Association for Computational Linguistics. +Alina Maria Ciobanu and Liviu P. Dinu. 2019. Automatic identification and production of related words for historical linguistics. Computational Linguistics, 45(4):667-704. + +P. Epps. 2014. Historical linguistics and socio-cultural reconstruction. In *The Routledge Handbook of Historical Linguistics*, pages 579-597. London: Routledge. +Anthony P. Grant. 2020. Contact-Induced Linguistic Change: An Introduction. In *The Oxford Handbook of Language Contact*. Oxford University Press. +Mark Hall, Eibe Frank, Geoffrey Holmes, Bernhard Pfahringer, Peter Reutemann, and Ian H. Witten. 2009. The WEKA data mining software: an update. SIGKDD Explorations, 11(1):10-18. +Paul Heggarty. 2012. Beyond Lexicostatistics: How to Get More out of "Word List" Comparisons. In Quantitative Approaches to Linguistic Diversity: Commemorating the Centenary of the Birth of Morris Swadesh, pages 113-137. Benjamins. +Paul Heggarty. 2021. Cognacy databases and phylogenetic research on Indo-european. Annual Review of Linguistics, 7(1):371-394. +Gerhard Jäger. 2019. Computational Historical Linguistics. Theoretical Linguistics | Volume 45: Issue 3-4, 45: Issue 3-4. +Philipp Koehn. 2004. Statistical Significance Tests for Machine Translation Evaluation. In Proceedings of the Conference on Empirical Methods in Natural Language Processing, pages 388-395. +Grzegorz Kondrak. 2001. Identifying Cognates by Phonetic and Semantic Similarity. In NAACL. +Hahn Koo. 2015. An unsupervised method for identifying loanwords in korean. Lang. Resour. Evaluation, 49(2):355-373. +Heinrich Lausberg. 1969. Romanische Sprachwissenschaft, 3-vol. Berlin, De Gruyter. +Vladimir I. Levenshtein. 1965. Binary Codes Capable of Correcting Deletions, Insertions, and Reversals. Soviet Physics Doklady, 10:707-710. +Johann-Mattis List. 2019. Automatic Inference of Sound Correspondence Patterns across Multiple Languages. Computational Linguistics, 45(1):137-161. +Johann-Mattis List, Simon J. Greenhill, and Russell D. Gray. 2017. The potential of automatic word comparison for historical linguistics. PLOS ONE, 12(1):1-18. +A. Meillet. 1925. La Méthode Comparative en Linguistique Historique. H. Aschehoug & Co. Oslo. +Carlo Meloni, Shauli Ravfogel, and Yoav Goldberg. 2019. Ab Antiquo: Proto-language Reconstruction with RNNs. CoRR, abs/1908.02477. + +John E. Miller, Tiago Tresoldi, Roberto Zariquiey, Cesar A. Beltrán Castanón, Natalia Morozova, and Johann-Mattis List. 2020. Using lexical language models to detect borrowings in monolingual wordlists. PLOS ONE, 15(12):1-23. +Andrea Mulloni and Viktor Pekar. 2006. Automatic detection of orthographic cues for cognate recognition. In In Proceedings of the 5th International Conference on Language Resources and Evaluation, LREC 2006, pages 2387-2390. +Saul B. Needleman and Christian D. Wunsch. 1970. A General Method Applicable to the Search for Similarities in the Amino Acid Sequence of Two Proteins. Journal of Molecular Biology, 48(3):443-453. +Michael P. Oakes. 2000. Computer Estimation of Vocabulary in a Protolanguage from Word Lists in Four Daughter Languages. Journal of Quantitative Linguistics, 7:233-243. +Na'ama Pat-El. 2013. Contact or Inheritance? Criteria for distinguishing internal and external change in genetically related languages. Journal of Language Contact, 6:313-328. +F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. 2011. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825-2830. +Sanda Reinheimer Ripeanu. 2001. Lingvistica Romania: Lexic, Morfologie, Fonetica. Ed. All. Bucuresti. +Sanda Reinheimer Ripeanu. 2004. Les emprunts latins dans les langues romanes. Editura Universitàti din Bucuresti. +Yulia Tsvetkov, Waleed Ammar, and Chris Dyer. 2015. Constraint-Based Models of Lexical Borrowing. In Proceedings of NAACL-HLT 2015, pages 598-608. +Winston Wu and David Yarowsky. 2020. Computational Etymology and Word Emergence. In Proceedings of the 12th Language Resources and Evaluation Conference, pages 3252-3259. \ No newline at end of file diff --git a/automaticdiscriminationbetweeninheritedandborrowedlatinwordsinromancelanguages/images.zip b/automaticdiscriminationbetweeninheritedandborrowedlatinwordsinromancelanguages/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..c38ac518ceae48e2127b1f3380b5dd40b73ccc51 --- /dev/null +++ b/automaticdiscriminationbetweeninheritedandborrowedlatinwordsinromancelanguages/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f0cdc2736cfc234605652e1fd94795e019ecbda1c0fb8afd5a2cd6b450e3f109 +size 482321 diff --git a/automaticdiscriminationbetweeninheritedandborrowedlatinwordsinromancelanguages/layout.json b/automaticdiscriminationbetweeninheritedandborrowedlatinwordsinromancelanguages/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..b6b469d47e5a94c591a2b60605d8cfa01d06377d --- /dev/null +++ b/automaticdiscriminationbetweeninheritedandborrowedlatinwordsinromancelanguages/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1fc7c9f2bbb3fbde118fdcea7cd44d229e20f41cef3f4c232749d8dccb5fb2c1 +size 282759 diff --git a/automaticrulegenerationfortimeexpressionnormalization/1cb4496b-1c6e-4554-b920-2688f6af1825_content_list.json b/automaticrulegenerationfortimeexpressionnormalization/1cb4496b-1c6e-4554-b920-2688f6af1825_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..8a53aca6881069802e66a10d0a2f30753e694a78 --- /dev/null +++ b/automaticrulegenerationfortimeexpressionnormalization/1cb4496b-1c6e-4554-b920-2688f6af1825_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d482cccc6e9a6ba8df4509eb4b81d2926e4e502e936f4dbec8b36f93a540dfd +size 66971 diff --git a/automaticrulegenerationfortimeexpressionnormalization/1cb4496b-1c6e-4554-b920-2688f6af1825_model.json b/automaticrulegenerationfortimeexpressionnormalization/1cb4496b-1c6e-4554-b920-2688f6af1825_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e263eea950613060de0c63d03d868b44965a4b57 --- /dev/null +++ b/automaticrulegenerationfortimeexpressionnormalization/1cb4496b-1c6e-4554-b920-2688f6af1825_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6610ad01f8da485bd63f97ffd4fdb8b81b23b7f1e3b85c16d968318176b0b86f +size 83091 diff --git a/automaticrulegenerationfortimeexpressionnormalization/1cb4496b-1c6e-4554-b920-2688f6af1825_origin.pdf b/automaticrulegenerationfortimeexpressionnormalization/1cb4496b-1c6e-4554-b920-2688f6af1825_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..46058373692087b532878e5cabfb315fbfcbc8c7 --- /dev/null +++ b/automaticrulegenerationfortimeexpressionnormalization/1cb4496b-1c6e-4554-b920-2688f6af1825_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f0bcb618549866950bc8bdce0b248a4352b98ba557e837ae9abe00ff47b6fab2 +size 387134 diff --git a/automaticrulegenerationfortimeexpressionnormalization/full.md b/automaticrulegenerationfortimeexpressionnormalization/full.md new file mode 100644 index 0000000000000000000000000000000000000000..a0c6e0d2b4d613c9e2930dc2e2aa8940a08dc15c --- /dev/null +++ b/automaticrulegenerationfortimeexpressionnormalization/full.md @@ -0,0 +1,284 @@ +# Automatic Rule Generation for Time Expression Normalization + +Wentao Ding, Jianhao Chen, Jinmao Li, Yuzhong Qu + +National Key Laboratory for Novel Software Technology, Nanjing University {wtding, jh_chen, jmli} $@$ smail.nju.edu.cn, yzqu@nju.edu.cn + +# Abstract + +The understanding of time expressions includes two sub-tasks: recognition and normalization. In recent years, significant progress has been made in the recognition of time expressions while research on normalization has lagged behind. Existing SOTA normalization methods highly rely on rules or grammars designed by experts, which limits their performance on emerging corpora, such as social media texts. In this paper, we model time expression normalization as a sequence of operations to construct the normalized temporal value, and we present a novel method called ARTime, which can automatically generate normalization rules from training data without expert interventions. Specifically, ARTime automatically captures possible operation sequences from annotated data and generates normalization rules on time expressions with common surface forms. The experimental results show that ARTime can significantly surpass SOTA methods on the Tweets benchmark, and achieves competitive results with existing expert-engineered rule methods on the TempEval-3 benchmark. + +# 1 Introduction + +Temporal information plays an important role in natural language. The research community divides the understanding of time expressions into two subtasks: recognition and normalization (UzZaman et al., 2013). The first task is to annotate time expressions from free text, and the second one is to annotate the temporal values and types of the recognized time expressions. Some recent research work (Zhong et al., 2017; Zhong and Cambria, 2018; Ding et al., 2019) achieved significant improvements on the recognition task comparing with classic rule-based or semantic parsing systems, while the researches on normalization have lagged behind. Normalization methods often rely on expert-designed rules or grammars to model the + +compositional structure of time expression, which are domain-sensitive and not sufficient enough on covering emerging corpora. + +To avoid the performance limitation and the labor cost of manually designing rules for different corpora, we study the problem of automatically generating normalization rules from annotated data. There are some challenges to achieve this goal. Firstly, the surface text forms of natural language expressions are diverse, and the normalized value of time expressions may not directly correspond to their surface text form. (e.g., both the expression "May" and "this month" could be normalized to "2021-05".) Secondly, time expressions have rich semantic structures which are not explicitly reflected in their annotations. The implicitness of semantic structure makes supervised approaches hard to apply to the task of generating normalization rules. Besides, the annotations in practical datasets are noisy, which challenges the robustness of data-driven methods. + +To achieve the goal, we regard time expression normalization as a sequence of operations to construct the normalized temporal value of specific types. We assume that the surface form of time expressions activates the corresponding normalization sequence. The normalization rules are defined as the alignment between surface form pattern and activated operation sequences, as demonstrated in Example 1. Section 3 will describe operations and normalization rules in details. + +Example 1. The time expression "last October" can be normalized by the rule (Pattern="last MONTH: $1", Type=Instant, Operations=(ToLast[Year], ModifyEnum[$ 1])) where the type "Instant" indicates that the normalized value should be a date or time instant, the first operation decreases the current value on year field by 1, and the second operation modifies the value on month field by the "MONTH" variable obtained from the expression (i.e., October). + +We name the method for automatically generating normalization rules as ARTime1. ARTime computes the difference between the base value and the annotated value of input time expression to capture possible operation sequences, aligning the captured sequence with the surface form of the time expression to construct candidate rules. It ranks the noisy candidates by their frequency to distinguish the good rules. When applying the rules for normalization, ARTime attempts to dynamically search a rule composition for unmatched expressions to improve the coverage of generated rules. The whole normalization process only relies on a small set of pre-defined lexicon of temporal values (e.g., numeric values and time units), and does not need the intervention of human experts. + +The rest sections are organized as follows: The second section summarizes related research work. The third section introduces the representation of temporal values and time expressions in detail. The fourth section describes the framework and main components of ARTime. The fifth section reports the evaluation results of ARTime on two benchmarks. The last section concludes this paper. + +# 2 Related Work + +Understanding time expressions in natural language has long attracted the attention of researchers. The TIDES research program proposed TIMEX (Setzer and Gaizauskas, 2000) and TIMEX2 (Ferro et al., 2005), which are standalone annotation schemes of time expression with detailed descriptions of temporal values. The TERQAS workshops conceptualized TimeML (Pustejovsky et al., 2010) based on TIMEX and TIMEX2. TimeML became an ISO standard in 2009. Bethard and Parker (2016) pointed out that the classic annotation schemes failed to show the semantic composition structure of of time expressions and proposed the Semantically Compositional Annotation of Time Expressions (SCATE). However, applying SCATE to existing corpus requires to manually re-associate the expressions in a more complex way, and many of the existing SOTA methods can not handle annotation in SCATE format directly (Laparra et al., 2018). + +On the recognition of time expression, an early study shows that the complexity of time expressions is limited, and finite state automata or regex + +expression can be effective for recognizing those expressions (Hobbs et al., 1997). Mainstream recognition methods can be roughly divided to surface-structure-based methods (Verhagen et al., 2005; Strötgen and Gertz, 2010; Strötgen et al., 2013; Chang and Manning, 2012; Lee et al., 2014; Zhong et al., 2017; Ding et al., 2019) and sequential-tagging-model-based methods (Bethard, 2013; Ning et al., 2018; Zhong and Cambria, 2018). Research work in recent years achieves significant improvements on the recognition. SynTime (Zhong et al., 2017) defines generic but heuristic rules on a group of time-related triggering token types. TOMN (Zhong and Cambria, 2018) uses the SynTime defined token types instead of the classic BIO-tagging scheme for the CRF model. PTime (Ding et al., 2019) generalizes time expressions in training data to sequential patterns and selects a subset of the patterns for recognition. However, these studies only focus on the recognition. + +The normalization of time expression is dominated by methods with expert designed rules or grammars. HeidelTime (Strömgen and Gertz, 2010; Strömgen et al., 2013, 2014) uses regex rules on time tokens and modifiers to combine recognized tokens and filter ambiguous expressions. SUTime (Chang and Manning, 2012) proposes a 3-layered temporal pattern language. It firstly extends recognized tokens to string, then composes and filters the strings to get temporal values. Angeli and Uszkoreit (2013) use an EM-style bootstrapping approach to learn a PCFG parser on pre-defined preterminals. UWTime (Lee et al., 2014) uses a combinatory categorical grammar to parse possible meanings of time expressions. It selects meanings for recognized expressions via a linear classifier with context-dependent features. CogCompTime (Ning et al., 2018) provides a rule-based standalone normalizer conceptually built on Zhao et al. (2012), which achieves the SOTA normalization results on the (UzZaman et al., 2013) dataset. There are also some efforts on understanding event-related expressions. Tissot et al. (2015) analyzes time expressions in clinical notes. TweetTime (Tabassum et al., 2016) improves existing methods by establishing an external event knowledge base. According to existing studies (UzZaman et al., 2013; Tabassum et al., 2016), rule-engineering can achieve good results on covered expressions but are hard to extend to emerging corpora. + +In this paper, we focus on automatically recover + +ing the semantic structure of expressions without any compositional annotations. The latest work on recognition inspired our idea of using surface form patterns to activate normalization rules, and we replace the labor cost of designing rules by the automatic rule generation. + +# 3 Time Expression Normalization as a Sequence of Operations + +We model the normalization of a time expression as a sequence of operations defined on time fields, which can construct a temporal value of specific type. The normalization rule is defined as a triplet consists of a surface form pattern, a type of temporal value, and an operation sequence. The following subsections introduce the above concepts. + +# 3.1 Time Fields + +The time fields can be simply treated as time units with lower and upper bound constraints on values. Each temporal value can be denoted by a series of non-overlapping fields. For example, ISO:8601 represents a date value in the format "yyyy-MM-DD", where "MM" represents the "month" field with lower bound 1 and upper bound 12. + +# 3.2 Type of Temporal Values + +According to TimeML, we classify the temporal value into 3 types according to their formats. 1) Instant for representing date and time (e.g., "2021-05-17T12:00"), 2) Duration for denoting the amount of intervening time in a time interval (e.g., "P2M" represents 2 months.), and 3) Approximate reference for representing approximate referring value (e.g., "PAST_REF"). + +# 3.3 Operations + +ARTime takes the function of time expression as changing a base temporal value to a target value. The semantic of a time expression is represented by a sequence of operations defined the temporal fields. We design ten types of operations for ARTime (as listed in Table 1. The operations take 5 kinds of parameters: 1) integer values $v$ , 2) time units $u$ , 3) temporal fields $f$ , 4) enumerable temporal constant $e$ , and 5) approximate reference $r$ (i.e., Past, Present and Future). Most of the operations are designed for temporal values of instant + +type, while ApproxRef and Add are designed for approximate reference values and duration values respectively. Specifically, we use a MakeSet operation to represent the TIMEX3 type "SET". + +In the execution of operations, we require the operations be arranged in order. Operations on larger fields should be executed first. Operations on the same fields will be arranged according to their type. The operations independent to the base (e.g., ModifyVal) should be executed first. The reason to use descending order of granularity is that the order corresponds to the way humans understand time fields. For example, the token "day" denotes "dayOfYear" in "the first day in 2021" and "dayOfWeek" in "the first day in this week". Its meaning depends on the larger fields mentioned in the context. Arrange operations according to their type is to prevent redundant sequences. Example 2 explained why executing some operations later may overriding the execution results of previous operations. + +Example 2. Considering the base value "2021-01", we have + +$$ +\begin{array}{l} \text {T o N e x t} [ \text {M o n t h} ] \left(" 2 0 2 1 - 0 1"\right) \\ = ^ {\prime \prime} 2 0 2 I - 0 2 ^ {\prime \prime}, \\ \text {M o d i f y E n u m [ M a y ]} \left(" 2 0 2 1 - 0 2 ^ {\prime \prime}\right) \\ = \text {M o d i f y E n u m} [ \text {M a y} ] \left(" 2 0 2 1 - 0 1"\right) \\ = ^ {\prime \prime} 2 0 2 1 - 0 5 ^ {\prime \prime} \\ \end{array} +$$ + +, which indicates that executing the subsequent ModifyEnum[May] might make ToNext[Month] a redundant operation. + +# 3.4 The Surface Form Pattern of Rule + +In our design, each rule has a surface form pattern to determine whether it can be applied to an input expression. The pattern in our approach is similar to the sequential pattern in PTime (Ding et al., 2019), which is defined as a sequence consisting of token types and untyped tokens. A token type consists of multiple values, and each value has a corresponding regex to capture its various surface forms. We only use 6 token types listed in Table 2 for obtaining variable values. The 6 types including 4 kinds of enumerable temporal constants (i.e, the first 4 rows in the table), time units, and inequality modifiers (denoted as "IN_EQ") collected from HeidelTime. + +In our method, only the tokens referring to temporal values that appear in the operation sequences + +Table 1: The temporal operations used in ARTime. + +
ActionDescription
ModifyVal[v, f]Modify the value in f to v. (e.g, ModifyVal[5, Day, Week])(“2021-05-17”)=“2021-05-21”)
ModifyEnum[e]Use the enumerable constant e to modify the corresponding field. (e.g, ModifyVal[Summer])(“2021-05-17”)=“2021-SU”)
CountEnum[v, e, f]Find the v-th e in field f. (e.g, CountEnum[1, Friday, Month])(“2021-05-17”)=“2021-05-07”)
Equal[f]Let the target value equals to the base on field f. (e.g, Equal[1, Friday, Month])(“2021-05-17”)=“2021-05”)
ToBegin/End[f]Modify the value in f to its begin/end point. (e.g, ToBegin[Month, Quarter])(“2021-05”)=“2021-04”)
For/Backward[v, u]Increase/decrease current value by vu. (e.g, Backward[2, Month])(“2021-05”)=“2021-03”)
ToNext/Last[u]Increase/decrease current value by one u. (e.g, ToNext[Month])(“2021-05”)=“2021-06”)
MakeSet[f]Denote that the current value are sets of f. (e.g, MakeSet[Week])(“2021”)=“2021-WXX”)
Add[v, u]Add vu to the current value, only works for duration values. (e.g, Add[2, Month])(“P1Y”)=“P1Y2M”)
ApproxRef[r]Mean the value is the approximate reference r. (e.g, ApproxRef[Past])(“2021-05”)=“PAST_REF”)
+ +Table 2: The token types. + +
TypeContents
MONTHJanuary, Jan., Feb., etc.
WEEKSunday, Sun., etc,
SEASONSpring, Summer, etc.
DAY_TIMEmoring, afternoon, etc.
TIME_UNITyear, month, etc.
IN_EQa mere, no more than, etc.
+ +will be generalized to the corresponding type. For example, the token "day" in rule (Pattern="several day later", Type=ApproximateReference, Operations=(ApproxRef[FUTURE_REF]) is not generalized to corresponding type "TIME_UNIT" since the operations do not require a unit variable. + +# 4 Framework of ARTime + +Figure 1 illustrates the normalization process of ARTime. The pre-processing step is adopted from the corresponding components in PTime. The rest normalization procedures can be divided into two parts, 1) generating rules (i.e., the left part of Figure 1) and 2) applying the generated rules (i.e. the right part of Figure 1). Since the TimeML standard does + +![](images/426cd731c3f66e35e8d4b62e1fae86bae86bc288bf3f5a3d863b51df5de20125.jpg) +Figure 1: The framework of ARTime. + +not annotate the base value of each time expression, we simply use the document creation time as a substitute in capturing the possible operation sequences. The following sub-sections describe the key techniques in ARTime. Section 4.1 details how to capture possible operation sequences. Section 4.2 describes how to generate rules from the noisy results. Section 4.3 describes how to use the generated rules to normalize input time expressions. + +# 4.1 Capturing Possible Operations + +By regarding temporal values as vertices and operations as directed edges connecting the base values to the normalized values, the task of reasoning possible operation sequence can be formalized as searching paths on the graph of temporal values, where each path corresponds to a sequence of operations (as demonstrated in Figure 2). The main challenge is that there could be a great quantity of paths between two values, and not all of them correspond to meaningful expression in daily communications (e.g., the sequence (ToEnd[Quarter,Year], ToBegin[Month,Quarter]) is legal in semantic but unnatural). + +![](images/842a424d813773982edcaf6a6156b59eafc1e5ee286664177a9f576e5ceb2733.jpg) +Figure 2: Some operation paths from "2021-05-17" to "2020-10" + +Our method is based on the assumption that practical time expressions are low-redundancy sequences. i.e., we prefer direct sequences like (Equal[Day])(“today”) rather than the complex ones of the same meaning such as (ToLast[Week],Forward[37,Day])(“7 days after a week ago”). + +We implement the process by a heuristic depth-first search (DFS) algorithm described in Algorithm 1. The main idea is to guide the search process by the difference between the base value and the annotated value. In each iteration, we ensure that the current value $V_{c}$ and the target value $V_{t}$ are the same on fields of granularity not less than the iterated field $f$ . (line 1). We enumerate a smaller field $f'$ (line 8) and check if there are some operations $a$ on field $f'$ corresponds the difference between $V_{c}$ and $V_{t}$ from $f'$ to $f$ (line 13-14). In the enumeration of $a$ (line 12), we only consider no-redundancy sequences of the partial order introduced in section 3.3. Specifically, we accelerate the process by requiring all numeric values that appear in the search results must also appear in the input + +Algorithm 1 The DFS algorithm for changing $V_{c}$ to $V_{t}$ , where pool is the pool of usable numeric values for acceleration. + +1: function DFS $(V_{c}, V_{t}, f, \text{pool})$ +2: if $f = 1 / \infty$ then $\triangleright 1 / \infty$ is a virtual field for the termination condition +3: return $V_{c} = V_{t}$ +4: $S\gets \emptyset$ +5: for $f' \in \{f'|1 / \infty \leq f' < f\}$ do +6: $\Delta = V_{t[f:f']} - V_{c[f:f']}.$ +7: if $\Delta = 0$ then +8: $S + = \mathrm{DFS}(V_c,V_t,f',pool)$ +9: for $a \subset \{\text{operations on } f\}$ do +10: if $V_{c}$ .exec(a)- $V_{c}\neq \Delta$ then +11: continue +12: if $\neg (\mathrm{numVals}(a)\subseteq vPool)$ then +13: continue +14: $pool^{\prime}\gets pool - \mathrm{numVals}(a)$ +15: $V^{\prime}\gets V_{c}.exec(a)$ +16: sol $\leftarrow$ DFS(V', Vt, f', pool') +17: if haveSolution then +18: $S = S\cup (a + sol)$ +19: return S + +time expression (line 15-16). + +Given the time expression $T$ with annotated value $V_{a}$ and the base time $V_{b}$ , we obtain possible operation sequences by calling $\mathrm{DFS}(V_b, V_a, \infty, \mathrm{numVals}(T))$ , where $\infty$ is a virtual time unit as the initialization condition and numVals is the function for collecting appeared numeric values. + +# 4.2 Constructing and Filtering Rules + +All the captured operation sequences will be used for constructing candidate rules. We firstly find the values appear in both the surface form and the operation sequence, then replace its appearance with corresponding token types and variable symbols to construct candidate rules. For example, given the expression "this month" and operation sequence Equal[Month], the replacement result will be "this TIME_UNIT: $1" and Equal[$ 1]. + +The generation produces many noises since there are more than one sequence from one time value to another. We distinguish good rules by a quite simple intuition that more general patterns and more correct rules should appear on more expressions. We rank the candidate rules by their frequency and the frequency of their patterns on training corpus, + +then select the most frequent rules for normalization. We suppose that there is no need to drop the low frequency rules. The reason is that a low frequency rule either be replaced by more generalized rules (e.g., the second rule in Example 3), or do capture some meaningful token patterns that are difficult to generalize (e.g., "as soon as possible"). + +Example 3. Consider the expression "last month" and normalized value "2021-04" and suppose that there are two candidate rules, + +·(“last TIME_UNIT: $1” \Rightarrow ToLast[$ 1]), +·(“last month”, $\Rightarrow$ ModifyEnum[April]). + +The first one is correct and can handle similar expressions (e.g., "last year"), while the second one only holds on the coincidence appearance of the base value "2021-05". + +# 4.3 Applying Rules For Normalization + +Given an input expression, ARTime will try to find a matchable rule to normalize it. If it can not match any generated rules, ARTime will attempt to search a consecutive composition of rules and stop words to cover it. The stop words include connecting symbols (e.g., “-”), determiners (e.g., “this”), prepositions (e.g., “to”) and so on. + +The search process is performed by a segmentation algorithm (i.e., the dynamic programming algorithm described in Algorithm 2.) The algorithm tries to cover the input expression except for stop words in it (line 6-7) with minimum rules (line 11-13). For the case that there are multiple compositions of the same size, we simply choose the one that contains the most frequent rules. After that, we assume that all the operations in chosen rules are useful and merge them into a new sequence according to the order described in section 3.3. + +# 5 Evaluation + +# 5.1 Datasets + +We use the TempEval-3 (UzZaman et al., 2013) benchmark and the Tweets benchmark proposed by Zhong et al. (2017). The statistics of the two benchmarks are illustrated in Table 3. + +TempEval-3 (UzZaman et al., 2013) is a sub-task in SemEval 2013 consisting of English news articles. We follow the previous study (Lee et al., + +Algorithm 2 The segmentation algorithm for unmatched expressions. + +1: function SEGMENT(T: expression, $\mathcal{R}$ : rules) +2: Initialize $F\gets$ to an array of empty sets. +3: $F_{[0]}\gets \{\emptyset \}$ +4: for $i\gets 1$ to $|T|$ do +5: $C\gets \emptyset$ +6: if isStopword $(T_{[i]})\wedge F_{[i - 1]}\neq \emptyset$ then +7: $C\gets C\cup \{F_{[i - 1]}\}$ +8: for $j\gets 0$ to $i - 1$ do +9: if $F_{[j]} = \emptyset$ then +10: continue +11: if $\exists r\in \mathcal{R}.$ match $(r,T_{[j + 1:i]})$ then +12: $C\gets C\cup \{F_{[j]}\cup \{r\}\}$ +13: if $C\neq \emptyset$ then +14: $F_{[i]} = \mathrm{argmin}_{c\in C}|c|$ +15: return $F_{|T|}$ + +Table 3: The statistics of the datasets. The Doc., Token, and Exp. columns report the number of documents, tokens, and time expressions in the datasets respectively. + +
DatasetDoc.TokenExp.
TimeBank18361,4181,243
AQUANT7333,973579
TempEval-3 Eval206,375138
Tweets train74215,571892
Tweets test2004,198237
+ +2014) to use corrected TimeBank (Pustejovsky et al., 2003) and AQUAINT as its training datasets. + +Tweets (Zhong et al., 2017) is a new benchmark consisting of English tweets. The annotators tend to annotate years in a finer granularity (e.g. the annotation "... in $\langle T\text{value} = 2014 - XX - XX\rangle 2014\langle /T\rangle$ means "a day in 2014".) These annotations are legal according to TimeML, but do not conform to the intuition of expert designed rules in existing methods. Thus we provide the alter-version Tweets-M by annotating the year expressions as is. + +# 5.2 Compared Methods + +We compare ARTime with 4 normalization systems, HeidelTime (Strötgen et al., 2013), UWTime (Lee et al., 2014), SUTime (Chang and Manning, 2012) and CogCompN (Ning et al., 2018). HedidelTime is the SOTA purely-rule-based system. UWTime achieves the SOTA performances on TempEval-3. + +Table 4: The accuracy(%) of normalization results on gold recognition annotations. The best results are in **bold**, and the second-best results are **underlined**. + +
MethodTempEval-3TweetsTweets-M
TypeValueTypeValueTypeValue
HeidelTime81.276.176.466.276.471.3
SUTime83.370.389.583.589.588.6
UWTime88.482.676.471.376.476.4
CogCompN91.383.486.570.986.575.9
ARTime84.875.493.287.393.289.0
ARTime+H90.681.994.584.494.589.5
+ +SUTime outperforms the other ones on social media texts according to Tabassum et al. (2016). CogCompN is the standalone normalizer of CogCompTime (Ning et al., 2018) which achieves SOTA results on TempEval-3. + +We also evaluate the performance of compared normalization methods in real applications. We implement end-to-end systems with 3 SOTA recognition methods, SynTime (Zhong et al., 2017), TOMN (Zhong and Cambria, 2018), and PTime (Ding et al., 2019). We directly use the output of HeidelTime, SUTime, and UWTime for end-to-end comparison because they use the same rules (or grammar) for recognition and normalization. + +# 5.3 Evaluation Metrics + +We use the scripts provided by TempEval-3 for evaluation. For the normalization results, we report the accuracy of normalized temporal results with gold mentions. For the end-to-end results, we report the F1 score of normalized types, and the precision (Pr), recall (Re), and F1 score of normalized temporal values. + +# 5.4 Experimental Results + +# 5.4.1 Normalization Results + +Table 4 reports the normalization results on gold recognition annotations. ARTime surpasses other methods and shows better adaptability and robustness on Tweets (i.e., +3.8 points on the original Tweets). The performances of the compared methods dramatically vary on the different corpus. All compared methods except SUTime achieve very poor results on Tweets, while SUTime achieves the worst results on TempEval-3. ARTime's performances are not very well on TempEval-3. The + +main reason is that the training data and the test data of TempEval-3 are annotated separately, and the insufficiency of training data severely hurts the performance of purely data-driven methods like ARTime according to previous study (Ding et al., 2019). For example, the test data of TempEval-3 includes 2 expressions about "flu season" (It should be normalized as winter), our method cannot handle them since none of the training expressions contains the word "season". Besides, the normalized values of some expressions rely on the tenses of corresponding utterances and need to be re-computed by post-modification (Strötgen and Gertz, 2010; Lee et al., 2014). (e.g., "finished in June") denotes "June in last year" for base temporal values like "2021-05"). The above problems can be alleviated by introducing prior knowledge. We transform the expert rules in HeidelTime into ARTime's formats as pre-defined rules, name the combined approach as ARTime+H. ARTime+H achieves a good balance on different domains with the best results on Tweets-M and competitive results on TempEval-3. (i.e., 1.5 points lower than the SOTA results on values.) + +# 5.4.2 End-to-end Results + +Table 5 reports the end-to-end results on TempEval-3 and Tweets-M. ARTime with the SOTA recognition method (PTime) outperforms the existing methods with an improvement of +2.2 points on the F1 scores of normalized values on Tweets-M. The results of ARTime on TempEval-3 are not good enough, but can be easily improved by introducing the same prior knowledge used in HeidelTime. ARTime+H with SynTime achieve the second-best results on the F1 score on values without losing the advantages on Tweets (1.4 points higher than the best results achieved by compared methods). + +Table 5: The end-to-end results(%) on TempEval-3 and Tweets. The best results are in **bold**, and the second-best results are underlined. + +
MethodTempEval-3Tweets-M
TypeValueTypeValue
Reco.Norm.F1PrReF1F1PrReF1
HeidelTime83.380.276.178.184.488.071.378.8
SUTime81.967.870.369.087.885.488.687.0
UWTime85.785.979.782.783.693.774.783.1
SynTimeCogCompN88.580.081.280.686.577.074.775.8
ARTime86.378.674.676.693.991.986.589.1
ARTime+H90.182.280.481.394.490.386.588.4
TOMNCogCompN89.382.079.080.486.175.773.474.5
ARTime86.280.371.075.489.391.186.188.5
ARTime+H88.782.876.879.793.389.586.187.7
PTimeCogCompN85.582.478.380.388.076.776.476.5
ARTime83.075.872.574.194.789.788.689.2
ARTime+H86.079.977.578.795.289.189.589.3
+ +Table 6: The statistics(%) of negative samples in the normalization results + +
ErrorsTempEval-3Tweets-M
Unseen Pattern41.250.0
Tense Error17.611.5
Bad Rule8.819.2
Annotation Error8.83.8
Others23.515.4
+ +# 5.4.3 Analysis + +We categorize the negative samples in the normalization results of ARTime by their causes in Table 6. About half of the negative samples are due to unseen patterns that can not be captured by our rules. Another problem is the errors caused by tense in the context. Some existing systems apply post-modification tricks by comparing the tense to the positivity of the difference between the output value and the base value. If our method can correctly utilize the oracle tense information, the accuracy on TempEval-3 can increase to $79.7\%$ (+4.3 points). There are also some cases that the rules generated in our method do not fit the input expressions (The 3rd row in Table 6). + +We also manually analyzed the rules used in the test process to show what extent the introduction of expert rules replaces the automatic generation + +Table 7: The statistics of rules in the normalization results of ARTime+H. + +
DatasetAutoFullRatio(%)
TempEval-3343691.9%
Tweets-M404295.2%
+ +in ARTime+H, the results are illustrated in Table 7. The "Full" column reports the number of rules used in normalizing the expressions, and the "Auto" and "Ratio" columns report how many of those rules can be covered by automatically generation. From the results we can know that the automatic generation can cover over 90 percent of the manual rules and adding about 2 rules are enough for ARTime. + +# 5.4.4 Running Efficiency + +All the results of ARTime are obtained by a single-threaded Scala implementation on a personal workstation with an Intel Xeon CPU E5-1607 v4 @ 3.10GHz CPU and 128GB RAM. In average, AR-Time generates $\sim 4.8$ candidate rules for each expression. The offline training process took $\sim 16.3$ minutes on TempEval-3 and $\sim 13.5$ minutes on Tweets. The test process took $\sim 47$ seconds on TempEval-3 and $\sim 46$ seconds on Tweets. + +# 6 Conclusion + +In this paper, we mainly focus on automatically generating rules for time expression normalization. The main contributions of this paper are summarized as follows: + +- We model time expression normalization as an operation sequence to construct the normalized temporal value, and ten basic operations are defined for time expression normalization. + +- We present a novel method, called ARTime, for generating normalization rules from training data without expert interventions. Specifically, AR-Time captures possible operation sequences from annotated data and generates candidate rules on time expressions with common surface forms, and finally obtains normalization rules by ranking the candidate rules. + +- Our experimental results show that ARTime outperforms SOTA methods on the Tweets benchmark, and achieves competitive results with existing expert-engineered rule methods on the Tempeval-3 benchmark. The end-to-end results when combining ARTime with time expression recognition systems are also very competitive. + +There are still some rooms to improve ARTime. One of the future work is to generate more high-quality rules. The other is to enable ARTime to use the tense and event information in context. + +# Acknowledgements + +This work is supported by the National Science Foundation of China under grant No.61772264. We would like to thank our team members Guanji Gao and Yanjia Wang for their help in the early exploration stage of this work. + +# References + +Gabor Angeli and Jakob Uszkoreit. 2013. Language-independent discriminative parsing of temporal expressions. In Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 83-92, Sofia, Bulgaria. Association for Computational Linguistics. +Steven Bethard. 2013. ClearTK-TimeML: A minimalist approach to TempEval 2013. In Proceedings of the Seventh International Workshop on Semantic Evaluation, pages 10-14, Atlanta, Georgia, USA. Association for Computational Linguistics. +Steven Bethard and Jonathan Parker. 2016. A semantically compositional annotation scheme for time normalization. In Proceedings of the Tenth Interna + +tional Conference on Language Resources and Evaluation, pages 3779-3786. +Angel X. Chang and Christopher Manning. 2012. Sutime: A library for recognizing and normalizing time expressions. In Proceedings of the Eight International Conference on Language Resources and Evaluation, pages 3735-3740, Istanbul, Turkey. European Language Resources Association. +Wentao Ding, Guanji Gao, Linfeng Shi, and Yuzhong Qu. 2019. A pattern-based approach to recognizing time expressions. In The Thirty-Third AAAI Conference on Artificial Intelligence, pages 6335-6342, Honolulu, Hawaii, USA. AAAI Press. +Lisa Ferro, Laurie Gerber, Inderjeet Mani, Beth Sundheim, and George Wilson. 2005. Standard for the annotation of temporal expressions-tides. The MITRE Corporation, McLean-VG-USA. +Jerry R Hobbs, Douglas Appelt, John Bear, David Israel, Megumi Kameyama, Mark Stickel, and Mabry Tyson. 1997. *Fastus: A cascaded finite-state transducer for extracting information from natural-language text.* arXiv preprint cmp-lg/9705013. +Egoitz Laparra, Dongfang Xu, Ahmed Elsayed, Steven Bethard, and Martha Palmer. 2018. SemEval 2018 task 6: Parsing time normalizations. In Proceedings of The Twelfth International Workshop on Semantic Evaluation, pages 88-96, New Orleans, Louisiana. Association for Computational Linguistics. +Kenton Lee, Yoav Artzi, Jesse Dodge, and Luke Zettlemoyer. 2014. Context-dependent semantic parsing for time expressions. In Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1437-1447, Baltimore, Maryland. Association for Computational Linguistics. +Pawel Mazur and Robert Dale. 2010. WikiWars: A new corpus for research on temporal expressions. In Proceedings of the 2010 Conference on Empirical Methods in Natural Language Processing, pages 913-922, Cambridge, MA. Association for Computational Linguistics. +Qiang Ning, Ben Zhou, Zhili Feng, Haoruo Peng, and Dan Roth. 2018. CogCompTime: A tool for understanding time in natural language. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 72-77, Brussels, Belgium. Association for Computational Linguistics. +James Pustejovsky, Patrick Hanks, Roser Sauri, Andrew See, Robert Gaizauskas, Andrea Setzer, Dragomir Radev, Beth Sundheim, David Day, Lisa Ferro, et al. 2003. The timebank corpus. In Corpus linguistics, volume 2003, page 40. Lancaster, UK. +James Pustejovsky, Kiyong Lee, Harry Bunt, and Laurent Romary. 2010. ISO-TimeML: An international standard for semantic annotation. In Proceedings of + +the Seventh International Conference on Language Resources and Evaluation, pages 394-397, Valletta, Malta. European Language Resources Association. +Andrea Setzer and Robert Gaizauskas. 2000. Annotating events and temporal information in newswire texts. In Proceedings of the Second International Conference on Language Resources and Evaluation, Athens, Greece. European Language Resources Association. +Jannik Strötgen, Thomas Bögel, Julian Zell, Ayser Armiti, Tran Van Canh, and Michael Gertz. 2014. Extending HeidelTime for temporal expressions referring to historic dates. In Proceedings of the Ninth International Conference on Language Resources and Evaluation, pages 2390-2397, Reykjavik, Iceland. European Language Resources Association. +Jannik Strötgen and Michael Gertz. 2010. HeidelTime: High quality rule-based extraction and normalization of temporal expressions. In Proceedings of the 5th International Workshop on Semantic Evaluation, pages 321-324, Uppsala, Sweden. Association for Computational Linguistics. +Jannik Strötgen, Julian Zell, and Michael Gertz. 2013. HeidelTime: Tuning English and developing Spanish resources for TempEval-3. In Proceedings of the Seventh International Workshop on Semantic Evaluation, pages 15–19, Atlanta, Georgia, USA. Association for Computational Linguistics. +Jeniya Tabassum, Alan Ritter, and Wei Xu. 2016. TweeTime: A minimally supervised method for recognizing and normalizing time expressions in Twitter. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 307-318, Austin, Texas. Association for Computational Linguistics. +Hegler Tissot, Angus Roberts, Leon Derczynski, Genevieve Gorrell, and Marcus Didonet Del Fabro. 2015. Analysis of temporal expressions annotated in clinical notes. In Proceedings of the 11th Joint ACLISO Workshop on Interoperable Semantic Annotation, London, UK. Association for Computational Linguistics. +Naushad UzZaman, Hector Llorens, Leon Derczynski, James Allen, Marc Verhagen, and James Pustejovsky. 2013. SemEval-2013 task 1: TempEval-3: Evaluating time expressions, events, and temporal relations. In Proceedings of the Seventh International Workshop on Semantic Evaluation, pages 1–9, Atlanta, Georgia, USA. Association for Computational Linguistics. +Marc Verhagen, Inderjeet Mani, Roser Sauri, Jessica Littman, Robert Knippen, Seok B. Jang, Anna Rumshisky, John Phillips, and James Pustejovsky. 2005. Automating temporal annotation with TARSQI. In Proceedings of the ACL Interactive Poster and Demonstration Sessions, pages 81-84, Ann Arbor, Michigan. Association for Computational Linguistics. + +Ran Zhao, Quang Do, and Dan Roth. 2012. A robust shallow temporal reasoning system. In Proceedings of the Demonstration Session at the Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 29-32, Montréal, Canada. Association for Computational Linguistics. +Xiaoshi Zhong and Erik Cambria. 2018. Time expression recognition using a constituent-based tagging scheme. In Proceedings of the 2018 World Wide Web Conference, page 983-992, Republic and Canton of Geneva, CHE. International World Wide Web Conferences Steering Committee. +Xiaoshi Zhong, Aixin Sun, and Erik Cambria. 2017. Time expression analysis and recognition using syntactic token types and general heuristic rules. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 420-429, Vancouver, Canada. Association for Computational Linguistics. \ No newline at end of file diff --git a/automaticrulegenerationfortimeexpressionnormalization/images.zip b/automaticrulegenerationfortimeexpressionnormalization/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..764a6b0f18de3ed312608946fb8d33fdff5b8d00 --- /dev/null +++ b/automaticrulegenerationfortimeexpressionnormalization/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f542b1c54cb1b4a13d86587a9dc54301d1dfaf658af40e5e92e4fd1c29bc7c50 +size 448201 diff --git a/automaticrulegenerationfortimeexpressionnormalization/layout.json b/automaticrulegenerationfortimeexpressionnormalization/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..aee474449ed3442506ab793338cf8411ec762a2c --- /dev/null +++ b/automaticrulegenerationfortimeexpressionnormalization/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:743c09b0b7caf99d3efa9b5c9417cd75107b19e95426fe99ac52f0d118529c9f +size 323700 diff --git a/awebscaleentityextractionsystem/a6a57ae4-524d-47de-949d-0e11bc54ac50_content_list.json b/awebscaleentityextractionsystem/a6a57ae4-524d-47de-949d-0e11bc54ac50_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..72a8551c8e215e7c1803e1f9d7de5f0fa8d3426d --- /dev/null +++ b/awebscaleentityextractionsystem/a6a57ae4-524d-47de-949d-0e11bc54ac50_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3eb1f5804b8c43da3d79ed473c0760b4d972265a1da8aef512da1d7cdd97b4d +size 40058 diff --git a/awebscaleentityextractionsystem/a6a57ae4-524d-47de-949d-0e11bc54ac50_model.json b/awebscaleentityextractionsystem/a6a57ae4-524d-47de-949d-0e11bc54ac50_model.json new file mode 100644 index 0000000000000000000000000000000000000000..0362e2a8da08624c6bf27c8c82ecba2018e2206c --- /dev/null +++ b/awebscaleentityextractionsystem/a6a57ae4-524d-47de-949d-0e11bc54ac50_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:828e3d54c2b32a4b172620dd4d0e150ebf2d9db8d5b218177df12cce8317b35a +size 48311 diff --git a/awebscaleentityextractionsystem/a6a57ae4-524d-47de-949d-0e11bc54ac50_origin.pdf b/awebscaleentityextractionsystem/a6a57ae4-524d-47de-949d-0e11bc54ac50_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6588dc825695bb3b80ed7fe68052f189557fc149 --- /dev/null +++ b/awebscaleentityextractionsystem/a6a57ae4-524d-47de-949d-0e11bc54ac50_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c4749c77824b11a2cb70d5fb7348711d4f5eca43f03d88132f157b9ea3691eea +size 210795 diff --git a/awebscaleentityextractionsystem/full.md b/awebscaleentityextractionsystem/full.md new file mode 100644 index 0000000000000000000000000000000000000000..56b69dcb61021953d0a63ce5841fafc21d203e1d --- /dev/null +++ b/awebscaleentityextractionsystem/full.md @@ -0,0 +1,189 @@ +# A Web Scale Entity Extraction System + +Xuanting Cai + +Facebook Inc + +Quanbin Ma + +Facebook Inc + +Pan Li + +Facebook Inc + +pli@fb.com + +Jianyu Liu + +Facebook Inc + +jianyuliu@fb.com + +Qi Zeng + +Facebook Inc + +qizeng@fb.com + +Zhengkan Yang + +Facebook Inc + +zhengkan@fb.com + +Pushkar Tripathi + +Facebook Inc + +pushkart@fb.com + +# Abstract + +Understanding the semantic meaning of content on the web through the lens of entities and concepts has many practical advantages. However, when building large-scale entity extraction systems, practitioners are facing unique challenges involving finding the best ways to leverage the scale and variety of data available on internet platforms. We present learnings from our efforts in building an entity extraction system for multiple document types at large scale using Transformers. We empirically demonstrate the effectiveness of multilingual, multi-task and cross-document type learning. We also discuss the label collection schemes that help to minimize the amount of noise in the collected data. + +# 1 Introduction + +Content understanding finds myriad applications in large scale recommendation system. One example is ranking content with sparse data (Davidson et al., 2010; Amatriain and Basilic, 2012). In such scenarios, content signals can offer better generalization to overcome cold-start problems (Lam et al., 2008; Timmaraju et al., 2020). Another example is explaining the working theory of the recommendation system to users and regulators (Chen et al., 2019). In such scenarios, content signals can offer human understandable features. + +This paper presents an overview of the entity extraction platform we build for our recommendation system. Along the way, we overcome several unique challenges: Multiple Languages - since our business operates world wide and supports languages from various countries, it is imperative to build a multi-lingual system; Multiple Entity Types - we want to extract multiple types of entities including named entities like people and places, as well as commercial entities like products and brands; Multiple Document Types - our system should work across multiple structured document types such as + +web pages, ads and user generated content; Scale - owing to our scale, we need a system that is responsive and resource efficient to process billions of documents per day. + +In the subsequent sections, we will review the methodology to collect data and the ideas behind the models. Then we will discuss techniques to deploy these models efficiently. + +# 2 Notation and Setup + +An entity is a human interpretable concept that is grounded in a real world notion. A mention is a word or a phrase in the text that refers to an entity. For example, both "Joe Biden" and "Biden" can be mentions for the same entity that represents the 46th president of the United States. Entity extraction is the task of extracting mentions from a given text and linking them to entities. Each instance of this problem consists of a structured document with text attributes like title and description, as well as categorical features and metadata, from which we wish to extract multiple entities. We categorize the entity extraction tasks into closed-world task and open-world task. The former is applicable when we have a fixed predefined universe of entities, say, topics from Wikipedia; while the latter is needed when such a list is not available e.g. products. + +# 3 Open-World Entity Extraction + +In this section, we discuss the data labeling and the model architecture for open-world entity extraction. + +# 3.1 Data Labeling + +Collecting data for the open-world entity extraction presents unique challenges since it entails collecting free-form inputs from raters. We design a widget to let raters highlight spans of text, generating a set of positive mentions per example. Each example is rated by multiple raters and there are + +different ways to combine mentions from all raters: And - select tokens highlighted by all raters; Or - select tokens highlighted by any rater; Majority - select tokens highlighted by the majority of raters. + +We evaluate these methods by comparing to in-house experts. Based on the evaluation in Table 1, we choose the Majority method, which provides the best label quality, for our label generating. + +
MethodExact Match F1
And0.775
Or0.706
Majority0.794
+ +Table 1: Exact Match F1 is the F1 score of the aggregated rater labels of extract match compared with the expert labels. + +In order to audit and enhance the quality of the labeled data, we prepare detailed instructions on navigating the user interface, task-specific reasoning process, sample tasks elucidating the rules, and explanations for handling corner cases. Additionally, we routinely inject known examples to calibrate external raters against our experts. We periodically remove and retrain raters whose outputs digress significantly from the experts. Furthermore, we also track their consistency with consensus labels to detect outliers. Finally, we also perform some rule-based sanitization to rectify common errors. For example, we find that raters often fail to select all the occurrences of a same piece of text. Thus, we broadcast selected mentions back to the entire input to capture all occurrences. + +# 3.2 Modeling + +We divide the open world-entity extraction task into the extraction stage and the clustering stage. There are a few existing researches on similar problems, e.g. Lin et al. (2012); Cao et al. (2020). However, our method is a novel one in that it completely gets rid of a predefined entity list. + +# 3.2.1 Extraction Stage + +In the extraction stage, We try to find all mentions in a text using a sequence to sequence model. As depicted in Figure 1a, our extraction model is based on a pre-trained cross-lingual language model (Lample and Conneau, 2019). For computation efficiency, we choose a multiple layer perception on top of XLM instead of conditional random field layer (Lafferty et al., 2001). We + +find that the simple multiple layer perception with take-continuous-positive-blocks decoding in the sequence works good enough to provide high quality mentions. + +# 3.2.2 Semi-supervised Clustering Stage + +In the clustering stage, we try to collapse all mentions referring to the same concept to a canonical entity. Intuitively, one can run k-means algorithm on embeddings coming from the extraction stage. However we found that the performance of this approach not acceptable for two reasons: The k-means is based on a uniform distribution assumption which the embeddings do not follow; Embeddings taken from extraction model fail to align with the human interpretation for two mentions being the same concept. + +We solve the problem with a semi-supervised graph based approach, where we build a dedicated model as illustrated in Figure 1b to predict links between mentions if they represent the same underlying entity. This model is trained on a dataset specialized in mention concept similarity that we collect separately. We adopt the Siamese neural network architecture in order to scale for processing all pairs between hundreds of millions of documents during graph construction. Then we run Louvain community detection algorithm (Blondel et al., 2008) on the resulting graph to collapse close mentions into an entity. We find that this could significantly improve the quality of the clusters. + +# 4 Closed-World Entity Extraction + +In this section, we discuss the data labeling and the model architecture for closed-world entity extraction. + +# 4.1 Data Labeling + +In an ideal world, we would want our raters to select the mentions freely from input text and attach the corresponding Wikipedia entity to it. But that makes it hard for raters to reach any consensus, and impossible for us to perform any quality control. Instead, we make the task a multiple-choice, where we extract beforehand a list of possible mentions, alongside with their potential Wikipedia link candidates, with the help of a pre-defined dictionary. Now the rater only need to choose all the positive mentions, and their corresponding Wikipedia entity, both from a given list. + +Similar to open-world, we perform quality analysis on different consensus methods. Here we treat + +![](images/fc514eac9fe0ac2b094742fa7c3ceff8ccf8fbbf758e407aa8f13221f3dc818b.jpg) +(a) + +![](images/54f44643cdaa49b802a1fdea2a56969fdef0f1f1ae9bf8b53c6a202b4e01ba46.jpg) +(b) +Figure 1: (a) The open-world extraction model, where each sentence piece is classified as B/I/O/E; (b) The open-world link prediction model, which predicts if two mentions refer to the same entity. (c) The closed-world linking model, which predicts the probability that a mention corresponds to each entity candidate (entity embeddings are generated offline and fetched from the storage at inference time). + +![](images/38070b6d68adce85374da98a2bafa33f13950903097632f519dbb58bd0eaef4a.jpg) +(c) + +wiki entities selected by 2 out of 5 raters to be our community ground truth. This method, compared against the oracle labels provided by in-house experts, can achieve $80\%$ chance of having all extracted entities being correct, and $70\%$ chance of having all correct entities being extracted. Both number would further increase by $14\%$ if we tolerate one single error. As reference, the F1 score of an individual average rater on this task is 0.68. + +# 4.2 Modeling + +Similar to the open-world model, we break up the task into the extraction stage and the linking stage. + +# 4.2.1 Extraction Stage + +Instead of finding possible entity links dynamically after the mentions are extracted, we rely on a static dictionary, containing mapping from various mention aliases to entities, to extract all possible links in advance using fuzzy string matching. This simplifies the labeling effort, while also reduces the computation time for both training and inference. + +The performance would then heavily depend on the quality of the dictionary. We recursively trace Wikipedia's Redirect, which defines a mapping from a mention to an entity, and Disambiguation pages, which maps a mention onto multiple possible entities, to build the dictionary. Various rule-based clean-ups are also performed for the mentions, entities and the mapping. + +# 4.2.2 Linking Stage + +The linking model then computes the similarity between the mention and its candidate entities. The mention tower is similar to the open world model, where we run the input document through a language model and pool the outputs to get embeddings for the mentions. On the entity side, its Wikipedia texts are summarized offline into embeddings. For each mention-entity pair, the mention + +embedding is broadcasted to dot with its candidate entity embeddings after a linear projection, to output a relevance score, as shown in Figure 1c. + +We also experimented with first predicting a mention score as in the open world case, but found little difference in the final entity metric. Additional supervision on salience is also added for entities based on the number of votes received from the raters. We concatenate these scores with some counter-based features such as the prior of the mention-entity link, to get the final linking score after feed forward layer. + +# 5 Scaling Challenges + +To have a good coverage over various documents, our system needs to scale across languages, entity types and document types. Naively, we can develop a model for each triple (language, entity type, document type) and run a combination of models for each piece of document. However, this would bring significant overhead in model development and model serving. Therefore, our system tackles these scaling challenges with the following techniques and train a single model instead. + +# 5.1 Cross Language Model and Fine-Tuning + +Transformer (Vaswani et al., 2017) based pretrained language model has led to strong improvements on various natural language processing tasks (Wang et al., 2018). With cross-lingual pretraining, XLM (Lample and Conneau, 2019) can achieve state-of-art results across languages. In our work, we employ XLM and further improve the prediction by fine-tuning on multilingual data. We compare the performance of zero-shot and fine-tuned product extraction models on ads in Table 2. While the zero-shot model predicts reasonably for Romance languages, e.g. French (fr), Portuguese (pt), it has a poor performance for Arabic (ar) and Vietnamese + +(vi). This is expected since the latter have very different characteristics from English. By fine-tuning on all-language data, we see a substantial boost in model performance for all languages. + +
Zero-ShotFine-Tuned
LanguagePrecisionRecallF1PrecisionRecallF1
ar0.25560.06760.10690.31700.53310.3976
da0.24370.40370.30400.40930.54440.4673
de0.29660.36700.32810.33490.59210.4279
en0.43010.67500.52540.42510.70360.5300
es0.27390.35000.30730.34390.59550.4360
fr0.34990.35840.35410.40670.59880.4844
it0.31570.36260.33750.41520.61460.4956
nl0.24660.46730.32280.33160.52990.4079
pt0.30750.43950.36180.41220.65550.5061
ru0.31440.44670.36910.43000.70210.5334
vi0.18860.02830.04920.36530.68880.4774
Overall0.33150.38340.35560.38610.63310.4797
+ +# 5.2 Multi-Task Learning For Extraction, Clustering, and Linking + +Multi-task learning (Caruana, 1997) is a subfield of machine learning, in which multiple tasks are simultaneously learned by a shared model. Such approaches offer advantages like improved data efficiency, reduced overfitting through shared representations, and fast learning by leveraging auxiliary information. It has been proved effective in various applications like Computer Vision (Zhang et al., 2014) and Natural Language Processing (Vaswani et al., 2017). In previous subsections, we train models separately and predict in parallel for different entity types. This is advantageous in that we can train a model for a new entity type or update the model for an existing entity type without affecting other entity models. However, this causes ever-increasing inference costs as new entity types are considered. Currently we have 5 entity types and 7 Transformer-based models, which means to run 7 XLM encoders for every ad, web page, etc. The heavy inference cost is a major blocker for our service. To resolve this issue, we developed the unified model structure and training framework. We are able to co-train all entity extraction and linking models with a shared XLM encoder. Since the encoding part accounts for the majority of all computation, the inference time is reduced to $1/7$ of before and unblocks the service. Table 3 displays the performance of the shared-encoder models trained with the framework. It can be seen that + +Table 2: Multilingual fine-tuning of product name extraction model. Zero-shot model is trained on English only; fine-tuned model is trained on all languages (one-tenth of English sample size for each new language). + +
TaskMetricSeparate ModelsShared-Encoder Models
ExtractionPrecision0.43010.4171
Recall0.67500.6671
F10.52540.5133
Closed-WorldAccuracy0.67290.6815
+ +Table 3: Co-train product name extraction and closedworld linking models with a shared XLM encoder + +
TaskMetricAds ModelAds+Web Pages Model
AdsWeb PagesAdsWeb Pages
ExtractionPrecision0.43010.45190.43150.5148
Recall0.67500.51670.69510.6906
F10.52540.48210.53250.5899
Closed-WorldAccuracy0.67290.61060.68110.6852
+ +Table 4: Transfer learning between product name extraction and closed-world linking models between ads and web pages data. The first model is trained on ads only; the second is trained on both ads and web pages. The sample sizes of ads and web pages are the same. + +they have a performance comparable with that of separately trained models. While the closed-world linking model has a slightly better accuracy with co-training, the product name extraction model performs slightly worse. This is probably because a single XLM of a moderate size may not encode all info required by different entity extraction heads. We expect increasing the capacity of encoder will reduce the conflicts. To sum up, the unified model permits new entity types with little inference cost and only slight performance drop. + +# 5.3 Cross Document Transfer Learning + +Transfer learning aims at improving the performance of target models on target domains by transferring the knowledge contained in different but related source domains (Zhuang et al., 2021). Different transfer learning approaches are developed from zero-shot transfer learning (Xian et al., 2017) to few-shot transfer learning (Vinyals et al., 2016). We incorporate the transfer learning framework in our system to solve cross document types challenge. We run experiments on zero-shot transfer learning and few-shot transfer learning as in Table 4. As we can see, the transfer learning could boost the performance of the model on both document types. + +# 6 Conclusion And Future Work + +In this paper, we present the platform of the entity extraction at giant internet company's scale. We discuss the practical learnings from our work. In the future, we would like to improve the efficiency of Transformer related language model as discussed in (Tay et al., 2020). + +# References + +Xavier Amatriain and Justin Basilic. 2012. Netflix recommendations: Beyond the 5 stars. The Netflix Tech Blog. +Vincent D Blondel, Jean-Loup Guillaume, Renaud Lambiotte, and Etienne Lefebvre. 2008. Fast unfolding of communities in large networks. Journal of statistical mechanics: theory and experiment, 2008(10):P10008. +Ermei Cao, Difeng Wang, Jiacheng Huang, and Wei Hu. 2020. Open knowledge enrichment for long-tail entities. In Proceedings of The Web Conference 2020, pages 384-394. +Rich Caruana. 1997. Multitask learning. Machine Learning, 28:41-75. +Hanxiong Chen, Xu Chen, Shaoyun Shi, and Yongfeng Zhang. 2019. Generate natural language explanations for recommendation. In Proceedings of the 29th ACM International Conference on Information and Knowledge Management, page 755-764. +James Davidson, Benjamin Liebald, Junning Liu, Palash Nandy, Taylor Van Vleet, Ullas Gargi, Sujoy Gupta, Yu He, Mike Lambert, Blake Livingston, and Dasarathi Sampath. 2010. The youtube video recommendation system. In Proceedings of the fourth ACM conference on Recommender systems, page 293-296. +John Lafferty, Andrew McCallum, and Fernando Pereira. 2001. Conditional random fields: Probabilistic models for segmenting and labeling sequence data. In Proceedings of the Eighteenth International Conference on Machine Learning, page 282-289. +Xuan Nhat Lam, Thuc Vu, Trong Duc Le, and Anh Duc Duong. 2008. Addressing cold-start problem in recommendation systems. In Proceedings of the 2nd international conference on Ubiquitous information management and communication, page 208-211. +Guillaume Lample and Alexis Conneau. 2019. Crosslingual language model pretraining. In Advances in Neural Information Processing Systems, volume 32. +Thomas Lin, Oren Etzioni, et al. 2012. No noun phrase left behind: detecting and typing unlinkable entities. In Proceedings of the 2012 joint conference on empirical methods in natural language processing and computational natural language learning, pages 893-903. +Yi Tay, Mostafa Dehghani, Dara Bahri, and Donald Metzler. 2020. Efficient transformers: A survey. Arxiv. +Aditya Srinivas Timmaraju, Angli Liu, and Pushkar Tripathi. 2020. Addressing challenges in building web-scale content classification systems. In 2020 IEEE International Conference on Acoustics, Speech and Signal Processing, pages 8134-8138. + +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advances in Neural Information Processing Systems, volume 30. +Oriol Vinyals, Charles Blundell, Timothy Lillicrap, Koray kavukcuoglu, and Daan Wierstra. 2016. Matching networks for one shot learning. In Advances in Neural Information Processing Systems, volume 29. +Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel Bowman. 2018. Glue: A multi-task benchmark and analysis platform for natural language understanding. In Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pages 353-355. +Yongqin Xian, Bernt Schiele, and Zeynep Akata. 2017. Zero-shot learning — the good, the bad and the ugly. In 2017 IEEE Conference on Computer Vision and Pattern Recognition, pages 3077-3086. +Zhanpeng Zhang, Ping Luo, Chen Change Loy, and Xiaou Tang. 2014. Facial landmark detection by deep multi-task learning. In Computer Vision - ECCV 2014, pages 94-108. +Fuzhen Zhuang, Zhiyuan Qi, Keyu Duan, Dongbo Xi, Yongchun Zhu, Hengshu Zhu, Hui Xiong, and Qing He. 2021. A comprehensive survey on transfer learning. In Proceedings of the IEEE, volume 109, pages 43-76. \ No newline at end of file diff --git a/awebscaleentityextractionsystem/images.zip b/awebscaleentityextractionsystem/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..c242949df4245d0f5dee5397186a3fe9053eb08a --- /dev/null +++ b/awebscaleentityextractionsystem/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5164659713f46760d58082763d9cf5893291da526b14115b8dc65d303b7dfbe +size 139986 diff --git a/awebscaleentityextractionsystem/layout.json b/awebscaleentityextractionsystem/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..743d53f84adac0e0b780e5cba668f0d78ad4a265 --- /dev/null +++ b/awebscaleentityextractionsystem/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17439b1e17eed5b049ab652daf68ad7be6c9cb467f7838135640bafd6f8ae6ce +size 165424