Latent Semantic Indexing
Latent semantic indexing ranks documents with a rank-k approximation of the term-document matrix computed by singular value decomposition, so that a query also matches documents that share no term with it.
Concepts#
- Singular Value Decompositionfactorisation into column-orthonormal , diagonal and row-orthonormal ; truncation gives the best rank- approximation start here
- LSI Rankingscores documents with the rank- approximation instead of
How it fits together#
Starting point. In the vector space model the term-document matrix ( terms, documents) scores all documents for a query vector at once as . A document only gets a score from the terms it shares with the query.
Factorise, then truncate. The SVD writes with , and , where is the rank of . Some exams write instead, so check which convention the task uses. Keeping the largest singular values gives , the best rank- approximation of . Each of the dimensions is a latent concept: maps terms to concepts, maps documents to concepts.
Ranking. LSI Ranking replaces by . The three ways of computing the scores (approximated matrix , query in concept space, document expansion ) give the same scores, because . They differ in what is precomputed and in cost. is dense even if is sparse, so the factors are stored instead of .
The linear algebra the exams test.
- Rank: is the number of linearly independent rows (or columns) of , hence the number of nonzero singular values and the largest useful . Typical tasks: argue the rank of a small matrix, change few entries to lower or raise it.
- Orthonormality: and , but and are in general not identity matrices (only when resp. ).
- Recovering a factor: from and follows , hence ; the singular values follow from .
- Dimension check for every NumPy expression: , one score per document.
Choosing . Small merges more terms into one concept (more recall for synonyms, less precision). gives back and plain vector-space ranking.
Key Formulas#
- SVD: , , (Singular Value Decomposition)
- Rank- approximation: (Singular Value Decomposition)
- LSI scores: (LSI Ranking)
- Recovering :
Exercises & Exam Questions#
SuccessSolution
Multiply from the left by . Column-orthonormality gives , so . The diagonal entries of are the nonzero singular values, so is invertible, and multiplying by gives . Full solution: DBIS Exam WS2223 (not published).
Exam occurrences#
| Exam | Task | Points | Subtasks |
|---|---|---|---|
| DBIS Exam WS1314 (not published) | Task 4.3–4.4 | 10 of 20 | rank of a term-document matrix, effect of duplicating documents (with k-means) |
| DBIS Exam WS1516 (not published) | Task 5 | 20 | tf.idf term-document matrix, query similarities as a matrix product, matrix_mult |
| DBIS Exam WS1617 (not published) | Task 5 | 20 | show row-orthonormal, compute , rank and adding a column, L2 normalisation |
| DBIS Exam WS1718 (not published) | Task 5 | 20 | compute and of a matrix, compute_V |
| DBIS Exam WS1819 (not published) | Task 5 | 20 | rank with argument, change entries to rank 2 / rank 1, is_row_orthonormal |
| DBIS Exam WS1920 (not published) | Task 5.1 | 5 | which of , is always the identity |
| DBIS Exam WS2122 (not published) | Task 5.1 | 10 | top(q, U, S, V, k): top document with the rank- approximation |
| DBIS Exam WS2223 (not published) | Task 5.1–5.2 | 15 | top(q, A, U, k) with document expansion, prove |
Lectures#
- Not lectured in WS 25/26. The material comes from the past exams of the predecessor course Information Retrieval (see the course
CLAUDE.md).
Related Topics#
- Inverted Index and Ranking — the vector space model and term-document matrix that LSI approximates