UZH at S em E val-2020 Task 3: Combining BERT with W ord N et Sense Embeddings to Predict Graded Word Similarity Changes (2020)

Abstract: CoSimLex is a dataset that can be used to evaluate the ability of context-dependent word embed- dings for modeling subtle, graded changes of meaning, as perceived by humans during reading. At SemEval-2020, task 3, subtask 1 is about ”predicting the (graded) effect of context in word similarity”, using CoSimLex to quantify such a change of similarity for a pair of words, from one context to another. Here, a meaning shift is composed of two aspects, a) discrete changes observed between different word senses, and b) more subtle changes of meaning representation that are not captured in those discrete changes. Therefore, this SemEval task was designed to allow the evaluation of systems that can deal with a mix of both situations of semantic shift, as they occur in the human perception of meaning. The described system was developed to improve the BERT baseline provided with the task, by reducing distortions in the BERT semantic space, compared to the human semantic space. To this end, complementarity between 768- and 1024-dimensional BERT embeddings, and average word sense vectors were used. With this system, after some fine-tuning, the baseline performance of 0.705 (uncentered Pearson correlation with human semantic shift data from 27 annotators) was enhanced by more than 6%, to 0.7645. We hope that this work can make a contribution to further our understanding of the semantic vector space of human perception, as it can be modeled with context-dependent word embeddings in natural language processing systems.

