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.
Glossary
Co-occurrence Graph

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.
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.
Key Characteristics
The defining architectural and algorithmic features that govern how a co-occurrence graph is constructed and utilized for keyphrase extraction.
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.
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.
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.
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.
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.
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.
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.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Explore the core algorithms, evaluation metrics, and related graph-based ranking techniques that form the foundation of co-occurrence graph analysis for keyphrase extraction.
Graph-based Ranking
A family of algorithms that represent text units as vertices and their semantic or co-occurrence relationships as edges. Salience is determined by structural centrality measures rather than purely statistical frequency.
- PageRank adaptation: Runs on lexical networks to find authoritative nodes
- Vertex centrality: Measures like degree, closeness, and eigenvector centrality identify key terms
- Iterative convergence: Scores propagate through the graph until a stable ranking is achieved
TextRank
A graph-based ranking algorithm that builds a word or phrase co-occurrence network from a document and applies PageRank to identify the most salient keyphrases. It is fully unsupervised and domain-independent.
- Window size: Typically uses a co-occurrence window of 2-10 words to establish edges
- Weighted edges: Edge weights reflect co-occurrence frequency within the sliding window
- Post-processing: Top-ranked words are collapsed into multi-word keyphrases if they appear adjacently in text
RAKE
An unsupervised, domain-independent algorithm that extracts keyphrases by analyzing word co-occurrence within stopword-delimited sequences. It does not require a pre-built graph but constructs an implicit co-occurrence matrix.
- Candidate generation: Splits text on stopwords and punctuation to form contiguous phrase candidates
- Scoring: Each word is scored by its degree (co-occurrence count) divided by its frequency
- Phrase score: Candidate keyphrase score is the sum of its constituent word scores
F1@K
An evaluation metric computing the harmonic mean of precision and recall for the top-K predicted keyphrases against a gold-standard set. It is the primary benchmark for comparing keyphrase extraction systems.
- Precision@K: Proportion of top-K predictions that are correct
- Recall@K: Proportion of all gold-standard keyphrases captured in the top-K
- Stemming matching: Typically uses Porter stemmer to match morphological variants between predictions and ground truth
Candidate Scoring
The process of assigning a numerical weight to each candidate phrase extracted from a co-occurrence graph or statistical model. Scores determine the final ranked output of keyphrases.
- Frequency-based: Term frequency and TF-IDF variants provide baseline salience signals
- Position-based: Phrases appearing early in a document or in section headers receive higher weights
- Graph centrality: Node degree, betweenness, and PageRank scores derived from the co-occurrence structure
Phraseness vs. Informativeness
Two orthogonal scoring dimensions used to evaluate candidate keyphrases. Phraseness measures linguistic well-formedness, while informativeness measures topical relevance.
- Phraseness: Assessed via POS patterns (e.g., adjective-noun sequences) and n-gram probability
- Informativeness: Quantified by TF-IDF, domain specificity (TF-ICF), or semantic similarity to the document centroid
- Combined scoring: Final score often multiplies or linearly combines both dimensions for balanced extraction

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us