GM-CTSC at SemEval-2020 Task 1: Gaussian Mixtures Cross Temporal Similarity Clustering
Pierluigi Cassotti, Annalina Caputo, Marco Polignano, Pierpaolo Basile
Introduction
The recent development in word embeddings, and their increasing capability to capture lexical semantics has inspired the application of these methods to new tasks and introduced new challenges. The diachronic analysis of language is one of such linguistic tasks that has benefited from the advantages of these new methods, i.e. the capability to build semantic representations of words by skimming through large corpora spanning multiple time periods. SemEval 2020 Task 1 [Schlechtweg et al., 2020] addresses the current lack of a systematic approach for the evaluation of automatic methods for the diachronic analysis by proposing a common evaluation framework that comprises two tasks and covers four different languages (German, English, Latin, and Swedish). Given two corpora and for two periods and , Subtask 1 requires participants to classify a set of target words in two categories: words that have lost or gained senses from to and words that did not, while Subtask 2 requires participants to rank the target words according to their degree of lexical semantic change between the two periods. We tackle the problem of automatically detecting lexical semantic changes with approaches that rely on temporal word embeddings. These approaches create a word vector representation for each time period by exploiting a shared semantic space. Similarity measures can then be used to capture the extent of a word semantic change between two time lapses. Some temporal word embedding techniques adopt a two-step approach, where they first learn separate word embeddings for each time period and then align the word vectors across multiple time periods [Hamilton et al., 2016]. Other dynamic approaches incorporate the alignment directly into the learning stage via the optimisation function [Tahmasebi et al., 2018]. Dynamic word embeddings can be further categorised according to the constraint imposed on the alignment. The explicit alignment adopts a conservative approach to the semantic drift that a word can undergo by posing a limit to the distance between the word vectors belonging to the two temporal spaces. In the implicit alignment, there is no need for explicit constraint since the alignment is automatically performed by sharing the same word context vectors across all the time periods.
In this work, we focus on dynamic word embeddings by exploring methods based on both explicit, such as Dynamic Word2Vec [Yao et al., 2018], and implicit alignment, namely Temporal Random Indexing [Basile et al., 2015] and Temporal Referencing [Dubossarsky et al., 2019]. We analyse the use of different similarity measures to determine the extent of a word semantic change and compare the cosine similarity with Pearson Correlation and the neighborhood similarity [Shoemark et al., 2019]. While these similarity measures can be directly employed to generate a ranked list of words for Subtask 2, their adoption in Subtask 1 requires further manipulation. We introduce a new method to classify changing vs. stable words by clustering the target similarity distributions via Gaussian Mixture Models. We describe the embedding models and the clustering algorithm in Section 2, while Section 3 provides details about the hyper-parameter selection. Section 4 reports the results of the task evaluation followed by some concluding remarks in Section 5.
GM-CTSC
Dynamic Word2Vec (DW2V) [Yao et al., 2018] simultaneously learns time-aware embeddings by aligning and reducing the dimensionality of time-binned Positive Point-wise Mutual Information matrices.
Temporal Random Indexing (TRI) [Basile et al., 2015] implicitly aligns co-occurrence matrices by using the same random projection for all the temporal bins.
Collocations extracts for each word and each time period the set of relevant collocations through Dice score. As similarity function, we measure the cosine similarity between the sets of collocations belonging to the two different time periods. More details are reported in ?).
Temporal Referencing (TR) [Dubossarsky et al., 2019] used only in the post-evaluation, it consists in a modified version of Word2Vec Skipgram that adds a temporal referencing to target vectors, keeping context vectors unchanged.
A similarity measure between vectors in the two temporal spaces is adopted to compute the extent of the semantic drift of the target words. We explored several similarity measures:
Cosine similarity (CS) is the cosine of the angle between two vectors.
Pearson correlation (PC) measures the linear correlation between two variables, in case of centred vectors (with zero means) is equivalent to the cosine similarity.
Neighborhood similarity (NS) computes two -neighbour sets and and the union set . Two second-order vectors, one for each word representation , are created. The components of are the cosine similarity between the vector Where is the vector representation for the word generated by and is the time period. and the i-th element of : . The Neighborhood similarity is the cosine similarity between the second-order vectors. In all the experiments we set .
In Subtask 2, we use one of the three similarity measures (, , ) to compute the set of target similarities . Then, we rank the target words according to the distance, computed as: .
2 Subtask 1: Gaussian Mixture Clustering
Subtask 1 requires a further step: given , the set of target similarities, we need to predict the target labels. The aim is to assign either of the two classes, 0 (stable) or 1 (change), to each target word of a given language. Once we compute the set of target similarities , we want to find a way to assign the corresponding label. We assume that low similarities suggest changing words and high similarities indicate stable words.
Gaussian Mixture Models (GMMs) allow to build probabilistic models for representing the Gaussian distribution of stable and changed targets. We use GMMshttps://scikit-learn.org/stable/modules/generated/sklearn.mixture.GaussianMixture.html to model the density of the distributions of the similarities of targets as a weighted sum of two Gaussian densities [Huang et al., 2017]:
where is the number of mixture components, is the Gaussian density with mean vector and covariance matrix , and is the prior probability for the -th component. Additional constraints can be applied to the covariance matrix in Eq. 1. In our experiments, we allow each component to have its own covariance matrix.
For our purpose, we speculate that the distribution of target similarities is a mixture of two densities, i.e. representing the stable and changing words. Consequently, we fixed the number of the mixture components in the GMMs to two. We initially randomly assign a label (stable/changing) to each density distribution. Let and be the means of the two Gaussians associated with the “stable” and “changing” labels respectively. If (i.e. the similarity mean of the distribution labelled as “stable” is lower than the mean of distribution labelled as “changing”), we invert the labels. Alg. 1 can be used for properly label each word of the target vocabulary.
In order to set the best parameters for each language and model, we rely on the GMMs log likelihood, which is generally used for estimating the clusters quality:
Experimental Setup
In all the runs, we do not pre-process data and we use a context window size of 5 while analyzing sentences. The modelWe add this model during the post-evaluation. has been adopted into its original implementationhttps://github.com/Garrafao/TemporalReferencing, as the https://github.com/pippokill/tri approach and https://github.com/yifan0sun/DynamicWord2Vec one. For runs involving , we experimented with a varying vector size from to . Moreover, we investigated (1) the initialization of the count matrix at time with the matrix at time , (2) the contribution of positive-only projections, and (3) the application of PPMI weights, as explained in ?). For , we use the parameter setting proposed in ?). We set , , , and experimented with a number of iterations from one to five. As vocabulary, we kept the top 50,000 most frequent tokens for both and . In the runs, we set the vector size to , and we experimented eight iterations for English and Latin, and four for German and Swedish. We use negative samples, keeping only the tokens that occur at least times. All the other parameters used for configuring the models are reported in Tab. 1.
Results
Tab. 2 reports the main results obtained by the different models. It shows the results obtained from the official submissions at the challenge and the results obtained by the approach performed during the post-evaluation phase. The results obtained for the Subtask 1 are reported using the accuracy metric, while for the Subtask 2, the Spearman’s rank-order correlation coefficients are used.
Considering the results of the evaluation phase, the models show not consistent behaviors. showed the best performance when considering “all the languages” for both Subtasks, although in Subtask 1 it is not able to overcome Baseline2. Focusing on Subtask 1, if we consider each language in isolation, we see that gives the best results for EnglishPlease, note that for EN, LA and SW and coincide while (Collocation with cosine similarity) is our best system for German language, although it is not able to overcome Baseline2. is the best system for Latin, although outperformed by Baseline1, and Sweden languages. In Subtask 2, the best English score was reported by . Simlarly to Subtask 1, performed the best in German language. For Latin and Sweden, provided the best results, and interestingly, it is one of the few systems that did not generate a negative correlation. For Sweden language in particular, it is interesting to notice that generated the best result among all the task participants.
At the end of the challenge, when the labelled test set was released, we performed more experiments reported in the post-evaluation row. In this phase we run an additional system, , which outperformed all the previous reported approaches, including both baselines. The only exception is for Latin, in which for Subtask 1 achieves accuracy in comparison to of . Comparing and , which are both based on implicit alignment, the former is a prediction-based model while the is latter a count-based one. Moreover, creates a temporal word embedding only for the target words rather than for the whole vocabulary. Consequently, this results in better word embeddings for all the words in the vocabulary that do not have a temporal reference. These differences allow to achieve better results than the other models.
During the post-evaluation we decided to investigate also the role of GMMs for class labeling (Sec. 2). We compared GMMs with semi-manual thresholds , , and Winsorizing [Kokic and Bell, 1994] computing and on data provided for Subtask 1, where , are the mean and the standard deviation computed on the similarity set . Figure 1 reports the different accuracy scores obtained by the five methods for the , , , approaches. The scores for the GMMs strategy are close to those obtained by for TRI and Collocation. While GMMs outperforms in every run, seems to work better than GMMs except that in . Winsorizing work better in and than GMMs. GMMs outperforms Winsorizing in and . These results are not clear enough to advocate for a specific threshold. Consequently, further analysis will be part of future work in order to understand what is the better threshold that could be included in the GMMs process.
Conclusions
We described the runs we submitted to the SemEval-2020 Task 1: Unsupervised Lexical Semantic Change Detection. This paper has two main contributions. We reported a comparison of some of the most recent approaches to model lexical semantic change with temporal word embeddings, and we experimented with an automatic unsupervised procedure to classify changing and stable words. Results show that implicit alignment works generally better in modelling the lexical semantic change. In future works we plan to carry out an analysis on unlemmatised corpora and gauge a better understanding of the impact of Gaussian Mixture Clustering for unsupervised lexical semantic change detection.