Persistent Homology of Text Corpora
Published:
Text as a Topological Space
Consider a text corpus as a finite metric space:
- Points: tokens, sentences, or documents
- Distance: cosine distance in embedding space, or edit distance for sequences
From this metric space, we construct a filtered simplicial complex and compute its persistent homology.
Vietoris-Rips Filtration
For a point cloud \(X\) with distance \(d\):
\[VR_\varepsilon(X) = \{\sigma \subset X : \text{diam}(\sigma) \leq \varepsilon\}\]As \(\varepsilon\) increases from \(0\) to \(\infty\), simplices are added, and homology groups evolve:
\[0 = H_k(VR_0) \to H_k(VR_{\varepsilon_1}) \to \cdots \to H_k(VR_\infty) = H_k(\text{point})\]Persistence Diagrams
For each homological dimension \(k\), we track birth and death times of features:
- \(H_0\): connected components (semantic clusters)
- \(H_1\): cycles (semantic ambiguities, circular relationships)
- \(H_2\): voids (missing information, higher-order gaps)