Evaluating Word Embeddings with Categorical Modularity

Sílvia Casacuberta, Karina Halevy, Damián E. Blasi

TL;DR

This paper introduces "categorical modularity," a novel intrinsic metric to evaluate word embeddings by measuring how well words within semantic categories cluster together in embedding space. This metric shows strong correlations with downstream NLP tasks, suggesting it can predict embedding quality and potentially reflect how language is encoded in the human brain.

What Problem Does This Paper Address?

Evaluating the quality of word embeddings is crucial for their effective use in NLP. Traditional methods fall into two camps: extrinsic (testing performance on downstream tasks) and intrinsic (measuring inherent properties). Extrinsic methods can be costly and don't always reflect true semantic quality, while intrinsic methods often lack a clear link to real-world performance. Furthermore, evaluating embeddings for low-resource languages is particularly challenging due to the scarcity of labeled data for downstream tasks. This paper aims to bridge this gap by proposing a low-resource, intrinsic metric that correlates well with extrinsic performance and offers insights into the cognitive plausibility of embeddings.

Methods

The core innovation is categorical modularity, a graph-based metric. The process involves:

  1. Dataset Creation: A set of 500 English words, categorized into 59 neurobiologically motivated semantic categories across three levels of granularity (e.g., "Artifacts," "Furniture"). These words are translated into 28 other languages.
  2. Graph Construction: For each language and embedding model (FastText, MUSE, subs2vec), a k-nearest neighbor (k-NN) graph is built using the embedding vectors of these 500 words. The "neighbors" are determined by cosine similarity.
  3. Modularity Calculation: The graph's modularity is computed. Modularity quantifies how well a network can be divided into distinct modules or clusters. In this context, high modularity means words within the same semantic category are more likely to be neighbors in the embedding space than words from different categories.
  4. Normalization: The modularity score is normalized to account for category size and graph density.

The authors also compare their method against using "unsupervised clusters" derived directly from the embedding space itself, to demonstrate the value of using pre-defined semantic categories.

Datasets

  • Core Word Set: 500 English words from the Binder et al. (2016) dataset, expanded and balanced across categories.
  • Multilingual Translations: The 500 English words were translated into 28 additional languages.
  • Pre-trained Embeddings: The study used three popular embedding models:
  • FastText: Monolingual embeddings trained on Common Crawl and Wikipedia.
  • MUSE: Cross-lingual embeddings aligning FastText models.
  • subs2vec: Monolingual embeddings trained on subtitle corpora.
  • Downstream Task Datasets:
    • Sentiment Analysis: IMDB Movie Reviews dataset (English), translated into 15 languages.
  • Word Similarity: SemEval-2017 datasets (English, Italian, Spanish), translated into remaining languages.
  • Bilingual Lexicon Induction (BLI): Ground-truth dictionaries provided with the MUSE library.

Key Insights and Ideas

  • Semantic Cohesion Matters: The fundamental idea is that good word embeddings should group semantically related words together. Categorical modularity directly measures this cohesion.
  • Cognitive Alignment: By using neurobiologically motivated categories, the metric aims to assess how well embeddings align with human cognitive structures for language.
  • Low-Resource Viability: The metric is "low-resource" because it relies on a fixed set of words and pre-trained embeddings, not on large amounts of labeled data for specific tasks. This makes it valuable for languages with limited resources.
  • Beyond Unsupervised Clustering: The paper demonstrates that using pre-defined semantic categories (Binder categories) provides more predictive power than clusters discovered directly from the embeddings, suggesting that explicit semantic knowledge is crucial.
  • Model Behavior Insights: The correlations vary across different embedding models, offering clues about their strengths and weaknesses in capturing semantic relationships.

Key Results

  • Strong Correlations with Downstream Tasks: Categorical modularity showed moderate to strong positive Spearman correlations with performance on sentiment analysis, word similarity, and bilingual lexicon induction tasks.
  • Sentiment Analysis: Overall correlation of $\rho = 0.54$ (with optimal hyperparameters).
  • Word Similarity: Overall correlation of $\rho = 0.71$.
  • Bilingual Lexicon Induction (from English): Overall correlation of $\rho = 0.55$.
  • Bilingual Lexicon Induction (to English): Overall correlation of $\rho = 0.5$.
  • Model-Specific Performance: The subs2vec model consistently showed stronger correlations across tasks, particularly for word similarity and BLI, suggesting it might better capture human-like semantic encoding.
  • Unsupervised Clusters Lag: Correlations with unsupervised cluster modularity were significantly lower than with Binder categories, reinforcing the value of the proposed semantic categories. For instance, in sentiment analysis, unsupervised clusters yielded $\rho = 0.09$ compared to $0.54$ for Binder categories.

Limitations and Future Work

  • Hyperparameter Sensitivity: The metric's performance is sensitive to the choice of $k$ (number of neighbors) and the level of semantic granularity.
  • Limited Task Scope: The study focused on three specific downstream tasks (sentiment analysis, word similarity, BLI) and basic models (SVMs, linear regression). Future work could explore multi-class classification, text generation, and more complex neural architectures.
  • Representational Harms: The metric has not yet been shown to reveal representational harms (e.g., biases) inherent in word embeddings.
  • Future Directions:
    • Investigate single-category modularities ($Q_c$) to identify which categories are most predictive.
  • Extend the analysis to more embedding models and languages.
  • Explore contextualized word embeddings and develop lower-resource variants of the metric.
  • Apply the metric to a wider range of NLP tasks and model types.

Summary updated

BibTeX
@inproceedings{casacuberta2021evaluating,
  author = {Sílvia Casacuberta and Karina Halevy and Damián E. Blasi},
  title = {{Evaluating Word Embeddings with Categorical Modularity}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2021},
  url = {https://openreview.net/forum?id=nAV2yGPNayH},
}
Figure