Co-occurrence Analysis — Word Co-occurrence

Machine Learning
Introduced by
J.R. Firth (distributional principle)
Year
1957
Type
Text-mining / distributional-semantics technique

What does it do?

Co-occurrence analysis is a text-mining technique that counts how often word pairs appear together within a defined window or sentence, and uses those counts to map associations and thematic structure in a corpus.

Its basis is the distributional principle attributed to J.R. Firth (1957): words that occur in similar company tend to be related in meaning. The method is exploratory and produces a frequency matrix rather than a tested hypothesis.

The intuition behind the method

Words that repeatedly appear close together are often related in meaning or topic. Rather than reading a corpus document by document, co-occurrence analysis tallies how often each pair of terms falls within the same context and treats those counts as evidence of association. Pairs with high counts can suggest the themes and candidate concept clusters running through the text. The counts record how often two words share a context, so they indicate association but not the nature of the link between them.

History

The approach traces back to the distributional principle attributed to J.R. Firth (1957), which holds that a word's meaning is shaped by the words it appears alongside. Turney and Pantel (2010) survey vector space models of semantics, organised by matrix type into term-document, word-context and pair-pattern matrices. Word-context matrices, which are built from co-occurrence counts, form one of these three classes.

When to use it

Choose co-occurrence analysis when you have a tokenisable text corpus and want to explore which terms relate to each other and what thematic structure they form, without a predefined hypothesis. It fits exploratory, relational questions. Thirty documents is a rule of thumb, not a validated threshold; with much smaller collections the counts are likely to be unstable. Do not use the method to test a directed or causal relation between terms. You will also need to justify your context definition (window, sentence or document level) and your stop-word list, since both shape the result.

Limitations and considerations

  • Results depend on the context definition. A different window size or a sentence boundary produces different pairs and different clusters.
  • Raw counts reward frequent terms, so common words can appear associated with many others unless the preprocessing removes them.
  • It measures association, not direction or causation between the paired words.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • The output is a word-by-word count matrix, so each association can be traced back to the specific pairs that produced it.
  • It needs no labelled data; structure emerges from the text's own co-occurrence patterns.
  • It rests on the distributional principle, so the association it measures has a clear meaning: terms that share contexts.

Applications

  • Building semantic maps and concept networks from a body of documents.
  • Discovering thematic structure in research literature or survey responses.
  • Identifying frequently associated terms in social and business text corpora.
  • Serving as a feature step that feeds distributional semantic models.

How it works

How it works

1

The raw text is tokenised, and stop-words are removed so that mainly content words remain. Without this step, very frequent function words would appear in many pairs and obscure the associations between content words.

2

Before counting, the analyst fixes what counts as 'together'. Two common definitions are used. The first is a sliding window of a chosen size, for example five tokens, or a sentence boundary. The window size is a deliberate parameter. A wider window admits pairs that are further apart and so tends to surface broader topical association, while a narrower window restricts pairs to close neighbours. The second is the document-level definition, in which two terms count as co-occurring when they appear in the same document or record, regardless of their distance within it. The two definitions generally produce different counts and clusters, so the chosen definition should be stated and justified.

3

Within each defined context, co-occurring word pairs are tallied, producing a symmetric word-by-word co-occurrence frequency matrix. Each cell records how often two terms appeared together across the corpus.

4

The frequency matrix is read as a map of associations. Strongly co-occurring terms can suggest candidate concept clusters and themes, and the matrix can be drawn as a co-occurrence network for visual exploration. Raw counts favour frequent terms, because a frequent word tends to co-occur with many others. Before reading a cluster as an association, consider frequency-adjusted association measures and state which one was used. Whether a cluster reflects a genuine theme or an artefact of the window definition or word frequency should be checked against the text itself.

Common pitfalls

  • Leaving function words in the corpus lets their pairs dominate the matrix and hide genuine associations.
  • Choosing a window size without tying it to the research question makes the resulting clusters hard to justify.
  • Reading high co-occurrence as a meaningful relation when it may reflect only the overall frequency of the words.
  • Running the method on a corpus well below the roughly thirty-document rule of thumb produces noisy counts.

Frequently asked questions

How should I choose the context window size?

There is no universal answer; it is a deliberate parameter. A wider window (for example a whole sentence or many tokens) admits pairs that are further apart and tends to surface broader topical association. A narrower window restricts pairs to close neighbours. Choose the size to match the kind of relationship you want to surface, and report the value you used.

Why is stop-word removal so important here?

Function words such as 'the' and 'and' occur alongside almost every other word. Without removing them, the co-occurrence matrix is dominated by uninformative pairs that hide the associations between content words.

Does high co-occurrence mean two words are truly related?

Not necessarily. Strong co-occurrence is evidence of association, but it can also reflect that both words are simply very frequent. The method captures association rather than a directed or causal semantic relation, so interpret clusters with care.

How much text do I need?

Thirty documents is a rule of thumb rather than a validated threshold. With fewer documents, co-occurrence counts become unstable and noisy, and the resulting map is less reliable.

Related methods

Sources

  1. Firth, J.R. (1957). A Synopsis of Linguistic Theory. Studies in Linguistic Analysis. Oxford: Blackwell.

    Open publication reference
  2. Turney, P.D. & Pantel, P. (2010). From Frequency to Meaning: Vector Space Models of Semantics. Journal of Artificial Intelligence Research, 37, 141-188.

    Open DOI reference