Lesk Algorithm (1983) › The Elegant Solution
History of Language AIAll chapters Lesk Algorithm (1983) › The Elegant SolutionOne section · Sections in this chapter3 / 11 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Lesk's insight was to turn the dictionary itself into a disambiguation tool. Rather than viewing dictionary definitions merely as explanations for humans, he recognized them as semantic fingerprints.unique collections of words that characterized each sense. If you looked up "bank" in a dictionary, the financial institution sense would be defined using words like "money," "account," "deposit," "loan," and "credit," while the riverbank sense would use words like "river," "edge," "shore," "water," and "slope." These definition vocabularies were distinctive precisely because lexicographers had crafted them to distinguish meanings. Lesk realized that by comparing the words in these definitions against the words surrounding an ambiguous term in actual text, a system could measure which sense best "fit" the context.
The algorithm operates through a remarkably straightforward procedure. Given a sentence containing an ambiguous target word, the system first retrieves all dictionary definitions for that word. It then collects the words appearing in a fixed window around the target.perhaps five or ten words on either side. The core computation involves calculating overlaps: for each candidate sense of the target word, the algorithm counts how many words appear in both the sense's dictionary definition and the surrounding context. The sense with the maximum overlap wins. If the context window contains the words "deposits," "guarantee," and "losses," and the financial institution sense of "bank" has a definition mentioning "deposits" and "money," while the riverbank sense has no overlapping words, the financial sense receives a higher score.
This basic version, often called "Simplified Lesk," was just the starting point. Lesk's original formulation included a more sophisticated variant that considered the target word's definitions and the definitions of neighboring words in the context. This created a richer comparison space: the algorithm compared the definition of one sense of "bank" against the definitions of the senses of "guarantee," "deposits," and "losses." When multiple words in the context window had their own polysemy, this approach allowed the algorithm to jointly disambiguate them, selecting sense combinations that showed mutual definitional overlap. The reasoning was direct: related senses of different words should have related definitions and share vocabulary from the same semantic domain.
Let's walk through a concrete example to see the algorithm in action. Consider disambiguating "bank" in "I sat by the bank fishing." Using simplified Lesk with hypothetical definitions:
- Bank (financial): "An institution for receiving, lending, and safeguarding money and facilitating financial transactions."
- Bank (riverbank): "The sloping margin of a watercourse, such as a river or stream."
The context window contains: "sat," "by," "fishing." The financial definition has no overlapping words (overlap = 0). The riverbank definition shares no direct overlap either, but suppose the algorithm expands slightly.if "fishing" appears in definitions related to water activities, and those definitions share words like "river" with the riverbank definition, extended overlaps emerge. More realistically, in the full Lesk algorithm, we'd also look at definitions for "fishing," which would contain words like "catch," "fish," "water," "sport," "angling." The definition of "bank" (riverbank) contains "watercourse," "river," "stream".semantic neighbors of "water" and "fish." While not identical words, the semantic clustering becomes apparent.
The original Lesk algorithm simply counted overlapping words, but numerous refinements have been proposed over the decades. Some variants weight overlaps by word frequency, giving less common words (which are more semantically distinctive) greater influence. Others use squared overlap counts. This emphasized definitions with multiple matching words over those with single matches. Still others expand beyond exact word matches to include morphological variants (fishing/fish/fisher) or semantic relations from resources like WordNet, treating synonyms and hypernyms as partial matches. These variations address a core limitation: dictionary definitions are often quite short, making exact lexical overlap sparse for anything but the most explicitly related contexts.
The algorithm's computational profile was remarkably modest, especially for 1983. Computing overlaps required only string matching and counting.operations any computer could perform efficiently. Unlike syntactic parsing, which required complex grammar rules and search through structural possibilities, or semantic analysis, which demanded expensive inference, Lesk's method scaled linearly with the number of candidate senses and context size. You could disambiguate a thousand-word document in seconds on 1980s hardware. This practicality mattered enormously for early adoption.