Using BERT for German compound compositionality prediction
Date
Authors
Journal Title
Journal ISSN
Volume Title
Publisher
Abstract
In order to assess and understand the performance of Transformer models, tests are required that are not only based on predicting the correct next word. One of these tests is the compositionality of compound words. Compositionality of compound words describes how important the first and the second word are for the meaning of the compound word. In this bachelor thesis, we used the transformer model BERT to analyse German compound words and compare them with a human-annotated gold standard. Different combinations of models, the division of the words into the two words, the number of sentences analysed, the layers of Bert and the individual sentence parts were used. These were then compared with the results of the English study from which this study is derived. The models used for German were bert-base-german-dbmdz-cased and bert-base-german-dbmdz-uncased, which were downloaded from Hugging Face. Overall, the cased BERT model, achieved the best performance. With a Spearman's ρ = 0.432, this performance is achieved in the 1st layer of the model. The compound words are also separated for this purpose. This predicted the compositionality of the head. The best compositionality of the modifier is worse than the of the head. The uncased BERT model has a worse performance than the cased model. The best value is achieved with the layer combination 11-12 with split compounds and a Spearman’s ρ = 0.38. If the compound words are not separated, the performance is also worse. With regard to the number of sentences, it can be observed that performance generally improves when more sentences are used. However, there was one exception, which is probably only due to chance. When comparing the individual parts of the sentence, it is noticeable that the best performance is usually achieved when comparing the context with the individual word that is to be predicted. From this we can conclude that context is important. It is obvious that the representation of one's own word is important for the prediction of this part of speech. If you compare the English and German results, you realise that the English results are significantly better. It is particularly noticeable that the results of the cased BERT model and split words look similar to those of the English model. It makes sense that these results are similar because the compound words are also split in English. It also makes sense that the best model is the cased model, as the case is much more important for nouns in German than in English.
Um die Performance von Transformer Modellen zu beurteilen und zu verstehen sind Test nötig, welche nicht nur auf dem Vorhersagen des richtigen nächsten Wortes basieren. Einer dieser Tests ist die Kompositionalität von zusammengesetzten Wörtern. Die Kompositionalität von zusammengesetzten Wörtern beschreibt, wie wichtig das erste und das zweite Wort für die Bedeutung des zusammengesetzten Wortes ist. Bei dieser Bachelorarbeit haben wir das Transformer Modell BERT genutzt, um Deutsche zusammengesetzte Wörter zu analysieren und mit einem von Menschen annotierten Goldstandard zu vergleichen. Dabei wurden verschiedene Kombinationen von Modellen, das Teilen der Wörter in die zwei Wörter, Anzahl der analysierten Sätze, die Schichten von Bert und die einzelnen Satzteile verwendet. Diese wurden dann noch mit den Resultaten der englischen Studie verglichen, von der diese Studie abgeleitet ist. Als Modelle für Deutsch wurden bert-base-german-dbmdz-cased und bert-base-german-dbmdz-uncased verwendet, welche von Hugging Face heruntergeladen wurden. Insgesamt erreicht das BERT-Modell, welches Groß- und Kleinschreibung berücksichtig die beste Performance. Mit einem Spearman’s ρ = 0,432 wird diese Performance in der 1. Schicht des Modells erreicht. Dafür werden auch die zusammengesetzten Wörter getrennt. Dabei wird die Kompositionalität des zweiten Wortes vorhergesagt. Das BERT-Modell ohne Groß- und Kleinschreibung hat eine schlechtere Performance als das Modell mit Groß- und Kleinschreibung. Der beste Wert wird mit der Schichtkombination 11-12 erreicht. Wenn man die zusammengesetzten Wörter nicht trennt, ist die Performance auch schlechter. Bei der Anzahl der Sätze lässt sich beobachten, dass die Performance allgemein besser wird, wenn man mehr Sätze verwendet. Dabei gab es jedoch eine Ausnahme, die wahrscheinlich aber nur am Zufall liegt. Beim Vergleichen der einzelnen Satzteile fällt auf, dass meistens die Beste Performance beim Vergleichen vom Kontext mit dem einzelnen Wort, welches vorhergesagt werden soll, erreicht wird. Daraus kann man schließen, dass der Kontext wichtig ist. Dass die Repräsentation des eigenen Wortes für die Vorhersage dieses Teilwortes wichtig ist, ist offensichtlich. Wenn man die englischen und deutschen Ergebnisse vergleicht, stellt man fest, dass die englischen Resultate deutlich besser sind. Dabei fällt vor allem auf, dass die Resultate des BERT-Modells mit Groß- und Kleinschreibung und geteilten Worten ähnlich aussehen wie die des englischen Modells. Dadurch, dass im Englischen die zusammengesetzten Worte auch geteilt geschrieben werden macht es Sinn, dass sich diese Ergebnisse ähneln. Auch dass das beste Modell das Modell mit Groß- und Kleinschreibung ist, macht Sinn, da im Deutschen die Groß- und Kleinschreibung viel wichtiger für Nomen ist als im Englischen.