## introduction context-dependent word embeddings such as bert @xcite provide semantic vector representations of words which depend on the surrounding context, capturing not only discrete differences in word sense, but also the more graded effects of context on word meaning @xcite . while discrete shifts in meaning can often be aligned with word senses for polysemous english words in the wordnet knowledge graph @xcite , more subtle, graded shifts in meaning cannot be fully represented in this manner. as such embeddings are vectors, for which distances can be calculated, relative shifts in meaning can in principle be modeled by distances in that semantic vector space. however, it is not fully understood how well such distances based on context-dependent word embeddings actually represent graded word similarity changes as perceived by humans while reading. while their ability to predict human cognitive data collected during reading has been investigated, indicating a non-random correspondance @xcite , additional approaches are needed to better assess their ability to model human perceptions of word semantics under natural conditions. by compiling the cosimlex dataset, @xcite enable an evaluation of such embeddings in terms of their ability to model human perceptions of meaning, when performing similarity judgements in context. in other words, they capture both graded and discrete shifts in meaning, depending on the contexts in which a pair of words appear. this evaluation in semeval-2020 therefore enables new research questions to be asked, compared to previously compiled datasets for the modeling of word semantics, by reflecting the gradedness of human semantic judgements. while cosimlex provides a multi-lingual dataset, the described system in this paper only predicts graded effects of context on word meaning for the largest subset of cosimlex, which is composed of 340 english word pairs in two different contexts. an extension of this system to other languages is in principle feasible, but would require considerably more work as a key system component described here, the average word sense vectors based on the work of @xcite , only exist for english words, at present. to improve upon the relatively strong baseline script provided with the task, an approach was developed that adds a multi-parametric semantic space distortion correction model to the baseline algorithm. in the unmodified baseline, a pre-trained 768-dimensional bert model generates a context-dependent embedding for each word in the pair. then the similarity between those vectors is calculated, using cosine distance. once the same process has been repeated for the same word pair in the second context, both similarity values can be compared using subtraction. this results in a positive or negative value, representing the "semantic shift" for this word pair, depending on the meanings of those two words shifting towards being more or less similar. in many cases, this perception of meaning shift does not reflect the use of a different word sense, but something more gradual, in the human semantic vector space. in the baseline algorithm, which word sense (according to wordnet) is used in both contexts is not determined. to experiment with a model that would either boost or shrink the result produced by the baseline, modeling a distortion correction that would approximate a more human judgement of semantic shift, an algorithm was developed for performing a number of comparisons between the embeddings produced by the baseline, and average embeddings for different word senses for that word. the latter aspect taps into semantic knowledge captured in a computationally accessible form, as semantic vectors, using a knowledge graph called wordnet @xcite . to integrate such knowledge into the logic of the baseline, pre-trained embeddings for all discrete word senses stored in wordnet were obtained from the work of @xcite . in brief, loureiro and jorge calculated average vectors from bert embeddings for each english word sense recorded in wordnet, based on a large corpus in which those distinct word senses were labeled with their wordnet identifiers. for a particular target word in a word pair in our task, those pre-trained embeddings for word senses are then compared to standard 1024-dimensional bert-based embeddings that do not take word sense knowledge in wordnet into account, as in the baseline. basically, this correction model was designed to either boost or shrink the similarity shift value generated by the baseline, depending on a few factors derived from parametrized semantic vector space calculations, aiming to improve the system's ability to model human perceptions of meaning shift. in other words, the model aims to reduce distortions in the original bert-based semantic space, from the perspective of human semantic perception. after experimenting with a few parameters that influence the balance between different distortion corrections in this model, a final combination was chosen that substantially improved the match with the human perception of meaning shift. this fine-tuning of the system was guided by human inspection, based on the author's subjective perception of semantic shift. during such inspection, did the meaning of the two words become more or less similar in the second context, compared to the first? was it a substantial shift, to a semantically very different word sense, or a more subtle discrete or graded shift? in total, 32 combinations of 4 parameters were evaluated in this way, before no further improvement of the system was observed. this combination also improved the performance in the semeval-2020 evaluation task, under the conditions of post-evaluation in codalab. note that the true labels for the evaluation set in this task, the graded similarity changes obtained from the 27 human annotators, for 340 word pairs, were not available during system development and fine-tuning, as reported in ## background the english language subset of the cosimlex dataset, the focus of this work, consists of 340 word pairs, with each word pair occurring in 2 different multi-sentence contexts. see @xcite for an example, and a more detailed description of the theory, the human annotation method, as well as the calculation of meaning shift. note that the uzh system only performs subtask 1, the graded similarity shift between context 1 and 2 for a particular word pair, for the english language subset, for the reasons outlined above. ## system overview the uzh system uses the similarity values generated by the baseline script as input to a semantic space distortion correction model for either boosting (increasing) or shrinking (decreasing) that value, based on a range of calculations in two complementary semantic vector spaces. the basic intuition behind this design is to reduce distortions in the semantic vector space modeled by the baseline algorithm, resulting from differences in the way bert represents meaning shifts using cosine distances in vector space, compared to perceptions of semantic shift by the 27 human annotators. one of the main ideas was that averaged vectors for word senses from large training data would allow the empirical discovery of such distortion corrections for semantic vector space, using a limited number of trials, guided by visual inspection. therefore, in each iteration of system fine-tuning, each word pair was printed with both contexts, together with the baseline prediction of semantic shift, as well as the output and behavior of the distortion correction model. to match the type of bert model used to generate those pre-trained word sense embeddings (1024 dimensions) with the bert model used in the baseline script (768 dimensions), the 1024 cased version of the bert model, trained on the book corpus, was used for this comparison with the averaged word sense vectors. in a first step, distances between embeddings for all word senses and the context-dependent 1024dimensional bert embedding are calculated. then, the word sense embedding with the highest similarity to the target word embedding is selected for further calculations (vector wsesel), representing the most relevant discrete word sense. by calculating distances in semantic vector space, compared to this wsesel reference, the model can apparently better reflect subtle, gradual sense shifts for the same word sense, in different contexts. distances to wsesel are also calculated for the second target word in the word pair, for comparison, thereby generating all required parameters for the correction model, as outlined in equation 1. fine-tuning of those 4 parameters then helped to determine the best balance between the factors influencing the reduction of distortion. equation 1: @xmath0: similarity (prediction), a: baseline prediction, using 768-dimensional bert embeddings (bbe768) b: 1024-dimensional bert prediction (difference to a, divided by w1 weight; negative if a was negative), sl: average of both distances between the most similar word sense embedding (wsesel) and the 1024-dimensional bert embedding (bbe1024) for the target words as: change of distance between the wsesel and bbe1024 for the target words, between context 1 and context 2. in summary, the conceptual stages of the algorithm that apply the correction model to the baseline script outputs are: the pre-trained word sense embeddings can be considered a summarization of a population of embeddings in semantic vector space, for that particular word sense, capturing vector representation of that word sense. due to the averaging, this vector is independent of variations in the context that do not affect the annotation of word sense in its discrete form. for example, the word 'play' can refer to child's play, playing a role in a movie, and playing an instrument while making music (three word senses). therefore, it can capture each distinct word sense as a different semantic vector, based on how word senses are stored in the wordnet knowledge graph. hence, the distortion correction model described here uses the distance between the context-dependent embedding for a target word, which can reflect graded shifts in meaning, and those summarized embeddings for that word sense, for the larger discrete shifts in meaning. while the 768-dimensional and 1024-dimensional bert models may have distinct advantages and disadvantages in modeling human perceptions of meaning, the use of wsesel provides an orthogonal way to introduce additional information in assessing such distortions. the hyper-parameters in this distortion correction model were adjusted based on multiple submissions, as outlined above. see as it was impossible, under post-evaluation conditions, to use standard methods for supervised learning on this task, as outlined above, it is plausible that the performance of the correction model may be further enhanced, once the labels are used for such parameter optimization. see below for a few experiments on the labels shared by the conference organizers after the submission of this paper. in other words, the effort for fine-tuning described here may well have found a local rather than a global optimum. further investigation into the most salient aspects of the algorithm could therefore lead to useful insights into the modeling of human perceptions of meaning shifts using a complementary set of bert and other embeddings, which seem to have unique advantages that can be combined in a synergistic manner. the design of the presented algorithm may be a starting point for such investigations. for details on the algorithm, see equation 1, and the code (written in python 3.7.6) at https://github.com/lilytang2017/semeval2020 ## experimental setup as no supervised learning could be applied during fine-tuning of model parameters, no data splits were performed. python libraries used: bert embedding, numpy, pandas, and scipy. evaluation measures were predefined by the task organizers, as described by @xcite , basically measuring correlation. after paper submission, the conference organizers shared the gold labels, reflecting the human perception of meaning shifts in cosimlex, as perceived by 27 human annotators. based on those labels, additional combinations of hyperparameters were investigated, beyond those shown in ## results the best score obtained with this correction model was 0.7645, reaching the top rank at the time of submission, in the post-evaluation phase of semeval-2020. as this is a considerable improvement over the baseline prediction, which reached a score of 0.705, the described correction model is able to make a contribution by combining the strengths of different semantic vectors and vector calculations. after obtaining the gold labels, 70 additional combinations of hyper-parameters were evaluated. under those conditions, a slight improvement to a score of 0.7649 was observed, with the parameters: @xmath1, @xmath2, @xmath3, @xmath4.5. parameter w3 was observed to be optimal near value 6, when testing values up to 20. each run took about 30 min for each hyper-parameter combination. ## conclusion as the application of the described multi-parameter correction model to the predictions of the baseline script were able to improve performance by over 6%, we can conclude that the further investigation of this approach for reducing distortions in the bert semantic space could help us better model the human semantic vector space at word level, as far as meaning shifts captured in cosimlex are concerned.