NLP: Mathematizing Meaning and Context in Language

This article explores the mathematization of meaning and context in NLP through distributional semantics and contextualized word representations.

Rahul S
5 min readAug 17, 2023


In this article, we uncover various methods used to ascertain the similarity between words and sentences, including lexical similarity, semantic similarity, syntactic similarity, machine learning methods, and hybrid approaches. However, our main focus lies on distributional similarity, a technique that analyzes the contextual patterns in which words or sentences appear.


There are several methods to ascertain similarity between two words or sentences. Here are some common approaches:

1. Lexical Similarity: This method focuses on comparing the words or terms themselves. It can involve techniques such as comparing the spelling, pronunciation, or part-of-speech tags of the words. Measures like edit distance or Levenshtein distance can be used to quantify the difference between two words based on their characters.

2. Semantic Similarity: This approach aims to determine the similarity based on the meaning of words or sentences. It often utilizes techniques from natural language processing and machine learning. Word embeddings, such as Word2Vec or GloVe, represent words in a high-dimensional space, where similar words are closer to each other. Similarity scores can be calculated based on the cosine similarity or Euclidean distance between word embeddings.

3. Distributional Similarity: This method analyzes the context in which words or sentences appear. It assumes that words with similar distributions (i.e., occurring in similar contexts) are likely to have similar meanings. Distributional similarity can be computed using techniques like co-occurrence matrices, pointwise mutual information (PMI), or word vectors trained on large text corpora.

4. Syntactic Similarity: This approach examines the structural similarity between sentences or phrases. It involves parsing the sentences and comparing their syntactic structures, such as dependency trees or phrase structure trees. Similarity can be…