Inferensys

Glossary

Co-occurrence Graph

A network representation where nodes are words or phrases and edges are weighted by their frequency of co-occurrence within a defined sliding window in a text corpus.
Stylish WeWork-like workspace with hot desks and document wall, professional searching through enterprise knowledge base on a mounted ultrawide display, warm industrial pendants overhead.
GRAPH-BASED KEYPHRASE EXTRACTION

What is Co-occurrence Graph?

A co-occurrence graph is a network representation where nodes are words or phrases and edges are weighted by their frequency of co-occurrence within a sliding window, used to identify semantically related terms and extract salient keyphrases from unstructured text.

A co-occurrence graph is a network representation where vertices represent unique words or candidate phrases, and edges are weighted by the frequency with which two terms appear together within a predefined sliding window across a document. This structure captures local syntactic and semantic affinities, transforming linear text into a relational map where the strength of a connection reflects contextual proximity rather than raw frequency alone.

In keyphrase extraction, algorithms like TextRank apply graph-based ranking to this network, iteratively scoring nodes based on their connections to other high-scoring terms until convergence. The resulting centrality scores identify the most salient phrases, effectively surfacing a document's core topics without requiring external corpora or labeled training data.

Structural Properties

Key Characteristics

The defining architectural and algorithmic features that govern how a co-occurrence graph is constructed and utilized for keyphrase extraction.

01

Undirected Weighted Edges

Edges represent a symmetric relationship between two terms, with weights quantifying the strength of their association. The weight is typically the raw count or a normalized metric of how often the two words appear together within a defined sliding window. A higher weight implies a stronger semantic or topical bond, making these edges critical for graph-based ranking algorithms like TextRank.

02

Sliding Window Co-occurrence

The graph is built by scanning text with a fixed-size window (e.g., 2-10 words). An edge is created or its weight incremented every time two words fall within this window. This method captures local syntactic and semantic relationships without requiring deep parsing. The window size is a crucial hyperparameter: smaller windows capture fixed phrases, while larger windows capture broader thematic connections.

03

Stopword-Delimited Candidate Generation

In algorithms like RAKE, the graph is built specifically from content words, using stopwords as natural boundary markers. Candidate keyphrases are sequences of contiguous words that are not separated by a stopword. The co-occurrence graph then links these content words, and the final score of a candidate phrase is derived from the sum of the degrees or weighted degrees of its constituent words.

04

Graph-Based Ranking Centrality

Once constructed, the graph is used to score word importance via centrality algorithms like PageRank or Degree Centrality. A node's score is determined by the number and weight of its connections. In TextRank, a word is important if it is linked to many other important words. The final keyphrase score is often the sum of its constituent word scores, identifying the most salient phrases in the document.

05

Sparse vs. Dense Representation

A co-occurrence graph is a sparse representation of text, capturing explicit, first-order statistical relationships. This contrasts with dense vector embeddings (like BERT), which capture latent semantic similarity. While embeddings excel at synonymy, co-occurrence graphs provide transparent, easily interpretable evidence for why a phrase was selected, based purely on explicit frequency and proximity data.

06

Language and Domain Agnosticism

Since the graph relies solely on token co-occurrence statistics and stopword lists, it is inherently language-agnostic. It requires no pre-trained models, linguistic parsers, or external corpora. This makes it highly effective for domain-specific jargon (e.g., medical or legal text) where pre-trained NLP models may fail to recognize novel compound terms, as it builds a custom statistical model for each input document.

CO-OCCURRENCE GRAPH FAQ

Frequently Asked Questions

Clear, technical answers to common questions about co-occurrence graphs, their construction, and their role in keyphrase extraction and semantic search.

A co-occurrence graph is a network representation where nodes are unique words or phrases, and edges are weighted by the frequency with which those terms appear together within a defined sliding window of text. The graph works by parsing a document, moving a window of N words across the text, and incrementing the edge weight between every pair of terms that falls inside that window. This structure captures the statistical proximity of terms, transforming a linear text into a relational map where highly connected nodes often represent the document's central themes. Algorithms like TextRank then apply graph-based ranking to identify the most salient keyphrases based on their centrality in this network.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.