Abstract
Word similarity is a cornerstone of machine learning applications such as search engines and recommendation systems. Measuring how the meaning of a word shifts between different contexts is crucial for modeling polysemy and complex syntactic features. In this paper, we present the methodology proposed by team Ferryman for SemEval-2020 Task 3. Our system integrates the Bidirectional Encoder Representations from Transformers (BERT) model with term frequency-inverse document frequency (TF-IDF) weighting. We evaluate this approach on the CoSimLex dataset, covering English, Croatian, Slovene, and Finnish.
Introduction
Traditional word embedding models like Word2Vec or GloVe generate static vectors where a word like "bank" has a single representation regardless of its context (e.g., "river bank" vs. "investment bank"). However, human language is inherently contextual. The challenge of contextual word similarity involves quantifying how the similarity between word pairs changes based on their surrounding text. This requires models to perform contextual modulation—identifying which semantic traits are emphasized or backgrounded by the local environment.
Methodology: BERT with TF-IDF Weighting
The core of the Ferryman system is a hybrid approach that combines the deep contextual capabilities of BERT with the statistical grounding of TF-IDF.
TF-IDF Integration
While BERT excels at capturing inter-word relationships, the authors hypothesized that statistical word importance could further refine these representations. TF-IDF scores were used to weight the BERT mask layer, influencing the attention mechanism. This helps the model prioritize words that are statistically significant within the document, effectively "enriching the attributes" of the target word pairs.
Fine-tuning and Preprocessing
The team employed several preprocessing steps, including expanding abbreviations via a custom dictionary to ensure input consistency. For training, they utilized multi-dropout—a regularization technique—to improve the model's ability to generalize when predicting absolute similarity ratings.
Experimental Setup
The system was evaluated using CoSimLex, a benchmark designed for graded word similarity in context. Unlike datasets providing a single similarity score, CoSimLex provides scores for word pairs across varying contexts in four languages: English, Croatian, Slovene, and Finnish. The evaluation set included 340 English pairs, 112 Croatian pairs, 111 Slovene pairs, and 24 Finnish pairs.
Results and Discussion
Performance was measured using the uncentered Pearson correlation coefficient. The results demonstrate that the effectiveness of TF-IDF weighting varies significantly by language and model variant.
As shown in the results table, the BERT + TF-IDF model dominated the English subtask, achieving a score of 0.774 and securing 1st place out of 14 teams. However, for other languages, standard BERT variants often performed better. For instance, the team reached 2nd place in Finnish using a standard bert-uncased model (0.681). In Croatian and Slovene, bert-cased provided the best results (0.634 and 0.606, respectively).
Conclusion
The Ferryman team's success highlights that traditional statistical methods like TF-IDF can still enhance modern transformer-based architectures. While the TF-IDF weighting provided a substantial boost for English, its inconsistent performance in other languages suggests that linguistic properties or the quality of pre-trained models play a significant role in how statistical weighting interacts with contextual embeddings. Future work will focus on more sophisticated fusion techniques to better integrate statistical importance with transformer attention across diverse languages.
Summary updated